The preferred method for defining boundary conditions (besides using the GUI) is to assign zone-based definitions in the cs_user_boundary_conditions_setup function (cs_user_boundary_conditions.c).
As an alternative, the same definitions may be defined in cs_user_finalize_setup_wrapper (cs_user_parameters), which is called immediately after cs_user_boundary_conditions_setup. Choosing one or the other should be based on the best balance for reability and maintainability,
The following initialization block needs to be added for the following examples:
In the body, we may define several boundary conditions. Here are a few examples.
Assign an inlet to boundary faces of in zone 'inlet_1'.
Set a a Dirichlet value on the three components of on the faces with the selection criterion '2 and x < 0.01' and set a Dirichlet to all the scalars
.
Turbulence example computed using equations valid for a pipe.
We will be careful to specify a hydraulic diameter adapted to the current inlet.
We will also be careful if necessary to use a more precise formula for the dynamic viscosity use in the calculation of the Reynolds number (especially if it is variable, it may be useful to take the law from cs_user_physical_properties. Here, we use by default the 'viscl0" value.
Regarding the density, we have access to its value at boundary faces (b_roh) so this value is the one used here (specifically, it is consistent with the processing in cs_user_physical_properties, in case of variable density).
Assign an inlet to boundary faces of zone 'inlet_2'.
Set a a Dirichlet value on the three components of on the faces with the selection criterion '3' and set a Dirichlet to all the scalars
.
Turbulence example computed using turbulence intensity data.
We will be careful to specify a hydraulic diameter adapted to the current inlet.
Calculation of and
at the inlet (xkent and xeent) using the turbulence intensity and standard laws for a circular pipe (their initialization is not needed here but is good practice)
Outlet:
Assign a wall to boundary faces of zone '5'.
Wall:
Assign a rough wall to boundary faces of zone '7'.
Wall:
Assign a symmetry condition to boundary faces of zone '4'