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-2018 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_equation_param.h"
33 
34 /*----------------------------------------------------------------------------*/
35 
37 
38 /*============================================================================
39  * Macro definitions
40  *============================================================================*/
41 
42 /*============================================================================
43  * Type definitions
44  *============================================================================*/
45 
68 typedef enum {
69 
74 
76 
78 
94 typedef enum {
95 
99 
101 
103 
125 typedef enum {
126 
131 
133 
135 
141 typedef struct {
142 
147 
152 
162 
167 
172 
182 
187 
192 
199 
205 
211 
218 
233 
240 
258 
263 
271 
277 
282 
290 
294 
336 typedef enum {
337 
347 
349 
351 
352 /*============================================================================
353  * Inline static public function prototypes
354  *============================================================================*/
355 
356 /*----------------------------------------------------------------------------*/
365 /*----------------------------------------------------------------------------*/
366 
367 static inline bool
369 {
370  if (nsp == NULL)
371  return true;
372 
374  return true;
375  else
376  return false;
377 }
378 
379 /*============================================================================
380  * Public function prototypes
381  *============================================================================*/
382 
383 /*----------------------------------------------------------------------------*/
394 /*----------------------------------------------------------------------------*/
395 
398  cs_navsto_param_time_state_t time_state,
399  cs_navsto_param_coupling_t algo_coupling);
400 
401 /*----------------------------------------------------------------------------*/
409 /*----------------------------------------------------------------------------*/
410 
413 
414 /*----------------------------------------------------------------------------*/
423 /*----------------------------------------------------------------------------*/
424 
425 void
427  cs_navsto_key_t key,
428  const char *keyval);
429 
430 /*----------------------------------------------------------------------------*/
438 /*----------------------------------------------------------------------------*/
439 
440 void
442  cs_equation_param_t *eqp);
443 
444 /*----------------------------------------------------------------------------*/
450 /*----------------------------------------------------------------------------*/
451 
452 void
454 
455 /*----------------------------------------------------------------------------*/
463 /*----------------------------------------------------------------------------*/
464 
465 const char *
467 
468 /*----------------------------------------------------------------------------*/
482 /*----------------------------------------------------------------------------*/
483 
484 cs_xdef_t *
486  const char *z_name,
487  cs_real_t *val);
488 
489 /*----------------------------------------------------------------------------*/
504 /*----------------------------------------------------------------------------*/
505 
506 cs_xdef_t *
508  const char *z_name,
509  cs_analytic_func_t *analytic,
510  void *input);
511 
512 /*----------------------------------------------------------------------------*/
526 /*----------------------------------------------------------------------------*/
527 
528 cs_xdef_t *
530  const char *z_name,
531  cs_real_t *val);
532 
533 /*----------------------------------------------------------------------------*/
548 /*----------------------------------------------------------------------------*/
549 
550 cs_xdef_t *
552  const char *z_name,
553  cs_analytic_func_t *analytic,
554  void *input);
555 
556 /*----------------------------------------------------------------------------*/
568 /*----------------------------------------------------------------------------*/
569 
570 cs_xdef_t *
572  const char *z_name,
573  cs_analytic_func_t *ana,
574  void *input);
575 
576 /*----------------------------------------------------------------------------*/
587 /*----------------------------------------------------------------------------*/
588 
589 cs_xdef_t *
591  const char *z_name,
592  cs_real_t *val);
593 
594 /*----------------------------------------------------------------------------*/
607 /*----------------------------------------------------------------------------*/
608 
609 cs_xdef_t *
611  const char *z_name,
612  cs_flag_t loc,
613  cs_real_t *array,
614  cs_lnum_t *index);
615 
616 /*----------------------------------------------------------------------------*/
617 
619 
620 #endif /* __CS_NAVSTO_PARAM_H__ */
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:460
Definition: cs_navsto_param.h:346
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:500
Definition: cs_navsto_param.h:348
Definition: cs_navsto_param.h:339
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, it enables to access in coords at the right location and the same thing to fill retval if compact is set to false.
Definition: cs_param.h:66
Definition: cs_navsto_param.h:73
int n_velocity_ic_defs
Definition: cs_navsto_param.h:262
cs_property_t * lami_viscosity
Definition: cs_navsto_param.h:239
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:368
cs_navsto_param_coupling_t
Choice of algorithm for solving the system.
Definition: cs_navsto_param.h:125
bool velocity_ic_is_owner
Definition: cs_navsto_param.h:257
Definition: cs_navsto_param.h:132
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources...
Definition: cs_equation_param.h:159
Definition: cs_navsto_param.h:72
cs_xdef_t ** pressure_ic_defs
Definition: cs_navsto_param.h:289
int max_algo_iter
Definition: cs_navsto_param.h:217
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:678
Definition: cs_navsto_param.h:342
Definition: cs_navsto_param.h:345
Definition: cs_navsto_param.h:96
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:843
cs_real_3_t gravity
Definition: cs_navsto_param.h:181
#define BEGIN_C_DECLS
Definition: cs_defs.h:462
cs_quadrature_type_t qtype
Definition: cs_navsto_param.h:204
Definition: cs_navsto_param.h:341
cs_real_t gd_scale_coef
Definition: cs_navsto_param.h:198
Definition: cs_navsto_param.h:98
int n_pressure_ic_defs
Definition: cs_navsto_param.h:281
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:873
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:298
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:615
Structure storing the parameters related to the resolution of the Navier-Stokes system.
Definition: cs_navsto_param.h:141
Definition: cs_navsto_param.h:100
double cs_real_t
Floating-point value.
Definition: cs_defs.h:297
cs_navsto_param_time_state_t
Status of the time for the Navier-Stokes system of equations.
Definition: cs_navsto_param.h:94
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, cs_lnum_t *index)
Define a new source term structure defined by an array.
Definition: cs_navsto_param.c:901
Definition: cs_navsto_param.h:71
cs_quadrature_type_t
Definition: cs_quadrature.h:51
cs_navsto_key_t
List of available keys for setting the parameters of the Navier-Stokes system.
Definition: cs_navsto_param.h:336
bool has_gravity
Definition: cs_navsto_param.h:180
cs_param_time_scheme_t time_scheme
Definition: cs_navsto_param.h:160
Definition: cs_navsto_param.h:129
Definition: cs_navsto_param.h:75
cs_navsto_param_model_t model
Definition: cs_navsto_param.h:171
cs_param_time_scheme_t
Definition: cs_param.h:180
static int input(void)
cs_param_dof_reduction_t
Definition: cs_param.h:148
cs_xdef_t ** velocity_ic_defs
Definition: cs_navsto_param.h:270
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:744
bool pressure_ic_is_owner
Definition: cs_navsto_param.h:276
Definition: cs_navsto_param.h:344
Structure storing medata for defining a quantity in a very flexible way.
Definition: cs_xdef.h:126
cs_real_t theta
Definition: cs_navsto_param.h:161
cs_navsto_param_time_state_t time_state
Definition: cs_navsto_param.h:186
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:310
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:579
cs_property_t * density
Definition: cs_navsto_param.h:232
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:793
Definition: cs_navsto_param.h:70
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:293
Definition: cs_navsto_param.h:97
Definition: cs_navsto_param.h:340
#define END_C_DECLS
Definition: cs_defs.h:463
Definition: cs_navsto_param.h:127
unsigned short int cs_flag_t
Definition: cs_defs.h:299
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:253
int verbosity
Definition: cs_navsto_param.h:146
Definition: cs_navsto_param.h:130
Definition: cs_navsto_param.h:128
Definition: cs_navsto_param.h:343
cs_param_dof_reduction_t dof_reduction_mode
Definition: cs_navsto_param.h:151
cs_param_space_scheme_t
Type of numerical scheme for the discretization in space.
Definition: cs_param.h:122
cs_navsto_param_model_t
Modelling related to the Navier-Stokes system of equations.
Definition: cs_navsto_param.h:68
cs_navsto_param_t * cs_navsto_param_create(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:195
Structure and routines handling the specific settings related to a cs_equation_t structure.
Definition: cs_navsto_param.h:338
Definition: cs_property.h:104
cs_navsto_param_coupling_t coupling
Definition: cs_navsto_param.h:191
cs_real_t residual_tolerance
Definition: cs_navsto_param.h:210
cs_param_space_scheme_t space_scheme
Definition: cs_navsto_param.h:166