Atmospheric examples

| programmer's documentation

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Atmospheric examples

# Local variables to be added

integer ifac, ii
integer izone
integer ilelt, nlelt
double precision d2s3
double precision zref, xuref
double precision ustar, rugd, rugt
double precision zent, xuent, xvent
double precision xkent, xeent
integer, allocatable, dimension(:) :: lstelt

# Initialization and finalization

Initialization and finalization is similar to that of the base examples

# Example 1

For boundary faces of color 11, assign an inlet boundary condition prescribed from the meteo profile with automatic choice between inlet/ outlet according to the meteo profile.

call getfbr('11',nlelt,lstelt)
!==========
! - Zone number (from 1 to n)
izone = 1
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
! - Zone to which the face belongs
izfppp(ifac) = izone
! - CAUTION: do not assign boundary condition type (itypfb(ifac))
! as it is automatically set by the code.
! - Boundary conditions are prescribed from the meteo profile
iprofm(izone) = 1
enddo

# Example 2

For boundary faces of color 21, assign an inlet boundary condition prescribed from the meteo profile.

call getfbr('21',nlelt,lstelt)
!==========
! - Zone number (from 1 to n)
izone = 2
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
! - Zone to which the face belongs
izfppp(ifac) = izone
! - Boundary conditions are prescribed from the meteo profile
iprofm(izone) = 1
! - Assign inlet boundary conditions
itypfb(ifac) = ientre
enddo

# Example 3

For boundary faces of color 31, assign an inlet boundary condition prescribed from the meteo profile except for dynamical variables which are prescribed with a rough log law.

call getfbr('31',nlelt,lstelt)
!==========
! - Zone number (from 1 to n)
izone = 3
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
! - Zone to which the face belongs
izfppp(ifac) = izone
! - Boundary conditions are prescribed from the meteo profile
iprofm(izone) = 1
! - Dynamical variables are prescribed with a rough log law
zent=cdgfbo(3,ifac)
ustar=xkappa*xuref/log((zref+rugd)/rugd)
xuent=ustar/xkappa*log((zent+rugd)/rugd)
xvent = 0.d0
xkent=ustar**2/sqrt(cmu)
xeent=ustar**3/xkappa/(zent+rugd)
itypfb(ifac) = ientre
rcodcl(ifac,iu,1) = xuent
rcodcl(ifac,iv,1) = xvent
rcodcl(ifac,iw,1) = 0.d0
! itytur is a flag equal to iturb/10
if (itytur.eq.2) then
rcodcl(ifac,ik,1) = xkent
rcodcl(ifac,iep,1) = xeent
elseif(itytur.eq.3) then
rcodcl(ifac,ir11,1) = d2s3*xkent
rcodcl(ifac,ir22,1) = d2s3*xkent
rcodcl(ifac,ir33,1) = d2s3*xkent
rcodcl(ifac,ir12,1) = 0.d0
rcodcl(ifac,ir13,1) = 0.d0
rcodcl(ifac,ir23,1) = 0.d0
rcodcl(ifac,iep,1) = xeent
elseif(iturb.eq.50) then
rcodcl(ifac,ik,1) = xkent
rcodcl(ifac,iep,1) = xeent
rcodcl(ifac,iphi,1) = d2s3
rcodcl(ifac,ifb,1) = 0.d0
elseif(iturb.eq.60) then
rcodcl(ifac,ik,1) = xkent
rcodcl(ifac,iomg,1) = xeent/cmu/xkent
elseif(iturb.eq.70) then
rcodcl(ifac,inusa,1) = cmu*xkent**2/xeent
endif
enddo

# Example 4

Prescribe at boundary faces of color '12' an outlet.

call getfbr('15', nlelt, lstelt)
!==========
! - Zone number (from 1 to n)
izone = 5
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
! Wall: zero flow (zero flux for pressure)
! rough friction for velocities (+ turbulent variables)
! zero flux for scalars
! - Zone to which the zone belongs
izfppp(ifac) = izone
itypfb(ifac) = iparug
! Roughness for velocity: rugd
rcodcl(ifac,iu,3) = rugd
! Roughness for scalars (if required):
! rcodcl(ifac,iv,3) = rugd
if(iscalt.ne.-1) then
! If temperature prescribed to 20 with a rough wall law (scalar ii=1)
! (with thermal roughness specified in rcodcl(ifac,iv,3)) :
! ii = 1
! icodcl(ifac, isca(ii)) = 6
! rcodcl(ifac, isca(ii),1) = 293.15d0
! If flux prescribed to 4.d0 (scalar ii=2):
! ii = 2
! icodcl(ifac, isca(ii)) = 3
! rcodcl(ifac, isca(ii), 3) = 4.D0
endif
enddo

# Example 5

Prescribe at boundary faces of color 4 a symmetry.

call getfbr('4', nlelt, lstelt)
!==========
! - Zone number (from 1 to n)
izone = 6
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
! - Zone to which the zone belongs
izfppp(ifac) = izone
itypfb(ifac) = isymet
enddo