Week 1: Channel flow simulation using CONVERGE CFD
Aim:To simulate the flow of air through a channel using converge CFD.
Introduction:
Channel flow:
Flows in conduits or channels are of interest in science, engineering, and everyday life.
There are two type of flow through conduits.
- Open-channel flow: rivers, tidal currents, irrigation canals, or sheets of water running across the ground surface after a rain.
- Closed-channel flow: pipe flow, Flow of air through the duct, closed rectangular channel.
Laminar flow:
laminar flow is characterized by fluid particles following smooth paths in layers, with each layer moving smoothly past the adjacent layers with little or no mixing. In laminar flow, the motion of the particles of the fluid is very orderly with particles close to a solid surface moving in straight lines parallel to that surface.
PISO:
PISO stands for Pressure Implicit with Splitting of Operator. This is used for both steady and transient state problems. PISO is similar to the SIMPLE whereas SIMPLE uses 1 corrector step and PISO uses 2 or more corrector steps. This algorithm allows larger time steps without affecting the stability of the solution.
SIMPLE:
SIMPLE stands for Semi Implicit Method for Pressure Linked Equation. This algorithm is only used for steady-state problems. This method works on the pressure correction method. In the first step where the pressure is guessed and termed as the predictor step and the next step where the corrections are applied is termed as the corrector step. In the SIMPLE algorithm, there is 1 predictor and corrector step in each iteration.
Case Setup:
1.Create the Geometry and boundaries
Go to geometry editing toolbox > create > shape > box and enter the values of center and dimensions of dx, dy, and dz to create the geometry.


now in the geometry toolbox select boundary > flag > select + icon.
A new window named boundary definition will appear and create the number of boundaries we require and click apply. Assign the boundaries to the 6 faces of the channel(each face contains 2 triangles) and rename the boundaries as inlet, outlet, top-bottom walls, front 2D, and back 2D.

2. Check the orientation of normals:
Enable the normals by clicking the normal toggle icon which is located on the bottom side in the left panel. Actually, the normals should be pointed towards the flow of fluid or air in the channel but here the normals are pointed reversed as shown in the below figure.To avoid this select any triangle on the face whose normal is pointed away from the flow and select transform in the geometry toolbox > normal > click on propagate change from single triangle and press apply.


3. Run the diagnosis, for geometry errors
Click on diagnosis which is located on the right side of the panel. If all the parameters are having a green tick mark then there are no errors in the geometry.

4. Go to case setup:
The case setup tab is located beside the diagnosis tab on the right side of the panel.
Application type:
Select application type > Time-based > apply.

Select the application type as time-based and select apply and done.
Physical models
Select physical models and disable turbulence modelling then press apply and done.

Materials
Select materials and unselect the checkbox reaction mechanism as we are not simulating any reactions then select the predefined mixture as air then click apply and done.

i. Gas simulation:
ii. Global Transport properties:
iii. Species:

Simulation Parameters:
i. Run parameters: Here we are using a steady state solver. And full hydrodynamic because it generates mesh. Coming to misc. untick the shared memory and when we use steady-state solver tick the steady-state monitor.


Steady-State monitor

Simulation time parameters

Solver parameters: The value for the maximum convection CFL limit should be less than one.



Initial conditions and events:

The regions are created and air is added as species and mass fractions are changed to O2 as 0.77 and N2 as 0.23.
Boundary conditions
Inlet:

For inlet, set the pressure boundary condition as specified value of 100001 pa and select air for species boundary conditions.
Outlet:

Set the outlet pressure boundary conditions as specified value of 100000 pa and for species backflow select air.
Top and bottom:

Select the top and bottom boundary as wall type with no slip boundary conditions. And the temperature as specified values of 300k.
Front and back:


The boundary type is selected as 2d.
Steady state monitor

The monitor variables are added and the minimum number of cycles, monitor start delay and sample sizes are defined.
- Base grid
The three different base grids are defined for three different cases and press ok.
Grid Control: For meshing, we have to mention the values of dx, dy, and dz in the base grid size > click ok. Here in the challenge, we have 3 different mesh grid sizes as 2e-4, 1.5e-4, and 1.2e-4

Output/post-processing:
i. Post variable selection: Comming to the combustion/turbulence just untick all turbulence.


Output files:

By the end, the case setup should look like this which is shown below:

Export all input files into a folder:
Click on files > Export > Export input files > choose the path and select all files and press ok.


Copy and paste the mpiexec.exe file, converge file to the folder in which the input files are exported: The mpiexec.exe file is located at drive c > program files > Convergent_Science > CONVERGE > 3.0.16 > bin > mpi > intel64 > bin. The converge file is located at drive c > program files > Convergent_Science > CONVERGE > 3.0.16 > bin > intelmpi.

