Refining the Finite Element Mesh on Demand: Adaptive Mesh Refinement in Ansys Mechanical
Learn how Ansys Mechanical’s Adaptive Mesh Refinement (AMR) uses ZZ‑based error estimation to automatically refine only the elements that need it. Follow a step‑by‑step example on a cantilever beam, check convergence, and understand the trade‑offs.
24 Dec 2025, 22:07 UTC

Why Adaptive Mesh Refinement Matters
When solving structural problems in Ansys Mechanical, the quality of the mesh directly influences solution accuracy and computational cost. A common practice is to start with a coarse mesh, run a solution, and then manually refine elements near high‑stress or high‑strain regions. This manual tweaking is time‑consuming and can miss critical areas, especially in complex geometries or multiphysics setups.
Adaptive Mesh Refinement (AMR) automates this process by iteratively refining only those elements where an error estimator indicates the discretization is insufficient. The result is a mesh that concentrates elements where they are needed most, keeping the overall element count—and thus memory usage and solution time—lower than a uniformly refined mesh.
How Ansys Implements AMR
Starting with Ansys R19.2, the software introduced a residual‑based error estimator, often referred to as the ZZ (Zienkiewicz–Zhu) indicator. The steps are:
- Run an initial solution on the base mesh.
- Generate per‑element error estimates based on equilibrium residuals.
- Mark elements whose error exceeds a user‑defined threshold.
- Refine marked elements either by subdividing (h‑refinement) or increasing polynomial order (p‑refinement).
- Re‑solve the updated mesh and repeat until the error distribution meets the convergence criteria.
The process is fully integrated into the Mesh menu under Adaptive Mesh → Start Adaptive. The tool supports structural, thermal, and coupled multiphysics studies.
Practical Example: A Cantilever Beam
Below is a step‑by‑step illustration of AMR on a classic Euler–Bernoulli cantilever beam, a model with an analytical solution that makes it easy to verify convergence.
- Create the Geometry
// 3‑D beam: 100 mm length, 10 mm width, 5 mm thickness beam = Part("Beam", 100, 10, 5); - Assign Material
steel = Material("Steel", E=210e9, nu=0.3, rho=7850); beam.material = steel; - Apply Boundary Conditions
// Fixed at z=0 face beam.boundaries.addFixed(z=0); // Apply a 5 kN downward load at free end beam.loads.addPointLoad(5e3, direction="-z", location="free_end"); - Initial Mesh
// Use a global mesh size of 10 mm (coarse) mesh = Mesh(beam, size=10); - Run Initial Solution
solve(mesh); - Start Adaptive Refinement
// In the Mechanical GUI: Mesh → Adaptive Mesh → Start Adaptive // Set error threshold to 5% of the maximum element error adaptive = AdaptiveMesh(mesh, errorThreshold=0.05); adaptive.run(); - Inspect Error Distribution
// Export per‑element error values errorData = adaptive.exportError("error.txt"); - Verify Convergence
// Compare peak stress from the last adaptive step to analytical value stressAnalytical = 3*5e3*0.05/(10*5**2); // Simplified formula stressNumerical = mesh.results.maxStress(); print("Error ", abs(stressNumerical - stressAnalytical)/stressAnalytical);
After the first refinement cycle, you should see a significant drop in the error indicator around the fixed end, where stress concentration is highest. Subsequent cycles will refine the mesh further until the error falls below the set threshold. The final mesh typically contains only 10–20% of the elements of a uniformly refined mesh that would achieve the same accuracy.
Trade‑offs and Limitations
- Memory Footprint – Each refinement step increases the element count. In large 3‑D models, even a few refinement cycles can push RAM usage beyond available resources. Monitor the Memory Usage panel in the solver log.
- Hanging Nodes – Subdividing elements can create non‑conformal interfaces. Ansys automatically heals most cases, but complex geometries may require manual healing or a global mesh repair command.
- Estimator Sensitivity – The ZZ indicator is designed for linear elasticity. For problems with strong material nonlinearity, contact, or large deformations, the error estimator may not capture all sources of discretization error, leading to over‑ or under‑refinement.
- Solver Backends – In earlier Ansys releases (R19.1 and earlier), the ZZ estimator behaved inconsistently across the finite element and finite volume solvers. Stick to R19.2 or newer for stable results.
How to Check Your AMR Result
- Plot the Error Map – Use the Plot → Error option to color‑code elements by their error indicator. Refined elements should cluster around high‑error zones.
- Compare a Quantity of Interest – Run a mesh convergence study: solve the same problem on the base mesh, after one refinement, after two refinements, etc., and plot the peak stress or displacement. The curve should flatten as refinement depth increases.
- Export Mesh Statistics – Ansys provides Mesh Statistics (Elements, Nodes, Hanging Nodes) after each refinement. Verify that the number of hanging nodes remains zero or a tolerable number.
- Cross‑Validate with Analytical Solution – Where possible, compare the numerical result with an analytical benchmark. For the cantilever beam, the analytical bending stress at the fixed end is \\sigma = \frac{3 M c}{I}\; with M=5 kN·m, c=2.5 mm, I=10·5^3/12.
Bottom Line
Adaptive Mesh Refinement in Ansys Mechanical is a powerful tool that can dramatically reduce computational cost while maintaining or improving accuracy. By letting the solver decide where to refine, you avoid the pitfalls of manual mesh tweaking and ensure that critical regions receive the resolution they need. Just remember to monitor memory usage, validate the error estimator against known solutions, and be aware of the potential for hanging nodes in complex geometries.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.