programmer's documentation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cs_ventil.h
Go to the documentation of this file.
1 #ifndef __CS_VENTIL_H__
2 #define __CS_VENTIL_H__
3 
4 /*============================================================================
5  * Management of fans
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2014 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 #include "cs_mesh.h"
41 #include "cs_mesh_quantities.h"
42 
43 /*----------------------------------------------------------------------------*/
44 
46 
47 /*============================================================================
48  * Structure definition
49  *============================================================================*/
50 
51 typedef struct _cs_ventil_t cs_ventil_t;
52 
53 /*============================================================================
54  * Public function prototypes for Fortran API
55  *============================================================================*/
56 
57 /*----------------------------------------------------------------------------
58  * Get the number of fans.
59  *
60  * Fortran interface:
61  *
62  * SUBROUTINE TSTVTL
63  * *****************
64  *
65  * INTEGER NBRVTL : --> : number of fans
66  *----------------------------------------------------------------------------*/
67 
68 void CS_PROCF (tstvtl, TSTVTL)
69 (
70  cs_int_t *const nbrvtl
71 );
72 
73 /*----------------------------------------------------------------------------
74  * Adds a fan.
75  *
76  * Fortran interface:
77  *
78  * SUBROUTINE DEFVTL
79  * *****************
80  *
81  * INTEGER DIMMOD : <-- : Fan model dimension:
82  * : : 1: constant_f; 2: force_profile;
83  * : : 3: force_profile + tangential couple
84  * INTEGER DIMVTL : <-- : Fan dimension:
85  * : : 2: pseudo-2D (extruded mesh)
86  * : : 3: 3D (standard)
87  * DOUBLE PRECISION XYZVT1(3) : <-- : Coo. of the axis point in upstream face
88  * DOUBLE PRECISION XYZVT2(3) : <-- : Coo. of the axis point in downstream face
89  * DOUBLE PRECISION RVVT : <-- : Fan radius
90  * DOUBLE PRECISION RPVT : <-- : Blades radius
91  * DOUBLE PRECISION RMVT : <-- : Hub radius
92  * DOUBLE PRECISION CCARAC(3) : <-- : Coefficients of degre 0, 1 and 2
93  * : : of the characteristic curve
94  * DOUBLE PRECISION TAUVT : <-- : Fan axial couple
95  *----------------------------------------------------------------------------*/
96 
97 void CS_PROCF (defvtl, DEFVTL)
98 (
99  const cs_int_t *const dimmod,
100  const cs_int_t *const dimvtl,
101  const cs_real_t xyzvt1[3],
102  const cs_real_t xyzvt2[3],
103  const cs_real_t *const rvvt,
104  const cs_real_t *const rpvt,
105  const cs_real_t *const rmvt,
106  const cs_real_t ccarac[3],
107  const cs_real_t *const tauvt
108 );
109 
110 /*----------------------------------------------------------------------------
111  * Build the list of cells associated to the fans
112  *
113  * Fotrtran interface:
114  *
115  * SUBROUTINE INIVTL
116  * *****************
117  *----------------------------------------------------------------------------*/
118 
119 void CS_PROCF (inivtl, INIVTL)
120 (
121  void
122 );
123 
124 /*----------------------------------------------------------------------------
125  * Mark the fans and associate the fan number to the cells belonging to
126  * thus fan, 0 otherwise.
127  *
128  * Fortran interface:
129  *
130  * SUBROUTINE NUMVTL (INDIC)
131  * *****************
132  *
133  * INTEGER INDIC(NCELET) : --> : Fan number (0 if outside the fan)
134  *----------------------------------------------------------------------------*/
135 
136 void CS_PROCF (numvtl, NUMVTL)
137 (
138  cs_int_t indic[]
139 );
140 
141 /*----------------------------------------------------------------------------
142  * Calculate the flows through the fans
143  *
144  * Fortran interface:
145  *
146  * SUBROUTINE DEBVTL
147  * *****************
148  *
149  * DOUBLE PRECISION FLUMAS(*) : <-- : Interior faces mass flux
150  * DOUBLE PRECISION FLUMAB(*) : <-- : Boundary faces mass flux
151  * DOUBLE PRECISION RHOFAC(*) : <-- : Density at cells
152  * DOUBLE PRECISION RHOFAB(*) : <-- : Density at boundary faces
153  * DOUBLE PRECISION DEBENT(NBRVTL) : --> : Inlet flow through the fan
154  * DOUBLE PRECISION DEBSOR(NBRVTL) : --> : Outlet flow through the fan
155  *----------------------------------------------------------------------------*/
156 
157 void CS_PROCF (debvtl, DEBVTL)
158 (
159  cs_real_t flumas[],
160  cs_real_t flumab[],
161  cs_real_t rhofac[],
162  cs_real_t rhofab[],
163  cs_real_t debent[],
164  cs_real_t debsor[]
165 );
166 
167 /*----------------------------------------------------------------------------
168  * Calculate the force induced by the fans (needs a previous calculation
169  * of the flows through each fan).
170  *
171  * The induced force is added to the array crvxep (which can have other
172  * contributions).
173  *
174  * Fortran interface:
175  *
176  * subroutine tsvvtl
177  * *****************
178  *
179  * parameters:
180  * idimts <-- Dimension associated to the source
181  * term of velocity (1: X; 2: Y; 3: Z)
182  * crvexp <-> Explicit source term (velocity)
183  *----------------------------------------------------------------------------*/
184 
185 void CS_PROCF (tsvvtl, TSVVTL)
186 (
187  cs_int_t *idimts,
188  cs_real_t crvexp[]
189 );
190 
191 /*============================================================================
192  * Public function prototypes
193  *============================================================================*/
194 
195 /*----------------------------------------------------------------------------
196  * Fan definition (added to the ones previously defined)
197  *
198  * parameters:
199  * dim_modele <-- Fan model dimension:
200  * 1: constant_f
201  * 2: force_profile
202  * 3: force_profile + tangential couple
203  * dim_ventil <-- Fan dimension:
204  * 2: pseudo-2D (extruded mesh)
205  * 3: 3D (standard)
206  * coo_axe_amont <-- Coo. of the axis point in upstream face
207  * coo_axe_aval <-- Coo. of the axis point in downstream face
208  * ray_ventil <-- Fan radius
209  * ray_pales <-- Blades radius
210  * ray_moyeu <-- Hub radius
211  * coeff_carac <-- Coefficients of degre 0, 1 and 2 of
212  the characteristic curve
213  * couple_axial <-- Fan axial couple
214  *----------------------------------------------------------------------------*/
215 
216 void
217 cs_ventil_definit(const cs_int_t dim_modele,
218  const cs_int_t dim_ventil,
219  const cs_real_t coo_axe_amont[3],
220  const cs_real_t coo_axe_aval[3],
221  const cs_real_t ray_ventil,
222  const cs_real_t ray_pales,
223  const cs_real_t ray_moyeu,
224  const cs_real_t coeff_carac[3],
225  const cs_real_t couple_axial);
226 
227 /*----------------------------------------------------------------------------
228  * Destroy the structures associated to fans
229  *----------------------------------------------------------------------------*/
230 
231 void
233 
234 /*----------------------------------------------------------------------------
235  * Looks for the cells belonging to the different fans.
236  *
237  * parameters:
238  * mesh <-- associated mesh structure
239  * mesh_quantities <-- mesh quantities
240  *----------------------------------------------------------------------------*/
241 
242 void
244  const cs_mesh_quantities_t *mesh_quantities);
245 
246 /*----------------------------------------------------------------------------
247  * Calculate the flows through the fans
248  *
249  * parameters:
250  * mesh <-- mesh structure
251  * mesh_qantities <-- mesh quantities
252  * flux_masse_fac <-- interior faces mass flux
253  * flux_masse_fbr <-- boundary faces mass flux
254  * densite_cel <-- density at cells
255  * densite_fbr <-- density at boundary faces
256  *----------------------------------------------------------------------------*/
257 
258 void
260  const cs_mesh_quantities_t *mesh_quantities,
261  const cs_real_t flux_masse_fac[],
262  const cs_real_t flux_masse_fbr[],
263  const cs_real_t densite_cel[],
264  const cs_real_t densite_fbr[]);
265 
266 /*----------------------------------------------------------------------------
267  * Calculate the force induced by the fans (needs a previous calculation
268  * of the flows through each fan).
269  *
270  * The induced force is added to the array CRVXEP (which can have other
271  * other contributions).
272  *
273  * parameters:
274  * mesh_quantities <-- mesh quantities
275  * idim_source <-- Dimension associated to the source term of velocity
276  * (1: X; 2: Y; 3: Z)
277  * t_source <-> Explicit source term for the velocity
278  *----------------------------------------------------------------------------*/
279 
280 void
281 cs_ventil_calcul_force(const cs_mesh_quantities_t *mesh_quantities,
282  const cs_int_t idim_source,
283  cs_real_t t_source[]);
284 
285 /*----------------------------------------------------------------------------*/
286 
288 
289 #endif /* __CS_VENTIL_H__ */
void cs_ventil_calcul_debits(const cs_mesh_t *mesh, const cs_mesh_quantities_t *mesh_quantities, const cs_real_t flux_masse_fac[], const cs_real_t flux_masse_fbr[], const cs_real_t densite_cel[], const cs_real_t densite_fbr[])
Definition: cs_ventil.c:749
#define BEGIN_C_DECLS
Definition: cs_defs.h:405
int cs_int_t
Fortran-compatible integer.
Definition: cs_defs.h:295
void tsvvtl(cs_int_t *idimts, cs_real_t crvexp[])
Definition: cs_ventil.c:342
void inivtl(void)
Definition: cs_ventil.c:251
void cs_ventil_detruit_tous(void)
Definition: cs_ventil.c:458
Definition: cs_mesh.h:62
Definition: mesh.f90:26
void cs_ventil_cree_listes(const cs_mesh_t *mesh, const cs_mesh_quantities_t *mesh_quantities)
Definition: cs_ventil.c:489
Definition: cs_mesh_quantities.h:51
void debvtl(cs_real_t flumas[], cs_real_t flumab[], cs_real_t rhofac[], cs_real_t rhofab[], cs_real_t debent[], cs_real_t debsor[])
Definition: cs_ventil.c:298
void cs_ventil_calcul_force(const cs_mesh_quantities_t *mesh_quantities, const cs_int_t idim_source, cs_real_t t_source[])
Definition: cs_ventil.c:901
void tstvtl(cs_int_t *const nbrvtl)
Definition: cs_ventil.c:186
void cs_ventil_definit(const cs_int_t dim_modele, const cs_int_t dim_ventil, const cs_real_t coo_axe_amont[3], const cs_real_t coo_axe_aval[3], const cs_real_t ray_ventil, const cs_real_t ray_pales, const cs_real_t ray_moyeu, const cs_real_t coeff_carac[3], const cs_real_t couple_axial)
Definition: cs_ventil.c:378
#define END_C_DECLS
Definition: cs_defs.h:406
void defvtl(const cs_int_t *const dimmod, const cs_int_t *const dimvtl, const cs_real_t xyzvt1[3], const cs_real_t xyzvt2[3], const cs_real_t *const rvvt, const cs_real_t *const rpvt, const cs_real_t *const rmvt, const cs_real_t ccarac[3], const cs_real_t *const tauvt)
Definition: cs_ventil.c:218
double cs_real_t
Definition: cs_defs.h:296
#define CS_PROCF(x, y)
Definition: cs_defs.h:419
void numvtl(cs_int_t indic[])
Definition: cs_ventil.c:272