#include "cs_defs.h"
#include <assert.h>
#include <math.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "bft_error.h"
#include "bft_mem.h"
#include "bft_printf.h"
#include "cs_log.h"
#include "cs_timer.h"
#include "cs_property.h"
#include "cs_physical_properties.h"
#include "cs_eos.hxx"
#include "cs_coolprop.hxx"
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... | |
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.
[in] | property | property queried |
[in] | n_vals | number of values |
[in] | var1_stride | stride between successive values of var1 |
[in] | var2_stride | stride between successive values of var2 |
[in] | var1 | values on first plane axis |
[in] | var2 | values on second plane axis |
[out] | val | resulting property values |
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.
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:
[in] | backend | backend name; "HEOS" used if nullptr. |
void cs_physical_property_create | ( | const char * | name, |
const int | dim, | ||
const cs_real_t | refval | ||
) |
Create a physical property.
[in] | name | property name |
[in] | dim | property dimension |
[in] | refval | reference value |
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
[in] | name | property name |
[in] | type_flag | field type flag |
[in] | location_id | location id flag |
[in] | dim | field dimension |
[in] | has_previous | does the field has val_pre |
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.
[in] | name | property name |
[in] | zname | zone name |
[in] | dim | property dimension |
[in] | val | reference value for the zone |
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.
[in] | name | property name |
[in] | zname | zone name |
[in] | dim | property dimension (>1) |
[in] | vals | array of values to set |
int cs_physical_property_field_id_by_name | ( | const char * | name | ) |
Return id of field associated to property.
[in] | name | property name |
cs_real_t cs_physical_property_get_ref_value | ( | const char * | name | ) |
Get reference value of a physical property.
[in] | name | property name |
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.
[in] | name | property name |
[in] | zname | zone name |
[in] | retval | array of values to return |
void cs_physical_property_set_ref_value | ( | const char * | name, |
const cs_real_t | val | ||
) |
Set reference value for a physical property.
[in] | name | property name |
[in] | val | new value to set |
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.
[in] | name | property name |
[in] | zname | zone name |
[in] | vals | array of values to set |
void cs_thermal_table_finalize | ( | void | ) |
finalize thermal table.
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.