9.0
general documentation
Loading...
Searching...
No Matches
cs_physical_properties.h
Go to the documentation of this file.
1#ifndef __CS_PHYSICAL_PROPERTIES_H__
2#define __CS_PHYSICAL_PROPERTIES_H__
3
4/*============================================================================
5 * Physical properties computation and management.
6 *============================================================================*/
7
8/*
9 This file is part of code_saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2025 EDF S.A.
12
13 This program is free software; you can redistribute it and/or modify it under
14 the terms of the GNU General Public License as published by the Free Software
15 Foundation; either version 2 of the License, or (at your option) any later
16 version.
17
18 This program is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 details.
22
23 You should have received a copy of the GNU General Public License along with
24 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25 Street, Fifth Floor, Boston, MA 02110-1301, USA.
26*/
27
28/*----------------------------------------------------------------------------*/
29
30/*----------------------------------------------------------------------------
31 * Local headers
32 *----------------------------------------------------------------------------*/
33
34#include "base/cs_defs.h"
35
37
38/*----------------------------------------------------------------------------*/
39
41
42/*============================================================================
43 * Type definitions
44 *============================================================================*/
45
57
75
76/*=============================================================================
77 * Public function prototypes
78 *============================================================================*/
79
80/*----------------------------------------------------------------------------
81 * Define thermal table.
82 *----------------------------------------------------------------------------*/
83
84void
85cs_thermal_table_set(const char *material,
86 const char *method,
87 const char *reference,
89 cs_temperature_scale_t temp_scale);
90
91/*----------------------------------------------------------------------------
92 * Finalize thermal table
93 *----------------------------------------------------------------------------*/
94
95void
97
98/*----------------------------------------------------------------------------
99 * Get current thermal table plane
100 *----------------------------------------------------------------------------*/
101
104
105/*----------------------------------------------------------------------------*/
113/*----------------------------------------------------------------------------*/
114
115const char *
117
118/*----------------------------------------------------------------------------*/
143/*----------------------------------------------------------------------------*/
144
145void
147
148/*----------------------------------------------------------------------------
149 * Compute a physical property.
150 *
151 * For values var1 and var2, we can use a stride so that accesses for a given
152 * element with id i will be of the form: var[i*stride]; this allows regular
153 * access with stride 1, and access to constant variables stored as a
154 * single-valued array with a stride of 0.
155 *
156 * parameters:
157 * property <-- property queried
158 * n_vals <-- number of values
159 * var1_stride <-- stride between successive values of var1
160 * var2_stride <-- stride between successive values of var2
161 * var1 <-- values on first plane axis
162 * var2 <-- values on second plane axis
163 * val --> resulting property values
164 *----------------------------------------------------------------------------*/
165
166void
168 cs_lnum_t n_vals,
169 cs_lnum_t var1_stride,
170 cs_lnum_t var2_stride,
171 const cs_real_t var1[],
172 const cs_real_t var2[],
173 cs_real_t val[]);
174
175/*----------------------------------------------------------------------------*/
183/*----------------------------------------------------------------------------*/
184
186cs_physical_property_get_ref_value(const char *name);
187
188/*----------------------------------------------------------------------------*/
195/*----------------------------------------------------------------------------*/
196
197void
199 const cs_real_t val);
200
201/*----------------------------------------------------------------------------*/
209/*----------------------------------------------------------------------------*/
210
211void
213 const char *zname,
214 cs_real_t retval[]);
215
216/*----------------------------------------------------------------------------*/
224/*----------------------------------------------------------------------------*/
225
226void
227cs_physical_property_create(const char *name,
228 const int dim,
229 const cs_real_t refval);
230
231/*----------------------------------------------------------------------------*/
240/*----------------------------------------------------------------------------*/
241
242void
244 const char *zname,
245 const int dim,
246 const cs_real_t val);
247
248/*----------------------------------------------------------------------------*/
257/*----------------------------------------------------------------------------*/
258
259void
261 const char *zname,
262 const int dim,
263 cs_real_t vals[]);
264
265/*----------------------------------------------------------------------------*/
277/*----------------------------------------------------------------------------*/
278
279void
281 int type_flag,
282 int location_id,
283 int dim,
284 bool has_previous);
285
286/*----------------------------------------------------------------------------*/
294/*----------------------------------------------------------------------------*/
295
296int
298
299/*----------------------------------------------------------------------------*/
307/*----------------------------------------------------------------------------*/
308
309void
311 const char *zname,
312 const cs_real_t vals[]);
313
314/*----------------------------------------------------------------------------*/
315
317
318#endif /* __CS_PHYSICAL_PROPERTIES_H__ */
#define BEGIN_C_DECLS
Definition cs_defs.h:542
double cs_real_t
Floating-point value.
Definition cs_defs.h:342
#define END_C_DECLS
Definition cs_defs.h:543
int cs_lnum_t
local mesh entity id
Definition cs_defs.h:335
void cs_physical_property_set_ref_value(const char *name, const cs_real_t val)
Set reference value for a physical property.
Definition cs_physical_properties.cpp:675
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.
Definition cs_physical_properties.cpp:809
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.
Definition cs_physical_properties.cpp:897
void cs_physical_properties_set_coolprop_backend(const char *backend)
Set backend for CoolProp.
Definition cs_physical_properties.cpp:500
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.
Definition cs_physical_properties.cpp:547
cs_phys_prop_thermo_plane_type_t
Definition cs_physical_properties.h:46
@ CS_PHYS_PROP_PLANE_TX
Definition cs_physical_properties.h:54
@ CS_PHYS_PROP_PLANE_PS
Definition cs_physical_properties.h:50
@ CS_PHYS_PROP_PLANE_TS
Definition cs_physical_properties.h:53
@ CS_PHYS_PROP_PLANE_PT
Definition cs_physical_properties.h:49
@ CS_PHYS_PROP_PLANE_PV
Definition cs_physical_properties.h:52
@ CS_PHYS_PROP_PLANE_PH
Definition cs_physical_properties.h:48
@ CS_PHYS_PROP_PLANE_PU
Definition cs_physical_properties.h:51
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.
Definition cs_physical_properties.cpp:770
cs_real_t cs_physical_property_get_ref_value(const char *name)
Get reference value of a physical property.
Definition cs_physical_properties.cpp:652
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.
Definition cs_physical_properties.cpp:846
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.
Definition cs_physical_properties.cpp:698
void cs_physical_property_create(const char *name, const int dim, const cs_real_t refval)
Create a physical property.
Definition cs_physical_properties.cpp:751
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.
Definition cs_physical_properties.cpp:300
cs_phys_prop_thermo_plane_type_t cs_thermal_table_get_thermo_plane(void)
Get current thermal table plane.
Definition cs_physical_properties.cpp:442
cs_phys_prop_type_t
Definition cs_physical_properties.h:58
@ CS_PHYS_PROP_THERMAL_CONDUCTIVITY
Definition cs_physical_properties.h:70
@ CS_PHYS_PROP_SPECIFIC_VOLUME
Definition cs_physical_properties.h:66
@ CS_PHYS_PROP_TEMPERATURE
Definition cs_physical_properties.h:61
@ CS_PHYS_PROP_PRESSURE
Definition cs_physical_properties.h:60
@ CS_PHYS_PROP_ISOCHORIC_HEAT_CAPACITY
Definition cs_physical_properties.h:65
@ CS_PHYS_PROP_INTERNAL_ENERGY
Definition cs_physical_properties.h:68
@ CS_PHYS_PROP_QUALITY
Definition cs_physical_properties.h:69
@ CS_PHYS_PROP_DENSITY
Definition cs_physical_properties.h:67
@ CS_PHYS_PROP_ENTHALPY
Definition cs_physical_properties.h:62
@ CS_PHYS_PROP_SPEED_OF_SOUND
Definition cs_physical_properties.h:72
@ CS_PHYS_PROP_ISOBARIC_HEAT_CAPACITY
Definition cs_physical_properties.h:64
@ CS_PHYS_PROP_ENTROPY
Definition cs_physical_properties.h:63
@ CS_PHYS_PROP_DYNAMIC_VISCOSITY
Definition cs_physical_properties.h:71
int cs_physical_property_field_id_by_name(const char *name)
Return id of field associated to property.
Definition cs_physical_properties.cpp:874
const char * cs_physical_properties_get_coolprop_backend(void)
Get backend set for CoolProp.
Definition cs_physical_properties.cpp:463
void cs_thermal_table_finalize(void)
finalize thermal table.
Definition cs_physical_properties.cpp:395
cs_temperature_scale_t
Definition cs_thermal_model.h:65