My Project
programmer's documentation
Generation of synthetic turbulence at LES inlets

Introduction

This example contains 3 subroutines :

  • cs_user_les_inflow_init: definition of global caracteristics of synthetic turbulence inlets
  • cs_user_les_inflow_define: definition of the caracteristics of the synthetic turbulence
  • cs_user_les_inflow_advanced: accurate definition of target statistics at inlet

Global caracteristics of synthetic turbulence inlets

Purpose

Generation of synthetic turbulence at LES inlets. Definition of global caracteristics of synthetic turbulence inlets: nent and isuisy might be defined.

  • nent = Number of inlets
  • isuisy = 1: Reading of the LES inflow module restart file
  • isuisy = 0: not activated (synthetic turbulence reinitialized)

Local variables declaration

No local variable.

Initializations

! nent = Number of inlets
!------------------------
! There is two distinct synthetic turbulence inlets in the flow
nent = 2
! Reading of the LES inflow module restart file
! isuisy = 0 ------> not activated (synthetic turbulence reinitialized)
! isuisy = 1 ------> activated
!-------------------------------
! Synthetic fluctuations are not re-initialized in case of restart calculation
isuisy = isuite

Caracteristics of one specific inlet

Purpose

Generation of synthetic turbulence at LES inlets Definition of the caracteristics of the synthetic turbulence inlet 'nument' For each LES inlet, the following parameters might be defined:

  1. Data relatve to the method employed
    • typent indicates the synthetic turbulence method:
      • 0 : laminar, no turbulent fluctations
      • 1 : random gaussian noise
      • 2 : Batten method, based on Fourier mode decomposition
      • 3 : Synthetic Eddy Method (SEM)
    • nelent indicates the number of "entities" relative to the method (useful only for the Batten method and the SEM):
      • for Batten : number of Fourier modes of the turbulent fluctuations
      • for SEM : number of synthetic eddies building the fluctuations
    • iverbo indicates the verbosity level (listing)
      • = 0 no specific output
      • > 0 additionnal output (only for SEM)
  2. Data relative to the LES inflow boundary faces
    • nfbent: number of boundary faces of the LES inflow
    • lfbent: list of boundary faces of the LES inflow
  3. Data relative to the flow
    • vitent(3): reference mean velocity vector
    • enrent: reference turbulent kinetic energy
    • dspent: reference dissipation rate
    • Note:
      • dspent useful only for typent = 2 (Batten) or typent = 3 (SEM).
      • Strictly positive values are required for enrent and dspent.
      • Accurate specification of the statistics of the flow at LES inlet can be made via the user subroutine cs_user_les_inflow_advanced.

Local variables declaration

No local variable.

Initializations

First synthetic turbulence inlet: the Batten Method is used for boundary faces of color '1'.

if (nument.eq.1) then
! 1. Data relatve to the method employed
! Batten method
typent = 2
! Synthetic fluctuations are composed of 200 modes
nelent = 200
! No specific verbosity
iverbo = 0
! 2. Data relative to the LES inflow boundary faces
! Selection of the boundary faces of color '1'
call getfbr('1',nfbent,lfbent)
! 3. Data relative to the flow
! Velocity, turb. kinetic energy and dissipation scales are given
vitent(1) = 18.d0
vitent(2) = 0.d0
vitent(3) = 0.d0
enrent = 4.d0
dspent = 4.d0
endif

Second synthetic turbulence inlet: the Synthetic Eddy Method is used for the boundary faces verifying a geometric criterion.

if (nument.eq.1) then
! 1. Data relatve to the method employed
! Synthetic Eddy Method
typent = 3
! 2000 synthetic eddies contribute to the turbulent fluctuations
nelent = 2000
! Details concerning SEM in the log
iverbo = 1
! 2. Data relative to the LES inflow boundary faces
! Selection of the boundary faces thanks to a geometric criterion
call getfbr('x < 0.1', nfbent, lfbent)
! 3. Data relative to the flow
! Velocity, turb. kinetic energy and dissipation scales are given
vitent(1) = 12.d0
vitent(2) = 0.d0
vitent(3) = 0.d0
enrent = 3.d0
dspent = 3.d0
endif

Accurate specification of target statistics at inlet

Purpose

Generation of synthetic turbulence at LES inlets. Accurate definition of mean velocity, Reynolds stresses and dissipation rate for each boundary faces of the synthetic turbulence inlet 'nument'.

Usage:

  • uvwent(ndim,nfbent) : mean velocity vector
  • rijent( 6,nfbent) : Reynolds stresses!
  • epsent( nfbent) : dissipation rate

Local variables declaration

integer ii, ifac, iel
double precision d2s3
double precision utau, href, reyfro, yy, yplus, uplus, kplus, eplus
double precision uref2, xdh, xitur, xkent, xeent
double precision, dimension(:), pointer :: cpro_viscl

Example 1

Mean velocity, Reynolds stresses an dissipation are deduced from a wall law for the first synthetic turbulence inlet,

  • no refining of the statistics of the flow is provided for the second synthetic turbulence inlet.
if (nument.eq.1) then
! Approximation of the friction velocity
utau = uref/20.d0
! Reference length scale
href = 1.d0
do ii = 1, nfbent
ifac = lfbent(ii)
iel = ifabor(ifac)
reyfro = utau*href/cpro_viscl(iel)
! Dimensionless wall distance
yy = 1.d0-abs(cdgfbo(2,ifac))
yplus = yy/href*reyfro
! Reichart laws (dimensionless)
uplus = log(1.d0+0.4d0*yplus)/xkappa &
+ 7.8d0*( 1.d0 - exp(-yplus/11.d0) &
- yplus/11.d0*exp(-0.33d0*yplus))
kplus = 0.07d0*yplus*yplus*exp(-yplus/8.d0) &
+ (1.d0 - exp(-yplus/20.d0))*4.5d0 &
/ (1.d0 + 4.d0*yplus/reyfro)
eplus = (1.d0/xkappa) &
/ (yplus**4+15.d0**4)**(0.25d0)
! Arrays are filled with dimensionnal stats
uvwent(1,ii) = uplus*utau
uvwent(2,ii) = 0.d0
uvwent(3,ii) = 0.d0
rijent(1,ii) = d2s3*kplus*utau**2
rijent(2,ii) = d2s3*kplus*utau**2
rijent(3,ii) = d2s3*kplus*utau**2
rijent(4,ii) = 0.d0
rijent(5,ii) = 0.d0
rijent(6,ii) = 0.d0
epsent(ii) = eplus*utau**4/cpro_viscl(iel)
enddo
endif
! No refining of the statistics of the flow is provided for the other
! synthetic turbulence inlet
if (nument.eq.2) then
continue
endif

Example 2

Reynolds stresses and dissipation at the inlet are computed using the turbulence intensity and standard laws for a circular pipe for the first synthetic turbulence inlet,

  • no refining of the statistics of the flow is provided for the other synthetic turbulence inlet.
if (nument.eq.1) then
do ii = 1, nfbent
ifac = lfbent(ii)
iel = ifabor(ifac)
uvwent(1,ii) = 1.1d0
uvwent(2,ii) = 1.1d0
uvwent(3,ii) = 1.1d0
uref2 = uvwent(1,ii)**2 &
+ uvwent(2,ii)**2 &
+ uvwent(3,ii)**2
uref2 = max(uref2,1.d-12)
! Hydraulic diameter
xdh = 0.075d0
! Turbulence intensity
xitur = 0.02d0
xkent = epzero
xeent = epzero
call turbulence_bc_ke_turb_intensity&
( uref2, xitur, xdh, xkent, xeent )
rijent(1,ii) = d2s3*xkent
rijent(2,ii) = d2s3*xkent
rijent(3,ii) = d2s3*xkent
rijent(4,ii) = 0.d0
rijent(5,ii) = 0.d0
rijent(6,ii) = 0.d0
epsent(ii) = xeent
enddo
endif
getfbr
subroutine getfbr(fstr, facnb, faces)
Build the list of boundary faces matching a criteria string.
Definition: cs_selector_f2c.f90:111
yplus
Definition: cs_field_pointer.h:237