Local variables to be added
integer ifac, ii, iel
integer idim
integer izone,iesp
integer ilelt, nlelt
double precision uref2, d2s3
double precision rhomoy, dhy, ustar2
double precision xkent, xeent
double precision z1 , z2
integer ipotr, ipoti, f_id, ipotva1, ipotva2, ipotva3
character(len=80) :: f_name
integer, allocatable, dimension(:) :: lstelt
double precision, dimension(:), pointer :: bfpro_rom
double precision, dimension(:), pointer :: cvara_potva
integer :: keyvar
Initialization and finalization
Initialization and finalization is similar to that of the base examples
Example 1
For boundary faces of color 1 assign an inlet and assign a cathode for "electric" variables.
call
getfbr(
'1', nlelt, lstelt)
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
izone = 1
uref2 = rcodcl(ifac,
iu,1)**2 &
uref2 = max(uref2,1.d-12)
dhy = 0.075d0
rhomoy = bfpro_rom(ifac)
ustar2 = 0.d0
ustar2, xkent, xeent)
rcodcl(ifac,
ik,1) = xkent
rcodcl(ifac,
iep,1) = xeent
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
icodcl(ifac,
isca(ii)) = 1
rcodcl(ifac,
isca(ii),1) = 1.d6
icodcl(ifac,ipotr) = 1
rcodcl(ifac,ipotr,1) = 0.d0
write(f_name,'(a13,i2.2)') 'esl_fraction_',iesp
icodcl(ifac,ii) = 1
rcodcl(ifac,ii,1) = 0.d0
enddo
endif
icodcl(ifac,ipoti) = 1
rcodcl(ifac,ipoti,1) = 0.d0
endif
icodcl(ifac,ipotva1) = 3
rcodcl(ifac,ipotva1,3) = 0.d0
icodcl(ifac,ipotva2) = 3
rcodcl(ifac,ipotva2,3) = 0.d0
icodcl(ifac,ipotva3) = 3
rcodcl(ifac,ipotva3,3) = 0.d0
endif
enddo
Example 2
For boundary faces of color 5 assign an free outlet and example of electrode for Joule Effect by direct conduction.
call
getfbr(
'5', nlelt, lstelt)
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
izone = 2
icodcl(ifac,ipotr) = 1
rcodcl(ifac,ipotr,1) = 500.d0*
coejou
else
rcodcl(ifac,ipotr,1) = 500.d0
endif
endif
icodcl(ifac,ipoti) = 1
rcodcl(ifac,ipoti,1) = sqrt(3.d0)*500.d0*
coejou
else
rcodcl(ifac,ipoti,1) = sqrt(3.d0)*500.d0
endif
endif
enddo
Example 3
For boundary faces of color 2 assign a free outlet and example of anode for electric arc.
call
getfbr(
'2', nlelt, lstelt)
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
izone = 3
icodcl(ifac,ipotr) = 1
else
rcodcl(ifac,ipotr,1) = 1000.d0
endif
enddo
Example 4
For boundary faces of color 3 assign a wall and example of potential vector Dirichlet condition
call
getfbr(
'3', nlelt, lstelt)
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
izone = 4
if (
cdgfbo(1,ifac) .le. 2.249d-2 .or. &
cdgfbo(1,ifac) .ge. 2.249d-2 .or. &
cdgfbo(3,ifac) .le. -2.249d-2 .or. &
cdgfbo(3,ifac) .ge. 2.249d-2 )
then
icodcl(ifac,ipotva1) = 1
rcodcl(ifac,ipotva1,1) = cvara_potva(iel)
icodcl(ifac,ipotva2) = 1
rcodcl(ifac,ipotva2,1) = cvara_potva(iel)
icodcl(ifac,ipotva3) = 1
rcodcl(ifac,ipotva3,1) = cvara_potva(iel)
endif
endif
enddo
Example 5
For boundary faces of color 51 assign a wall and restriking model for electric arc (anode boundaray condition).
call
getfbr(
'51', nlelt, lstelt)
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
izone = 5
icodcl(ifac,
isca(ii)) = 1
rcodcl(ifac,
isca(ii),1) = 2.d4
rcodcl(ifac,
isca(ii),2) = 1.d5
icodcl(ifac,ipotr) = 1
else
rcodcl(ifac,ipotr,1) = 100.d0
endif
if (z1.le.0.d0) z1 = 0.d0
if (z2.ge.2.d-2) z2 = 2.d-2
icodcl(ifac,
isca(ii)) = 1
else
icodcl(ifac,
isca(ii)) = 3
rcodcl(ifac,
isca(ii),3) = 0.d0
endif
endif
endif
icodcl(ifac,ipotva1) = 3
rcodcl(ifac,ipotva1,3) = 0.d0
icodcl(ifac,ipotva2) = 3
rcodcl(ifac,ipotva2,3) = 0.d0
icodcl(ifac,ipotva3) = 3
rcodcl(ifac,ipotva3,3) = 0.d0
endif
enddo
Example 6
For boundary faces of color 4 assign a symmetry.
call
getfbr(
'4', nlelt, lstelt)
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
izone = 6
icodcl(ifac,ipoti) = 1
rcodcl(ifac,ipoti,1) = 0.d0
endif
enddo