## Non uniform inlet profil with codedFixedValue

## The codedFixedValue boundary condition

The boundary condition code is located in:

## The structure of the boundary condition

The setting of the boundary condition is done as follows:

## A concrete example !

To illustrate the possibilities offered by the use of * codedFixedValue* we will study the case of the flow, in laminar regime (\(R_{e}=500\)), in a bend. In this case study, we want to impose a fully developed velocity profile. The analytical expression of the profile, in laminar regime (obtained after solving the Navier-Stokes equation under simplifying assumptions) is as follows:

#### \(U(r) = U_{max}(1-\frac{r}{R})^2\)

The pipe radius \(R\) is 24 mm and the bulk velocity \(U_{max}\) is 0.0105 m/s. The figures below show the geometry of the elbow and the mesh composed of 430,000 cells generated with snappyHexMesh (volume refinement at the elbow area, refinement with a distance mode for the wall patch and insertion of 5 boundary layer elements ).

__Bend geometry (left) and mesh (right)__

The circular input patch (in red) in the figure is centered in x = 0, y = 0.1344 m and z = 0. This offset must be taken into account in the calculation of the radius. The implementation of the* codedFixedValue* boundary condition and its visualization under Paraview are shown in the figure below:

__CodedFixedValue (left) and code visualization under paraview (right)
__

The calculation is performed (4 cores) with the * simpleFoam* incompressible solver and converges in 500 iterations. The converged velocity field is shown in the following figure: