MOOSE Newsletter (May 2025)

MOOSE Improvements

MFEM capability development

MFEM-based objects in MOOSE have moved to a functor-like design for coefficient parameters. Whereas previously near-duplicate objects were required to operate with Function or MaterialPropertyName parameters, a newly-streamlined set of MFEM-based objects takes MFEMXXXCoefficientName parameters, where XXX can be Scalar, Vector, or Matrix. Function and functor material properties are stored in a single coefficient database which allows for this single parameter type design.

MOOSE also newly-implemented support for MFEM's low-order-refined (LOR) solver capabilities. We reproduce some of the documentation in MFEMSolverBase. LOR solvers work by taking a problem and casting it onto a spectrally-equivalent one with lower polynomial order and more refined mesh. Due to the scaling properties of the computing time with respect to polynomial order and mesh size, this change will often result in a significant performance improvement, which tends to be more pronounced at higher polynomial orders. More details can be found here.

Input Syntax Highlighting in Documentation

The MOOSE documentation generation engine, named MooseDocs, now has syntax highlighting for MOOSE input snippets. This includes an additional feature that automatically links to syntax, object, and parameter documentation within the code snippets if including the AppSyntax extension. Readers can hover over the object name and parameter to get a description of the object and parameters. The syntax and objects are also linked to their prescribed documentation pages; readers can click on these links directly in the snippet to navigate to these pages. Try it out with the following examples:

!listing! language=moose
[FunctorMaterials]
  [mat]
    type = ParsedFunctorMaterial
    property_name = 'pressure'
    expression = 'rho * R * T'
    functor_symbols = 'rho R T'
    functor_names = 'density ${gas_constant} temperature'
  []
[]
!listing-end!
[FunctorMaterials<<<{"href": "../../syntax/FunctorMaterials/index.html"}>>>]
  [mat]
    type = ParsedFunctorMaterial<<<{"description": "Computes a functor material from a parsed expression of other functors.", "href": "../../source/functormaterials/ParsedFunctorMaterial.html"}>>>
    property_name<<<{"description": "Name to give the new functor material property"}>>> = 'pressure'
    expression<<<{"description": "Expression to parse for the new functor material"}>>> = 'rho * R * T'
    functor_symbols<<<{"description": "Symbolic name to use for each functor in 'functor_names' in the parsed expression. If not provided, then the actual functor names must be used in the parsed expression."}>>> = 'rho R T'
    functor_names<<<{"description": "Functors to use in the parsed expression"}>>> = 'density ${gas_constant} temperature'
  []
[]
!listing moose/test/tests/kernels/simple_diffusion/simple_diffusion.i
[Mesh<<<{"href": "../../syntax/Mesh/index.html"}>>>]
  type = GeneratedMesh
  dim = 2
  nx = 10
  ny = 10
[]

[Variables<<<{"href": "../../syntax/Variables/index.html"}>>>]
  [u]
  []
[]

[Kernels<<<{"href": "../../syntax/Kernels/index.html"}>>>]
  [diff]
    type = Diffusion<<<{"description": "The Laplacian operator ($-\\nabla \\cdot \\nabla u$), with the weak form of $(\\nabla \\phi_i, \\nabla u_h)$.", "href": "../../source/kernels/Diffusion.html"}>>>
    variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = u
  []
[]

[BCs<<<{"href": "../../syntax/BCs/index.html"}>>>]
  [left]
    type = DirichletBC<<<{"description": "Imposes the essential boundary condition $u=g$, where $g$ is a constant, controllable value.", "href": "../../source/bcs/DirichletBC.html"}>>>
    variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = u
    boundary<<<{"description": "The list of boundary IDs from the mesh where this object applies"}>>> = left
    value<<<{"description": "Value of the BC"}>>> = 0
  []
  [right]
    type = DirichletBC<<<{"description": "Imposes the essential boundary condition $u=g$, where $g$ is a constant, controllable value.", "href": "../../source/bcs/DirichletBC.html"}>>>
    variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = u
    boundary<<<{"description": "The list of boundary IDs from the mesh where this object applies"}>>> = right
    value<<<{"description": "Value of the BC"}>>> = 1
  []
[]

[Executioner<<<{"href": "../../syntax/Executioner/index.html"}>>>]
  type = Steady
  solve_type = 'PJFNK'
  petsc_options_iname = '-pc_type'
  petsc_options_value = 'hypre'
[]

[Outputs<<<{"href": "../../syntax/Outputs/index.html"}>>>]
  exodus<<<{"description": "Output the results using the default settings for Exodus output."}>>> = true
[]
(test/tests/kernels/simple_diffusion/simple_diffusion.i)

Postprocessor Restore on Failed Timestep

Postprocessors are now automatically restored to their previous value when a solve fails in a timestep. Previously, statefulness was observed in postprocessor values when a timestep was repeated due to a failed solve, potentially causing discrepancy in the converged solution. VectorPostprocessors and Reporters are also restored, but only if an old value has been requested. More information can be found on the linked pages.

Online mesh modification improvements

The SidesetAroundSubdomainUpdater can now support updating boundaries as they traverse inside h-refined elements during adaptivity.

This same MeshModifier can now use a "mask" sideset to decide whether to update a boundary or not. Only sides part of the mask sideset are updated.

Vector variables improvement

A VectorValueJumpIndicator was added to perform adaptivity based on the jump in values of a vector variable between neighboring cells.

The old values, e.g. from the previous time step, of a vector variable can now be retrieved using the Coupleable::coupledVectorValuesOld API.

MOOSE Modules Changes

Thermal Hydraulics: Gas Mixture Flow Model

The Thermal Hydraulics module has added the Gas mixture flow model, which allows one-dimensional gas mixtures to be simulated using a single-phase mixture formulation, which resembles the Single-phase flow model but with an additional partial differential equation for the secondary gas species and additional terms for diffusion of mass and energy.

The use_scalar_variables parameter in Junctions was deprecated. See Deprecated use_scalar_variables for more details.

Heat Transfer module

The finite volume discretization for the heat conduction equation can now support functors for the material properties.

Fluid Properties module

LeadLithiumFluidProperties were added to the module to model fluid flow in fusion device blanket components.

The linear finite volume implementation of the SIMPLE/PIMPLE algorithm can now support both Neumann and convective boundary conditions, the latter using a correlation to set the surface heat transfer coefficient.

Solid mechanics module

The ExplicitMixedOrder time integrator was improved to support mixed-order time integration scheme, using central difference for some variables and first-order Euler for others. This mixed-order approach can avoid using an unstable second-order scheme for equations known to have these issues.

libMesh-level Changes

