programmer's documentation
cs_ctwr_air_props.h
Go to the documentation of this file.
1 #ifndef __CS_CTWR_AIR_PROPS_H__
2 #define __CS_CTWR_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-2015 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 cpa; /* Capacite calorifique de l air */
53  cs_real_t cpv; /* Capacite calorifique de la vapeur */
54  cs_real_t cpe; /* Capacite calorifique de l eau */
55  cs_real_t hv0; /* Chaleur latente */
56  cs_real_t rhoe; /* Masse volumique de l eau*/
57  cs_real_t visc; /* Viscosite Dynamique */
58  cs_real_t cond; /* Conductivite */
59  cs_real_t gravx; /* Gravite x */
60  cs_real_t gravy; /* Gravite y */
61  cs_real_t gravz; /* Gravite z */
62 
64 
66 
67 /* Structure associated to air properties */
68 
69 typedef struct {
70 
71  cs_real_t rho_ref; /* Reference density */
72  cs_real_t p_ref; /* Reference pressure */
73  cs_real_t t_ref; /* Reference temperature */
75 
76  cs_real_t g[3]; /* Gravity vector */
77 
79 
80 /*============================================================================
81  * Public function prototypes for Fortran API
82  *============================================================================*/
83 
84 /*----------------------------------------------------------------------------
85  * Calculation of the air humidity at saturation for a given temperature
86  *
87  * Fortran interface:
88  *
89  * SUBROUTINE XSATH
90  * ****************
91  *
92  * DOUBLE PRECISION TH : <- : temperature in Celsius degree
93  * DOUBLE PRECISION XSAT : -> : absolute humidity of saturated air
94  *----------------------------------------------------------------------------*/
95 
96 void CS_PROCF (xsath, XSATH)
97 (
98  const cs_real_t *th,
99  cs_real_t *xsat
100 );
101 
102 /*----------------------------------------------------------------------------
103  * Calculation of the derivative of the absolute humidity at saturation
104  *
105  * Fortran interface:
106  *
107  * SUBROUTINE DXSATH
108  * *****************
109  *
110  * DOUBLE PRECISION TH : <- : temperature in Celsius degree
111  * DOUBLE PRECISION DXSAT : -> : derivative of the humidity of saturated air
112  *----------------------------------------------------------------------------*/
113 
114 void CS_PROCF (dxsath, DXSATH)
115 (
116  const cs_real_t *th,
117  cs_real_t *dxsat
118 );
119 
120 /*----------------------------------------------------------------------------
121  * Communication des proprietes physiques
122  *
123  * Fortran interface:
124  *
125  * SUBROUTINE COMPPF
126  * *****************
127  *----------------------------------------------------------------------------*/
128 
129 void CS_PROCF (ctprof, CTPROF)
130 (
131  const cs_real_t *cpa, /* Capacite calorifique de l air */
132  const cs_real_t *cpv, /* Capacite calorifique de la vapeur */
133  const cs_real_t *cpe, /* Capacite calorifique de l eau */
134  const cs_real_t *hv0, /* Chaleur latente */
135  const cs_real_t *rhoe, /* Masse volumique de l eau*/
136  const cs_real_t *visc, /* Viscosite Dynamique */
137  const cs_real_t *cond, /* Conductivite */
138  const cs_real_t *gravx, /* Gravite x */
139  const cs_real_t *gravy, /* Gravite y */
140  const cs_real_t *gravz /* Gravite z */
141 );
142 
143 /*============================================================================
144  * Prototypes of public function
145  *============================================================================*/
146 
147 /*----------------------------------------------------------------------------
148  * Calculation of the air humidity at saturation for a given temperature
149  *
150  * parameters:
151  * th <-- temperature in Celsius degree
152  *
153  * returns:
154  * absolute humidity of saturated air
155  *----------------------------------------------------------------------------*/
156 
157 cs_real_t
158 cs_ctwr_xsath(const cs_real_t th);
159 
160 /*----------------------------------------------------------------------------
161  * Calculation of moist air mass enthalpy
162  *
163  * parameters:
164  * xair <-- absolute humidity of saturated air
165  * tair <-- air temperature in Celsius degree
166  *
167  * returns:
168  * air mass enthalpy
169  *----------------------------------------------------------------------------*/
170 
171 cs_real_t
172 cs_ctwr_enthair(const cs_real_t xair,
173  const cs_real_t tair);
174 
175 /*----------------------------------------------------------------------------
176  * Calculation water mass enthalpy
177  *
178  * parameters:
179  * teau <-- water temperature in Celsius degree
180  *
181  * returns:
182  * water mass enthalpy
183  *----------------------------------------------------------------------------*/
184 
185 cs_real_t
186 cs_ctwr_heau(const cs_real_t teau);
187 
188 /*----------------------------------------------------------------------------
189  * Calculation of the derivate of the absolute humidity at saturation
190  *
191  * parameters:
192  * th <-- temperature in Celsius degree
193  *
194  * returns:
195  * derivative of the humidity of saturated air
196  *----------------------------------------------------------------------------*/
197 
198 cs_real_t
200 
201 /*----------------------------------------------------------------------------*/
202 
204 
205 #endif /* __CS_CTWR_AIR_PROPERTIES_H__ */
void ctprof(const cs_real_t *cpa, const cs_real_t *cpv, const cs_real_t *cpe, const cs_real_t *hv0, const cs_real_t *rhoe, const cs_real_t *visc, const cs_real_t *cond, const cs_real_t *gravx, const cs_real_t *gravy, const cs_real_t *gravz)
Definition: cs_ctwr_air_props.c:76
cs_real_t cs_ctwr_dxsath(const cs_real_t th)
Definition: cs_ctwr_air_props.c:295
cs_real_t p_ref
Definition: cs_ctwr_air_props.h:72
cs_real_t rho_ref
Definition: cs_ctwr_air_props.h:71
cs_real_t gravx
Definition: cs_ctwr_air_props.h:59
Definition: cs_ctwr_air_props.h:69
#define BEGIN_C_DECLS
Definition: cs_defs.h:429
cs_real_t cpe
Definition: cs_ctwr_air_props.h:54
cs_real_t delta
Definition: cs_ctwr_air_props.h:74
double precision, dimension(npot), save th
temperature (in K)
Definition: ppthch.f90:90
cs_real_t rhoe
Definition: cs_ctwr_air_props.h:56
cs_real_t cs_ctwr_heau(const cs_real_t teau)
Definition: cs_ctwr_air_props.c:274
void xsath(const cs_real_t *th, cs_real_t *xsat)
Definition: cs_ctwr_air_props.c:117
cs_ctwr_fluid_props_t * cs_glob_ctwr_props
Definition: cs_ctwr_air_props.c:61
cs_real_t cpv
Definition: cs_ctwr_air_props.h:53
cs_real_t gravy
Definition: cs_ctwr_air_props.h:60
cs_real_t cond
Definition: cs_ctwr_air_props.h:58
cs_real_t cs_ctwr_enthair(const cs_real_t xair, const cs_real_t tair)
Definition: cs_ctwr_air_props.c:250
#define END_C_DECLS
Definition: cs_defs.h:430
double cs_real_t
Definition: cs_defs.h:296
cs_real_t cpa
Definition: cs_ctwr_air_props.h:52
cs_real_t visc
Definition: cs_ctwr_air_props.h:57
Definition: cs_ctwr_air_props.h:50
#define CS_PROCF(x, y)
Definition: cs_defs.h:453
cs_real_t cs_ctwr_xsath(const cs_real_t th)
Definition: cs_ctwr_air_props.c:162
cs_real_t t_ref
Definition: cs_ctwr_air_props.h:73
cs_real_t hv0
Definition: cs_ctwr_air_props.h:55
cs_real_t gravz
Definition: cs_ctwr_air_props.h:61
void dxsath(const cs_real_t *th, cs_real_t *dxsat)
Definition: cs_ctwr_air_props.c:138