7.0
general documentation
cs_vof.h File Reference
#include "cs_base.h"
#include "cs_domain.h"
+ Include dependency graph for cs_vof.h:

Go to the source code of this file.

Data Structures

struct  cs_vof_parameters_t
 VOF model parameters. Void fraction variable tracks fluid 2. More...
 
struct  cs_cavitation_parameters_t
 Cavitation model parameters. More...
 

Macros

#define CS_VOF_ENABLED   (1 << 0)
 
#define CS_VOF_FREE_SURFACE   (1 << 1)
 
#define CS_VOF_MERKLE_MASS_TRANSFER   (1 << 2)
 

Functions

cs_vof_parameters_tcs_get_glob_vof_parameters (void)
 
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 density and dynamic viscosity $ \rho_l, \mu_l $ (liquid), $ \rho_v, \mu_v $ (gas). More...
 
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 flux, the volume fraction and the reference density and dynamic viscosity $ \rho_l, \mu_l $ (liquid), $ \rho_v, \mu_v $ (gas). More...
 
void cs_vof_log_mass_budget (const cs_domain_t *domain)
 Write in main log the global mixture mass budget:

\[ \sum_i\left( |\Omega_i|\dfrac{\alpha_i^n - \alpha_i^{n-1}}{\Delta t} + \sum_{j\in\Face{\celli}}\left(\rho\vect{u}\vect{S}\right)_{ij}^n \right). \]

. More...

 
void cs_vof_deshpande_drift_flux (const cs_domain_t *domain)
 Compute the flux of the drift velocity $ \vect u _d $, by using the flux of the standard velocity $ \vect u $ following the approach described by Suraj S Deshpande et al 2012 Comput. Sci. Disc. 5 014016. It is activated with the option idrift = 1. More...
 
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 field $ \varia $. More...
 
cs_cavitation_parameters_tcs_get_glob_cavitation_parameters (void)
 

Variables

const cs_vof_parameters_tcs_glob_vof_parameters
 

Function Documentation

◆ cs_get_glob_cavitation_parameters()

cs_cavitation_parameters_t* cs_get_glob_cavitation_parameters ( void  )

◆ cs_get_glob_vof_parameters()

cs_vof_parameters_t* cs_get_glob_vof_parameters ( void  )

◆ cs_vof_compute_linear_rho_mu()

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 density and dynamic viscosity $ \rho_l, \mu_l $ (liquid), $ \rho_v, \mu_v $ (gas).

Computation is done as follows on cells:

\[ \rho_\celli = \alpha_\celli \rho_v + (1-\alpha_\celli) \rho_l, \]

\[ \mu_\celli = \alpha_\celli \mu_v + (1-\alpha_\celli) \mu_l, \]

A similar linear formula is followed on boundary using fluid volume fraction value on the boundary.

◆ cs_vof_deshpande_drift_flux()

void cs_vof_deshpande_drift_flux ( const cs_domain_t domain)

Compute the flux of the drift velocity $ \vect u _d $, by using the flux of the standard velocity $ \vect u $ following the approach described by Suraj S Deshpande et al 2012 Comput. Sci. Disc. 5 014016. It is activated with the option idrift = 1.

Using the notation:

\[ \begin{cases} \left ( \vect u ^{n+1} . \vect S \right ) _{\face} = \Dot{m}_{\face}\\ \left ( \vect u _d^{n+1} . \vect S \right ) _{\face} = \Dot{m^d}_{\face} \end{cases} \]

The drift flux is computed as:

