8.0
general documentation
cs_divergence.h
Go to the documentation of this file.
1 #ifndef __CS_DIVERGENCE_H__
2 #define __CS_DIVERGENCE_H__
3 
4 /*============================================================================
5  * Divergence operators.
6  *============================================================================*/
7 
8 /*
9  This file is part of code_saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2023 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  * Local headers
32  *----------------------------------------------------------------------------*/
33 
34 #include "cs_base.h"
35 #include "cs_halo.h"
36 #include "cs_mesh.h"
37 #include "cs_mesh_quantities.h"
38 
39 /*----------------------------------------------------------------------------*/
40 
42 
43 /*=============================================================================
44  * Local Macro definitions
45  *============================================================================*/
46 
47 /*============================================================================
48  * Type definition
49  *============================================================================*/
50 
51 /*============================================================================
52  * Global variables
53  *============================================================================*/
54 
55 /*============================================================================
56  * Public function prototypes for Fortran API
57  *============================================================================*/
58 
59 /*----------------------------------------------------------------------------
60  * Wrapper to cs_mass_flux
61  *----------------------------------------------------------------------------*/
62 
63 void CS_PROCF (inimav, INIMAV)
64 (
65  const int *const f_id,
66  const int *const itypfl,
67  const int *const iflmb0,
68  const int *const init,
69  const int *const inc,
70  const int *const imrgra,
71  const int *const nswrgu,
72  const int *const imligu,
73  const int *const iwarnu,
74  const cs_real_t *const epsrgu,
75  const cs_real_t *const climgu,
76  const cs_real_t rom[],
77  const cs_real_t romb[],
78  const cs_real_3_t vel[],
79  const cs_real_3_t coefav[],
80  const cs_real_33_t coefbv[],
81  cs_real_t i_massflux[],
82  cs_real_t b_massflux[]
83 );
84 
85 /*----------------------------------------------------------------------------
86  * Wrapper to cs_divergence
87  *----------------------------------------------------------------------------*/
88 
89 void CS_PROCF (divmas, DIVMAS)
90 (
91  const int *const init,
92  const cs_real_t i_massflux[],
93  const cs_real_t b_massflux[],
94  cs_real_t diverg[]
95 );
96 
97 /*----------------------------------------------------------------------------
98  * Wrapper to cs_divergence_tensor
99  *----------------------------------------------------------------------------*/
100 
101 void CS_PROCF (divmat, DIVMAT)
102 (
103  const int *const init,
104  const cs_real_3_t i_massflux[],
105  const cs_real_3_t b_massflux[],
106  cs_real_3_t diverg[]
107 );
108 
109 /*----------------------------------------------------------------------------
110  * Wrapper to cs_ext_force_flux
111  *----------------------------------------------------------------------------*/
112 
113 void CS_PROCF (projts, PROJTS)
114 (
115  const int *const init,
116  const int *const nswrgu,
117  const cs_real_3_t frcxt[],
118  const cs_real_t cofbfp[],
119  cs_real_t i_massflux[],
120  cs_real_t b_massflux[],
121  const cs_real_t i_visc[],
122  const cs_real_t b_visc[],
123  const cs_real_t viselx[],
124  const cs_real_t visely[],
125  const cs_real_t viselz[]
126 );
127 
128 /*----------------------------------------------------------------------------
129  * Wrapper to cs_ext_force_anisotropic_flux
130  *----------------------------------------------------------------------------*/
131 
132 void CS_PROCF (projtv, PROJTV)
133 (
134  const int *const init,
135  const int *const nswrgu,
136  const int *const ircflp,
137  const cs_real_3_t frcxt[],
138  const cs_real_t cofbfp[],
139  const cs_real_t i_visc[],
140  const cs_real_t b_visc[],
141  cs_real_6_t viscel[],
142  const cs_real_2_t weighf[],
143  cs_real_t i_massflux[],
144  cs_real_t b_massflux[]
145 );
146 
147 /*----------------------------------------------------------------------------
148  * Wrapper to cs_tensor_face_flux
149  *----------------------------------------------------------------------------*/
150 
151 void CS_PROCF (divrij, DIVRIJ)
152 (
153  const int *const f_id,
154  const int *const itypfl,
155  const int *const iflmb0,
156  const int *const init,
157  const int *const inc,
158  const int *const imrgra,
159  const int *const nswrgu,
160  const int *const imligu,
161  const int *const iwarnu,
162  const cs_real_t *const epsrgu,
163  const cs_real_t *const climgu,
164  const cs_real_t rom[],
165  const cs_real_t romb[],
166  const cs_real_6_t tensorvel[],
167  const cs_real_6_t coefav[],
168  const cs_real_66_t coefbv[],
169  cs_real_3_t i_massflux[],
170  cs_real_3_t b_massflux[]
171 );
172 
173 /*=============================================================================
174  * Public function prototypes
175  *============================================================================*/
176 
177 /*----------------------------------------------------------------------------*/
231 /*----------------------------------------------------------------------------*/
232 
233 void
234 cs_mass_flux(const cs_mesh_t *m,
235  const cs_mesh_quantities_t *fvq,
236  int f_id,
237  int itypfl,
238  int iflmb0,
239  int init,
240  int inc,
241  int imrgra,
242  int nswrgu,
243  int imligu,
244  int iwarnu,
245  double epsrgu,
246  double climgu,
247  const cs_real_t rom[],
248  const cs_real_t romb[],
249  const cs_real_3_t vel[],
250  const cs_real_3_t coefav[],
251  const cs_real_33_t coefbv[],
252  cs_real_t *restrict i_massflux,
253  cs_real_t *restrict b_massflux);
254 
255 /*----------------------------------------------------------------------------*/
271 /*----------------------------------------------------------------------------*/
272 
273 void
274 cs_divergence(const cs_mesh_t *m,
275  int init,
276  const cs_real_t i_massflux[],
277  const cs_real_t b_massflux[],
278  cs_real_t *restrict diverg);
279 
280 /*----------------------------------------------------------------------------*/
296 /*----------------------------------------------------------------------------*/
297 
298 void
300  int init,
301  const cs_real_3_t i_massflux[],
302  const cs_real_3_t b_massflux[],
303  cs_real_3_t *restrict diverg);
304 
305 /*----------------------------------------------------------------------------*/
331 /*----------------------------------------------------------------------------*/
332 
333 void
336  int init,
337  int nswrgu,
338  const cs_real_3_t frcxt[],
339  const cs_real_t cofbfp[],
340  cs_real_t *restrict i_massflux,
341  cs_real_t *restrict b_massflux,
342  const cs_real_t i_visc[],
343  const cs_real_t b_visc[],
344  const cs_real_t viselx[],
345  const cs_real_t visely[],
346  const cs_real_t viselz[]);
347 
348 /*----------------------------------------------------------------------------*/
377 /*----------------------------------------------------------------------------*/
378 
379 void
382  int init,
383  int nswrgp,
384  int ircflp,
385  const cs_real_3_t frcxt[],
386  const cs_real_t cofbfp[],
387  const cs_real_t i_visc[],
388  const cs_real_t b_visc[],
389  cs_real_6_t viscel[],
390  const cs_real_2_t weighf[],
391  cs_real_t *restrict i_massflux,
392  cs_real_t *restrict b_massflux);
393 
394 /*----------------------------------------------------------------------------*/
434 /*----------------------------------------------------------------------------*/
435 
436 void
439  int f_id,
440  int itypfl,
441  int iflmb0,
442  int init,
443  int inc,
444  int imrgra,
445  int nswrgu,
446  int imligu,
447  int iwarnu,
448  double epsrgu,
449  double climgu,
450  const cs_real_t c_rho[],
451  const cs_real_t b_rho[],
452  const cs_real_6_t c_var[],
453  const cs_real_6_t coefav[],
454  const cs_real_66_t coefbv[],
455  cs_real_3_t *restrict i_massflux,
456  cs_real_3_t *restrict b_massflux);
457 
458 /*----------------------------------------------------------------------------*/
459 
461 
462 #endif /* __CS_DIVERGENCE_H__ */
#define restrict
Definition: cs_defs.h:139
#define BEGIN_C_DECLS
Definition: cs_defs.h:509
double cs_real_t
Floating-point value.
Definition: cs_defs.h:319
#define CS_PROCF(x, y)
Definition: cs_defs.h:523
cs_real_t cs_real_66_t[6][6]
6x6 matrix of floating-point values
Definition: cs_defs.h:342
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:332
cs_real_t cs_real_2_t[2]
vector of 2 floating-point values
Definition: cs_defs.h:331
cs_real_t cs_real_6_t[6]
vector of 6 floating-point values
Definition: cs_defs.h:334
#define END_C_DECLS
Definition: cs_defs.h:510
cs_real_t cs_real_33_t[3][3]
3x3 matrix of floating-point values
Definition: cs_defs.h:341
void divmat(const int *const init, const cs_real_3_t i_massflux[], const cs_real_3_t b_massflux[], cs_real_3_t diverg[])
Definition: cs_divergence.c:181
void projts(const int *const init, const int *const nswrgu, const cs_real_3_t frcxt[], const cs_real_t cofbfp[], cs_real_t i_massflux[], cs_real_t b_massflux[], const cs_real_t i_visc[], const cs_real_t b_visc[], const cs_real_t viselx[], const cs_real_t visely[], const cs_real_t viselz[])
Definition: cs_divergence.c:202
void cs_mass_flux(const cs_mesh_t *m, const cs_mesh_quantities_t *fvq, int f_id, int itypfl, int iflmb0, int init, int inc, int imrgra, int nswrgu, int imligu, int iwarnu, double epsrgu, double climgu, const cs_real_t rom[], const cs_real_t romb[], const cs_real_3_t vel[], const cs_real_3_t coefav[], const cs_real_33_t coefbv[], cs_real_t *restrict i_massflux, cs_real_t *restrict b_massflux)
Add to the mass flux .
Definition: cs_divergence.c:380
void cs_divergence(const cs_mesh_t *m, int init, const cs_real_t i_massflux[], const cs_real_t b_massflux[], cs_real_t *restrict diverg)
Add the integrated mass flux on the cells.
Definition: cs_divergence.c:1400
void cs_ext_force_flux(const cs_mesh_t *m, cs_mesh_quantities_t *fvq, int init, int nswrgu, const cs_real_3_t frcxt[], const cs_real_t cofbfp[], cs_real_t *restrict i_massflux, cs_real_t *restrict b_massflux, const cs_real_t i_visc[], const cs_real_t b_visc[], const cs_real_t viselx[], const cs_real_t visely[], const cs_real_t viselz[])
Project the external source terms to the faces in coherence with cs_face_diffusion_scalar for the imp...
Definition: cs_divergence.c:1618
void cs_tensor_divergence(const cs_mesh_t *m, int init, const cs_real_3_t i_massflux[], const cs_real_3_t b_massflux[], cs_real_3_t *restrict diverg)
Add the integrated mass flux on the cells for a tensor variable.
Definition: cs_divergence.c:1502
void divmas(const int *const init, const cs_real_t i_massflux[], const cs_real_t b_massflux[], cs_real_t diverg[])
Definition: cs_divergence.c:160
void cs_tensor_face_flux(const cs_mesh_t *m, cs_mesh_quantities_t *fvq, int f_id, int itypfl, int iflmb0, int init, int inc, int imrgra, int nswrgu, int imligu, int iwarnu, double epsrgu, double climgu, const cs_real_t c_rho[], const cs_real_t b_rho[], const cs_real_6_t c_var[], const cs_real_6_t coefav[], const cs_real_66_t coefbv[], cs_real_3_t *restrict i_massflux, cs_real_3_t *restrict b_massflux)
Add to a flux.
Definition: cs_divergence.c:929
void projtv(const int *const init, const int *const nswrgu, const int *const ircflp, const cs_real_3_t frcxt[], const cs_real_t cofbfp[], const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_6_t viscel[], const cs_real_2_t weighf[], cs_real_t i_massflux[], cs_real_t b_massflux[])
Definition: cs_divergence.c:239
void divrij(const int *const f_id, const int *const itypfl, const int *const iflmb0, const int *const init, const int *const inc, const int *const imrgra, const int *const nswrgu, const int *const imligu, const int *const iwarnu, const cs_real_t *const epsrgu, const cs_real_t *const climgu, const cs_real_t rom[], const cs_real_t romb[], const cs_real_6_t tensorvel[], const cs_real_6_t coefav[], const cs_real_66_t coefbv[], cs_real_3_t i_massflux[], cs_real_3_t b_massflux[])
Definition: cs_divergence.c:275
void inimav(const int *const f_id, const int *const itypfl, const int *const iflmb0, const int *const init, const int *const inc, const int *const imrgra, const int *const nswrgu, const int *const imligu, const int *const iwarnu, const cs_real_t *const epsrgu, const cs_real_t *const climgu, const cs_real_t rom[], const cs_real_t romb[], const cs_real_3_t vel[], const cs_real_3_t coefav[], const cs_real_33_t coefbv[], cs_real_t i_massflux[], cs_real_t b_massflux[])
Definition: cs_divergence.c:109
void cs_ext_force_anisotropic_flux(const cs_mesh_t *m, cs_mesh_quantities_t *fvq, int init, int nswrgp, int ircflp, const cs_real_3_t frcxt[], const cs_real_t cofbfp[], const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_6_t viscel[], const cs_real_2_t weighf[], cs_real_t *restrict i_massflux, cs_real_t *restrict b_massflux)
Project the external source terms to the faces in coherence with cs_face_anisotropic_diffusion_scalar...
Definition: cs_divergence.c:1833
@ vel
Definition: cs_field_pointer.h:68
integer(c_int), pointer, save imrgra
type of gradient reconstruction
Definition: optcal.f90:137
Definition: cs_mesh_quantities.h:92
Definition: cs_mesh.h:85