8.3
general documentation
cs_physical_properties.h File Reference
#include "cs_defs.h"
#include "cs_thermal_model.h"
+ Include dependency graph for cs_physical_properties.h:

Go to the source code of this file.

Enumerations

enum  cs_phys_prop_thermo_plane_type_t {
  CS_PHYS_PROP_PLANE_PH , CS_PHYS_PROP_PLANE_PT , CS_PHYS_PROP_PLANE_PS , CS_PHYS_PROP_PLANE_PU ,
  CS_PHYS_PROP_PLANE_PV , CS_PHYS_PROP_PLANE_TS , CS_PHYS_PROP_PLANE_TX
}
 
enum  cs_phys_prop_type_t {
  CS_PHYS_PROP_PRESSURE , CS_PHYS_PROP_TEMPERATURE , CS_PHYS_PROP_ENTHALPY , CS_PHYS_PROP_ENTROPY ,
  CS_PHYS_PROP_ISOBARIC_HEAT_CAPACITY , CS_PHYS_PROP_ISOCHORIC_HEAT_CAPACITY , CS_PHYS_PROP_SPECIFIC_VOLUME , CS_PHYS_PROP_DENSITY ,
  CS_PHYS_PROP_INTERNAL_ENERGY , CS_PHYS_PROP_QUALITY , CS_PHYS_PROP_THERMAL_CONDUCTIVITY , CS_PHYS_PROP_DYNAMIC_VISCOSITY ,
  CS_PHYS_PROP_SPEED_OF_SOUND
}
 

Functions

void cs_thermal_table_set (const char *material, const char *method, const char *reference, cs_phys_prop_thermo_plane_type_t thermo_plane, cs_temperature_scale_t temp_scale)
 Define thermal table. More...
 
void cs_thermal_table_finalize (void)
 finalize thermal table. More...
 
const char * cs_physical_properties_get_coolprop_backend (void)
 Get backend set for CoolProp. More...
 
void cs_physical_properties_set_coolprop_backend (const char *backend)
 Set backend for CoolProp. More...
 
void cs_phys_prop_compute (cs_phys_prop_type_t property, cs_lnum_t n_vals, cs_lnum_t var1_stride, cs_lnum_t var2_stride, const cs_real_t var1[], const cs_real_t var2[], cs_real_t val[])
 Compute a physical property. More...
 
cs_real_t cs_physical_property_get_ref_value (const char *name)
 Get reference value of a physical property. More...
 
void cs_physical_property_set_ref_value (const char *name, const cs_real_t val)
 Set reference value for a physical property. More...
 
void cs_physical_property_get_zone_values (const char *name, const char *zname, cs_real_t retval[])
 Get property reference values for a given zone. More...
 
void cs_physical_property_create (const char *name, const int dim, const cs_real_t refval)
 Create a physical property. More...
 
void cs_physical_property_define_from_value (const char *name, const char *zname, const int dim, const cs_real_t val)
 Add a property definition on a given zone using a single value. More...
 
void cs_physical_property_define_from_values (const char *name, const char *zname, const int dim, cs_real_t vals[])
 Add a property multi-diemnsional definition on a given zone. More...
 
void cs_physical_property_define_from_field (const char *name, int type_flag, int location_id, int dim, bool has_previous)
 Add a property definition based on a cs_field_t. More...
 
int cs_physical_property_field_id_by_name (const char *name)
 Return id of field associated to property. More...
 
void cs_physical_property_update_zone_values (const char *name, const char *zname, const cs_real_t vals[])
 Update reference values for a property on a given zone. More...
 

Enumeration Type Documentation

◆ cs_phys_prop_thermo_plane_type_t

Enumerator
CS_PHYS_PROP_PLANE_PH 
CS_PHYS_PROP_PLANE_PT 
CS_PHYS_PROP_PLANE_PS 
CS_PHYS_PROP_PLANE_PU 
CS_PHYS_PROP_PLANE_PV 
CS_PHYS_PROP_PLANE_TS 
CS_PHYS_PROP_PLANE_TX 

◆ cs_phys_prop_type_t

Enumerator
CS_PHYS_PROP_PRESSURE 
CS_PHYS_PROP_TEMPERATURE 
CS_PHYS_PROP_ENTHALPY 
CS_PHYS_PROP_ENTROPY 
CS_PHYS_PROP_ISOBARIC_HEAT_CAPACITY 
CS_PHYS_PROP_ISOCHORIC_HEAT_CAPACITY 
CS_PHYS_PROP_SPECIFIC_VOLUME 
CS_PHYS_PROP_DENSITY 
CS_PHYS_PROP_INTERNAL_ENERGY 
CS_PHYS_PROP_QUALITY 
CS_PHYS_PROP_THERMAL_CONDUCTIVITY 
CS_PHYS_PROP_DYNAMIC_VISCOSITY 
CS_PHYS_PROP_SPEED_OF_SOUND 

Function Documentation

◆ cs_phys_prop_compute()

void cs_phys_prop_compute ( cs_phys_prop_type_t  property,
cs_lnum_t  n_vals,
cs_lnum_t  var1_stride,
cs_lnum_t  var2_stride,
const cs_real_t  var1[],
const cs_real_t  var2[],
cs_real_t  val[] 
)

Compute a physical property.

For values var1 and var2, we can use a stride so that accesses for a given element with id i will be of the form: var[i*stride]; this allows regular access with stride 1, and access to constant variables stored as a single-valued array with a stride of 0.

