My Project
programmer's documentation
cs_navsto_param.h
Go to the documentation of this file.
1 #ifndef __CS_NAVSTO_PARAM_H__
2 #define __CS_NAVSTO_PARAM_H__
3 
4 /*============================================================================
5  * Routines to handle cs_navsto_param_t structure
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2019 EDF S.A.
12 
13  This program is free software; you can redistribute it and/or modify it under
14  the terms of the GNU General Public License as published by the Free Software
15  Foundation; either version 2 of the License, or (at your option) any later
16  version.
17 
18  This program is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21  details.
22 
23  You should have received a copy of the GNU General Public License along with
24  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25  Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 */
27 
28 /*----------------------------------------------------------------------------
29  * Local headers
30  *----------------------------------------------------------------------------*/
31 
32 #include "cs_boundary.h"
33 #include "cs_equation_param.h"
34 
35 /*----------------------------------------------------------------------------*/
36 
38 
39 /*============================================================================
40  * Macro definitions
41  *============================================================================*/
42 
43 /*============================================================================
44  * Type definitions
45  *============================================================================*/
46 
69 typedef enum {
70 
75 
77 
79 
175 typedef enum {
176 
184 
186 
188 
204 typedef enum {
205 
209 
211 
213 
238 typedef enum {
239 
245 
247 
249 
255 typedef struct {
256 
261 
272 
282 
287 
292 
302 
307 
312 
317 
324 
330 
336 
343 
352 
367 
374 
404 
422 
431  /* \var boundaries
432  * Pointer to a \ref cs_boundary_t structure shared with the domain
433  */
435 
454 
471 
475 
476 
531 typedef enum {
532 
545 
547 
549 
550 /*============================================================================
551  * Inline static public function prototypes
552  *============================================================================*/
553 
554 /*----------------------------------------------------------------------------*/
563 /*----------------------------------------------------------------------------*/
564 
565 static inline bool
567 {
568  if (nsp == NULL)
569  return true;
570 
572  return true;
573  else
574  return false;
575 }
576 
577 /*============================================================================
578  * Public function prototypes
579  *============================================================================*/
580 
581 /*----------------------------------------------------------------------------*/
593 /*----------------------------------------------------------------------------*/
594 
596 cs_navsto_param_create(const cs_boundary_t *boundaries,
598  cs_navsto_param_time_state_t time_state,
599  cs_navsto_param_coupling_t algo_coupling);
600 
601 /*----------------------------------------------------------------------------*/
609 /*----------------------------------------------------------------------------*/
610 
613 
614 /*----------------------------------------------------------------------------*/
623 /*----------------------------------------------------------------------------*/
624 
625 void
627  cs_navsto_key_t key,
628  const char *keyval);
629 
630 /*----------------------------------------------------------------------------*/
638 /*----------------------------------------------------------------------------*/
639 
640 void
642  cs_equation_param_t *eqp);
643 
644 /*----------------------------------------------------------------------------*/
650 /*----------------------------------------------------------------------------*/
651 
652 void
654 
655 /*----------------------------------------------------------------------------*/
663 /*----------------------------------------------------------------------------*/
664 
665 const char *
667 
668 /*----------------------------------------------------------------------------*/
682 /*----------------------------------------------------------------------------*/
683 
684 cs_xdef_t *
686  const char *z_name,
687  cs_real_t *val);
688 
689 /*----------------------------------------------------------------------------*/
704 /*----------------------------------------------------------------------------*/
705 
706 cs_xdef_t *
708  const char *z_name,
709  cs_analytic_func_t *analytic,
710  void *input);
711 
712 /*----------------------------------------------------------------------------*/
726 /*----------------------------------------------------------------------------*/
727 
728 cs_xdef_t *
730  const char *z_name,
731  cs_real_t *val);
732 
733 /*----------------------------------------------------------------------------*/
748 /*----------------------------------------------------------------------------*/
749 
750 cs_xdef_t *
752  const char *z_name,
753  cs_analytic_func_t *analytic,
754  void *input);
755 
756 /*----------------------------------------------------------------------------*/
764 /*----------------------------------------------------------------------------*/
765 
766 void
768 
769 /*----------------------------------------------------------------------------*/
777 /*----------------------------------------------------------------------------*/
778 
779 void
781 
782 /*----------------------------------------------------------------------------*/
790 /*----------------------------------------------------------------------------*/
791 
792 void
794 
795 /*----------------------------------------------------------------------------*/
804 /*----------------------------------------------------------------------------*/
805 
806 void
808  const char *z_name,
809  cs_real_t *values);
810 
811 /*----------------------------------------------------------------------------*/
821 /*----------------------------------------------------------------------------*/
822 
823 void
825  const char *z_name,
826  cs_real_t *values);
827 
828 /*----------------------------------------------------------------------------*/
838 /*----------------------------------------------------------------------------*/
839 
840 void
842  const char *z_name,
843  cs_real_t *values);
844 
845 /*----------------------------------------------------------------------------*/
856 /*----------------------------------------------------------------------------*/
857 
858 void
860  const char *z_name,
861  cs_analytic_func_t *ana,
862  void *input);
863 
864 /*----------------------------------------------------------------------------*/
876 /*----------------------------------------------------------------------------*/
877 
878 cs_xdef_t *
880  const char *z_name,
881  cs_analytic_func_t *ana,
882  void *input);
883 
884 /*----------------------------------------------------------------------------*/
895 /*----------------------------------------------------------------------------*/
896 
897 cs_xdef_t *
899  const char *z_name,
900  cs_real_t *val);
901 
902 /*----------------------------------------------------------------------------*/
917 /*----------------------------------------------------------------------------*/
918 
919 cs_xdef_t *
921  const char *z_name,
922  cs_flag_t loc,
923  cs_real_t *array,
924  bool is_owner,
925  cs_lnum_t *index);
926 
927 /*----------------------------------------------------------------------------*/
934 /*----------------------------------------------------------------------------*/
935 
936 void
938  cs_adv_field_t *adv_fld);
939 
940 /*----------------------------------------------------------------------------*/
941 
943 
944 #endif /* __CS_NAVSTO_PARAM_H__ */
CS_NAVSTO_SLES_N_TYPES
Definition: cs_navsto_param.h:185
CS_NSKEY_ADVECTION_FORMULATION
Definition: cs_navsto_param.h:533
cs_navsto_set_fixed_walls
void cs_navsto_set_fixed_walls(cs_navsto_param_t *nsp)
Add the definition of boundary conditions related to a fixed wall into the set of parameters for the ...
Definition: cs_navsto_param.c:1044
CS_NAVSTO_TIME_STATE_FULL_STEADY
Definition: cs_navsto_param.h:206
cs_navsto_param_t::time_scheme
cs_param_time_scheme_t time_scheme
Definition: cs_navsto_param.h:280
input
static int input(void)
CS_NSKEY_SPACE_SCHEME
Definition: cs_navsto_param.h:541
CS_NAVSTO_SLES_ADDITIVE_GMRES_BY_BLOCK
Definition: cs_navsto_param.h:179
cs_navsto_param_t::n_pressure_bc_defs
int n_pressure_bc_defs
Definition: cs_navsto_param.h:469
cs_navsto_add_pressure_ic_by_value
cs_xdef_t * cs_navsto_add_pressure_ic_by_value(cs_navsto_param_t *nsp, const char *z_name, cs_real_t *val)
Define the initial condition for the pressure unknowns. This definition can be done on a specified me...
Definition: cs_navsto_param.c:949
cs_param_dof_reduction_t
cs_param_dof_reduction_t
Definition: cs_param.h:151
CS_NAVSTO_TIME_STATE_UNSTEADY
Definition: cs_navsto_param.h:208
cs_navsto_add_source_term_by_analytic
cs_xdef_t * cs_navsto_add_source_term_by_analytic(cs_navsto_param_t *nsp, const char *z_name, cs_analytic_func_t *ana, void *input)
Define a new source term structure defined by an analytical function.
Definition: cs_navsto_param.c:1444
CS_NSKEY_QUADRATURE
Definition: cs_navsto_param.h:538
cs_navsto_param_t::velocity_ic_defs
cs_xdef_t ** velocity_ic_defs
Definition: cs_navsto_param.h:403
cs_xdef_t
Structure storing medata for defining a quantity in a very flexible way.
Definition: cs_xdef.h:126
CS_NSKEY_SLES_STRATEGY
Definition: cs_navsto_param.h:540
cs_navsto_add_source_term_by_array
cs_xdef_t * cs_navsto_add_source_term_by_array(cs_navsto_param_t *nsp, const char *z_name, cs_flag_t loc, cs_real_t *array, bool is_owner, cs_lnum_t *index)
Define a new source term structure defined by an array.
Definition: cs_navsto_param.c:1504
cs_navsto_param_t::time_state
cs_navsto_param_time_state_t time_state
Definition: cs_navsto_param.h:306
CS_NAVSTO_SLES_UPPER_SCHUR_GMRES
Definition: cs_navsto_param.h:181
CS_NAVSTO_COUPLING_MONOLITHIC
Definition: cs_navsto_param.h:242
cs_navsto_param_t::qtype
cs_quadrature_type_t qtype
Definition: cs_navsto_param.h:329
cs_real_3_t
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:315
cs_navsto_add_source_term_by_val
cs_xdef_t * cs_navsto_add_source_term_by_val(cs_navsto_param_t *nsp, const char *z_name, cs_real_t *val)
Define a new source term structure defined by a constant value.
Definition: cs_navsto_param.c:1474
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_param_model_t
cs_navsto_param_model_t
Modelling related to the Navier-Stokes system of equations.
Definition: cs_navsto_param.h:69
cs_boundary_t
Structure storing information related to the "physical" boundaries that one want to set on the comput...
Definition: cs_boundary.h:77
CS_NAVSTO_MODEL_OSEEN
Definition: cs_navsto_param.h:72
cs_navsto_param_get_coupling_name
const char * cs_navsto_param_get_coupling_name(cs_navsto_param_coupling_t coupling)
Retrieve the name of the coupling algorithm.
Definition: cs_navsto_param.c:783
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
CS_NSKEY_GD_SCALE_COEF
Definition: cs_navsto_param.h:536
cs_navsto_param_t::model
cs_navsto_param_model_t model
Definition: cs_navsto_param.h:291
cs_navsto_param_t::boundaries
const cs_boundary_t * boundaries
Definition: cs_navsto_param.h:434
cs_navsto_param_t::coupling
cs_navsto_param_coupling_t coupling
Definition: cs_navsto_param.h:316
cs_navsto_param_time_state_t
cs_navsto_param_time_state_t
Status of the time for the Navier-Stokes system of equations.
Definition: cs_navsto_param.h:204
cs_real_t
double cs_real_t
Floating-point value.
Definition: cs_defs.h:302
CS_NSKEY_RESIDUAL_TOLERANCE
Definition: cs_navsto_param.h:539
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
cs_navsto_param_t::pressure_ic_is_owner
bool pressure_ic_is_owner
Definition: cs_navsto_param.h:419
cs_navsto_param_t::theta
cs_real_t theta
Definition: cs_navsto_param.h:281
CS_NAVSTO_SLES_BLOCK_MULTIGRID_CG
Definition: cs_navsto_param.h:178
CS_NAVSTO_N_MODELS
Definition: cs_navsto_param.h:76
CS_NAVSTO_N_COUPLINGS
Definition: cs_navsto_param.h:246
cs_param_advection_scheme_t
cs_param_advection_scheme_t
Definition: cs_param.h:255
cs_navsto_param_is_steady
static bool cs_navsto_param_is_steady(cs_navsto_param_t *nsp)
Ask cs_navsto_param_t structure if the settings correspond to a steady computation.
Definition: cs_navsto_param.h:566
cs_navsto_param_sles_t
cs_navsto_param_sles_t
High-level information about the way of settings the SLES for solving the Navier-Stokes system....
Definition: cs_navsto_param.h:175
CS_NAVSTO_COUPLING_ARTIFICIAL_COMPRESSIBILITY_VPP
Definition: cs_navsto_param.h:241
cs_navsto_param_t::velocity_ic_is_owner
bool velocity_ic_is_owner
Definition: cs_navsto_param.h:401
cs_navsto_param_t::sles_strategy
cs_navsto_param_sles_t sles_strategy
Definition: cs_navsto_param.h:311
cs_navsto_param_t::velocity_bc_is_owner
bool velocity_bc_is_owner
Definition: cs_navsto_param.h:451
cs_navsto_add_pressure_ic_by_analytic
cs_xdef_t * cs_navsto_add_pressure_ic_by_analytic(cs_navsto_param_t *nsp, const char *z_name, cs_analytic_func_t *analytic, void *input)
Define the initial condition for the pressure unkowns. This definition can be done on a specified mes...
Definition: cs_navsto_param.c:998
cs_navsto_param_t::pressure_bc_is_owner
bool pressure_bc_is_owner
Definition: cs_navsto_param.h:468
cs_navsto_param_free
cs_navsto_param_t * cs_navsto_param_free(cs_navsto_param_t *param)
Free a cs_navsto_param_t structure.
Definition: cs_navsto_param.c:317
cs_equation_param_t
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources.
Definition: cs_equation_param.h:148
cs_navsto_param_t::pressure_bc_defs
cs_xdef_t ** pressure_bc_defs
Definition: cs_navsto_param.h:470
cs_navsto_set_pressure_bc_by_value
void cs_navsto_set_pressure_bc_by_value(cs_navsto_param_t *nsp, const char *z_name, cs_real_t *values)
Define the pressure field on a boundary using a uniform value.
Definition: cs_navsto_param.c:1190
cs_navsto_set_outlets
void cs_navsto_set_outlets(cs_navsto_param_t *nsp)
Add the definition of boundary conditions related to outlets into the set of parameters for the manag...
Definition: cs_navsto_param.c:1141
cs_navsto_param_t::space_scheme
cs_param_space_scheme_t space_scheme
Definition: cs_navsto_param.h:286
CS_NAVSTO_N_TIME_STATES
Definition: cs_navsto_param.h:210
CS_NAVSTO_SLES_GKB_GMRES
Definition: cs_navsto_param.h:182
CS_NAVSTO_COUPLING_UZAWA
Definition: cs_navsto_param.h:244
cs_navsto_param_transfer
void cs_navsto_param_transfer(const cs_navsto_param_t *nsp, cs_equation_param_t *eqp)
Apply the numerical settings defined for the Navier-Stokes system to an equation related to this syst...
Definition: cs_navsto_param.c:632
cs_navsto_param_t::n_velocity_ic_defs
int n_velocity_ic_defs
Definition: cs_navsto_param.h:402
cs_navsto_param_t::n_velocity_bc_defs
int n_velocity_bc_defs
Definition: cs_navsto_param.h:452
cs_navsto_set_velocity_wall_by_value
void cs_navsto_set_velocity_wall_by_value(cs_navsto_param_t *nsp, const char *z_name, cs_real_t *values)
Define the velocity field for a sliding wall boundary using a uniform value.
Definition: cs_navsto_param.c:1272
cs_navsto_param_t::n_pressure_ic_defs
int n_pressure_ic_defs
Definition: cs_navsto_param.h:420
CS_NAVSTO_SLES_GKB
Definition: cs_navsto_param.h:183
CS_NAVSTO_MODEL_STOKES
Definition: cs_navsto_param.h:71
cs_navsto_key_t
cs_navsto_key_t
List of available keys for setting the parameters of the Navier-Stokes system.
Definition: cs_navsto_param.h:531
cs_property_t
Definition: cs_property.h:104
cs_lnum_t
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:298
cs_param_space_scheme_t
cs_param_space_scheme_t
Type of numerical scheme for the discretization in space.
Definition: cs_param.h:125
cs_param_advection_form_t
cs_param_advection_form_t
Definition: cs_param.h:212
cs_navsto_param_t::adv_form
cs_param_advection_form_t adv_form
Definition: cs_navsto_param.h:350
cs_navsto_param_t::adv_scheme
cs_param_advection_scheme_t adv_scheme
Definition: cs_navsto_param.h:351
cs_analytic_func_t
void() cs_analytic_func_t(cs_real_t time, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, const cs_real_t *coords, bool compact, void *input, cs_real_t *retval)
Generic function pointer for an analytic function elt_ids is optional. If not NULL,...
Definition: cs_param.h:66
CS_NAVSTO_SLES_EQ_WITHOUT_BLOCK
Definition: cs_navsto_param.h:177
cs_navsto_param_t::gravity
cs_real_3_t gravity
Definition: cs_navsto_param.h:301
cs_navsto_param_t::residual_tolerance
cs_real_t residual_tolerance
Definition: cs_navsto_param.h:335
CS_NSKEY_DOF_REDUCTION
Definition: cs_navsto_param.h:535
CS_NAVSTO_SLES_DIAG_SCHUR_GMRES
Definition: cs_navsto_param.h:180
CS_NSKEY_ADVECTION_SCHEME
Definition: cs_navsto_param.h:534
cs_navsto_set_symmetries
void cs_navsto_set_symmetries(cs_navsto_param_t *nsp)
Add the definition of boundary conditions related to a symmetry into the set of parameters for the ma...
Definition: cs_navsto_param.c:1091
cs_navsto_param_set
void cs_navsto_param_set(cs_navsto_param_t *nsp, cs_navsto_key_t key, const char *keyval)
Set a parameter attached to a keyname in a cs_navsto_param_t structure.
Definition: cs_navsto_param.c:391
cs_navsto_param_t::gd_scale_coef
cs_real_t gd_scale_coef
Definition: cs_navsto_param.h:323
cs_navsto_add_oseen_field
void cs_navsto_add_oseen_field(cs_navsto_param_t *nsp, cs_adv_field_t *adv_fld)
Add a advection field for the Oseen problem.
Definition: cs_navsto_param.c:1530
cs_navsto_param_t::lami_viscosity
cs_property_t * lami_viscosity
Definition: cs_navsto_param.h:373
CS_NSKEY_VERBOSITY
Definition: cs_navsto_param.h:544
CS_NAVSTO_MODEL_BOUSSINESQ_NAVIER_STOKES
Definition: cs_navsto_param.h:74
cs_navsto_param_t::has_gravity
bool has_gravity
Definition: cs_navsto_param.h:300
CS_NSKEY_N_KEYS
Definition: cs_navsto_param.h:546
CS_NSKEY_TIME_SCHEME
Definition: cs_navsto_param.h:542
cs_flag_t
unsigned short int cs_flag_t
Definition: cs_defs.h:304
cs_navsto_param_t::pressure_ic_defs
cs_xdef_t ** pressure_ic_defs
Definition: cs_navsto_param.h:421
cs_navsto_param_create
cs_navsto_param_t * cs_navsto_param_create(const cs_boundary_t *boundaries, cs_navsto_param_model_t model, cs_navsto_param_time_state_t time_state, cs_navsto_param_coupling_t algo_coupling)
Create a new structure to store all numerical parameters related to the resolution of the Navier-Stok...
Definition: cs_navsto_param.c:218
cs_navsto_param_t::verbosity
int verbosity
Definition: cs_navsto_param.h:260
cs_navsto_add_velocity_ic_by_value
cs_xdef_t * cs_navsto_add_velocity_ic_by_value(cs_navsto_param_t *nsp, const char *z_name, cs_real_t *val)
Define the initial condition for the velocity unknowns. This definition can be done on a specified me...
Definition: cs_navsto_param.c:820
cs_navsto_param_t::velocity_bc_defs
cs_xdef_t ** velocity_bc_defs
Definition: cs_navsto_param.h:453
cs_navsto_param_coupling_t
cs_navsto_param_coupling_t
Choice of algorithm for solving the system.
Definition: cs_navsto_param.h:238
cs_equation_param.h
Structure and routines handling the specific settings related to a cs_equation_t structure.
CS_NAVSTO_MODEL_INCOMPRESSIBLE_NAVIER_STOKES
Definition: cs_navsto_param.h:73
cs_navsto_param_t::max_algo_iter
int max_algo_iter
Definition: cs_navsto_param.h:342
cs_navsto_param_log
void cs_navsto_param_log(const cs_navsto_param_t *nsp)
Summary of the main cs_navsto_param_t structure.
Definition: cs_navsto_param.c:683
cs_quadrature_type_t
cs_quadrature_type_t
Definition: cs_quadrature.h:51
cs_navsto_add_velocity_ic_by_analytic
cs_xdef_t * cs_navsto_add_velocity_ic_by_analytic(cs_navsto_param_t *nsp, const char *z_name, cs_analytic_func_t *analytic, void *input)
Define the initial condition for the velocity unkowns. This definition can be done on a specified mes...
Definition: cs_navsto_param.c:883
CS_NSKEY_TIME_THETA
Definition: cs_navsto_param.h:543
cs_param_time_scheme_t
cs_param_time_scheme_t
Definition: cs_param.h:183
cs_navsto_set_velocity_inlet_by_analytic
void cs_navsto_set_velocity_inlet_by_analytic(cs_navsto_param_t *nsp, const char *z_name, cs_analytic_func_t *ana, void *input)
Define the velocity field for an inlet boundary using an analytical function.
Definition: cs_navsto_param.c:1385
cs_adv_field_t
Definition: cs_advection_field.h:149
CS_NAVSTO_TIME_STATE_LIMIT_STEADY
Definition: cs_navsto_param.h:207
CS_NAVSTO_COUPLING_PROJECTION
Definition: cs_navsto_param.h:243
CS_NAVSTO_COUPLING_ARTIFICIAL_COMPRESSIBILITY
Definition: cs_navsto_param.h:240
cs_navsto_param_t::density
cs_property_t * density
Definition: cs_navsto_param.h:366
cs_navsto_param_t::dof_reduction_mode
cs_param_dof_reduction_t dof_reduction_mode
Definition: cs_navsto_param.h:271
cs_boundary.h
CS_NSKEY_MAX_ALGO_ITER
Definition: cs_navsto_param.h:537
cs_navsto_set_velocity_inlet_by_value
void cs_navsto_set_velocity_inlet_by_value(cs_navsto_param_t *nsp, const char *z_name, cs_real_t *values)
Define the velocity field for an inlet boundary using a uniform value.
Definition: cs_navsto_param.c:1328