| programmer's documentation

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

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Electric arcs example

# Electric arcs example

## Local variables to be added

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

integer iel, mode
integer iesp , idimve
double precision tinit, hinit, coefe(ngazem)
integer, allocatable, dimension(:) :: lstelt

## Allocation

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

## Initialization

Some controls are made during initialization:

! For Joule heating by direct conduction, it stops
! you have tot be sure that the enthalpy function H(T) is the right one
!
if ( ippmod(ieljou).ge.1 ) then
write(nfecra,9010)
call csexit(1)
! For electric arc, we continue because the value are given by defauft
! (H(T) is given from the data file dp_ELE)
elseif (ippmod(ielarc).ge.1) then
if (ntcabs.eq.1) then
write(nfecra,9011)
endif
return
endif

Classical initialization:

allocate(lstelt(ncel)) ! temporary array for cells selection
! Control output
write(nfecra,9001)
!===============================================================================
! Initialization
! (only at the beginning of the calculation)
!===============================================================================
if ( isuite.eq.0 ) then
! --> Enthalpy = H(T0) ou 0
! For electric arc,
! for the whole compution domain enthalpy is set to H(T0) of the 1st
! constituant of the gas
!
! For Joule jeating by direct conduction,
! enthalpy is set to zero, and the user will enter his H(T) function
! tabulation.
!
! -- HINIT calculations
if ( ippmod(ielarc).ge.1 ) then
mode = -1
tinit = t0
coefe(1) = 1.d0
if ( ngazg .gt. 1 ) then
do iesp = 2, ngazg
coefe(iesp) = 0.d0
enddo
endif
call elthht(mode,ngazg,coefe,hinit,tinit)
else
mode = -1
tinit = t0
call usthht(mode,hinit,tinit)
endif
! -- Entahlpy value
do iel = 1, ncel
rtp(iel,isca(iscalt)) = hinit
enddo
! --> Mass fraction = 1 ou 0
if ( ngazg .gt. 1 ) then
do iel = 1, ncel
rtp(iel,isca(iycoel(1))) = 1.d0
enddo
do iesp = 2, ngazg-1
do iel = 1, ncel
rtp(iel,isca(iycoel(iesp))) = 0.d0
enddo
enddo
endif
! --> Electric potentials = 0
! -- Real Component
do iel = 1, ncel
rtp(iel,isca(ipotr)) = 0.d0
enddo
! -- Imaginary (for Joule heating by direct conduction)
if ( ippmod(ieljou).eq.2 .or. ippmod(ieljou).eq.4 ) then
do iel = 1, ncel
rtp(iel,isca(ipoti)) = 0.d0
enddo
endif
! -- Vector potential (3D electric arc 3D)
if ( ippmod(ielarc).ge.2 ) then
do idimve = 1, ndimve
do iel = 1, ncel
rtp(iel,isca(ipotva(idimve))) = 0.d0
enddo
enddo
endif
endif

## Finalization

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