#include "cs_defs.h"#include "bft_mem.h"#include "cs_array.h"#include "cs_base.h"#include "cs_blas.h"#include "cs_boundary_conditions.h"#include "cs_convection_diffusion.h"#include "cs_convection_diffusion_priv.h"#include "cs_equation.h"#include "cs_face_viscosity.h"#include "cs_divergence.h"#include "cs_equation_iterative_solve.h"#include "cs_field.h"#include "cs_field_default.h"#include "cs_field_pointer.h"#include "cs_field_operator.h"#include "cs_log.h"#include "cs_log_iteration.h"#include "cs_physical_constants.h"#include "cs_math.h"#include "cs_mesh.h"#include "cs_mesh_quantities.h"#include "cs_parall.h"#include "cs_prototypes.h"#include "cs_rotation.h"#include "cs_sles_default.h"#include "cs_turbomachinery.h"#include "cs_vof.h"Functions | |
| cs_vof_parameters_t * | cs_get_glob_vof_parameters (void) |
| 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 density and dynamic viscosity | |
| 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 flux, the volume fraction and the reference density and dynamic viscosity | |
| 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: | |
| 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. (1992). | |
| void | cs_vof_deshpande_drift_flux (const cs_mesh_t *m, const cs_mesh_quantities_t *mq) |
| Compute a relative velocity | |
| 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 divergence of the drift velocity term in the volume fraction equation. | |
| cs_cavitation_parameters_t * | cs_get_glob_cavitation_parameters (void) |
| void | cs_vof_solve_void_fraction (int iterns) |
| Solve the void fraction | |
VOF model data.
| cs_cavitation_parameters_t * cs_get_glob_cavitation_parameters | ( | void | ) |
| cs_vof_parameters_t * cs_get_glob_vof_parameters | ( | void | ) |
| 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 density and dynamic viscosity 

Computation is done as follows on cells:
![\[\rho_\celli = \alpha_\celli \rho_v + (1-\alpha_\celli) \rho_l,
\]](form_265.png)
![\[\mu_\celli = \alpha_\celli \mu_v + (1-\alpha_\celli) \mu_l,
\]](form_266.png)
A similar linear formula is followed on boundary using fluid volume fraction value on the boundary.
| [in] | m | pointer to mesh structure |
| void cs_vof_deshpande_drift_flux | ( | const cs_mesh_t * | m, |
| const cs_mesh_quantities_t * | mq ) |
Compute a relative velocity 
Compute the flux of the drift velocity 

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}
\]](form_271.png)
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}
\]](form_272.png)
Where 

![\[\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}
\]](form_275.png)
| [in] | m | pointer to mesh structure |
| [in] | mq | pointer to mesh quantities structure |
| 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 divergence of the drift velocity term in the volume fraction equation.
Add the explicit part of the convection/diffusion terms of a standard transport equation of a scalar field 
More precisely, the right hand side 
![\[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)
\]](form_276.png)
| [in] | imrgra | indicator
|
| [in] | nswrgp | number of reconstruction sweeps for the gradients |
| [in] | imligp | clipping gradient method
|
| [in] | iwarnp | verbosity |
| [in] | epsrgp | relative precision for the gradient reconstruction |
| [in] | climgp | clipping coefficient for the computation of the gradient |
| [in] | pvar | solved variable (current time step) |
| [in] | pvara | solved variable (previous time step) |
| [in,out] | rhs | right hand side |
| 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:
![\[\sum_\celli\left(
|\Omega_\celli|\dfrac{\rho_\celli^n - \rho_\celli^{n-1}}{\Delta t} +
\sum_{\cellj\in\Face{\celli}}\left(\rho\vect{u}\vect{S}\right)_{\ij}^n
\right).
\]](form_269.png)
| [in] | m | pointer to mesh structure |
| [in] | mq | pointer to mesh quantities structure |
| void cs_vof_solve_void_fraction | ( | int | iterns | ) |
Solve the void fraction 
This function solves:
![\[\dfrac{\alpha^n - \alpha^{n-1}}{\Delta t}
+ \divs \left( \alpha^n \vect{u}^n \right)
+ \divs \left( \left[ \alpha^n
\left( 1 - \alpha^{n} \right)
\right] \vect{u^r}^n \right)
= \dfrac{\Gamma_V \left( \alpha^{n-1}, p^n \right)}{\rho_v}
\]](form_277.png)
with 


| [in] | iterns | Navier-Stokes iteration number |
| 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. (1992).
| [in] | m | pointer to mesh structure |
| [in] | mq | pointer to mesh quantities structure |
| [out] | stf | surface tension momentum source term |
| 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 flux, the volume fraction and the reference density and dynamic viscosity 

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.
\]](form_267.png)
![\[\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.
\]](form_268.png)
| [in] | m | pointer to mesh structure |