7.0
general documentation
cs_user_boundary_mass_source_terms.f90 File Reference

Source terms associated at the boundary faces and the neighboring cells with surface condensation. More...

Functions/Subroutines

subroutine cs_user_boundary_mass_source_terms (nvar, nscal, nfbpcd, iappel, ifbpcd, itypcd, izftcd, spcond, tpar)
 

Detailed Description

Source terms associated at the boundary faces and the neighboring cells with surface condensation.

This subroutine fills the condensation source terms for each variable at the cell center associated to the boundary faces identifed in the mesh. The fluid exchange coefficient is computed with a empiric law to be imposed at the boundary face where the condensation phenomenon occurs.

This user subroutine is called which allows the setting of $ \gamma_{\mbox{cond}} $ the condensation source term.

This function fills the condensation source term array gamma_cond adding to the following equations:

  • The equation for mass conservation:

    \[ D\frac{rho}{dt} + divs \left( \rho \vect{u}^n\right) = \Gamma _{cond} \]

  • The equation for a variable $\Phi $:

    \[ D\frac{\phi}{dt} = ... + \Gamma _{cond}*(\Phi _i - \Phi) \]

discretized as below:

\[ \rho*\dfrac{\Phi^{n+1}-\Phi^{n}}/dt = ... + \Gamma _{cond}*(\Phi _i - \Phi^{n+1}) \]

Remarks
  • $ \Phi _i $ is the value of $ \Phi $ associated to the injected condensation rate.

    With 2 options are available:

    • the condensation rate is injected with the local value of variable $ \Phi = \Phi ^{n+1}$ in this case the $ \Phi $ variable is not modified.
    • the condensation rate is injected with a specific value for $ \Phi = \Phi _i $ the specified value given by the user.

Usage

The three stages in the code where this User subroutine is called (with

iappel = 1, 2 and 3

)

iappel = 1
  • Calculation of the number of cells where a mass source term is imposed: ncesmp Called once at the beginning of the calculation
iappel = 2
  • Identification of the cells where a mass source term is imposed: array icesmp(ncesmp) Called once at the beginning of the calculation
iappel = 3
  • Calculation of the values of the mass source term Called at each time step

specific variables to define with is user subroutine

  • nfbpcd: number of faces where a condensation source term is imposed
  • ifbpcd(ieltcd): identification of the faces where a condensation source term is imposed.
  • itypcd(ieltcd,ivar): type of treatment for variable ivar in the ieltcd cell with condensation source term.
    • itypcd = 0 –> injection of ivar at local value
    • itypcd = 1 –> injection of ivar at user specified value.
  • spcond(ielscd,ipr): value of the injection condensation rate gamma_cond (kg/m3/s) in the ieltcd cell with condensation source term.
  • spcond(ieltcd,ivar): specified value for variable ivar associated to the injected condensation in the ieltcd cell with a condensation source term except for ivar=ipr.
Remarks
  • For each face where a condensation source terms is imposed ielscd in [1;nfbpcd]), ifbpcd(ielscd) is the global index number of the corresponding face (ifbpcd(ieltcd) in [1;ncel]).
  • if itypcd(ieltcd,ivar)=0, spcond(ielpcd,ivar) is not used.
  • if spcond(ieltcd,ipr)<0, mass is removed from the system, therefore Code_Saturna automatically considers f_i=f^(n+1), whatever the values of itypcd or smacel specified by the user
Examples of settings for boundary condensation mass source terms
Examples are available here.

Function/Subroutine Documentation

◆ cs_user_boundary_mass_source_terms()

subroutine cs_user_boundary_mass_source_terms ( integer  nvar,
integer  nscal,
integer  nfbpcd,
integer  iappel,
integer, dimension(nfbpcd)  ifbpcd,
integer, dimension(nfbpcd,nvar)  itypcd,
integer, dimension(ncel)  izftcd,
double precision, dimension(nfbpcd,nvar)  spcond,
double precision  tpar 
)
Parameters
[in]nvartotal number of variables
[in]nscaltotal number of scalars
[in]iappelindicates which at which stage the routine is
[in]nfbpcdnumber of faces with condensation source terms
[in]ifbpcdindex of faces with condensation source terms
[in]itypcdtype of condensation source term for each ivar
[in]izftcdfaces zone with condensation source terms imposed (at previous and current time steps)
[out]spcondvariable value associated to the condensation source term (for ivar=ipr, spcond is the flow rate $ \Gamma_{cond}^n $)
[out]tpartemperature imposed at the cold wall as constant or variable in time with a 1D thermal model