#include "cs_defs.h" Include dependency graph for cs_turbulence_bc.h:
 Include dependency graph for cs_turbulence_bc.h:Go to the source code of this file.
| Functions | |
| void | cs_turbulence_bc_init_pointers (void) | 
| Initialize turbulence model boundary condition pointers.  More... | |
| void | cs_turbulence_bc_free_pointers (void) | 
| Free memory allocations for turbulence boundary condition pointers.  More... | |
| void | cs_turbulence_bc_ke_hyd_diam (double uref2, double dh, double rho, double mu, double *ustar2, double *k, double *eps) | 
| Calculation of  ,  and  from a diameter  and the reference velocity  for a circular duct flow with smooth wall (use for inlet boundary conditions).  More... | |
| void | cs_turbulence_bc_ke_turb_intensity (double uref2, double t_intensity, double dh, double *k, double *eps) | 
| Calculation of  and  from a diameter  , a turbulent intensity  and the reference velocity  for a circular duct flow with smooth wall (for inlet boundary conditions).  More... | |
| void | cs_turbulence_bc_inlet_hyd_diam (cs_lnum_t face_id, double uref2, double dh, double rho, double mu) | 
| Set inlet boundary condition values for turbulence variables based on a diameter  and the reference velocity  for a circular duct flow with smooth wall.  More... | |
| void | cs_turbulence_bc_inlet_turb_intensity (cs_lnum_t face_id, double uref2, double t_intensity, double dh) | 
| Set inlet boundary condition values for turbulence variables based on a diameter  , a turbulent intensity  and the reference velocity  for a circular duct flow with smooth wall.  More... | |
| void | cs_turbulence_bc_inlet_k_eps (cs_lnum_t face_id, double k, double eps) | 
| Set inlet boundary condition values for turbulence variables based on given k and epsilon values.  More... | |
| void | cs_turbulence_bc_set_uninit_inlet_hyd_diam (cs_lnum_t face_id, double vel_dir[], double shear_dir[], double uref2, double dh, double rho, double mu) | 
| Set inlet boundary condition values for turbulence variables based on a diameter  and the reference velocity  for a circular duct flow with smooth wall, only if not already set.  More... | |
| void | cs_turbulence_bc_set_uninit_inlet_turb_intensity (cs_lnum_t face_id, double uref2, double t_intensity, double dh) | 
| Set inlet boundary condition values for turbulence variables based on a diameter  , a turbulent intensity  and the reference velocity  for a circular duct flow with smooth wall, only if not already set.  More... | |
| void | cs_turbulence_bc_set_uninit_inlet_k_eps (cs_lnum_t face_id, double k, double eps, double vel_dir[], double shear_dir[]) | 
| Set inlet boundary condition values for turbulence variables based on given k and epsilon values only if not already initialized.  More... | |
| void | cs_turbulence_bc_set_hmg_neumann (cs_lnum_t face_id) | 
| Assign homogeneous Neumann turbulent boundary conditions to a given face.  More... | |
| void | cs_turbulence_bc_rij_transform (int is_sym, cs_real_t p_lg[3][3], cs_real_t alpha[6][6]) | 
| Compute matrix  used in the computation of the Reynolds stress tensor boundary conditions.  More... | |
| void cs_turbulence_bc_free_pointers | ( | void | ) | 
Free memory allocations for turbulence boundary condition pointers.
| void cs_turbulence_bc_init_pointers | ( | void | ) | 
Initialize turbulence model boundary condition pointers.
| void cs_turbulence_bc_inlet_hyd_diam | ( | cs_lnum_t | face_id, | 
| double | uref2, | ||
| double | dh, | ||
| double | rho, | ||
| double | mu | ||
| ) | 
Set inlet boundary condition values for turbulence variables based on a diameter  and the reference velocity
 and the reference velocity  for a circular duct flow with smooth wall.
 for a circular duct flow with smooth wall. 
We use the laws from Idel'Cik, i.e. the head loss coefficient  is defined by:
 is defined by: 
![\[ |\dfrac{\Delta P}{\Delta x}| = \dfrac{\lambda}{D_H} \frac{1}{2} \rho U_{ref}^2 \]](form_121.png) 
then the relation reads  .
.  depends on the hydraulic Reynolds number
 depends on the hydraulic Reynolds number  and is given by:
 and is given by:
 
 
![\[ \lambda = \dfrac{64}{Re} \]](form_126.png) 
 
 
![\[ \lambda = \dfrac{1}{( 1.8 \log_{10}(Re)-1.64 )^2} \]](form_128.png) 
 , we complete by a straight line
, we complete by a straight line 
![\[ \lambda = 0.021377 + 5.3115. 10^{-6} Re \]](form_130.png) 
From  , we can estimate
, we can estimate  and
 and  from the well known formulae of developped turbulence
 from the well known formulae of developped turbulence
