Fourth in a series of introductory articles on Simcenter STAR-CCM+ simulation. This article will cover physics continua and model selection, then solver setup and controls.
This is the fourth in a series of introductory articles to Simcenter STAR-CCM+ simulation. In this article, we will be discussing the physics setup and solver options to generate a solution.
Now that we have a volume mesh to work in, we need to define what the various sections are made of. Very often, one of the sections will be a fluid, and often a solid continuum is needed for modeling effects such as heat transfer. Multiple continua can be present in a simulation, interacting with each other.
A physics continuum.
Right click on the Continua > Physics > Models node and select “Choose models” to get started. You will be presented with a large variety of options to specify the conditions of your model. Note the button selected in the lower left-hand corner: “Auto-select recommended models.” This will pick additional models based on the high-level choices you make to ensure everything runs properly.
For each type of continuum in the simulation, you will need to create a physics setup accordingly. As you select your models, more options will appear and disappear to match the models you have already selected.
Spatial dimensions: this is set to 2D or 3D automatically if you have generated a volume mesh.
Time: Here we select whether this is a transient (unsteady) or steady state solution. Harmonic Balance can be chosen for rapid, periodic flows as discussed by Best Practices for Harmonic Balance The implicit and explicit unsteady options change how the flow equations are solved. What is the difference between implicit and explicit unsteady simulation approaches ? is a guide to choosing between them.
Material: whether the part is solid, liquid, gas or some combination of the three. Multiphase models solve for mixed flows of two or more states, and multi-component continua have several different materials of the same state in them.
Flow: Once the material is selected as anything but a solid, the flow solvers options will appear. Segregated and coupled flow solvers work with the equations differently, as discussed byShould I use the coupled or the segregated solver for my simulation?
Equation of State: With a flow solver selected, you can choose which equation of state will define the flow. Depending on the choices made above, various equation of state options will appear. Select one that most closely matches the physics of your case.
Viscous regime: In many cases, flow viscosity and turbulence cannot be neglected. Once a viscous model is selected, there will be several options for turbulence modeling. Selection of a turbulence model can be guided by What turbulence model should I use for my simulation?, and the Spotlight on... Turbulence
Optional models: Once all the prior models are selected, certain additional models can be selected to improve the accuracy of the flow and aid its convergence. Some models add effects like gravity, while others impact the solvers.
Physics model selection window.
The official documentation has a “Theory” folder in which you can learn about all the models and solvers Simcenter STAR-CCM+ offers. The section will guide you through the physics underlying the solver and when it might be applicable to use.
With the physics models selected, we can now turn our attention to the physics conditions within these continua. Under Continua > Physics > reference values you can override the references for the models you selected. Only options that affect your models will be available. Below this, under Continua > Physics > Initial Conditions you can set the values to initialize the flow field or solid mechanics within the continuum. Again, only values pertinent to your selected models will be available. It is important to initialize the flow to as close as possible to the final state, so the solver doesn’t have far to go to converge your simulation. This reduces the iterations needed to solve to convergence, which reduces the runtime of the simulation. In addition, the solution is likely to be more stable as it starts closer to the final stable solution.
Parts are to Geometry as Regions are to Continua. They are defined spatially by the geometry parts they are derived from and physically by the continuum they are assigned to. Right click a geometry part and select “Assign parts to regions” to set what parts become regions. Use the options at the bottom to make a region for each part or part surface as desired. Most boundaries for simple cases are either an inlet, outlet, symmetry plane or a wall.
Wall: A solid boundary, it does not allow flow propagation through it and will reflect waves back off itself. You can specify the physical properties based on the selected equation of state.
Inlet: There are several types of inlets each defined differently, but they all spawn fluid flow to enter the domain
Velocity inlet: You specify the velocity magnitude and direction at the inlet.
Mass flow inlet: Similar to the velocity inlet, but instead of specifying the velocity magnitude you specify the mass flow rate in, and the velocity is derived from there.
Stagnation inlet: This is useful in supersonic flows, and cases where pressure is known but velocity or flow rate are not. You specify Total and Supersonic Static Pressures along with the direction and turbulence. Supersonic static pressure is discussed in How do I prescribe the supersonic static pressure?
Outlet: There are several options for outlets:
Pressure Outlet: Defined by the pressure and backflow specification. The pressure should be lower than the flow upstream, so flow continues out of the volume.
Outlet: Specified by the mass flux out of the domain.
Free stream: Can be used along any boundary, it is defined as the far-field flow properties, and it is useful for external aerodynamics.
Symmetry Plane: Used for cases where only part needs to be simulated due to symmetry. This defines the cutoff, so a wall is not placed there instead.
Regions for an airflow simulation.
By specifying the boundary conditions, you set the physical parameters that constrain the solution. Poorly defined boundary conditions often cause poor or non-converged solutions. Ensure that the conditions you choose are physical and reasonable. Other boundary condition settings exist, including an option to model fan inlets and outlets.
After setting up the regions and initial/boundary conditions, we turn to fine-tuning the solvers themselves. Typically, if the prior steps have been completed successfully, the default solver settings will converge most simple cases. The larger a case becomes, however, the longer it will take to run and the higher the chances of it failing to converge. Each solver combination has its own options and techniques for convergence, but general tips may be found in How to control the numerical stability?
Additional convergence help can be found in My divergence proof simulation checklist and best practice This is a walkthrough down the simulation tree (similar to this one), clearing issues along the way that would affect convergence.
How to troubleshoot residuals that oscillate or converge to a high value also guides you through the main reasons a simulation would fail.
Additionally, under the Simcenter STAR-CCM+ > Simulating Physics > Flow and energy folder in the official documentation, there are discussions for both the coupled and segregated solvers’ best practices for setting the courant number, term relaxation and more.
The many varied use cases for Simcenter STAR-CCM+ each have their own set of best practices and appropriate solution setups. It is advised to check the documentation and search the Steve Portal for information before setting up a completely new type of simulation for these notes, so that common mistakes can be avoided.
Properly converging residuals.
It is important for your simulation to know when it should stop iterating. In a steady simulation the automatic criterion is the maximum number of iterations, in an unsteady simulation it is the number of outer and inner iterations and the physical time that has passed. It is possible to use a monitor to set your own criteria, by tracking the solution and stopping when a certain solution value is met (The desired quantities are steady, for instance). We will discuss monitors in more detail in the next article, but they can be created for any measurable quantity and are updated each iteration of the simulation. Multiple stopping criteria can be set by right-clicking the Stopping Criteria node and organized with logical “AND” and “OR” conditions. Watch Adding additional convergence criterion to a transient simulation for more information.
Simulations are run with the goal of finding a converged solution of the governing physics equations. We can monitor our simulation results for convergence to ensure we will end up with a physical result. One common tool is to watch the residual plots that are generated while the solvers are running. Residuals are monitors that track how satisfied the discretized equations are. Converged residuals should drop from the initial value of one to oscillate around a smaller value. We can also monitor convergence by tracking physical quantities of interest. When the physical quantities we care about for a given simulation have converged to an asymptotically constant value, we could also say the simulation is converged. Further discussion can be found inHow do I determine whether I can consider my solution converged?
We will discuss this in more detail in the next article, but a solution history saves a snapshot of your solution when a trigger activates. By creating a solution history under the node, you can set the trigger to activate throughout the simulation. This is especially useful for transient simulations, as you can save solution histories every time-step to create an animation of your solution. This needs to be enabled before running the simulation for this to be possible. It is important to note that history files can be very large, a file saved 100 times is 100 times larger than the initial sim file! It is important to only save what you need, see How do I save intermediate results efficiently?
With the solver and stopping criteria set, it is time to initialize and run your simulation! You can initialize with the green flag on the toolbar, then run by clicking the running figure. This gives you a chance to view and check the initialization in scenes and in reports before running the sim. Just clicking the run button will automatically initialize the simulation, then proceed immediately into simulation. A new window will open with the residuals plot if it is not already open. In the next article we will backtrack just a bit to discuss other monitors and plots to run during the simulation. It is important to note, however, that reports, monitors and plots should be set up before the sim runs in order to capture the results while the simulation runs and to later set up animations.