7.1
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-2021 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_bc.h"
43 #include "cs_cdofb_priv.h"
44 #include "cs_cdofb_scaleq.h"
45 #include "cs_cdofb_vecteq.h"
47 #include "cs_cdofb_navsto.h"
48 #include "cs_equation_bc.h"
49 #include "cs_equation_common.h"
50 #include "cs_equation_priv.h"
51 #include "cs_iter_algo.h"
52 #include "cs_navsto_coupling.h"
53 #include "cs_static_condensation.h"
54 #include "cs_timer.h"
55 
56 /*----------------------------------------------------------------------------*/
57 
59 
60 /*=============================================================================
61  * Additional doxygen documentation
62  *============================================================================*/
63 
72 typedef struct _cdofb_monolithic_t cs_cdofb_monolithic_t;
73 
76 /*=============================================================================
77  * Definitions of function pointers
78  *============================================================================*/
79 
80 /*----------------------------------------------------------------------------*/
87 /*----------------------------------------------------------------------------*/
88 
89 typedef void
90 (cs_cdofb_monolithic_init_matrix_t)(cs_cdofb_monolithic_t *sc);
91 
92 /*----------------------------------------------------------------------------*/
105 /*----------------------------------------------------------------------------*/
106 
107 typedef void
108 (cs_cdofb_monolithic_assemble_t)(const cs_cell_sys_t *csys,
109  const cs_cell_mesh_t *cm,
110  const cs_real_t *div_op,
111  const bool has_sourceterm,
113  cs_cdofb_vecteq_t *eqc,
115 
116 /*----------------------------------------------------------------------------*/
131 /*----------------------------------------------------------------------------*/
132 
133 typedef void
134 (cs_cdofb_monolithic_build_t)(const cs_navsto_param_t *nsp,
135  const cs_real_t vel_f_n[],
136  const cs_real_t vel_c_n[],
137  const cs_real_t vel_f_nm1[],
138  const cs_real_t vel_c_nm1[],
140 
141 /*----------------------------------------------------------------------------*/
153 /*----------------------------------------------------------------------------*/
154 
155 typedef int
156 (cs_cdofb_monolithic_solve_t)(const cs_navsto_param_t *nsp,
157  const cs_equation_param_t *eqp,
159 
160 /*=============================================================================
161  * Structure definitions
162  *============================================================================*/
163 
170 struct _cdofb_monolithic_t {
171 
178  cs_navsto_monolithic_t *coupling_context;
179 
190  cs_field_t *velocity;
191 
198 
204  cs_field_t *divergence;
205 
215  cs_adv_field_t *adv_field;
216 
220  cs_real_t *mass_flux_array;
221 
225  cs_real_t *mass_flux_array_pre;
226 
237  const cs_boundary_type_t *bf_type;
238 
245  cs_cdo_bc_face_t *pressure_bc;
246  int pressure_rescaling;
247 
265  cs_cdo_apply_boundary_t *apply_fixed_wall;
266  cs_cdo_apply_boundary_t *apply_sliding_wall;
267  cs_cdo_apply_boundary_t *apply_velocity_inlet;
268  cs_cdo_apply_boundary_t *apply_symmetry;
269 
277  cs_cdofb_monolithic_init_matrix_t *init_system;
278  cs_cdofb_monolithic_build_t *steady_build;
279  cs_cdofb_monolithic_build_t *build;
280 
287  cs_cdofb_navsto_source_t *add_gravity_term;
288 
296  /* \var assemble
297  * Function pointer to manage the assembly process for the Navier-Stokes
298  * system of equation
299  */
300 
301  cs_cdofb_monolithic_assemble_t *assemble;
302 
303  /* \var elemental_assembly
304  * Function pointer to manage the assembly process at low-level
305  */
306 
307  cs_equation_assembly_t *elemental_assembly;
308 
309  /* \var mav_structures
310  * Set of pointers to the matrix assembler structures for matrix values
311  * Size = 1 or 9
312  */
313 
314  cs_matrix_assembler_values_t **mav_structures;
315 
323  cs_cdofb_monolithic_solve_t *solve;
324 
325  /* \var msles
326  * Set of pointers to enable the resolution of saddle-point system
327  * with various algorithms. This structure allows us to unify the prototype
328  * of "solve" functions
329  * Some members of this structure are allocated only if a specific algorithm
330  * is requested.
331  */
332 
334 
340  cs_iter_algo_t *nl_algo;
341 
353  cs_timer_counter_t timer;
354 
357 };
358 
361 /*============================================================================
362  * Public function prototypes
363  *============================================================================*/
364 
365 /*----------------------------------------------------------------------------*/
366 
368 
369 #endif /* __CS_CDOFB_MONOLITHIC_PRIV_H__ */
double precision, dimension(:,:,:), allocatable pressure
Definition: atimbr.f90:122
int cs_boundary_type_t
Definition: cs_boundary.h:69
Definition: cs_advection_field.h:149
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
Field descriptor.
Definition: cs_field.h:125
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources...
Definition: cs_equation_param.h:177
struct _cs_matrix_assembler_values_t cs_matrix_assembler_values_t
Definition: cs_matrix_assembler.h:65
#define BEGIN_C_DECLS
Definition: cs_defs.h:510
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:169
void() cs_equation_assembly_t(const cs_sdm_t *m, const cs_lnum_t *dof_ids, const cs_range_set_t *rset, cs_equation_assemble_t *eqa, cs_matrix_assembler_values_t *mav)
Assemble a cellwise matrix into the global matrix Block or no block versions are handled.
Definition: cs_equation_assemble.h:72
struct _cs_equation_assemble_t cs_equation_assemble_t
Definition: cs_equation_assemble.h:52
Set of local quantities and connectivities related to a mesh cell.
Definition: cs_cdo_local.h:202
Structure storing the parameters related to the resolution of the Navier-Stokes system.
Definition: cs_navsto_param.h:605
double cs_real_t
Floating-point value.
Definition: cs_defs.h:322
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:146
Set of common parameters to manage an iterative algorithm.
Definition: cs_iter_algo.h:101
Definition: cs_cdofb_monolithic_sles.h:56
Definition: cs_cdo_bc.h:88
#define END_C_DECLS
Definition: cs_defs.h:511
struct _cdofb_monolithic_t cs_cdofb_monolithic_t
Definition: cs_cdofb_monolithic_priv.h:72
Set of parameters specific for solving the Navier-Stokes system with a fully coupled monolithic algor...
Definition: cs_navsto_coupling.h:77
Definition: cs_timer.h:55