| [in] | face_id | boundary face id | 
| [in] | uref2 | square of the reference flow velocity | 
| [in] | dh | hydraulic diameter   | 
| [in] | rho | mass density   | 
| [in] | mu | dynamic viscosity   | 
| void cs_turbulence_bc_inlet_k_eps | ( | cs_lnum_t | face_id, | 
| double | k, | ||
| double | eps | ||
| ) | 
Set inlet boundary condition values for turbulence variables based on given k and epsilon values.
| [in] | face_id | boundary face id | 
| [in] | k | turbulent kinetic energy | 
| [in] | eps | turbulent dissipation | 
| void cs_turbulence_bc_inlet_turb_intensity | ( | cs_lnum_t | face_id, | 
| double | uref2, | ||
| double | t_intensity, | ||
| double | dh | ||
| ) | 
Set inlet boundary condition values for turbulence variables based on a diameter  , a turbulent intensity
, a turbulent intensity  and the reference velocity
 and the reference velocity  for a circular duct flow with smooth wall.
 for a circular duct flow with smooth wall. 
| [in] | face_id | boundary face id | 
| [in] | uref2 | square of the reference flow velocity | 
| [in] | t_intensity | turbulent intensity   | 
| [in] | dh | hydraulic diameter   | 
| void cs_turbulence_bc_ke_hyd_diam | ( | double | uref2, | 
| double | dh, | ||
| double | rho, | ||
| double | mu, | ||
| double * | ustar2, | ||
| double * | k, | ||
| double * | eps | ||
| ) | 
Calculation of  ,
,  and
 and  from a diameter
 from a diameter  and the reference velocity
 and the reference velocity  for a circular duct flow with smooth wall (use for inlet boundary conditions).
 for a circular duct flow with smooth wall (use for inlet boundary conditions). 
Both  and
 and  are returned, so that the user may compute other values of
 are returned, so that the user may compute other values of  and
 and  with
 with  .
.
We use the laws from Idel'Cik, i.e. the head loss coefficient  is defined by:
 is defined by: 
![\[ |\dfrac{\Delta P}{\Delta x}| = \dfrac{\lambda}{D_H} \frac{1}{2} \rho U_{ref}^2 \]](form_121.png) 
then the relation reads  .
.  depends on the hydraulic Reynolds number
 depends on the hydraulic Reynolds number  and is given by:
 and is given by:
 
 
![\[ \lambda = \dfrac{64}{Re} \]](form_126.png) 
 
 
![\[ \lambda = \dfrac{1}{( 1.8 \log_{10}(Re)-1.64 )^2} \]](form_128.png) 
 , we complete by a straight line
, we complete by a straight line 
![\[ \lambda = 0.021377 + 5.3115. 10^{-6} Re \]](form_130.png) 
From  , we can estimate
, we can estimate  and
 and  from the well known formulae of developped turbulence
 from the well known formulae of developped turbulence
![\[ k = \dfrac{u^{\star 2}}{\sqrt{C_\mu}} \]](form_132.png) 
![\[ \varepsilon = \dfrac{ u^{\star 3}}{(\kappa D_H /10)} \]](form_133.png) 
| [in] | uref2 | square of the reference flow velocity | 
| [in] | dh | hydraulic diameter   | 
| [in] | rho | mass density   | 
| [in] | mu | dynamic viscosity   | 
| [out] | ustar2 | square of friction speed | 
| [out] | k | calculated turbulent intensity   | 
| [out] | eps | calculated turbulent dissipation   | 
| void cs_turbulence_bc_ke_turb_intensity | ( | double | uref2, | 
| double | t_intensity, | ||
| double | dh, | ||
| double * | k, | ||
| double * | eps | ||
| ) | 
Calculation of  and
 and  from a diameter
 from a diameter  , a turbulent intensity
, a turbulent intensity  and the reference velocity
 and the reference velocity  for a circular duct flow with smooth wall (for inlet boundary conditions).
 for a circular duct flow with smooth wall (for inlet boundary conditions). 
![\[ k = 1.5 I {U_{ref}}^2 \]](form_516.png) 
![\[ \varepsilon = 10 \dfrac{{C_\mu}^{0.75} k^{1.5}}{ \kappa D_H} \]](form_517.png) 
| [in] | uref2 | square of the reference flow velocity | 
| [in] | t_intensity | turbulent intensity   | 
| [in] | dh | hydraulic diameter   | 
| [out] | k | calculated turbulent intensity   | 
| [out] | eps | calculated turbulent dissipation   | 
Compute matrix  used in the computation of the Reynolds stress tensor boundary conditions.
 used in the computation of the Reynolds stress tensor boundary conditions. 
