Darcy Problem

Summary

Solves a 2D mixed Darcy problem. This is a saddle point problem, discretized using Raviart-Thomas finite elements (velocity ) and piecewise discontinuous polynomials (pressure ). This example demonstrates the use of transposition in the input file for mixed problems with different trial and test variables. This example is based on MFEM Example 5.

Description

This problem solves a mixed Darcy problem with strong form:

where , , and .

In this example, we solve this using the weak form

where

Example File

[Mesh<<<{"href": "../Mesh/index.html"}>>>]
  type = MFEMMesh
  file = ../mesh/star.mesh
  uniform_refine<<<{"description": "Specify the level of uniform refinement applied to the initial mesh"}>>> = 4
[]

[Problem<<<{"href": "../Problem/index.html"}>>>]
  type = MFEMProblem
[]

[Functions<<<{"href": "../Functions/index.html"}>>>]
  [exact_velocity]
    type = ParsedVectorFunction<<<{"description": "Returns a vector function based on string descriptions for each component.", "href": "../../source/functions/MooseParsedVectorFunction.html"}>>>
    expression_x<<<{"description": "x-component of function."}>>> = '-exp(x) * sin(y)'
    expression_y<<<{"description": "y-component of function."}>>> = '-exp(x) * cos(y)'
  []
  [exact_pressure]
    type = ParsedFunction<<<{"description": "Function created by parsing a string", "href": "../../source/functions/MooseParsedFunction.html"}>>>
    expression<<<{"description": "The user defined function."}>>> = 'exp(x) * sin(y)'
  []
  [exact_pressure_rhs]
    type = ParsedFunction<<<{"description": "Function created by parsing a string", "href": "../../source/functions/MooseParsedFunction.html"}>>>
    expression<<<{"description": "The user defined function."}>>> = '-exp(x) * sin(y)'
  []
[]

[FESpaces]
  [HDivFESpace]
    type = MFEMVectorFESpace
    fec_type = RT
    fec_order = SECOND
  []
  [L2FESpace]
    type = MFEMScalarFESpace
    fec_type = L2
    fec_order = SECOND
  []
[]

[Variables<<<{"href": "../Variables/index.html"}>>>]
  [velocity]
    type = MFEMVariable
    fespace = HDivFESpace
  []
  [pressure]
    type = MFEMVariable
    fespace = L2FESpace
  []
[]

[BCs<<<{"href": "../BCs/index.html"}>>>]
  [flux_boundaries]
    type = MFEMVectorFEBoundaryFluxIntegratedBC
    variable = velocity
    coefficient = exact_pressure_rhs
  []
[]

[Kernels<<<{"href": "../Kernels/index.html"}>>>]
  [VelocityMass]
    type = MFEMVectorFEMassKernel
    variable = velocity
  []
  [PressureGrad]
    type = MFEMVectorFEDivergenceKernel
    trial_variable = pressure
    variable = velocity
    coefficient = -1
    transpose = true
  []
  [VelocityDiv]
    type = MFEMVectorFEDivergenceKernel
    trial_variable = velocity
    variable = pressure
    coefficient = -1
  []
[]

[Solver]
  type = MFEMSuperLU
[]

[Executioner<<<{"href": "../Executioner/index.html"}>>>]
  type = MFEMSteady
  device = cpu
[]

[Postprocessors<<<{"href": "../Postprocessors/index.html"}>>>]
  [velocity_error]
    type = MFEMVectorL2Error
    variable = velocity
    function = exact_velocity
  []
  [pressure_error]
    type = MFEML2Error
    variable = pressure
    function = exact_pressure
  []
[]

[Outputs<<<{"href": "../Outputs/index.html"}>>>]
  [ParaViewDataCollection]
    type = MFEMParaViewDataCollection
    file_base = OutputData/Darcy
    vtk_format = ASCII
  []
  [DarcyErrorCSV]
    type = CSV<<<{"description": "Output for postprocessors, vector postprocessors, and scalar variables using comma seperated values (CSV).", "href": "../../source/outputs/CSV.html"}>>>
    file_base<<<{"description": "The desired solution output name without an extension. If not provided, MOOSE sets it with Outputs/file_base when available. Otherwise, MOOSE uses input file name and this object name for a master input or uses master file_base, the subapp name and this object name for a subapp input to set it."}>>> = OutputData/Darcy
  []
[]
(moose/test/tests/mfem/kernels/darcy.i)