8.1
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  * Public function prototypes
99  *============================================================================*/
100 
101 /*----------------------------------------------------------------------------*/
155 /*----------------------------------------------------------------------------*/
156 
157 void
158 cs_mass_flux(const cs_mesh_t *m,
159  const cs_mesh_quantities_t *fvq,
160  int f_id,
161  int itypfl,
162  int iflmb0,
163  int init,
164  int inc,
165  int imrgra,
166  int nswrgu,
167  int imligu,
168  int iwarnu,
169  double epsrgu,
170  double climgu,
171  const cs_real_t rom[],
172  const cs_real_t romb[],
173  const cs_real_3_t vel[],
174  const cs_real_3_t coefav[],
175  const cs_real_33_t coefbv[],
176  cs_real_t *restrict i_massflux,
177  cs_real_t *restrict b_massflux);
178 
179 /*----------------------------------------------------------------------------*/
195 /*----------------------------------------------------------------------------*/
196 
197 void
198 cs_divergence(const cs_mesh_t *m,
199  int init,
200  const cs_real_t i_massflux[],
201  const cs_real_t b_massflux[],
202  cs_real_t *restrict diverg);
203 
204 /*----------------------------------------------------------------------------*/
220 /*----------------------------------------------------------------------------*/
221 
222 void
224  int init,
225  const cs_real_3_t i_massflux[],
226  const cs_real_3_t b_massflux[],
227  cs_real_3_t *restrict diverg);
228 
229 /*----------------------------------------------------------------------------*/
255 /*----------------------------------------------------------------------------*/
256 
257 void
260  int init,
261  int nswrgu,
262  const cs_real_3_t frcxt[],
263  const cs_real_t cofbfp[],
264  cs_real_t *restrict i_massflux,
265  cs_real_t *restrict b_massflux,
266  const cs_real_t i_visc[],
267  const cs_real_t b_visc[],
268  const cs_real_t viselx[],
269  const cs_real_t visely[],
270  const cs_real_t viselz[]);
271 
272 /*----------------------------------------------------------------------------*/
301 /*----------------------------------------------------------------------------*/
302 
303 void
306  int init,
307  int nswrgp,
308  int ircflp,
309  const cs_real_3_t frcxt[],
310  const cs_real_t cofbfp[],
311  const cs_real_t i_visc[],
312  const cs_real_t b_visc[],
313  cs_real_6_t viscel[],
314  const cs_real_2_t weighf[],
315  cs_real_t *restrict i_massflux,
316  cs_real_t *restrict b_massflux);
317 
318 /*----------------------------------------------------------------------------*/
358 /*----------------------------------------------------------------------------*/
359 
360 void
362  const cs_mesh_quantities_t *fvq,
363  int f_id,
364  int itypfl,
365  int iflmb0,
366  int init,
367  int inc,
368  int imrgra,
369  int nswrgu,
370  int imligu,
371  int iwarnu,
372  double epsrgu,
373  double climgu,
374  const cs_real_t c_rho[],
375  const cs_real_t b_rho[],
376  const cs_real_6_t c_var[],
377  const cs_real_6_t coefav[],
378  const cs_real_66_t coefbv[],
379  cs_real_3_t *restrict i_massflux,
380  cs_real_3_t *restrict b_massflux);
381 
382 /*----------------------------------------------------------------------------*/
383 
385 
386 #endif /* __CS_DIVERGENCE_H__ */
#define restrict
Definition: cs_defs.h:139
#define BEGIN_C_DECLS
Definition: cs_defs.h:514
double cs_real_t
Floating-point value.
Definition: cs_defs.h:319
#define CS_PROCF(x, y)
Definition: cs_defs.h:528
cs_real_t cs_real_66_t[6][6]
6x6 matrix of floating-point values
Definition: cs_defs.h:344
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:334
cs_real_t cs_real_2_t[2]
vector of 2 floating-point values
Definition: cs_defs.h:333
cs_real_t cs_real_6_t[6]
vector of 6 floating-point values
Definition: cs_defs.h:336
#define END_C_DECLS
Definition: cs_defs.h:515
cs_real_t cs_real_33_t[3][3]
3x3 matrix of floating-point values
Definition: cs_defs.h:343
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:236
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:1270
void cs_tensor_face_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 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:785
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:1487
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:1372
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 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:1702
@ 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