8.0
general documentation
cs_user_wall_condensation.c File Reference

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

#include "cs_defs.h"
#include <assert.h>
#include <math.h>
#include "cs_headers.h"
+ Include dependency graph for cs_user_wall_condensation.c:

Functions

void cs_user_wall_condensation (int nvar, int nscal, int iappel)
 Source terms associated at the boundary faces and the neighboring cells with surface condensation. More...
 

Detailed Description

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

Function Documentation

◆ cs_user_wall_condensation()

void cs_user_wall_condensation ( int  nvar,
int  nscal,
int  iappel 
)

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

This function 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 empirical law to be imposed at the boundary face where the condensation phenomenon occurs.

This user function 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

  • 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.
Parameters
[in]nvartotal number of variables
[in]nscaltotal number of scalars
[in]iappelindicates which at which stage the routine is