2025.05.23 Update

  • Added a System::parameters object, which can be used to selectively override EquationSystems::parameters

  • Improved support for vector-valued elements on meshes with 2D elements outside the XY plane in 3D space

  • Initial support for Polyhedron type elements, with one basic subclass and hand-coded unit tests. Critical support for mesh generation and I/O is still forthcoming.

  • The Elem::set_node() setter which returns a reference has been deprecated and replaced by a version which takes the value to set. This provides compatibility with new Polyhedron support.

  • Added Elem::type_to_dim_map and Elem::type_to_default_order_map, enabling code to query the dimension and/or default order of an ElemType without actually building an element.

  • Added NumericVector::print_matlab() and NumericVector::read_matlab() I/O methods

  • MeshBase::write() is now a const member

  • Elem::disconnected_clone() can now clone elements which have not yet been given a valid unique_id().

  • Autodetection of slate use in PETSc, to initialize MPI with the MPI_THREAD_MULTIPLE setting for slate compatibility.

  • solid_angle() function for evaluating the solid angle defined by three vectors

  • Code refactoring for clarity and simplicity:

    • Orientation-determining code for advanced finite element types

    • Tet::choose_diagonal() for tetrahedron refinement

    • More local variables declared const as appropriate

    • Unit tests are easier to make compatible with --enable-complex builds

  • Removed workaround for overzealous gcc 8.1 warnings about gzstream headers; newer compilers including gcc 8.5 do not emit warnings.

  • Avoid poor triangulator behavior when given an inconsistent boundary input mesh

  • Performance logging of n_connected_components() mesh tool

  • Many bug fixes:

    • More rigorous implementation and verification of MeshBase::clone(). This fixes issues that can arise when certain MOOSE mesh generators accept input meshes which are incompletely prepared and have been cloned for use in multiple mesh generators.

    • UnstructuredMesh::copy_nodes_and_elements() no longer copies other metadata such as preparation policy settings from its source mesh. That copying has been moved to copy constructors which need it, and no longer occurs during mesh stitching. This fixes partitioning failures in a reactor module mesh generator.

    • UnstructuredMesh::copy_nodes_and_elements() is more careful about marking its target as unprepared if any combination of inputs might cause it to be unprepared

    • Fix for automatic interior-parents detection on refined meshes

    • Backported NetCDF fix for compatibility with C23 C compilers

    • Fixes for compiler -fsanitize-integer warnings

    • Many fixes for libMesh builds with Real defined to be other than double. Many more libMesh capabilities such as higher-order quadrature rules are no longer truncated to 64-bit or 80-bit accuracy when used with 128-bit-Real builds.

PETSc-level Changes

Bug Fixes, Minor Changes, and Minor Enhancements

  • MOOSE will now error if coordinate transformation parameters are passed in a single simulation context. These parameters are intended for coupling between MultiApps using different frames of references.

  • The CopyMeshPartitioner was added to MOOSE to let a MultiApp copy the spatial mesh partitioning of its parent application. This is intended to reduce the amount of off-process communication in Transfers.

  • The FunctorExtremaPositions was added to MOOSE to gather the locations of N extrema (max/min/max absolute) of a functor. In future, this will let us spawn simulations at these bounding locations.

  • Physics can now skip object-creation tasks through the dont_create_kernels/bcs/... parameters that a user passes. This can be useful to combine Physics with standard MOOSE syntax.

  • Recover testing has been enabled on the contact and combined modules. This ensures that future development in those modules can either create a checkpoint and recover from this checkpoint, or properly error if it does not support this feature.

  • PETSc options can now be passed to each equation solve inside SubChannel problems, using the pre-defined prefixes.

  • An additional EXEC_POST_ADAPTIVITY execution schedule was added to MOOSE. This notably enables transferring markers to match adaptivity refinement patterns between a parent and its child applications.

  • The Makefile for moose was improved to avoid errors on missing libtorch or libmfem on unrelated targets.

  • JSON output of the perf graph was enabled. This is intended for automated examination of solver performance by the MOOSE continuous integration platform.

  • The ADEqualValueEmbeddedConstraint was added to MOOSE. This facilitates the use of automatic differentiation (AD) in that system, enabling numerically-perfect Jacobians without hand-coding the Jacobian.

  • The LibtorchNeuralNetControl object can now be used for recover simulations.

  • The displaced mesh is now correctly displaced if adaptivity is run without actually modifying the mesh, because the Markers showed no adaptivity was needed.

  • The reporting of the preconditioner in the simulation header has been improved to correctly report the preconditioner when modified using the command line. Reporting for simulations with multiple systems/variables has also been made clearer.

  • The FParser epsilon, a constant used for removing terms during the function optimization phase, has been set to zero (0) to prevent undesirable behavior.

  • The DebugResidualAux will now properly return an error when used with incompatible variable types.

  • The BoundaryLayerSubdomainGenerator was added to MOOSE to change the subdomain ID of elements near one or more boundaries. This enables singling out these elements for custom boundary treatments, such as wall functions in computational fluid dynamics.

  • Modifications were added to the ghosting specifications of finite volume residual objects, enabling split mesh workflows.