Fluid Property evaluation (general)

At the moment REFPROP (NIST) or CoolProp can be used for property evaluations of pure fluids and mixures, TREND (RU Bochum) usage will be included in near future. They will have to be installed on your system!

Functions to obtain fluid properties from REFPROP or CoolProp using the low level interface. (Set _props accordingly) Mainly used for thermodynamic cycle calculations. So far for several combinations of (input) parameters in the single-phase or saturated regime. For the ouput it can be mostly chosen, whether transport properties are als returned, besides the thermodynamiic properties. Functions are also vectorized by hand (Name:”…_v). Physical exergies can be calculated for a state of known h and p.

For REFPROP two usages of hp, Tp etc. are possible: Passing a string with the fluid name and compositon, properties etc. (This sometimes leads to trouble, when having many function calls >1E5 and it is slower). selected instance (RP) will be used throughout.

Or:First calling setPRFluid with the fluid name string. This generates an instance of REFPROP for this fluid (mixture), which has to be passed to the calls of hp, Tp etc. together with an empty string as fluid name.

Standard units: SI (J, kg, Pa, K,…)

fluid_properties_rp.T_prop_sat(temp, fluid='', composition=[1.0], option=1, units=ctREFPROP.ctREFPROP.REFPROPFunctionLibrary.GETENUMdll.iEnum, props='REFPROP', RP=ctREFPROP.ctREFPROP.REFPROPFunctionLibrary)

Saturation state properties at given temperature for a certain fluid (mixture).

Parameters
  • temp (float) – Temperature in K.

  • fluid (depends) – an AbstractState in coolprop or a fluid in REFPROP.

  • RP (REFPROP Instance as set with setRPfluid) – if set, the fluid name does not have to be passed again, instead flud =”” works.

Returns

alle – includes: properies in saturated state at given pressure p of liquid (0,:) and vapor(1,:), [1] T, p, h, v,s, q [0] T p h v s q cp, viscosity, thermal conductivity, Pr, kinematic viscosity all in SI units.

Return type

numpy array (2,4)

fluid_properties_rp.hp(h, p, fluid='', composition=[1.0], option=1, units=ctREFPROP.ctREFPROP.REFPROPFunctionLibrary.GETENUMdll.iEnum, props='REFPROP', RP=ctREFPROP.ctREFPROP.REFPROPFunctionLibrary)

Properties needed for integration at given values of pressure and specific enthalpy.

Parameters
  • h (float) – specific enthalpy in J/kg.

  • p (float) – pressure in Pa.

  • fluid (an AbstractState in coolprop. or fluid name in Refprop) –

  • option (integer) – if 0 also transport properties will be calculated (not yet implemented for REFPROP) with option 1 : T,p,h,v,s,x is calculated

  • units (integer) – units in Refprop (imposrtant: must be SI and mass based (kg, Pa etc.))

  • RP (REFPROP Instance as set with setRPfluid) – if set, the fluid name does not have to be passed again, instead flud =”” works.

Returns

alle – if option = 0 it includes: T, p , quality, specific enthalpy,entropy densities, viscosities, cp , conductivity,phase prandtl-number at the defined state (p,h) all in SI units.

if option =1: it is compatible to the high level output T,p,h,v,s,x.

Return type

numpy array

fluid_properties_rp.hp_exergy(h, p, fluid='', T_env=283.15, p_env=101300.0, props='REFPROP', composition=[1.0], RP=ctREFPROP.ctREFPROP.REFPROPFunctionLibrary)

calculate the specific exergy of a fluid from given enthalpy and pressure

Parameters
  • h (float) – specific enthalpy (J/kg).

  • p (float) – pressure (Pa).

  • fluid (depends on model, as defined with props(REFPROP, CoolProp etc.)) – define the fluid(mixture).

  • T_env (float, optional) – temperature (K) of the environment. The default is __Tenv__.

  • p_env (float, optional) – pressure (Pa) of the environment. The default is __penv__.

  • props (TYPE, optional) – define the fluid module to use. The default is _props.

  • composition (depends on model, optional) – mole fractions of the different compounds, should add to 1. The default is [1.0].

  • RP (REFPROP Instance as set with setRPfluid) – if set, the fluid name does not have to be passed again, instead flud =”” works.

