8.3
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-2024 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#include "cs_equation.h"
37
38/*----------------------------------------------------------------------------*/
39
41
42/*============================================================================
43 * Type definitions
44 *============================================================================*/
45
46typedef struct {
47
52
58
63
69
74
79
85
87
89
90/*============================================================================
91 * Public function definitions
92 *============================================================================*/
93
94/*----------------------------------------------------------------------------*/
98/*----------------------------------------------------------------------------*/
99
100void
102
103/*----------------------------------------------------------------------------*/
107/*----------------------------------------------------------------------------*/
108
109void
111
112
113/*----------------------------------------------------------------------------*/
114/*
115 * \brief Activate the pressure increment solving with CDO
116 */
117/*----------------------------------------------------------------------------*/
118
119void
121
122/*----------------------------------------------------------------------------*/
123/*
124 * \brief Activate the pressure increment, either FV or CDO
125 */
126/*----------------------------------------------------------------------------*/
127
128void
130
131/*----------------------------------------------------------------------------*/
132/*
133 * \brief Test if pressure solving with CDO is activated
134 *
135 * \return true if solving with CDO is requested, false otherwise
136 */
137/*----------------------------------------------------------------------------*/
138
139bool
141
142/*----------------------------------------------------------------------------*/
143/*
144 * \brief Start setting-up the pressure increment equation
145 * At this stage, numerical settings should be completely determined
146 * but connectivity and geometrical information is not yet available.
147 */
148/*----------------------------------------------------------------------------*/
149
150void
152
153/*----------------------------------------------------------------------------*/
154/*
155 * \brief Finalize setting-up the pressure increment equation
156 * At this stage, numerical settings should be completely determined
157 *
158 * \param[in] domain pointer to a cs_domaint_t structure
159 */
160/*----------------------------------------------------------------------------*/
161
162void
164
165/*----------------------------------------------------------------------------*/
166/*
167 * \brief Perform the pressure correction step of the Navier-Stokes equations
168 * for incompressible or slightly compressible flows.
169 *
170 * This function solves the following Poisson equation on the pressure:
171 * \f[
172 * D \left( \Delta t, \delta p \right) =
173 * \divs \left( \rho \vect{\widetilde{u}}\right)
174 * - \Gamma^n
175 * + \dfrac{\rho^n - \rho^{n-1}}{\Delta t}
176 * \f]
177 *
178 * Either the legacy FV method or a CDO face-based scheme is used.
179 *
180 * For the legacy case, the mass flux is updated as follows:
181 * \f[
182 * \dot{m}^{n+1}_\ij = \dot{m}^{n}_\ij
183 * - \Delta t \grad_\fij \delta p \cdot \vect{S}_\ij
184 * \f]
185 *
186 * \Remark:
187 * - an iterative process is used to solve the Poisson equation.
188 * - if the arak coefficient is set to 1, the the Rhie & Chow filter is
189 * activated.
190 *
191 * Please refer to the
192 * <a href="../../theory.pdf#resopv"><b>resopv</b></a>
193 * section of the theory guide for more information.
194 *
195 * \param[in] iterns Navier-Stokes iteration number
196 * \param[in] nfbpcd number of faces with condensation source term
197 * \param[in] ncmast number of cells with condensation source terms
198 * \param[in] ifbpcd index of faces with condensation source term
199 * \param[in] ltmast list of cells with condensation source terms
200 * (1 to n numbering)
201 * \param[in] isostd indicator of standard outlet and index
202 * of the reference outlet face
203 * \param[in] vel velocity
204 * \param[in, out] da_uu velocity matrix
205 * \param[in] bc_coeffs_v boundary condition structure for the variable
206 * \param[in] bc_coeffs_dp boundary conditions structure for the
207 * pressure increment
208 * \param[in] spcond variable value associated to the condensation
209 * source term (for ivar=ipr, spcond is the
210 * flow rate
211 * \f$ \Gamma_{s,cond}^n \f$)
212 * \param[in] svcond variable value associated to the condensation
213 * source term (for ivar=ipr, svcond is the flow rate
214 * \f$ \Gamma_{v, cond}^n \f$)
215 * \param[in] frcxt external forces making hydrostatic pressure
216 * \param[in] dfrcxt variation of the external forces
217 * composing the hydrostatic pressure
218 * \param[in] i_visc visc*surface/dist aux faces internes
219 * \param[in] b_visc visc*surface/dist aux faces de bord
220 */
221/*----------------------------------------------------------------------------*/
222
223void
224cs_pressure_correction(int iterns,
225 cs_lnum_t nfbpcd,
226 cs_lnum_t ncmast,
227 cs_lnum_t ifbpcd[],
228 cs_lnum_t ltmast[],
229 const int isostd[],
230 cs_real_t vel[][3],
231 cs_real_t da_uu[][6],
232 cs_field_bc_coeffs_t *bc_coeffs_v,
233 cs_field_bc_coeffs_t *bc_coeffs_dp,
234 cs_real_t spcond[],
235 cs_real_t svcond[],
236 cs_real_t frcxt[][3],
237 cs_real_t dfrcxt[][3],
238 cs_real_t i_visc[],
239 cs_real_t b_visc[]);
240
241/*----------------------------------------------------------------------------*/
242
244
245#endif /* __CS_PRESSURE_CORRECTION_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
double cs_real_t
Floating-point value.
Definition: cs_defs.h:342
#define END_C_DECLS
Definition: cs_defs.h:543
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:335
unsigned short int cs_flag_t
Definition: cs_defs.h:344
@ vel
Definition: cs_field_pointer.h:70
void cs_pressure_correction_cdo_activate(void)
Activate the pressure increment solving with CDO.
Definition: cs_pressure_correction.cpp:3518
void cs_pressure_correction_cdo_destroy_all(void)
Free the main structure related to the pressure correction.
Definition: cs_pressure_correction.cpp:3752
bool cs_pressure_correction_cdo_is_activated(void)
Test if pressure solving with CDO is activated.
Definition: cs_pressure_correction.cpp:3597
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], cs_real_t i_visc[], cs_real_t b_visc[])
Perform the pressure correction step of the Navier-Stokes equations for incompressible or slightly co...
Definition: cs_pressure_correction.cpp:3827
void cs_pressure_correction_fv_activate(void)
Activate the pressure increment solving with Legacy FV.
Definition: cs_pressure_correction.cpp:3492
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:3614
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:3680
void cs_pressure_correction_model_activate(void)
Activate the pressure increment, either FV or CDO.
Definition: cs_pressure_correction.cpp:3577
Structure storing the main features of the computational domain and pointers to the main geometrical ...
Definition: cs_domain.h:129
Main structure to handle the discretization and the resolution of an equation.
Field boundary condition descriptor (for variables)
Definition: cs_field.h:104
Field descriptor.
Definition: cs_field.h:131
Definition: cs_pressure_correction.h:46
cs_flag_t post_flag
Definition: cs_pressure_correction.h:86
cs_equation_t * pressure_incr
Definition: cs_pressure_correction.h:51
cs_field_t * pressure_incr_gradient
Definition: cs_pressure_correction.h:57
cs_real_t * bdy_pressure_incr
Definition: cs_pressure_correction.h:84
cs_field_t * pressure_gradient
Definition: cs_pressure_correction.h:62
cs_real_t * div_st
Definition: cs_pressure_correction.h:68
cs_real_t * inner_potential_flux
Definition: cs_pressure_correction.h:73
cs_real_t * bdy_potential_flux
Definition: cs_pressure_correction.h:78