isca(1) is the number related to the first user-defined scalar variable. rtp(iel,isca(1)) is the value of this variable in cell number iel. ONLY done if there is no restart computation
The following local variables need to be defined for the examples in this section:
integer iel, ige, mode, icla, icha
integer ioxy
double precision t1init, h1init, coefe(
ngazem)
double precision t2init, h2init
double precision xkent, xeent, d2s3
double precision wmh2o,wmco2,wmn2,wmo2,dmas
integer, allocatable, dimension(:) :: lstelt
double precision, dimension(:), pointer :: cvar_k, cvar_cep, cvar_phi, cvar_fb
double precision, dimension(:), pointer :: cvar_omg, cvar_nusa
double precision, dimension(:), pointer :: cvar_r11, cvar_r22, cvar_r33
double precision, dimension(:), pointer :: cvar_r12, cvar_r13, cvar_r23
double precision, dimension(:), pointer :: cvar_xch, cvar_xck, cvar_np, cvar_h2
double precision, dimension(:), pointer :: cvar_scalt
double precision, dimension(:), pointer :: cvar_f1m, cvar_f2m, cvar_f4m
double precision, dimension(:), pointer :: cvar_f5m, cvar_f6m, cvar_f7m
double precision, dimension(:), pointer :: cvar_f8m, cvar_f9m, cvar_fvp2m
double precision, dimension(:), pointer :: cvar_yco2
double precision, dimension(:), pointer :: cvar_yhcn, cvar_yno, cvar_hox
Before user initialization, work arrays lstelt must be allocated, like in basic example.
d2s3 = 2.d0/3.d0
xkent = 1.d-10
xeent = 1.d-10
cvar_k(iel) = xkent
cvar_cep(iel) = xeent
enddo
cvar_r11(iel) = d2s3*xkent
cvar_r22(iel) = d2s3*xkent
cvar_r33(iel) = d2s3*xkent
cvar_r12(iel) = 0.d0
cvar_r13(iel) = 0.d0
cvar_r23(iel) = 0.d0
cvar_cep(iel) = xeent
enddo
elseif (
iturb.eq.50)
then
cvar_k(iel) = xkent
cvar_cep(iel) = xeent
cvar_phi(iel) = d2s3
cvar_fb(iel) = 0.d0
enddo
elseif (
iturb.eq.60)
then
cvar_k(iel) = xkent
cvar_omg(iel) = xeent/
cmu/xkent
enddo
elseif (
iturb.eq.70)
then
cvar_nusa(iel) =
cmu*xkent**2/xeent
enddo
endif
do icla = 1, nclacp
icha = ichcor(icla)
enddo
enddo
enddo
coefe(io2) =
wmole(io2)*oxyo2(1) &
coefe(ih2o) =
wmole(ih2o)*oxyh2o(1) &
coefe(ico2) =
wmole(ico2)*oxyco2(1) &
coefe(in2) = 1.d0-coefe(io2)-coefe(ih2o)-coefe(ico2)
enddo
mode = -1
cvar_scalt(iel) = h1init
enddo
do icha = 1, ncharb
enddo
enddo
if ( noxyd .ge. 2 ) then
endif
if ( noxyd .ge. 3 ) then
endif
endif
if ( ihtco2 .eq. 1 ) then
endif
if ( ihth2o .eq. 1 ) then
endif
if ( ieqco2.ge.1 ) then
ioxy = 1
dmas = ( oxyo2(ioxy)*wmo2 +oxyn2(ioxy)*wmn2 &
+oxyh2o(ioxy)*wmh2o+oxyco2(ioxy)*wmco2 )
xco2 = oxyco2(ioxy)*wmco2/dmas
cvar_yco2(iel) = oxyco2(ioxy)*wmco2/dmas
endif
if ( ieqnox .eq. 1 ) then
cvar_yhcn(iel) = 0.d0
cvar_yno(iel) = 0.d0
cvar_hox(iel) = h1init
endif
enddo
endif
At the end of the subroutine, it is recommended to deallocate the work array lstelt, like in basic example.