programmer's documentation
Gas EBU example

Gas EBU example

Local variables to be added

The following local variables need to be defined for the examples in this section:

integer iel, mode, igg, izone
double precision hinit, coefg(ngazgm)
double precision sommqf, sommqt, sommq, tentm, fmelm
integer, allocatable, dimension(:) :: lstelt
double precision, dimension(:), pointer :: cvar_ygfm, cvar_fm, cvar_scalt

Allocation

Before user initialization, work arrays lstelt must be allocated, like in basic example.

Initialization

The following initialization block needs to be added for the following examples:

allocate(lstelt(ncel)) ! temporary array for cells selection
! Control output
write(nfecra,9001)
do igg = 1, ngazgm
coefg(igg) = zero
enddo
!===============================================================================
! Variables initialization:
!
! ONLY done if there is no restart computation
!===============================================================================
if ( isuite.eq.0 ) then
! a. Preliminary calculations
sommqf = zero
sommq = zero
sommqt = zero
! For multiple inlets
do izone = 1, nozapm
sommqf = sommqf + qimp(izone)*fment(izone)
sommqt = sommqt + qimp(izone)*tkent(izone)
sommq = sommq + qimp(izone)
enddo
if (abs(sommq).gt.epzero) then
fmelm = sommqf / sommq
tentm = sommqt / sommq
else
fmelm = zero
tentm = t0
endif
! ----- Calculation of the Enthalpy of the mean gas mixture
! (unburned - or fresh- gas at mean mixture fraction)
if ( ippmod(icoebu).eq.1 .or. ippmod(icoebu).eq.3 ) then
coefg(1) = fmelm
coefg(2) = (1.d0-fmelm)
coefg(3) = zero
mode = -1
! Converting the mean boundary conditions into
! enthalpy values
call cothht &
!==========
( mode , ngazg , ngazgm , coefg , &
npo , npot , th , ehgazg , &
hinit , tentm )
endif
! b. Initialisation
do iel = 1, ncel
! ----- Mass fraction of Unburned Gas
cvar_ygfm(iel) = 5.d-1
! ----- Mean Mixture Fraction
if ( ippmod(icoebu).eq.2 .or. ippmod(icoebu).eq.3 ) then
cvar_fm(iel) = fmelm
endif
! ----- Enthalpy
if ( ippmod(icoebu).eq.1 .or. ippmod(icoebu).eq.3 ) then
cvar_scalt(iel) = hinit
endif
enddo
endif

Finalization

At the end of the subroutine, it is recommended to deallocate the work array lstelt, like in basic example.