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-2018 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[],
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 cs_int_t *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 cs_int_t *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 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[],
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 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[],
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_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[],
167  cs_real_3_t i_massflux[],
168  cs_real_3_t b_massflux[]
169 );
170 
171 
172 /*----------------------------------------------------------------------------
173  * Wrapper to cs_tensor_face_flux
174  *----------------------------------------------------------------------------*/
175 
176 void CS_PROCF (divrijco, DIVRIJCO)
177 (
178  const cs_int_t *const f_id,
179  const cs_int_t *const itypfl,
180  const cs_int_t *const iflmb0,
181  const cs_int_t *const init,
182  const cs_int_t *const inc,
183  const cs_int_t *const imrgra,
184  const cs_int_t *const nswrgu,
185  const cs_int_t *const imligu,
186  const cs_int_t *const iwarnu,
187  const cs_real_t *const epsrgu,
188  const cs_real_t *const climgu,
189  const cs_real_t rom[],
190  const cs_real_t romb[],
191  const cs_real_6_t tensorvel[],
192  const cs_real_6_t coefav[],
193  const cs_real_66_t coefbv[],
194  cs_real_3_t i_massflux[],
195  cs_real_3_t b_massflux[]
196 );
197 
198 /*=============================================================================
199  * Public function prototypes
200  *============================================================================*/
201 
202 /*----------------------------------------------------------------------------*/
256 /*----------------------------------------------------------------------------*/
257 
258 void
259 cs_mass_flux(const cs_mesh_t *m,
261  int f_id,
262  int itypfl,
263  int iflmb0,
264  int init,
265  int inc,
266  int imrgra,
267  int nswrgu,
268  int imligu,
269  int iwarnu,
270  double epsrgu,
271  double climgu,
272  const cs_real_t rom[],
273  const cs_real_t romb[],
274  const cs_real_3_t vel[],
275  const cs_real_3_t coefav[],
276  const cs_real_33_t coefbv[],
277  cs_real_t *restrict i_massflux,
278  cs_real_t *restrict b_massflux);
279 
280 /*----------------------------------------------------------------------------*/
296 /*----------------------------------------------------------------------------*/
297 
298 void
299 cs_divergence(const cs_mesh_t *m,
300  int init,
301  const cs_real_t i_massflux[],
302  const cs_real_t b_massflux[],
303  cs_real_t *restrict diverg);
304 
305 /*----------------------------------------------------------------------------*/
321 /*----------------------------------------------------------------------------*/
322 
323 void
325  int init,
326  const cs_real_3_t i_massflux[],
327  const cs_real_3_t b_massflux[],
328  cs_real_3_t *restrict diverg);
329 
330 /*----------------------------------------------------------------------------*/
356 /*----------------------------------------------------------------------------*/
357 
358 void
361  int init,
362  int nswrgu,
363  const cs_real_3_t frcxt[],
364  const cs_real_t cofbfp[],
365  cs_real_t *restrict i_massflux,
366  cs_real_t *restrict b_massflux,
367  const cs_real_t i_visc[],
368  const cs_real_t b_visc[],
369  const cs_real_t viselx[],
370  const cs_real_t visely[],
371  const cs_real_t viselz[]);
372 
373 /*----------------------------------------------------------------------------*/
402 /*----------------------------------------------------------------------------*/
403 
404 void
407  int init,
408  int nswrgp,
409  int ircflp,
410  const cs_real_3_t frcxt[],
411  const cs_real_t cofbfp[],
412  const cs_real_t i_visc[],
413  const cs_real_t b_visc[],
414  cs_real_6_t viscel[],
415  const cs_real_2_t weighf[],
416  cs_real_t *restrict i_massflux,
417  cs_real_t *restrict b_massflux);
418 
419 /*----------------------------------------------------------------------------*/
463 /*----------------------------------------------------------------------------*/
464 
465 void
466 cs_tensor_flux(const cs_mesh_t *m,
468  int f_id,
469  int itypfl,
470  int iflmb0,
471  int init,
472  int inc,
473  int imrgra,
474  int nswrgu,
475  int imligu,
476  int iwarnu,
477  double epsrgu,
478  double climgu,
479  const cs_real_t rom[],
480  const cs_real_t romb[],
481  const cs_real_6_t tens[],
482  const cs_real_6_t coefav[],
483  const cs_real_66_t coefbv[],
484  cs_real_3_t *restrict i_massflux,
485  cs_real_3_t *restrict b_massflux);
486 
487 
488 /*----------------------------------------------------------------------------*/
528 /*----------------------------------------------------------------------------*/
529 
530 void
533  int f_id,
534  int itypfl,
535  int iflmb0,
536  int init,
537  int inc,
538  int imrgra,
539  int nswrgu,
540  int imligu,
541  int iwarnu,
542  double epsrgu,
543  double climgu,
544  const cs_real_t c_rho[],
545  const cs_real_t b_rho[],
546  const cs_real_6_t c_var[],
547  const cs_real_6_t coefav[],
548  const cs_real_66_t coefbv[],
549  cs_real_3_t *restrict i_massflux,
550  cs_real_3_t *restrict b_massflux);
551 
552 /*----------------------------------------------------------------------------*/
553 
555 
556 #endif /* __CS_DIVERGENCE_H__ */
#define restrict
Definition: cs_defs.h:122
cs_real_t cs_real_2_t[2]
vector of 2 floating-point values
Definition: cs_defs.h:308
cs_real_t cs_real_6_t[6]
vector of 6 floating-point values
Definition: cs_defs.h:311
void projts(const cs_int_t *const init, const cs_int_t *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
cs_real_t cs_real_66_t[6][6]
6x6 matrix of floating-point values
Definition: cs_defs.h:316
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:1158
#define BEGIN_C_DECLS
Definition: cs_defs.h:451
void divmat(const cs_int_t *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
int cs_int_t
Fortran-compatible integer.
Definition: cs_defs.h:296
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:1039
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:938
void inimav(const cs_int_t *const f_id, const cs_int_t *const itypfl, const cs_int_t *const iflmb0, const cs_int_t *const init, const cs_int_t *const inc, const cs_int_t *const imrgra, const cs_int_t *const nswrgu, const cs_int_t *const imligu, const cs_int_t *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
double cs_real_t
Floating-point value.
Definition: cs_defs.h:297
Definition: cs_mesh.h:63
void divrijco(const cs_int_t *const f_id, const cs_int_t *const itypfl, const cs_int_t *const iflmb0, const cs_int_t *const init, const cs_int_t *const inc, const cs_int_t *const imrgra, const cs_int_t *const nswrgu, const cs_int_t *const imligu, const cs_int_t *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:326
void divmas(const cs_int_t *const init, const cs_real_t i_massflux[], const cs_real_t b_massflux[], cs_real_t diverg[])
Definition: cs_divergence.c:160
void divrij(const cs_int_t *const f_id, const cs_int_t *const itypfl, const cs_int_t *const iflmb0, const cs_int_t *const init, const cs_int_t *const inc, const cs_int_t *const imrgra, const cs_int_t *const nswrgu, const cs_int_t *const imligu, const cs_int_t *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
Definition: cs_mesh_quantities.h:52
void cs_tensor_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_6_t tens[], 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:1677
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:309
#define END_C_DECLS
Definition: cs_defs.h:452
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:1367
#define CS_PROCF(x, y)
Definition: cs_defs.h:465
cs_real_t cs_real_33_t[3][3]
3x3 matrix of floating-point values
Definition: cs_defs.h:315
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:1883
void projtv(const cs_int_t *const init, const cs_int_t *const nswrgu, const cs_int_t *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
integer(c_int), pointer, save imrgra
type of gradient reconstruction
Definition: optcal.f90:353
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:432