MOOSE Framework

Category: Open-Source CAE | Revised 2026-10-02
CAE visualization for moose framework theory - technical simulation diagram
MOOSE Framework

Theory: writing physics as residuals

Overview

🙋

How does MOOSE differ from other open-source finite element codes?

🎓

It is a framework for building analysis codes rather than an analysis code itself. MOOSE (Multiphysics Object Oriented Simulation Environment) is developed at Idaho National Laboratory; it delegates meshing to libMesh and linear and nonlinear solvers to PETSc, and the user writes only the residual of each governing equation. For heat conduction you write the diffusion term and the source term as separate Kernels and list them in an input file; MOOSE sums and solves them. Adding physics means adding Kernels: all unknowns — thermal, mechanical, chemical — are assembled into one nonlinear system and solved together by Newton's method. BISON, which models nuclear fuel behaviour, and many other research codes are built on it.

Residuals and Newton's method

$$ R_i(u) = \int_\Omega \left( k(u)\,\nabla\psi_i\cdot\nabla u - \psi_i f \right) d\Omega = 0,\qquad J_{ij} = \frac{\partial R_i}{\partial u_j},\qquad J\,\delta u = -R $$

ψᵢ are test functions, k(u) a solution-dependent coefficient, f the source and J the Jacobian. MOOSE either builds J (possibly approximately) or uses JFNK (Jacobian-Free Newton-Krylov), computing J·v from residual differences without forming the matrix.

Verification by manufactured solutions

$$ u_{ex} = \sin(\pi x),\quad f = \pi^2 \sin(\pi x),\qquad p = \log_2 \frac{e_{N}}{e_{2N}} $$

Choose the solution first and back out the source f that it satisfies. The convergence order p comes from the error ratio when the element count N doubles, compared with theory (for linear elements, 2 for values and 1 for gradients).

Coffee Break Trivia

A framework born for nuclear fuel

MOOSE development began around 2008 at Idaho National Laboratory to model nuclear fuel. Inside a fuel pellet, heat, deformation, fission gas release and material changes all affect one another, and running separate codes in sequence could not handle the strong coupling. The chosen design — physics written as residuals, with coupling and solvers handled by the framework — was released as open source in 2014.

Worked examples

Example 1: checking convergence order with sin(πx)

Solve −u″ = f on [0, 1] with linear elements, u = 0 at both ends; the exact solution is sin(πx).

Elements NL2 errorGradient errorL2 orderGradient order
43.93×10⁻²0.499——
89.92×10⁻³0.2511.990.99
162.49×10⁻³0.1262.001.00
326.22×10⁻⁴0.06302.001.00

Each halving of element size cuts the L2 error by 4 and the gradient error by 2, matching theory.

🙋

Comparing nodal values with the exact solution, the error was below 10⁻⁷ even with 4 elements. Is that already accurate enough?

🎓

That is a quirk of linear elements in 1D, and it misleads easily. In this problem the nodal values alone almost match the exact solution (superconvergence), yet between nodes and in the gradient the table shows an L2 error of 4×10⁻² and a gradient error of 0.5 with 4 elements. Looking only at nodes can hide a wrong element implementation. In MOOSE the standard is to measure error with integral norms such as L2 and the H1 seminorm and to judge by the order as elements are refined two and four times. If the order departs from theory, suspect a Kernel sign, quadrature, or how boundary conditions are applied.

Example 2: Newton vs Picard on nonlinear diffusion

−(k(u)u′)′ = 10 with k = 1 + u², u = 0 at both ends, 32 elements. Compare iterations until the residual norm drops below 10⁻¹⁰.

MethodIterationsMax u
Newton (consistent Jacobian)50.957
Picard (k frozen at previous iterate)120.957
For reference: k = 1 (linear)11.250

Near convergence Newton's residual falls quadratically (7×10⁻³ → 4×10⁻⁶), while Picard reduces it only about tenfold per iteration. Because k grows with u, the maximum drops from 1.25 in the linear case to 0.957.

🙋

If Newton is always better, why are segregated, one-after-another schemes still used?

🎓

Newton's weaknesses are the effort of building a correct Jacobian and its tendency to diverge from a poor initial guess. When you want to reuse existing codes per physics, or the coupling is weak enough to converge in a few exchanges, segregated schemes are simpler and faster. MOOSE supports both: strongly coupled variables go into one Newton system, while weakly coupled physics or those on different time scales can be solved separately as MultiApps that exchange data. An inaccurate Jacobian loses quadratic convergence and the iteration count climbs toward Picard's, so MOOSE also offers a check that compares Kernel derivatives against a finite-difference Jacobian.

Getting started

  1. Set up an environment (e.g. conda), build MOOSE and run its tests once.
  2. Run a bundled example such as heat conduction from its input file and learn how Kernels, boundary conditions and the Executioner are written.
  3. After writing your own Kernel, verify its convergence order with a manufactured solution.
  4. For nonlinear problems, watch Newton iteration counts to confirm the Jacobian is right.
  5. Register verified cases as tests and run them automatically on every change.
Coffee Break Trivia

“The order stalled at 1.5”

When you implement a new boundary condition as a Kernel and check it with a manufactured solution, the L2 order often stalls near 1.5 instead of 2. The cause is usually a small inconsistency: boundary terms not evaluated at the same quadrature as the interior, or a source approximated by nodal values. The plotted results look plausible, so such errors are found only by measuring the order. That is why verification tests carry so much weight in MOOSE development.

Common mistakes

Mistakes and fixes

MistakeEffectFix
Verifying with nodal values onlyImplementation errors missedCheck order in L2/H1 norms
Wrong JacobianNewton iterations growCompare with a finite-difference Jacobian
Sign error in a KernelDivergence or reversed solutionCheck with MMS
Initial guess far from the solutionNewton divergesApproach by load stepping or time marching
Lumping weak couplings into one systemExpensive solvesSeparate with MultiApps
🙋

I'd like to learn related topics.

Related Simulators

Experience the theory firsthand with the interactive simulator for this field

All Simulators

Related fields

Structural AnalysisFluid Analysis (CFD)Thermal Analysis
Rate this article
Thank you for your feedback!
Helpful
More details
Report error
Helpful
0
More details
0
Report error
0