7.0
general documentation
cs_navsto_coupling.h
Go to the documentation of this file.
1 #ifndef __CS_NAVSTO_COUPLING_H__
2 #define __CS_NAVSTO_COUPLING_H__
3 
4 /*============================================================================
5  * Routines to handle structures used as a context when solving the
6  * Navier-Stokes equations. Structures are cast on-the-fly according to the
7  * type of 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  * Local headers
32  *----------------------------------------------------------------------------*/
33 
34 #include "cs_equation.h"
35 #include "cs_field.h"
36 #include "cs_navsto_param.h"
37 
38 /*----------------------------------------------------------------------------*/
39 
41 
54 /*============================================================================
55  * Macro definitions
56  *============================================================================*/
57 
58 /*============================================================================
59  * Type definitions
60  *============================================================================*/
61 
62 /* Predefined context structures depending on the settings */
63 /* ======================================================= */
64 
72 typedef struct {
73 
81 
83 
89 typedef struct {
90 
94 
102 typedef struct {
103 
113 
118 
124 
126 
127 /*============================================================================
128  * Public function prototypes
129  *============================================================================*/
130 
131 /*----------------------------------------------------------------------------*/
141 /*----------------------------------------------------------------------------*/
142 
143 void *
145  cs_navsto_param_t *nsp);
146 
147 /*----------------------------------------------------------------------------*/
156 /*----------------------------------------------------------------------------*/
157 
158 void *
159 cs_navsto_ac_free_context(void *context);
160 
161 /*----------------------------------------------------------------------------*/
171 /*----------------------------------------------------------------------------*/
172 
173 void
175  cs_adv_field_t *adv_field,
176  void *context);
177 
178 /*----------------------------------------------------------------------------*/
186 /*----------------------------------------------------------------------------*/
187 
188 void
190  void *context);
191 
192 /*----------------------------------------------------------------------------*/
201 /*----------------------------------------------------------------------------*/
202 
204 cs_navsto_ac_get_momentum_eq(void *context);
205 
206 /*----------------------------------------------------------------------------*/
216 /*----------------------------------------------------------------------------*/
217 
218 void *
220  cs_navsto_param_t *nsp);
221 
222 /*----------------------------------------------------------------------------*/
230 /*----------------------------------------------------------------------------*/
231 
232 void *
233 cs_navsto_monolithic_free_context(void *context);
234 
235 /*----------------------------------------------------------------------------*/
245 /*----------------------------------------------------------------------------*/
246 
247 void
249  cs_adv_field_t *adv_field,
250  void *context);
251 
252 /*----------------------------------------------------------------------------*/
260 /*----------------------------------------------------------------------------*/
261 
262 void
264  void *context);
265 /*----------------------------------------------------------------------------*/
274 /*----------------------------------------------------------------------------*/
275 
278 
279 /*----------------------------------------------------------------------------*/
290 /*----------------------------------------------------------------------------*/
291 
292 void *
294  cs_navsto_param_t *nsp);
295 
296 /*----------------------------------------------------------------------------*/
304 /*----------------------------------------------------------------------------*/
305 
306 void *
307 cs_navsto_projection_free_context(void *context);
308 
309 /*----------------------------------------------------------------------------*/
321 /*----------------------------------------------------------------------------*/
322 
323 void
325  cs_adv_field_t *adv_field,
326  int loc_id,
327  bool has_previous,
328  void *context);
329 
330 /*----------------------------------------------------------------------------*/
340 /*----------------------------------------------------------------------------*/
341 
342 void
344  const cs_navsto_param_t *nsp,
345  void *context);
346 
347 /*----------------------------------------------------------------------------*/
356 /*----------------------------------------------------------------------------*/
357 
360 
361 /*----------------------------------------------------------------------------*/
362 
364 
365 #endif /* __CS_NAVSTO_COUPLING_H__ */
Definition: cs_advection_field.h:149
cs_field_t * predicted_velocity
Definition: cs_navsto_coupling.h:123
Field descriptor.
Definition: cs_field.h:125
void cs_navsto_projection_init_setup(const cs_navsto_param_t *nsp, cs_adv_field_t *adv_field, int loc_id, bool has_previous, void *context)
Start setting-up the Navier-Stokes equations when a projection algorithm is used to coupled the syste...
Definition: cs_navsto_coupling.c:528
cs_property_t * zeta
Definition: cs_navsto_coupling.h:80
void cs_navsto_monolithic_last_setup(const cs_navsto_param_t *nsp, void *context)
Finalize the setup for the Navier-Stokes equations when a monolithic algorithm is used to coupled the...
Definition: cs_navsto_coupling.c:378
#define BEGIN_C_DECLS
Definition: cs_defs.h:495
void * cs_navsto_ac_free_context(void *context)
Free the context structure related to an Artificial Compressibility approach.
Definition: cs_navsto_coupling.c:152
void * cs_navsto_monolithic_free_context(void *context)
Free the context structure related to a monolithic approach.
Definition: cs_navsto_coupling.c:315
cs_equation_t * cs_navsto_ac_get_momentum_eq(void *context)
Retrieve the pointer to the cs_equation_t structure related to the momentum equation in case of artif...
Definition: cs_navsto_coupling.c:248
cs_real_t * bdy_pressure_incr
Definition: cs_navsto_coupling.h:117
Structure storing the parameters related to the resolution of the Navier-Stokes system.
Definition: cs_navsto_param.h:540
void * cs_navsto_ac_create_context(cs_param_bc_type_t bc, cs_navsto_param_t *nsp)
Allocate and initialize a context structure when the Navier-Stokes system is coupled using an Artific...
Definition: cs_navsto_coupling.c:108
double cs_real_t
Floating-point value.
Definition: cs_defs.h:307
Definition: cs_cdo_quantities.h:124
cs_equation_t * cs_navsto_projection_get_momentum_eq(void *context)
Retrieve the pointer to the cs_equation_t structure related to the momentum equation in case of a pro...
Definition: cs_navsto_coupling.c:637
cs_equation_t * momentum
Definition: cs_navsto_coupling.h:91
cs_equation_t * correction
Definition: cs_navsto_coupling.h:106
void * cs_navsto_projection_free_context(void *context)
Free the context structure related to a Projection approach.
Definition: cs_navsto_coupling.c:501
void cs_navsto_ac_init_setup(const cs_navsto_param_t *nsp, cs_adv_field_t *adv_field, void *context)
Start setting-up the Navier-Stokes equations when an Artificial Compressibility algorithm is used to ...
Definition: cs_navsto_coupling.c:174
cs_equation_t * prediction
Definition: cs_navsto_coupling.h:104
Set of parameters specific for solving the Navier-Stokes system with an incremental projection algori...
Definition: cs_navsto_coupling.h:102
void cs_navsto_projection_last_setup(const cs_cdo_quantities_t *quant, const cs_navsto_param_t *nsp, void *context)
Finalize the setup for the Navier-Stokes equations when a projection algorithm is used to coupled the...
Definition: cs_navsto_coupling.c:583
cs_real_t * div_st
Definition: cs_navsto_coupling.h:112
cs_equation_t * momentum
Definition: cs_navsto_coupling.h:74
void cs_navsto_monolithic_init_setup(const cs_navsto_param_t *nsp, cs_adv_field_t *adv_field, void *context)
Start setting-up the Navier-Stokes equations when a monolithic algorithm is used to coupled the syste...
Definition: cs_navsto_coupling.c:337
#define END_C_DECLS
Definition: cs_defs.h:496
cs_param_bc_type_t
Definition: cs_param_types.h:431
Main structure to handle the discretization and the resolution of an equation.
void cs_navsto_ac_last_setup(const cs_navsto_param_t *nsp, void *context)
Finalize the setup for the Navier-Stokes equations when an Artificial Compressibility algorithm is us...
Definition: cs_navsto_coupling.c:213
void * cs_navsto_projection_create_context(cs_param_bc_type_t bc, cs_navsto_param_t *nsp)
Allocate and initialize a context structure when the Navier-Stokes system is coupled using an increme...
Definition: cs_navsto_coupling.c:433
cs_equation_t * cs_navsto_monolithic_get_momentum_eq(void *context)
Retrieve the pointer to the cs_equation_t structure related to the momentum equation in case of a mon...
Definition: cs_navsto_coupling.c:409
Structure associated to the definition of a property relying on the cs_xdef_t structure.
void * cs_navsto_monolithic_create_context(cs_param_bc_type_t bc, cs_navsto_param_t *nsp)
Allocate and initialize a context structure when the Navier-Stokes system is coupled using a monolith...
Definition: cs_navsto_coupling.c:271
Set of parameters specific for solving the Navier-Stokes system with a fully coupled monolithic algor...
Definition: cs_navsto_coupling.h:89
Set of parameters specific for solving the Navier-Stokes system with the "artificial compressibility"...
Definition: cs_navsto_coupling.h:72