• CFD, Fluid Flow, FEA, Heat/Mass Transfer
  • +91 987-11-19-383
  • amod.cfd@gmail.com

Solver Setting

Type of Solvers and Solution Control Parameters

This section deals with solution controls for solvers including topics like CFL Number, Time-step for Transient Simulations, Psuedo-time Marching, Parallel Computing, Nodes and Cluster, HPC - High Performance Computing, Threading, Partitioning, MPI - Message Passing Interface and Scalability.

Solver setting

This process encompasses following aspects of numerical solutions.
  • Discretization scheme for momentum, pressure, energy and turbulence parameters
  • PV-Coupling such as SIMPLE, SIMPLER, PISO
  • Conservation target and residual levels for convergence criteria. In addition to the "residual norm", it is strongly recommended to set "mass-conservation" or "energy-conservation" as convergence check.
  • Fluid time-scales
  • Solid time-scales (in case of conjugate heat transfer or pure conduction problems). The recommended practice to have solid time-scale set to an order of magnitude (10 times) higher than fluid time-scale.
  • You should ensure that the solution is mesh-independent and use mesh adaption to modify the mesh or create additional meshes for the mesh-independence study. A mesh-sensitive result confirms presence of "False Diffusion".
  • The node-based averaging scheme is known to be more accurate than the default cell-based scheme for unstructured meshes, most notably for triangular and tetrahedral meshes.
  • Note that for coupled solvers which solves psuedo-transient equations even for steady state problems (such as CFX), relaxation factors are not required to be set. The solver applies a false timestep as the convergence process is iterated towards final solution.
SIMPLE Algorithm: Analogy between analytical solution and numerical simulation

SIMPLE - Analogy

Differences between co-located (non-staggered) and staggered grid layout

  • For co-located solvers (such as ANSYS CFX), control volumes are identical for all transport equations, continuity as well as momentum.
  • CFX is a nodal based solver and constructs control volumes around the nodes from element sectors, thus the number of control volumes is equal to the number of nodes and not the number of elements. The input of CFX may be tetrahedron, prism and hexhedron in physical form, the solver internally generates a polyhedral mesh. In a cell centered code, such as FLUENT or STAR-CD / STAR-CCM+, number of elements are the same as the number of control volumes (as the control volumes are same as physical elements) so these are often used interchangably.
  • All field (or unknown or solution) variables as well as fluid properties are stored at the nodes (the vertices on the mesh).
  • The distinction between colocated and staggered approach is nicely explained in section 4.6 by S. V. Patankar in his book "Numerical Heat Transfer and Fluid Flow" and section 7.2 in the book Computational Methods for Fluid Dynamics by J. H. Ferziger and M. Peric.
  • For staggered solvers like ANSYS FLUENT, values of scalar field variables as well as material properties are stored as cell centres.
  • Due to the difference in the way field variables are stored, the simulation with same mesh, material properties and boundary conditions, the y+ value reported in ANSYS CFX will be approximately twice that reported in FLUENT.

Excerpts from user manuals of commercial tools

  • Smaller physical timesteps are more robust than larger ones.
  • An 'isothermal' or cold-flow simulation is more robust than modeling heat transfer. The Thermal Energy model is more robust than the Total Energy Model.
  • Velocity or mass specified boundary conditions are more robust than pressure specified boundary conditions. Static pressure boundary is more robust than a total pressure boundary.
  • If the characteristic time scale is not simply the advection time of the problem, there may be transient effects holding up convergence. Heat transfer or combustion processes may take a long time to convect through the domain or settle out. There may also be vortices caused by the initial guess, which take longer to move through the entire solution domain. In these cases, a larger timestep may be needed to push things through initially, followed by a smaller timestep to ensure convergence on the small time scale physics. If the large timestep results in solver instability, then a small time scale should be used and more iterations may be required.
  • Sometimes the levels of turbulence in the domain can affect convergence. If the level of turbulence is non-physically too low, then the flow might be "too thin" and transient flow effects may be dominating. Conversely if the level of turbulence is non-physically too high then the flow might be "too thick" and cause unrealistic pressure changes in the domain. It is wise to look at the Eddy Viscosity and compare it to the dynamic (molecular) viscosity. Typically the Eddy Viscosity is of the order of 1000 times the dynamic viscosity, for a fully turbulent flow.
  • The 2nd Order High Resolution advection scheme has the desirable property of giving 2nd order accurate gradient resolution while keeping solution variables physically bounded. However, may cause convergence problems for some cases due to the nonlinearity of the Beta value. If you are running High Res and are having convergence difficulty, try reducing your timestep. If you still have problems converging, try switching to a Specified Blend Factor of 0.75 and gradually increasing the Blend Factor to as close to 1.0 as possible.