Parameters
[in]propertyproperty queried
[in]n_valsnumber of values
[in]var1_stridestride between successive values of var1
[in]var2_stridestride between successive values of var2
[in]var1values on first plane axis
[in]var2values on second plane axis
[out]valresulting property values

◆ cs_physical_properties_get_coolprop_backend()

const char * cs_physical_properties_get_coolprop_backend ( void  )

Get backend set for CoolProp.

Returns NULL if CoolProp is not used or backend not set yet.

Returns
pointer to CoolProp backend.

Returns null if CoolProp is not used or backend not set yet.

Returns
pointer to CoolProp backend.

◆ cs_physical_properties_set_coolprop_backend()

void cs_physical_properties_set_coolprop_backend ( const char *  backend)

Set backend for CoolProp.

Ignored if CoolProp is not used.

When called from user-defined functions, this should be set from cs_user_model rather than cs_user_parameters, as some reference property values may be computed before calling cs_user_parameters.

A few primary backends in CoolProp are:

  • "HEOS": The Helmholtz Equation of State backend for use with pure and pseudo-pure fluids, and mixtures, all of which are based on multi-parameter Helmholtz Energy equations of state.
  • "REFPROP": only if REFPROP library is available (set ALTERNATIVE_REFPROP_PATH environment variable if needed)
  • "INCOMP": Incompressible backend (for pure fluids)
  • "TTSE&XXXX": TTSE backend, with tables generated using the XXXX backend where XXXX is one of the base backends("HEOS", "REFPROP", etc.)
  • "BICUBIC&XXXX": Bicubic backend, with tables generated using the XXXX backend where XXXX is one of the base backends("HEOS", "REFPROP", etc.)
Parameters
[in]backendbackend name

Ignored if CoolProp is not used.

When called from user-defined functions, this should be set from cs_user_model rather than cs_user_parameters, as some reference property values may be computed before calling cs_user_parameters.

A few primary backends in CoolProp are:

  • "HEOS": The Helmholtz Equation of State backend for use with pure and pseudo-pure fluids, and mixtures, all of which are based on multi-parameter Helmholtz Energy equations of state.
  • "REFPROP": only if REFPROP library is available (set ALTERNATIVE_REFPROP_PATH environment variable if needed)
  • "INCOMP": Incompressible backend (for pure fluids)
  • "TTSE&XXXX": TTSE backend, with tables generated using the XXXX backend where XXXX is one of the base backends("HEOS", "REFPROP", etc.)
  • "BICUBIC&XXXX": Bicubic backend, with tables generated using the XXXX backend where XXXX is one of the base backends("HEOS", "REFPROP", etc.)
Parameters
[in]backendbackend name; "HEOS" used if nullptr.

◆ cs_physical_property_create()

void cs_physical_property_create ( const char *  name,
const int  dim,
const cs_real_t  refval 
)

Create a physical property.

Parameters
[in]nameproperty name
[in]dimproperty dimension
[in]refvalreference value

◆ cs_physical_property_define_from_field()

void cs_physical_property_define_from_field ( const char *  name,
int  type_flag,
int  location_id,
int  dim,
bool  has_previous 
)

Add a property definition based on a cs_field_t.

The field is created if needed

Parameters
[in]nameproperty name
[in]type_flagfield type flag
[in]location_idlocation id flag
[in]dimfield dimension
[in]has_previousdoes the field has val_pre

◆ cs_physical_property_define_from_value()

void cs_physical_property_define_from_value ( const char *  name,
const char *  zname,
const int  dim,
const cs_real_t  val 
)

Add a property definition on a given zone using a single value.

Parameters
[in]nameproperty name
[in]znamezone name
[in]dimproperty dimension
[in]valreference value for the zone

◆ cs_physical_property_define_from_values()

void cs_physical_property_define_from_values ( const char *  name,
const char *  zname,
const int  dim,
cs_real_t  vals[] 
)

Add a property multi-diemnsional definition on a given zone.

Parameters
[in]nameproperty name
[in]znamezone name
[in]dimproperty dimension (>1)
[in]valsarray of values to set

◆ cs_physical_property_field_id_by_name()

int cs_physical_property_field_id_by_name ( const char *  name)

Return id of field associated to property.

Parameters
[in]nameproperty name
Returns
field id (int)

◆ cs_physical_property_get_ref_value()

cs_real_t cs_physical_property_get_ref_value ( const char *  name)

Get reference value of a physical property.

Parameters
[in]nameproperty name
Returns
reference value (cs_real_t)

◆ cs_physical_property_get_zone_values()

void cs_physical_property_get_zone_values ( const char *  name,
const char *  zname,
cs_real_t  retval[] 
)

Get property reference values for a given zone.

Parameters
[in]nameproperty name
[in]znamezone name
[in]retvalarray of values to return

◆ cs_physical_property_set_ref_value()

void cs_physical_property_set_ref_value ( const char *  name,
const cs_real_t  val 
)

Set reference value for a physical property.

Parameters
[in]nameproperty name
[in]valnew value to set

◆ cs_physical_property_update_zone_values()

void cs_physical_property_update_zone_values ( const char *  name,
const char *  zname,
const cs_real_t  vals[] 
)

Update reference values for a property on a given zone.

Parameters
[in]nameproperty name
[in]znamezone name
[in]valsarray of values to set

◆ cs_thermal_table_finalize()

void cs_thermal_table_finalize ( void  )

finalize thermal table.

◆ cs_thermal_table_set()

void cs_thermal_table_set ( const char *  material,
const char *  method,
const char *  reference,
cs_phys_prop_thermo_plane_type_t  thermo_plane,
cs_temperature_scale_t  temp_scale 
)

Define thermal table.