My Project
programmer's documentation
Functions/Subroutines
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:

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
iappel = 2
iappel = 3

specific variables to define with is user subroutine

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