6.2
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-2020 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 
88 
97 
99 
105 typedef struct {
106 
115 
124 
126 
134 typedef struct {
135 
145 
150 
156 
163 
172 
174 
175 /*============================================================================
176  * Public function prototypes
177  *============================================================================*/
178 
179 /*----------------------------------------------------------------------------*/
189 /*----------------------------------------------------------------------------*/
190 
191 void *
193  cs_param_bc_type_t bc);
194 
195 /*----------------------------------------------------------------------------*/
205 /*----------------------------------------------------------------------------*/
206 
207 void *
209  void *context);
210 
211 /*----------------------------------------------------------------------------*/
220 /*----------------------------------------------------------------------------*/
221 
222 void
224  void *context);
225 
226 /*----------------------------------------------------------------------------*/
237 /*----------------------------------------------------------------------------*/
238 
239 void
241  const cs_cdo_quantities_t *quant,
242  const cs_navsto_param_t *nsp,
243  void *context);
244 
245 /*----------------------------------------------------------------------------*/
254 /*----------------------------------------------------------------------------*/
255 
257 cs_navsto_ac_get_momentum_eq(void *context);
258 
259 /*----------------------------------------------------------------------------*/
269 /*----------------------------------------------------------------------------*/
270 
272 cs_navsto_ac_get_adv_field(void *context);
273 
274 /*----------------------------------------------------------------------------*/
285 /*----------------------------------------------------------------------------*/
286 
287 cs_real_t *
288 cs_navsto_ac_get_mass_flux(void *context,
289  bool previous);
290 
291 /*----------------------------------------------------------------------------*/
301 /*----------------------------------------------------------------------------*/
302 
303 void *
305  cs_param_bc_type_t bc);
306 
307 /*----------------------------------------------------------------------------*/
316 /*----------------------------------------------------------------------------*/
317 
318 void *
320  void *context);
321 
322 /*----------------------------------------------------------------------------*/
331 /*----------------------------------------------------------------------------*/
332 
333 void
335  void *context);
336 
337 /*----------------------------------------------------------------------------*/
348 /*----------------------------------------------------------------------------*/
349 
350 void
352  const cs_cdo_quantities_t *quant,
353  const cs_navsto_param_t *nsp,
354  void *context);
355 
356 /*----------------------------------------------------------------------------*/
365 /*----------------------------------------------------------------------------*/
366 
369 
370 /*----------------------------------------------------------------------------*/
380 /*----------------------------------------------------------------------------*/
381 
384 
385 /*----------------------------------------------------------------------------*/
396 /*----------------------------------------------------------------------------*/
397 
398 cs_real_t *
400  bool previous);
401 
402 /*----------------------------------------------------------------------------*/
413 /*----------------------------------------------------------------------------*/
414 
415 void *
417  cs_param_bc_type_t bc);
418 
419 /*----------------------------------------------------------------------------*/
428 /*----------------------------------------------------------------------------*/
429 
430 void *
432  void *context);
433 
434 /*----------------------------------------------------------------------------*/
445 /*----------------------------------------------------------------------------*/
446 
447 void
449  int loc_id,
450  bool has_previous,
451  void *context);
452 
453 /*----------------------------------------------------------------------------*/
464 /*----------------------------------------------------------------------------*/
465 
466 void
468  const cs_cdo_quantities_t *quant,
469  const cs_navsto_param_t *nsp,
470  void *context);
471 
472 /*----------------------------------------------------------------------------*/
481 /*----------------------------------------------------------------------------*/
482 
485 
486 /*----------------------------------------------------------------------------*/
496 /*----------------------------------------------------------------------------*/
497 
500 
501 /*----------------------------------------------------------------------------*/
512 /*----------------------------------------------------------------------------*/
513 
514 cs_real_t *
516  bool previous);
517 
518 /*----------------------------------------------------------------------------*/
519 
521 
522 #endif /* __CS_NAVSTO_COUPLING_H__ */
cs_real_t * mass_flux_array
Definition: cs_navsto_coupling.h:170
void cs_navsto_ac_init_setup(const cs_navsto_param_t *nsp, void *context)
Start setting-up the Navier-Stokes equations when an Artificial Compressibility algorithm is used to ...
Definition: cs_navsto_coupling.c:197
void cs_navsto_monolithic_init_setup(const cs_navsto_param_t *nsp, void *context)
Start setting-up the Navier-Stokes equations when a monolithic algorithm is used to coupled the syste...
Definition: cs_navsto_coupling.c:470
Definition: cs_advection_field.h:149
cs_field_t * predicted_velocity
Definition: cs_navsto_coupling.h:155
Field descriptor.
Definition: cs_field.h:125
void cs_navsto_monolithic_last_setup(const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, 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:512
cs_property_t * zeta
Definition: cs_navsto_coupling.h:80
cs_real_t * cs_navsto_ac_get_mass_flux(void *context, bool previous)
Retrieve the pointer to the mass flux array (used as the advection field). Case of artificial compres...
Definition: cs_navsto_coupling.c:354
void * cs_navsto_monolithic_create_context(cs_navsto_param_t *nsp, cs_param_bc_type_t bc)
Allocate and initialize a context structure when the Navier-Stokes system is coupled using a monolith...
Definition: cs_navsto_coupling.c:381
#define BEGIN_C_DECLS
Definition: cs_defs.h:495
cs_adv_field_t * cs_navsto_ac_get_adv_field(void *context)
Retrieve the pointer to the advection field structure playing the role of the mass flux Case of artif...
Definition: cs_navsto_coupling.c:330
Definition: cs_cdo_connect.h:76
cs_adv_field_t * cs_navsto_projection_get_adv_field(void *context)
Retrieve the pointer to the advection field structure playing the role of the mass flux Case of proje...
Definition: cs_navsto_coupling.c:934
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:307
cs_real_t * bdy_pressure_incr
Definition: cs_navsto_coupling.h:149
Structure storing the parameters related to the resolution of the Navier-Stokes system.
Definition: cs_navsto_param.h:462
double cs_real_t
Floating-point value.
Definition: cs_defs.h:307
void * cs_navsto_projection_free_context(const cs_navsto_param_t *nsp, void *context)
Free the context structure related to a Projection approach.
Definition: cs_navsto_coupling.c:736
Definition: cs_cdo_quantities.h:124
void cs_navsto_projection_last_setup(const cs_cdo_connect_t *connect, 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:823
cs_real_t * mass_flux_array_pre
Definition: cs_navsto_coupling.h:171
void * cs_navsto_ac_create_context(cs_navsto_param_t *nsp, cs_param_bc_type_t bc)
Allocate and initialize a context structure when the Navier-Stokes system is coupled using an Artific...
Definition: cs_navsto_coupling.c:108
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:911
cs_equation_t * momentum
Definition: cs_navsto_coupling.h:107
cs_equation_t * correction
Definition: cs_navsto_coupling.h:138
cs_real_t * mass_flux_array_pre
Definition: cs_navsto_coupling.h:123
cs_adv_field_t * adv_field
Definition: cs_navsto_coupling.h:162
cs_adv_field_t * cs_navsto_monolithic_get_adv_field(void *context)
Retrieve the pointer to the advection field structure playing the role of the mass flux Case of monol...
Definition: cs_navsto_coupling.c:601
cs_real_t * mass_flux_array
Definition: cs_navsto_coupling.h:95
cs_equation_t * prediction
Definition: cs_navsto_coupling.h:136
cs_real_t * mass_flux_array
Definition: cs_navsto_coupling.h:122
void cs_navsto_ac_last_setup(const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, 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:238
cs_adv_field_t * adv_field
Definition: cs_navsto_coupling.h:114
Set of parameters specific for solving the Navier-Stokes system with an incremental projection algori...
Definition: cs_navsto_coupling.h:134
cs_real_t * cs_navsto_monolithic_get_mass_flux(void *context, bool previous)
Retrieve the pointer to the mass flux array (used as the advection field). Case of monolithic algorit...
Definition: cs_navsto_coupling.c:625
cs_real_t * div_st
Definition: cs_navsto_coupling.h:144
void cs_navsto_projection_init_setup(const cs_navsto_param_t *nsp, 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:768
void * cs_navsto_projection_create_context(cs_navsto_param_t *nsp, cs_param_bc_type_t bc)
Allocate and initialize a context structure when the Navier-Stokes system is coupled using an increme...
Definition: cs_navsto_coupling.c:654
cs_equation_t * momentum
Definition: cs_navsto_coupling.h:74
#define END_C_DECLS
Definition: cs_defs.h:496
cs_param_bc_type_t
Definition: cs_param_types.h:365
void * cs_navsto_monolithic_free_context(const cs_navsto_param_t *nsp, void *context)
Free the context structure related to a monolithic approach.
Definition: cs_navsto_coupling.c:443
cs_real_t * cs_navsto_projection_get_mass_flux(void *context, bool previous)
Retrieve the pointer to the mass flux array (used as the advection field). Case of projection algorit...
Definition: cs_navsto_coupling.c:958
cs_real_t * mass_flux_array_pre
Definition: cs_navsto_coupling.h:96
Main structure to handle the discretization and the resolution of an equation.
void * cs_navsto_ac_free_context(const cs_navsto_param_t *nsp, void *context)
Free the context structure related to an Artificial Compressibility approach.
Definition: cs_navsto_coupling.c:169
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:578
Structure associated to the definition of a property relying on the cs_xdef_t structure.
Set of parameters specific for solving the Navier-Stokes system with a fully coupled monolithic algor...
Definition: cs_navsto_coupling.h:105
cs_adv_field_t * adv_field
Definition: cs_navsto_coupling.h:87
Set of parameters specific for solving the Navier-Stokes system with the "artificial compressibility"...
Definition: cs_navsto_coupling.h:72