Skip to content

models.propulsion.thrust_chamber

machwave.models.propulsion.thrust_chamber

BipropellantInjector

A simple injector class for a liquid rocket engine.

Source code in machwave/models/propulsion/thrust_chamber/injector.py
class BipropellantInjector:
    """
    A simple injector class for a liquid rocket engine.
    """

    def __init__(
        self,
        discharge_coefficient_fuel: float,
        discharge_coefficient_oxidizer: float,
        area_fuel: float,
        area_ox: float,
    ):
        """
        Initialize an Injector instance.

        Args:
            discharge_coefficient_fuel:
                Discharge coefficient for the fuel side (dimensionless).
            discharge_coefficient_oxidizer:
                Discharge coefficient for the oxidizer side (dimensionless).
            area_fuel:
                Effective flow area of the fuel injector [m^2].
            area_ox:
                Effective flow area of the oxidizer injector [m^2].
        """
        self.discharge_coefficient_fuel = discharge_coefficient_fuel
        self.discharge_coefficient_oxidizer = discharge_coefficient_oxidizer
        self.area_fuel = area_fuel
        self.area_ox = area_ox

__init__(discharge_coefficient_fuel, discharge_coefficient_oxidizer, area_fuel, area_ox)

Initialize an Injector instance.

Parameters:

Name Type Description Default
discharge_coefficient_fuel float

Discharge coefficient for the fuel side (dimensionless).

required
discharge_coefficient_oxidizer float

Discharge coefficient for the oxidizer side (dimensionless).

required
area_fuel float

Effective flow area of the fuel injector [m^2].

required
area_ox float

Effective flow area of the oxidizer injector [m^2].

required
Source code in machwave/models/propulsion/thrust_chamber/injector.py
def __init__(
    self,
    discharge_coefficient_fuel: float,
    discharge_coefficient_oxidizer: float,
    area_fuel: float,
    area_ox: float,
):
    """
    Initialize an Injector instance.

    Args:
        discharge_coefficient_fuel:
            Discharge coefficient for the fuel side (dimensionless).
        discharge_coefficient_oxidizer:
            Discharge coefficient for the oxidizer side (dimensionless).
        area_fuel:
            Effective flow area of the fuel injector [m^2].
        area_ox:
            Effective flow area of the oxidizer injector [m^2].
    """
    self.discharge_coefficient_fuel = discharge_coefficient_fuel
    self.discharge_coefficient_oxidizer = discharge_coefficient_oxidizer
    self.area_fuel = area_fuel
    self.area_ox = area_ox

CombustionChamber

Geometry model of a cylindrical combustion-chamber.

Source code in machwave/models/propulsion/thrust_chamber/combustion_chamber.py
class CombustionChamber:
    """Geometry model of a cylindrical combustion-chamber."""

    def __init__(
        self,
        casing_inner_diameter: float,
        casing_outer_diameter: float,
        internal_length: float,
        thermal_liner_thickness: float = 0.0,
    ) -> None:
        """Create a new CombustionChamber instance.

        Args:
            casing_inner_diameter: Internal diameter [m].
            casing_outer_diameter: Outer diameter [m].
            internal_length: Distance from combustion chamber inlet to
                nozzle inlet [m].
            thermal_liner_thickness: Thermal liner thickness [m].
                Defaults to 0.0.
        """
        self.casing_inner_diameter = casing_inner_diameter
        self.casing_outer_diameter = casing_outer_diameter
        self.internal_length = internal_length
        self.thermal_liner_thickness = thermal_liner_thickness

    @property
    def inner_diameter(self) -> float:
        """Inner diameter of the combustion chamber [m]."""
        return self.casing_inner_diameter - 2 * self.thermal_liner_thickness

    @property
    def outer_diameter(self) -> float:
        """Outer diameter of the combustion chamber [m]."""
        return self.casing_outer_diameter

    @property
    def inner_radius(self) -> float:
        """Inner radius of the combustion chamber [m]."""
        return 0.5 * self.inner_diameter

    @property
    def outer_radius(self) -> float:
        """Outer radius of the combustion chamber [m]."""
        return 0.5 * self.outer_radius

    @property
    def internal_volume(self) -> float:
        """Internal volume of the combustion chamber [m^3]."""
        r = self.inner_radius
        return np.pi * r * r * self.internal_length

inner_diameter property

Inner diameter of the combustion chamber [m].

inner_radius property

Inner radius of the combustion chamber [m].

internal_volume property

Internal volume of the combustion chamber [m^3].

outer_diameter property

Outer diameter of the combustion chamber [m].

outer_radius property

Outer radius of the combustion chamber [m].

__init__(casing_inner_diameter, casing_outer_diameter, internal_length, thermal_liner_thickness=0.0)

