7.0
general documentation
cs_vof.h
Go to the documentation of this file.
1 #ifndef __CS_VOF_H__
2 #define __CS_VOF_H__
3 
4 /*============================================================================
5  * Functions associated to VOF model
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2021 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 
41 /*----------------------------------------------------------------------------*/
42 
44 
45 /*=============================================================================
46  * Macro definitions
47  *============================================================================*/
48 
58 #define CS_VOF_ENABLED (1 << 0)
59 
61 #define CS_VOF_FREE_SURFACE (1 << 1)
62 
64 #define CS_VOF_MERKLE_MASS_TRANSFER (1 << 2)
65 
71 /*============================================================================
72  * Type definitions
73  *============================================================================*/
74 
75 /* VOF model parameters */
76 /*----------------------*/
77 
78 typedef struct {
79 
80  unsigned vof_model; /* VoF model (sum of masks defining Volume of
81  Fluid model and submodels */
82 
83  double rho1; /* density */
84 
85  double rho2;
86 
87  double mu1; /* viscosity */
88 
89  double mu2;
90 
91  int idrift; /* drift velocity model */
92 
93  double cdrift; /* C_gamma constante (drift flux factor)*/
94 
95  double kdrift;
96 
98 
99 /* Cavitation parameters */
100 /*-----------------------*/
101 
102 typedef struct {
103 
104  cs_real_t presat; /* reference saturation pressure */
105  cs_real_t uinf; /* reference velocity */
106  cs_real_t linf; /* reference length scale */
107  cs_real_t cdest; /* constant of condensation model (Merkle) */
108  cs_real_t cprod; /* constant of vaporization model (Merkle) */
109  int icvevm; /* eddy-viscosity correction indicator */
110  cs_real_t mcav; /* eddy-viscosity correction cstt (Reboud) */
111  int itscvi; /* eddy-viscosity correction indicator */
112 
114 
115 /*=============================================================================
116  * Global variables
117  *============================================================================*/
118 
119 /* pointer to VOF model parameters structure */
120 
122 
123 /*============================================================================
124  * Public function prototypes
125  *============================================================================*/
126 
127 /*----------------------------------------------------------------------------
128  *!
129  * \brief Provide access to VOF structure.
130  */
131 /*----------------------------------------------------------------------------*/
132 
135 
136 /*----------------------------------------------------------------------------*/
153 /*----------------------------------------------------------------------------*/
154 
155 void
157 
158 /*----------------------------------------------------------------------------*/
188 /*----------------------------------------------------------------------------*/
189 
190 void
191 cs_vof_update_phys_prop(const cs_domain_t *domain);
192 
193 /*----------------------------------------------------------------------------*/
203 /*----------------------------------------------------------------------------*/
204 
205 void
206 cs_vof_log_mass_budget(const cs_domain_t *domain);
207 
208 /*----------------------------------------------------------------------------*/
243 /*----------------------------------------------------------------------------*/
244 
245 void
247 
248 /*----------------------------------------------------------------------------*/
280 /*----------------------------------------------------------------------------*/
281 
282 void
284  int nswrgp,
285  int imligp,
286  int iwarnp,
287  cs_real_t epsrgp,
288  cs_real_t climgp,
289  cs_real_t *restrict pvar,
290  const cs_real_t *restrict pvara,
291  cs_real_t *restrict rhs);
292 
293 /*----------------------------------------------------------------------------
294  *!
295  * \brief Provide access to cavitation parameters structure.
296  */
297 /*----------------------------------------------------------------------------*/
298 
301 
302 /*----------------------------------------------------------------------------*/
303 
305 
306 #endif /* __CS_VOF_H__ */
cs_real_t mcav
Definition: cs_vof.h:110
void cs_vof_log_mass_budget(const cs_domain_t *domain)
Write in main log the global mixture mass budget: .
Definition: cs_vof.c:569
#define restrict
Definition: cs_defs.h:127
void cs_vof_compute_linear_rho_mu(const cs_domain_t *domain)
Compute the mixture density, mixture dynamic viscosity given fluid volume fractions and the reference...
Definition: cs_vof.c:435
void cs_vof_deshpande_drift_flux(const cs_domain_t *domain)
Compute the flux of the drift velocity , by using the flux of the standard velocity following the ap...
Definition: cs_vof.c:744
void cs_vof_drift_term(int imrgra, int nswrgp, int imligp, int iwarnp, cs_real_t epsrgp, cs_real_t climgp, cs_real_t *restrict pvar, const cs_real_t *restrict pvara, cs_real_t *restrict rhs)
Add the explicit part of the convection/diffusion terms of a standard transport equation of a scalar ...
Definition: cs_vof.c:854
#define BEGIN_C_DECLS
Definition: cs_defs.h:495
VOF model parameters. Void fraction variable tracks fluid 2.
Definition: cs_vof.h:78
cs_real_t uinf
Definition: cs_vof.h:105
cs_vof_parameters_t * cs_get_glob_vof_parameters(void)
Definition: cs_vof.c:410
double cs_real_t
Floating-point value.
Definition: cs_defs.h:307
void cs_vof_update_phys_prop(const cs_domain_t *domain)
Compute the mixture density, mixture dynamic viscosity and mixture mass flux given the volumetric flu...
Definition: cs_vof.c:513
int idrift
Definition: cs_vof.h:91
unsigned vof_model
Definition: cs_vof.h:80
double rho1
Definition: cs_vof.h:83
double kdrift
Definition: cs_vof.h:95
Structure storing the main features of the computational domain and pointers to the main geometrical ...
Definition: cs_domain.h:88
cs_real_t cprod
Definition: cs_vof.h:108
cs_real_t cdest
Definition: cs_vof.h:107
cs_real_t linf
Definition: cs_vof.h:106
double rho2
Definition: cs_vof.h:85
#define END_C_DECLS
Definition: cs_defs.h:496
double mu1
Definition: cs_vof.h:87
const cs_vof_parameters_t * cs_glob_vof_parameters
cs_real_t presat
Definition: cs_vof.h:104
double cdrift
Definition: cs_vof.h:93
cs_cavitation_parameters_t * cs_get_glob_cavitation_parameters(void)
Definition: cs_vof.c:1041
Cavitation model parameters.
Definition: cs_vof.h:102
integer(c_int), pointer, save imrgra
type of gradient reconstruction
Definition: optcal.f90:251
int itscvi
Definition: cs_vof.h:111
double mu2
Definition: cs_vof.h:89
int icvevm
Definition: cs_vof.h:109