8.1
general documentation
Gas 3 PTCHEM examples

Local variables to be added

integer iel, ifac, izone, ii
integer ilelt, nlelt
integer, pointer, dimension(:,:) :: icodcl
double precision, pointer, dimension(:,:,:) :: rcodcl
double precision uref2, d2s3
double precision xkent, xeent
double precision dp, rho, S0, Kadm, radm, madm, Qadm, Padm, Ploc
double precision, dimension(:), pointer :: crom
integer, allocatable, dimension(:) :: lstelt

Initialization and finalization

Initialization and finalization is similar to that of the base examples

Example 1

Definition of a fuel flow inlet for each face of colour 11

call getfbr('11', nlelt, lstelt)
!==========
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
! Type of pre-defined boundary condidition (see above)
itypfb(ifac) = ientre
! Zone number (arbitrary number between 1 and n)
izone = 1
! Allocation of the actual face to the zone
izfppp(ifac) = izone
! Indicating the inlet as a fuel flow inlet
ientfu(izone) = 1
! Inlet Temperature in K
tinfue = 436.d0
! The incoming fuel flow refers to:
! a) a massflow rate -> iqimp() = 1
iqimp(izone) = 1
qimp(izone) = 2.62609d-4 / 72.d0
!
! b) an inlet velocity -> iqimp() = 0
rcodcl(ifac,iu,1) = 0.d0
rcodcl(ifac,iv,1) = 0.d0
rcodcl(ifac,iw,1) = 21.47d0
! ATTENTION: If iqimp() = 1 the direction vector of the massfow has
! to begiven here.
!
! Boundary conditions of turbulence
icalke(izone) = 1
!
! - If ICALKE = 0 the boundary conditions of turbulence at
! the inlet are calculated as follows:
if(icalke(izone).eq.0) then
uref2 = rcodcl(ifac,iu,1)**2 &
+rcodcl(ifac,iv,1)**2 &
+rcodcl(ifac,iw,1)**2
uref2 = max(uref2,1.d-12)
xkent = epzero
xeent = epzero
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
endif
!
! - If ICALKE = 1 the boundary conditions of turbulence at
! the inlet refer to both, a hydraulic diameter and a
! reference velocity.
!
dh(izone) = 0.032d0
!
! - If ICALKE = 2 the boundary conditions of turbulence at
! the inlet refer to a turbulence intensity.
!
xintur(izone) = 0.d0
enddo
subroutine getfbr(fstr, facnb, faces)
Build the list of boundary faces matching a criteria string.
Definition: cs_selector_f2c.f90:111

Example 2

Definition of an air flow inlet for each face of colour 21

call getfbr('21', nlelt, lstelt)
!==========
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
! Type of pre-defined boundary condidition (see above)
itypfb(ifac) = ientre
! Zone number (arbitrary number between 1 and n)
izone = 2
! Allocation of the actual face to the zone
izfppp(ifac) = izone
! Indicating the inlet as a air flow inlet
ientox(izone) = 1
! Inlet Temperature in K
tinoxy = 353.d0
! The inflowing fuel flow refers to:
! a) a massflow rate -> iqimp() = 1
iqimp(izone) = 1
qimp(izone) = 4.282d-3 / 72.d0
!
! b) an inlet velocity -> iqimp() = 0
rcodcl(ifac,iu,1) = 0.d0
rcodcl(ifac,iv,1) = 0.d0
rcodcl(ifac,iw,1) = 0.097d0
! ATTENTION: If iqimp() = 1 the direction vector of the massfow has
! to be given here.
! Boundary conditions of turbulence
icalke(izone) = 1
!
! - If ICALKE = 0 the boundary conditions of turbulence at
! the inlet are calculated as follows:
if(icalke(izone).eq.0) then
uref2 = rcodcl(ifac,iu,1)**2 &
+rcodcl(ifac,iv,1)**2 &
+rcodcl(ifac,iw,1)**2
uref2 = max(uref2,1.d-12)
xkent = epzero
xeent = epzero
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
endif
!
! - If ICALKE = 1 the boundary conditions of turbulence at
! the inlet refer to both, a hydraulic diameter and a
! reference velocity.
!
dh(izone) = 0.218d0
!
! - If ICALKE = 2 the boundary conditions of turbulence at
! the inlet refer to a turbulence intensity.
!
xintur(izone) = 0.d0
!
enddo

Example 3

Definition of a wall for each face of colour 51 up to 59

call getfbr('51 to 59', nlelt, lstelt)
!==========
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
! Type of pre-defined boundary condidition (see above)
itypfb(ifac) = iparoi
! Zone number (arbitrary number between 1 and n)
izone = 3
! Allocation of the actual face to the zone
izfppp(ifac) = izone
enddo

Example 4

Definition of an exit for each face of colour 91

call getfbr('91', nlelt, lstelt)
!==========
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
! Type of pre-defined boundary condidition (see above)
itypfb(ifac) = isolib
! Zone number (arbitrary number between 1 and n)
izone = 4
! Allocation of the actual face to the zone
izfppp(ifac) = izone
enddo

Example 5

Definition of symmetric boundary conditions for each face of colour 41 and 4.

call getfbr('41 or 4', nlelt, lstelt)
!==========
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
! Type of pre-defined boundary condidition (see above)
itypfb(ifac) = isymet
! Zone number (arbitrary number between 1 and n)
izone = 5
! Allocation of the actual face to the zone
izfppp(ifac) = izone
enddo