The following initialization block needs to be added for the following examples:
allocate(lstelt(nfabor)) ! temporary array for boundary faces selection
call field_get_val_s(ibrom, bfpro_rom)
Ad the end of the subroutine, it is recommended to deallocate the work array:
deallocate(lstelt) ! temporary array for boundary faces selection
In theory Fortran 95 deallocates locally-allocated arrays automatically, but deallocating arrays in a symmetric manner to their allocation is good practice, and it avoids using a different logic for C and Fortran.
Body
In the body, we may define several boundary conditions. Here are a few examples.
Inlet example with hydraulic diameter
Assign an inlet to boundary faces of group '2' and x < 0.01.
Warning
the <, <=, >, and >= operators may only be used with variables x, y, and z. This syntax is not a full equation interpreter, so formulas involving x, y, or z are not allowed.
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 usphyv. Here, we use by default the 'viscl0" value.
Regarding the density, we have access to its value at boundary faces (romb) so this value is the one used here (specifically, it is consistent with the processing in usphyv, in case of variable density).
Build the list of boundary faces matching a criteria string.
Definition cs_selector_f2c.f90:111
Inlet example with turbulence intensity
Assign an inlet to boundary faces of group '3'.
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)