7.3
general documentation
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-2022 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 typedef enum {
41 
49 
51 
52 typedef enum {
53 
67 
69 
70 /*=============================================================================
71  * Public function prototypes
72  *============================================================================*/
73 
74 /*----------------------------------------------------------------------------
75  * Define thermal table.
76  *----------------------------------------------------------------------------*/
77 
78 void
79 cs_thermal_table_set(const char *material,
80  const char *method,
81  const char *reference,
83  int temp_scale);
84 
85 /*----------------------------------------------------------------------------
86  * Finalize thermal table
87  *----------------------------------------------------------------------------*/
88 
89 void
91 
92 /*----------------------------------------------------------------------------*/
117 /*----------------------------------------------------------------------------*/
118 
119 void
121 
122 /*----------------------------------------------------------------------------
123  * Compute a physical property.
124  *
125  * For values var1 and var2, we can use a stride so that accesses for a given
126  * element with id i will be of the form: var[i*stride]; this allows regular
127  * access with stride 1, and access to constant variables stored as a
128  * single-valued array with a stride of 0.
129  *
130  * parameters:
131  * property <-- property queried
132  * n_vals <-- number of values
133  * var1_stride <-- stride between successive values of var1
134  * var2_stride <-- stride between successive values of var2
135  * var1 <-- values on first plane axis
136  * var2 <-- values on second plane axis
137  * val --> resulting property values
138  *----------------------------------------------------------------------------*/
139 
140 void
142  cs_lnum_t n_vals,
143  cs_lnum_t var1_stride,
144  cs_lnum_t var2_stride,
145  const cs_real_t var1[],
146  const cs_real_t var2[],
147  cs_real_t val[]);
148 
149 /*----------------------------------------------------------------------------
150  * Compute properties with Freesteam in a defined thermal plane.
151  *
152  * parameters:
153  * thermo_plane <-- thermodynamic plane
154  * property <-- property queried
155  * n_vals <-- number of values
156  * var1 <-- values on first plane axis
157  * var2 <-- values on second plane axis
158  * val --> resulting property values
159  *
160  * returns:
161  * floating point value associated with the key id for this field
162  *----------------------------------------------------------------------------*/
163 
164 void
166  cs_phys_prop_type_t property,
167  const cs_lnum_t n_vals,
168  const cs_real_t var1[],
169  const cs_real_t var2[],
170  cs_real_t val[]);
171 
172 /*----------------------------------------------------------------------------*/
180 /*----------------------------------------------------------------------------*/
181 
182 cs_real_t
183 cs_physical_property_get_ref_value(const char *name);
184 
185 /*----------------------------------------------------------------------------*/
192 /*----------------------------------------------------------------------------*/
193 
194 void
195 cs_physical_property_set_ref_value(const char *name,
196  const cs_real_t val);
197 
198 /*----------------------------------------------------------------------------*/
206 /*----------------------------------------------------------------------------*/
207 
208 void
209 cs_physical_property_get_zone_values(const char *name,
210  const char *zname,
211  cs_real_t retval[]);
212 
213 /*----------------------------------------------------------------------------*/
221 /*----------------------------------------------------------------------------*/
222 
223 void
224 cs_physical_property_create(const char *name,
225  const int dim,
226  const cs_real_t refval);
227 
228 /*----------------------------------------------------------------------------*/
237 /*----------------------------------------------------------------------------*/
238 
239 void
241  const char *zname,
242  const int dim,
243  const cs_real_t val);
244 
245 /*----------------------------------------------------------------------------*/
254 /*----------------------------------------------------------------------------*/
255 
256 void
258  const char *zname,
259  const int dim,
260  cs_real_t vals[]);
261 
262 /*----------------------------------------------------------------------------*/
274 /*----------------------------------------------------------------------------*/
275 
276 void
278  int type_flag,
279  int location_id,
280  int dim,
281  bool has_previous);
282 
283 /*----------------------------------------------------------------------------*/
291 /*----------------------------------------------------------------------------*/
292 
293 int
294 cs_physical_property_field_id_by_name(const char *name);
295 
296 /*----------------------------------------------------------------------------*/
304 /*----------------------------------------------------------------------------*/
305 
306 void
308  const char *zname,
309  const cs_real_t vals[]);
310 
311 /*----------------------------------------------------------------------------*/
312 
314 
315 #endif /* __CS_PHYSICAL_PROPERTIES_H__ */
Definition: cs_physical_properties.h:57
Definition: cs_physical_properties.h:61
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:1051
cs_phys_prop_type_t
Definition: cs_physical_properties.h:52
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:306
Definition: cs_physical_properties.h:45
#define BEGIN_C_DECLS
Definition: cs_defs.h:512
void cs_physical_properties_set_coolprop_backend(const char *backend)
Set backend for CoolProp.
Definition: cs_physical_properties.c:466
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:998
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:513
Definition: cs_physical_properties.h:59
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:1070
double cs_real_t
Floating-point value.
Definition: cs_defs.h:322
Definition: cs_physical_properties.h:63
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:975
Definition: cs_physical_properties.h:65
Definition: cs_physical_properties.h:60
cs_phys_prop_thermo_plane_type_t
Definition: cs_physical_properties.h:40
Definition: cs_physical_properties.h:44
Definition: cs_physical_properties.h:56
Definition: cs_physical_properties.h:64
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:626
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:316
#define END_C_DECLS
Definition: cs_defs.h:513
Definition: cs_physical_properties.h:62
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:1197
cs_real_t cs_physical_property_get_ref_value(const char *name)
Get reference value of a physical property.
Definition: cs_physical_properties.c:951
Definition: cs_physical_properties.h:46
int cs_physical_property_field_id_by_name(const char *name)
Return id of field associated to property.
Definition: cs_physical_properties.c:1174
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:1146
Definition: cs_physical_properties.h:43
Definition: cs_physical_properties.h:48
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:1109
Definition: cs_physical_properties.h:42
Definition: cs_physical_properties.h:47
void cs_thermal_table_finalize(void)
finalize thermal table.
Definition: cs_physical_properties.c:404
Definition: cs_physical_properties.h:55
Definition: cs_physical_properties.h:66
Definition: cs_physical_properties.h:54
Definition: cs_physical_properties.h:58