models.propellants¶
Propellant definition and thermochemical evaluation. A propellant is built from PropellantComponent instances (each with a chemical formula, density, enthalpy, and role), then evaluated at operating conditions via NASA CEA to obtain γ, molecular weight, adiabatic flame temperature, Isp, and condensed-phase fractions.
Submodules:
- categories —
SolidPropellant(with St. Robert’s burn rate law) andBiliquidPropellant(with O/F ratio) - formulations — Ready-to-use propellant instances and JSON loader
machwave.models.propellants
¶
Propellant models and components.
BiliquidPropellant
¶
Bases: Propellant
Biliquid propellant with separate oxidizer and fuel.
Source code in machwave/models/propellants/categories/biliquid.py
__init__(name, components=None, oxidizer_to_fuel_ratio=None)
¶
Initialize biliquid propellant.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Propellant name. |
required |
components
|
list[PropellantComponent] | None
|
Chemical components (should be exactly 2: oxidizer and fuel). |
None
|
oxidizer_to_fuel_ratio
|
float | None
|
Oxidizer-to-fuel mass ratio for this
formulation. Used as the default mixture_ratio at the
thermochemical service layer; callers can override per-call
via |
None
|
Raises:
| Type | Description |
|---|---|
PropellantValidationError
|
If components do not include exactly one oxidizer and one fuel. |
Source code in machwave/models/propellants/categories/biliquid.py
ComponentRole
¶
Bases: StrEnum
Role of a chemical component in the propellant formulation.
Source code in machwave/models/propellants/components.py
MixtureType
¶
Propellant
¶
Bases: ABC
Base class for propellant formulations.
Source code in machwave/models/propellants/categories/base.py
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 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | |
has_condensed_phase
property
¶
Whether this propellant can form a condensed combustion phase.
A propellant built solely from elements in GASEOUS_ONLY_ELEMENTS cannot form a
condensed phase.
thermochemical_service
cached
property
¶
Get thermochemical service, cached.
__init__(name, components=None)
¶
Initialize a propellant.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Propellant name. |
required |
components
|
list[PropellantComponent] | None
|
Chemical components. If None, defaults to empty list. |
None
|
Source code in machwave/models/propellants/categories/base.py
evaluate(chamber_pressure, expansion_ratio=8.0, mixture_ratio=None)
¶
Evaluate thermochemical properties at given conditions.
Chamber pressure is quantized to CHAMBER_PRESSURE_QUANTIZATION_PA and
mixture ratio to MIXTURE_RATIO_QUANTIZATION; the result is cached per
(chamber_pressure, expansion_ratio, mixture_ratio).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chamber_pressure
|
float
|
Chamber pressure [Pa]. |
required |
expansion_ratio
|
float
|
Nozzle area ratio (Ae/At). |
8.0
|
mixture_ratio
|
float | None
|
Ratio of the propellant mixture. |
None
|
Returns:
| Type | Description |
|---|---|
ThermochemicalProperties
|
ThermochemicalProperties. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If evaluation fails. |
Source code in machwave/models/propellants/categories/base.py
PropellantComponent
dataclass
¶
Chemical component of a propellant formulation.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Component name (i.e., "KNO3", "LOX", "HTPB"). |
role |
ComponentRole
|
Component role (oxidizer, fuel, additive). |
density |
float
|
Component density [kg/m^3]. |
chemical_formula |
dict[str, int]
|
Element symbols to atom counts (i.e., {"H": 2, "O": 1}). |
enthalpy |
float
|
Standard enthalpy of formation [J/mol]. |
initial_temperature |
float
|
Initial component temperature before combustion [K]. |
Source code in machwave/models/propellants/components.py
to_cea_dict(*, weight_percent)
¶
Convert component to CEA-compatible dictionary format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
weight_percent
|
float
|
Component weight percent in the mixture [%]. |
required |
Returns:
| Type | Description |
|---|---|
dict
|
CEA format with name, formula, weight_percent, |
dict
|
heat_of_formation (cal/mol), temperature [K], and density [g/cc]. |
Source code in machwave/models/propellants/components.py
SolidPropellant
¶
Bases: Propellant
Solid propellant with burn rate model.
Source code in machwave/models/propellants/categories/solid.py
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 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | |
ideal_density
property
¶
Return the ideal propellant density [kg/m^3] for solid mixtures.
Uses a harmonic mean based on solid mixture mass fractions.
properties
property
¶
Expose pre-defined thermochemical properties when present.
__init__(name, components=None, mass_fractions=None, properties=None, burn_rate_map=None)
¶
Initialize a solid propellant.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Propellant name. |
required |
components
|
list[PropellantComponent] | None
|
Chemical components. Required; must contain at least one oxidizer and one fuel. |
None
|
mass_fractions
|
list[float] | None
|
Mass fractions aligned with |
None
|
properties
|
ThermochemicalProperties | None
|
Pre-defined thermochemical properties. Optional
override used by |
None
|
burn_rate_map
|
list[dict[str, float | int]] | None
|
Saint Robert's law coefficients by pressure range. |
None
|
Raises:
| Type | Description |
|---|---|
PropellantValidationError
|
If components, mass_fractions, or their relationship is invalid. |
Source code in machwave/models/propellants/categories/solid.py
evaluate(chamber_pressure, expansion_ratio=8.0, mixture_ratio=None)
¶
Evaluate thermochemical properties.
If properties are pre-defined, returns them directly. Otherwise, evaluates using the thermochemical service via the parent class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chamber_pressure
|
float
|
Chamber pressure [Pa]. |
required |
expansion_ratio
|
float
|
Nozzle area expansion ratio (Ae/At). |
8.0
|
mixture_ratio
|
float | None
|
Per-call mixture ratio override. Unused for solid formulations; accepted for parent-class compatibility. |
None
|
Returns:
| Type | Description |
|---|---|
ThermochemicalProperties
|
Pre-defined or calculated properties. |
Raises:
| Type | Description |
|---|---|
PropellantValidationError
|
If evaluation fails. |
Source code in machwave/models/propellants/categories/solid.py
get_burn_rate(chamber_pressure)
¶
Return the instantaneous burn rate of the solid propellant.
Uses Saint Robert's law r = a * P^n, where r is burn rate [m/s],
P is chamber pressure [MPa], and a, n are empirical coefficients
drawn from burn_rate_map.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chamber_pressure
|
float
|
Chamber pressure [Pa]. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Burn rate [m/s]. |
Raises:
| Type | Description |
|---|---|
BurnRateOutOfBoundsError
|
If pressure is outside the valid range. |
PropellantValidationError
|
If the burn rate model is not defined. |
Source code in machwave/models/propellants/categories/solid.py
ThermochemicalProperties
dataclass
¶
Thermochemical properties of chemical-rocket combustion products.
Attributes:
| Name | Type | Description |
|---|---|---|
k_chamber |
float
|
Isentropic exponent in chamber. |
k_exhaust |
float
|
Isentropic exponent at nozzle exit. |
adiabatic_flame_temperature |
float
|
Ideal combustion temperature [K]. |
molecular_weight_chamber |
float
|
Molecular weight in chamber [kg/mol]. |
molecular_weight_exhaust |
float
|
Molecular weight at exit [kg/mol]. |
i_sp_frozen |
float
|
Frozen flow specific impulse [s]. |
i_sp_shifting |
float
|
Shifting equilibrium specific impulse [s]. |
qsi_chamber |
float
|
Condensed phase species content in chamber. |
qsi_exhaust |
float
|
Condensed phase species content at exit. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If any parameter is outside a valid range. |
Source code in machwave/models/propellants/properties.py
R_chamber
cached
property
¶
Specific gas constant for chamber [J/(kg-K)].
R_exhaust
cached
property
¶
Specific gas constant for exhaust [J/(kg-K)].
is_two_phase_flow
cached
property
¶
Check if combustion products have condensed phase species.
Returns:
| Type | Description |
|---|---|
bool
|
True if qsi_chamber > 0 or qsi_exhaust > 0. |
__post_init__()
¶
Validate all properties are within physical bounds.