8.3
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-2024 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 "cs_defs.h"
33
34/*----------------------------------------------------------------------------
35 * Standard C library headers
36 *----------------------------------------------------------------------------*/
37
38/*----------------------------------------------------------------------------
39 * Local headers
40 *----------------------------------------------------------------------------*/
41
42#include "cs_cdo_assembly.h"
43#include "cs_cdo_bc.h"
44#include "cs_cdo_system.h"
46#include "cs_cdofb_navsto.h"
47#include "cs_equation_bc.h"
48#include "cs_equation_priv.h"
49#include "cs_iter_algo.h"
50#include "cs_macfb_navsto.h"
51#include "cs_macfb_priv.h"
52#include "cs_macfb_vecteq.h"
53#include "cs_navsto_coupling.h"
54#include "cs_navsto_param.h"
55#include "cs_sles.h"
57#include "cs_timer.h"
58
59/*----------------------------------------------------------------------------*/
60
62
63/*=============================================================================
64 * Additional doxygen documentation
65 *============================================================================*/
66
75typedef struct _macfb_monolithic_t cs_macfb_monolithic_t;
76
79/*=============================================================================
80 * Definitions of function pointers
81 *============================================================================*/
82
83/*----------------------------------------------------------------------------*/
95/*----------------------------------------------------------------------------*/
96
97typedef void(cs_macfb_monolithic_assemble_t)(
98 const cs_cell_sys_t *csys,
99 const cs_cell_mesh_t *cm,
100 const cs_macfb_navsto_builder_t *nsb,
102 cs_macfb_vecteq_t *eqc,
103 cs_cdo_assembly_t *asb);
104
105/*----------------------------------------------------------------------------*/
118/*----------------------------------------------------------------------------*/
119
120typedef void(cs_macfb_monolithic_build_t)(const cs_navsto_param_t *nsp,
121 const cs_real_t vel_f_n[],
122 const cs_real_t vel_f_nm1[],
124
125/*----------------------------------------------------------------------------*/
139/*----------------------------------------------------------------------------*/
140
141typedef int(cs_macfb_monolithic_solve_t)(const cs_navsto_param_t *nsp,
142 cs_saddle_solver_t *saddle,
143 cs_real_t *u_f,
144 cs_real_t *p_c);
145
146/*=============================================================================
147 * Structure definitions
148 *============================================================================*/
149
156struct _macfb_monolithic_t {
157
164 cs_navsto_monolithic_t *coupling_context;
165
176 cs_field_t *velocity;
177
184
190 cs_field_t *divergence;
191
201 cs_adv_field_t *adv_field;
202
206 cs_real_t *mass_flux_array;
207
211 cs_real_t *mass_flux_array_pre;
212
223 const cs_boundary_type_t *bf_type;
224
231 cs_cdo_bc_face_t *pressure_bc;
232 int pressure_rescaling;
233
251 cs_cdo_apply_boundary_t *apply_fixed_wall;
252 cs_cdo_apply_boundary_t *apply_sliding_wall;
253 cs_cdo_apply_boundary_t *apply_velocity_inlet;
254 cs_cdo_apply_boundary_t *apply_symmetry;
255
263 cs_macfb_monolithic_build_t *steady_build;
264 cs_macfb_monolithic_build_t *build;
265
272 cs_cdofb_navsto_source_t *add_gravity_term;
273
281 /* \var assemble
282 * Function pointer to manage the assembly process for the Navier-Stokes
283 * system of equation
284 */
285
286 cs_macfb_monolithic_assemble_t *assemble;
287
288 /* \var block21_op
289 * Unassembled (2,1)-block (related to the divergence). Not always
290 * allocated. It depends on the solver for the saddle-point system.
291 */
292
293 cs_real_t *block21_op;
294
295 /* \var system_helper
296 * Set of structure to handle the saddle-point matrix and its rhs
297 */
298
299 cs_cdo_system_helper_t *system_helper;
300
311 cs_macfb_monolithic_solve_t *solve;
312
313 /* \var saddle_solver
314 * Set of pointers to enable the resolution of saddle-point system
315 * with various algorithms. This structure allows us to unify the prototype
316 * of "solve" functions
317 */
318
319 cs_saddle_solver_t *saddle_solver;
320
326 cs_iter_algo_t *nl_algo;
327
339 cs_timer_counter_t timer;
340
342};
343
346/*============================================================================
347 * Public function prototypes
348 *============================================================================*/
349
350/*----------------------------------------------------------------------------*/
351
353
354#endif /* __CS_MACFB_MONOLITHIC_PRIV_H__ */
int cs_boundary_type_t
Definition: cs_boundary.h:69
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
#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
void() cs_cdo_apply_boundary_t(short int f, const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *pty, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Apply a boundary condition for a given face (inlet, outlet, wall, sliding wall, symmetry....
Definition: cs_equation_bc.h:69
struct _macfb_monolithic_t cs_macfb_monolithic_t
Definition: cs_macfb_monolithic_priv.h:75
double precision, dimension(:,:,:), allocatable pressure
Definition: atimbr.f90:121
Definition: cs_advection_field.h:151
Definition: cs_cdo_bc.h:106
Definition: cs_cdo_system.h:377
Set of local quantities and connectivities related to a mesh cell.
Definition: cs_cdo_local.h:203
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:147
Field descriptor.
Definition: cs_field.h:131
Structure to handle the convergence of an iterative algorithm.
Definition: cs_iter_algo.h:290
Structure storing additional arrays related to the building of the Navier-Stokes system.
Set of parameters specific for solving the Navier-Stokes system with a fully coupled monolithic algor...
Definition: cs_navsto_coupling.h:81
Structure storing the parameters related to the resolution of the Navier-Stokes system.
Definition: cs_navsto_param.h:263
Definition: cs_saddle_solver.h:88
Definition: cs_timer.h:55