7.0
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 /*----------------------------------------------------------------------------*/
91 /*----------------------------------------------------------------------------*/
92 
93 typedef void
94 (cs_cdofb_monolithic_source_t)(const cs_navsto_param_t *nsp,
95  const cs_cell_mesh_t *cm,
96  const cs_cdofb_navsto_builder_t *nsb,
97  cs_cell_sys_t *csys);
98 
99 /*----------------------------------------------------------------------------*/
106 /*----------------------------------------------------------------------------*/
107 
108 typedef void
109 (cs_cdofb_monolithic_init_matrix_t)(cs_cdofb_monolithic_t *sc);
110 
111 /*----------------------------------------------------------------------------*/
124 /*----------------------------------------------------------------------------*/
125 
126 typedef void
127 (cs_cdofb_monolithic_assemble_t)(const cs_cell_sys_t *csys,
128  const cs_cell_mesh_t *cm,
129  const cs_real_t *div_op,
130  const bool has_sourceterm,
132  cs_cdofb_vecteq_t *eqc,
134 
135 /*----------------------------------------------------------------------------*/
152 /*----------------------------------------------------------------------------*/
153 
154 typedef void
155 (cs_cdofb_monolithic_build_t)(const cs_navsto_param_t *nsp,
156  const cs_real_t vel_f_n[],
157  const cs_real_t vel_c_n[],
158  const cs_real_t vel_f_nm1[],
159  const cs_real_t vel_c_nm1[],
160  const cs_real_t *dir_values,
161  const cs_lnum_t forced_ids[],
163 
164 /*----------------------------------------------------------------------------*/
176 /*----------------------------------------------------------------------------*/
177 
178 typedef int
179 (cs_cdofb_monolithic_solve_t)(const cs_navsto_param_t *nsp,
180  const cs_equation_param_t *eqp,
182 
183 /*=============================================================================
184  * Structure definitions
185  *============================================================================*/
186 
193 struct _cdofb_monolithic_t {
194 
201  cs_navsto_monolithic_t *coupling_context;
202 
213  cs_field_t *velocity;
214 
221 
227  cs_field_t *divergence;
228 
238  cs_adv_field_t *adv_field;
239 
243  cs_real_t *mass_flux_array;
244 
248  cs_real_t *mass_flux_array_pre;
249 
260  const cs_boundary_type_t *bf_type;
261 
268  cs_cdo_bc_face_t *pressure_bc;
269  int pressure_rescaling;
270 
275  cs_cdofb_monolithic_source_t *add_gravity_source_term;
276 
294  cs_cdo_apply_boundary_t *apply_fixed_wall;
295  cs_cdo_apply_boundary_t *apply_sliding_wall;
296  cs_cdo_apply_boundary_t *apply_velocity_inlet;
297  cs_cdo_apply_boundary_t *apply_symmetry;
298 
306  cs_cdofb_monolithic_init_matrix_t *init_system;
307  cs_cdofb_monolithic_build_t *steady_build;
308  cs_cdofb_monolithic_build_t *build;
309 
317  /* \var assemble
318  * Function pointer to manage the assembly process for the Navier-Stokes
319  * system of equation
320  */
321 
322  cs_cdofb_monolithic_assemble_t *assemble;
323 
324  /* \var elemental_assembly
325  * Function pointer to manage the assembly process at low-level
326  */
327 
328  cs_equation_assembly_t *elemental_assembly;
329 
330  /* \var mav_structures
331  * Set of pointers to the matrix assembler structures for matrix values
332  * Size = 1 or 9
333  */
334 
335  cs_matrix_assembler_values_t **mav_structures;
336 
344  cs_cdofb_monolithic_solve_t *solve;
345 
346  /* \var msles
347  * Set of pointers to enable the resolution of saddle-point system
348  * with various algorithms. This structure allows us to unify the prototype
349  * of "solve" functions
350  * Some members of this structure are allocated only if a specific algorithm
351  * is requested.
352  */
353 
355 
361  cs_iter_algo_info_t *algo_info;
362 
374  cs_timer_counter_t timer;
375 
378 };
379 
382 /*============================================================================
383  * Public function prototypes
384  *============================================================================*/
385 
386 /*----------------------------------------------------------------------------*/
387 
389 
390 #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:202
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:495
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 This is a key structure for all cel...
Definition: cs_cdo_local.h:159
Structure storing the parameters related to the resolution of the Navier-Stokes system.
Definition: cs_navsto_param.h:540
double cs_real_t
Floating-point value.
Definition: cs_defs.h:307
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:107
Definition: cs_cdofb_monolithic_sles.h:56
Definition: cs_cdo_bc.h:88
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:301
#define END_C_DECLS
Definition: cs_defs.h:496
struct _cdofb_monolithic_t cs_cdofb_monolithic_t
Definition: cs_cdofb_monolithic_priv.h:72
Set of information related to the convergence of the iterative algorithm (Picard or Uzawa for instanc...
Definition: cs_iter_algo.h:93
Definition: cs_cdofb_navsto.h:68
Routines to handle structures used as a context when solving the Navier-Stokes equations. Structures are cast on-the-fly according to the type of coupling. Routines to handle the settings of coupling algorithms.
Set of parameters specific for solving the Navier-Stokes system with a fully coupled monolithic algor...
Definition: cs_navsto_coupling.h:89
Definition: cs_timer.h:57