State(Fluid, dict StateDict, phase=None)
A class that contains all the code that represents a thermodynamic state
The motivation for this class is that it is useful to be able to define the state once using whatever state inputs you like and then be able to calculate other thermodynamic properties with the minimum of computational work.
Let’s suppose that you have inputs of pressure and temperature and you want to calculate the enthalpy and pressure. Since the Equations of State are all explicit in temperature and density, each time you call something like:
h = Props('H','T',T','P',P,Fluid)
s = Props('S','T',T','P',P,Fluid)
the solver is used to carry out the T-P flash calculation. And if you wanted entropy as well you could either intermediately calculate T, rho and then use T, rho in the EOS in a manner like:
rho = Props('D','T',T','P',P,Fluid)
h = Props('H','T',T','D',rho,Fluid)
s = Props('S','T',T','D',rho,Fluid)
Instead in this class all that is handled internally. So the call to update sets the internal variables in the most computationally efficient way possible
Parameters: |
|
---|
Returns an integer flag for the phase of the fluid, where the flag value is one of iLiquid, iSupercritical, iGas, iTwoPhase
These constants are defined in the phase_constants module, and are imported into this module
The Prandtl number (cp*mu/k) [-]
The quality [-]
The temperature [K]
The saturation temperature (dew) for the given pressure, in [K]
Return a string representation of the state
Make a copy of this State class
The specific heat at constant pressure [kJ/kg/K]
The specific heat at constant volume [kJ/kg/K]
Get the mole mass [kg/kmol] or [g/mol]
Get the quality [-]
Get the temperature [K]
Get the saturation temperature, in [K]
Returns None if pressure is not within the two-phase pressure range
Get the thermal conductivity, in [kW/m/K]
Get the specific heat at constant pressure [kJ/kg/K]
Get the specific heat at constant pressure for the ideal gas [kJ/kg/K]
Get the specific heat at constant volume [kJ/kg/K]
Get the specific enthalpy [kJ/kg]
Get the pressure [kPa]
Get the density [kg/m^3]
Get the specific enthalpy [kJ/kg/K]
Get the speed of sound [m/s]
Get the amount of subcooling below the saturation temperature corresponding to the pressure, in [K]
Returns None if pressure is not within the two-phase pressure range
Get the amount of superheat above the saturation temperature corresponding to the pressure, in [K]
Returns None if pressure is not within the two-phase pressure range
Get the specific internal energy [kJ/kg]
Get the viscosity, in [Pa-s]
The specific enthalpy [kJ/kg]
The thermal conductivity, in [kW/m/K]
The pressure [kPa]
The density [kg/m^3]
The specific enthalpy [kJ/kg/K]
State.set_Fluid(signatures, args, kwargs, defaults)
The amount of subcooling below the saturation temperature corresponding to the pressure, in [K]
Returns None if pressure is not within the two-phase pressure range
The amount of superheat above the saturation temperature corresponding to the pressure, in [K]
Returns None if pressure is not within the two-phase pressure range
The internal energy [kJ/kg]
Parameters params, dictionary
A dictionary of terms to be updated, with keys equal to single-char inputs to the Props function, for instance dict(T=298, P = 101.325) would be one standard atmosphere
Just use the temperature and density directly for speed
Parameters: |
|
---|
Use the pressure and enthalpy directly
Parameters: |
|
---|
The viscosity, in [Pa-s]