8.0
general documentation
cs_air_props.h
Go to the documentation of this file.
1 #ifndef __CS_AIR_PROPS_H__
2 #define __CS_AIR_PROPS_H__
3 
4 /*============================================================================
5  * Specific laws for air properties (temperature, enthalpy)
6  *============================================================================*/
7 
8 /*
9  This file is part of code_saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2023 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  * Standard C library headers
32  *----------------------------------------------------------------------------*/
33 
34 /*----------------------------------------------------------------------------
35  * Local headers
36  *----------------------------------------------------------------------------*/
37 
38 #include "cs_base.h"
39 
40 /*----------------------------------------------------------------------------*/
41 
43 
44 /*============================================================================
45  * Structure definition
46  *============================================================================*/
47 
48 /* Structure associated to general properties */
49 
50 typedef struct {
51 
52  cs_real_t humidity0; /* Reference humidity */
53  cs_real_t cp_a; /* Specific heat of dry air */
54  cs_real_t cp_v; /* Specific heat of vapor */
55  cs_real_t cp_l; /* Specific heat of liquid water */
56  cs_real_t hv0; /* Chaleur latente */
57  cs_real_t rho_l; /* Masse volumique de l eau */
58  cs_real_t lambda_h; /* Humid air conductivity */
59  cs_real_t lambda_l; /* Water conductivity */
60  cs_real_t droplet_diam; /* Drop diameter for rain zones */
61  cs_real_t molmass_rat; /* Ratio of the molar mass (H2O) over the
62  molar mass (air) */
63 
65 
67 
68 /*============================================================================
69  * Public function prototypes for Fortran API
70  *============================================================================*/
71 
72 /*============================================================================
73  * Prototypes of public function
74  *============================================================================*/
75 
76 /*----------------------------------------------------------------------------*/
84 /*----------------------------------------------------------------------------*/
85 
88 
89 /*----------------------------------------------------------------------------*/
97 /*----------------------------------------------------------------------------*/
98 
100 cs_air_hvap(cs_real_t t_vap);
101 
102 /*----------------------------------------------------------------------------*/
111 /*----------------------------------------------------------------------------*/
112 
113 cs_real_t
115  cs_real_t p0);
116 
117 /*----------------------------------------------------------------------------*/
126 /*----------------------------------------------------------------------------*/
127 
128 cs_real_t
130  cs_real_t x_s);
131 
132 /*----------------------------------------------------------------------------*/
143 /*----------------------------------------------------------------------------*/
144 
145 cs_real_t
147  cs_real_t x,
148  cs_real_t x_s,
149  cs_real_t t_h);
150 
151 /*----------------------------------------------------------------------------*/
162 /*----------------------------------------------------------------------------*/
163 
164 cs_real_t
166  cs_real_t x,
167  cs_real_t x_s,
168  cs_real_t h_h);
169 
170 /*----------------------------------------------------------------------------*/
178 /*----------------------------------------------------------------------------*/
179 
180 cs_real_t
182 
183 /*----------------------------------------------------------------------------*/
191 /*----------------------------------------------------------------------------*/
192 
193 cs_real_t
195 
196 /*----------------------------------------------------------------------------*/
197 
198 /*----------------------------------------------------------------------------*/
207 /*----------------------------------------------------------------------------*/
208 
209 cs_real_t
211  cs_real_t p);
212 
213 /*----------------------------------------------------------------------------*/
223 /*----------------------------------------------------------------------------*/
224 
225 cs_real_t
227  cs_real_t p);
228 
229 /*----------------------------------------------------------------------------*/
238 /*----------------------------------------------------------------------------*/
239 
240 cs_real_t
242 
243 /*----------------------------------------------------------------------------*/
252 /*----------------------------------------------------------------------------*/
253 
254 cs_real_t
255 cs_air_x_to_yw(const cs_real_t x);
256 
257 /*----------------------------------------------------------------------------*/
266 /*----------------------------------------------------------------------------*/
267 
268 cs_real_t
270 
271 /*----------------------------------------------------------------------------*/
283 /*----------------------------------------------------------------------------*/
284 
285 void
286 cs_rho_humidair(cs_real_t ywm, //TODO rename yw_h
287  cs_real_t t_liq,
288  cs_real_t p,
289  cs_real_t *yw_liq,
290  cs_real_t *t_h,
291  cs_real_t *rho_h);
292 
293 /*----------------------------------------------------------------------------*/
306 /*----------------------------------------------------------------------------*/
307 
308 cs_real_t
310  cs_real_t rho0,
311  cs_real_t p0,
312  cs_real_t t0,
313  cs_real_t molmassrat,
314  cs_real_t t_h);
315 
316 /*----------------------------------------------------------------------------*/
317 
319 
320 #endif /* __CS_AIR_PROPERTIES_H__ */
cs_real_t cs_liq_h_to_t(cs_real_t h_l)
Calculation of the temperature of liquid water.
Definition: cs_air_props.c:351
cs_air_fluid_props_t * cs_glob_air_props
Definition: cs_air_props.c:86
cs_real_t cs_air_yw_sat(cs_real_t t_c, cs_real_t p)
Calculation of the air water mass fraction at saturation for a given temperature.
Definition: cs_air_props.c:433
cs_real_t cs_air_x_sat(cs_real_t t_c, cs_real_t p)
Calculation of the air humidity at saturation for a given temperature.
Definition: cs_air_props.c:393
cs_real_t cs_air_cp_humidair(cs_real_t x, cs_real_t x_s)
Calculation of the Cp of humid air.
Definition: cs_air_props.c:259
cs_real_t cs_liq_t_to_h(cs_real_t t_l)
Calculation of the specific enthalpy of liquid water.
Definition: cs_air_props.c:372
cs_real_t cs_air_x_to_yw(const cs_real_t x)
Convert the absolute humidity of humid air to the air water mass fraction qwt = Ym = mw/mh.
Definition: cs_air_props.c:533
cs_real_t cs_air_h_l(cs_real_t t_l)
Calculation water mass enthalpy.
Definition: cs_air_props.c:124
cs_real_t cs_air_rho_humidair(cs_real_t x, cs_real_t rho0, cs_real_t p0, cs_real_t t0, cs_real_t molmassrat, cs_real_t t_h)
Calculation of the density of humid air.
Definition: cs_air_props.c:643
cs_real_t cs_air_yw_to_x(cs_real_t qw)
Convert the air water mass fraction qwt = Ym = mw/mh to the absolute humidity of humid air.
Definition: cs_air_props.c:554
void cs_rho_humidair(cs_real_t ywm, cs_real_t t_liq, cs_real_t p, cs_real_t *yw_liq, cs_real_t *t_h, cs_real_t *rho_h)
Calculation of the density of humid air.
Definition: cs_air_props.c:579
cs_real_t cs_air_hvap(cs_real_t t_vap)
Calculation water vapor mass enthalpy.
Definition: cs_air_props.c:142
cs_real_t cs_air_dxsath(cs_real_t th, cs_real_t p0)
Calculation of the derivate of the absolute humidity at saturation.
Definition: cs_air_props.c:166
cs_real_t cs_air_pwv_sat(cs_real_t t_c)
Computes the saturation water vapor pressure function of the temperature (in Celsius)
Definition: cs_air_props.c:458
cs_real_t cs_air_t_humidair(cs_real_t cp_h, cs_real_t x, cs_real_t x_s, cs_real_t h_h)
Calculation of the temperature of humid air.
Definition: cs_air_props.c:323
cs_real_t cs_air_h_humidair(cs_real_t cp_h, cs_real_t x, cs_real_t x_s, cs_real_t t_h)
Calculation of the specific enthalpy of humid air.
Definition: cs_air_props.c:290
#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
@ h_l
Definition: cs_field_pointer.h:202
@ p
Definition: cs_field_pointer.h:67
@ t_l
Definition: cs_field_pointer.h:201
double precision, dimension(:,:,:), allocatable qw
Definition: atimbr.f90:109
real(c_double), pointer, save p0
reference pressure for the total pressure.
Definition: cstphy.f90:167
real(c_double), pointer, save t0
reference temperature.
Definition: cstphy.f90:214
double precision, dimension(npot), save th
temperature (in K)
Definition: ppthch.f90:119
Definition: cs_air_props.h:50
cs_real_t cp_l
Definition: cs_air_props.h:55
cs_real_t cp_v
Definition: cs_air_props.h:54
cs_real_t humidity0
Definition: cs_air_props.h:52
cs_real_t droplet_diam
Definition: cs_air_props.h:60
cs_real_t lambda_l
Definition: cs_air_props.h:59
cs_real_t molmass_rat
Definition: cs_air_props.h:61
cs_real_t rho_l
Definition: cs_air_props.h:57
cs_real_t cp_a
Definition: cs_air_props.h:53
cs_real_t lambda_h
Definition: cs_air_props.h:58
cs_real_t hv0
Definition: cs_air_props.h:56