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