models.motors¶
Top-level motor/engine definitions that assemble all physical sub-components into a complete propulsion unit.
SolidMotor— Combines aGrain,SolidPropellant, andSolidMotorThrustChamber. Provides launch/dry mass, free chamber volume, CoG (mass-weighted across grain and hardware), and thrust coefficient with loss corrections.LiquidEngine— Combines aBiliquidPropellant,LiquidEngineThrustChamber, andFeedSystem. Tracks CoG shift as propellant is consumed from the tanks.
Both inherit from the generic Motor[P, T] base class. A motor instance is the primary input to InternalBallisticsSimulation.
machwave.models.motors
¶
LiquidEngine
¶
Bases: Motor[BiliquidPropellant, LiquidEngineThrustChamber]
Source code in machwave/models/motors/liquid.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | |
initial_propellant_mass
property
¶
Returns the initial propellant mass in kg.
__init__(propellant, thrust_chamber, feed_system, oxidizer_tank_cog=None, fuel_tank_cog=None)
¶
Initialize a liquid rocket engine.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
propellant
|
BiliquidPropellant
|
Bi-liquid propellant properties (oxidizer + fuel). |
required |
thrust_chamber
|
LiquidEngineThrustChamber
|
Thrust chamber assembly (nozzle + combustion chamber + injector). |
required |
feed_system
|
FeedSystem
|
Propellant feed system (tanks, lines, pumps/pressurization). |
required |
oxidizer_tank_cog
|
float | None
|
Axial position of the oxidizer tank center (where propellant CoG is), measured from the nozzle exit, in meters. If None, uses a default estimate. |
None
|
fuel_tank_cog
|
float | None
|
Axial position of the fuel tank center (where propellant CoG is), measured from the nozzle exit, in meters. If None, uses a default estimate. |
None
|
Source code in machwave/models/motors/liquid.py
get_center_of_gravity(propellant_fraction=0.0)
¶
Calculate the center of gravity of the liquid engine including structural dry mass, oxidizer, and fuel.
The calculation uses a mass-weighted average of: 1. Structural dry mass (thrust chamber, tanks structure, feed lines, etc.) 2. Oxidizer mass (from oxidizer tank) 3. Fuel mass (from fuel tank)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
propellant_fraction
|
float
|
Fraction of propellant consumed (0.0 = full, 1.0 = empty). |
0.0
|
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
Center of gravity in 3D space [x, y, z], in meters. |
NDArray[float64]
|
Origin is at the nozzle exit on the chamber axis. |
NDArray[float64]
|
Positive x-direction points forward (toward bulkhead/away from nozzle exit). |
Raises:
| Type | Description |
|---|---|
ValueError
|
If thrust_chamber.center_of_gravity_coordinate, oxidizer_tank_cog, or fuel_tank_cog is not defined. |
Source code in machwave/models/motors/liquid.py
get_thrust_coefficient(chamber_pressure, exit_pressure, external_pressure, expansion_ratio, k_exhaust, other_losses)
¶
Get thrust coefficient.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chamber_pressure
|
float
|
Chamber pressure [Pa]. |
required |
exit_pressure
|
float
|
Exit pressure [Pa]. |
required |
external_pressure
|
float
|
External pressure [Pa]. |
required |
expansion_ratio
|
float
|
Expansion ratio. |
required |
k_exhaust
|
float
|
Two-phase isentropic coefficient. |
required |
other_losses
|
float
|
Additional losses not covered by specific mechanisms, as a fraction in [0, 1]. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Instantaneous thrust coefficient. |
Source code in machwave/models/motors/liquid.py
Motor
¶
Bases: Generic[P, T], ABC
Abstract rocket motor/engine class. Can be used to model any chemical rocket propulsion system, such as Solid, Hybrid and Liquid.
Source code in machwave/models/motors/base.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |
initial_propellant_mass
abstractmethod
property
¶
Returns:
| Type | Description |
|---|---|
float
|
Initial propellant mass, in kg |
__init__(propellant, thrust_chamber)
¶
Instantiates object attributes common to any motor/engine (Solid, Hybrid or Liquid).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
propellant
|
P
|
Object representing the propellant used in the motor. |
required |
thrust_chamber
|
T
|
Object representing the thrust chamber of the motor. |
required |
Source code in machwave/models/motors/base.py
get_center_of_gravity(*args, **kwargs)
abstractmethod
¶
Calculate the center of gravity of the propulsion system.
The coordinate system origin corresponds to the combustion chamber axis at the nozzle exit plane, with positive x pointing toward the bulkhead.
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
A 1D array of shape (3,) representing the [x, y, z] coordinates of |
NDArray[float64]
|
the center of gravity, in meters. |
Source code in machwave/models/motors/base.py
get_dry_mass()
abstractmethod
¶
Calculates the dry mass of the rocket at any time.
Returns:
| Type | Description |
|---|---|
float
|
Dry mass of the rocket, in kg |
get_launch_mass()
abstractmethod
¶
Calculates the total mass of the motor before launch.
Returns:
| Type | Description |
|---|---|
float
|
Total mass of the motor before launch, in kg |
get_thrust(cf, chamber_pressure)
¶
Calculates the thrust based on instantaneous thrust coefficient and chamber pressure.
Utilized nozzle throat area from the structure and nozzle classes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cf
|
float
|
Instantaneous thrust coefficient, adimensional |
required |
chamber_pressure
|
float
|
Instantaneous chamber pressure, in Pa |
required |
Returns:
| Type | Description |
|---|---|
float
|
Instantaneous thrust, in Newtons |
Source code in machwave/models/motors/base.py
get_thrust_coefficient(*args, **kwargs)
abstractmethod
¶
Calculates the thrust coefficient at a particular instant.
Returns:
| Type | Description |
|---|---|
float
|
Thrust coefficient |
get_thrust_coefficient_correction_factor(other_losses)
¶
Calculates the thrust coefficient correction factor. This factor is adimensional and should be applied to the ideal thrust coefficient to get the real thrust coefficient.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other_losses
|
float
|
Additional losses not covered by specific mechanisms, as a fraction in [0, 1]. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Thrust coefficient correction factor |
Source code in machwave/models/motors/base.py
SolidMotor
¶
Bases: Motor[SolidPropellant, SolidMotorThrustChamber]
Source code in machwave/models/motors/solid.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | |
initial_propellant_mass
property
¶
Returns:
| Type | Description |
|---|---|
float
|
Initial propellant mass, in kg |
__init__(grain, propellant, thrust_chamber)
¶
Initialize a solid rocket motor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
grain
|
Grain
|
Grain geometry configuration. |
required |
propellant
|
SolidPropellant
|
Solid propellant properties. |
required |
thrust_chamber
|
SolidMotorThrustChamber
|
Thrust chamber model. |
required |
Source code in machwave/models/motors/solid.py
get_center_of_gravity(web_distance=0.0)
¶
Calculates the center of gravity of the solid motor including propellant grain (wet mass) and dry mass.
The calculation uses a mass-weighted average of: 1. Propellant grain CoG; 2. Thrust chamber dry mass CoG, considered constant.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
web_distance
|
float
|
Web distance traveled [m]. Defaults to ignition state. |
0.0
|
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
Center of gravity in 3D space (x, y, z) [m]. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If thrust chamber dry mass CoG is not defined or if total mass is less than or equal to zero. |
Source code in machwave/models/motors/solid.py
get_free_chamber_volume(propellant_volume)
¶
Calculates the chamber volume without any propellant.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
propellant_volume
|
float
|
Propellant volume, in m^3 |
required |
Returns:
| Type | Description |
|---|---|
float
|
Free chamber volume, in m^3 |
Source code in machwave/models/motors/solid.py
get_thrust_coefficient(chamber_pressure, exit_pressure, external_pressure, expansion_ratio, k_exhaust, nozzle_correction_factor)
¶
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chamber_pressure
|
float
|
Chamber pressure, in Pa |
required |
exit_pressure
|
float
|
Exit pressure, in Pa |
required |
external_pressure
|
float
|
External pressure, in Pa |
required |
expansion_ratio
|
float
|
Expansion ratio, adimensional |
required |
k_exhaust
|
float
|
Two-phase isentropic coefficient, adimensional |
required |
nozzle_correction_factor
|
float
|
Thrust coefficient correction factor, adimensional |
required |
Returns:
| Type | Description |
|---|---|
float
|
Instanteneous thrust coefficient, adimensional |