CONVERGE 06-Grid - Control
CONVERGE 06-Grid - Control
Grid Control
Introduction to CONVERGE
Session 6/16
Workflow: Case Setup
• Configure the case setup
- Boundaries
- Initial conditions and events
- Grid control
- Physical models (turbulence, heat transfer, sources, VOF, discrete phase,
combustion and emissions)
• Export surface geometry, input, and data files to the Case Directory
2
CONVERGE Advantage: Grid Generation
• Unlike many CFD codes, CONVERGE maintains the original surface definition
with high fidelity such that the volumes and areas are correct regardless of
- The mesh resolution
- Which grid control techniques have been invoked
• The solver and meshing algorithm are tightly coupled (typically no mesh files
are created)
- Except for inlaid meshes, the entire grid is generated at runtime
3
CONVERGE Advantage: Cut-Cell Cartesian Meshing
• CONVERGE automatically generates a body-fitted Polyhedra cut-cell elements generated at
volume mesh using a patented cut-cell technique surface intersection
Inlaid cells
Cartesian
Imported PLOT3D mesh
cells
5
CONVERGE Advantage: Cell Pairing
• CONVERGE trims the cells at the intersecting surface, which results in some
irregularly shaped cut-cells
• If the volume of a cut-cell is less than a specified ratio, then CONVERGE
combines the cut-cell and the adjacent cell that shares most cell face area
with the cut-cell
- Specify this ratio in Case Setup > Simulation Parameters > Run parameters >
Misc. > Minimum volume ratio
- You can also specify a minimum volume ratio which varies in space and time
• The center of the adjacent cell becomes the volumetric center of the
combined cell
• The cut-cell and the adjacent cell share transport quantities (velocity,
temperature, pressure)
6
Grid Control Strategies
• Cartesian mesh: There are four ways to manipulate the grid size of the
Cartesian mesh in CONVERGE
- Base grid size: Assign dx, dy, dz
The base grid size is the largest grid size available in the simulation
All other grid control strategies are specified with respect to the base grid size
- Grid scaling: Refine or coarsen the entire mesh at a specified time
- Fixed embedding: Refine a specified portion of the grid at a specified time
- Adaptive Mesh Refinement (AMR): Automatically refine the grid based on
local flow conditions such as temperature or velocity
• Inlaid meshing: Specify a grid with an arbitrary orientation, spacing,
and construction
- Inlaid meshes cannot be refined or coarsened during the simulation
7
Combining Strategies
• You can specify as many grid control strategies as desired
- The base grid is required
- All other grid control strategies are optional
• Most grid control strategies can be activated and deactivated at various times
- Inlaid meshes can be activated and de-activated for CONVERGE 3.0.14 and later
- Inlaid meshes cannot be extruded from moving boundaries or intersect with the geometry
• If more than one grid refinement technique is activated in a single cell at a particular
time, the method that calls for the largest refinement level (finest grid size) will be used
(i.e., the effects are not additive)
8
Grid Control in a New Simulation
• When running a new simulation, it may be helpful to start with a coarse base grid and
no refinement techniques
- This allows for a rapid solution while testing the case setup and boundary motion
- Once you have verified the setup, activate the desired grid control techniques
• Because the base grid size is a simulation input, it is straightforward to perform a grid
resolution study to determine the resolution required for reasonable grid independence
• Then, multiple grid control strategies can be used to obtain the grid independent
solution at reduced computational cost
9
Grid Control Setup
• Go to Case Setup > Grid Control
- Base grid is always enabled
- Click Adaptive mesh refinement, Fixed embedding, Grid
scaling, Inlaid mesh, and Minimum volume ratio as desired
10
Base Grid
• Go to Case Setup > Grid Control
> Base grid to set values for dx,
dy, and dz (m)
• Click Suggestion from target cell
count and enter a target cell
count to get a suggested base
grid size
- The suggestion does not take
into account other grid control
techniques
11
Practice
• Load *.cvg file
CONVERGE_Training/Intro_to_CONVERGE/Example_Cases/06-GridControl/CVG_files/06-GridControl.cvg
12
Grid Scaling (1/3)
• Grid scaling changes the base grid size for the entire domain at a specified time
• Grid scaling is useful to speed up convergence in steady-state flows
• The base grid (dx_base) can be coarsened or refined by any power of two
13
Grid Scaling (2/3)
• Go to Case Setup > Grid
Control > Grid scaling
- Enter an integer or check
Use file to set up
different grid scaling
values at different times
The grid scaling
values must be in
ascending order
14
Grid Scaling (3/3)
• In steady-state simulations we recommend gradually
refining the mesh from coarse to fine
- This allows you to reach a steady solution more quickly
• Go to Case Setup > Simulation Parameters > Run
Parameters> Steady-state Monitor
- Select Open grid scaling configuration to set up
different grid scaling values at times dictated
automatically in the simulation
• Go to Case Setup > Grid Control > Grid scaling > Use File
- Grid scaling time is set to AUTO
- Grid scaling values must be in descending order
15
Practice
• Set up grid scaling
16
Fixed Embedding (1/3)
• Fixed embedding refines the Cartesian grid at specified locations and times to capture flow
phenomena of interest
• Embedding techniques can be permanent or set to coincide with critical events such as motion
initiation or change in frequency of rotation
Region embedding
Base grid
Boundary embedding
17
Fixed Embedding (2/3)
• For each fixed embedding, use the embedding scale to specify the number of levels
of embedding
• The embedding cell sizes are governed by
• Negative values for embedding scale (i.e., coarsening) are not allowed
- This is in contrast to grid scaling, in which both refining and coarsening are allowed
18
Fixed Embedding (3/3)
• Go to Case Setup > Grid Control > Fixed embedding
• Fixed embedding can add mesh resolution in
various locations
- BOUNDARY: at a boundary of interest
- SPHERE: in a sphere of interest
- CYLINDER: in a user-defined cylinder
- NOZZLE: near a nozzle (spray)
- INJECTOR: near an injector (spray)
- BOX: in a user-defined box of interest
- REGION: in a specific region
• These techniques are described in the following slides
19
Boundary
embedding
on blades
Embed layers
20
Fixed Embedding: SPHERE
• Sphere embedding allows you to
specify a spherical region in which
fixed embedding will be applied
• Sphere embedding is commonly used
in internal combustion engine and
gas turbine applications
- Resolve spark gap before discharge
- Resolve initial flame kernel
formation
21
Fixed Embedding: CYLINDER
• Cylinder embedding allows you to specify a cylindrical region in which fixed embedding
will be applied
- You can specify different start and
end radii for a conical frustum
22
Fixed Embedding: BOX
• Box embedding allows you to specify a box
in which fixed embedding will be applied
23
Fixed Embedding: REGION
• Region embedding allows you to specify a region
to which fixed embedding will be applied
Diffuser Contraction
Region Region
Test
Outlet
Region
Region
24
Fixed Embedding Timing Control and Translation
• Select the option to move embedding when the
geometry is transformed
• For each fixed embedding, you can select from several
timing options
- PERMANENT: Embedding technique always used
- SEQUENTIAL: Embedding technique starts and
ends at specified times
- CYCLIC: Embedding is activated periodically
(specify the start time, end time, and period)
25
Practice
• Set up all of the fixed embedding strategies used in this example
- Region-based embedding for test_region and outlet_region with embedding level of 1
- Boundary-based embedding for propeller_blades and naca_blade with embedding level of 2
26
Inlaid Meshing
• Alternative grid type in CONVERGE
- Not part of the Cartesian cut-cell mesh generated
at runtime
- Made up of cells with arbitrary shape, size, and orientation
that make up some or all of the domain
- Generated before the simulation
- Typically with CONVERGE Studio
• Inlaid meshes are made of surface triangles defined as
flow through INTERFACE
• Entirely optional
- Does not need to be a part of your workflow!
27
Motivation for Inlaid Meshing
• Take advantage of a priori knowledge of the flow
- Examples: Spray-aligned mesh, flow-aligned mesh, boundary layer mesh
• Can potentially yield more accurate
results with fewer cells
- Can coarsen the grid in directions
with small gradients
• Inlaid meshes are always optional
- CONVERGE’s autonomous
meshing capabilities allow you to
be entirely hands-off with regard
to meshing if so desired
28
Creating an Inlaid Mesh
• Inlaid meshes are typically created in
CONVERGE Studio
- Define a shaped mesh away from surfaces
(e.g., a spray cone)
- Extrude a mesh from a triangulated surface
(e.g., a boundary layer)
- Option to import a PLOT3D mesh
29
Inlaid Mesh Quality (1/2)
• CONVERGE’s autonomous cut-cell mesh approach controls the quality of the
Cartesian mesh
• When you generate an inlaid mesh, you are in charge of mesh quality
- CONVERGE will write mesh quality metrics if you specify MESH_QUALITY in post.in
• Parameters to consider
- Surface triangulation (if extruding)
- Shape of the inlaid cells
- Interfaces between Cartesian and inlaid meshes
30
Inlaid Mesh Quality (2/2)
• Mesh quality metrics can be written to the post files
- Aspect ratio
- Non-orthogonality
- Skewness
- Number of inlaid neighbors
- Number of Cartesian neighbors
- Face warpage
- Stretch ratio
• Refer to the CONVERGE Manual for
guidelines on mesh quality
31
Inlaid Mesh Time Control (1/2)
• Inlaid meshes cannot be generated on a moving boundary
• Moving boundaries and inlaid cells cannot intersect
• Inlaid cells cannot be refined with fixed embedding or AMR
- Refinement is allowed in Cartesian cells that neighbor inlaid cells
• Inlaid cells can be activated or deactivated using events (CONVERGE 3.0.14+)
32
Inlaid Mesh Time Control (2/2)
• To allow activation and deactivation of
the inlaid mesh, ensure that the inlaid
interior and exterior boundaries are
Flow through and Disconnect
• Specify a CLOSE event for both
inlaid_interior and inlaid_exterior to
activate the inlaid mesh
• Specify an OPEN event for both
inlaid_interior and inlaid_exterior to
deactivate the inlaid mesh
33
Inlaid Mesh Boundaries
• When an inlaid mesh is generated
two boundaries are specified:
inlaid_interior and inlaid_exterior
• Both must be flow through
INTERFACE boundaries
• Select the forward and reverse sides
• Specify the inlaid interior boundary
in Case Setup > Grid Control >
Inlaid Mesh
34
Practice
• Extrude an inlaid mesh from the airfoil boundary
35
Adaptive Mesh Refinement (1/2)
• AMR automatically increases and decreases the grid
resolution based on curvatures (second derivatives) in
field variables or may be controlled based on the values
of these variables
• AMR can be permanent or activated at specified times
• AMR is activated on a region-by-region basis
• AMR can be activated for velocity, temperature, species,
passives, void fraction, pressure, density, and/or y+
(a dimensionless wall distance) on a boundary
• AMR can be activated based on a proximity check Velocity AMR resolving the
wake downstream of a reindeer
between two boundaries
- For example, between rotors in a rotary screw compressor
36
Adaptive Mesh Refinement (2/2)
• You specify a maximum number of AMR cells
that, in conjunction with the base grid size,
determines the overall grid resolution Methane jet (70 m/s)
into air crossflow (30 m/s)
- This constraint forces CONVERGE to refine the
mesh such that the maximum number of cells
in the domain does not become excessive
38
Boundary AMR
• CONVERGE includes boundary y+ AMR
- In this example, CONVERGE will add cells along the wall if the y+ value along the wall
boundary exceeds 30
39
AMR-SGS (1/2)
• CONVERGE calculates the sub-grid scalar (SGS) field as φ ′= φ − φ
φ ′ is the sub-grid scalar field
φ is the actual field
φ is the resolved field
• CONVERGE uses a truncated infinite series to approximate
the sub-grid field for any scalar
dxk2 ∂ 2φ
φ′ ≅ −
24 ∂xk2
dxk is the grid spacing for a given rectangular cell
Temperature AMR capturing the thermal gradients
40
AMR-SGS (2/2)
• If the absolute value of the sub-grid field exceeds the user-
specified value (e.g., amr_vel_sgs_embed for velocity) in a given
cell, CONVERGE increases the grid resolution
• If the absolute value of the sub-grid field is less than 1/5 of the
user-specified value, CONVERGE releases the refinement by AMR
• You can specify the frequency at which embedding is applied or
released
• CONVERGE will stop refining the grid at the user-specified embed
level even if the target sub-grid scale has not been met Void fraction AMR
(ECN Spray A VOF example case)
41
Value-Based AMR
• Applies embedding at a scale above a value,
below a value, or between two values
• Requires well-defined values
- Inappropriately defined bounds can lead to
running out of memory, because value-
based AMR is not self-limiting like SGS AMR
• Timing control can be CYCLIC, SEQUENTIAL,
or PERMANENT
- Start and end time controls are available for
CYCLIC and SEQUENTIAL timing types
42
Inlaid Neighbor AMR
• If your domain contains an inlaid mesh, you can direct
CONVERGE to refine or coarsen the Cartesian cells based
on their inlaid neighbors
- This helps control the quality of the interface between the
Cartesian and inlaid cells
• CONVERGE will
- Add embedding to a Cartesian cell if there are more than
N inlaid cells neighboring it
- Remove embedding from a Cartesian cell if it is a group of
more than N such cells neighboring an inlaid cell
43
Practice
• Set up all of the AMR strategies used in this example
- Velocity AMR for Test_region with Max embedding level of 3 and Sub-grid criterion of 0.2
44
Grid Resolution Recommendations
• The example cases provided by Convergent Science are set up with our
recommended physical, numerical, and grid settings
• These recommendations are based on our experience in obtaining accurate results
while minimizing computational expense
• We recommend using these settings as a starting point for your simulation and then
using your judgement to customize the grid settings to better suit your particular
problem
• We recommend performing grid sensitivity analyses to understand the
accuracy/cost trade-off
45
Load Balancing (1/2)
• Most engineering simulations are too large to run on a single-core processor
and thus are run in parallel
• Parallel computing requires splitting the computation among many
processors, all of which must communicate with each other
• The overall simulation speed is limited by the last processor to complete
each time-step
• The fluid solver (i.e., the solution of the Navier-Stokes equations) is load
balanced separately from the combustion solver
- Both the fluid and combustion solver are parallelized on a cell-by-cell basis
46
Load Balancing (2/2)
• Because CONVERGE is dynamically altering the
mesh, it must periodically load balance during
the simulation
• Go to Case Setup > Simulation Parameters >
Simulation time parameters > Misc
- Set Percentage imbalance to trigger load balance
at each load_balance check to more than 100
- Set The number of cycles between parallel load
balances (we recommend checking Auto)
47
Parallel Scalability
• CONVERGE simulations closely track Amdahl’s
law of scaling beyond 1000 cores
• The plot at right shows speedup data from
CONVERGE 3.0
- Sandia Flame D case with 170 million cells
• Scalability can be limited by your
cluster’s interconnect
- CONVERGE will scale best when you have
> 3,000 cells per processor (fast interconnect)
> 10,000 cells per processor (slow interconnect)
48
Selected Grid-Related Output Files
• cell_count_ranks.out: provides information on load balancing
• cell_count_regions.out: provides information on cell count by region
• amr.out: Shows how the addition of AMR cells limits the SGS value used as a
refinement criterion
49
Review Questions
• Does the domain volume change with grid refinement?
• What is cell pairing? Why do we need such strategy?
• What fixed embedding types follow boundary motion?
50
Review Questions and Answers
• Does the domain volume change with grid refinement?
- No, the volume does not change with refinement.
• What is cell pairing? Why do we need such strategy?
- Cell pairing combines cut-cells with < 30% of the volume of surrounding cells with adjacent
cells to avoid solving the equations on a cell that is too small.
• What fixed embedding types follow boundary motion?
- Boundary embedding moves with the moving surface.
51
APPENDIX
Grid Resolution Recommendations: Addendum
• A combination of grid control techniques can be used for
challenging regions
• Example: valve seat
- The cut-cell technique captures the valve angle and seat well,
but cell pairing might result in undesirable coarsening when
the valve is nearly closed
- Add fixed embedding on the valve angle so that cells are not
cut by more than approximately 60% when the valve is at
minimum lift
- Cells pair at 30% of their original volume, so pairing will
mostly be avoided
54
AMR y+ Restriction
• You may need to limit the wall cell refinement on
selected boundaries based on y+
• Go to Case Setup > Grid Control > Adaptive mesh
refinement > Release
• If the y+ value of cell adjacent to the wall is
smaller than the target y+, then CONVERGE releases the refinement (i.e., the cell is coarsened)
- However, CONVERGE will not coarsen the cell if the cell connectivity criterion (2:1) would be violated
• If the ratio of the y+ value of cell adjacent to the wall to Y+ target is smaller than the Y+ Ratio, then the
neighboring cells will be coarsened to maintain 2:1 cell connectivity
• We recommend a Y+ Ratio of 1/3
55