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.
Any program does only one thing: "Solves exactly what one tells it to solve and how to solve, nothing else!"
Note the the field variables solved during CFD simulation are velocity vector, pressure, temperature (enthalpy). The density at each cell is calculated from equation of state (ideal gas law or real gas laws like Redlich-Kwong and IAPWS equation of state for steam). Note that the "compressible flows" and "compressible gas" are not the same concepts. Compressible flows are characterized by Mach number of the flow whereas compressible behaviour of fluid refers to equation of state such as ideal gas law, essential change in density due to change in pressure and temperature.
One of the key consideration is the compressible or incompressible behaviour of the fluid. For liquids under lower pressure conditions (except cases such as hydraulics, deep bore drilling in oil exploration...), they can be assumed incompressible without loss of any accuracy. The compressibility chek for liquids need to be decided based on bulk modulus, operating pressures and coefficient of volume expansion.. The later varies between 0.001 ~ 0.010 [K-1]. The bulk modulus is defined as β = -V × ΔP/ΔV where negative sign refers to the fact that volume decreases as pressure increases. Thus, in terms of density, β = -ρ/Δρ × ΔP. β for water is 2.2 [GPa]. Hence, at pressure of 100 [MPa], the change in water density as compared to density at 1 [atm] would be 1000 [kg/m3] × 0.1 [GPa] / 2.2 [GPa] = 45.5 [kg/m3] which is 4.55% of density of water at 1 [atm].
While the change in density of liquids is more pronouced with change in temperature, the situation is different in cases of gases where density is a strong function of both temperature and pressure changes. Note that the density is calculated based on static conditions (static temperature and static pressure) and not on total conditions (total temperature and total pressure). On the other hand, the stagnation conditions are the true measure of pressure energy and internal energy. There are two modes of reduction in stagnation (or total) pressure: the first mode is due to conversion of pressure energy into velocity (kinetic) energy and the second mode is loss of pressure energy due to wall friction and minor losses (sudden expansion and contraction). The general equations to estimate stagnation and static conditions for all values of flow velocities are described below.
Let's consider isothermal flow through a rough pipe of uniform cross-sectional area. The expression for frictional pressure drop is also described. Here, V denotes area-average velocity at the inlet and the outlet.
From conservation of mass:
Static pressure drop taking into account compressibiity of the fluid:
Since ρ1 always > ρ2 for isothermal flows, the effect of compressibility of the gas is to increase static pressure drop. Since wall friction is also function of velocity gradient near wall and the free-stream velocity increases as density of gas decrease due to frictional loss, the effect of compressibility is to increase wall friction and subsequently viscous losses. But how much will the compressibility affect static pressure drop? For ρ1 / ρ2 = 1.11 (10% drop in density), V1 = 5 [m/s] and ρ1 = 1.20 [kg/m3], additional pressure drop due to compressibility = 0.5 × 1.20 × 25 × (1.11 - 1.00) = 0.66 [Pa]. However, a 10% reduction in density will call a 10% drop in absolute static pressure. At mean value of 1 [bar], this turns out to be 100,000 x 0.1 = 10,000 [Pa]. This magnitude of pressure drop can be observed in a pipe of diameter 100 [mm] and length of approximately 2.2 [km]!
The operating pressure is used to specify the mean pressure in the system. Though it can be adjusted to convert the gauge pressure into absolute pressure. That is, the operating pressure can be set to zero to get the pressure field directly in absolute values. This is the recommended method for cases involving phase change such as simulation of cavitation in pumps. Note that cavitation occurs when local absolute static pressure in the flow field falls below saturation pressure at given temperature. However, once the operating pressure is set to 0 [Pa], the boundary conditions should also be specified in absolute values, e.g. 1,01,325 [Pa] instead of 0 [Pa].
On irregular (skewed and distorted) unstructured meshes, the accuracy of the least-squares gradient method is comparable to that of the node-based gradient (and both are much more superior compared to the cell-based gradient).
In an explicit Eulerian method, the Courant number cannot be > 1 otherwise it will lead a condition where information is propagating through more than one grid cell at each time step. This is explained in the physical domain of dependence and numerical domain of dependence in following diagram. For a stable solution, numerical domain of dependence must cover the physical (real) domain of dependence.
In multi-dimensional problem, depending upon the spatial and temporal discretization scheme, the CFL condition varies as shown below.
Thus, Courant number can be reduced either by reducing the time step or by increasing the mesh size (i.e. coarsening of the mesh). The later option may appear counter-intuitive though mathematically that remains a fact. It is difficult for most of the simulation engineers to believe the fact that coarsening the mesh help them achieve a better convergence.
To verify that your choice for time-step was proper, check contours of the Courant number within the domain. In FLUENT, select Cell Courant Number under Velocity... For a stable and accurate calculation, the Courant number should not exceed a value of 20-40 in most sensitive transient regions of the domain.Note that CFX reports two types of Courant number:
The standard enthalpy of formation of a material or compound is defined as the change in enthalpy (ΔH0) when 1 mole of that material in the standard state (1 atm of pressure and 298.15 K) is formed from its pure elements under the same temperature and pressure conditions. The standard enthalpy of formation of a pure element in its reference is zero. Carbon exists as C-atoms, oxygen exists as O2 molecules and hydrogen exists as H2 in its reference (or natural) form. Hence, the standard enthalpy of formation is ZERO. However, water-vapour and carbon-dioxide are not pure elements and will have non-zero value as their standard enthalpy of formation.
The value of ΔH0 will be negative if the process is endothermic (that is the reaction for material formation requires external heat energy) or positive if the process is exothermic (if heat is released during formation or reaction).
In situations with phase change such as forced convection subcooled nucleate boiling, the standard state enthalpies of vapor and liquid phase are set such that their difference equals to latent heat of vapourization = 2.992E+07 [J/kmole]. The unit of standard state enthalpy is [kJ/kmol] and usually the latent heat value is avaiable in [kJ/kg]. The latest heat value in [kJ/mole] should be multiplied by molecular wight of the liquid. For correct speciffication of latent heat, the reference temperature should be set to 298.15 [K] or 25 [°C]. Note that it is a postive value (in case of boiling simulation) as compared to standard state enthalpies of species such as CO2 and CH4 (which are negative by sign convection) used in species transport and combustion modeling.
In phase change phenomena (evaporation or condensation), the difference between actual temperature of the phase and saturation conditions are described as degree of subcooling (liquid) and degree of superheating (gas). If the inlet temperature of liquid is T = 350 [K] and the saturation temperature TSAT = 373 [K], liquid state is terms as subcooled and with the degree of subcooling = 373 - 350 = 23 [K]. In a nucleate boiling, when the wall temperature rises above the liquid saturation temperature, steam bubbles will get formed and migrate away from the wall. Since the bulk flow (liquid far away from the wall) is subcooled, these bubbles condense near the center of the pipe.
Wet Steam: The steam with droplets of water is known as wet steam and it characterized by dryness fraction. Most of the boilers do not generate dry steam as steam bubbles breaking through the heated surface will pull tiny water droplets along with it. In general, when a substance exists partly as liquid and partly as vapor (gas) phase, its quality is defined as the ratio of the mass of vapor to the total mass. On the hand, mass fraction of the condensed phase is known as wetness factor.
Dry Steam: Saturated or superheated steam are known as dry steam.For water, the triple point T = 0.01 [°C] and P = 0.6113 [kPa], is selected as the reference state where the internal energy, enthalpy and entropy of saturated liquid are assigned a zero value. Similarly, saturated refrigerant R-134a is specified enthalpy of 0 [J/kg] at temperature -40 [°C] and pressure of 51.25 [kPa]. Thus, standard state enthalpy of liquid water is 0 and reference temperature is 273.15 [K]. The standard state enthalpy of steam is heat of vaporization at T = 0.01 [°C] and P = 0.6113 [kPa] and equals 2501 [kJ/kg]. The molecular weight of water is 18.0153 [kg/kmole] and hence the standard state enthalpy of steam is (2501 × 18.0153) [kJ/kmole]. The saturation pressure of water as per ASHRAE: p(T in [K]) in [Pa] = exp[c1 / T + c2 + c3 * T + c4 * T2 + c5 * T3 + c6 * Ln(T)] where c1 = -5800.22, c2 = +1.3914993E+00, c3 = -4.8640239E−02, c4 = +4.1764768E−05, c5 = −1.4452093E−08, c6 = +6.54597.
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:
|First point - X1:|
|First point - Y1:|
|First point - Z1:|
|Second point - X2:|
|Second point - Y2:|
|Second point - Z2:|
Temperature Drop across a Porous DomainIf flow through the porous domain is assumed (a) incompressible, one-dimension, steady state and (b) pressure drop varies linearly with the flow direction x:
In case of multi-phase flow, an initial distribution of volume fraction of the constituents is important. The method to set initial conditions in ANSYS FLUENT is called patching which requires regions to be marked as shown below. In OpenFOAM setFields (requires setFieldsDict) utility is used to initialize field variables in various zones.
Sometimes k (designated as Tke in STAR CCM+) and and ε (referred 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 subsequent 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.
In ANSYS FLUENT, the denominator to calculate the scaled residual for the continuity equation of a pressure-based solver is the largest absolute value of the continuity residual in the first 5 iterations. When iteration starts with a good solution, the largest residual of first 5 iterations may be low. Hence in subsequent iterations, significant reduction in order of magnitude of the residuals may not be observed even though the convergence can be deemed to be of good accuracy. Note 'scaling' and 'normalization' of residuals are different and interpretation should be different as well.Under Relaxation Factors (URF): As per ANSYS documentation and training material, Pressure and Momentum URFs MUST sum to 1.00 and flow stability is best with smaller pressure URF (0.03 is not uncommon).
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.
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.
Slug Flow: This is characterized by flow of large gas bubbles in liquid.
Annular Flow: Here one of the phase if confined to area near the wall forming an annular section.
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.
In the Euler-Euler approach, the different phases are treated mathematically as interpenetrating continua where each phase coexist as continuous function in space and time.
In transient VOF simulations, ANSYS FLUENT solves the volume fraction equation(s) once for each time step (outer loop). To solve the volume fraction equation(s) at every (inner) iteration within a time step, use TUI: /define/models/multiphase/volume-fraction-parameters [solve vof every iteration?] yes. This will update convective flux coefficients in the other transport equations based on the updated volume fractions at each iteration, though this a computationally more expensive and less stable option. While using sliding meshes or dynamic meshes with layering and/or remeshing, using the solve vof every iteration? option will yield more accurate results, although at a greater computational cost.
If the field "Number Of Continuous Phase Iterations Per DPM Iteration" field is set to 0, FLUENT will not perform any discrete phase iterations. Excerpts from ANSYS FLUENT: rule of thumb to follow when setting the parameters above is that if you want the particles to advance through a domain consisting of N mesh cells into the main flow direction, the Step Length Factor × N ≈ Max. Number of Steps.
Also, if "Number Of Continuous Phase Iterations Per DPM Iteration" field is reduced, the coupling between dispersed and continuous flow increases and vice-versa. For a closer coupling, this value should be set to a value ≤ 5 though no unique upper limit exists. Increasing the under-relaxation factor (setting value closer to 1) for discrete phase improves coupling and reducing the under-relaxation factor (setting value away from 1 and closer to 0) for discrete phase weakens the coupling.
DPM Trajectory Equation
Here subscript 'p' denotes 'particle'. Various empirical correlations of drag laws for viscous forces over solid particles are:
ANSYS FLUENT calculates drag coefficient of non-spherical particle using shape factor defined as [s/S] where 's' is the surface area of a hypothetical sphere having the same volume as the particle and 'S' is the actual surface area of the particle.As explained above, the underlying physics of DPM is described by ordinary differential equations (ODE) as opposed to the Navier-Stokes equation for continuous flow which is expressed in the form of partial differential equations (PDE). Therefore, DPM can have its own numerical mechanisms and discretization schemes, which can be completely different from other numerics (such as discretization schemes) to solve the governing equations. The Numerics tab gives users control over the numerical schemes for particle tracking as well as solutions of heat and mass equations related to particles - continuous phase interactions.
Type of coupling: continuous (carrier) phase and discrete phase
The approach differs in ways injected particles (number, volume fraction, injection speed) are treated or the way particle-particle collisions are treated. For example: one particle can represent either one or a group of particles (sometimes known as parcels). In Discrete Particle Method (DPM), particle particle interaction can be treated in following 3-ways:
In ANSYS FLUENT, the DDPM option is available only under Eulerian multi-phase model.
In two-way coupling, dispersed phase modifies carrier phase turbulence where bigger particles usually enhance turbulence and smaller particles damp turbulence. This leads to situation where carrier phase turbulence becomes anisotropic. On the other hand, carrier phase turbulence enhances dispersion (fluctuating flow field) and clustering of the dispersed phase (stagnant flow field). When the flow is turbulent, it imparts a random motion on the particles based in instantaneous components of fluctuating velocity. However, RANS flow solution does not resolve all the small–scale turbulent eddies in the flow. The effect of eddies on particle trajectories is resolved using stochastic tracking. Here, a number as specified by "number of tries", particle streams are released from the same point. Each one is given a random "kick" in each grid cell based on the calculated turbulent intensity. This will indicate how turbulence will modify the trajectories.
Type of injectionFor typical applications, the computational cost of tracking all of the particles individually is prohibitive. Instead, the approach adopted in DPM and Discrete Element Method (DEM) Collision Model is that like particles are divided into parcels and then the position of each parcel is determined by tracking a single representative particle. Thus, in such calculations, following differences between DPM and DEM are mentioned in FLUENT user manual.
In ANSYS FLUENT, for surface injection, mass flow rates of the particles from each face (each element of the boundary zone) can be scaled by the ratio of the area of the face particles are released from to the total area of the surface using option "Scale Flow Rate By Face Area" under Point Properties. Note that surfaces invariably have non-uniform distributions of points. In order to generate a uniform spatial distribution of particle streams released from a surface in 3D, one will need to create a bounded plane surface with a uniform distribution using the Plane Surface panel.
In ANSYS FLUENT, particle initial conditions (position, velocity, diameter, temperature and mass flow rate) can also be read from an external file to describe injection distribution. The file has the following form with all of the parameters in SI units. All the parentheses are required, name is optional.
(( x y z u v w diameter temperature mass-flow) name)Mass flow rate: Only for coupled calculations (discrete phase affecting flow field of continuous phase), the mass of particles per unit time that follows the trajectory can be defined in the injection setting option. Also note that the number of streams (say 100) is not the same as the number of particles. The DPM uses a parcel method where many particles are tracked in each parcel and ANSYS FLUENT allocates the number of particles in each parcel based on the particle diameter, density and mass flow rate. Numper of particles in each parcel NP = mPS × Δt / mP where mPS = mass flow rate in particle stream, mP = mass of each particle and Δt is the time step. Under steady state operations, it is assumed that any particle released from the same location with the same conditions will follow the same trajectory. P_FLOW_RATE macro can be used in a UDF to return the flow rate of a parcel in [kg/s].
Example: particle release from a surface - assuming there are 200 faces in the surface.
Number of Particle Streams: This option controls the number of droplet parcels that are introduced into the domain at every time step.Note the options at top right quadrant of "Discrete Phase Model" setting window: Inject particles at (i)Particle Time Step and (ii)Fluid Flow Time Step. The option (i) requires two entrys (a)Particle Time Step Size in [s] and (b) Number of Time Steps. Option (ii) requires only (a) Particle Time Step Size. To start the particle injection at t = 0, set "Start Time" of inject = 0. In order to keep the particle injection long after the time period of interest, set a large value for the Stop Time, for example 500 [s] which ensures that the injection will essentially never stop.
Poincaré plots are made by placing a dot on a given surface every time a particle trajectory hits or crosses that surface.
The DDPM is based on concept of granular flows and compressible regime (that is, where the solids volume fraction is less than its maximum allowed value described in image above), a solids pressure (which is similar to thermodynamic pressure) is calculated independently and used for the pressure gradient term in the granular-phase momentum equation. The expression of solid pressure is
ps = [1+2(1 + e) α gr ]α ρp Θswhere e is the coefficient of restitution, gr is the radial distribution function - a correction factor that modifies the probability of collisions between grains when the solid granular phase becomes dense (may also be interpreted as the nondimensional distance between spheres), α is the volume fraction of solid, ρp is the density of solid particles and Θs is the granular temperature. The radial function tends to infinity as the volume fraction tends to the packing limit and it tends to 1 as the volume fraction approached zero (the dilute limit).
The term "granular temperature" has been borrowed from kinetic theory of gases and is a bit misnomer which does not represent any temperature in thermodynamic sense. It represents particle momentum exchange due to translation and collision leading to definition of kinetic and collisional viscosities respectively. The shear and bulk viscosities arising due to this phenomena is added to the solid stress tensor. The granular temperature for the solids phase is proportional to the kinetic energy of the particles’ random motion mathematically expression as Θs = 1/3[u'.u'] where u' is the fluctuating solids velocity in the Cartesian coordinate system. This is defined as an ensemble average of the particles’ random velocity within a finite volume and time period having particle number per unit volume as averaging basis.The collisional part of shear viscosity:
Kinetic viscosity as per Syamlal et al.
Kinetic viscosity as per Gidaspow et al.
The solids bulk viscosity accounts for the resistance of the granular particles to compression and expansion.
A thin liquid film forms as liquid drops impinge on a solid surface in the domain with several possible outcomes from this impingement:
The geometric reconstruction scheme represents the interface between fluids using a piecewise-linear approach. It assumes that the interface between two fluids has a linear slope within each cell and uses this linear shape for calculation of the advection of fluid through the cell faces.In ANSYS FLUENT this scheme has better accuracy as compared to other schemes (such as donor-acceptor scheme) and is applicable for general unstructured meshes.
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:
Here, the results from coarse-mesh at each level is interpolated from/on the nearest finer mesh and vice-versa.
FSI simulations are classified under a broader category of "Multi-physics Simulations" and not limited only to structural simulations. Fluid-thermal interaction, Fluid-thermal-electric interaction, Fluid-piezoelectric interaction, Structural-magentic interaction ... are other types of multi-physics simulations.
In addition to the settings described above, following steps are required for a FSI simulation:
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.
Graphics refers to the pictures, videos, charts and animations. The graphics components of a computer control and enhance how these 'graphics' are displayed on computer screen. Usually the graphics components are on a separate card that is plugged into a slot on the motherboard though these can and are built directly into the motherboard as well. Some other names used for the graphics components are video card, video adapter nd display adapter.
Similar to an operating system which deals with how a computer starts and shuts down, the graphics driver is a program that enables computer to use the graphics card and communicate with CPU, HDD and other components. A 'driver' in general is a software component that lets the operating system and a 'device' communicate with each other. E.g. there is USD 'driver' to make a USB mouse work. The graphics card sends the signal to the computer display and makes the data visible.Note that computer 'monitors' are not same as "graphics cards or graphics drivers". Graphics card is a hardware and graphics driver is software to make it work. AMD Radeon a graphics card used in my laptop manufactured by Lenovo.
Starting FLUENT in batch mode in Linux
Starting FLUENT in batch mode in Windows
> WARNING: Rank:0 Machine mpp2-xxxxxxx has 37 % of RAM filled with file buffer caches. This can cause potential performance issues. Please use -cflush flag to flush the cache. (In case of any trouble with that, try the TUI/Scheme command '(flush-cache)'.)In order to clear the buffer cache, add following lines at the beginning the journal file.
(rpsetvar 'cache-flush/target/reduce-by-mb 12288) (flush-cache)The number 12288 [Mb] = 12 x 1024 [kb] is the specification of the amount of system memory which cannot be flushed out due to boot image of Linux OS files in the memory of the diskless compute nodes. This means that on a compute node with 64 Gb, it tries to flush 64 [Gb] - 12.0 [Gb] = 52 [Gb] of memory. The value of 12288 also varies from cluster-to-cluster and may also change over the time.
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.
Template by OS Templates