My Project
programmer's 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-2019 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 
37 /*----------------------------------------------------------------------------*/
38 
40 
41 /*=============================================================================
42  * Local Macro definitions
43  *============================================================================*/
44 
45 /*============================================================================
46  * Type definition
47  *============================================================================*/
48 
49 /*============================================================================
50  * Global variables
51  *============================================================================*/
52 
53 /*============================================================================
54  * Public function prototypes for Fortran API
55  *============================================================================*/
56 
57 /*----------------------------------------------------------------------------
58  * Wrapper to cs_mass_flux
59  *----------------------------------------------------------------------------*/
60 
61 void CS_PROCF (inimav, INIMAV)
62 (
63  const cs_int_t *const f_id,
64  const cs_int_t *const itypfl,
65  const cs_int_t *const iflmb0,
66  const cs_int_t *const init,
67  const cs_int_t *const inc,
68  const cs_int_t *const imrgra,
69  const cs_int_t *const nswrgu,
70  const cs_int_t *const imligu,
71  const cs_int_t *const iwarnu,
72  const cs_real_t *const epsrgu,
73  const cs_real_t *const climgu,
74  const cs_real_t rom[],
75  const cs_real_t romb[],
76  const cs_real_3_t vel[],
77  const cs_real_3_t coefav[],
78  const cs_real_33_t coefbv[],
81 );
82 
83 /*----------------------------------------------------------------------------
84  * Wrapper to cs_divergence
85  *----------------------------------------------------------------------------*/
86 
87 void CS_PROCF (divmas, DIVMAS)
88 (
89  const cs_int_t *const init,
91  const cs_real_t b_massflux[],
93 );
94 
95 /*----------------------------------------------------------------------------
96  * Wrapper to cs_divergence_tensor
97  *----------------------------------------------------------------------------*/
98 
99 void CS_PROCF (divmat, DIVMAT)
100 (
101  const cs_int_t *const init,
102  const cs_real_3_t i_massflux[],
103  const cs_real_3_t b_massflux[],
105 );
106 
107 /*----------------------------------------------------------------------------
108  * Wrapper to cs_ext_force_flux
109  *----------------------------------------------------------------------------*/
110 
111 void CS_PROCF (projts, PROJTS)
112 (
113  const cs_int_t *const init,
114  const cs_int_t *const nswrgu,
115  const cs_real_3_t frcxt[],
116  const cs_real_t cofbfp[],
119  const cs_real_t i_visc[],
120  const cs_real_t b_visc[],
121  const cs_real_t viselx[],
122  const cs_real_t visely[],
123  const cs_real_t viselz[]
124 );
125 
126 /*----------------------------------------------------------------------------
127  * Wrapper to cs_ext_force_anisotropic_flux
128  *----------------------------------------------------------------------------*/
129 
130 void CS_PROCF (projtv, PROJTV)
131 (
132  const cs_int_t *const init,
133  const cs_int_t *const nswrgu,
134  const cs_int_t *const ircflp,
135  const cs_real_3_t frcxt[],
136  const cs_real_t cofbfp[],
137  const cs_real_t i_visc[],
138  const cs_real_t b_visc[],
140  const cs_real_2_t weighf[],
143 );
144 
145 /*----------------------------------------------------------------------------
146  * Wrapper to cs_tensor_face_flux
147  *----------------------------------------------------------------------------*/
148 
149 void CS_PROCF (divrij, DIVRIJ)
150 (
151  const cs_int_t *const f_id,
152  const cs_int_t *const itypfl,
153  const cs_int_t *const iflmb0,
154  const cs_int_t *const init,
155  const cs_int_t *const inc,
156  const cs_int_t *const imrgra,
157  const cs_int_t *const nswrgu,
158  const cs_int_t *const imligu,
159  const cs_int_t *const iwarnu,
160  const cs_real_t *const epsrgu,
161  const cs_real_t *const climgu,
162  const cs_real_t rom[],
163  const cs_real_t romb[],
164  const cs_real_6_t tensorvel[],
165  const cs_real_6_t coefav[],
166  const cs_real_66_t coefbv[],
169 );
170 
171 /*=============================================================================
172  * Public function prototypes
173  *============================================================================*/
174 
175 /*----------------------------------------------------------------------------*/
229 /*----------------------------------------------------------------------------*/
230 
231 void
232 cs_mass_flux(const cs_mesh_t *m,
234  int f_id,
235  int itypfl,
236  int iflmb0,
237  int init,
238  int inc,
239  int imrgra,
240  int nswrgu,
241  int imligu,
242  int iwarnu,
243  double epsrgu,
244  double climgu,
245  const cs_real_t rom[],
246  const cs_real_t romb[],
247  const cs_real_3_t vel[],
248  const cs_real_3_t coefav[],
249  const cs_real_33_t coefbv[],
252 
253 /*----------------------------------------------------------------------------*/
269 /*----------------------------------------------------------------------------*/
270 
271 void
272 cs_divergence(const cs_mesh_t *m,
273  int init,
274  const cs_real_t i_massflux[],
275  const cs_real_t b_massflux[],
277 
278 /*----------------------------------------------------------------------------*/
294 /*----------------------------------------------------------------------------*/
295 
296 void
298  int init,
299  const cs_real_3_t i_massflux[],
300  const cs_real_3_t b_massflux[],
302 
303 /*----------------------------------------------------------------------------*/
329 /*----------------------------------------------------------------------------*/
330 
331 void
334  int init,
335  int nswrgu,
336  const cs_real_3_t frcxt[],
337  const cs_real_t cofbfp[],
340  const cs_real_t i_visc[],
341  const cs_real_t b_visc[],
342  const cs_real_t viselx[],
343  const cs_real_t visely[],
344  const cs_real_t viselz[]);
345 
346 /*----------------------------------------------------------------------------*/
375 /*----------------------------------------------------------------------------*/
376 
377 void
380  int init,
381  int nswrgp,
382  int ircflp,
383  const cs_real_3_t frcxt[],
384  const cs_real_t cofbfp[],
385  const cs_real_t i_visc[],
386  const cs_real_t b_visc[],
388  const cs_real_2_t weighf[],
391 
392 /*----------------------------------------------------------------------------*/
432 /*----------------------------------------------------------------------------*/
433 
434 void
437  int f_id,
438  int itypfl,
439  int iflmb0,
440  int init,
441  int inc,
442  int imrgra,
443  int nswrgu,
444  int imligu,
445  int iwarnu,
446  double epsrgu,
447  double climgu,
448  const cs_real_t c_rho[],
449  const cs_real_t b_rho[],
450  const cs_real_6_t c_var[],
451  const cs_real_6_t coefav[],
452  const cs_real_66_t coefbv[],
455 
456 /*----------------------------------------------------------------------------*/
457 
459 
460 #endif /* __CS_DIVERGENCE_H__ */
visely
void const cs_int_t *const const cs_real_3_t const cs_real_t cs_real_t cs_real_t const cs_real_t const cs_real_t const cs_real_t const cs_real_t visely[]
Definition: cs_divergence.h:114
f_id
void const int * f_id
Definition: cs_gui.h:292
CS_PROCF
void CS_PROCF(inimav, INIMAV)(const cs_int_t *const f_id
init
void const cs_int_t *const const cs_int_t *const const cs_int_t *const init
Definition: cs_divergence.h:64
cs_ext_force_anisotropic_flux
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:1864
weighf
void const cs_int_t *const const cs_int_t *const const cs_real_3_t const cs_real_t const cs_real_t const cs_real_t cs_real_6_t const cs_real_2_t weighf[]
Definition: cs_divergence.h:133
frcxt
void const cs_int_t *const const cs_real_3_t frcxt[]
Definition: cs_divergence.h:114
itypfl
void const cs_int_t *const itypfl
Definition: cs_divergence.h:64
restrict
#define restrict
Definition: cs_defs.h:127
viselz
void const cs_int_t *const const cs_real_3_t const cs_real_t cs_real_t cs_real_t const cs_real_t const cs_real_t const cs_real_t const cs_real_t const cs_real_t viselz[]
Definition: cs_divergence.h:114
cs_real_3_t
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:315
cs_real_2_t
cs_real_t cs_real_2_t[2]
vector of 2 floating-point values
Definition: cs_defs.h:314
iflmb0
void const cs_int_t *const const cs_int_t *const iflmb0
Definition: cs_divergence.h:64
b_visc
void const cs_int_t *const const cs_real_3_t const cs_real_t cs_real_t cs_real_t const cs_real_t const cs_real_t b_visc[]
Definition: cs_divergence.h:114
iwarnu
void const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const iwarnu
Definition: cs_divergence.h:64
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
cs_tensor_divergence
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:1511
diverg
void const cs_real_t const cs_real_t cs_real_t diverg[]
Definition: cs_divergence.h:90
coefav
void const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_real_t *const const cs_real_t *const const cs_real_t const cs_real_t const cs_real_3_t const cs_real_3_t coefav[]
Definition: cs_divergence.h:64
nswrgp
void const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const nswrgp
Definition: cs_convection_diffusion.h:5386
i_visc
void const cs_int_t *const const cs_real_3_t const cs_real_t cs_real_t cs_real_t const cs_real_t i_visc[]
Definition: cs_divergence.h:114
cs_real_t
double cs_real_t
Floating-point value.
Definition: cs_defs.h:302
coefbv
void const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_real_t *const const cs_real_t *const const cs_real_t const cs_real_t const cs_real_3_t const cs_real_3_t const cs_real_33_t coefbv[]
Definition: cs_divergence.h:64
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
rom
void const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_real_t *const const cs_real_t *const const cs_real_t rom[]
Definition: cs_divergence.h:64
cs_divergence
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:1410
cs_mesh_quantities_t
Definition: cs_mesh_quantities.h:90
viscel
void const cs_int_t *const const cs_int_t *const const cs_real_3_t const cs_real_t const cs_real_t const cs_real_t cs_real_6_t viscel[]
Definition: cs_divergence.h:133
viselx
void const cs_int_t *const const cs_real_3_t const cs_real_t cs_real_t cs_real_t const cs_real_t const cs_real_t const cs_real_t viselx[]
Definition: cs_divergence.h:114
cs_halo.h
cs_tensor_face_flux
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:933
cs_mass_flux
void cs_mass_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 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
inc
void const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const inc
Definition: cs_divergence.h:64
cs_real_6_t
cs_real_t cs_real_6_t[6]
vector of 6 floating-point values
Definition: cs_defs.h:317
imrgra
void const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const imrgra
Definition: cs_divergence.h:64
imligu
void const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const imligu
Definition: cs_divergence.h:64
cofbfp
void const cs_int_t *const const cs_real_3_t const cs_real_t cofbfp[]
Definition: cs_divergence.h:114
cs_ext_force_flux
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:1630
nswrgu
void const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const nswrgu
Definition: cs_divergence.h:64
tensorvel
void const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_real_t *const const cs_real_t *const const cs_real_t const cs_real_t const cs_real_6_t tensorvel[]
Definition: cs_divergence.h:152
cs_real_66_t
cs_real_t cs_real_66_t[6][6]
6x6 matrix of floating-point values
Definition: cs_defs.h:322
cs_real_33_t
cs_real_t cs_real_33_t[3][3]
3x3 matrix of floating-point values
Definition: cs_defs.h:321
vel
void const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_real_t *const const cs_real_t *const const cs_real_t const cs_real_t const cs_real_3_t vel[]
Definition: cs_divergence.h:64
romb
void const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_real_t *const const cs_real_t *const const cs_real_t const cs_real_t romb[]
Definition: cs_divergence.h:64
cs_int_t
int cs_int_t
Fortran-compatible integer.
Definition: cs_defs.h:301
b_massflux
void const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_real_t *const const cs_real_t *const const cs_real_t const cs_real_t const cs_real_3_t const cs_real_3_t const cs_real_33_t cs_real_t cs_real_t b_massflux[]
Definition: cs_divergence.h:64
i_massflux
void const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_real_t *const const cs_real_t *const const cs_real_t const cs_real_t const cs_real_3_t const cs_real_3_t const cs_real_33_t cs_real_t i_massflux[]
Definition: cs_divergence.h:64
epsrgu
void const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_real_t *const epsrgu
Definition: cs_divergence.h:64
ircflp
void const cs_int_t *const const cs_int_t *const ircflp
Definition: cs_divergence.h:133
climgu
void const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_real_t *const const cs_real_t *const climgu
Definition: cs_divergence.h:64
cs_mesh_t
Definition: cs_mesh.h:63
cs_base.h