9.2
general documentation
cs_pressure_correction.h
Go to the documentation of this file.
1#ifndef CS_PRESSURE_CORRECTION_H
2#define CS_PRESSURE_CORRECTION_H
3
4/*============================================================================
5 * Pressure correction.
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
36#include "cdo/cs_equation.h"
37
38/*============================================================================
39 * Type definitions
40 *============================================================================*/
41
42typedef struct {
43
48
54
59
65
70
75
81
83
85
86/*============================================================================
87 * Public function definitions
88 *============================================================================*/
89
90/*----------------------------------------------------------------------------*/
94/*----------------------------------------------------------------------------*/
95
96void
98
99/*----------------------------------------------------------------------------*/
100/*
101 * \brief Free the main structure related to the pressure correction
102 */
103/*----------------------------------------------------------------------------*/
104
105void
107
108/*----------------------------------------------------------------------------*/
109/*
110 * \brief Activate the pressure increment solving with CDO
111 */
112/*----------------------------------------------------------------------------*/
113
114void
116
117/*----------------------------------------------------------------------------*/
118/*
119 * \brief Activate the pressure increment, either FV or CDO
120 */
121/*----------------------------------------------------------------------------*/
122
123void
125
126/*----------------------------------------------------------------------------*/
127/*
128 * \brief Test if pressure solving with CDO is activated
129 *
130 * \return true if solving with CDO is requested, false otherwise
131 */
132/*----------------------------------------------------------------------------*/
133
134bool
136
137/*----------------------------------------------------------------------------*/
138/*
139 * \brief Start setting-up the pressure increment equation
140 * At this stage, numerical settings should be completely determined
141 * but connectivity and geometrical information is not yet available.
142 */
143/*----------------------------------------------------------------------------*/
144
145void
147
148/*----------------------------------------------------------------------------*/
149/*
150 * \brief Finalize setting-up the pressure increment equation
151 * At this stage, numerical settings should be completely determined
152 *
153 * \param[in] domain pointer to a cs_domaint_t structure
154 */
155/*----------------------------------------------------------------------------*/
156
157void
159
160/*----------------------------------------------------------------------------*/
161/*
162 * \brief Perform the pressure correction step of the Navier-Stokes equations
163 * for incompressible or slightly compressible flows.
164 *
165 * This function solves the following Poisson equation on the pressure:
166 * \f[
167 * D \left( \Delta t, \delta p \right) =
168 * \divs \left( \rho \vect{\widetilde{u}}\right)
169 * - \Gamma^n
170 * + \dfrac{\rho^n - \rho^{n-1}}{\Delta t}
171 * \f]
172 *
173 * Either the legacy FV method or a CDO face-based scheme is used.
174 *
175 * For the legacy case, the mass flux is updated as follows:
176 * \f[
177 * \dot{m}^{n+1}_\ij = \dot{m}^{n}_\ij
178 * - \Delta t \grad_\fij \delta p \cdot \vect{S}_\ij
179 * \f]
180 *
181 * \remark:
182 * - an iterative process is used to solve the Poisson equation.
183 * - if the arak coefficient is set to 1, the Rhie & Chow filter is activated.
184 *
185 * Please refer to the
186 * <a href="../../theory.pdf#resopv"><b>resopv</b></a>
187 * section of the theory guide for more information.
188 *
189 * \param[in] iterns Navier-Stokes iteration number
190 * \param[in] nfbpcd number of faces with condensation source term
191 * \param[in] ncmast number of cells with condensation source terms
192 * \param[in] ifbpcd index of faces with condensation source term
193 * \param[in] ltmast list of cells with condensation source terms
194 * (1 to n numbering)
195 * \param[in] isostd indicator of standard outlet and index
196 * of the reference outlet face
197 * \param[in] vel velocity
198 * \param[in, out] da_uu velocity matrix
199 * \param[in] bc_coeffs_v boundary condition structure for the variable
200 * \param[in] bc_coeffs_dp boundary conditions structure for the
201 * pressure increment
202 * \param[in] spcond variable value associated to the condensation
203 * source term (for ivar=ipr, spcond is the
204 * flow rate
205 * \f$ \Gamma_{s,cond}^n \f$)
206 * \param[in] svcond variable value associated to the condensation
207 * source term (for ivar=ipr, svcond is the
208 * flow rate
209 * \f$ \Gamma_{v, cond}^n \f$)
210 * \param[in] frcxt external forces making hydrostatic pressure
211 * \param[in] dfrcxt variation of the external forces
212 * composing the hydrostatic pressure
213 */
214/*----------------------------------------------------------------------------*/
215
216void
217cs_pressure_correction(int iterns,
218 cs_lnum_t nfbpcd,
219 cs_lnum_t ncmast,
220 cs_lnum_t ifbpcd[],
221 cs_lnum_t ltmast[],
222 const int isostd[],
223 cs_real_t vel[][3],
224 cs_real_t da_uu[][6],
225 cs_field_bc_coeffs_t *bc_coeffs_v,
226 cs_field_bc_coeffs_t *bc_coeffs_dp,
227 cs_real_t spcond[],
228 cs_real_t svcond[],
229 cs_real_t frcxt[][3],
230 cs_real_t dfrcxt[][3]);
231
232/*----------------------------------------------------------------------------*/
233
234#endif /* CS_PRESSURE_CORRECTION_H */
Field boundary condition descriptor (for variables)
Definition: cs_field.h:107
Field descriptor.
Definition: cs_field.h:275
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:325
unsigned short int cs_flag_t
Definition: cs_defs.h:334
@ vel
Definition: cs_field_pointer.h:66
void cs_pressure_correction_cdo_activate(void)
Activate the pressure increment solving with CDO.
Definition: cs_pressure_correction.cpp:3196
void cs_pressure_correction_cdo_destroy_all(void)
Free the main structure related to the pressure correction.
Definition: cs_pressure_correction.cpp:3428
bool cs_pressure_correction_cdo_is_activated(void)
Test if pressure solving with CDO is activated.
Definition: cs_pressure_correction.cpp:3275
void cs_pressure_correction_fv_activate(void)
Activate the pressure increment solving with Legacy FV.
Definition: cs_pressure_correction.cpp:3171
void cs_pressure_correction_cdo_init_setup(void)
Start setting-up the pressure increment equation At this stage, numerical settings should be complete...
Definition: cs_pressure_correction.cpp:3292
void cs_pressure_correction_cdo_finalize_setup(const cs_domain_t *domain)
Finalize setting-up the pressure increment equation At this stage, numerical settings should be compl...
Definition: cs_pressure_correction.cpp:3356
void cs_pressure_correction(int iterns, cs_lnum_t nfbpcd, cs_lnum_t ncmast, cs_lnum_t ifbpcd[], cs_lnum_t ltmast[], const int isostd[], cs_real_t vel[][3], cs_real_t da_uu[][6], cs_field_bc_coeffs_t *bc_coeffs_v, cs_field_bc_coeffs_t *bc_coeffs_dp, cs_real_t spcond[], cs_real_t svcond[], cs_real_t frcxt[][3], cs_real_t dfrcxt[][3])
Perform the pressure correction step of the Navier-Stokes equations for incompressible or slightly co...
Definition: cs_pressure_correction.cpp:3502
void cs_pressure_correction_model_activate(void)
Activate the pressure increment, either FV or CDO.
Definition: cs_pressure_correction.cpp:3255
Structure storing the main features of the computational domain and pointers to the main geometrical ...
Definition: cs_domain.h:120
Main structure to handle the discretization and the resolution of an equation.
Definition: cs_pressure_correction.h:42
cs_flag_t post_flag
Definition: cs_pressure_correction.h:82
cs_equation_t * pressure_incr
Definition: cs_pressure_correction.h:47
cs_field_t * pressure_incr_gradient
Definition: cs_pressure_correction.h:53
cs_real_t * bdy_pressure_incr
Definition: cs_pressure_correction.h:80
cs_field_t * pressure_gradient
Definition: cs_pressure_correction.h:58
cs_real_t * div_st
Definition: cs_pressure_correction.h:64
cs_real_t * inner_potential_flux
Definition: cs_pressure_correction.h:69
cs_real_t * bdy_potential_flux
Definition: cs_pressure_correction.h:74