Porous Domains

Flow geometry such as heat exchangers with closely spaced fins, honecomb flow passages in a catalytic converters, screens or perforated plates used as protection cover at the from of a tractor engine ... are too complicated to model as it is. They are simplified with equivalent performance characteristic, knowns as Δp-Q curve. These curves are either generated using empirical correlations from textbooks or using a CFD simulation for smalled, peridic/symmetric flow arrangement. The simplified computational domain is known as "porous zone" in case it is represented as a 3D volume or pressure or porous jump in case it is represented as a plane of zero thickness. In a similar fashion, the performance data of a fan can be specified including the swirl component.

All the porous media formulation take the form: Δp = -L × (A.v + B.v2) where v is the 'superficial' flow velocity and negative sign refers to the fact that pressure decreases along the flow direction. The 'superficial velocity' is calculated assuming there is no blockage of the flow. L is the thickness of the porous domain in the direction of the flow. Here, A and B are coefficients of viscous and inertial resistances.

In FLUENT, the equation used is: Δp/L = -(μ/α.v + C2.ρ/2.v2) where α is known as 'permeability' and μ is the dynamic viscosity of fluid flowing through the porous domain. This is a measure of flow resistance and has unit of [m2]. Other unit of measurement is the darcy [1 darcy = 0.987 μm2], named after the French scientist who discovered the phenomenon.

STAR-CCM+ uses the expression Δp/L = -(Pv.v + Pi.v2) for a porous domain.

The pressure drop is usually specified as Δp = ζ/2·ρ·v2 where ζ is 'equivalent loss coefficient' and is dimensionless. Darcy expressed the pressure gradient in the porous media as v = -[K/μ]·dP/dL where 'K' is the permeability and 'v' is the superficial velocity or the apparent velocity determined by dividing the flow rate by the cross-sectional area across which fluid is flowing.

Steps to find out viscous and inertial resistances:

  1. Calculate the pressure drop vs. flow velocity data [Δp-v] from empirical correlations or wind-tunnel test or simplified CFD simulations.
  2. Divide the pressure drop value with thickness of the porous domain. Let's name it as [Δp'-v curve].
  3. Calculate the quadratic polynmical curve fit coefficients [A, B] from the curve Δp'-v. Ensure that the intercept to the y-axis is zero.
  4. In STAR-CCM+ this coefficients 'A' and 'B' can be directly used as Pv and Pi which are viscous and inertial resistances respectively.
  5. Divide 'A' by dynamics viscosity of the fluid to get inverse of permeability that is 1/α to be supplied as input in ANSYS FLUENT.
  6. Divide 'B' by [0.5ρ] where ρ is the density of fluid, to get C2 to be supplied as input in ANSYS FLUENT.
  7. The method needs to be repeated for the other 3 directions. If the flow is primarily one-directional, the resistances in other two directions need to be set to a very high value, typically 3 order of magnitude higher.

Convergence History

The residuals of continuity, momentum (u, v and w), energy (T), k and ε is used to check the convergence of iterative solution process. Convergence refers to the situation where the calculated value is assumed to tend to correct inversion of equation [A]{x}={b}. Sometimes k (designated as Tke in STAR CCM+) and and ε (refered to as Tdr in STAR CCM+) may be as high as few thousand and the results are reasonable. The scale can be reduced by turning off the normalization for k and ε. Normalization takes the very first iteration's values to normalize all susequent residuals. When solution already start with a good solution or guess value for k and ε, the first value is already very low, and residuals may not reduce further. It then sometimes can happen that the residual increases instead of decreasing even though the absolute (without normalization) value might still be very low.

Solver Setting for Transient Simulation: CFL Number

  • The CFL number scales the time-step sizes that are used for the time-marching scheme of the flow solver.
  • A higher value leads to faster convergence but can lead to divergence and unstable simulations.
  • The inverse of this is also true where choosing a smaller value in an unstable simulation improves convergence.

