~ubuntu-branches/ubuntu/precise/code-saturne/precise

« back to all changes in this revision

Viewing changes to src/ctwr/cs_ctwr_air_props.h

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2011-11-01 17:43:32 UTC
  • mto: (6.1.7 sid)
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: package-import@ubuntu.com-20111101174332-tl4vk45no0x3emc3
Tags: upstream-2.1.0
ImportĀ upstreamĀ versionĀ 2.1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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-2011 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
 
 
50
BEGIN_C_DECLS
 
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
 
 
71
} cs_ctwr_fluid_props_t;
 
72
 
 
73
extern  cs_ctwr_fluid_props_t  *cs_glob_ctwr_props;
 
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 */
 
82
  cs_real_t  delta;
 
83
 
 
84
  cs_real_t  g[3]; /* Gravity vector */
 
85
 
 
86
} cs_ctwr_air_props_t;
 
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
 
 
211
END_C_DECLS
 
212
 
 
213
#endif /* __CS_CTWR_AIR_PROPERTIES_H__ */