Code_Saturne
CFD tool
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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-2012 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  * BFT library headers
36  *----------------------------------------------------------------------------*/
37 
38 /*----------------------------------------------------------------------------
39  * FVM library headers
40  *----------------------------------------------------------------------------*/
41 
42 /*----------------------------------------------------------------------------
43  * Local headers
44  *----------------------------------------------------------------------------*/
45 
46 #include "cs_base.h"
47 
48 /*----------------------------------------------------------------------------*/
49 
51 
52 /*============================================================================
53  * Structure definition
54  *============================================================================*/
55 
56 /* Structure associated to general properties */
57 
58 typedef struct {
59 
60  cs_real_t cpa; /* Capacite calorifique de l air */
61  cs_real_t cpv; /* Capacite calorifique de la vapeur */
62  cs_real_t cpe; /* Capacite calorifique de l eau */
63  cs_real_t hv0; /* Chaleur latente */
64  cs_real_t rhoe; /* Masse volumique de l eau*/
65  cs_real_t visc; /* Viscosite Dynamique */
66  cs_real_t cond; /* Conductivite */
67  cs_real_t gravx; /* Gravite x */
68  cs_real_t gravy; /* Gravite y */
69  cs_real_t gravz; /* Gravite z */
70 
72 
74 
75 /* Structure associated to air properties */
76 
77 typedef struct {
78 
79  cs_real_t rho_ref; /* Reference density */
80  cs_real_t p_ref; /* Reference pressure */
81  cs_real_t t_ref; /* Reference temperature */
83 
84  cs_real_t g[3]; /* Gravity vector */
85 
87 
88 /*============================================================================
89  * Public function prototypes for Fortran API
90  *============================================================================*/
91 
92 /*----------------------------------------------------------------------------
93  * Calculation of the air humidity at saturation for a given temperature
94  *
95  * Fortran interface:
96  *
97  * SUBROUTINE XSATH
98  * ****************
99  *
100  * DOUBLE PRECISION TH : <- : temperature in Celsius degree
101  * DOUBLE PRECISION XSAT : -> : absolute humidity of saturated air
102  *----------------------------------------------------------------------------*/
103 
104 void CS_PROCF (xsath, XSATH)
105 (
106  const cs_real_t *th,
107  cs_real_t *xsat
108 );
109 
110 /*----------------------------------------------------------------------------
111  * Calculation of the derivative of the absolute humidity at saturation
112  *
113  * Fortran interface:
114  *
115  * SUBROUTINE DXSATH
116  * *****************
117  *
118  * DOUBLE PRECISION TH : <- : temperature in Celsius degree
119  * DOUBLE PRECISION DXSAT : -> : derivative of the humidity of saturated air
120  *----------------------------------------------------------------------------*/
121 
122 void CS_PROCF (dxsath, DXSATH)
123 (
124  const cs_real_t *th,
125  cs_real_t *dxsat
126 );
127 
128 /*----------------------------------------------------------------------------
129  * Communication des proprietes physiques
130  *
131  * Fortran interface:
132  *
133  * SUBROUTINE COMPPF
134  * *****************
135  *----------------------------------------------------------------------------*/
136 
137 void CS_PROCF (ctprof, CTPROF)
138 (
139  const cs_real_t *cpa, /* Capacite calorifique de l air */
140  const cs_real_t *cpv, /* Capacite calorifique de la vapeur */
141  const cs_real_t *cpe, /* Capacite calorifique de l eau */
142  const cs_real_t *hv0, /* Chaleur latente */
143  const cs_real_t *rhoe, /* Masse volumique de l eau*/
144  const cs_real_t *visc, /* Viscosite Dynamique */
145  const cs_real_t *cond, /* Conductivite */
146  const cs_real_t *gravx, /* Gravite x */
147  const cs_real_t *gravy, /* Gravite y */
148  const cs_real_t *gravz /* Gravite z */
149 );
150 
151 /*============================================================================
152  * Prototypes of public function
153  *============================================================================*/
154 
155 /*----------------------------------------------------------------------------
156  * Calculation of the air humidity at saturation for a given temperature
157  *
158  * parameters:
159  * th <-- temperature in Celsius degree
160  *
161  * returns:
162  * absolute humidity of saturated air
163  *----------------------------------------------------------------------------*/
164 
165 cs_real_t
166 cs_ctwr_xsath(const cs_real_t th);
167 
168 /*----------------------------------------------------------------------------
169  * Calculation of moist air mass enthalpy
170  *
171  * parameters:
172  * xair <-- absolute humidity of saturated air
173  * tair <-- air temperature in Celsius degree
174  *
175  * returns:
176  * air mass enthalpy
177  *----------------------------------------------------------------------------*/
178 
179 cs_real_t
180 cs_ctwr_enthair(const cs_real_t xair,
181  const cs_real_t tair);
182 
183 /*----------------------------------------------------------------------------
184  * Calculation water mass enthalpy
185  *
186  * parameters:
187  * teau <-- water temperature in Celsius degree
188  *
189  * returns:
190  * water mass enthalpy
191  *----------------------------------------------------------------------------*/
192 
193 cs_real_t
194 cs_ctwr_heau(const cs_real_t teau);
195 
196 /*----------------------------------------------------------------------------
197  * Calculation of the derivate of the absolute humidity at saturation
198  *
199  * parameters:
200  * th <-- temperature in Celsius degree
201  *
202  * returns:
203  * derivative of the humidity of saturated air
204  *----------------------------------------------------------------------------*/
205 
206 cs_real_t
207 cs_ctwr_dxsath(const cs_real_t th);
208 
209 /*----------------------------------------------------------------------------*/
210 
212 
213 #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:84
cs_real_t cs_ctwr_dxsath(const cs_real_t th)
Definition: cs_ctwr_air_props.c:303
cs_real_t p_ref
Definition: cs_ctwr_air_props.h:80
cs_real_t rho_ref
Definition: cs_ctwr_air_props.h:79
cs_real_t gravx
Definition: cs_ctwr_air_props.h:67
Definition: cs_ctwr_air_props.h:77
#define BEGIN_C_DECLS
Definition: cs_defs.h:365
cs_real_t cpe
Definition: cs_ctwr_air_props.h:62
cs_real_t delta
Definition: cs_ctwr_air_props.h:82
cs_real_t rhoe
Definition: cs_ctwr_air_props.h:64
cs_real_t cs_ctwr_heau(const cs_real_t teau)
Definition: cs_ctwr_air_props.c:282
void xsath(const cs_real_t *th, cs_real_t *xsat)
Definition: cs_ctwr_air_props.c:125
cs_ctwr_fluid_props_t * cs_glob_ctwr_props
Definition: cs_ctwr_air_props.c:69
cs_real_t cpv
Definition: cs_ctwr_air_props.h:61
cs_real_t gravy
Definition: cs_ctwr_air_props.h:68
cs_real_t cond
Definition: cs_ctwr_air_props.h:66
cs_real_t cs_ctwr_enthair(const cs_real_t xair, const cs_real_t tair)
Definition: cs_ctwr_air_props.c:258
#define END_C_DECLS
Definition: cs_defs.h:366
double cs_real_t
Definition: cs_defs.h:264
cs_real_t cpa
Definition: cs_ctwr_air_props.h:60
cs_real_t visc
Definition: cs_ctwr_air_props.h:65
Definition: cs_ctwr_air_props.h:58
#define CS_PROCF(x, y)
Definition: cs_defs.h:379
cs_real_t cs_ctwr_xsath(const cs_real_t th)
Definition: cs_ctwr_air_props.c:170
cs_real_t t_ref
Definition: cs_ctwr_air_props.h:81
cs_real_t hv0
Definition: cs_ctwr_air_props.h:63
cs_real_t gravz
Definition: cs_ctwr_air_props.h:69
void dxsath(const cs_real_t *th, cs_real_t *dxsat)
Definition: cs_ctwr_air_props.c:146