9.2
general documentation
cs_macfb_monolithic_priv.h
Go to the documentation of this file.
1#ifndef CS_MACFB_MONOLITHIC_PRIV_H
2#define CS_MACFB_MONOLITHIC_PRIV_H
3
4/*============================================================================
5 * Build an algebraic MACface-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
42#include "alge/cs_sles.h"
43#include "base/cs_timer.h"
44#include "cdo/cs_cdo_assembly.h"
45#include "cdo/cs_cdo_bc.h"
46#include "cdo/cs_cdo_system.h"
48#include "cdo/cs_cdofb_navsto.h"
49#include "cdo/cs_equation_bc.h"
51#include "cdo/cs_iter_algo.h"
52#include "cdo/cs_macfb_navsto.h"
53#include "cdo/cs_macfb_priv.h"
54#include "cdo/cs_macfb_vecteq.h"
57#include "cdo/cs_navsto_param.h"
59
60/*=============================================================================
61 * Additional doxygen documentation
62 *============================================================================*/
63
72typedef struct _macfb_monolithic_t cs_macfb_monolithic_t;
73
76/*=============================================================================
77 * Definitions of function pointers
78 *============================================================================*/
79
80/*----------------------------------------------------------------------------*/
92/*----------------------------------------------------------------------------*/
93
94typedef void(cs_macfb_monolithic_assemble_t)(
95 const cs_cell_sys_t *csys,
96 const cs_cell_mesh_t *cm,
99 cs_macfb_vecteq_t *eqc,
100 cs_cdo_assembly_t *asb);
101
102/*----------------------------------------------------------------------------*/
115/*----------------------------------------------------------------------------*/
116
117typedef void(cs_macfb_monolithic_build_t)(const cs_navsto_param_t *nsp,
118 const cs_real_t vel_f_n[],
119 const cs_real_t vel_f_nm1[],
121
122/*----------------------------------------------------------------------------*/
136/*----------------------------------------------------------------------------*/
137
138typedef int(cs_macfb_monolithic_solve_t)(const cs_navsto_param_t *nsp,
139 cs_saddle_solver_t *saddle,
140 cs_real_t *u_f,
141 cs_real_t *p_c);
142
143/*=============================================================================
144 * Structure definitions
145 *============================================================================*/
146
153struct _macfb_monolithic_t : public cs::cdo_navsto_monolithic_ctx_t {
161 cs_macfb_monolithic_build_t *steady_build;
162 cs_macfb_monolithic_build_t *build;
163
170 cs_cdofb_navsto_source_t *add_gravity_term;
171
179 /* \var assemble
180 * Function pointer to manage the assembly process for the Navier-Stokes
181 * system of equation
182 */
183
184 cs_macfb_monolithic_assemble_t *assemble;
185
186 /* \var block21_op
187 * Unassembled (2,1)-block (related to the divergence). Not always
188 * allocated. It depends on the solver for the saddle-point system.
189 */
190
191 cs_real_t *block21_op;
192
193 /* \var system_helper
194 * Set of structure to handle the saddle-point matrix and its rhs
195 */
196
197 cs_cdo_system_helper_t *system_helper;
198
209 cs_macfb_monolithic_solve_t *solve;
210
211 /* \var saddle_solver
212 * Set of pointers to enable the resolution of saddle-point system
213 * with various algorithms. This structure allows us to unify the prototype
214 * of "solve" functions
215 */
216
217 cs_saddle_solver_t *saddle_solver;
218
224 cs_iter_algo_t *nl_algo;
225
227};
228
231/*============================================================================
232 * Public function prototypes
233 *============================================================================*/
234
235#endif /* CS_MACFB_MONOLITHIC_PRIV_H */
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
struct _macfb_monolithic_t cs_macfb_monolithic_t
Definition: cs_macfb_monolithic_priv.h:72
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
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 additional arrays related to the building of the Navier-Stokes system.
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