Returns

ex – specific exergy (J/kg).

Return type

float

fluid_properties_rp.hp_v(h, p, fluid='', composition=[1.0], option=1, units=ctREFPROP.ctREFPROP.REFPROPFunctionLibrary.GETENUMdll.iEnum, props='REFPROP', RP=ctREFPROP.ctREFPROP.REFPROPFunctionLibrary)

Vectorization of the single phase properties function, see: hp

fluid_properties_rp.mdot_area_function(m_dot, diameter)

Calculate the mass flux through a tube and the orthogonal area

Parameters
  • m_dot (float) – mass flow rate (kg/s).

  • diameter (float) – of the tube (m).

Returns

  • m_dot_area (float) – in kg/(s m2).

  • area (float) – in m2.

fluid_properties_rp.p_prop_sat(p, fluid='', composition=[1.0], option=1, units=ctREFPROP.ctREFPROP.REFPROPFunctionLibrary.GETENUMdll.iEnum, props='REFPROP', RP=ctREFPROP.ctREFPROP.REFPROPFunctionLibrary)

Saturation state properties at given p for a certain fluid (mixture).

Parameters
  • p (float) – saturation pressure in Pa.

  • fluid (an AbstractState in coolprop or a fluid in REFPROP.) –

  • RP (REFPROP Instance as set with setRPfluid) – if set, the fluid name does not have to be passed again, instead flud =”” works.

Returns

alle – includes: properies in saturated state at given pressure p of vapor(0,:),and liquid (1,:) [1] T, p, h, v,s, q [0] T p h v s q cp, viscosity, thermal conductivity, Pr, kinematic viscosity all in SI units.

Return type

numpy array (2,4)

fluid_properties_rp.prop_Tq(T, q, fluid='', composition=[1.0], option=1, units=ctREFPROP.ctREFPROP.REFPROPFunctionLibrary.GETENUMdll.iEnum, props='REFPROP', RP=ctREFPROP.ctREFPROP.REFPROPFunctionLibrary)

Saturation state properties at given pressure and quality for a certain fluid (mixture).

Parameters
  • K. (Temp in) –

  • q (float (0<q<1)) – quality

  • fluid (an AbstractState in coolprop or a fluid in REFPROP.) –

  • composition (list of floats) – mole fraction of each fluid.

  • option (integer) – [1] only T p h v s and q

  • units (integer) – select units (SI of property model, for REFPROP: 21)

  • RP (REFPROP Instance as set with setRPfluid) – if set, the fluid name does not have to be passed again, instead flud =”” works.

Returns

alle – includes: properies in saturated state at given pressure p of liquid (0,:) and vapor(1,:), T, p, h, v,s, q all in SI units.

Return type

numpy array (2,4)

fluid_properties_rp.prop_pq(p, q, fluid='', composition=[1.0], option=1, units=ctREFPROP.ctREFPROP.REFPROPFunctionLibrary.GETENUMdll.iEnum, props='REFPROP', RP=ctREFPROP.ctREFPROP.REFPROPFunctionLibrary)

Saturation state properties at given pressure and quality for a certain fluid (mixture).

Parameters
  • p (float) – pressure in Pa.

  • q (float (0<q<1)) – quality

  • fluid (an AbstractState in coolprop or a fluid in REFPROP.) –

  • composition (list of floats) – mole fraction of each fluid.

  • option (integer) – [1] only T p h v s and q

  • units (integer) – select units (SI of property model, for REFPROP: 21)

  • RP (REFPROP Instance as set with setRPfluid) – if set, the fluid name does not have to be passed again, instead flud =”” works.

Returns

alle – includes: properies in saturated state at given pressure p of liquid (0,:) and vapor(1,:), T, p, h, v,s, q all in SI units.