Mesh Reordering - Node Renumbering

Both elements and nodes are numbered where elements are described as a set of nodes forming its vertices. The more compact is the arrangement of elements and nodes, lesser will be the memory requirements. Some terms associated with elements and node arrangements in a mesh are as follows.

  • Bandwidth: It is the maximum difference between neighboring cells in a zone i.e. if each cell in the zone is numbered in increasing order sequentially, bandwidth is the maximum differences between these indices.
  • Excerpt from user manaual - FLUENT: Since most of the computational loops are over faces, you would like the two cells in memory cache at the same time to reduce cache and/or disk swapping i.e. you want the cells near each other in memory to reduce the cost of memory access.
  • In general, the faces and cells are reordered so that neighboring cells are near each other in the zone and in memory resulting in a more diagoal matrix that is non-zero elements are closer to diagonal. Refer to "banded-matrices" in context with numerical simulations.

Solver Setting for Multi-Phase Flows

Multi-phase flows have wide applications in process, automotive, power generation and metal industries including phenomena like mixing, particle-laden flows, CSTR - Contunuously Stirred Tanks Reactor, Water Gas Shift Reaction (WGSR), fluidized bed, fuel injection in engines, bubble columns, mixer vessels, Lagrangian Particle Tracking (LPT). Some of the general characteristics and categories of multi-phase flow are described below along with setting parameters in ANSYS FLUENT

 Multiphase flow regimes are typically grouped into five categories: gas-liquid (which are naturally immiscible) flows and (immiscible) liquid-liquid flows, gas-solid flows, liquid-solid flows, three or more phase flows. As can be seen, the immiscibility is a important criteria. In a multi-phase flow, one of the phase is usually continuous and the other phase(s) are dispersed in it. The adjective "Lagrangian" indicates that it relates to the phenomena of tracking a moving points ("fluid particles") - such as tracking a moving vehicle on a road. On the other hand, the adjective "Eulerian" is used to describe correlations between two fixed points in a fixed frame of reference - such as counting the type of vehicles and their speeds while passing through a fixed point on the road.

Gas-liquid flows are further grouped into many categories depending upon the distribution and shape of gas parcels. Three such types are described below.

Bubbly Flow: it represents a flow of discrete gaseous or fluid bubbles in a continuous phase.

Bubbly Flow - Gas Liquid

Slug Flow: This is characterized by flow of large gas bubbles in liquid.

Annular Flow - Gas Liquid

Annular Flow: Here one of the phase if confined to area near the wall forming an annular section.

Annular Flow - Gas Liquid

Some other types of flows are particle-laden flow such as air carrying dust particles, slurry flow where particles are transported in a liquid, hydrotransport which describes densely-distributed solid particles in a continuous liquid such as cement concrete mix. Gas assisted mixing of solid such as fluidized-bed and settling tank where particles tend to sediment near the bottom of the tank forming thick sludge are some other examples of multi-phase flows.

The two dominant method of multi-phase simulations are listed below.

multiphase Methods

multi-phase flow: VOF and Eulerian in ANSYS FLUENT

multi-phase flow: boiling in ANSYS FLUENT

Eulerian Wall Film
A wall film is a thin layer of liquid over a solid surface such as water dripping due to condensation. The surface tension is one of the dominant parameter which controls the thickness and flow rate of such liquid films.

multi-phase flow: Eulerian Wall Film in ANSYS FLUENT

Advanaced Solver Setting: AMG

The Algebraic Multi Grid solver is one among the familiy of multi-grid solvers. The adjective multi-grid refers to the concept that the solution process is implemented more than one grid (levels) even though the user has created only one grid.

Settings of a multi-grid solver in ANSYS FLUENT

In AMG solver, a 'virtual' coarse mesh equations are created by merging the original control volumes. The merged coarse control volume meshes are in general very irregular in shape. The coarse mesh equations thus impose conservation reduce the error components at longer wavelengths. The following image is taken from CFX user manual:

AMG control volume merging approach

Here, the results from coarse-mesh at each level is interpolated from/on the nearest finer mesh and vice-versa.

FSI: Fluid-Structure Interaction in ANSYS

FSI setting in ANSYS workbench

Geometry import setting

Geometry import options

FSI Coupled flow and structure simulation

FSI System Coupling

Parallel Processing

