7.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-2021 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 int *const f_id,
64  const int *const itypfl,
65  const int *const iflmb0,
66  const int *const init,
67  const int *const inc,
68  const int *const imrgra,
69  const int *const nswrgu,
70  const int *const imligu,
71  const int *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[],
79  cs_real_t i_massflux[],
80  cs_real_t b_massflux[]
81 );
82 
83 /*----------------------------------------------------------------------------
84  * Wrapper to cs_divergence
85  *----------------------------------------------------------------------------*/
86 
87 void CS_PROCF (divmas, DIVMAS)
88 (
89  const int *const init,
90  const cs_real_t i_massflux[],
91  const cs_real_t b_massflux[],
92  cs_real_t diverg[]
93 );
94 
95 /*----------------------------------------------------------------------------
96  * Wrapper to cs_divergence_tensor
97  *----------------------------------------------------------------------------*/
98 
99 void CS_PROCF (divmat, DIVMAT)
100 (
101  const int *const init,
102  const cs_real_3_t i_massflux[],
103  const cs_real_3_t b_massflux[],
104  cs_real_3_t diverg[]
105 );
106 
107 /*----------------------------------------------------------------------------
108  * Wrapper to cs_ext_force_flux
109  *----------------------------------------------------------------------------*/
110 
111 void CS_PROCF (projts, PROJTS)
112 (
113  const int *const init,
114  const int *const nswrgu,
115  const cs_real_3_t frcxt[],
116  const cs_real_t cofbfp[],
117  cs_real_t i_massflux[],
118  cs_real_t b_massflux[],
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 int *const init,
133  const int *const nswrgu,
134  const int *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[],
139  cs_real_6_t viscel[],
140  const cs_real_2_t weighf[],
141  cs_real_t i_massflux[],
142  cs_real_t b_massflux[]
143 );
144 
145 /*----------------------------------------------------------------------------
146  * Wrapper to cs_tensor_face_flux
147  *----------------------------------------------------------------------------*/
148 
149 void CS_PROCF (divrij, DIVRIJ)
150 (
151  const int *const f_id,
152  const int *const itypfl,
153  const int *const iflmb0,
154  const int *const init,
155  const int *const inc,
156  const int *const imrgra,
157  const int *const nswrgu,
158  const int *const imligu,
159  const int *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[],
167  cs_real_3_t i_massflux[],
168  cs_real_3_t b_massflux[]
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[],
250  cs_real_t *restrict i_massflux,
251  cs_real_t *restrict b_massflux);
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[],
276  cs_real_t *restrict diverg);
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[],
301  cs_real_3_t *restrict diverg);
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[],
338  cs_real_t *restrict i_massflux,
339  cs_real_t *restrict b_massflux,
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[],
387  cs_real_6_t viscel[],
388  const cs_real_2_t weighf[],
389  cs_real_t *restrict i_massflux,
390  cs_real_t *restrict b_massflux);
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[],
453  cs_real_3_t *restrict i_massflux,
454  cs_real_3_t *restrict b_massflux);
455 
456 /*----------------------------------------------------------------------------*/
457 
459 
460 #endif /* __CS_DIVERGENCE_H__ */
#define restrict
Definition: cs_defs.h:127
cs_real_t cs_real_2_t[2]
vector of 2 floating-point values
Definition: cs_defs.h:319
cs_real_t cs_real_6_t[6]
vector of 6 floating-point values
Definition: cs_defs.h:322
cs_real_t cs_real_66_t[6][6]
6x6 matrix of floating-point values
Definition: cs_defs.h:328
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:1634
#define BEGIN_C_DECLS
Definition: cs_defs.h:495
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:276
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:1515
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:1414
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:203
double cs_real_t
Floating-point value.
Definition: cs_defs.h:307
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:182
Definition: cs_field_pointer.h:68
Definition: cs_mesh.h:84
Definition: cs_mesh_quantities.h:89
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:320
#define END_C_DECLS
Definition: cs_defs.h:496
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:1867
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:161
#define CS_PROCF(x, y)
Definition: cs_defs.h:509
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:110
cs_real_t cs_real_33_t[3][3]
3x3 matrix of floating-point values
Definition: cs_defs.h:327
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:240
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:936
integer(c_int), pointer, save imrgra
type of gradient reconstruction
Definition: optcal.f90:251
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:381