My Project
programmer's documentation
Compressible examples

Local variables to be added

integer ifac , iel , ii
integer izone , iutile
integer ilelt, nlelt
double precision uref2 , dhy , rhomoy
double precision 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.

call getfbr('1 and X <= 1.0 ', nlelt, lstelt)
!==========
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
! Cell adjacent to boundary face
iel = ifabor(ifac)
! Number of zones from 1 to n...
izone = 1
izfppp(ifac) = izone
itypfb(ifac) = iesicf
! Velocity
rcodcl(ifac,iu,1) = 5.0d0
rcodcl(ifac,iv,1) = 0.0d0
rcodcl(ifac,iw,1) = 0.0d0
! Pressure, Density, Temperature, Total Specific Energy
! Only 2 of the 4 variables are independant,
! hence one can impose values for any couple of variables
! (except Temperature-Energy) and the two other variables
! will be computed automatically
! ** Choose a couple of variables which values are to be imposed
! and delete the others (that will be computed with the help of
! the thermodynamic laws in cfther.f90).
! Pressure (in Pa)
rcodcl(ifac,ipr,1) = 5.d5
! Temperature (in K)
rcodcl(ifac,isca(itempk),1) = 300.d0
! Specific Total Energy (in J/kg)
! rcodcl(ifac,isca(ienerg),1) = 355.d3
! Turbulence
uref2 = rcodcl(ifac,iu,1)**2 + rcodcl(ifac,iv,1)**2 + rcodcl(ifac,iw,1)**2
uref2 = max(uref2,1.d-12)
! Turbulence example computed using equations valid for a pipe.
! We will be careful to specify a hydraulic diameter adapted
! to the current inlet.
! We will also be careful if necessary to use a more precise
! formula for the dynamic viscosity use in the calculation of
! the Reynolds number (especially if it is variable, it may be
! useful to take the law from 'cs_user_physical_properties'. Here, we use by default
! the 'viscl0" value.
! Regarding the density, we have access to its value at boundary
! faces (romb) so this value is the one used here (specifically,
! it is consistent with the processing in 'cs_user_physical_properties', in case of
! variable density)
! Hydraulic diameter
dhy = 0.075d0
rhomoy = cpro_rom(iel)
call turbulence_bc_inlet_hyd_diam &
( ifac, uref2, dhy, rhomoy, viscl0, rcodcl )
! Handle scalars
! (do not loop on nscal to avoid modifying rho and energy)
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).

call getfbr('2', nlelt, lstelt)
!==========
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
! Number zones from 1 to n...
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)
call getfbr('3', nlelt, lstelt)
!==========
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
! Number of zones from 1 to n...
izone = 3
izfppp(ifac) = izone
itypfb(ifac) = ieqhcf
! - flow rate density (kg/(m2 s))
rcodcl(ifac,irun,1) = 5.d5
! - enthalpy flow rate density (J/(m2 s))
rcodcl(ifac,irunh,1) = 5.d5
! Unavailable B.C. in current version
call csexit (1)
!==========
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)

call getfbr('4', nlelt, lstelt)
!==========
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
! Number zones from 1 to n...
izone = 4
izfppp(ifac) = izone
itypfb(ifac) = iephcf
! Total pressure (in Pa)
rcodcl(ifac,ipr,1) = 1.d5
! Total enthalpy
rcodcl(ifac,isca(ienerg),1) = 294465.d0
! Direction of the velocity: normal to inlet faces
rcodcl(ifac,iu,1) = -surfbo(1,ifac)
rcodcl(ifac,iv,1) = -surfbo(2,ifac)
rcodcl(ifac,iw,1) = -surfbo(3,ifac)
! Turbulence (no turbulence)
! Handle scalars
! (do not loop on nscal to avoid modifying rho and energy)
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.

call getfbr('5', nlelt, lstelt)
!==========
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
! Number zones from 1 to n...
izone = 5
izfppp(ifac) = izone
itypfb(ifac) = isopcf
! Pressure (in Pa)
rcodcl(ifac,ipr,1) = 5.d5
enddo

Example 6

Wall example

call getfbr('7', nlelt, lstelt)
!==========
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
! Number zones from 1 to n...
izone = 7
izfppp(ifac) = izone
itypfb(ifac) = iparoi
! --- Sliding wall
! By default, the wall does not slide.
! If the wall slides, define the nonzero components of its velocity.
! The velocity will be projected in a plane tangent to the wall.
! In the following example, we prescribe Ux = 1.
! (example activated if iutile=1)
iutile = 0
if(iutile.eq.1) then
rcodcl(ifac,iu,1) = 1.d0
endif
! --- Prescribed temperature
! By default, the wall is adiabatic.
! If the wall has a prescribed temperature, indicate it by setting
! icodcl = 5 and define a value in Kelvin in rcodcl(., ., 1)
! In the following example, we prescribe T = 293.15 K
! (example activated if iutile=1)
iutile = 0
if(iutile.eq.1) then
icodcl(ifac,isca(itempk)) = 5
rcodcl(ifac,isca(itempk),1) = 20.d0 + 273.15d0
endif
! --- Prescribed flux
! By default, the wall is adiabatic.
! If the wall has a prescribed flux, indicate it by setting
! icodcl = 3 and define the value in Watt/m2 in rcodcl(., ., 3)
! In the following example, we prescribe a flux of 1000 W/m2
! - a midday in the summer - (example is activated if iutile=1)
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

call getfbr('8', nlelt, lstelt)
!==========
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
! Number zones from 1 to n...
izone = 8
izfppp(ifac) = izone
itypfb(ifac) = isymet
enddo
getfbr
subroutine getfbr(fstr, facnb, faces)
Build the list of boundary faces matching a criteria string.
Definition: cs_selector_f2c.f90:111