carbatpy.models.fluids.fluid_props¶
Created on Mon May 22 21:09:12 2023
@author: atakan
Attributes¶
Classes¶
Fluid model to be used Refprop or TREND |
|
The Fluid class is used to set, get, and print states of a fluid with a given |
Functions¶
|
short way to define a Fluid and a FluidModel |
Module Contents¶
- carbatpy.models.fluids.fluid_props._fl_properties_names = ('Temperature', 'Pressure', 'spec_Enthalpy', 'spec_Volume', 'spec_Entropy', 'quality',...[source]¶
- class carbatpy.models.fluids.fluid_props.FluidModel(fluid, units=_UNITS, props=_PROPS, rp_inst=rp_instance, args=_MODEL_ARGS)[source]¶
Fluid model to be used Refprop or TREND
Only model, chemical compunds units and for TREND some more values are set here. The mixture composition, state etc. is set in Fluid.
- set_rp_fluid(modwf=REFPROPFunctionLibrary, name='RPPREFIX')[source]¶
A new instance of Refpropdll for the given fluid. It can then be called using fluid =””
- Parameters:
fluid (string) – fluid (mixture) name, as described in REFPROP.
- Returns:
self.rp_instance – for further usage.
- Return type:
REFPROP Instance
- class carbatpy.models.fluids.fluid_props.Fluid(fluidmodel, composition=None, option=1)[source]¶
The Fluid class is used to set, get, and print states of a fluid with a given
model (e.g. RefProp). The compounds are set in the fluidmodel, while the composition is also set here.
- set_composition(composition)[source]¶
Mainly for TREND mole fractions have to converted to mass fractions
Sets the self.composition used in the Fluid settings and the self.comp_mass and self.comp_mole by calling calc_mass_fraction()
- Parameters:
composition (list/numpy.array) – mole fractions must sum up to 1.
- Return type:
None.
- set_state(values, given='TP', wanted=_THERMO_STRING, composition=None, **kwargs)[source]¶
Sets the state of a fluid and calculates the wanted
- Parameters:
values (list[2]) – the two state parameter values.
given (String, optional) – What are the two values (T,P,H,S,Q,V). The default is “TP”.
wanted (String, optional) – Which parameters shall be calculated? The default is _THERMO_STRING.
composition (list, optional) – mole fraction of each compound, must sum up to 1. When empty, the last/actual value will be used. The default is [].
kwargs (dictionary, optional) – Flags like iMass or iFlag can be passed to Refprop. with iMass=1 the input composition is taken as mass fraction, otherwise they are mole fractions. iMass is set to 1 if ‘Q’ is in wanted.
- Raises:
Exception – DESCRIPTION.
- Returns:
DESCRIPTION.
- Return type:
TYPE
- set_state_v(values, given='TP', wanted=_THERMO_STRING, **kwargs)[source]¶
set many Fluid states with the values given as array(vector)
- Parameters:
values (numpy.array((N,2))) – the N value pairs to fix the states.
given (String, optional) – what are the input values?(T,P, Q, S,…). The default is “TP”.
wanted (String, optional) – with all the outputs wanted. The default is _THERMO_STRING.
- Returns:
output – all the wanted properties for the N inputs.
- Return type:
numpy.array(N, n_wanted)
- carbatpy.models.fluids.fluid_props.init_fluid(fluid, composition, **keywords)[source]¶
short way to define a Fluid and a FluidModel
- Parameters:
fluid (string) – The species within the fluid.
composition (List) – mole fraction for each fluid.
**keywords (TYPE) – all keywords needed for the FluidModel, if non-defults shall be set.
- Returns:
actual_fluid – Instance of the actually set Fluid.
- Return type: