Channel flow simulation using CONVERGE CFD
AIM:
The aim of this project is to simulate a laminar 2d flow of air in a channel.
OBJECTIVES:
- Setup the case in Converge Studio 3.0 and run the simulation
- Post-process the output files and visualize them in Para View 5.9.1
- Extract the plots for velocity and pressure in Para view and save the animation for velocity.
- Extract the plots for velocity, pressure mass flowrate, and no of cells in converge at the inlet and outlet.
- The above plots need to be extracted for 3 different mesh sizes 2e-4,1.5e4,1e-4.
- Capture the mesh for the above sizes.
PROCEDURE:
SETTING UP THE CASE
We start with creating geometry in converge.
- As we open a new project, we go to toolbox on the left > Geometry > Create > Shape > Box.
- In the box dimensions we select the centre coordinates, dimensions of the box by inputting centre coordinates as X =0.05, y = 0, Z =0 and the dimensions as x = 0.1, y = 0.01, z = 0.01 and > Create.
- A channel will be created.
- Now we need to add the boundaries. For that we go Geometry > Boundaries > Flag > select the “green +”
- A new window will pop up select the create multiple boundaries option, make sure the number of boundaries to create is set to 5 and the starting boundary option is set to 1, and click ok.
- 5 boundaries will be shown, right-click on those boundaries to rename them as
Boundary 1 > “inlet” (select 2 triangles on the left)
Boundary 2 > “outlet” (select 2 triangles on the right)
Boundary 3 > “Top and bottom” (Select the two triangles on the top and two triangles on the bottom)
Boundary 4 > “Front 2d” (select the two triangles on the front)
Boundary 5 > “Back 2d” (select the two triangles on the back)
- Now left-click on a boundary name and select the triangles on the geometry to assign those triangles to the boundary. Repeat this process for all the 5 boundaries created.
- On the left side of the geometry tab, there are some icons. Click on the icon with a blue triangle with a yellow normal pointing outward. This will show the normal of each boundary on the geometry created. If these normal are facing outward they must point inward.
- To do so on the tool on the left there is another tab called Transform > Normal.
- In this tab make sure the propagate change from a single triangle is checked and click on any triangle on the geometry and click Apply. This will change the normal direction to inward.
- On the right side of the GUI, there is another toolbox. At the bottom of this toolbox, there are three tabs. Go to the diagnosis tab and with the default options click on find. This will generate a report if all the boxes shown above are checked green select clear.
- Go to the case setup tab and click Begin Case Setup.
- A new window will pop up (If it doesn’t click on application type) select Time based and click on apply and then done.
- Now on the right side, we can see many sections which is where we can setup the simulation.
- Click on the Physical Models section and uncheck the turbulence modelling > Apply and Done.
- Click on the Materials tab and select the predefined mixture as Air. Uncheck the reaction mechanism option and then check the species option and click Apply and done.
- A new message will pop up asking Do you really want to overwrite gas.dat, mech.dat, and therm.dat by loading predefined mixture as air? Click on yes.
- In the Gas simulation option with the default settings click apply and done
- Same for the global transport parameters with the default settings click on apply and done.
- On the Species click on add and type O2 and N2 and add them from the suggestions/manual entry.
- In the run parameters in the solver: select the steady-state solver to make sure the simulation mode is set to full hydrodynamic Gas flow solver: Compressible.
- In the miscellaneous tab uncheck the use shared memory option and check the steady-state monitor option. And click on ok.
- In the Simulation, time parameters enter the following values.
Start time: 0
End time: 15000 cycles
Initial time step: 1e-9
Minimum time step: 1e-9
Maximum time step: 1 click on ok.
- In the solver parameters section select the Density-based option and in the equations tab. On the left side click pressure and on the right side select the preconditioner to none. In the steady-state solver> control tab select the Mach number to 0.5 and click OK.
- Now before we go into the boundaries option click on regions and initialization. Click on add new region. Right-click on region 0 and rename it to the volumetric region (user-defined). On the left side near the species click on +Air and reverse the mass fractions of O2(set to 0.77) and N2(set to 0.23) click ok.
- Now in the boundaries tab assign the following to each boundary.
Inlet > inflow
Outlet > Outflow
Top and bottom > wall
Front 2d > TWO_D
Back 2d > TWO_D
- In the inlet, boundary select the pressure to “specified value” 100001 pa. Select the temperature to a specified value of 300 K and click on +Air in the species boundary condition.
- In the Outlet boundary select the pressure to “specified value” 100000 pa. and select the temperature to the specified value of 300K and click on +Air in the Species Backflow.
- In the Top and bottom boundary select the Temperature Boundary condition to a Specified value of 300 K. And the option next to UDF as No slip.
- Now set the regions in the left panel next to boundaries as Volumetric region User-defined.
- Now we go to Steady-state Monitor and Add config > Minimum number of cycles to be executed for steady-state solver: 5000, Monitor Units: cycles Monitor start delay, cycles: 200, Sample size: 100, In the left window double click the Monitor variables and select AVG_VELOCITY, Target type double click and select Boundary, Target as Outlet.
- Add two more variables and select TOTAL_PRESSURE, MASSFLOWRATE select the target type Boundary, Target as Outlet. Press OK.
- In the Grid Control > Base Grid > set the x, y, z sizes to 2e-4,1.5e-4,1e-4 for three different cases and click ok.
- In the Output/Post-processing section,> post variable selection > turnoff all the variables in the turbulence modelling tab. Also, in the species tab check the mass fraction tab and add N2, O2 and press ok.
- In the Output/Post-processing section > Output files,> writing time intervals tab > set the time interval for writing 3d output files to 100cycles this will make sure that the files are written for every 100 cycles thereby we have more data and more clear curves.
EXPORTING THE FILES
Now since the case is set, we need to run the simulation. Save this case file on the local computer and then go to the taskbar on the top left > file > export > export input files. We should see a total of 10files. The usual location is set to the same directory where the case file is saved. Set the location and export the files.
RUNNING THE SIMULATION
Open the Cygwin terminal as administrator and navigate to the location where the case files are stored using the cd command. Then we execute the following command.
mpiexec.exe -n 4 converge.exe restricted </dev/null> logfile.txt &
mpiexec.exe is the message passing interface executive file.
-n 4 represents the number of cores to be used for running the simulation.
converge.exe is the converge file that runs the simulation.
restricted limits the total number of cells to 5,00,000
</dev/null> logfile.txt is to create a log file that can be used to track the simulation.
& to not print output on the Cygwin terminal
We can know the status of the simulation by checking the task manager. Once the converge.exe has disappeared it means that the simulation has finished. We can also know the status of the simulation by using the command
tail -f logfile.txt
This will print the last ten lines of the logfile.txt on the Cygwin terminal. Once the simulation is complete, we need to post-process the output files.
POST-PROCESSING
We open converge > on the bottom left there are some options like postprocessing, lines, etc. We select the post-processing and that will take us to a new window. Here we select the location of the output file which is created in the same directory in which we stored the input files. Once the output file is selected a list appears in the window below the file location option > click on select all and the below the cell variables will be listed > click on select all. Above the file location option, there is space for naming the post-processed file we give a proper name (preferably without spaces/special characters). And then select the output format as “Paraview vtk inline binary”. Once we do this the click convert. And the files will be post-processed.
Once the post-processing is done open ParaView > open file select the output file location > select the converted file _..vtm – group file. This will load the results in ParaView. Click on apply to view the case we setup.
In the top panel select the surface with edges to view the mesh and we might see that with the mesh there are some diagonal lines visible on the mesh. This is because the triangle converge created. So, we create a slice of this geometry. This slice will have the normal in the Z direction. For this in the top panel in the bottom-most line of the top panel there is an option called slice we select that and then click on Z-normal and apply. This will create a slice of the geometry.
The mesh on the slice would look like this
2e-4 m

1.5e-4 m

1e-4 m

Now we use the plot over line option in the top panel to plot a line at the center of the geometry and then we get the following plots.
Pressure
2e-4 m

1.5e-4 m

1e-4 m

Velocity
2e-4 m

1.5e-4 m

1e-4 m

Velocity animation
2e-4 m
1.5e-4 m
1e-4 m
We can use some of the converge features to compare results. In converge on the bottom left beside the post-processing, there is another tab called line plotting. Upon clicking this it will take us into another window. Here we select the same location where we saved the case setup file. This is because the converge takes the .out files as the input upon selecting the file location some variables are displayed in the window below. We select the file as massflowrate.out. The x-axis will be cycles and on the y axis, we can select mass flowrate, Total pressure, Average velocity, and all the variables we selected in the steady-state monitor.
These are the graphs we generated using the converge line plotting module.
Pressure
2e-4 m

1.5e-4 m

1e-4 m

Velocity
2e-4 m

1.5e-4 m

1e-4 m

Mass Flow rate
2e-4 m

1.5e-4 m

1e-4 m

Total cell count
2e-4 m

1.5e-4 m

1e-4 m

CONCLUSION:
- On observing the above plots, we can say that the solution gets accurate as we keep decreasing the mesh size.
- The spike in solution at the initial cycles keeps decreasing as decrease the size of the mesh.
- Also, as we keep decreasing the mesh size the total cell count increases 2e-4 m -> 25000, 1.5e-4 m -> 45460, 1e-4 m -> 100000 due to this time required for computation increases.
- As we decrease the size of the mesh converge decrease the time step to maintain the courant number to keep the solution stable. Because of this the number of cycles required for convergence increases which is another factor for increased computation time.