mooney slides for dynamic topoFvMesh in open foam for mesh motion
1. Using the dynamicTopoFvMesh class in
OpenFOAM
Sandeep Menon Kyle Mooney
Multi-phase Flow Simulation Laboratory
University of Massachusetts Amherst
June 13 2011
2. Introduction
Examples
I Leaky Faucet (free surface flow)
I Micron Scale Droplet Collision (free surface flow)
I Translating Circle (2D parallel remeshing)
I Cylinder Intake Stroke (internal flow)
I Store Separation (external flow & six-DOF)
Adaptive reconnection methods
I Mesh quality optimization
I Length scale resolution
Solution remapping
Parallel mesh reconnection
Setting Up A Case
I Configuring dynamicMeshDict
I Running A Simulation
Slide: 2/31
10. Governing Equations
Integral Conservation Law for Moving / Deforming Control Volumes:
d
dt
Z
V
ρφ dV +
Z
S
n · ρ(v − vs)φ dS = −
Z
S
n · qφ dS +
Z
V
sφ dV
Conservation of Mass:
d
dt
Z
V
ρ dV +
Z
S
n · ρ(v − vs) dS = 0
Conservation of Linear Momentum:
d
dt
Z
V
ρv dV +
Z
S
n · ρ(v − vs)v dS =
Z
V
ρg dV +
Z
S
n · σ dS
Space Conservation Law:
d
dt
Z
V
dV −
Z
S
n · vs dS = 0
Slide: 10/31
12. Mesh Smoothing
Objectives:
Continuously maintain mesh quality
No changes to mesh connectivity
Delay local re-meshing requirements
Easily incorporated into conservation laws
Spring Analogy Laplacian:
X
j
kij(xij − xi) = 0
Laplacian Smoothing on Surfaces:
(I − nnT
)
X
j
kij(xij − xi) = 0
Slide: 11/31
13. Adaptive Mesh Reconnection
Reconnection for Improved Mesh Quality
Handle excessive distortion
Used when mesh-motion algorithms are insufficient
Localized nature to avoid interpolation errors
Only simplical 2D and 3D meshes considered
Reconnection for Length-Scale Resolution
Accurately capture physical phenomena
Achieve trade-off for computational cost vs. solution accuracy
Slide: 12/31
19. Solution Remapping
Steps
Compute intersections
Compute and limit gradients on source mesh
Volume and distance weighted Taylor series interpolate to supermesh
Agglomeration on target mesh
φ(xKb
) =
1
VKb
" n
X
i=1
{φKa
+ (xi
Kc
− xKa
) · (∇φ)Ka
}V i
Kc
#
Slide: 13/31
21. Parallel Mesh Reconnection
Shared memory parallelism
Entire memory is accessible to all compute nodes
Thread-safety is always a concern
Using the pthreads library for thread handling
Limited by memory bandwidth / capacity
Distributed memory parallelism
Each compute node sees only its share of memory
Inter-processor communication using MPI
Theoretically infinite memory capacity
Slide: 14/31
26. Configuring dynamicMeshDict
//- Select the type of dynamicFvMesh
dynamicFvMesh dynamicTopoFvMesh;
//- Select the type of motionSolver
solver mesquiteMotionSolver;
Slide: 17/31
27. Configuring mesquiteOptions Subdict.
mesquiteOptions
{
//- Specify interval for surface smoothing
surfInterval 1;
//- Optimization metric
optMetric AspectRatioGamma;
//- Objective function
objFunction LPtoP;
//- Optimization algorithm
optAlgorithm FeasibleNewton;
//- Termination criteria sub-dictionaries
//- (takes default values if not specified)
//- Specifying an empty sub-dictionary
//- terminates with available options
tcInner
{
absGradL2 1e-4;
cpuTime 0.5;
}
Slide: 18/31
28. Configuring mesquiteOptions Subdict. cont.
//- Power value for the LPtoP objective function
pValue 2;
power 2;
//- Specify a tolerance for the surface-smoothing CG solver
tolerance 1e-2;
//- Specify number of CG sweeps for surface-smoothing
nSweeps 2;
//- Specify slip patches for the motionSolver
slipPatches
{
sideWall;
topWall;
}
Slide: 19/31
30. Configuring mesquiteOptions Subdict cont.
//- Specify fixedValue patches for the motionSolver
fixedValuePatches
{
topWall
{
type angularOscillatingDisplacement;
amplitude -0.0125;
//type oscillatingDisplacement;
//amplitude (0 0 -0.01);
axis (1 0 0);
origin (0 0 3);
angle0 0.0;
omega 0.15;
value uniform (0 0 0);
}
}
Other fixedValuePatch types can be found here:
/src/dynamicMesh/meshMotion/fvMotionSolver/pointPatchFields/derived
//-End of Mesquite options
Slide: 21/31
31. Configuring dynamicTopoFvMesh
//- Options for dynamicTopoFvMesh
dynamicTopoFvMesh
{
//- Should all options be made mandatory?
//- Useful for first-time use.
allOptionsMandatory no;
//- Set run-time debug level [0-5]
// debug 0;
//- Specify the number of threads
threads 1;
//- Specify re-meshing interval
//- Negative value implies no re-meshing
interval 1;
//- Specify whether the length-scale field
//- should be dumped to disk
dumpLengthScale false;
Slide: 22/31
32. Configuring dynamicTopoFvMesh
//- sliverThreshold specifies the
//- quality criteria for sliver removal.
sliverThreshold 0.35;
//- Should the tool attempt to remove slivers
//- that fall below the sliverThreshold value?
removeSlivers false;
//- Skip mapping step. Useful while using
//- this tool as a pre-processor
// skipMapping true;
// Toggle edgeRefinement on/off
edgeRefinement yes;
//- If the number of modifications are to be limited, set this option
// maxModifications 1000;
//- Load custom libraries for metrics
// tetMetricLibs ("libtetMetrics.so");
//- Tetrahedral mesh quality metric
tetMetric Knupp;
Slide: 23/31
33. Configuring
dynamicTopoFvMesh::refinementOptions
//- Options for edge-bisection/collapse.
//- The edgeRefinement flag must be set for
//- the following options to have effect
refinementOptions
{
collapseRatio 0.5;
bisectionRatio 1.5;
growthFactor 1.03;
//- By default, existing boundary edge-lengths
//- are used for length-scales.
//- Length-scale can be fixed for certain patches.
fixedLengthScalePatches
{
topWall 0.2;
bottomWall 0.2;
sideWall 0.2;
outlet 0.2;
}
Slide: 24/31
34. Configuring
dynamicTopoFvMesh::refinementOptions
//- Avoid refinement on certain patches, if necessary
noModificationPatches
{}
//- Set floating length-scale values on certain patches
freeLengthScalePatches
{}
//- Limit lengthScales to specified values, if necessary
// minLengthScale 0.1;
// maxLengthScale 0.3;
//- Field-based refinement options
// fieldRefinement gamma;
// fieldLengthScale 0.005;
// lowerRefineLevel 0.001;
// upperRefineLevel 0.999;
// maxRefineLevel 4;
// meanScale 0.015;
Slide: 25/31
39. Limitations
Topology changes on simplicial elements only (Tri & Tet)
I Some success in mixed element meshes by tagging zones
for topo changes
Crushing Cells
I Currently does not support cell “crushing”
I Example: complete valve closure for cylinder simulations
I Potentially performed via coupling with a GGI patch
Serial version available in 1.6-ext release.
Parallel redistribution still a little buggy. (Consider it Beta)
Slide: 30/31
41. Discussion and Future Work
Successful implementation of mesh-topology modification
algorithms
Slide: 31/31
42. Discussion and Future Work
Successful implementation of mesh-topology modification
algorithms
Highly versatile application range
Slide: 31/31
43. Discussion and Future Work
Successful implementation of mesh-topology modification
algorithms
Highly versatile application range
Conservative solution transfer
Slide: 31/31
44. Discussion and Future Work
Successful implementation of mesh-topology modification
algorithms
Highly versatile application range
Conservative solution transfer
Efficient due to shared / distributed memory parallelization
Slide: 31/31
45. Discussion and Future Work
Successful implementation of mesh-topology modification
algorithms
Highly versatile application range
Conservative solution transfer
Efficient due to shared / distributed memory parallelization
Future focus:
I Constrained, cost-effective remapping for divergence-free fluxes
I Testing / validation of two-phase flows
I Handling of coalescence and separation regimes
Slide: 31/31
46. Discussion and Future Work
Successful implementation of mesh-topology modification
algorithms
Highly versatile application range
Conservative solution transfer
Efficient due to shared / distributed memory parallelization
Future focus:
I Constrained, cost-effective remapping for divergence-free fluxes
I Testing / validation of two-phase flows
I Handling of coalescence and separation regimes
Thank You
Slide: 31/31
48. Governing Equations
Newtonian Stress Tensor:
σ = −pI + τ
τ = µ[∇v + (∇v)T
]
Incompressible Navier Stokes Equations:
Z
S
n · v dS = 0
d
dt
Z
V
ρv dV +
Z
S
n · ρ(v − vs)v dS =
Z
V
ρg dV −
Z
V
∇p dV +
Z
S
n · (µ∇v) dS
49. Conditions at a Fluid Interface
Dynamic Condition:
Z
S
n · σ2 dS −
Z
S
n · σ1 dS +
Z
∂S
mσ dL = 0
50. Conditions at a Fluid Interface
Dynamic Condition:
Z
S
n · σ2 dS −
Z
S
n · σ1 dS +
Z
∂S
mσ dL = 0
Differential Form:
(p2 − p1)n − n · (τ2 − τ1) = ∇sσ + κσn
Normal Stress Balance:
(p2 − p1) − nn: (τ2 − τ1) = κσ
Tangential Stress Balance:
n · (τ2 − τ1) − n[nn: (τ2 − τ1)] = −∇sσ
51. Conditions at a Fluid Interface
Dynamic Condition:
Z
S
n · σ2 dS −
Z
S
n · σ1 dS +
Z
∂S
mσ dL = 0
Kinematic Condition:
n · v2 − n · v1 = 0
Momentum transfer:
(I − nn) · v2 − (I − nn) · v1 = 0
Continuity of Velocity:
v2 = v1
53. Mesh Smoothing
Local Optimization:
Gauss-Seidel iteration over vertices
Maximize quality of local cell-group
Global convergence is unclear
Global Optimization:
Maximize quality of all elements simultaneously
Typically involves large, sparse-matrices
Attempts to find a global optimum
May not adequately penalize worst quality cells