models.feed_systems¶
Feed-system models for liquid-fed rocket engines. The package describes how propellant is delivered from the tanks to the combustion chamber, and is organised around three concerns:
| Concern | Where it lives | What it contains |
|---|---|---|
| Contract | feed_systems.base |
The abstract FeedSystem interface every cycle must satisfy. |
| Cycle implementations | feed_systems.cycles |
One module per cycle topology (pressure-fed today; electric-pump, gas-generator, expander, staged-combustion to follow). |
| Shared component descriptions | feed_systems.components |
Static descriptions of pumps, turbines, gas generators, regenerative jackets, plus a tabulated-curve helper that cycle implementations consume. |
| Tank thermodynamics | feed_systems.tank |
Two-phase tank model backed by CoolProp. |
| Propellant lines | feed_systems.lines |
The PropellantLine a feed system delivers — its name, its role, and the tank it draws from — and the LineState the integrator carries for it. |
The FeedSystem contract¶
A feed system delivers one PropellantLine per propellant, keyed by line name, and every cycle implementation extends FeedSystem to supply the pressure that reaches the injector on every line:
get_inlet_pressures(line_states) -> dict[str, float]
From those, the base class assembles the state every line is fed with:
get_inlet_states(line_states) -> dict[str, FluidState]
Both take the LineState of every line — the fluid mass and the internal energy the integrator carries beside it — keyed by line name.
The default inlet state is the tank fluid at the tank temperature and density, at the pressure that survives the path to the injector. A cycle that heats or pressurizes a propellant on the way — a regenerative jacket, a pump — overrides get_inlet_states to say so.
machwave.simulation.biliquid.states.BiliquidEngineState.run_timestep composes the two: it reads every inlet state once per integration step, then calls Injector with them at each chamber pressure the solver tries.
Public surface¶
Importing from machwave.models.feed_systems exposes the abstract base, every concrete cycle, and the components sub-package:
from machwave.models.feed_systems import (
FeedSystem,
StackedTankPressureFedFeedSystem,
components,
)
pump_spec = components.PumpSpec(
name="oxidizer pump",
isentropic_efficiency=0.7,
pressure_rise=5.0e6,
volumetric_flow_design=2.0e-3,
shaft_speed_design=3000.0,
)
The top-level machwave package additionally re-exports feed_systems as a shortcut, so from machwave import feed_systems and feed_systems.StackedTankPressureFedFeedSystem work identically.
machwave.models.feed_systems
¶
FeedSystem
¶
Bases: ABC
Abstract base class for the feed system of a rocket engine.
The system delivers one PropellantLine per propellant, keyed by line
name, and solves every line together: a cycle couples its lines
physically, as the stacked-tank piston ties the fuel pressure to the
oxidizer ullage pressure.
Source code in machwave/models/feed_systems/base.py
__init__(lines)
¶
Initialize the feed system with the lines it delivers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lines
|
Sequence[PropellantLine]
|
Propellant lines the system feeds, one per propellant. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If no line was given, or if two lines share a name. |
Source code in machwave/models/feed_systems/base.py
get_initial_propellant_mass()
¶
Compute and return the initial propellant mass in the system [kg].
get_inlet_pressures(line_states)
abstractmethod
¶
Compute the pressure delivered to the injector inlet on every line [Pa].
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. |
Source code in machwave/models/feed_systems/base.py
get_inlet_states(line_states)
¶
Return the state delivered to the injector inlet on every line.
Each state is the tank fluid at the tank temperature and density, at the pressure that survives the path to the injector. A cycle that heats or works on a propellant on the way — a regenerative jacket, a pump — overrides this to say so.
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, FluidState]
|
Injector inlet state of every line, keyed by line name. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If any line of the system has no state. |
Source code in machwave/models/feed_systems/base.py
get_lines_with_role(role)
¶
Return every line carrying the given role, in the order they were given.
Source code in machwave/models/feed_systems/base.py
LineState
dataclass
¶
The propellant a line still holds at one point in the integration.
Attributes:
| Name | Type | Description |
|---|---|---|
fluid_mass |
float
|
Mass of fluid left in the tank [kg]. |
internal_energy |
float | None
|
Internal energy of that fluid [J]. None for an isothermal tank, which runs no energy balance. |
Source code in machwave/models/feed_systems/lines.py
PropellantLine
dataclass
¶
One propellant on its way from a tank to the injector.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Line name, which keys the line across the feed system, the injector and the simulation state. |
role |
ComponentRole
|
Whether the line carries an oxidizer, a fuel, or an additive such as a triliquid diluent or a coolant. |
tank |
Tank
|
Tank the line draws from. |
Source code in machwave/models/feed_systems/lines.py
initial_state
property
¶
The line state the integrator starts from, as the tank was loaded.
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. |