programmer's documentation
cs_navsto_system.h
Go to the documentation of this file.
1 #ifndef __CS_NAVSTO_SYSTEM_H__
2 #define __CS_NAVSTO_SYSTEM_H__
3 
4 /*============================================================================
5  * Routines to handle cs_navsto_system_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_advection_field.h"
33 #include "cs_field.h"
34 #include "cs_param.h"
35 #include "cs_property.h"
36 #include "cs_mesh.h"
37 #include "cs_navsto_param.h"
38 #include "cs_time_step.h"
39 #include "cs_xdef.h"
40 
41 /*----------------------------------------------------------------------------*/
42 
44 
51 /*============================================================================
52  * Macro definitions
53  *============================================================================*/
54 
55 /*============================================================================
56  * Type definitions
57  *============================================================================*/
58 
59 /*----------------------------------------------------------------------------*/
68 /*----------------------------------------------------------------------------*/
69 
70 typedef void
72  const void *nscc);
73 
74 /*----------------------------------------------------------------------------*/
81 /*----------------------------------------------------------------------------*/
82 
83 typedef void
85 
86 /*----------------------------------------------------------------------------*/
98 /*----------------------------------------------------------------------------*/
99 
100 typedef void
102  double dt_cur,
103  const cs_navsto_param_t *nsp,
104  void *nscc);
105 
106 /*=============================================================================
107  * Local Macro definitions and structure definitions
108  *============================================================================*/
109 
115 typedef struct {
116 
121 
122  /* Set of fields (resolved variables): fields are created according to the
123  choice of model for Navier-Stokes */
128 
139 
145  void *context;
146 
158 
165 
171 
175 
176 /*============================================================================
177  * Public function prototypes
178  *============================================================================*/
179 
180 /*----------------------------------------------------------------------------*/
187 /*----------------------------------------------------------------------------*/
188 
189 bool
191 
192 /*----------------------------------------------------------------------------*/
202 /*----------------------------------------------------------------------------*/
203 
206  cs_navsto_param_time_state_t time_state,
207  cs_navsto_param_coupling_t algo_coupling);
208 
209 /*----------------------------------------------------------------------------*/
213 /*----------------------------------------------------------------------------*/
214 
215 void
217 
218 /*----------------------------------------------------------------------------*/
223 /*----------------------------------------------------------------------------*/
224 
227 
228 /*----------------------------------------------------------------------------*/
234 /*----------------------------------------------------------------------------*/
235 
236 void
238 
239 /*----------------------------------------------------------------------------*/
246 /*----------------------------------------------------------------------------*/
247 
248 void
250  const cs_cdo_quantities_t *quant);
251 
252 /*----------------------------------------------------------------------------*/
257 /*----------------------------------------------------------------------------*/
258 
259 void
261 
262 /*----------------------------------------------------------------------------*/
269 /*----------------------------------------------------------------------------*/
270 
271 void
273  double dt_cur);
274 
275 /*----------------------------------------------------------------------------*/
297 /*----------------------------------------------------------------------------*/
298 
299 void
301  int mesh_id,
302  int cat_id,
303  int ent_flag[5],
304  cs_lnum_t n_cells,
305  cs_lnum_t n_i_faces,
306  cs_lnum_t n_b_faces,
307  const cs_lnum_t cell_ids[],
308  const cs_lnum_t i_face_ids[],
309  const cs_lnum_t b_face_ids[],
310  const cs_time_step_t *time_step);
311 
312 /*----------------------------------------------------------------------------*/
316 /*----------------------------------------------------------------------------*/
317 
318 void
320 
321 /*----------------------------------------------------------------------------*/
322 
324 
325 #endif /* __CS_NAVSTO_SYSTEM_H__ */
void cs_navsto_system_compute(const cs_mesh_t *mesh, double dt_cur)
Build, solve and update the Navier-Stokes system.
Definition: cs_navsto_system.c:1173
time step descriptor
Definition: cs_time_step.h:51
bool cs_navsto_system_is_activated(void)
Check if the resolution of the Navier-Stokes system has been activated.
Definition: cs_navsto_system.c:789
Definition: cs_advection_field.h:59
cs_navsto_param_coupling_t
Choice of algorithm for solving the system.
Definition: cs_navsto_param.h:113
Field descriptor.
Definition: cs_field.h:124
cs_navsto_init_scheme_context_t * init
Definition: cs_navsto_system.h:157
cs_property_t * lami_viscosity
Definition: cs_navsto_system.h:138
#define BEGIN_C_DECLS
Definition: cs_defs.h:461
cs_adv_field_t * adv_field
Definition: cs_navsto_system.h:124
Definition: cs_cdo_connect.h:69
cs_field_t * temperature
Definition: cs_navsto_system.h:127
Structure storing the parameters related to the resolution of the Navier-Stokes system.
Definition: cs_navsto_param.h:129
Definition: cs_cdo_quantities.h:94
void cs_navsto_system_extra_post(void *input, int mesh_id, int cat_id, int ent_flag[5], cs_lnum_t n_cells, cs_lnum_t n_i_faces, cs_lnum_t n_b_faces, const cs_lnum_t cell_ids[], const cs_lnum_t i_face_ids[], const cs_lnum_t b_face_ids[], const cs_time_step_t *time_step)
Predefined post-processing output for the Navier-Stokes system. The prototype of this function is fix...
Definition: cs_navsto_system.c:1212
Definition: cs_mesh.h:63
cs_navsto_param_time_state_t
Status of the time for the Navier-Stokes system of equations.
Definition: cs_navsto_param.h:88
cs_navsto_param_t * cs_navsto_system_get_param(void)
Recover the structure storing the parameters for the Navier–Stokes system.
Definition: cs_navsto_system.c:928
void() cs_navsto_free_scheme_context_t(const cs_navsto_param_t *nsp)
Allocate and initialize the context structure related to a given discretization scheme for the resolu...
Definition: cs_navsto_system.h:84
void * context
Definition: cs_navsto_system.h:145
Structure managing the Navier-Stokes system.
Definition: cs_navsto_system.h:115
cs_field_t * velocity
Definition: cs_navsto_system.h:125
static int input(void)
cs_navsto_system_t * cs_navsto_system_activate(cs_navsto_param_model_t model, cs_navsto_param_time_state_t time_state, cs_navsto_param_coupling_t algo_coupling)
Allocate and initialize the Navier-Stokes (NS) system.
Definition: cs_navsto_system.c:810
void cs_navsto_system_finalize_setup(const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant)
Last step of the setup of the Navier-Stokes system.
Definition: cs_navsto_system.c:1030
void cs_navsto_system_initialize(void)
Initialize the context structure used to build the algebraic system This is done after the setup step...
Definition: cs_navsto_system.c:1151
cs_navsto_param_t * param
Definition: cs_navsto_system.h:120
void() cs_navsto_init_scheme_context_t(const cs_navsto_param_t *nsp, const void *nscc)
Allocate and initialize the context structure related to a given discretization scheme for the resolu...
Definition: cs_navsto_system.h:71
cs_navsto_free_scheme_context_t * free
Definition: cs_navsto_system.h:164
cs_property_t * density
Definition: cs_navsto_system.h:137
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:293
cs_navsto_compute_t * compute
Definition: cs_navsto_system.h:170
cs_field_t * pressure
Definition: cs_navsto_system.h:126
#define END_C_DECLS
Definition: cs_defs.h:462
void cs_navsto_system_log_setup(void)
Summary of the main cs_navsto_system_t structure.
Definition: cs_navsto_system.c:1247
void cs_navsto_system_init_setup(void)
Start setting-up the Navier-Stokes system At this stage, numerical settings should be completely dete...
Definition: cs_navsto_system.c:947
cs_navsto_param_model_t
Modelling related to the Navier-Stokes system of equations.
Definition: cs_navsto_param.h:63
void cs_navsto_system_destroy(void)
Free the main structure related to the Navier-Stokes system.
Definition: cs_navsto_system.c:870
Definition: cs_property.h:63
Definition: mesh.f90:26
void() cs_navsto_compute_t(const cs_mesh_t *mesh, double dt_cur, const cs_navsto_param_t *nsp, void *nscc)
Compute for the current time step the new state for the Navier-Stokes system. This means that equatio...
Definition: cs_navsto_system.h:101