** The created CFD domain is now read into the CFD package of interest to setup the CFD simulation. It should be noted that the current tutorial has a significant difference compared to other available CFD tutorials online! This tutorial is structured and developed based on a generic and methodological approach to set up a CFD simulation. The first principals and reasonings for each setting is discussed at each step. Potential alterations and modifications to perform similar analysis for different flow conditions are also addressed and discussed. Hence, in the end user will have the capability of applying potential modifications, improvements or extending the application of the current CFD simulation to a more complex problem of interest, rather than having a one time successful run of a specific simulation with specific and strictly pre-defined boundary conditions. **
In simple words: Current tutorial teaches users to fish, rather than giving them a fish.
According to the physics of the flow field user will select required model/s to simulate the flow.
User will define the physical and thermodynamical properties of the working fluid/s and solid/s in the problem.
Solving the governing equations of the flow (i.e. system of partial differential equations) requires well-defined boundary conditions within the CFD domain. These conditions are selected and defined in this step.
In CFD simulations the governing equations of the flow are solve numerically. Based on the physics of the problem appropriate numerical schemes and solution methods are selected at this step.
In the following section the details for the above four steps to setup a CFD simulation of 2D Laminar Flow in a Circular Pipe are explained in great details. It should be noted that the path for defining conditions and other settings are provided in command line
format. Users can access exact same settings and options by following the provided path via the tree of progress or pull down menu in STAR CCM+. The summary of the steps to take for CFD simulation setup for problem of 2D laminar flow over a flat plate are as follows:
<span style=style="background-color:lightgrey;">Continua\Physics 1\Models\ [double click]
<span style=style="background-color:lightgrey;">Continua\Physics 1\Models\Liquid\ [double click]
<span style=style="background-color:lightgrey;">fluid\Regions\Boundaries\ [double click]
<span style=style="background-color:lightgrey;">fluid\Regions\Initial Conditions\ [double click]
<span style=style="background-color:lightgrey;">Solvers\ [double click]
<span style=style="background-color:lightgrey;">Solution/Initialize Solution
<span style=style="background-color:lightgrey;">Solution/Run
Following is the step-by-step explanation for each of the above command/setting procedure:
1. Setup Model/s:
Once the CFD domain is imported into the STAR-CCM+ solver via <span style=style="background-color:lightgrey;">File\import\Import Volume Mesh Files command, the required models to perform CFD simulation can be set inside the <span style=style="background-color:lightgrey;">Continua folder using <span style=style="background-color:lightgrey;">Continua\Physics 1\Models\ [double click] pathway. This opens a new window, where the desired models to perform the CFD simulation can be selected. It should be noted that once users select each model the other relative and required models will become available in this windows for users to choose from. The required models for the current case study as they become available after clicking on each option are as follows:
<span style=style="background-color:lightgrey;">Space: In this problem the main assumption is that the computational domain a three-dimensional circular pipe. Therefor, the problem is defined to be <span style=style="background-color:lightgrey;">Three dimensional.
<span style=style="background-color:lightgrey;">Time: The other main assumption in the problem of flow in a circular pipe is that the free stream flow is uniform and steady. Furthermore, for flow fields where the Reynolds number, based on channel hydraulic diameter, is less than $2300$ the flow field evolution within the CFD domain is steady too. Therefore, the <span style=style="background-color:lightgrey;">Steady model is chosen to develop the CFD simulation. In cases where the flow field's Reynolds number, based on channel hydraulic diameter, goes beyond the critical value of $2300$, flow evolution or it's other properties start to rapidly change with respect to time within the CFD domain. Hence, to capture the flow field behavior in these case studies the Unsteady model should be chosen.
<span style=style="background-color:lightgrey;">Material: In this problem the working fluid will be set to Air. Thus, it is recommended to choose <span style=style="background-color:lightgrey;">Gas as the defined material. If the users are not obligated with the choice of the working fluid type, it is recommended to choose <span style=style="background-color:lightgrey;">Liquid as the defined material and set it's properties later to match the most important groups of non-dimensional variables within the flow field (e.g. Reynolds number).
<span style=style="background-color:lightgrey;">Flow: The model to simulate the flow should be selected at this step. The flow for current case study is assumed to be incompressible (i.e. Ma # < 0.3), therefore pressure and velocity field are the two variables to solve for. Hence <span style=style="background-color:lightgrey;">Segregated Flow is the recommended model in which the pressure and velocity field will be found separately by solving the flow field governing equations numerically. In cases that the speed of the flow enters sonic and supersonic regimes ( Ma # > 0.3 ), the changes in pressure and density of the flow will be significantly important factor and users should pick the Coupled Flow model.
<span style=style="background-color:lightgrey;">Equation of State: In this problem we are considering that the flow is in subsonic regime. Therefore, variation of density with respect to the pressure can be neglected. As a result of this assumption one can define the working fluid to be incompressible and the <span style=style="background-color:lightgrey;">Constant Density option is chosen for the equation of state of this problem. In cases that the speed of the flow enters sonic and supersonic regimes ( Mach # > 0.3 ), the changes in density (i.e. compressibility) of the flow will be an important factor and users should pick the relevant model from this menu.
<span style=style="background-color:lightgrey;">Viscous Regime: In the current problem the focus is to investigate laminar flow behavior when a uniform flow moves inside a circular pipe. Therefore, the flow regime is laminar and the appropriate model for flow would be <span style=style="background-color:lightgrey;">Laminar. It is important to note that the critical Reynolds number (based on channel hydraulic cylinder) for the current case study is $2300$. In cases that this Reynolds number is grater than this critical value the chosen model will Turbulent and the desired closure model will be selected from the available options.
2. Setup Working Fluid/s & Solid/s:
During selection of the required models to setup the current CFD simulation the type of Material was selected as <span style=style="background-color:lightgrey;">Gas. After this selection an option becomes available under <span style=style="background-color:lightgrey;">\Continua\Physics 1\Models\Gas path, where the properties of the working fluid (i.e. Density and Viscosity) in CFD simulation can be set. The working fluid properties strongly depend on physics of the problem. In this case study Air is the working fluid, hence the default choice of Air under Gas material is appropriate for the current case study.
In the absence of obligations to define a specific working fluid such as air or water, it is suggested that the users define the working fluid such that the important non-dimensional groups of interest (e.g. Reynolds number) is matched the desired flow conditions. This strategy removes the uncertainties in the choice of the working fluid and will solidify the basis for expected physical observations.
Later on, the Reynolds number of the flow is set by setting values of flow inlet velocity according to the following formulation: The Reynolds number of the flow is defined as $Re = \frac{\rho U D_h}{\mu}$, where $D_h$ is the hydraulic diameter of the circular pipe and is estimated to be equal to the diameter of the circular pipe. Inserting the thermodynamic properties of Air, defined in solver, into the equation of flow field Reynolds number, users will have $Re ~ 6400 * U$. To match the desired Reynolds number within the flow, users can calculate the corresponding velocity $U$, which will be the streamwise velocity of the flow at the inlet. As seen here in most of the CFD packages, water or air is the pre-defined gas and liquid working fluid. Hence, users should modify the working fluid via this procedure to define a new material with unique physical and thermodynamical properties.
3. Setup Boundary and Zone Conditions:
In this problem the entire CFD domain is defined as one united <span style=style="background-color:lightgrey;">fluid accessible under the folder of <span style=style="background-color:lightgrey;">Regions. The <span style=style="background-color:lightgrey;">Regions\fluid\Boundaries path has the name of the boundary faces of the CFD domain. These names are assigned during the creation of CFD domain. The types of boundary and initial conditions for this CFD simulation are set in each sub-folder of this <span style=style="background-color:lightgrey;">fluid section. The steps to define these settings are as follows:
The flow enters the CFD domain from inlet face with constant and uniform velocity in streamwise direction (i.e x-direction). Users can assign the boundary condition to this face named inlet
by a double click on the name of the face and set the <span style=style="background-color:lightgrey;">Type to <span style=style="background-color:lightgrey;">Velocity Inlet and <span style=style="background-color:lightgrey;">Physics Conditions/Velocity Specification/Methods to <span style=style="background-color:lightgrey;">Components. As discussed earlier, in this study the working fluid within the domain is set to Air. As a result of this, the streamwise velocity magnitude will set the value of Reynolds number in the Flow according to the following formulation: The Reynolds number of the flow is defined as $Re = \frac{\rho U D_h}{\mu}$, where $D_h$ is the hydraulic diameter of the channel and is estimated to be $D$, $D$ being the diameter of the circular pipe which is $0.1 [m]$ as discussed in the CFD domain section. Inserting the thermodynamic properties of Air at standard conditions into the equation of flow field Reynolds number, users will have $Re = 6400 * U$. To match the desired Reynolds number within the flow, users can calculate the corresponding velocity $U$, which will be the streamwise velocity of the flow at the inlet. For case of Re=64, U=0.01. To setup velocity values users can use <span style=style="background-color:lightgrey;">Physics Values/Velocity/Values to <span style=style="background-color:lightgrey;">[0.01 , 0 , 0]. In cases where the incoming velocity into the CFD domain is not uniform and has different components, one can define the incoming velocity with the pre-defined directions or generate a user defined function to set the shape of the velocity profile.
The flow is bounded by the <span style=style="background-color:lightgrey;">walls faces on the surroundings of the CFD domain. Flow interacts with this unit boundary based on the no-slip wall boundary condition. User assigns the no-slip boundary condition to this face of the domain via a double click on the name of the face and set the <span style=style="background-color:lightgrey;">Type to <span style=style="background-color:lightgrey;">Wall and <span style=style="background-color:lightgrey;">Phyical Condition/Shear Stress Specification/Methods to <span style=style="background-color:lightgrey;">No-Slip. If the shear forces and formed boundary layer becomes turbulent at this surface user should either provide required mesh resolution to capture the phenomena or set the methods to slip condition such that the fluid elements would not interact with wall region. For low Reynolds number flow, similar to the current problem of interest, a reasonable mesh resolution is sufficient to capture the laminar boundary layer and effect of the forces over the wall boundary.
The flow can exit the CFD domain from the <span style=style="background-color:lightgrey;">outlet face and it's pressure will be equal to atmospheric pressure (i.e. zero gauge pressure). Users assign the boundary condition to this face of the CFD domain by a double click on the name of the face and set the <span style=style="background-color:lightgrey;">Type to <span style=style="background-color:lightgrey;">Pressure Outlet and the value of the pressure via <span style=style="background-color:lightgrey;">Physics Values/Pressure/Value to <span style=style="background-color:lightgrey;">0~[Pa] as the gauge pressure. If in the problem of interest, there exist a specific pressure difference between the inlet and outlet or other surfaces, that magnitude can be set in corresponding faces of the domain.
After setting the boundary conditions, initial conditions values should be set for the CFD simulations. These conditions can be thought as initial numerical guesses to start the iterative process of numerical simulation of the flow field. The path of <span style=style="background-color:lightgrey;">Regions/fluid/Physics Conditions/Initial Condition Option opens a window to set the Option
to define the initial condition. By default this Option
is to <span style=style="background-color:lightgrey;">Use Continuum Values. Changing this option to <span style=style="background-color:lightgrey;">Specify Region Values will open a folder called Initial Conditions
under the Region
tree where the initial values for Pressure and Velocity within the CFD domain can be set. For the current problem the initial values of <span style=style="background-color:lightgrey;">Pressure/[double click] and <span style=style="background-color:lightgrey;">Velocity/[double click] can be set to $0~[pa]$ and $0.01~[m/s]$ respectively. The basis for these values come from the flow field variables values at the inlet of the CFD domain. In majority of case studies initialization of the flow field using the values at the inlet of the domain is a good start point and would result into a smooth convergence trend. However, for more complex problems were the flow is unsteady or the simulation's computational time is high initialization of the CFD domain with previously developed time step solutions is a possibility that users can consider.
4. Setup Solution methods:
In this step, it is highly recommended to use the default options and settings for the <span style=style="background-color:lightgrey;">Solvers folder as it was pre-set based on the set options for the numerical models. Unless based on physics of the problem the user is aware of any specific choices. Furthermore upon non-smooth convergence and potential divergence of the CFD simulation user can modify and examine various solution methods. To modify the solution methods and controls users should look into available options under <span style=style="background-color:lightgrey;">Solvers folder.
Now all boundary conditions and settings for the CFD simulation are defined. User can initialize and then run the solution via the set initial conditions. This can be done via using the paths <span style=style="background-color:lightgrey;">Solution/Initialize Solution and <span style=style="background-color:lightgrey;">Solution/Run using the drop-down menus on top respectively. It is worth to mention that STAR-CCM+ lets it's users to visualize the evolution of flow field variables once the simulation is started to run. It order to enable this option users should use <span style=style="background-color:lightgrey;">Scenes/Scalar Scene 1/Displayers/Scalar 1/Scalar Field and choose the field of interest (e.g. Velocity in x-direction) to visualize it's evolution as the simulation converges on a define plane of interest. In this case study a plane was defined in the center of the circular pipe using the path of <span style=style="background-color:lightgrey;">Derived Parts/New Part/Isosurface. Following is the screen-shot of the converged simulation for case study of Re=64. Fig. 1 shows the tree-of-progress for simulation settings on left and sreatmwise velocity contours on right.
Fig. 1 - Screenshot of the STAR-CCM+ user interface with details for Simulation setup step on left (see the tree of progress) and converged flow field visualization via the velocity contours on right.