8.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-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"
45 #include "cs_cdofb_priv.h"
46 #include "cs_cdofb_scaleq.h"
47 #include "cs_cdofb_vecteq.h"
49 #include "cs_cdofb_navsto.h"
50 #include "cs_equation_bc.h"
51 #include "cs_equation_priv.h"
52 #include "cs_iter_algo.h"
53 #include "cs_navsto_coupling.h"
54 #include "cs_navsto_param.h"
55 #include "cs_saddle_solver.h"
56 #include "cs_sles.h"
57 #include "cs_static_condensation.h"
58 #include "cs_timer.h"
59 
60 /*----------------------------------------------------------------------------*/
61 
63 
64 /*=============================================================================
65  * Additional doxygen documentation
66  *============================================================================*/
67 
76 typedef struct _cdofb_monolithic_t cs_cdofb_monolithic_t;
77 
80 /*=============================================================================
81  * Definitions of function pointers
82  *============================================================================*/
83 
84 /*----------------------------------------------------------------------------*/
96 /*----------------------------------------------------------------------------*/
97 
98 typedef void
99 (cs_cdofb_monolithic_assemble_t)(const cs_cell_sys_t *csys,
100  const cs_cell_mesh_t *cm,
101  const cs_cdofb_navsto_builder_t *nsb,
103  cs_cdofb_vecteq_t *eqc,
104  cs_cdo_assembly_t *asb);
105 
106 /*----------------------------------------------------------------------------*/
121 /*----------------------------------------------------------------------------*/
122 
123 typedef void
124 (cs_cdofb_monolithic_build_t)(const cs_navsto_param_t *nsp,
125  const cs_real_t vel_f_n[],
126  const cs_real_t vel_c_n[],
127  const cs_real_t vel_f_nm1[],
128  const cs_real_t vel_c_nm1[],
130 
131 /*----------------------------------------------------------------------------*/
145 /*----------------------------------------------------------------------------*/
146 
147 typedef int
148 (cs_cdofb_monolithic_solve_t)(const cs_navsto_param_t *nsp,
149  cs_saddle_solver_t *saddle,
150  cs_real_t *u_f,
151  cs_real_t *p_c);
152 
153 /*=============================================================================
154  * Structure definitions
155  *============================================================================*/
156 
163 struct _cdofb_monolithic_t {
164 
171  cs_navsto_monolithic_t *coupling_context;
172 
183  cs_field_t *velocity;
184 
191 
197  cs_field_t *divergence;
198 
209  cs_adv_field_t *adv_field;
210 
215  cs_real_t *mass_flux_array;
216 
221  cs_real_t *mass_flux_array_pre;
222 
233  const cs_boundary_type_t *bf_type;
234 
241  cs_cdo_bc_face_t *pressure_bc;
242  int pressure_rescaling;
243 
261  cs_cdo_apply_boundary_t *apply_fixed_wall;
262  cs_cdo_apply_boundary_t *apply_sliding_wall;
263  cs_cdo_apply_boundary_t *apply_velocity_inlet;
264  cs_cdo_apply_boundary_t *apply_symmetry;
265 
273  cs_cdofb_monolithic_build_t *steady_build;
274  cs_cdofb_monolithic_build_t *build;
275 
282  cs_cdofb_navsto_source_t *add_gravity_term;
283 
291  /* \var assemble
292  * Function pointer to manage the assembly process for the Navier-Stokes
293  * system of equation
294  */
295 
296  cs_cdofb_monolithic_assemble_t *assemble;
297 
298  /* \var block21_op
299  * Unassembled (2,1)-block (related to the divergence). Not always
300  * allocated. It depends on the solver for the saddle-point system.
301  */
302 
303  cs_real_t *block21_op;
304 
305  /* \var system_helper
306  * Set of structure to handle the saddle-point matrix and its rhs
307  */
308 
309  cs_cdo_system_helper_t *system_helper;
310 
321  cs_cdofb_monolithic_solve_t *solve;
322 
323  /* \var saddle_solver
324  * Set of pointers to enable the resolution of saddle-point system
325  * with various algorithms. This structure allows us to unify the prototype
326  * of "solve" functions
327  */
328 
329  cs_saddle_solver_t *saddle_solver;
330 
336  cs_iter_algo_t *nl_algo;
337 
350  cs_timer_counter_t timer;
351 
353 };
354 
357 /*============================================================================
358  * Public function prototypes
359  *============================================================================*/
360 
361 /*----------------------------------------------------------------------------*/
362 
364 
365 #endif /* __CS_CDOFB_MONOLITHIC_PRIV_H__ */
int cs_boundary_type_t
Definition: cs_boundary.h:69
struct _cdofb_monolithic_t cs_cdofb_monolithic_t
Definition: cs_cdofb_monolithic_priv.h:76
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:528
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
#define END_C_DECLS
Definition: cs_defs.h:529
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:68
double precision, dimension(:,:,:), allocatable pressure
Definition: atimbr.f90:121
Definition: cs_advection_field.h:150
Definition: cs_cdo_bc.h:109
Definition: cs_cdo_system.h:377
Structure storing additional arrays related to the building of the Navier-Stokes system.
Definition: cs_cdofb_navsto.h:107
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:289
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:262
Definition: cs_saddle_solver.h:88
Definition: cs_timer.h:55