In 2D, the important parameter in this routine is Param, which is a parametrized/scaled length of each boundary in the domain. For example, consider the rectangular domain , then the (x,y) coordinated values can be obtained from Param as described in Figure .
1cm
|
Note that the routine for imposing boundary values in 3D will be
and thus, the
coordinate values are input values so no need to calculate.
Imposing the boundary condition and boundary values for Navier-Stokes problems is similar as above, but needs to be imposed for every component of the velocity vector.
All data (diffusion
, convection
in 2D, reaction
, source
) of the problem can be set by using the below routine, which will be called from the assemble routine for every cell in the mesh.
Here, n_points is the number of quadrature points in the cell, x[], y[], z[] are the quadrature points in the cell. Further, the input values coeff[0],..., coeff[4] are
,
,
,
and
, respectively, need to be given for every quadrature point in the cell.
Example 1: Considered a stationary convection diffusion equation with Dirichlet boundary condition, that is,
in | ||
on |