models.feed_systems.cycles¶
Concrete feed-system cycle implementations. A cycle is the topology that determines how propellant is pressurised on its way from the tanks to the injector — pressure stored in the tanks themselves, electrically driven pumps, turbine-driven pumps powered by a small bleed-off combustor, and so on. Each module in this sub-package implements one topology and conforms to the FeedSystem contract so the simulation loop can treat them interchangeably.
Available cycles¶
StackedTankPressureFedFeedSystem— Pressure-fed engine with the oxidizer tank stacked directly above a piston-separated fuel tank. Tank pressure provides both propellants' driving head.SingleLinePressureFedFeedSystem— Pressure-fed engine feeding one line, which the tank pressurizes itself. The one-line case of the contract: an oxidizer-only hybrid feed or a monoliquid.
The cycle reads tank state through the PropellantLine instances it was constructed with, and combines that state with any component specs it owns to say what reaches the injector face. The simulation step lives in BiliquidEngineState.run_timestep, which calls get_inlet_states once per integration step and hands the results to the Injector at each chamber pressure the solver tries.
StackedTankPressureFedFeedSystem¶
A pressure-fed engine whose propellant tanks are arranged as a single vertical stack separated by a piston. The tank at the top of the stack — pressurizing_line — pressurises every propellant: directly for its own line, and through the piston for every line below it. Pressure loss across the piston is captured by piston_loss, and each feedline takes what line_losses states for it.
Construction
The two-line case a biliquid engine runs on has a convenience constructor, which names the lines "oxidizer" and "fuel":
from machwave.models.feed_systems import StackedTankPressureFedFeedSystem
from machwave.models.feed_systems.tank import Tank
feed_system = StackedTankPressureFedFeedSystem.from_oxidizer_and_fuel(
oxidizer_tank=Tank("N2O", volume=0.010, temperature=298.0, initial_fluid_mass=5.0),
fuel_tank=Tank("Ethanol", volume=0.008, temperature=298.0, initial_fluid_mass=3.0),
piston_loss=0.0, # Pa
oxidizer_line_loss=2e5, # Pa
fuel_line_loss=2e5, # Pa
)
Any other propellant count is built from the lines themselves — here a triliquid with a diluent below the piston:
from machwave.models.feed_systems import PropellantLine, StackedTankPressureFedFeedSystem
from machwave.models.propellants import ComponentRole
feed_system = StackedTankPressureFedFeedSystem(
lines=[
PropellantLine(name="oxidizer", role=ComponentRole.OXIDIZER, tank=oxidizer_tank),
PropellantLine(name="fuel", role=ComponentRole.FUEL, tank=fuel_tank),
PropellantLine(name="diluent", role=ComponentRole.ADDITIVE, tank=diluent_tank),
],
pressurizing_line="oxidizer",
piston_loss=1e5,
line_losses={"oxidizer": 2e5, "fuel": 2e5, "diluent": 1e5},
)
Mass-flow model. The feed system supplies the inlet state of every line and the injector does the orifice dispatch. Inlet pressure is the pressurizing tank pressure for its own line and that pressure less piston_loss for every line below the piston, each less its own feedline loss; downstream pressure is chamber_pressure. Inlet density comes from Tank.get_density. The injector picks the orifice model per line from its MassFlowModel.
line_losses is a fixed pressure drop per line, not a function of flow.
SingleLinePressureFedFeedSystem¶
One propellant line, pressurized by its own tank: a self-pressurized propellant rides its vapor pressure while liquid remains, then blows down on the real-gas equation of state. What reaches the injector is that pressure less line_loss. An empty tank delivers nothing, which stops the flow at the injector element.
Construction
from machwave.models.feed_systems import SingleLinePressureFedFeedSystem
from machwave.models.feed_systems.tank import Tank
feed_system = SingleLinePressureFedFeedSystem.from_oxidizer_tank(
oxidizer_tank=Tank("N2O", volume=0.010, temperature=298.0, initial_fluid_mass=5.0),
line_loss=2e5, # Pa
)
A monoliquid names its own line and role instead, through the PropellantLine constructor.
machwave.models.feed_systems.cycles
¶
Concrete feed-system cycle implementations.
Each module in this package implements one cycle topology (pressure-fed,
electric-pump, gas-generator, expander, staged combustion, ...). Cycles consume
the shared component specifications in machwave.models.feed_systems.components
and conform to the machwave.models.feed_systems.base.FeedSystem contract.
SingleLinePressureFedFeedSystem
¶
Bases: FeedSystem
Pressure-fed feed system delivering a single propellant line.
The tank pressurizes itself: a self-pressurized propellant rides its own vapor pressure while liquid remains, and blows down on the real-gas equation of state once none does. This is the one-line case of the feed system contract, which an oxidizer-only hybrid feed and a monoliquid engine both run on.
Source code in machwave/models/feed_systems/cycles/single_line_pressure_fed.py
line
property
¶
The one line the system feeds.
__init__(line, line_loss=0.0)
¶
Initialize the SingleLinePressureFedFeedSystem.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
line
|
PropellantLine
|
The propellant line the system feeds. |
required |
line_loss
|
float
|
Pressure loss along the feedline [Pa], stated for the design flow rather than computed from it. |
0.0
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the pressure loss is negative. |
Source code in machwave/models/feed_systems/cycles/single_line_pressure_fed.py
from_oxidizer_tank(*, oxidizer_tank, line_loss=0.0)
classmethod
¶
Build the oxidizer-only system a hybrid motor runs on.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
oxidizer_tank
|
Tank
|
Tank the oxidizer line draws from. |
required |
line_loss
|
float
|
Pressure loss along the feedline [Pa]. |
0.0
|
Source code in machwave/models/feed_systems/cycles/single_line_pressure_fed.py
get_inlet_pressures(line_states)
¶
Return the tank pressure less the feedline loss [Pa], keyed by line name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
line_states
|
Mapping[str, LineState]
|
Fluid mass and internal energy of the line, keyed by line name. |
required |
Source code in machwave/models/feed_systems/cycles/single_line_pressure_fed.py
StackedTankPressureFedFeedSystem
¶
Bases: FeedSystem
Pressure-fed feed system whose propellant tanks are stacked vertically.
The tank at the top of the stack pressurizes every tank below it through a piston, so one tank sets the pressure the whole system runs on.
Source code in machwave/models/feed_systems/cycles/stacked_tank_pressure_fed.py
9 10 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 | |
__init__(lines, pressurizing_line, piston_loss=0.0, line_losses=None)
¶
Initialize the StackedTankPressureFedFeedSystem.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lines
|
Sequence[PropellantLine]
|
Propellant lines the system feeds, one per propellant. |
required |
pressurizing_line
|
str
|
Name of the line at the top of the stack, whose tank pressure drives every line. |
required |
piston_loss
|
float
|
Pressure loss across the piston [Pa], taken by every line below the top of the stack. |
0.0
|
line_losses
|
Mapping[str, float] | None
|
Pressure loss along each feedline [Pa], keyed by line name and stated for the design flow rather than computed from it. A line left out takes no loss. |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the pressurizing line is not one of the lines, if a loss is keyed by an unknown line, or if any pressure loss is negative. |
Source code in machwave/models/feed_systems/cycles/stacked_tank_pressure_fed.py
from_oxidizer_and_fuel(*, oxidizer_tank, fuel_tank, piston_loss=0.0, oxidizer_line_loss=0.0, fuel_line_loss=0.0)
classmethod
¶
Build the two-line system a biliquid engine runs on.
The oxidizer sits at the top of the stack and pressurizes the fuel through the piston. The lines are named "oxidizer" and "fuel", which is how the injector and the simulation state key them.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
oxidizer_tank
|
Tank
|
Tank the oxidizer line draws from. |
required |
fuel_tank
|
Tank
|
Tank the fuel line draws from. |
required |
piston_loss
|
float
|
Pressure loss across the piston [Pa]. |
0.0
|
oxidizer_line_loss
|
float
|
Pressure loss along the oxidizer feedline [Pa]. |
0.0
|
fuel_line_loss
|
float
|
Pressure loss along the fuel feedline [Pa]. |
0.0
|
Source code in machwave/models/feed_systems/cycles/stacked_tank_pressure_fed.py
get_inlet_pressures(line_states)
¶
Return the pressure delivered to the injector on every line [Pa].
The line at the top of the stack loses only what its own feedline takes; every line below the piston loses the piston pressure loss too.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
line_states
|
Mapping[str, LineState]
|
Fluid mass and internal energy of every line, keyed by line name. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, float]
|
Injector inlet pressure of every line [Pa], keyed by line name. |