8.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 "cs_defs.h"
35
36/*----------------------------------------------------------------------------*/
37
39
40/*============================================================================
41 * Type definitions
42 *============================================================================*/
43
55
73
74/*=============================================================================
75 * Public function prototypes
76 *============================================================================*/
77
78/*----------------------------------------------------------------------------
79 * Define thermal table.
80 *----------------------------------------------------------------------------*/
81
82void
83cs_thermal_table_set(const char *material,
84 const char *method,
85 const char *reference,
87 int temp_scale);
88
89/*----------------------------------------------------------------------------
90 * Finalize thermal table
91 *----------------------------------------------------------------------------*/
92
93void
95
96/*----------------------------------------------------------------------------
97 * Get current thermal table plane
98 *----------------------------------------------------------------------------*/
99
102
103/*----------------------------------------------------------------------------*/
111/*----------------------------------------------------------------------------*/
112
113const char *
115
116/*----------------------------------------------------------------------------*/
141/*----------------------------------------------------------------------------*/
142
143void
145
146/*----------------------------------------------------------------------------
147 * Compute a physical property.
148 *
149 * For values var1 and var2, we can use a stride so that accesses for a given
150 * element with id i will be of the form: var[i*stride]; this allows regular
151 * access with stride 1, and access to constant variables stored as a
152 * single-valued array with a stride of 0.
153 *
154 * parameters:
155 * property <-- property queried
156 * n_vals <-- number of values
157 * var1_stride <-- stride between successive values of var1
158 * var2_stride <-- stride between successive values of var2
159 * var1 <-- values on first plane axis
160 * var2 <-- values on second plane axis
161 * val --> resulting property values
162 *----------------------------------------------------------------------------*/
163
164void
166 cs_lnum_t n_vals,
167 cs_lnum_t var1_stride,
168 cs_lnum_t var2_stride,
169 const cs_real_t var1[],
170 const cs_real_t var2[],
171 cs_real_t val[]);
172
173/*----------------------------------------------------------------------------
174 * Compute properties with Freesteam in a defined thermal plane.
175 *
176 * parameters:
177 * thermo_plane <-- thermodynamic plane
178 * property <-- property queried
179 * n_vals <-- number of values
180 * var1 <-- values on first plane axis
181 * var2 <-- values on second plane axis
182 * val --> resulting property values
183 *
184 * returns:
185 * floating point value associated with the key id for this field
186 *----------------------------------------------------------------------------*/
187
188void
190 cs_phys_prop_type_t property,
191 const cs_lnum_t n_vals,
192 const cs_real_t var1[],
193 const cs_real_t var2[],
194 cs_real_t val[]);
195
196/*----------------------------------------------------------------------------*/
204/*----------------------------------------------------------------------------*/
205
207cs_physical_property_get_ref_value(const char *name);
208
209/*----------------------------------------------------------------------------*/
216/*----------------------------------------------------------------------------*/
217
218void
220 const cs_real_t val);
221
222/*----------------------------------------------------------------------------*/
230/*----------------------------------------------------------------------------*/
231
232void
234 const char *zname,
235 cs_real_t retval[]);
236
237/*----------------------------------------------------------------------------*/
245/*----------------------------------------------------------------------------*/
246
247void
248cs_physical_property_create(const char *name,
249 const int dim,
250 const cs_real_t refval);
251
252/*----------------------------------------------------------------------------*/
261/*----------------------------------------------------------------------------*/
262
263void
265 const char *zname,
266 const int dim,
267 const cs_real_t val);
268
269/*----------------------------------------------------------------------------*/
278/*----------------------------------------------------------------------------*/
279
280void
282 const char *zname,
283 const int dim,
284 cs_real_t vals[]);
285
286/*----------------------------------------------------------------------------*/
298/*----------------------------------------------------------------------------*/
299
300void
302 int type_flag,
303 int location_id,
304 int dim,
305 bool has_previous);
306
307/*----------------------------------------------------------------------------*/
315/*----------------------------------------------------------------------------*/
316
317int
319
320/*----------------------------------------------------------------------------*/
328/*----------------------------------------------------------------------------*/
329
330void
332 const char *zname,
333 const cs_real_t vals[]);
334
335/*----------------------------------------------------------------------------*/
336
338
339#endif /* __CS_PHYSICAL_PROPERTIES_H__ */
#define BEGIN_C_DECLS
Definition cs_defs.h:509
double cs_real_t
Floating-point value.
Definition cs_defs.h:319
#define END_C_DECLS
Definition cs_defs.h:510
int cs_lnum_t
local mesh entity id
Definition cs_defs.h:313
void cs_phys_prop_freesteam(cs_phys_prop_thermo_plane_type_t thermo_plane, cs_phys_prop_type_t property, const cs_lnum_t n_vals, const cs_real_t var1[], const cs_real_t var2[], cs_real_t val[])
Compute properties with Freesteam in a defined thermal plane.
Definition cs_physical_properties.c:677
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.c:1025
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.c:1159
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.c:1247
void cs_physical_properties_set_coolprop_backend(const char *backend)
Set backend for CoolProp.
Definition cs_physical_properties.c:512
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.c:561
cs_phys_prop_thermo_plane_type_t
Definition cs_physical_properties.h:44
@ CS_PHYS_PROP_PLANE_TX
Definition cs_physical_properties.h:52
@ CS_PHYS_PROP_PLANE_PS
Definition cs_physical_properties.h:48
@ CS_PHYS_PROP_PLANE_TS
Definition cs_physical_properties.h:51
@ CS_PHYS_PROP_PLANE_PT
Definition cs_physical_properties.h:47
@ CS_PHYS_PROP_PLANE_PV
Definition cs_physical_properties.h:50
@ CS_PHYS_PROP_PLANE_PH
Definition cs_physical_properties.h:46
@ CS_PHYS_PROP_PLANE_PU
Definition cs_physical_properties.h:49
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.c:1120
cs_real_t cs_physical_property_get_ref_value(const char *name)
Get reference value of a physical property.
Definition cs_physical_properties.c:1002
void cs_thermal_table_set(const char *material, const char *method, const char *reference, cs_phys_prop_thermo_plane_type_t thermo_plane, int temp_scale)
Define thermal table.
Definition cs_physical_properties.c:309
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.c:1196
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.c:1048
void cs_physical_property_create(const char *name, const int dim, const cs_real_t refval)
Create a physical property.
Definition cs_physical_properties.c:1101
cs_phys_prop_thermo_plane_type_t cs_thermal_table_get_thermo_plane(void)
Get current thermal table plane.
Definition cs_physical_properties.c:454
cs_phys_prop_type_t
Definition cs_physical_properties.h:56
@ CS_PHYS_PROP_THERMAL_CONDUCTIVITY
Definition cs_physical_properties.h:68
@ CS_PHYS_PROP_SPECIFIC_VOLUME
Definition cs_physical_properties.h:64
@ CS_PHYS_PROP_TEMPERATURE
Definition cs_physical_properties.h:59
@ CS_PHYS_PROP_PRESSURE
Definition cs_physical_properties.h:58
@ CS_PHYS_PROP_ISOCHORIC_HEAT_CAPACITY
Definition cs_physical_properties.h:63
@ CS_PHYS_PROP_INTERNAL_ENERGY
Definition cs_physical_properties.h:66
@ CS_PHYS_PROP_QUALITY
Definition cs_physical_properties.h:67
@ CS_PHYS_PROP_DENSITY
Definition cs_physical_properties.h:65
@ CS_PHYS_PROP_ENTHALPY
Definition cs_physical_properties.h:60
@ CS_PHYS_PROP_SPEED_OF_SOUND
Definition cs_physical_properties.h:70
@ CS_PHYS_PROP_ISOBARIC_HEAT_CAPACITY
Definition cs_physical_properties.h:62
@ CS_PHYS_PROP_ENTROPY
Definition cs_physical_properties.h:61
@ CS_PHYS_PROP_DYNAMIC_VISCOSITY
Definition cs_physical_properties.h:69
int cs_physical_property_field_id_by_name(const char *name)
Return id of field associated to property.
Definition cs_physical_properties.c:1224
const char * cs_physical_properties_get_coolprop_backend(void)
Get backend set for CoolProp.
Definition cs_physical_properties.c:475
void cs_thermal_table_finalize(void)
finalize thermal table.
Definition cs_physical_properties.c:407