We note  the Reynolds Stress tensor in the global reference frame (mesh reference frame) and
 the Reynolds Stress tensor in the global reference frame (mesh reference frame) and  the Reynolds stress tensor in the local reference frame (reference frame associated to the boundary face).
 the Reynolds stress tensor in the local reference frame (reference frame associated to the boundary face).
 is the change of basis orthogonal matrix from local to global reference frame.
 is the change of basis orthogonal matrix from local to global reference frame.
 is a 6 by 6 matrix defined such that:
 is a 6 by 6 matrix defined such that: 
![\[ \vect{R}_{g,\fib} = \tens{\alpha} \vect{R}_{g,\centip} + \vect{R}_{g}^* \]](form_522.png) 
 where symetric tensors  have been unfolded as follows:
 have been unfolded as follows: 
![\[ \vect{R}_g = \transpose{\left(R_{g,11},R_{g,22},R_{g,33}, R_{g,12},R_{g,13},R_{g,23}\right)} \]](form_523.png) 
.
 should be computed as a function of
 should be computed as a function of  as follows:
 as follows: 
![\[ \tens{R}_{g,\fib}=\tens{P}_{lg}\tens{R}_{l,\fib}\transpose{\tens{P}_{lg}} \]](form_526.png) 
with
![\[ \tens{R}_{l,\fib} = \begin{bmatrix} R_{l,11,\centip} & 0 & c R_{l,13,\centip}\\ 0 & R_{l,22,\centip} & 0 \\ c R_{l,13,\centip} & 0 & R_{l,33,\centip} \end{bmatrix} + \underbrace{\begin{bmatrix} 0 & (1-c) u^* u_k & 0 \\ (1-c) u^* u_k & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix}}_{\vect{R}_l^*} \]](form_527.png) 
and  .
.
Constant c is chosen depending on the type of the boundary face:  at a wall face,
 at a wall face,  at a symmetry face.
 at a symmetry face.
| [in] | is_sym | Constant c in description above (1 at a symmetry face, 0 at a wall face) | 
| [in] | p_lg | change of basis matrix (local to global) | 
| [out] | alpha | transformation matrix | 
| void cs_turbulence_bc_set_hmg_neumann | ( | cs_lnum_t | face_id | ) | 
Assign homogeneous Neumann turbulent boundary conditions to a given face.
This is useful for outgoing flow.
| void cs_turbulence_bc_set_uninit_inlet_hyd_diam | ( | cs_lnum_t | face_id, | 
| double | vel_dir[], | ||
| double | shear_dir[], | ||
| double | uref2, | ||
| double | dh, | ||
| double | rho, | ||
| double | mu | ||
| ) | 
Set inlet boundary condition values for turbulence variables based on a diameter  and the reference velocity
 and the reference velocity  for a circular duct flow with smooth wall, only if not already set.
 for a circular duct flow with smooth wall, only if not already set. 
Apart from assigning values where not already initialized, this function is similar to cs_turbulence_bc_inlet_hyd_diam.
| [in] | face_id | boundary face id | 
| [in] | vel_dir | velocity direction (not normalized, or NULL) | 
| [in] | shear_dir | shear direction (or NULL), it also contains the level of anisotropy (Rnt = a_nt k) | 
| [in] | uref2 | square of the reference flow velocity | 
| [in] | dh | hydraulic diameter   | 
| [in] | rho | mass density   | 
| [in] | mu | dynamic viscosity   | 
| void cs_turbulence_bc_set_uninit_inlet_k_eps | ( | cs_lnum_t | face_id, | 
| double | k, | ||
| double | eps, | ||
| double | vel_dir[], | ||
| double | shear_dir[] | ||
| ) | 
Set inlet boundary condition values for turbulence variables based on given k and epsilon values only if not already initialized.
| [in] | face_id | boundary face id | 
| [in] | k | turbulent kinetic energy | 
| [in] | eps | turbulent dissipation | 
| [in] | vel_dir | velocity direction | 
| [in] | shear_dir | shear direction, it also contains the level of anisotropy (Rnt = a_nt k) | 
| void cs_turbulence_bc_set_uninit_inlet_turb_intensity | ( | cs_lnum_t | face_id, | 
| double | uref2, | ||
| double | t_intensity, | ||
| double | dh | ||
| ) | 
Set inlet boundary condition values for turbulence variables based on a diameter  , a turbulent intensity
, a turbulent intensity  and the reference velocity
 and the reference velocity  for a circular duct flow with smooth wall, only if not already set.
 for a circular duct flow with smooth wall, only if not already set. 
Apart from assigning values where not already initialized, this function is similar to cs_turbulence_bc_inlet_turb_intensity.
| [in] | face_id | boundary face id | 
| [in] | uref2 | square of the reference flow velocity | 
| [in] | t_intensity | turbulent intensity   | 
| [in] | dh | hydraulic diameter   |