9.2
general documentation
cs_cdofb_monolithic_priv.h
Go to the documentation of this file.
1#ifndef CS_CDOFB_MONOLITHIC_PRIV_H
2#define CS_CDOFB_MONOLITHIC_PRIV_H
3
4/*============================================================================
5 * Build an algebraic CDO face-based system for the Navier-Stokes equations
6 * and solved it as one block (monolithic approach of the velocity-pressure
7 * coupling)
8 *============================================================================*/
9
10/*
11 This file is part of code_saturne, a general-purpose CFD tool.
12
13 Copyright (C) 1998-2026 EDF S.A.
14
15 This program is free software; you can redistribute it and/or modify it under
16 the terms of the GNU General Public License as published by the Free Software
17 Foundation; either version 2 of the License, or (at your option) any later
18 version.
19
20 This program is distributed in the hope that it will be useful, but WITHOUT
21 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
22 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
23 details.
24
25 You should have received a copy of the GNU General Public License along with
26 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
27 Street, Fifth Floor, Boston, MA 02110-1301, USA.
28*/
29
30/*----------------------------------------------------------------------------*/
31
32#include "base/cs_defs.h"
33
34/*----------------------------------------------------------------------------
35 * Standard C library headers
36 *----------------------------------------------------------------------------*/
37
38/*----------------------------------------------------------------------------
39 * Local headers
40 *----------------------------------------------------------------------------*/
41
43#include "alge/cs_sles.h"
44#include "base/cs_timer.h"
45#include "cdo/cs_cdo_assembly.h"
46#include "cdo/cs_cdo_bc.h"
47#include "cdo/cs_cdo_system.h"
49#include "cdo/cs_cdofb_navsto.h"
50#include "cdo/cs_cdofb_priv.h"
51#include "cdo/cs_cdofb_scaleq.h"
52#include "cdo/cs_cdofb_vecteq.h"
53#include "cdo/cs_equation_bc.h"
55#include "cdo/cs_iter_algo.h"
58#include "cdo/cs_navsto_param.h"
60
61/*=============================================================================
62 * Additional doxygen documentation
63 *============================================================================*/
64
73typedef struct _cs_cdofb_monolithic_t cs_cdofb_monolithic_t;
74
77/*=============================================================================
78 * Definitions of function pointers
79 *============================================================================*/
80
81/*----------------------------------------------------------------------------*/
93/*----------------------------------------------------------------------------*/
94
95typedef void
96(cs_cdofb_monolithic_assemble_t)(const cs_cell_sys_t *csys,
97 const cs_cell_mesh_t *cm,
100 cs_cdofb_vecteq_t *eqc,
101 cs_cdo_assembly_t *asb);
102
103/*----------------------------------------------------------------------------*/
118/*----------------------------------------------------------------------------*/
119
120typedef void
121(cs_cdofb_monolithic_build_t)(const cs_navsto_param_t *nsp,
122 const cs_real_t vel_f_n[],
123 const cs_real_t vel_c_n[],
124 const cs_real_t vel_f_nm1[],
125 const cs_real_t vel_c_nm1[],
127
128/*----------------------------------------------------------------------------*/
142/*----------------------------------------------------------------------------*/
143
144typedef int
145(cs_cdofb_monolithic_solve_t)(const cs_navsto_param_t *nsp,
146 cs_saddle_solver_t *saddle,
147 cs_real_t *u_f,
148 cs_real_t *p_c);
149
150/*=============================================================================
151 * Structure definitions
152 *============================================================================*/
153
160struct _cs_cdofb_monolithic_t : public cs::cdo_navsto_monolithic_ctx_t {
168 cs_cdofb_monolithic_build_t *steady_build;
169 cs_cdofb_monolithic_build_t *build;
170
177 cs_cdofb_navsto_source_t *add_gravity_term;
178
186 /* \var assemble
187 * Function pointer to manage the assembly process for the Navier-Stokes
188 * system of equation
189 */
190
191 cs_cdofb_monolithic_assemble_t *assemble;
192
193 /* \var block21_op
194 * Unassembled (2,1)-block (related to the divergence). Not always
195 * allocated. It depends on the solver for the saddle-point system.
196 */
197
198 cs_real_t *block21_op;
199
200 /* \var system_helper
201 * Set of structure to handle the saddle-point matrix and its rhs
202 */
203
204 cs_cdo_system_helper_t *system_helper;
205
216 cs_cdofb_monolithic_solve_t *solve;
217
218 /* \var saddle_solver
219 * Set of pointers to enable the resolution of saddle-point system
220 * with various algorithms. This structure allows us to unify the prototype
221 * of "solve" functions
222 *
223 * \var gamma
224 * Scaling coefficient in case of augmentation of the system
225 */
226
227 cs_saddle_solver_t *saddle_solver;
228
229 double gamma;
230
236 cs_iter_algo_t *nl_algo;
237
239};
240
243/*============================================================================
244 * Public function prototypes
245 *============================================================================*/
246
247#endif /* CS_CDOFB_MONOLITHIC_PRIV_H */
struct _cs_cdofb_monolithic_t cs_cdofb_monolithic_t
Definition: cs_cdofb_monolithic_priv.h:73
void() cs_cdofb_navsto_source_t(const cs_navsto_param_t *nsp, const cs_cell_mesh_t *cm, const cs_cdofb_navsto_builder_t *nsb, cs_cell_sys_t *csys)
Compute and add a source term to the local RHS. This is a special treatment to enable source involvin...
Definition: cs_cdofb_navsto.h:184
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
@ gamma
Definition: cs_field_pointer.h:197
Context related to CDO face-based discretization when dealing with Navier-Stokes equations and vector...
Definition: cs_navsto_context.h:187
Definition: cs_cdo_system.h:373
Structure storing additional arrays related to the building of the Navier-Stokes system.
Definition: cs_cdofb_navsto.h:105
Set of local quantities and connectivities related to a mesh cell.
Definition: cs_cdo_local.h:242
Set of arrays and local (small) dense matrices related to a mesh cell This is a key structure for bui...
Definition: cs_cdo_local.h:163
Structure to handle the convergence of an iterative algorithm.
Definition: cs_iter_algo.h:285
Structure storing the parameters related to the resolution of the Navier-Stokes system.
Definition: cs_navsto_param.h:296
Definition: cs_saddle_solver.h:85