Create a new CombustionChamber instance.

Parameters:

Name Type Description Default
casing_inner_diameter float

Internal diameter [m].

required
casing_outer_diameter float

Outer diameter [m].

required
internal_length float

Distance from combustion chamber inlet to nozzle inlet [m].

required
thermal_liner_thickness float

Thermal liner thickness [m]. Defaults to 0.0.

0.0
Source code in machwave/models/propulsion/thrust_chamber/combustion_chamber.py
def __init__(
    self,
    casing_inner_diameter: float,
    casing_outer_diameter: float,
    internal_length: float,
    thermal_liner_thickness: float = 0.0,
) -> None:
    """Create a new CombustionChamber instance.

    Args:
        casing_inner_diameter: Internal diameter [m].
        casing_outer_diameter: Outer diameter [m].
        internal_length: Distance from combustion chamber inlet to
            nozzle inlet [m].
        thermal_liner_thickness: Thermal liner thickness [m].
            Defaults to 0.0.
    """
    self.casing_inner_diameter = casing_inner_diameter
    self.casing_outer_diameter = casing_outer_diameter
    self.internal_length = internal_length
    self.thermal_liner_thickness = thermal_liner_thickness

LiquidEngineThrustChamber

Bases: ThrustChamber

Represents the thrust chamber assembly of a liquid rocket engine. This class is a specialization of the ThrustChamber class for liquid rocket engines.

Source code in machwave/models/propulsion/thrust_chamber/base.py
class LiquidEngineThrustChamber(ThrustChamber):
    """
    Represents the thrust chamber assembly of a liquid rocket engine.
    This class is a specialization of the ThrustChamber class for liquid rocket engines.
    """

    def __init__(
        self,
        nozzle: Nozzle,
        injector: BipropellantInjector,
        combustion_chamber: CombustionChamber,
        dry_mass: float,
        center_of_gravity_coordinate: tuple[float, float, float] | None = None,
    ):
        """
        Initialize the LiquidEngineThrustChamber.

        Args:
            nozzle:
                An instance of a Nozzle class.
            injector:
                An instance of an Injector class.
            combustion_chamber:
                An instance of a CombustionChamber class.
            dry_mass:
                The dry mass of the thrust chamber assembly in kg.
            center_of_gravity_coordinate:
                3D position (x, y, z) of the dry mass (hardware) center of gravity,
                measured from the nozzle exit, in meters. Positive x values point toward
                the bulkhead. If None, will be estimated from chamber geometry.
        """
        super().__init__(
            nozzle, combustion_chamber, dry_mass, center_of_gravity_coordinate
        )
        self.injector = injector

__init__(nozzle, injector, combustion_chamber, dry_mass, center_of_gravity_coordinate=None)

Initialize the LiquidEngineThrustChamber.

Parameters:

Name Type Description Default
nozzle Nozzle

An instance of a Nozzle class.

required
injector BipropellantInjector

An instance of an Injector class.

required
combustion_chamber CombustionChamber

An instance of a CombustionChamber class.

required
dry_mass float

The dry mass of the thrust chamber assembly in kg.

required
center_of_gravity_coordinate tuple[float, float, float] | None

3D position (x, y, z) of the dry mass (hardware) center of gravity, measured from the nozzle exit, in meters. Positive x values point toward the bulkhead. If None, will be estimated from chamber geometry.

None
Source code in machwave/models/propulsion/thrust_chamber/base.py
def __init__(
    self,
    nozzle: Nozzle,
    injector: BipropellantInjector,
    combustion_chamber: CombustionChamber,
    dry_mass: float,
    center_of_gravity_coordinate: tuple[float, float, float] | None = None,
):
    """
    Initialize the LiquidEngineThrustChamber.

    Args:
        nozzle:
            An instance of a Nozzle class.
        injector:
            An instance of an Injector class.
        combustion_chamber:
            An instance of a CombustionChamber class.
        dry_mass:
            The dry mass of the thrust chamber assembly in kg.
        center_of_gravity_coordinate:
            3D position (x, y, z) of the dry mass (hardware) center of gravity,
            measured from the nozzle exit, in meters. Positive x values point toward
            the bulkhead. If None, will be estimated from chamber geometry.
    """
    super().__init__(
        nozzle, combustion_chamber, dry_mass, center_of_gravity_coordinate
    )
    self.injector = injector

Nozzle

