8.1
general documentation
cs_velocity_pressure.h
Go to the documentation of this file.
1 #ifndef __CS_VELOCITY_PRESSURE_H__
2 #define __CS_VELOCITY_PRESSURE_H__
3 
4 /*============================================================================
5  * Velocity-pressure coupling model and parameters.
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_defs.h"
35 
36 /*----------------------------------------------------------------------------*/
37 
39 
40 /*=============================================================================
41  * Macro definitions
42  *============================================================================*/
43 
44 /*============================================================================
45  * Type definitions
46  *============================================================================*/
47 
48 /* Velocity-pressure coupling model descriptor */
49 /*---------------------------------------------*/
50 
51 typedef struct {
52 
53  int ivisse; /* take viscous term of transposed velocity
54  gradient into account in momentum equation
55  - 1: true (default)
56  - 0: false */
57 
58  int idilat; /* algorithm to take into account the density
59  variation in time
60  - 1: dilatable steady algorithm (default)
61  - 2: dilatable unsteady algorithm
62  - 3: low-Mach algorithm
63  - 4: algorithm for fire
64  - 0: boussinesq algorithm with constant
65  density */
66 
67  bool fluid_solid; /* Has a solid zone where dynamics must be killed?
68  - false (default)
69  - true */
70 
71  int n_buoyant_scal; /* number of buoyant scalars,
72  zero if there is no buoyant scalar */
73 
74  int iprcdo; /* Discretization method for pressure:
75  - 0: Legacy finite Volume method.
76  - 1: CDO method, if CDO/FV is coupled. */
77 
79 
80 /*----------------------------------------------------------------------------
81  * Velocity-pressure coupling parameters
82  *----------------------------------------------------------------------------*/
83 
84 typedef struct {
85 
86  int iphydr; /* improve hydrostatic pressure algorithm
87  - 1: impose the equilibrium of the hydrostaic
88  part of the pressure with any external force,
89  even head losses
90  - 2: compute an hydrostatic pressure due to
91  buoyancy forces before the prediction step
92  - 0: no treatment (default) */
93 
94  int icalhy; /* compute the hydrostatic pressure in order to
95  compute the Dirichlet conditions on the
96  pressure at outlets
97  - 1: true
98  - 0: false (default) */
99 
100  int iprco; /* compute the pressure step thanks to the
101  continuity equation
102  - 1: true (default)
103  - 0: false */
104 
105  int ipredfl; /* deprecated:
106  switch on mass flux prediction before momentum
107  solving to be fully conservative in momentum
108  over time for variable density flows. */
109 
110  int irevmc; /* reconstruction of the velocity field with the
111  updated pressure option
112  - 0: default */
113 
114  int iifren; /* indicates the presence of a Bernoulli boundary
115  face (automatically computed)
116  - 0: no face
117  - 1: at least one face */
118  int irecmf; /* use interpolated face diffusion coefficient
119  instead of cell diffusion coefficient for the
120  mass flux reconstruction for the
121  non-orthogonalities
122  - 1: true
123  - 0: false (default) */
124 
125  int igprij; /* improve static pressure algorithm
126  - 1: take -div(rho R) in the static pressure
127  treatment IF iphydr=1
128  - 0: no treatment (default) */
129 
130  int igpust; /* improve static pressure algorithm
131  - 1: take user momemtum source terms in the
132  static pressure treatment IF iphydr=1
133  (default)
134  - 0: no treatment */
135 
136  int ipucou; /* pseudo coupled pressure-velocity solver
137  - 1: true (default)
138  - 0: false */
139 
140  int itpcol; /* time scheme option:
141  - 0: staggered.
142  - 1: colocated time scheme. */
143 
144  double arak; /* Arakawa multiplier for the Rhie and Chow
145  filter (1 by default) */
146 
147  int rcfact; /* Indicates the factor of the Rhie and Chow
148  filter
149  - 1: dt (default)
150  - 0: 1/A_u */
151 
152  int staggered; /* indicates if one works with the 1D staggered
153  scheme
154  - 0: colocated (default)
155  - 1: staggered */
156 
157  int nterup; /* number of iterations on the pressure-velocity
158  coupling on Navier-Stokes */
159 
160  double epsup; /* relative precision for the convergence test of
161  the iterative process on pressure-velocity
162  coupling */
163 
164  double xnrmu; /* norm of the increment
165  \f$ \vect{u}^{k+1} - \vect{u}^k \f$
166  of the iterative process on pressure-velocity
167  coupling */
168 
169  double xnrmu0; /* norm of \f$ \vect{u}^0 \f$ */
170 
171  double epsdp; /* parameter of diagonal pressure strengthening */
172 
174 
175 /* Deprecated structures (partial compatibilty mode) */
176 
179 
180 /*============================================================================
181  * Static global variables
182  *============================================================================*/
183 
184 /* Pointer to main velocity pressure coupling model structure */
186 
187 /* Pointer to main velocity pressure coupling parameters structure */
189 
190 /*=============================================================================
191  * Public function prototypes
192  *============================================================================*/
193 
194 /*----------------------------------------------------------------------------
195  * Provide read/write access to cs_glob_velocity_pressure_model
196  *
197  * needed to initialize structure with GUI
198  *----------------------------------------------------------------------------*/
199 
202 
203 /*----------------------------------------------------------------------------*/
211 /*----------------------------------------------------------------------------*/
212 
215 
216 /*----------------------------------------------------------------------------
217  *!
218  * \brief Count and set number of buoyant scalars.
219  */
220 /*----------------------------------------------------------------------------*/
221 
222 void
224 
225 /*----------------------------------------------------------------------------
226  *!
227  * \brief Set `fluid_solid` flag if solid zones are present.
228  */
229 /*----------------------------------------------------------------------------*/
230 
231 void
233 
234 /*----------------------------------------------------------------------------*/
238 /*----------------------------------------------------------------------------*/
239 
240 void
242 
243 /*----------------------------------------------------------------------------*/
247 /*----------------------------------------------------------------------------*/
248 
249 void
251 
252 /*----------------------------------------------------------------------------*/
253 
255 
256 #endif /* __CS_VELOCITY_PRESSURE_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:514
#define END_C_DECLS
Definition: cs_defs.h:515
cs_velocity_pressure_model_t cs_stokes_model_t
Definition: cs_velocity_pressure.h:177
cs_velocity_pressure_model_t * cs_get_glob_velocity_pressure_model(void)
Definition: cs_velocity_pressure.c:463
void cs_velocity_pressure_set_n_buoyant_scalars(void)
Definition: cs_velocity_pressure.c:491
void cs_velocity_pressure_param_log_setup(void)
Print Velocity-pressure parameters to setup.log.
Definition: cs_velocity_pressure.c:615
cs_velocity_pressure_param_t cs_piso_t
Definition: cs_velocity_pressure.h:178
cs_velocity_pressure_param_t * cs_get_glob_velocity_pressure_param(void)
Provide access to cs_glob_velocity_pressure_param.
Definition: cs_velocity_pressure.c:479
void cs_velocity_pressure_set_solid(void)
Definition: cs_velocity_pressure.c:515
const cs_velocity_pressure_param_t * cs_glob_velocity_pressure_param
const cs_velocity_pressure_model_t * cs_glob_velocity_pressure_model
void cs_velocity_pressure_model_log_setup(void)
Print the stokes model parameters to setup.log.
Definition: cs_velocity_pressure.c:536
Stokes equation model descriptor.
Definition: cs_velocity_pressure.h:51
int ivisse
Definition: cs_velocity_pressure.h:53
int idilat
Definition: cs_velocity_pressure.h:58
int n_buoyant_scal
Definition: cs_velocity_pressure.h:71
bool fluid_solid
Definition: cs_velocity_pressure.h:67
int iprcdo
Definition: cs_velocity_pressure.h:74
Inner velocity/pressure iteration options descriptor.
Definition: cs_velocity_pressure.h:84
int icalhy
Definition: cs_velocity_pressure.h:94
int irevmc
Definition: cs_velocity_pressure.h:110
double arak
Definition: cs_velocity_pressure.h:144
double epsdp
Definition: cs_velocity_pressure.h:171
double xnrmu
Definition: cs_velocity_pressure.h:164
int iifren
Definition: cs_velocity_pressure.h:114
int ipredfl
Definition: cs_velocity_pressure.h:105
int nterup
Definition: cs_velocity_pressure.h:157
double xnrmu0
Definition: cs_velocity_pressure.h:169
int ipucou
Definition: cs_velocity_pressure.h:136
int rcfact
Definition: cs_velocity_pressure.h:147
int igpust
Definition: cs_velocity_pressure.h:130
int iprco
Definition: cs_velocity_pressure.h:100
double epsup
Definition: cs_velocity_pressure.h:160
int igprij
Definition: cs_velocity_pressure.h:125
int iphydr
Definition: cs_velocity_pressure.h:86
int staggered
Definition: cs_velocity_pressure.h:152
int irecmf
Definition: cs_velocity_pressure.h:118
int itpcol
Definition: cs_velocity_pressure.h:140