My Project
programmer's documentation
|
It is useful to map a field array to a local pointer for a clear and concise access, such as done here fro the velocity:
Otherwise, the zone entries (see cs_volume_zone_t) should contain the necessary information with no additional preparation.
A volume zone may be defined using the GUI, or in the cs_user_zones user function (in cs_user_zones.c), such as the following zone determined by a geometric criterion:
Note that if the CS_VOLUME_ZONE_HEAD_LOSS flag is not set (or the matching type set through the GUI), calls to cs_user_head_losses will ignore this zone.
Note that in the following examples, we checku the zone name, so we know which zone we are dealing with using in case of multiple zones.
head loss tensor coefficients for each cell are organized as follows: cku11
, cku22
, cku33
, cku12
, cku13
, cku23
.
Coefficients are set to zero (then computed based on definitions provided through the GUI if this is the case) before calling this function, so setting values to zero is usually not necessary, unless we want to fully overwrite a GUI-based definition.
Note that diagonal coefficients must be positive; the calculation may crash if this is not the case.
Using the previously defined zone, we define head losses in direction x
Necessary, we shall use here a 3x3 tensor to impose head losses at an angle with respect to x and y direction of the computation frame. Namely, resistance is set along components x
by cku1
and y
by cku2
.
In the present example, it is chosen to set a head loss representing friction along X
and to model a vane in Y direction by setting ck1 = 0
.