Visualize 2D Flow Simulation Through A Rectangular Channel Duct For 3 Distinct Mesh Grid Size Using Converge CFD & ParaView
Aim:- The work is focused on simulating fluid flow through a backward-facing step channel that will be designed using the various geometric editing tools available in Converge Studio. Air is considered as the working fluid. Boundary flagging technique is used to assign each side of the geometry to a particular boundary & these boundaries will later be assigned to a volumetric region. Next, we set up the simulation parameters using a steady-state solver. Once the setup is complete, we export these inputs files generated by Converge CFD & run it using CYGWIN to generate 3D post output files. These 3D output files are first converted into either Paraview vtk inline binary format or EnSite format for Paraview to read & generate the flow field simulation. Through this simulation, we will be able to observe flow separation at different locations of the channel, variations in mass flow rate, pressure, velocity & number of cells generated for 3 distinct mesh grid sizes. The 3 different base mesh sizes that we will be used are:
Case 1: dx = 2e-4m, dy = 2e-4m, dz = 2e-4m ;
Case 2: dx = 1.5e-4m, dy = 1.5e-4m, dz = 1.5e-4m;
Case 3: dx = 1.0e-4m, dy = 1.0e-4m, dz = 1.0e-4m.
Objective
To perform CFD simulation of fluid flow inside a channel duct of dimension dx=0.1, dy=0.01, dz=0.01 for 3 distinct mesh grid size. Generate velocity & pressure contours for all 3-grid size mesh. Show mesh (i.e. surface with edges) for the 3 base mesh sizes. Plot graphs for velocity, pressure, mass flow rate, and total cell count for all 3 base mesh sizes.
GOVERNING EQUATIONS
The solution for a CFD simulation is obtained by solving the Navier-Stokes (NS) equations. The NS equations comprise of 5 equations, namely the continuity, momentum (3 equations), and energy equations. The continuity and momentum equations are solved for all flow problems with the energy equation being optional and can be used only when heat transfer is taking place to save computation time. For our purpose, we will be assuming that there is no heat transfer and that the temperature is constant, leaving us with 4 equations now, the continuity, and 3 momentum equations, one for each axis direction.
An important property of Converge is that any geometry created or exported is assumed to be made of triangles. In boundary flagging, we group these triangles to a particular ‘Boundary’ & assign these boundaries to a ‘Volumetric region’. Defining these boundary conditions is a fundamental step in any CFD simulation as this helps solve the NS equations. Converge creates and exports ‘input’ file of these complex governing equations which is then solved by CYGWIN for running the simulation.
1. Creating a 3D Rectangular Channel Duct
We start by creating a 3D geometric figure (Fig-1.1) of a channel of dimensions dx=0.1, dy=0.01, dz=0.01 along the x, y & z-direction of the coordinate system by using the geometric tools available from geometry dock.
Fig 1.1:- Rectangular Channel Duct
Having built the geometry, a diagnostic test is conducted to check for any anomaly like intersection errors, nonmanifold problems, open edges, etc within the geometry contour (Fig-1.2). If no errors, which is denoted by “green checks”, then we proceed to check the “Normal’s”.
Fig 1.1.1:- Geometry Dimensions Fig 1.2:- Diagnosis Check
Every geometry will have a normal vector which is perpendicular to the geometry, for this problem we use the “Normal Toggle” option to check for the direction of the normal. If normals are pointing outside of the geometry, then it's essential to transform the normal’s to point inside the geometry, where the fluid flow will occur as shown in Fig 1.3.1 & Fig 1.3.2.
Fig 1.3.1:- Normals pointing in the opposite direction of fluid flow
Fig 1.3.2:- Normals pointing inside the geometry
In Converge, all the surface information is stored in the form of 3 entities vertices, edges & triangles. Therefore, any geometry created or exported from other CAD software into converge are converted into triangles & that is the fundamental entity in converge, where every part of the geometry is assumed to be a triangle. The process of grouping these triangles into boundaries is known as boundary flagging. Each boundary is assigned with a distinct ID as shown in (Fig 1.4). For our geometry, we have 5 distinct surfaces Inlet, Outlet, Top&Bottom, Front2D, Back2D.
Fig 1.4:- Geometry Flagging
2. Case Setup
Having created the geometry, the next stage of the process is to set up the simulation parameters. This step involves specifying certain properties to capture the physics of the problem perfectly, such as materials used, simulation time parameters, solver parameters, initial & boundary conditions to solve the Navier Stokes equation which are PDE’s, defining body forces, type of fluid flow, species involved & grid size of the mesh.
We start setting up the time-based general flow simulation by first defining the Materials involved in the simulation. Since we are simulation fluid (air) flow inside a channel we choose ‘gas simulation’ and our choice of fluid for this project is ‘air’, hence we choose that as our pre-defined mixture. For gas simulation parameters we will be using the Redlich-Kwong equation of state with a critical temperature of 133K & critical pressure of 3770000pa. For global transport parameters, we use the default values of ‘turbulent Prandtl number’ and ‘Schmidt number’ which is 0.90 & 0.78 respectively. Since the fluid flow is air our ‘species’ will be a mixture of Oxygen (O2) & Nitrogen (N2) with a chemical composition of 23% & 77% respectively.
The next parameter for our case setup is the Simulation Parameters, which include the ‘run parameters’, ‘simulation time parameters’ & the ‘solver parameters’. For the channel flow problem, we will be running compressible gas flow using Steady-state solver at full hydrodynamics simulation mode, since our geometry is simple & has no moving. In addition to this, we will be using ‘density-based’ PISO Navier strokes solver. As for simulation time parameters, we will be running the simulation for 15000 cycles with an initial & minimum time step as (1e-09).
As earlier, after designing the geometry, we grouped the triangles and assigned them to a particular boundary ID. Similarly, in Boundary Condition, we group the 5 boundaries & assign each of them to a volumetric region. To do so we add a volumetric region from Initial Conditions & Events & assign the volumetric region (Region 0) to each of the boundaries. These volumetric regions are required to set up the initial conditions for solving PDE's. Initial conditions are assigned at the volume whereas boundary conditions are given at boundaries. The Inlet & Outlet boundaries are inflow & outflow boundaries respectively, Front 2D & Back 2D are a 2D boundary, Top & Bottom boundaries are stationary walls with no-slip conditions.
At the inlet boundary of the geometry, we defined a total pressure of 100001 Pa & a temperature of 300K. At the outlet boundary of the geometry, we defined a total pressure of 100000 pa & temperature of 300K.
The final parameter that we need to setup is defining the Mesh that is the Base grid size. For this particular challenge we will be comparing 3 distinct mesh grid sizes: dx = 2e-4m, dy = 2e-4m, dz = 2e-4m ; dx = 1.5e-4m, dy = 1.5e-4m, dz = 1.5e-4m; dx = 1.0e-4m, dy = 1.0e-4m, dz = 1.0e-4m.
3. Post Processing
The function of Converge studio is to set up the simulation & then create several input files which are then exported to a particular folder. To run these input files we use CYGWIN, a command-line interface that reads these inputs files & solves the complex PDEs of governing equation to generate several output files. These output files are then post-converted into 3D output files which are readable files for ParaView.
4. Results
Case 1:- Mesh Grid Size of dx = 2e-4m, dy = 2e-4m, dz = 2e-4m or 0.0002m
A. Mesh
B. Total Mesh Cells generated
C. Velocity Contour
D. Pressure Contour
E. Velocity Plot
F. Pressure plot
G. Mass Flow Rate at Inlet & Outlet
H. Fluid Flow Through Channel
Conclusion
For case1, with a mesh grid size of 0.0002m, the total number of cells formed for the entire geometry is 25000, which would be the lowest number of cells formed in the 3 cases as the mesh size is largest. The smaller the mesh grid size the larger number of cells would be generated. The velocity contour shows that the velocity is lower around the walls of the geometry where it experiences surface wall friction & maximum in the channel hollow duct region. Pressure contour of the channel indicates that the pressure at the inlet is maximum & minimum at the aft of the geometry i.e. air enters the channel at high pressure & exits at low pressure. The shape of the velocity curve across any given section depends upon whether the flow is laminar or turbulent. Since, in this case, the flow is laminar we observe a parabolic velocity profile with the maximum velocity at the center of the curve. The velocity profile also largely depends upon the surface wall of the channel. The mass-flow-rate plot at inlet & outlet appears to have converged following the mass conservation equation i.e. the discharge rate at inlet equals the discharge rate at the outlet.
Case 2:- Mesh Grid Size of dx =1.5e-4m, dy = 1.5e-4m, dz = 1.5e-4 or 0.00015m
A. Mesh
B. Total Mesh Cells Generated
C. Velocity Contour
D. Pressure Contour
E. Velocity Plot (Plot over line)
F. Pressure Plot (plot over line)
G. Mass Flow Rate at Inlet & Outlet
Conclusion
For case2, with a mesh grid size of 0.00015m, the total number of cells formed for the entire geometry is 25000, which means case2 has generated more mesh than case1. This indicates that the smaller the mesh grid size the larger number of cells would be generated. The velocity contour shows that the velocity is lower around the walls of the geometry where it experiences surface wall friction & maximum in the channel hollow duct region. Pressure contour of the channel indicates that the pressure at the inlet is maximum & minimum at the aft of the geometry i.e. air enters the channel at high pressure & exits at low pressure. The shape of the velocity curve across any given section depends upon whether the flow is laminar or turbulent. Since, in this case, the flow is laminar we observe a parabolic velocity profile with the maximum velocity at the center of the curve. The velocity profile also largely depends upon the surface wall of the channel. The mass-flow-rate plot at inlet & outlet appears to have converged following the mass conservation equation i.e. the discharge rate at inlet equals the discharge rate at the outlet.
Case 3:- Mesh Grid Size of dx = 1.0e-4m, dy = 1.0e-4m, dz = 1.0e-4m or 0.0001m
A. Mesh
B. Total Cells Generated
C. Velocity Contour
D. Pressure Contour
E. Velocity Plot (Plot over line)
F. Pressure Plot (Plot over line)
G. Fluid flow through a channel
Conclusion
For case3, with a mesh grid size of 0.0001m, the total number of cells formed for the entire geometry is 100000, which would be the highest number of cells formed in the 3 cases as the mesh size is smallest. The larger the mesh grid size the larger number of cells would be generated. Due to the small mesh size, we will get finer pressure & velocity plots. The velocity contour shows that the velocity is lower around the walls of the geometry where it experiences surface wall friction & maximum in the channel hollow duct region. Pressure contour of the channel indicates that the pressure at the inlet is maximum & minimum at the aft of the geometry i.e. air enters the channel at high pressure & exits at low pressure. The shape of the velocity curve across any given section depends upon whether the flow is laminar or turbulent. Since, in this case, the flow is laminar we observe a parabolic velocity profile with the maximum velocity at the center of the curve. The velocity profile also largely depends upon the surface wall of the channel. The mass-flow-rate plot at inlet & outlet appears to have converged following the mass conservation equation i.e. the discharge rate at inlet equals the discharge rate at the outlet.