programmer's documentation
Functions/Subroutines
cs_user_head_losses.f90 File Reference

Define Head losses. More...

Functions/Subroutines

subroutine cs_user_head_losses (ncepdp, iappel, icepdc, izcpdc, dt, ckupdc)
 

Detailed Description

Define Head losses.

The subroutine cs_user_head_losses is called at three different stages in the code (iappel = 1, 2 or 3)

iappel = 1: Calculation of the number of cells where a head loss term is imposed: ncepdp Called once at the beginning of the calculation

iappel = 2 Identification of the cells where a head loss term is imposed: array icepdc(ncepdc) Called once at the beginning of the calculation

iappel = 3 Calculation of the values of the head loss term Called at each time step

Note that calling this subroutine completely overwrites head losses defined using the GUI.

ckupdc is the local head loss term

It appears on the momentum as follows: rho du/dt = - grad p + head_loss (+ other terms) with head_loss = - rho ckupdc u (in kg/(m2 s2))

For a distributed head loss,

let ksil = dhl/(0.5 rho u**2) given by the litterature (dhl is the head loss per unit length)

the source term tspdc is equal to dhl = - ksil *(0.5 rho u**2)

we have ckupdc = 0.5 ksil abs(U)

For a singular head loss,

let ksil = dhs/(0.5 rho u**2) given by the litterature (dhs is the singular head loss)

the source term tspdc is equal to dhs/L = - ksil/L *(0.5 rho u**2)

we have ckupdc = 0.5 ksil/L abs(u)

where L is the length over which we have chosen to represent the singular head loss

Cells identification

Cells may be identified using the 'getcel' subroutine. The syntax of this subroutine is described in the 'cs_user_boundary_conditions' subroutine, but a more thorough description can be found in the user guide.

Function/Subroutine Documentation

subroutine cs_user_head_losses ( integer  ncepdp,
integer  iappel,
integer, dimension(ncepdp)  icepdc,
integer, dimension(ncel)  izcpdc,
double precision, dimension(ncelet)  dt,
double precision, dimension(ncepdp,6)  ckupdc 
)
Parameters
[in]ncepdpnumber of cells with head loss
[in]iappelstage in the code
[in]icepdcnumbers of ncepdp cells with head loss
[in]izcpdccells zone for head loss definition
[in]dttime step (per cell)
[in]ckupdcwork array for head loss