9.0
general documentation
Loading...
Searching...
No Matches
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-2025 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 "base/cs_defs.h"
39#include "mesh/cs_mesh.h"
41
42/*----------------------------------------------------------------------------*/
43
45
46/*=============================================================================
47 * Macro definitions
48 *============================================================================*/
49
57
59#define CS_VOF_ENABLED (1 << 0)
60
62#define CS_VOF_FREE_SURFACE (1 << 1)
63
65#define CS_VOF_MERKLE_MASS_TRANSFER (1 << 2)
66
71
72/*============================================================================
73 * Type definitions
74 *============================================================================*/
75
76/* VOF model parameters */
77/*----------------------*/
78
79typedef struct {
80
81 unsigned vof_model; /* VoF model (sum of masks defining Volume of
82 Fluid model and submodels */
83
84 double rho1; /* density */
85
86 double rho2;
87
88 double mu1; /* viscosity */
89
90 double mu2;
91
92 double sigma_s; /* surface tension */
93
94 int idrift; /* drift velocity model */
95
96 double cdrift; /* C_gamma constant (drift flux factor)*/
97
98 double kdrift;
99
101
102/* Cavitation parameters */
103/*-----------------------*/
104
105typedef struct {
106
107 cs_real_t presat; /* reference saturation pressure */
108 cs_real_t uinf; /* reference velocity */
109 cs_real_t linf; /* reference length scale */
110 cs_real_t cdest; /* constant of condensation model (Merkle) */
111 cs_real_t cprod; /* constant of vaporization model (Merkle) */
112 int icvevm; /* eddy-viscosity correction indicator */
113 cs_real_t mcav; /* eddy-viscosity correction cstt (Reboud) */
114 int itscvi; /* eddy-viscosity correction indicator */
115
117
119
126
127/*=============================================================================
128 * Global variables
129 *============================================================================*/
130
131/* pointer to VOF model parameters structure */
132
134
135/* pointer to cavitation model parameters structure */
136
138
139/*============================================================================
140 * Public function prototypes
141 *============================================================================*/
142
143/*----------------------------------------------------------------------------
144 *!
145 * \brief Provide write access to VOF structure.
146 */
147/*----------------------------------------------------------------------------*/
148
151
152/*----------------------------------------------------------------------------*/
153/*
154 * \brief Create VoF fields
155 */
156/*----------------------------------------------------------------------------*/
157
158void
160
161/*----------------------------------------------------------------------------*/
165/*----------------------------------------------------------------------------*/
166
167void
168cs_vof_log_setup(void);
169
170/*----------------------------------------------------------------------------*/
189/*----------------------------------------------------------------------------*/
190
191void
193
194/*----------------------------------------------------------------------------*/
226/*----------------------------------------------------------------------------*/
227
228void
230
231/*----------------------------------------------------------------------------*/
240/*----------------------------------------------------------------------------*/
241
242void
244 const cs_mesh_quantities_t *mq,
245 cs_real_3_t stf[]);
246
247/*----------------------------------------------------------------------------*/
260/*----------------------------------------------------------------------------*/
261
262void
264 const cs_mesh_quantities_t *mq);
265
266/*----------------------------------------------------------------------------*/
304/*----------------------------------------------------------------------------*/
305
306void
308 const cs_mesh_quantities_t *mq);
309
310/*----------------------------------------------------------------------------*/
342/*----------------------------------------------------------------------------*/
343
344void
346 int nswrgp,
347 int imligp,
348 int iwarnp,
349 cs_real_t epsrgp,
350 cs_real_t climgp,
351 cs_real_t *pvar,
352 const cs_real_t *pvara,
353 cs_real_t *rhs);
354
355/*----------------------------------------------------------------------------*/
356/*
357 * \param[in] iterns Navier-Stokes iteration number
358 */
359/*----------------------------------------------------------------------------*/
360
361void
363
364/*----------------------------------------------------------------------------
365 *!
366 * \brief Provide write access to cavitation parameters structure.
367 */
368/*----------------------------------------------------------------------------*/
369
372
373/*----------------------------------------------------------------------------*/
374/*
375 * \brief Compute the vaporization source term
376 * \f$ \Gamma_V \left(\alpha, p\right) = m^+ + m^- \f$ using the
377 * Merkle model:
378 *
379 * \f[
380 * m^+ = -\dfrac{C_{prod} \rho_l \min \left( p-p_V,0 \right)\alpha(1-\alpha)}
381 * {0.5\rho_lu_\infty^2t_\infty},
382 * \f]
383 * \f[
384 * m^- = -\dfrac{C_{dest} \rho_v \max \left( p-p_V,0 \right)\alpha(1-\alpha)}
385 * {0.5\rho_lu_\infty^2t_\infty},
386 * \f]
387 * with \f$ C_{prod}, C_{dest} \f$ empirical constants,
388 * \f$ t_\infty=l_\infty/u_\infty \f$ a reference time scale and \f$p_V\f$
389 * the reference saturation pressure.
390 * \f$ l_\infty \f$, \f$ u_\infty \f$ and \f$p_V\f$ may be provided by
391 * the user (user function).
392 *
393 * Note that the r.h.s. of the void fraction transport equation is
394 * \f$ \Gamma_V/\rho_v \f$.
395 *
396 * \param[in] pressure Pressure array
397 * \param[in] voidf Void fraction array
398 */
399/*----------------------------------------------------------------------------*/
400
401void
403 const cs_real_t voidf[]);
404
405/*----------------------------------------------------------------------------*/
406/* Set the contact angle mode */
407/*----------------------------------------------------------------------------*/
408
409void
411(
412 const cs_vof_contact_angle_t choice
413);
414
415/*----------------------------------------------------------------------------*/
416
418
419#endif /* CS_VOF_H */
#define BEGIN_C_DECLS
Definition cs_defs.h:542
double cs_real_t
Floating-point value.
Definition cs_defs.h:342
#define END_C_DECLS
Definition cs_defs.h:543
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition cs_defs.h:359
void cs_vof_deshpande_drift_flux(const cs_mesh_t *m, const cs_mesh_quantities_t *mq)
Compute the flux of the drift velocity , by using the flux of the standard velocity following the ap...
Definition cs_vof.cpp:1440
void cs_vof_surface_tension(const cs_mesh_t *m, const cs_mesh_quantities_t *mq, cs_real_3_t stf[])
Compute the surface tension momentum source term following the CSF model of Brackbill et al....
Definition cs_vof.cpp:1180
cs_cavitation_parameters_t * cs_get_glob_cavitation_parameters(void)
Definition cs_vof.cpp:2133
cs_vof_contact_angle_t
Definition cs_vof.h:120
@ CS_VOF_N_CONTACT_ANGLE_TYPES
Definition cs_vof.h:124
@ CS_VOF_CONTACT_ANGLE_STATIC
Definition cs_vof.h:122
@ CS_VOF_CONTACT_ANGLE_DYN
Definition cs_vof.h:123
@ CS_VOF_CONTACT_ANGLE_OFF
Definition cs_vof.h:121
void cs_vof_drift_term(int imrgra, int nswrgp, int imligp, int iwarnp, cs_real_t epsrgp, cs_real_t climgp, cs_real_t *pvar, const cs_real_t *pvara, cs_real_t *rhs)
Add the explicit part of the convection/diffusion terms of a standard transport equation of a scalar ...
void cs_vof_compute_linear_rho_mu(const cs_mesh_t *m)
Compute the mixture density, mixture dynamic viscosity given fluid volume fractions and the reference...
Definition cs_vof.cpp:872
void cs_vof_field_create(void)
Create VoF fields.
Definition cs_vof.cpp:665
void cs_cavitation_compute_source_term(const cs_real_t pressure[], const cs_real_t voidf[])
Compute the vaporization source term using the Merkle model:
Definition cs_vof.cpp:2167
void cs_vof_log_setup(void)
Log setup of VoF model.
Definition cs_vof.cpp:779
const cs_vof_parameters_t * cs_glob_vof_parameters
void cs_vof_log_mass_budget(const cs_mesh_t *m, const cs_mesh_quantities_t *mq)
Write in main log the global mixture mass budget:
Definition cs_vof.cpp:1015
void cs_vof_contact_angle_set(const cs_vof_contact_angle_t choice)
Set the contact angle mode.
Definition cs_vof.cpp:2219
const cs_cavitation_parameters_t * cs_glob_cavitation_parameters
void cs_vof_update_phys_prop(const cs_mesh_t *m)
Compute the mixture density, mixture dynamic viscosity and mixture mass flux given the volumetric flu...
Definition cs_vof.cpp:953
void cs_vof_solve_void_fraction(int iterns)
Solve the void fraction for the Volume of Fluid method (and hence for cavitating flows).
Definition cs_vof.cpp:1751
cs_vof_parameters_t * cs_get_glob_vof_parameters(void)
Definition cs_vof.cpp:653
int itscvi
Definition cs_vof.h:114
cs_real_t linf
Definition cs_vof.h:109
cs_real_t presat
Definition cs_vof.h:107
cs_real_t cdest
Definition cs_vof.h:110
cs_real_t uinf
Definition cs_vof.h:108
cs_real_t cprod
Definition cs_vof.h:111
int icvevm
Definition cs_vof.h:112
cs_real_t mcav
Definition cs_vof.h:113
double rho2
Definition cs_vof.h:86
double kdrift
Definition cs_vof.h:98
double cdrift
Definition cs_vof.h:96
double mu1
Definition cs_vof.h:88
int idrift
Definition cs_vof.h:94
double rho1
Definition cs_vof.h:84
unsigned vof_model
Definition cs_vof.h:81
double mu2
Definition cs_vof.h:90
double sigma_s
Definition cs_vof.h:92
Cavitation model parameters.
Definition cs_vof.h:105
Definition cs_mesh_quantities.h:92
Definition cs_mesh.h:85
VOF model parameters. Void fraction variable tracks fluid 2.
Definition cs_vof.h:79