9.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-2025 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 "base/cs_defs.h"
35
37
38/*----------------------------------------------------------------------------*/
39
41
42/*=============================================================================
43 * Macro definitions
44 *============================================================================*/
45
46/*============================================================================
47 * Type definitions
48 *============================================================================*/
49
50/* Velocity-pressure coupling model descriptor */
51/*---------------------------------------------*/
52
53typedef struct {
54
55 int ivisse; /* take viscous term of transposed velocity
56 gradient into account in momentum equation
57 - 1: true (default)
58 - 0: false */
59
60 int idilat; /* algorithm to take into account the density
61 variation in time
62 - 1: dilatable steady algorithm (default)
63 - 2: dilatable unsteady algorithm
64 - 3: low-Mach algorithm
65 - 0: boussinesq algorithm with constant
66 density */
67
68 bool fluid_solid; /* Has a solid zone where dynamics must be killed?
69 - false (default)
70 - true */
71
72 int n_buoyant_scal; /* number of buoyant scalars,
73 zero if there is no buoyant scalar */
74
75 int iprcdo; /* Discretization method for pressure:
76 - 0: Legacy finite Volume method.
77 - 1: CDO method, if CDO/FV is coupled. */
78
80
81/*----------------------------------------------------------------------------
82 * Velocity-pressure coupling parameters
83 *----------------------------------------------------------------------------*/
84
85typedef struct {
86
87 int iphydr; /* improve hydrostatic pressure algorithm
88 - 1: impose the equilibrium of the hydrostaic
89 part of the pressure with any external force,
90 even head losses
91 - 2: compute an hydrostatic pressure due to
92 buoyancy forces before the prediction step
93 - 0: no treatment (default) */
94
95 int icalhy; /* compute the hydrostatic pressure in order to
96 compute the Dirichlet conditions on the
97 pressure at outlets
98 - 1: true
99 - 0: false (default) */
100
101 int iprco; /* compute the pressure step thanks to the
102 continuity equation
103 - 1: true (default)
104 - 0: false */
105
106 int ipredfl; /* deprecated:
107 switch on mass flux prediction before momentum
108 solving to be fully conservative in momentum
109 over time for variable density flows. */
110
111 int irevmc; /* reconstruction of the velocity field with the
112 updated pressure option
113 - 0: using the gradient of pressure increment (default)
114 - 1: update from the mass fluxes
115 - 2: no velocity update (only mass fluxes are updated) */
116
117 int iifren; /* indicates the presence of a Bernoulli boundary
118 face (automatically computed)
119 - 0: no face
120 - 1: at least one face */
121 int irecmf; /* use interpolated face diffusion coefficient
122 instead of cell diffusion coefficient for the
123 mass flux reconstruction for the
124 non-orthogonalities
125 - 1: true
126 - 0: false (default) */
127
128 int igprij; /* improve static pressure algorithm
129 - 1: take -div(rho R) in the static pressure
130 treatment IF iphydr=1
131 - 0: no treatment (default) */
132
133 int igpust; /* improve static pressure algorithm
134 - 1: take user momemtum source terms in the
135 static pressure treatment IF iphydr=1
136 (default)
137 - 0: no treatment */
138
139 int igrdpp; /* For the compressible algorithm, indicate whether
140 the pressure should be updated after solution
141 of the acoustic equation.
142 - 1: true (default)
143 - 0: false */
144
145 int ipucou; /* pseudo coupled pressure-velocity solver
146 - 1: true (default)
147 - 0: false */
148
149 int itpcol; /* time scheme option:
150 - 0: staggered.
151 - 1: colocated time scheme. */
152
153 double arak; /* Arakawa multiplier for the Rhie and Chow
154 filter (1 by default) */
155
156 int rcfact; /* Indicates the factor of the Rhie and Chow
157 filter
158 - 0: dt (default)
159 - 1: 1/A_u */
160
161 int staggered; /* indicates if one works with the 1D staggered
162 scheme
163 - 0: colocated (default)
164 - 1: staggered */
165
166 int nterup; /* number of iterations on the pressure-velocity
167 coupling on Navier-Stokes */
168
169 double epsup; /* relative precision for the convergence test of
170 the iterative process on pressure-velocity
171 coupling */
172
173 double xnrmu; /* norm of the increment
174 \f$ \vect{u}^{k+1} - \vect{u}^k \f$
175 of the iterative process on pressure-velocity
176 coupling */
177
178 double xnrmu0; /* norm of \f$ \vect{u}^0 \f$ */
179
180 double epsdp; /* parameter of diagonal pressure strengthening */
181
182 cs_time_control_t time_control; /* Time control for radiation updates */
183
185
186/* Deprecated structures (partial compatibility mode) */
187
190
191/*============================================================================
192 * Static global variables
193 *============================================================================*/
194
195/* Pointer to main velocity pressure coupling model structure */
197
198/* Pointer to main velocity pressure coupling parameters structure */
200
201/*=============================================================================
202 * Public function prototypes
203 *============================================================================*/
204
205/*----------------------------------------------------------------------------
206 * Provide read/write access to cs_glob_velocity_pressure_model
207 *
208 * needed to initialize structure with GUI
209 *----------------------------------------------------------------------------*/
210
213
214/*----------------------------------------------------------------------------*/
222/*----------------------------------------------------------------------------*/
223
226
227/*----------------------------------------------------------------------------
228 *!
229 * \brief Count and set number of buoyant scalars.
230 */
231/*----------------------------------------------------------------------------*/
232
233void
235
236/*----------------------------------------------------------------------------
237 *!
238 * \brief Set `fluid_solid` flag if solid zones are present.
239 */
240/*----------------------------------------------------------------------------*/
241
242void
244
245/*----------------------------------------------------------------------------*/
249/*----------------------------------------------------------------------------*/
250
251void
253
254/*----------------------------------------------------------------------------*/
258/*----------------------------------------------------------------------------*/
259
260void
262
263/*----------------------------------------------------------------------------*/
264
266
267#endif /* __CS_VELOCITY_PRESSURE_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:554
#define END_C_DECLS
Definition: cs_defs.h:555
cs_velocity_pressure_model_t cs_stokes_model_t
Definition: cs_velocity_pressure.h:188
void cs_velocity_pressure_set_n_buoyant_scalars(void)
Definition: cs_velocity_pressure.cpp:408
void cs_velocity_pressure_param_log_setup(void)
Print Velocity-pressure parameters to setup.log.
Definition: cs_velocity_pressure.cpp:529
cs_velocity_pressure_param_t cs_piso_t
Definition: cs_velocity_pressure.h:189
cs_velocity_pressure_param_t * cs_get_glob_velocity_pressure_param(void)
Provide access to cs_glob_velocity_pressure_param.
Definition: cs_velocity_pressure.cpp:396
void cs_velocity_pressure_set_solid(void)
Definition: cs_velocity_pressure.cpp:432
cs_velocity_pressure_model_t * cs_get_glob_velocity_pressure_model(void)
Definition: cs_velocity_pressure.cpp:380
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.cpp:453
Definition: cs_time_control.h:96
Stokes equation model descriptor.
Definition: cs_velocity_pressure.h:53
int ivisse
Definition: cs_velocity_pressure.h:55
int idilat
Definition: cs_velocity_pressure.h:60
int n_buoyant_scal
Definition: cs_velocity_pressure.h:72
bool fluid_solid
Definition: cs_velocity_pressure.h:68
int iprcdo
Definition: cs_velocity_pressure.h:75
Inner velocity/pressure iteration options descriptor.
Definition: cs_velocity_pressure.h:85
int icalhy
Definition: cs_velocity_pressure.h:95
int irevmc
Definition: cs_velocity_pressure.h:111
double arak
Definition: cs_velocity_pressure.h:153
double epsdp
Definition: cs_velocity_pressure.h:180
double xnrmu
Definition: cs_velocity_pressure.h:173
int iifren
Definition: cs_velocity_pressure.h:117
int igrdpp
Definition: cs_velocity_pressure.h:139
int ipredfl
Definition: cs_velocity_pressure.h:106
int nterup
Definition: cs_velocity_pressure.h:166
double xnrmu0
Definition: cs_velocity_pressure.h:178
int ipucou
Definition: cs_velocity_pressure.h:145
cs_time_control_t time_control
Definition: cs_velocity_pressure.h:182
int rcfact
Definition: cs_velocity_pressure.h:156
int igpust
Definition: cs_velocity_pressure.h:133
int iprco
Definition: cs_velocity_pressure.h:101
double epsup
Definition: cs_velocity_pressure.h:169
int igprij
Definition: cs_velocity_pressure.h:128
int iphydr
Definition: cs_velocity_pressure.h:87
int staggered
Definition: cs_velocity_pressure.h:161
int irecmf
Definition: cs_velocity_pressure.h:121
int itpcol
Definition: cs_velocity_pressure.h:149