STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
feedtwin.vessels.volume.GasVolume Class Reference

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

Detailed Description

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.

Definition at line 92 of file volume.py.

Constructor & Destructor Documentation

◆ __init__()

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 )

Definition at line 110 of file volume.py.

Member Function Documentation

◆ __repr__()

str feedtwin.vessels.volume.GasVolume.__repr__ ( self)

Definition at line 290 of file volume.py.

◆ blowdown()

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().

◆ compressibility()

◆ density()

float feedtwin.vessels.volume.GasVolume.density ( self,
VesselState state )

◆ enthalpy()

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().

◆ initial_state()

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.

◆ pressure()

float feedtwin.vessels.volume.GasVolume.pressure ( self,
VesselState state )

◆ rates()

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().

◆ step()

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().

◆ temperature()

◆ with_wall()

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.

Member Data Documentation

◆ fluid

feedtwin.vessels.volume.GasVolume.fluid = fluid

◆ volume

feedtwin.vessels.volume.GasVolume.volume = volume

◆ wall_capacity

feedtwin.vessels.volume.GasVolume.wall_capacity = wall_capacity

Definition at line 124 of file volume.py.

Referenced by rates().

◆ wall_conductance

feedtwin.vessels.volume.GasVolume.wall_conductance = wall_conductance

Definition at line 125 of file volume.py.

Referenced by rates().

◆ wall_mass

feedtwin.vessels.volume.GasVolume.wall_mass = wall_mass

Definition at line 123 of file volume.py.

Referenced by rates().


The documentation for this class was generated from the following file: