pub struct State<Fluid> {
pub temperature: ThermodynamicTemperature,
pub density: MassDensity,
pub fluid: Fluid,
}Expand description
The thermodynamic state of a fluid.
A State<Fluid> captures the thermodynamic state of a specific fluid,
including its temperature, density, and any fluid-specific data.
The Fluid type parameter can be a simple marker type,
such as Air or Water,
or a structured type containing additional data, such as mixture composition
or particle concentration.
State is the primary input to capability-based thermodynamic models for
calculating pressure, enthalpy, entropy, and related quantities.
§Example
use twine_models::support::thermo::{State, fluid::Air};
use uom::si::{
f64::{ThermodynamicTemperature, MassDensity},
thermodynamic_temperature::kelvin,
mass_density::kilogram_per_cubic_meter,
};
let state = State {
temperature: ThermodynamicTemperature::new::<kelvin>(300.0),
density: MassDensity::new::<kilogram_per_cubic_meter>(1.0),
fluid: Air,
};Fields§
§temperature: ThermodynamicTemperature§density: MassDensity§fluid: FluidImplementations§
Source§impl<Fluid> State<Fluid>
impl<Fluid> State<Fluid>
Sourcepub fn new(
temperature: ThermodynamicTemperature,
density: MassDensity,
fluid: Fluid,
) -> Self
pub fn new( temperature: ThermodynamicTemperature, density: MassDensity, fluid: Fluid, ) -> Self
Creates a new state with the given temperature, density, and fluid.
Sourcepub fn with_temperature(self, temperature: ThermodynamicTemperature) -> Self
pub fn with_temperature(self, temperature: ThermodynamicTemperature) -> Self
Returns a new state with the given temperature, keeping other fields unchanged.
Sourcepub fn with_density(self, density: MassDensity) -> Self
pub fn with_density(self, density: MassDensity) -> Self
Returns a new state with the given density, keeping other fields unchanged.
Sourcepub fn with_fluid(self, fluid: Fluid) -> Self
pub fn with_fluid(self, fluid: Fluid) -> Self
Returns a new state with the given fluid, keeping other fields unchanged.
Trait Implementations§
Source§impl<Fluid> StepIntegrable<Quantity<dyn Dimension<T = PInt<UInt<UTerm, B1>>, Kind = dyn Kind, M = Z0, J = Z0, L = Z0, N = Z0, I = Z0, Th = Z0>, dyn Units<f64, amount_of_substance = mole, mass = kilogram, time = second, electric_current = ampere, length = meter, thermodynamic_temperature = kelvin, luminous_intensity = candela>, f64>> for State<Fluid>where
Fluid: StepIntegrable<Time>,
impl<Fluid> StepIntegrable<Quantity<dyn Dimension<T = PInt<UInt<UTerm, B1>>, Kind = dyn Kind, M = Z0, J = Z0, L = Z0, N = Z0, I = Z0, Th = Z0>, dyn Units<f64, amount_of_substance = mole, mass = kilogram, time = second, electric_current = ampere, length = meter, thermodynamic_temperature = kelvin, luminous_intensity = candela>, f64>> for State<Fluid>where
Fluid: StepIntegrable<Time>,
Source§type Derivative = StateDerivative<<Fluid as StepIntegrable<Quantity<dyn Dimension<T = PInt<UInt<UTerm, B1>>, Kind = dyn Kind, M = Z0, J = Z0, L = Z0, N = Z0, I = Z0, Th = Z0>, dyn Units<f64, amount_of_substance = mole, mass = kilogram, time = second, electric_current = ampere, length = meter, thermodynamic_temperature = kelvin, luminous_intensity = candela>, f64>>>::Derivative>
type Derivative = StateDerivative<<Fluid as StepIntegrable<Quantity<dyn Dimension<T = PInt<UInt<UTerm, B1>>, Kind = dyn Kind, M = Z0, J = Z0, L = Z0, N = Z0, I = Z0, Th = Z0>, dyn Units<f64, amount_of_substance = mole, mass = kilogram, time = second, electric_current = ampere, length = meter, thermodynamic_temperature = kelvin, luminous_intensity = candela>, f64>>>::Derivative>
Delta.