The created CFD domain is now imported into the CFD package of interest to setup and then run 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 users 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.
1. Setup Model/s:
According to the physics of the flow field user will select required model/s to simulate the flow.
2. Setup Working Fluid/s & Solid/s:
User will define the physical and thermodynamical properties of the working fluid/s and solid/s in the problem.
3. Setup Boundary Conditions:
Solving the governing equations of the flow (i.e. system of partial differential equations) requires set of well-defined boundary conditions within the CFD domain. These conditions are selected and defined in this step.
4. Setup Solution Methods:
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-mentioned four steps, for the CFD simulation setup of 2D Laminar Flow Over a Flat plate in STAR-CCM+ are explained in great details. In this tutorial the paths for defining conditions and other settings are provided in command line format and when a double click is requires it is denoted by [double click] symbol. Users can easily access the noted settings and options by following the provided path and use clicks when necessary. The summary of the steps to take for CFD simulation setup for problem of 2D laminar flow over a flat plate are as follows:
Continua\Physics 1\Models\ [double clcik]
Continua\Physics 1\Models\Liquid\ [double clcik]
fluid\Regions\Boundaries\ [double clcik]
fluid\Regions\Initial Conditions\ [double clcik]
Solvers\ [double clcik]
Solution/Initialize Solution
Solution/Run
1. Setup Model/s:
Once the CFD domain is imported into the STAR-CCM+ solver, the required models to perform CFD simulation can be set inside the Continua folder using 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 of 2D laminar flow over a flat plate as they become available after clicking on each option are as follows:
Space: In this problem the main assumption is that the flat plate is finite in the third dimension and has unit depth length. Therefor, the problem is defined to be Two dimensional.
Time: The other main assumption in the classical problem of flow over a 2D flat plate is that the free stream flow is uniform and steady. Therefore, the Steady model is chosen to develop the CFD simulation. In cases where the flow properties rapidly changes with respect to time the adequate unsteady model should be chosen.
Material: Unless the users are obligated with the choice of the working fluid type, it is recommended to choose 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). The procedure to set the properties of the working fluid in STAR-CCM+ will be discussed shortly.
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 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.
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 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.
Viscous Regime: In the current problem the focus is to investigate laminar flow and boundary layer behavior when a uniform flow passes a flat plate. Therefore, the flow regime is laminar and the appropriate model for flow would be Laminar. It is important to note that the critical Reynolds number for flows over flat plate is about 1.24E+6. In cases that the Reynolds number, based on flat plate length, is grater than this critical value the chosen model will be 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 Liquid. After this selection an option becomes available under \Continua\Physics 1\Models\Liquid 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 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.
For the current case study the goal is to investigate the flow field with different Reynolds number in the laminar regime. To set material properties and match the Reynolds number of interest rename the predefined liquid material from H2O to Reynolds_100. Now set the Density to $100~[\frac{kg}{m^3}]$ and Dynamic Viscosity to be $1~[Pa-s]$. Based on the $1 [m]$ length of the flat plate and incoming flow velocity of $1~[\frac{m}{s}]$ the Reynolds number for this flow field will be equal to $Re=\frac{\rho V L}{\mu}=\frac{100 * 1 * 1}{1}=100$. As seen here in most of the CFD packages, water or air is the pre-defined 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 Initial Conditions:
In this problem the entire CFD domain is defined as one united fluid accessible under the folder of Regions. The types of boundary and initial conditions for this CFD simulation are set in each sub-folder of this fluid section. The staps to define these settings are as follows:
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 flow is bounded by the flat_plate face on the bottom of the CFD domain. Flow interacts with this boundary based on the no-slip condition. User assign the no-slip boundary condition to this face of the domain via double click on the name of the face and set the Type to Wall and Phyical Condition/Shear Stress Specification/Methods to No-Slip. If the shear forces and formed boundary layer becomes turbulent in this region user should either provide required mesh resolution to capture the phenomena or set the Methods to Slip such that 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 region.
The flow can exit the CFD domain from the outlet face or free surface face and it's pressure will be equal to atmospheric pressure (i.e. zero gauge pressure). Users assign the boundary condition to these two faces of the CFD domain by a double click on the name of the face and set the Type to Pressure Outlet and the value of the pressure via Physics Values/Pressure/Value to 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.
The flow enters the CFD domain from inlet face with constant and uniform velocity of $1 [\frac{m}{s}]$ in 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 Type to Velocity Inlet and Physics Conditions/Velocity Specification/Methods to Components. To setup velocity values users can use Physics Values/Velocity/Values to [1.0 , 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.
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 Regions/fluid/Physics Conditions\Initial Condition Option opens a window to set the initial values for Pressure and Velocity within the CFD domain. For the current problem the initial values of Pressure and Velocity can be set to $0~[pa]$ and $1~[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 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 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 Solution/Initialize Solution and 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 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. Following is the video of solution convergence for case study of Re=100:
In [4]:
from IPython.display import YouTubeVideo
YouTubeVideo("KvQ5YWku-ck")
Out[4]:
This is a unique approach to visualize the convergance trend of the flow field. More discussions will be provided about the convergance check and ceriteria in the post-process and validation section. A general rule of thumb for converged solution is to have continuity residuals of 10E-3. More details about commenting on validity of solution and convergence criteria will be discussed in next section.