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
double precision z1 , z2
integer ipotr, ipoti, f_id, ipotva
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)
( ifac, uref2, dhy, rhomoy,
viscl0, rcodcl )
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,ipotva ) = 3
rcodcl(ifac,ipotva ,3) = 0.d0
icodcl(ifac,ipotva + 1) = 3
rcodcl(ifac,ipotva + 1,3) = 0.d0
icodcl(ifac,ipotva + 2) = 3
rcodcl(ifac,ipotva + 2,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,ipotva) = 1
rcodcl(ifac,ipotva,1) = cvara_potva(1, iel)
icodcl(ifac,ipotva + 1) = 1
rcodcl(ifac,ipotva + 1,1) = cvara_potva(2, iel)
icodcl(ifac,ipotva + 2) = 1
rcodcl(ifac,ipotva + 2,1) = cvara_potva(3, 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,ipotva ) = 3
rcodcl(ifac,ipotva ,3) = 0.d0
icodcl(ifac,ipotva + 1) = 3
rcodcl(ifac,ipotva + 1,3) = 0.d0
icodcl(ifac,ipotva + 2) = 3
rcodcl(ifac,ipotva + 2,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