My Project
programmer's 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-2019 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 #include "cs_param.h"
38 
39 /*----------------------------------------------------------------------------*/
40 
42 
57 /*============================================================================
58  * Macro definitions
59  *============================================================================*/
60 
61 /*============================================================================
62  * Type definitions
63  *============================================================================*/
64 
65 /* Predefined context structures depending on the settings */
66 /* ======================================================= */
67 
75 typedef struct {
76 
83 
91 typedef struct {
92 
103 
109 typedef struct {
110 
114 
122 typedef struct {
123 
133 
138 
144 
146 
155 typedef struct {
156 
164 
165 /*============================================================================
166  * Public function prototypes
167  *============================================================================*/
168 
169 /*----------------------------------------------------------------------------*/
179 /*----------------------------------------------------------------------------*/
180 
181 void *
183  cs_param_bc_type_t bc);
184 
185 /*----------------------------------------------------------------------------*/
195 /*----------------------------------------------------------------------------*/
196 
197 void *
199  void *context);
200 
201 /*----------------------------------------------------------------------------*/
210 /*----------------------------------------------------------------------------*/
211 
212 void
214  void *context);
215 
216 /*----------------------------------------------------------------------------*/
227 /*----------------------------------------------------------------------------*/
228 
229 void
231  const cs_cdo_quantities_t *quant,
232  const cs_navsto_param_t *nsp,
233  void *context);
234 
235 /*----------------------------------------------------------------------------*/
244 /*----------------------------------------------------------------------------*/
245 
247 cs_navsto_uzawa_get_momentum_eq(void *context);
248 
249 /*----------------------------------------------------------------------------*/
259 /*----------------------------------------------------------------------------*/
260 
261 void *
263  cs_param_bc_type_t bc);
264 
265 /*----------------------------------------------------------------------------*/
275 /*----------------------------------------------------------------------------*/
276 
277 void *
279  void *context);
280 
281 /*----------------------------------------------------------------------------*/
290 /*----------------------------------------------------------------------------*/
291 
292 void
294  void *context);
295 
296 /*----------------------------------------------------------------------------*/
307 /*----------------------------------------------------------------------------*/
308 
309 void
311  const cs_cdo_quantities_t *quant,
312  const cs_navsto_param_t *nsp,
313  void *context);
314 
315 /*----------------------------------------------------------------------------*/
324 /*----------------------------------------------------------------------------*/
325 
327 cs_navsto_ac_get_momentum_eq(void *context);
328 
329 /*----------------------------------------------------------------------------*/
339 /*----------------------------------------------------------------------------*/
340 
341 void *
343  cs_param_bc_type_t bc);
344 
345 /*----------------------------------------------------------------------------*/
355 /*----------------------------------------------------------------------------*/
356 
357 void *
359  void *context);
360 
361 /*----------------------------------------------------------------------------*/
370 /*----------------------------------------------------------------------------*/
371 
372 void
374  void *context);
375 
376 /*----------------------------------------------------------------------------*/
387 /*----------------------------------------------------------------------------*/
388 
389 void
391  const cs_cdo_quantities_t *quant,
392  const cs_navsto_param_t *nsp,
393  void *context);
394 
395 /*----------------------------------------------------------------------------*/
405 /*----------------------------------------------------------------------------*/
406 
408 cs_navsto_ac_vpp_get_momentum_eq(void *context);
409 
410 /*----------------------------------------------------------------------------*/
420 /*----------------------------------------------------------------------------*/
421 
422 void *
424  cs_param_bc_type_t bc);
425 
426 /*----------------------------------------------------------------------------*/
435 /*----------------------------------------------------------------------------*/
436 
437 void *
439  void *context);
440 
441 /*----------------------------------------------------------------------------*/
450 /*----------------------------------------------------------------------------*/
451 
452 void
454  void *context);
455 
456 /*----------------------------------------------------------------------------*/
467 /*----------------------------------------------------------------------------*/
468 
469 void
471  const cs_cdo_quantities_t *quant,
472  const cs_navsto_param_t *nsp,
473  void *context);
474 
475 /*----------------------------------------------------------------------------*/
484 /*----------------------------------------------------------------------------*/
485 
488 
489 /*----------------------------------------------------------------------------*/
500 /*----------------------------------------------------------------------------*/
501 
502 void *
504  cs_param_bc_type_t bc);
505 
506 /*----------------------------------------------------------------------------*/
515 /*----------------------------------------------------------------------------*/
516 
517 void *
519  void *context);
520 
521 /*----------------------------------------------------------------------------*/
532 /*----------------------------------------------------------------------------*/
533 
534 void
536  int loc_id,
537  bool has_previous,
538  void *context);
539 
540 /*----------------------------------------------------------------------------*/
551 /*----------------------------------------------------------------------------*/
552 
553 void
555  const cs_cdo_quantities_t *quant,
556  const cs_navsto_param_t *nsp,
557  void *context);
558 
559 /*----------------------------------------------------------------------------*/
568 /*----------------------------------------------------------------------------*/
569 
572 
573 /*----------------------------------------------------------------------------*/
574 
576 
577 #endif /* __CS_NAVSTO_COUPLING_H__ */
cs_navsto_ac_last_setup
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:483
cs_navsto_ac_vpp_init_setup
void cs_navsto_ac_vpp_init_setup(const cs_navsto_param_t *nsp, void *context)
Start setting-up the Navier-Stokes equations when an Artificial Compressibility with VPP algorithm is...
Definition: cs_navsto_coupling.c:637
cs_equation_t
Main structure to handle the discretization and the resolution of an equation.
cs_navsto_uzawa_t::energy
cs_equation_t * energy
Definition: cs_navsto_coupling.h:158
cs_navsto_projection_create_context
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:987
cs_navsto_ac_vpp_t::zeta
cs_property_t * zeta
Definition: cs_navsto_coupling.h:98
cs_navsto_ac_free_context
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:384
cs_navsto_projection_t::prediction
cs_equation_t * prediction
Definition: cs_navsto_coupling.h:124
cs_navsto_param_t
Structure storing the parameters related to the resolution of the Navier-Stokes system.
Definition: cs_navsto_param.h:255
cs_navsto_ac_t::momentum
cs_equation_t * momentum
Definition: cs_navsto_coupling.h:77
cs_navsto_ac_get_momentum_eq
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:524
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
cs_navsto_uzawa_t::zeta
cs_property_t * zeta
Definition: cs_navsto_coupling.h:160
cs_navsto_projection_free_context
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:1056
cs_navsto_monolithic_create_context
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:780
cs_real_t
double cs_real_t
Floating-point value.
Definition: cs_defs.h:302
cs_navsto_ac_t
Set of parameters specific for solving the Navier-Stokes system with the "artificial compressibility"...
Definition: cs_navsto_coupling.h:75
cs_navsto_monolithic_free_context
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:825
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
cs_navsto_ac_t::zeta
cs_property_t * zeta
Definition: cs_navsto_coupling.h:79
cs_navsto_monolithic_last_setup
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:927
cs_navsto_param.h
cs_navsto_projection_t::bdy_pressure_incr
cs_real_t * bdy_pressure_incr
Definition: cs_navsto_coupling.h:137
cs_navsto_projection_t
Set of parameters specific for solving the Navier-Stokes system with an incremental projection algori...
Definition: cs_navsto_coupling.h:122
cs_navsto_monolithic_t
Set of parameters specific for solving the Navier-Stokes system with a fully coupled monolithic algor...
Definition: cs_navsto_coupling.h:109
cs_navsto_uzawa_free_context
void * cs_navsto_uzawa_free_context(const cs_navsto_param_t *nsp, void *context)
Free the context structure related to an Uzawa-Augmented Lagrangian approach.
Definition: cs_navsto_coupling.c:160
cs_navsto_ac_vpp_last_setup
void cs_navsto_ac_vpp_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:711
cs_navsto_projection_init_setup
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:1085
cs_navsto_projection_last_setup
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:1133
cs_field.h
cs_navsto_projection_t::predicted_velocity
cs_field_t * predicted_velocity
Definition: cs_navsto_coupling.h:143
cs_cdo_quantities_t
Definition: cs_cdo_quantities.h:94
cs_property_t
Definition: cs_property.h:104
cs_navsto_projection_t::correction
cs_equation_t * correction
Definition: cs_navsto_coupling.h:126
cs_cdo_connect_t
Definition: cs_cdo_connect.h:74
cs_navsto_monolithic_t::momentum
cs_equation_t * momentum
Definition: cs_navsto_coupling.h:111
cs_navsto_ac_init_setup
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:409
cs_navsto_projection_t::div_st
cs_real_t * div_st
Definition: cs_navsto_coupling.h:132
cs_navsto_uzawa_get_momentum_eq
cs_equation_t * cs_navsto_uzawa_get_momentum_eq(void *context)
Retrieve the pointer to the cs_equation_t structure related to the momentum equation in case of Uzawa...
Definition: cs_navsto_coupling.c:314
cs_navsto_ac_vpp_get_momentum_eq
cs_equation_t * cs_navsto_ac_vpp_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:754
cs_navsto_uzawa_t
Set of parameters specific for solving the Navier-Stokes system with a fully coupled algorithm using ...
Definition: cs_navsto_coupling.h:155
cs_navsto_monolithic_get_momentum_eq
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:963
cs_navsto_ac_vpp_t
Set of parameters specific for solving the Navier-Stokes system with the "artificial compressibility"...
Definition: cs_navsto_coupling.h:91
cs_navsto_uzawa_t::momentum
cs_equation_t * momentum
Definition: cs_navsto_coupling.h:157
cs_navsto_uzawa_create_context
void * cs_navsto_uzawa_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 Uzawa-A...
Definition: cs_navsto_coupling.c:110
cs_navsto_ac_vpp_t::graddiv
cs_equation_t * graddiv
Definition: cs_navsto_coupling.h:94
cs_navsto_uzawa_last_setup
void cs_navsto_uzawa_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 Uzawa Augmented Lagrangian algorithm is us...
Definition: cs_navsto_coupling.c:272
cs_equation.h
cs_navsto_ac_vpp_free_context
void * cs_navsto_ac_vpp_free_context(const cs_navsto_param_t *nsp, void *context)
Free the context structure related to an Artificial Compressibility with the VPP approach.
Definition: cs_navsto_coupling.c:612
cs_navsto_monolithic_init_setup
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:850
cs_navsto_ac_vpp_t::momentum
cs_equation_t * momentum
Definition: cs_navsto_coupling.h:93
cs_field_t
Field descriptor.
Definition: cs_field.h:124
cs_param_bc_type_t
cs_param_bc_type_t
Definition: cs_param.h:302
cs_param.h
cs_navsto_uzawa_init_setup
void cs_navsto_uzawa_init_setup(const cs_navsto_param_t *nsp, void *context)
Start setting-up the Navier-Stokes equations when a Uzawa Augmented Lagrangian algorithm is used to c...
Definition: cs_navsto_coupling.c:185
cs_navsto_ac_create_context
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:337
cs_navsto_ac_vpp_create_context
void * cs_navsto_ac_vpp_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:547
cs_navsto_projection_get_momentum_eq
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:1190