To run the simulation, open Cygwin:
Open Cygwin and navigate to the folder in which the input files are exported and run the command as mpiexec.exe -n 4 converge.exe restricted then press enter the simulation will run automatically.

Post-convert all the output files:
Copy the post_convert_30_msmpi_64.exe file and paste it into the output folder. Now open Cygwin and go to the output folder and type mpiexec.exe -n 4 post_convert_30_msmpi_64.exe > enter the case name > select file type as Paraview VTK in-line binary format > type all for files and cell variables and click enter.
ls


Post-processing the files:
Lanch paraview and open it then open the file location as case1 which is saved in output > case1 .. vtm (this is a group file which is formed during post-converting the files) > click on apply > create a slice along the z-axis.
Grid:
The following three meshes are used for simulations:
Mesh 1: Grid size: dx=2e-4m, dy=2e-4m and dz=2e-4m

Mesh 2: Grid size: dx=1.5e-4m, dy=1.5e-4m and dz=1.5e-4m

Mesh 3: Grid size: dx=1.2e-4m, dy=1.2e-4m and dz=1.2e-4m

Results:
Velocity contour
Velocity contours are plotted for all three meshes.
Mesh 1: Grid size: dx=2e-4m, dy=2e-4m and dz=2e-4m

Mesh 2: Grid size: dx=1.5e-4m, dy=1.5e-4m and dz=1.5e-4m

Mesh 3: Grid size: dx=1.2e-4m, dy=1.2e-4m and dz=1.2e-4m

Velocity profile at the outlet
Velocity profile at the outlet is plotted for all three meshes.
Mesh 1: Grid size: dx=2e-4m, dy=2e-4m and dz=2e-4m

Mesh 2: Grid size: dx=1.5e-4m, dy=1.5e-4m and dz=1.5e-4m

Mesh 3: Grid size: dx=1.2e-4m, dy=1.2e-4m and dz=1.2e-4m

Pressure contours
Pressure contours are plotted for all three meshes.
Mesh 1: Grid size: dx=2e-4m, dy=2e-4m and dz=2e-4m

Mesh 2: Grid size: dx=1.5e-4m, dy=1.5e-4m and dz=1.5e-4m

Mesh 3: Grid size: dx=1.2e-4m, dy=1.2e-4m and dz=1.2e-4m

Average velocity vs simulation cycles
Average velocity at inlet and outlet is plotted over simulation cycles, for all three meshes.
Mesh 1: Grid size: dx=2e-4m, dy=2e-4m and dz=2e-4m

Mesh 2: Grid size: dx=1.5e-4m, dy=1.5e-4m and dz=1.5e-4m

Mesh 3: Grid size: dx=1.2e-4m, dy=1.2e-4m and dz=1.2e-4m

Static pressure vs simulation cycles
Static pressure at inlet and outlet is plotted over simulation cycles, for all three meshes.
Mesh 1: Grid size: dx=2e-4m, dy=2e-4m and dz=2e-4m

Mesh 2: Grid size: dx=1.5e-4m, dy=1.5e-4m and dz=1.5e-4m

Mesh 3: Grid size: dx=1.2e-4m, dy=1.2e-4m and dz=1.2e-4m

Mass flow rate vs simulation cycles
Mass flow rate at inlet and outlet is plotted over simulation cycles, for all three meshes.
Mesh 1: Grid size: dx=2e-4m, dy=2e-4m and dz=2e-4m

Mesh 2: Grid size: dx=1.5e-4m, dy=1.5e-4m and dz=1.5e-4m

Mesh 3: Grid size: dx=1.2e-4m, dy=1.2e-4m and dz=1.2e-4m

Discussion
It is evident that for all three meshes the mass flow rate is conserved.
Cell count ranks
Cell count ranks are plotted over simulation cycles, for all three meshes.
Mesh 1: Grid size: dx=2e-4m, dy=2e-4m and dz=2e-4m

Mesh 2: Grid size: dx=1.5e-4m, dy=1.5e-4m and dz=1.5e-4m

Mesh 3: Grid size: dx=1.2e-4m, dy=1.2e-4m and dz=1.2e-4m

Animation:
The animation attached below shows the development of velocity contours over simulation cycles, for Mesh 1.
Flow develops in the channel due to the imposed pressure gradient between inlet and outlet boundaries. The fluid enters through the inlet with a uniform velocity but as it moves downstream, due to its interaction with the wall, the fluid layers closer to the wall slow down wheras the fluid layers away from it (wall) move faster in order to conserve the mass flow rate. This ultimately results in the fully developed parabolic velocity profile, which remains constant along the flow.
Conclusions:
i. All three meshes are able to capture the parabolic velocity profile at the outlet.
ii. Simulation performed using Mesh 3 takes the longest time to complete.
iii. The velocity profile is smoothest for Mesh 3 as it has the highest number of mesh points.