Source code in machwave/models/propulsion/thrust_chamber/nozzle.py
class Nozzle:
    def __init__(
        self,
        inlet_diameter,
        throat_diameter,
        divergent_angle,
        convergent_angle,
        expansion_ratio,
        material,
    ) -> None:
        self.inlet_diameter = inlet_diameter
        self.throat_diameter = throat_diameter
        self.divergent_angle = divergent_angle
        self.convergent_angle = convergent_angle
        self.expansion_ratio = expansion_ratio
        self.material = material

    @property
    def outlet_diameter(self):
        return self.inlet_diameter * np.sqrt(self.expansion_ratio)

    def get_throat_area(self):
        return get_circle_area(self.throat_diameter)

    def get_nozzle_wall_thickness(
        self,
        chamber_pressure: float,
        safety_factor: float,
        chamber_inner_diameter: float,
        wall_angle: float,
    ) -> float:
        """
        Considers thin wall approximation.
        """
        return (chamber_pressure * chamber_inner_diameter / 2) / (
            self.material.yield_strength / safety_factor
            - 0.6 * chamber_pressure * (np.cos(np.deg2rad(wall_angle)))
        )

    def get_nozzle_thickness(
        self,
        chamber_pressure: float,
        safety_factor: float,
    ):
        """
        Returns nozzle convergent and divergent thickness.
        """
        nozzle_conv_thickness = self.get_nozzle_wall_thickness(
            chamber_pressure,
            safety_factor,
            self.inlet_diameter,
            self.convergent_angle,
        )

        nozzle_div_thickness = self.get_nozzle_wall_thickness(
            chamber_pressure,
            safety_factor,
            self.inlet_diameter,
            self.divergent_angle,
        )

        return nozzle_conv_thickness, nozzle_div_thickness

get_nozzle_thickness(chamber_pressure, safety_factor)

Returns nozzle convergent and divergent thickness.

Source code in machwave/models/propulsion/thrust_chamber/nozzle.py
def get_nozzle_thickness(
    self,
    chamber_pressure: float,
    safety_factor: float,
):
    """
    Returns nozzle convergent and divergent thickness.
    """
    nozzle_conv_thickness = self.get_nozzle_wall_thickness(
        chamber_pressure,
        safety_factor,
        self.inlet_diameter,
        self.convergent_angle,
    )

    nozzle_div_thickness = self.get_nozzle_wall_thickness(
        chamber_pressure,
        safety_factor,
        self.inlet_diameter,
        self.divergent_angle,
    )

    return nozzle_conv_thickness, nozzle_div_thickness

get_nozzle_wall_thickness(chamber_pressure, safety_factor, chamber_inner_diameter, wall_angle)

Considers thin wall approximation.

Source code in machwave/models/propulsion/thrust_chamber/nozzle.py
def get_nozzle_wall_thickness(
    self,
    chamber_pressure: float,
    safety_factor: float,
    chamber_inner_diameter: float,
    wall_angle: float,
) -> float:
    """
    Considers thin wall approximation.
    """
    return (chamber_pressure * chamber_inner_diameter / 2) / (
        self.material.yield_strength / safety_factor
        - 0.6 * chamber_pressure * (np.cos(np.deg2rad(wall_angle)))
    )

SolidMotorThrustChamber

Bases: ThrustChamber

Source code in machwave/models/propulsion/thrust_chamber/base.py
class SolidMotorThrustChamber(ThrustChamber):
    def __init__(
        self,
        nozzle: Nozzle,
        combustion_chamber: CombustionChamber,
        dry_mass: float,
        nozzle_exit_to_grain_port_distance: float,
        center_of_gravity_coordinate: tuple[float, float, float] | None = None,
    ):
        """
        Initialize the SolidMotorThrustChamber.

        Args:
            nozzle:
                An instance of a Nozzle class.
            combustion_chamber:
                An instance of a CombustionChamber class.
            dry_mass:
                The dry mass of the thrust chamber assembly in kg.
            nozzle_exit_to_grain_port_distance:
                Axial distance from nozzle exit plane to the grain port [m].
            center_of_gravity_coordinate:
                3D position (x, y, z) of the dry mass (hardware) center of gravity,
                measured from the nozzle exit, in meters. Positive x values point toward
                the bulkhead. If None, will be estimated from chamber geometry.
        """
        super().__init__(
            nozzle, combustion_chamber, dry_mass, center_of_gravity_coordinate
        )
        self.nozzle_exit_to_grain_port_distance = nozzle_exit_to_grain_port_distance

__init__(nozzle, combustion_chamber, dry_mass, nozzle_exit_to_grain_port_distance, center_of_gravity_coordinate=None)

Initialize the SolidMotorThrustChamber.

Parameters:

Name Type Description Default
nozzle Nozzle

An instance of a Nozzle class.

required
combustion_chamber CombustionChamber

An instance of a CombustionChamber class.

required
dry_mass float

The dry mass of the thrust chamber assembly in kg.

required
nozzle_exit_to_grain_port_distance float

Axial distance from nozzle exit plane to the grain port [m].

required
center_of_gravity_coordinate tuple[float, float, float] | None

3D position (x, y, z) of the dry mass (hardware) center of gravity, measured from the nozzle exit, in meters. Positive x values point toward the bulkhead. If None, will be estimated from chamber geometry.

None
Source code in machwave/models/propulsion/thrust_chamber/base.py
def __init__(
    self,
    nozzle: Nozzle,
    combustion_chamber: CombustionChamber,
    dry_mass: float,
    nozzle_exit_to_grain_port_distance: float,
    center_of_gravity_coordinate: tuple[float, float, float] | None = None,
):
    """
    Initialize the SolidMotorThrustChamber.

    Args:
        nozzle:
            An instance of a Nozzle class.
        combustion_chamber:
            An instance of a CombustionChamber class.
        dry_mass:
            The dry mass of the thrust chamber assembly in kg.
        nozzle_exit_to_grain_port_distance:
            Axial distance from nozzle exit plane to the grain port [m].
        center_of_gravity_coordinate:
            3D position (x, y, z) of the dry mass (hardware) center of gravity,
            measured from the nozzle exit, in meters. Positive x values point toward
            the bulkhead. If None, will be estimated from chamber geometry.
    """
    super().__init__(
        nozzle, combustion_chamber, dry_mass, center_of_gravity_coordinate
    )
    self.nozzle_exit_to_grain_port_distance = nozzle_exit_to_grain_port_distance

ThrustChamber

Bases: ABC

Represents the thrust chamber assembly of a liquid rocket engine. ThrustChamber acts as a coordinating layer that ties these elements together.

Source code in machwave/models/propulsion/thrust_chamber/base.py
class ThrustChamber(abc.ABC):
    """
    Represents the thrust chamber assembly of a liquid rocket engine.
    ThrustChamber acts as a coordinating layer that ties these elements together.
    """

    def __init__(
        self,
        nozzle: Nozzle,
        combustion_chamber: CombustionChamber,
        dry_mass: float,
        center_of_gravity_coordinate: tuple[float, float, float] | None = None,
    ):
        """
        Initialize the ThrustChamber.

        Args:
            nozzle:
                An instance of a Nozzle class.
            combustion_chamber:
                An instance of a CombustionChamber class.
            dry_mass:
                The dry mass of the thrust chamber assembly in kg.
            center_of_gravity_coordinate:
                3D position (x, y, z) of the dry mass (hardware) center of gravity,
                measured from the nozzle exit, in meters. Positive x values point toward
                the bulkhead. If None, will be estimated from chamber geometry.
        """
        self.nozzle = nozzle
        self.combustion_chamber = combustion_chamber
        self.dry_mass = dry_mass
        self.center_of_gravity_coordinate = (
            np.array(center_of_gravity_coordinate, dtype=np.float64)
            if center_of_gravity_coordinate is not None
            else None
        )

__init__(nozzle, combustion_chamber, dry_mass, center_of_gravity_coordinate=None)

Initialize the ThrustChamber.

Parameters:

Name Type Description Default
nozzle Nozzle

An instance of a Nozzle class.

required
combustion_chamber CombustionChamber

An instance of a CombustionChamber class.

required
dry_mass float

The dry mass of the thrust chamber assembly in kg.

required
center_of_gravity_coordinate tuple[float, float, float] | None

3D position (x, y, z) of the dry mass (hardware) center of gravity, measured from the nozzle exit, in meters. Positive x values point toward the bulkhead. If None, will be estimated from chamber geometry.

None
Source code in machwave/models/propulsion/thrust_chamber/base.py
def __init__(
    self,
    nozzle: Nozzle,
    combustion_chamber: CombustionChamber,
    dry_mass: float,
    center_of_gravity_coordinate: tuple[float, float, float] | None = None,
):
    """
    Initialize the ThrustChamber.

    Args:
        nozzle:
            An instance of a Nozzle class.
        combustion_chamber:
            An instance of a CombustionChamber class.
        dry_mass:
            The dry mass of the thrust chamber assembly in kg.
        center_of_gravity_coordinate:
            3D position (x, y, z) of the dry mass (hardware) center of gravity,
            measured from the nozzle exit, in meters. Positive x values point toward
            the bulkhead. If None, will be estimated from chamber geometry.
    """
    self.nozzle = nozzle
    self.combustion_chamber = combustion_chamber
    self.dry_mass = dry_mass
    self.center_of_gravity_coordinate = (
        np.array(center_of_gravity_coordinate, dtype=np.float64)
        if center_of_gravity_coordinate is not None
        else None
    )