|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Public Member Functions | |
| None | __init__ (self, Fluid fluid, float volume, *, float wall_mass=0.0, float wall_capacity=0.0, float wall_conductance=0.0) |
| float | density (self, VesselState state) |
| float | pressure (self, VesselState state) |
| float | temperature (self, VesselState state) |
| float | enthalpy (self, VesselState state) |
| float | compressibility (self, VesselState state) |
| VesselState | initial_state (self, float pressure, float temperature) |
| Rates | rates (self, VesselState state, *, float mdot_out=0.0, float mdot_in=0.0, float enthalpy_in=0.0, float heat_in=0.0, float stirring=1.0) |
| VesselState | step (self, VesselState state, Rates rates, float dt) |
| list[tuple[float, VesselState]] | blowdown (self, VesselState state, float|Callable[[VesselState, float], float] mdot, float duration, *, int steps=2000, float heat_in=0.0) |
| GasVolume | with_wall (self, float mass, float capacity, float conductance) |
| str | __repr__ (self) |
Public Attributes | |
| fluid = fluid | |
| volume = volume | |
| wall_mass = wall_mass | |
| wall_capacity = wall_capacity | |
| wall_conductance = wall_conductance | |
A fixed volume of gas: a COPV, an ullage, a plenum.
Args:
fluid: The gas.
volume: Internal volume [m^3].
wall_mass: Mass of vessel wall in thermal contact with the gas [kg].
Zero gives adiabatic behaviour, which is a bound rather than an
answer.
wall_capacity: Wall specific heat [J/(kg.K)]. Aluminium is about 900,
steel about 500, a carbon-overwrapped liner somewhere between and
worth measuring.
wall_conductance: Overall gas-to-wall conductance ``hA`` [W/K]. The
least-known number here by some way; it is what
:meth:`~feedtwin.vessels.volume.GasVolume.rates` multiplies the
gas-to-wall temperature difference by.
| None feedtwin.vessels.volume.GasVolume.__init__ | ( | self, | |
| Fluid | fluid, | ||
| float | volume, | ||
| * | , | ||
| float | wall_mass = 0.0, | ||
| float | wall_capacity = 0.0, | ||
| float | wall_conductance = 0.0 ) |
| list[tuple[float, VesselState]] feedtwin.vessels.volume.GasVolume.blowdown | ( | self, | |
| VesselState | state, | ||
| float | Callable[[VesselState, float], float] | mdot, | ||
| float | duration, | ||
| * | , | ||
| int | steps = 2000, | ||
| float | heat_in = 0.0 ) |
March a blowdown and return ``(time, state)`` samples. ``mdot`` is either a constant or a callable of ``(state, t)`` -- the latter is how a real orifice or regulator gets coupled in before the network solver does it properly. Stops early if the vessel empties, which is a physical end rather than an error.
Definition at line 249 of file volume.py.
References feedtwin.vessels.tank.Tank.rates(), rates(), feedtwin.session.core.Session.step(), feedtwin.session.model.AssemblyError.step, feedtwin.vessels.tank.Tank.step(), and step().
| float feedtwin.vessels.volume.GasVolume.compressibility | ( | self, | |
| VesselState | state ) |
Definition at line 148 of file volume.py.
References engine.pipeline.config_schemas.FluidConfig.density, engine.pipeline.config_schemas.StainlessSteelCaseConfig.density, density(), feedtwin.pid.document.PidNode.fluid, feedtwin.props.errors.OutOfRange.fluid, and fluid.
| float feedtwin.vessels.volume.GasVolume.density | ( | self, | |
| VesselState | state ) |
Definition at line 129 of file volume.py.
References feedtwin.engine.chamber.Chamber.volume, and volume.
Referenced by compressibility(), feedtwin.vessels.collapse.LiquidThermal.diffusivity(), enthalpy(), pressure(), temperature(), and feedtwin.engine.balance.SideBalance.velocity().
| float feedtwin.vessels.volume.GasVolume.enthalpy | ( | self, | |
| VesselState | state ) |
Specific enthalpy of the gas in the vessel [J/kg]. This is what leaves through an outlet: gas exits carrying its enthalpy, not its internal energy, and the difference is the flow work that cools what stays behind.
Definition at line 139 of file volume.py.
References engine.pipeline.config_schemas.FluidConfig.density, engine.pipeline.config_schemas.StainlessSteelCaseConfig.density, density(), feedtwin.pid.document.PidNode.fluid, feedtwin.props.errors.OutOfRange.fluid, and fluid.
Referenced by rates().
| VesselState feedtwin.vessels.volume.GasVolume.initial_state | ( | self, | |
| float | pressure, | ||
| float | temperature ) |
Build a state from the two numbers anyone actually knows.
Nobody fills a bottle to an internal energy. They fill it to a pressure
at a temperature, and this converts that into the state the balance
needs.
Raises:
ValueError: the state is a liquid. ``(rho, u)`` is an excellent set
of state variables for a gas and a poor one for a liquid --
liquid density is roughly 180x less sensitive to pressure, so
recovering pressure from density amplifies any error in it by
the same factor. On the exact equation of state the round trip
is still perfect; through interpolated tables a liquid comes
back 0.1-0.7% out where a gas is within 1e-4%. Catching it here
beats discovering it as pressures that are quietly slightly
wrong.
Definition at line 151 of file volume.py.
References feedtwin.pid.document.PidNode.fluid, feedtwin.props.errors.OutOfRange.fluid, fluid, feedtwin.engine.chamber.Chamber.volume, and volume.
| float feedtwin.vessels.volume.GasVolume.pressure | ( | self, | |
| VesselState | state ) |
Pressure [Pa] from mass and energy, through the real-gas EOS.
Definition at line 132 of file volume.py.
References engine.pipeline.config_schemas.FluidConfig.density, engine.pipeline.config_schemas.StainlessSteelCaseConfig.density, density(), feedtwin.pid.document.PidNode.fluid, feedtwin.props.errors.OutOfRange.fluid, and fluid.
| Rates feedtwin.vessels.volume.GasVolume.rates | ( | self, | |
| VesselState | state, | ||
| * | , | ||
| float | mdot_out = 0.0, | ||
| float | mdot_in = 0.0, | ||
| float | enthalpy_in = 0.0, | ||
| float | heat_in = 0.0, | ||
| float | stirring = 1.0 ) |
Time derivatives, for an integrator to march.
Args:
state: Where the vessel is now.
mdot_out: Gas leaving [kg/s]. It carries the vessel's own enthalpy.
mdot_in: Gas arriving [kg/s].
enthalpy_in: Specific enthalpy of arriving gas [J/kg]. Matters:
warm pressurant into a cold ullage is a heat source, and it is
the mechanism behind ullage collapse.
heat_in: External heat [W] -- ambient through insulation, say.
Wall exchange is computed here and need not be included.
stirring: Multiplier on the gas-to-wall conductance, 1 by default.
``wall_conductance`` is the still-gas figure; a charge jet
stirs the vessel and forced convection off it runs several
times natural. Named and passed in rather than inferred from
``mdot_in`` so a caller says when it applies and a run can
report what was assumed.
Definition at line 187 of file volume.py.
References enthalpy(), max, engine.pipeline.config_schemas.FluidConfig.temperature, feedtwin.comps.base.FlowConditions.temperature, feedtwin.engine.chamber.CombustionState.temperature, feedtwin.engine.chamber.ConstantCStar.temperature, feedtwin.engine.design.InjectorSide.temperature, feedtwin.session.burn.BurnTrace.temperature, feedtwin.session.network_trace.NetworkTrace.temperature, temperature(), fsw::calibration::EnvironmentalState.temperature, fsw::calibration::IMUCalibration::RawReading.temperature, pt_calibration_gui.PTMeasurement.temperature, robust_calibration.EnvironmentalState.temperature, robust_pt_calibration_gui.EnvironmentalState.temperature, feedtwin.vessels.tank.Tank.wall_capacity, wall_capacity, feedtwin.vessels.tank.Tank.wall_conductance, wall_conductance, feedtwin.vessels.tank.Tank.wall_mass, and wall_mass.
Referenced by blowdown().
| VesselState feedtwin.vessels.volume.GasVolume.step | ( | self, | |
| VesselState | state, | ||
| Rates | rates, | ||
| float | dt ) |
One explicit Euler step. For demonstration and simple sweeps. Phase 07 replaces this with a proper stiff integrator; it exists so that the vessel model can be exercised and validated now rather than waiting on a solver that does not exist yet.
Definition at line 236 of file volume.py.
Referenced by engine.pipeline.thermal.wall_conduction.WallModel.advance(), blowdown(), and engine.pipeline.thermal.wall_conduction.WallModel.soak().
| float feedtwin.vessels.volume.GasVolume.temperature | ( | self, | |
| VesselState | state ) |
Definition at line 136 of file volume.py.
References engine.pipeline.config_schemas.FluidConfig.density, engine.pipeline.config_schemas.StainlessSteelCaseConfig.density, density(), feedtwin.pid.document.PidNode.fluid, feedtwin.props.errors.OutOfRange.fluid, and fluid.
Referenced by rates().
| GasVolume feedtwin.vessels.volume.GasVolume.with_wall | ( | self, | |
| float | mass, | ||
| float | capacity, | ||
| float | conductance ) |
A copy with a different wall. Handy for bounding a real vessel between adiabatic and isothermal without rebuilding it.
Definition at line 279 of file volume.py.
References feedtwin.pid.document.PidNode.fluid, feedtwin.props.errors.OutOfRange.fluid, fluid, feedtwin.engine.chamber.Chamber.volume, and volume.
| feedtwin.vessels.volume.GasVolume.fluid = fluid |
Definition at line 121 of file volume.py.
Referenced by compressibility(), feedtwin.solve.network.Network.conditions(), enthalpy(), initial_state(), pressure(), temperature(), and with_wall().
| feedtwin.vessels.volume.GasVolume.volume = volume |
Definition at line 122 of file volume.py.
Referenced by feedtwin.session.core.BottleSim._air(), feedtwin.session.core.BottleSim.advance(), density(), initial_state(), and with_wall().
| feedtwin.vessels.volume.GasVolume.wall_capacity = wall_capacity |
| feedtwin.vessels.volume.GasVolume.wall_conductance = wall_conductance |
| feedtwin.vessels.volume.GasVolume.wall_mass = wall_mass |