8.3
general documentation
cs_ale.h
Go to the documentation of this file.
1#ifndef __CS_ALE_H__
2#define __CS_ALE_H__
3
4/*============================================================================
5 * Functions associated to ALE formulation
6 *============================================================================*/
7
8/*
9 This file is part of code_saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2024 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
30/*----------------------------------------------------------------------------
31 * Standard C library headers
32 *----------------------------------------------------------------------------*/
33
34/*----------------------------------------------------------------------------
35 * Local headers
36 *----------------------------------------------------------------------------*/
37
38#include "cs_base.h"
39#include "cs_domain.h"
40#include "cs_restart.h"
41
42/*----------------------------------------------------------------------------*/
43
45
46/*============================================================================
47 * Type definitions
48 *============================================================================*/
49
50/*----------------------------------------------------------------------------
51 * ALE type
52 *----------------------------------------------------------------------------*/
53
56typedef enum {
57
60 CS_ALE_CDO = 2
63
66typedef struct {
67
68 int *impale;
69 int *bc_type;
72
73/*=============================================================================
74 * Global variables
75 *============================================================================*/
76
78
80
81extern int cs_glob_ale_n_ini_f; /* Number of sub-iterations for fluid
82 flow initialization */
83
84extern int cs_glob_ale_need_init; /* Indicate whether an iteration to
85 initialize ALE is required */
86
87/*============================================================================
88 * Public function prototypes
89 *============================================================================*/
90
91/*----------------------------------------------------------------------------*/
95/*----------------------------------------------------------------------------*/
96
97void cs_ale_allocate(void);
98
99/*----------------------------------------------------------------------------*/
108/*----------------------------------------------------------------------------*/
109
110void
112 cs_real_t *max_vol,
113 cs_real_t *tot_vol);
114
115/*----------------------------------------------------------------------------*/
128/*----------------------------------------------------------------------------*/
129
130void
131cs_ale_project_displacement(const int ale_bc_type[],
132 const cs_real_3_t *meshv,
133 const cs_real_33_t gradm[],
134 const cs_real_3_t *claale,
135 const cs_real_33_t *clbale,
136 const cs_real_t *dt,
137 cs_real_3_t *disp_proj);
138
139/*----------------------------------------------------------------------------*/
145/*----------------------------------------------------------------------------*/
146
147void
148cs_ale_update_mesh(int itrale);
149
150/*----------------------------------------------------------------------------*/
157/*----------------------------------------------------------------------------*/
158
159void
160cs_ale_update_bcs(int *ale_bc_type,
161 cs_real_3_t *b_fluid_vel);
162
163/*----------------------------------------------------------------------------*/
172/*----------------------------------------------------------------------------*/
173
174void
176
177/*----------------------------------------------------------------------------*/
181/*----------------------------------------------------------------------------*/
182
183void
184cs_ale_activate(void);
185
186/*----------------------------------------------------------------------------*/
192/*----------------------------------------------------------------------------*/
193
194bool
196
197/*----------------------------------------------------------------------------*/
201/*----------------------------------------------------------------------------*/
202
203void
205
206/*----------------------------------------------------------------------------*/
212/*----------------------------------------------------------------------------*/
213
214void
216
217/*----------------------------------------------------------------------------
218 *!
219 * \brief Print the ALE options to setup.log.
220 *
221 *----------------------------------------------------------------------------*/
222
223void
224cs_ale_log_setup(void);
225
226/*----------------------------------------------------------------------------*/
232/*----------------------------------------------------------------------------*/
233
234void
236
237/*----------------------------------------------------------------------------*/
243/*----------------------------------------------------------------------------*/
244
245void
247
248/*----------------------------------------------------------------------------*/
252/*----------------------------------------------------------------------------*/
253
254void
256
257/*----------------------------------------------------------------------------*/
263/*----------------------------------------------------------------------------*/
264
265void
267
268/*----------------------------------------------------------------------------*/
274/*----------------------------------------------------------------------------*/
275
276void
278
279/*----------------------------------------------------------------------------*/
280
282
283#endif /* __CS_ALE_H__ */
void cs_ale_log_setup(void)
Definition: cs_ale.cpp:1678
void cs_ale_activate(void)
Activate the mesh velocity solving with CDO.
Definition: cs_ale.cpp:1506
void cs_ale_finalize_setup(cs_domain_t *domain)
Finalize the setup stage for the equation of the mesh velocity.
Definition: cs_ale.cpp:1821
int cs_glob_ale_n_ini_f
Definition: cs_ale.cpp:94
void cs_ale_update_mesh(int itrale)
Update mesh in the ALE framework.
Definition: cs_ale.cpp:1380
void cs_ale_update_bcs(int *ale_bc_type, cs_real_3_t *b_fluid_vel)
Update ALE BCs for required for the fluid.
Definition: cs_ale.cpp:1466
cs_ale_data_t * cs_glob_ale_data
Definition: cs_ale.cpp:91
void cs_ale_add_property_fields(void)
Add "property" fields dedicated to the ALE model.
Definition: cs_ale.cpp:1563
void cs_ale_destroy_all(void)
Free the main structure related to the ALE mesh velocity solving.
Definition: cs_ale.cpp:1844
cs_ale_type_t cs_glob_ale
Definition: cs_ale.cpp:89
void cs_ale_restart_write(cs_restart_t *r)
Write ALE data from restart file.
Definition: cs_ale.cpp:1930
void cs_ale_init_setup(cs_domain_t *domain)
Setup the equations solving the mesh velocity when CDO is activated.
Definition: cs_ale.cpp:1623
void cs_ale_setup_boundaries(const cs_domain_t *domain)
Setup the equations solving the mesh velocity.
Definition: cs_ale.cpp:1716
void cs_ale_allocate(void)
Allocation of ialtyb and impale for the ALE structure.
Definition: cs_ale.cpp:1109
bool cs_ale_is_activated(void)
Test if mesh velocity solving with CDO is activated.
Definition: cs_ale.cpp:1548
cs_ale_type_t
Definition: cs_ale.h:56
@ CS_ALE_LEGACY
Definition: cs_ale.h:59
@ CS_ALE_NONE
Definition: cs_ale.h:58
@ CS_ALE_CDO
Definition: cs_ale.h:60
void cs_ale_restart_read(cs_restart_t *r)
Read ALE data from restart file.
Definition: cs_ale.cpp:1869
void cs_ale_solve_mesh_velocity(int iterns)
Solve a Poisson equation on the mesh velocity in ALE framework.
Definition: cs_ale.cpp:1487
void cs_ale_update_mesh_quantities(cs_real_t *min_vol, cs_real_t *max_vol, cs_real_t *tot_vol)
Compute cell and face centers of gravity, cell volumes and update bad cells.
Definition: cs_ale.cpp:1139
void cs_ale_project_displacement(const int ale_bc_type[], const cs_real_3_t *meshv, const cs_real_33_t gradm[], const cs_real_3_t *claale, const cs_real_33_t *clbale, const cs_real_t *dt, cs_real_3_t *disp_proj)
Project the displacement on mesh vertices (solved on cell center).
Definition: cs_ale.cpp:1172
int cs_glob_ale_need_init
Definition: cs_ale.cpp:97
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
double cs_real_t
Floating-point value.
Definition: cs_defs.h:342
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:359
#define END_C_DECLS
Definition: cs_defs.h:543
cs_real_t cs_real_33_t[3][3]
3x3 matrix of floating-point values
Definition: cs_defs.h:368
@ dt
Definition: cs_field_pointer.h:65
struct _cs_restart_t cs_restart_t
Definition: cs_restart.h:95
Definition: cs_ale.h:66
int * impale
Definition: cs_ale.h:68
int * bc_type
Definition: cs_ale.h:69
Structure storing the main features of the computational domain and pointers to the main geometrical ...
Definition: cs_domain.h:129