Return type

numpy array (2,4)

fluid_properties_rp.setRPFluid(fluid, modwf=ctREFPROP.ctREFPROP.REFPROPFunctionLibrary, name='RPPREFIX')

A new instnce of Refpropdll for the given fluid. It can then be called using fluid =””

Parameters

fluid (string) – fluid (mixture) name, as described in REFPROP.

Returns

SP – for further usage.

Return type

REFPROP Instance

fluid_properties_rp.sp(s, p, fluid='', composition=[1.0], option=1, units=ctREFPROP.ctREFPROP.REFPROPFunctionLibrary.GETENUMdll.iEnum, props='REFPROP', RP=ctREFPROP.ctREFPROP.REFPROPFunctionLibrary)

Properties needed for integration at given s and p, single phase.

Parameters
  • s (float) – specific entropy in J/kg.

  • p (float) – pressure in Pa.

  • fluid (an AbstractState in coolprop. or fluid name in Refprop) –

  • option (integer) – if 0 also transport properties will be calculated (not yet implemented for REFPROP) with option 1 : T,p,h,v,s,x is calculated

  • units (integer) – units in Refprop (imposrtant: must be SI and mass based (kg, Pa etc.))

  • RP (REFPROP Instance as set with setRPfluid) – if set, the fluid name does not have to be passed again, instead flud =”” works.

Returns

alle – if option = 0 it includes: T, p , quality, specific enthalpy,entropy densities, viscosities, cp , conductivity,phase prandtl-number at the defined state (p,h) all in SI units.

if option =1: it is compatible to the high level output T,p,h,v,s,x.

Return type

numpy array

fluid_properties_rp.tp(temp, p, fluid='', composition=[1.0], option=1, units=ctREFPROP.ctREFPROP.REFPROPFunctionLibrary.GETENUMdll.iEnum, props='REFPROP', RP=ctREFPROP.ctREFPROP.REFPROPFunctionLibrary)

Properties needed for integration at given temperature and pressure, single phase. option 0 (many properties) not yet implemented for REFPROP!

Parameters
  • temp (float) – temperature in K.

  • p (float) – pressure in Pa.

  • fluid (an AbstractState in coolprop.) –

  • RP (REFPROP Instance as set with setRPfluid) –

  • set (if) –

  • again (the fluid name does not have to be passed) –

  • works. (instead flud ="") –

Returns

alle – if option = 0 it includes: T, p , quality, specific enthalpy,entropy densities, viscosities, cp , conductivity,phase prandtl-number at the defined state (p,h) all in SI units.

if option =1: it is compatible to the high level output T,p,h,v,s,x.

if option =2: molecular mass MM is included T,p,h,v,s,x, MM.

Return type

numpy array

fluid_properties_rp.uv(u, v, fluid='', composition=[1.0], option=1, units=ctREFPROP.ctREFPROP.REFPROPFunctionLibrary.GETENUMdll.iEnum, props='REFPROP', RP=ctREFPROP.ctREFPROP.REFPROPFunctionLibrary)

Properties needed for integration at given values of internal energy and specific volume.

Parameters
  • u (float) – internal energy in J/kg.

  • v (float) – specific volume in m3(kg.

  • fluid (an AbstractState in coolprop. or fluid name in Refprop) –

  • option (integer) – if 0 also transport properties will be calculated (not yet implemented for REFPROP) with option 1 : T,p,h,v,s,x is calculated

  • units (integer) – units in Refprop (important: must be SI and mass based (kg, Pa etc.))

  • RP (REFPROP Instance as set with setRPfluid) – if set, the fluid name does not have to be passed again, instead flud =”” works.

Returns

alle – if option = 0 it includes: T, p , quality, specific enthalpy,entropy densities, viscosities, cp , conductivity,phase prandtl-number at the defined state (p,h) all in SI units.

if option =1: it is compatible to the high level output T,p,h,v,s,x.

Return type

numpy array