Code_Saturne
CFD tool
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros 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-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  * 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  * other contributions).
173  *
174  * Fortran interface:
175  *
176  * SUBROUTINE TSVVTL (DEBENT, DEBSOR)
177  * *****************
178  *
179  * INTEGER IDIMTS : <-- : Dimension associated to the source
180  * : : term of velocity (1: X; 2: Y; 3: Z)
181  * DOUBLE PRECISION CRVEXP(NCELET) : <-> : Explicit source term (velocity)
182  *----------------------------------------------------------------------------*/
183 
184 void CS_PROCF (tsvvtl, TSVVTL)
185 (
186  cs_int_t *idimts,
187  cs_real_t crvexp[]
188 );
189 
190 /*============================================================================
191  * Public function prototypes
192  *============================================================================*/
193 
194 /*----------------------------------------------------------------------------
195  * Fan definition (added to the ones previously defined)
196  *
197  * parameters:
198  * dim_modele <-- Fan model dimension:
199  * 1: constant_f
200  * 2: force_profile
201  * 3: force_profile + tangential couple
202  * dim_ventil <-- Fan dimension:
203  * 2: pseudo-2D (extruded mesh)
204  * 3: 3D (standard)
205  * coo_axe_amont <-- Coo. of the axis point in upstream face
206  * coo_axe_aval <-- Coo. of the axis point in downstream face
207  * ray_ventil <-- Fan radius
208  * ray_pales <-- Blades radius
209  * ray_moyeu <-- Hub radius
210  * coeff_carac <-- Coefficients of degre 0, 1 and 2 of
211  the characteristic curve
212  * couple_axial <-- Fan axial couple
213  *----------------------------------------------------------------------------*/
214 
215 void
217  const cs_int_t dim_ventil,
218  const cs_real_t coo_axe_amont[3],
219  const cs_real_t coo_axe_aval[3],
220  const cs_real_t ray_ventil,
221  const cs_real_t ray_pales,
222  const cs_real_t ray_moyeu,
223  const cs_real_t coeff_carac[3],
224  const cs_real_t couple_axial);
225 
226 /*----------------------------------------------------------------------------
227  * Destroy the structures associated to fans
228  *----------------------------------------------------------------------------*/
229 
230 void
232 
233 /*----------------------------------------------------------------------------
234  * Looks for the cells belonging to the different fans.
235  *
236  * parameters:
237  * mesh <-- associated mesh structure
238  * mesh_quantities <-- mesh quantities
239  *----------------------------------------------------------------------------*/
240 
241 void
243  const cs_mesh_quantities_t *mesh_quantities);
244 
245 /*----------------------------------------------------------------------------
246  * Calculate the flows through the fans
247  *
248  * parameters:
249  * mesh <-- mesh structure
250  * mesh_qantities <-- mesh quantities
251  * flux_masse_fac <-- interior faces mass flux
252  * flux_masse_fbr <-- boundary faces mass flux
253  * densite_cel <-- density at cells
254  * densite_fbr <-- density at boundary faces
255  *----------------------------------------------------------------------------*/
256 
257 void
259  const cs_mesh_quantities_t *mesh_quantities,
260  const cs_real_t flux_masse_fac[],
261  const cs_real_t flux_masse_fbr[],
262  const cs_real_t densite_cel[],
263  const cs_real_t densite_fbr[]);
264 
265 /*----------------------------------------------------------------------------
266  * Calculate the force induced by the fans (needs a previous calculation
267  * of the flows through each fan).
268  *
269  * The induced force is added to the array CRVXEP (which can have other
270  * other contributions).
271  *
272  * parameters:
273  * mesh_quantities <-- mesh quantities
274  * idim_source <-- Dimension associated to the source term of velocity
275  * (1: X; 2: Y; 3: Z)
276  * t_source <-> Explicit source term for the velocity
277  *----------------------------------------------------------------------------*/
278 
279 void
280 cs_ventil_calcul_force(const cs_mesh_quantities_t *mesh_quantities,
281  const cs_int_t idim_source,
282  cs_real_t t_source[]);
283 
284 /*----------------------------------------------------------------------------*/
285 
287 
288 #endif /* __CS_VENTIL_H__ */
cs_real_t coo_axe_amont[3]
Definition: cs_ventil.c:73
cs_real_t couple_axial
Definition: cs_ventil.c:88
cs_real_t ray_moyeu
Definition: cs_ventil.c:84
cs_real_t ray_ventil
Definition: cs_ventil.c:82
cs_real_t coo_axe_aval[3]
Definition: cs_ventil.c:75
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:751
int dim_modele
Definition: cs_ventil.c:70
#define BEGIN_C_DECLS
Definition: cs_defs.h:365
void tsvvtl(cs_int_t *idimts, cs_real_t crvexp[])
Definition: cs_ventil.c:344
cs_real_t ray_pales
Definition: cs_ventil.c:83
int cs_int_t
Definition: cs_defs.h:263
void inivtl(void)
Definition: cs_ventil.c:255
void cs_ventil_detruit_tous(void)
Definition: cs_ventil.c:460
Definition: cs_mesh.h:62
Definition: mesh.f90:25
Definition: cs_ventil.c:67
void cs_ventil_cree_listes(const cs_mesh_t *mesh, const cs_mesh_quantities_t *mesh_quantities)
Definition: cs_ventil.c:491
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:301
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:903
void tstvtl(cs_int_t *const nbrvtl)
Definition: cs_ventil.c:190
cs_real_t coeff_carac[3]
Definition: cs_ventil.c:85
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:380
typedefBEGIN_C_DECLS struct _cs_ventil_t cs_ventil_t
Definition: cs_ventil.h:51
#define END_C_DECLS
Definition: cs_defs.h:366
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:222
int dim_ventil
Definition: cs_ventil.c:71
double cs_real_t
Definition: cs_defs.h:264
#define CS_PROCF(x, y)
Definition: cs_defs.h:379
void numvtl(cs_int_t indic[])
Definition: cs_ventil.c:276