9.0
general documentation
Loading...
Searching...
No Matches
cs_face_viscosity.cpp File Reference

Face viscosity. More...

#include "base/cs_defs.h"
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <math.h>
#include <float.h>
#include "bft/bft_error.h"
#include "bft/bft_mem.h"
#include "bft/bft_printf.h"
#include "alge/cs_blas.h"
#include "base/cs_dispatch.h"
#include "base/cs_ext_neighborhood.h"
#include "base/cs_field.h"
#include "base/cs_field_default.h"
#include "base/cs_field_pointer.h"
#include "alge/cs_gradient.h"
#include "base/cs_halo.h"
#include "base/cs_halo_perio.h"
#include "base/cs_internal_coupling.h"
#include "base/cs_log.h"
#include "base/cs_math.h"
#include "mesh/cs_mesh.h"
#include "mesh/cs_mesh_quantities.h"
#include "base/cs_parall.h"
#include "base/cs_parameters.h"
#include "base/cs_physical_constants.h"
#include "pprt/cs_physical_model.h"
#include "base/cs_porous_model.h"
#include "base/cs_prototypes.h"
#include "base/cs_timer.h"
#include "turb/cs_turbulence_model.h"
#include "alge/cs_face_viscosity.h"
Include dependency graph for cs_face_viscosity.cpp:

Functions

void cs_face_viscosity_secondary (cs_real_t secvif[], cs_real_t secvib[])
 Computes the secondary viscosity contribution $\kappa
  -\dfrac{2}{3} \mu$ in order to compute:
void cs_face_viscosity (const cs_mesh_t *m, const cs_mesh_quantities_t *fvq, const int visc_mean_type, cs_real_t *restrict c_visc, cs_real_t *restrict i_visc, cs_real_t *restrict b_visc)
 Compute the diffusion velocity at faces.
void cs_face_anisotropic_viscosity_vector (const cs_mesh_t *m, const cs_mesh_quantities_t *fvq, const int visc_mean_type, cs_real_6_t *restrict c_visc, cs_real_33_t *restrict i_visc, cs_real_t *restrict b_visc)
 Compute the equivalent tensor viscosity at faces for a 3x3 symetric tensor.
void cs_face_anisotropic_viscosity_scalar (const cs_mesh_t *m, const cs_mesh_quantities_t *fvq, cs_real_6_t *restrict c_visc, const int iwarnp, cs_real_2_t *restrict weighf, cs_real_t *restrict weighb, cs_real_t *restrict i_visc, cs_real_t *restrict b_visc)
 Compute the equivalent viscosity at faces for a 3x3 symetric tensor, always using a harmonic mean.

Detailed Description

Face viscosity.

Function Documentation

◆ cs_face_anisotropic_viscosity_scalar()

void cs_face_anisotropic_viscosity_scalar ( const cs_mesh_t * m,
const cs_mesh_quantities_t * fvq,
cs_real_6_t *restrict c_visc,
const int iwarnp,
cs_real_2_t *restrict weighf,
cs_real_t *restrict weighb,
cs_real_t *restrict i_visc,
cs_real_t *restrict b_visc )

Compute the equivalent viscosity at faces for a 3x3 symetric tensor, always using a harmonic mean.

Parameters
[in]mpointer to mesh
[in]fvqpointer to finite volume quantities
[in]c_visccell viscosity symmetric tensor
[in]iwarnpverbosity
[out]weighfinner face weight between cells i and j $ \frac{\vect{IF} \cdot \tens{K}_\celli}
                              {\norm{\tens{K}_\celli \cdot \vect{S}}^2} $ and $ \frac{\vect{FJ} \cdot \tens{K}_\cellj}
                              {\norm{\tens{K}_\cellj \cdot \vect{S}}^2} $
[out]weighbboundary face weight $ \frac{\vect{IF} \cdot \tens{K}_\celli}
                              {\norm{\tens{K}_\celli \cdot \vect{S}}^2} $
[out]i_viscinner face viscosity (times surface divided by distance)
[out]b_viscboundary face viscosity (surface, must be consistent with flux BCs)

◆ cs_face_anisotropic_viscosity_vector()

void cs_face_anisotropic_viscosity_vector ( const cs_mesh_t * m,
const cs_mesh_quantities_t * fvq,
const int visc_mean_type,
cs_real_6_t *restrict c_visc,
cs_real_33_t *restrict i_visc,
cs_real_t *restrict b_visc )

Compute the equivalent tensor viscosity at faces for a 3x3 symetric tensor.

Parameters
[in]mpointer to mesh
[in]fvqpointer to finite volume quantities
[in]visc_mean_typemethod to compute the viscosity at faces:
  • 0: arithmetic
  • 1: harmonic
[in]c_visccell viscosity symmetric tensor
[out]i_viscinner face tensor viscosity (times surface divided by distance)
[out]b_viscboundary face viscosity (surface, must be consistent with flux BCs)

◆ cs_face_viscosity()

void cs_face_viscosity ( const cs_mesh_t * m,
const cs_mesh_quantities_t * fvq,
const int visc_mean_type,
cs_real_t *restrict c_visc,
cs_real_t *restrict i_visc,
cs_real_t *restrict b_visc )

Compute the diffusion velocity at faces.

i_visc,b_visc = viscosity*surface/distance, homogeneous to a rate of flow in kg/s.

Please refer to the viscfa section of the theory guide for more informations.

Remarks
: a priori, no need of reconstruction techniques (to improve if necessary).
Parameters
[in]mpointer to mesh
[in]fvqpointer to finite volume quantities
[in]visc_mean_typemethod to compute the viscosity at faces:
  • 0 arithmetical
  • 1 harmonic
[in]c_visccell viscosity (scalar)
[out]i_viscinner face viscosity (times surface divided by distance)
[out]b_viscboundary face viscosity (surface, must be consistent with flux BCs)

◆ cs_face_viscosity_secondary()

void cs_face_viscosity_secondary ( cs_real_t secvif[],
cs_real_t secvib[] )

Computes the secondary viscosity contribution $\kappa
  -\dfrac{2}{3} \mu$ in order to compute:

Computes the secondary viscosity contribution $\kappa
  -\dfrac{2}{3} \mu$ in order to compute:

\[  \grad\left( (\kappa -\dfrac{2}{3} \mu) \trace( \gradt(\vect{u})) \right)
\]

with:

  • $ \mu = \mu_{laminar} + \mu_{turbulent} $
  • $ \kappa $ is the volume viscosity (generally zero)
Remarks
In LES, the tensor $\overline{\left(\vect{u}-\overline{\vect{u}}\right)\otimes\left(\vect{u}
*-\overline{\vect{u}}\right)}$ is modeled by $\mu_t \overline{\tens{S}}$ and not by $\mu_t\overline{\tens{S}}-\dfrac{2}{3}\mu_t
  \trace\left(\overline{\tens{S}}\right)\tens{1}+\dfrac{2}{3}k\tens{1}$ so that no term $\mu_t \dive \left(\overline{\vect{u}}\right)$ is needed.

Please refer to the visecv section of the theory guide for more informations.

Parameters
[in,out]secviflambda*surface at interior faces
[in,out]secviblambda*surface at boundary faces