In order to reduce the simulation run time, parallel processing methods have been developed where the arithmetic involved with matrices are broken into segments and assigned to different processors. Some of the the terms associated with this technology are described below. The image from "Optimising the Parallelisation of OpenFOAM Simulations" by Shannon Keough outlines the layout of various components in a cluster.

HPC Cluster Layout

  1. HPC: High Performnce Computing - A generic term used to describe the infrastructure (both hardware and software) for parallel processing.
  2. Cluster: A collection of workstations or nodes connected with each other with high speed network such as 1 GB/s Ethernet network or InfiniBand.
  3. Node: Each independent component of a cluser or HPC set-up. Each node has following configurations:
    • Chassis: For example - HP Z820
    • CPU: For example - Intel XEON-E5 2687W
    • Cores: For example - 8 cores per CPU @ 3.1GHz
    • RAM: For example - 8GB DDR3-1600 Registered ECC memory
    • Storage: For example - 1TB SATA HDD plus network file system (NFS) server
    • Operating System: For example - CentOS 6.5
    • Application Program: For example - CFD Software: OpenFOAM or FLUENT V17.2
  4. Hyper-threading: It is a method which allows each core on the CPU to present itself to the operating system as two cores: one real and one virtual. The operating system can then assign jobs to the virtual cores and these jobs are run when the real core would otherwise be idle (such as during memory read/write) theoretically maximising the utilisation of the CPU.
    • Excerpts from STAR-CCM+ User Manual: "Generally, for best performance, it is recommended that you turn off any features that artificially increase the number of cores on a processor, such as hyper-threading. In situations where hyper-threading is turned on to benefit other applications, you should generally avoid loading more processes than there are physical cores.
       In addition to turning off hyper-threading, it is recommended that you set your BIOS settings to favor performance rather than power saving. Almost all heavily parallelized applications suffer performance problems if the CPU frequencies are spun up and down. In most parallel applications, and STAR-CCM+ in particular, when one core is operating at a reduced frequency, all other cores are running at lower frequencies as well.
  5. Memory Intensive Applications: This refers to the programs whose performance is more influenced by RAM than the clock-speed of the CPU. For example - OpenFOAM
  6. Partitioninng: This is nothing of a "work distribution" among CPUs. However, tracking of nodes and elements are important. Excerpts from FLUENT user's manual: "Balancing the partitions (equalizing the number of cells) ensures that each processor has an equal load and that the partitions will be ready to communicate at about the same time. Since communication between partitions can be a relatively time-consuming process, minimizing the number of interfaces can reduce the time associated with this data interchange."
  7. MPI: Message Passing Interface - Each compute node is connected to every other compute node though the network and relies on inter-process communication to perform functions such as sending and receiving arrays, summations over all cells, assembling global matrix - remember A.x = b. Inter-process communication is managed by a message-passing library by an appropriate implementation of the Message Passing Interface (MPI) standard such as OpenMPI, Intel MPI, Cary MPI, IBM Platform MPI, Microsoft MPI, MPICH2 or vendor's own version of MPU.
  8. Scalability: It refers to decrease in turnaround time for solutions as the number of compute nodes increases. However, beyond a certain point the ratio of network communication (refer to definition of Cluster above) to computation increases, leading to reduced parallel efficiency, so optimal system sizing is important for any simulations - determined from a ratio of the time to compute and the time that is taken to exchange data between cluster nodes.

Dimensionless Numbers

  • CFL NUMBER: CFL, it is ratio of characteristic flow velocity to the speed with which time-marching solution advances over a mesh.
  • Knudsen number: Kn, defined as the ratio of the mean-free path to the characteristic length scale.
  • Mach number: M, defined as the ratio of the characteristic velocity to the sound speed
  • Reynolds number: Re, defined as the ratio of the product of the characteristic velocity × characteristic length to the kinematic viscosity. This is one of the widely used number required to distinguish laminar and turbulent flow regimes.
  • Strouhal number: Sh, defned as the ratio of the mean-free time to the characteristic time scale. This number is used to express vortex-shedding frequency of wake regions behind bluff-bodies.
Contact us
Disclaimers and Policies

The content on CFDyna.com is being constantly refined and improvised with on-the-job experience, testing, and training. Examples might be simplified to improve insight into the physics and basic understanding. Linked pages, articles, references, and examples are constantly reviewed to reduce errors, but we cannot warrant full correctness of all content.