| programmer's documentation

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

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Gas 3 PTCHEM example

# Gas 3 PTCHEM example

## Local variables to be added

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

integer iel, igg
double precision coefg(ngazgm)
integer, allocatable, dimension(:) :: lstelt

## 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
do iel = 1, ncel
! ----- Mean Mixture Fraction
rtp(iel,isca(ifm)) = fs(1)
! ----- Variance of Mixture Fraction
rtp(iel,isca(ifp2m)) = zero
! ----- Enthalpy
if ( ippmod(icod3p).eq.1 ) then
rtp(iel,isca(iscalt)) = hinfue*fs(1)+hinoxy*(1.d0-fs(1))
endif
enddo
endif

## Finalization

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