\[ \Dot{m^d}_{\face} = min \left ( C_{\gamma} \dfrac{\Dot{m}_{\face}} {\vect S_{\face}}, \underset{\face'}{max} \left [ \dfrac{\Dot{m}_{\face'}} {\vect S_{\face'}} \right ] \right ) \left ( \vect n . \vect S \right ) _{\face} \]

Where $ C_{\gamma} $ is the drift flux factor defined with the variable cdrift, $ \vect n _{\face} $ the normal vector to the interface. The gradient is computed using a centered scheme:

\[ {\vect n _{\face}} = \dfrac{\left ( \grad \alpha \right ) _{\face}} {\norm {\left ( \grad \alpha \right ) _{\face} + \delta}}, \text{ with: } \left ( \grad \alpha \right ) _{\face _{\celli \cellj}} = \dfrac{\left ( \grad \alpha \right ) _\celli + \left ( \grad \alpha \right ) _\cellj}{2}, \text{ and: } \delta = 10^{-8} / \overline{\vol \celli} ^{1/3} \]

Compute the flux of the drift velocity $ \vect u _d $, by using the flux of the standard velocity $ \vect u $ following the approach described by Suraj S Deshpande et al 2012 Comput. Sci. Disc. 5 014016. It is activated with the option idrift = 1.

Using the notation:

\[ \begin{cases} \left ( \vect u ^{n+1} . \vect S \right ) _{\face} = \Dot{m}_{\face}\\ \left ( \vect u _d^{n+1} . \vect S \right ) _{\face} = \Dot{m^d}_{\face} \end{cases} \]

The drift flux is computed as:

\[ \Dot{m^d}_{\face} = min \left ( C_{\gamma} \dfrac{\Dot{m}_{\face}} {\vect S_{\face}}, \underset{\face'}{max} \left [ \dfrac{\Dot{m}_{\face'}} {\vect S_{\face'}} \right ] \right ) \left ( \vect n \cdot \vect S \right ) _{\face} \]

Where $ C_{\gamma} $ is the drift flux factor defined with the variable cdrift, $ \vect n _{\face} $ the normal vector to the interface. The gradient is computed using a centered scheme:

\[ \vect {n} _{\face} = \dfrac{\left ( \grad \alpha \right ) _{\face}} {\norm {\left ( \grad \alpha \right ) _{\face} + \delta}}, \text{ with: } \left ( \grad \alpha \right ) _{\face _{\celli \cellj}} = \dfrac{\left ( \grad \alpha \right ) _\celli + \left ( \grad \alpha \right ) _\cellj}{2}, \text{ and: } \delta = 10^{-8} / \overline{\vol \celli} ^{1/3} \]

◆ cs_vof_drift_term()

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 field $ \varia $.

More precisely, the right hand side $ Rhs $ is updated as follows:

\[ Rhs = Rhs - \sum_{\fij \in \Facei{\celli}} \left( \alpha_\celli^{n+1} \left( 1 - \alpha_\cellj^{n+1} \right) \left( \dot{m}_\fij^{d} \right)^{+} + \alpha_\cellj^{n+1} \left( 1 - \alpha_\celli^{n+1} \right) \left( \dot{m}_\fij^{d} \right)^{-} \right) \]

Parameters
[in]imrgraindicator
  • 0 iterative gradient
  • 1 least squares gradient
[in]nswrgpnumber of reconstruction sweeps for the gradients
[in]imligpclipping gradient method
  • < 0 no clipping
  • = 0 by neighboring gradients
  • = 1 by the mean gradient
[in]iwarnpverbosity
[in]epsrgprelative precision for the gradient reconstruction
[in]climgpclipping coefficient for the computation of the gradient
[in]pvarsolved variable (current time step)
[in]pvarasolved variable (previous time step)
[in,out]rhsright hand side $ \vect{Rhs} $

Add the explicit part of the convection/diffusion terms of a standard transport equation of a scalar field $ \varia $.

More precisely, the right hand side $ Rhs $ is updated as follows:

\[ Rhs = Rhs - \sum_{\fij \in \Facei{\celli}} \left( \alpha_\celli^{n+1} \left( 1 - \alpha_\cellj^{n+1} \right) \left( \dot{m}_\fij^{d} \right)^{+} + \alpha_\cellj^{n+1} \left( 1 - \alpha_\celli^{n+1} \right) \left( \dot{m}_\fij^{d} \right)^{-} \right) \]

Parameters
[in]imrgraindicator
  • 0 iterative gradient
  • 1 least squares gradient
[in]nswrgpnumber of reconstruction sweeps for the gradients
[in]imligpclipping gradient method
  • < 0 no clipping
  • = 0 by neighboring gradients
  • = 1 by the mean gradient
[in]iwarnpverbosity
[in]epsrgprelative precision for the gradient reconstruction
[in]climgpclipping coefficient for the computation of the gradient
[in]pvarsolved variable (current time step)
[in]pvarasolved variable (previous time step)
[in,out]rhsright hand side $ \vect{Rhs} $

◆ cs_vof_log_mass_budget()

void cs_vof_log_mass_budget ( const cs_domain_t domain)

Write in main log the global mixture mass budget:

\[ \sum_i\left( |\Omega_i|\dfrac{\alpha_i^n - \alpha_i^{n-1}}{\Delta t} + \sum_{j\in\Face{\celli}}\left(\rho\vect{u}\vect{S}\right)_{ij}^n \right). \]

.

Write in main log the global mixture mass budget:

\[ \sum_i\left( |\Omega_i|\dfrac{\alpha_i^n - \alpha_i^{n-1}}{\Delta t} + \sum_{j\in\Face{\celli}}\left(\rho\vect{u}\vect{S}\right)_{ij}^n \right). \]

.

◆ cs_vof_update_phys_prop()

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 flux, the volume fraction and the reference density and dynamic viscosity $ \rho_l, \mu_l $ (liquid), $ \rho_v, \mu_v $ (gas).

For the computation of mixture density, mixture dynamic viscosity, see cs_vof_compute_linear_rho_mu.

Computation of mass flux is as follows:

\[ \left( \rho\vect{u}\cdot\vect{S} \right)_\ij = \\ \left\lbrace \begin{array}{ll} \rho_\celli (\vect{u}\cdot\vect{S})_\ij &\text{ if } (\vect{u}\cdot\vect{S})_\ij>0, \\ \rho_\cellj (\vect{u}\cdot\vect{S})_\ij &\text{ otherwise }, \end{array} \right. \]

\[ \left( \rho\vect{u}\cdot\vect{S} \right)_\ib = \\ \left\lbrace \begin{array}{ll} \rho_\celli (\vect{u}\cdot\vect{S})_\ib &\text{ if } (\vect{u}\cdot\vect{S})_\ib>0, \\ \rho_b (\vect{u}\cdot\vect{S})_\ib &\text{ otherwise }. \end{array} \right. \]

Variable Documentation

◆ cs_glob_vof_parameters

const cs_vof_parameters_t* cs_glob_vof_parameters