Local variables to be added
integer ifac , iel , ii
integer izone , iutile
integer ilelt, nlelt
double precision uref2 , dhyd , rhomoy
double precision ustar2, xkent , xeent , d2s3
integer, allocatable, dimension(:) :: lstelt
double precision, dimension(:), pointer :: cpro_rom
Initialization and finalization
Initialization and finalization is similar to that of the base examples
Example 1
Example of input / output for which everything is known.
Without presuming subsonic or supersonic character, the user wishes to impose all the flow characteristics. A supersonic inlet is a special case.
If the speed is outgoing, an homogenous Neumann is imposed on turbulence and user scalars.
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
iel = ifabor(ifac)
izone = 1
izfppp(ifac) = izone
itypfb(ifac) = iesicf
rcodcl(ifac,iu,1) = 5.0d0
rcodcl(ifac,iv,1) = 0.0d0
rcodcl(ifac,iw,1) = 0.0d0
rcodcl(ifac,ipr,1) = 5.d5
rcodcl(ifac,isca(itempk),1) = 300.d0
uref2 = rcodcl(ifac,iu,1)**2 + rcodcl(ifac,iv,1)**2 + rcodcl(ifac,iw,1)**2
uref2 = max(uref2,1.d-12)
dhyd = 0.075d0
rhomoy = cpro_rom(iel)
ustar2 = 0.d0
xkent = epzero
xeent = epzero
( uref2, dhyd, rhomoy, viscl0, cmu, xkappa, &
ustar2, xkent, xeent )
if (itytur.eq.2) then
rcodcl(ifac,ik,1) = xkent
rcodcl(ifac,iep,1) = xeent
elseif(itytur.eq.3) then
rcodcl(ifac,ir11,1) = 2.d0/3.d0*xkent
rcodcl(ifac,ir22,1) = 2.d0/3.d0*xkent
rcodcl(ifac,ir33,1) = 2.d0/3.d0*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
if(nscaus.gt.0) then
do ii = 1, nscaus
rcodcl(ifac,isca(ii),1) = 1.d0
enddo
endif
enddo
Example 2
Example supersonic output
All features are output. Internal values are used to calculate the flow edge, they should not be imposed.
For turbulence and scalar, if RCODCL values are provided, they will be used in Dirichlet if the mass flow is incoming, otherwise a null flow is imposed (flow outgoing mass or RCODCL informed here). Note that for turbulence RCODCL must be defined for all turbulent variables. Otherwise a null flow is applied).
TODO : verifier la traduction. Exemple de sortie supersonique
toutes les caracteristiques sortent on ne doit rien imposer (ce sont les valeurs internes qui sont utilisees pour le calcul des flux de bord)
pour la turbulence et les scalaires, si on fournit ici des valeurs de RCODCL, on les impose en Dirichlet si le flux de masse est entrant ; sinon, on impose un flux nul (flux de masse sortant ou RCODCL renseigne ici). Noter que pour la turbulence, il faut renseigner RCODCL pour toutes les variables turbulentes (sinon, on applique un flux nul).
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
izone = 2
izfppp(ifac) = izone
itypfb(ifac) = isspcf
enddo
Example 3
Subsonic input example (flow, flow calorimetry)
Two of three characteristics are incoming: two informations must be provided, third is deduced by a scenario of 2-contact and 3-relaxation in the field. Here we choose to give (rho * (U.n) * rho (U.n) * H)
- where H = 1/2 * G G + P / E + rho
- and n is the unit normal incoming
- Warning
- DENSITIES debit (per unit area) are provided.
TODO : Verifier la traduction
Exemple d'entree subsonique (debit, debit enthalpique)
2 caracteristiques sur 3 entrent : il faut donner 2 informations
la troisieme est deduite par un scenario de 2-contact et
3-detente dans le domaine
ici on choisit de donner (rho*(U.n), rho*(U.n)*H)
avec H = 1/2 U*U + P/rho + e
n la normale unitaire entrante
ATTENTION, on donne des DENSITES de debit (par unite de surface)
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
izone = 3
izfppp(ifac) = izone
itypfb(ifac) = ieqhcf
rcodcl(ifac,irun,1) = 5.d5
rcodcl(ifac,irunh,1) = 5.d5
enddo
Example 4
Subsonic input example with density and velocity.
Two of three characteristics are incoming: two informations must be provided, third is deduced by a scenario of 2-contact and 3-relaxation in the field. Here we choose to give (rho, U).
TODO : Verifier la traduction Exemple d'entree subsonique (masse volumique, vitesse)
2 caracteristiques sur 3 entrent : il faut donner 2 informations la troisieme est deduite par un scenario de 2-contact et 3-detente dans le domaine ici on choisit de donner (rho, U)
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
izone = 4
izfppp(ifac) = izone
itypfb(ifac) = iephcf
rcodcl(ifac,ipr,1) = 1.d5
rcodcl(ifac,isca(ienerg),1) = 294465.d0
rcodcl(ifac,iu,1) = -surfbo(1,ifac)
rcodcl(ifac,iv,1) = -surfbo(2,ifac)
rcodcl(ifac,iw,1) = -surfbo(3,ifac)
if(nscaus.gt.0) then
do ii = 1, nscaus
rcodcl(ifac,isca(ii),1) = 1.d0
enddo
endif
enddo
Example 5
Subsonic outlet example
1 characteristic out of 3 exits: 1 information must be given the 2 others are deduced by a 2-contact and 3-relaxation in the domain. Here we choose to definer P.
Turbulence and user scalars take a zero flux.
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
izone = 5
izfppp(ifac) = izone
itypfb(ifac) = isopcf
rcodcl(ifac,ipr,1) = 5.d5
enddo
Example 6
Wall example
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
izone = 7
izfppp(ifac) = izone
itypfb(ifac) = iparoi
iutile = 0
if(iutile.eq.1) then
rcodcl(ifac,iu,1) = 1.d0
endif
iutile = 0
if(iutile.eq.1) then
icodcl(ifac,isca(itempk)) = 5
rcodcl(ifac,isca(itempk),1) = 20.d0 + 273.15d0
endif
iutile = 0
if(iutile.eq.1) then
icodcl(ifac,isca(itempk)) = 3
rcodcl(ifac,isca(itempk),3) = 1000.d0
endif
enddo
Example 7
Symmetry example
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
izone = 8
izfppp(ifac) = izone
itypfb(ifac) = isymet
enddo