![]() |
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
3x3 tensor: Example of head losses at alpha = 45 degres x,y direction x
resists by cku1
and y
by cku2
cku2 = 0
represents vanes as follows: in coordinate system x
, y