BCs System

The BCs system is used to impose boundary conditions in a finite element problem. Each BC object sets the boundary condition for a single variable/equation, though multiple boundaries may be specified at once.

commentnote

See FVBCs for boundary conditions of finite volume problems.

Some of the main types of boundary conditions are: - Dirichlet Boundary conditions to set the value of a variable on a boundary - Neumann Boundary conditions to set a flux for the equation corresponding to the variable. Depending on the equation being solved, this can be equivalent to setting the value of the derivative of the variable on the boundary - Robin boundary conditions to solve an equation tying both the variable value and its derivatives on the boundary

In MOOSE, boundary conditions are split in two categories: NodalBCs and IntegratedBCs. Similar to kernels, computeQpResidual/Jacobian are the main routine to implement for most boundary conditions. Automatic differentiation is implemented for boundary conditions. AD BCs do not require implementing computeQpJacobian.

Nodal boundary conditions

Nodal boundary conditions are applied on nodes in the mesh. Nodal boundary conditions may only be applied on variables that have degrees of freedom at nodes, such as Lagrange variables.

We show below code snippets for the DirichletBCBase. This boundary condition sets the value of a variable on a node.

If the value is preset, the computeQpValue is called instead of the computeQpResidual. This value is then directly placed in the solution vector.

  params.addRequiredParam<Real>("value", "Value of the BC");
  params.declareControllable("value");
  params.addClassDescription("Imposes the essential boundary condition $u=g$, where $g$ "
                             "is a constant, controllable value.");
  return params;
}
(../moose/framework/src/bcs/DirichletBC.C)

If the value is not preset, the computeQpResidual routine is called. The residual of a non-preset DirichletBC is simply the difference between the desired value and the current variable value.

Real
DirichletBCBase::computeQpResidual()
{
  return _u[_qp] - computeQpValue();
}
(../moose/framework/src/bcs/DirichletBCBase.C)
commentnote

_qp, the index over quadrature points, is simply 0 on nodes. We use this indexing in order to keep consistent user interfaces.

Integrated boundary conditions

Integrated boundary conditions are applied on sides in the mesh. A local quadrature-based integration is performed to compute the residual and Jacobian contribution of the boundary condition.

In the following snippet, we show the definition of the contribution to the residual of a FunctionNeumannBC. The computeQpResidual simply returns the value of the flux.

Real
FunctionNeumannBC::computeQpResidual()
{
  return -_test[_i][_qp] * _func.value(_t, _q_point[_qp]);
}
(../moose/framework/src/bcs/FunctionNeumannBC.C)

Available Objects

  • Moose App
  • ADConservativeAdvectionBCBoundary condition for advection when it is integrated by parts. Supports Dirichlet (inlet-like) and implicit (outlet-like) conditions.
  • ADDirichletBCImposes the essential boundary condition , where is a constant, controllable value.
  • ADFunctionDirichletBCImposes the essential boundary condition , where is calculated by a function.
  • ADFunctionNeumannBCImposes the integrated boundary condition , where is a (possibly) time and space-dependent MOOSE Function.
  • ADFunctionPenaltyDirichletBCEnforces a (possibly) time and space-dependent MOOSE Function Dirichlet boundary condition in a weak sense by penalizing differences between the current solution and the Dirichlet data.
  • ADMatNeumannBCImposes the integrated boundary condition , where is a constant, is a material property, and is a coefficient defined by the kernel for .
  • ADMatchedValueBCImplements a NodalBC which equates two different Variables' values on a specified boundary.
  • ADNeumannBCImposes the integrated boundary condition , where is a constant, controllable value.
  • ADPenaltyDirichletBCEnforces a Dirichlet boundary condition in a weak sense by penalizing differences between the current solution and the Dirichlet data.
  • ADVectorFunctionDirichletBCImposes the essential boundary condition , where components are calculated with functions.
  • ADVectorFunctionNeumannBCImposes the integrated boundary condition , where is a (possibly) time and space-dependent MOOSE Function.
  • ADVectorMatchedValueBCImplements a ADVectorNodalBC which equates two different Variables' values on a specified boundary.
  • ArrayDirichletBCImposes the essential boundary condition , where are constant, controllable values.
  • ArrayHFEMDirichletBCImposes the Dirichlet BC with HFEM.
  • ArrayNeumannBCImposes the integrated boundary condition , where is a constant, controllable value.
  • ArrayPenaltyDirichletBCEnforces a Dirichlet boundary condition in a weak sense with , where is the constant scalar penalty; is the test functions and is the differences between the current solution and the Dirichlet data.
  • ArrayVacuumBCImposes the Robin boundary condition .
  • ConvectiveFluxBCDetermines boundary values via the initial and final values, flux, and exposure duration
  • CoupledVarNeumannBCImposes the integrated boundary condition , where is a variable.
  • DGFunctionDiffusionDirichletBCDiffusion Dirichlet boundary condition for discontinuous Galerkin method.
  • DiffusionFluxBCComputes a boundary residual contribution consistent with the Diffusion Kernel. Does not impose a boundary condition; instead computes the boundary contribution corresponding to the current value of grad(u) and accumulates it in the residual vector.
  • DirichletBCImposes the essential boundary condition , where is a constant, controllable value.
  • EigenArrayDirichletBCArray Dirichlet BC for eigenvalue solvers
  • EigenDirichletBCDirichlet BC for eigenvalue solvers
  • FunctionDirichletBCImposes the essential boundary condition , where is a (possibly) time and space-dependent MOOSE Function.
  • FunctionGradientNeumannBCImposes the integrated boundary condition arising from integration by parts of a diffusion/heat conduction operator, and where the exact solution can be specified.
  • FunctionNeumannBCImposes the integrated boundary condition , where is a (possibly) time and space-dependent MOOSE Function.
  • FunctionPenaltyDirichletBCEnforces a (possibly) time and space-dependent MOOSE Function Dirichlet boundary condition in a weak sense by penalizing differences between the current solution and the Dirichlet data.
  • FunctorNeumannBCImposes the integrated boundary condition , where is a functor.
  • HFEMDirichletBCImposes the Dirichlet BC with HFEM.
  • LagrangeVecDirichletBCImposes the essential boundary condition , where are constant, controllable values.
  • LagrangeVecFunctionDirichletBCImposes the essential boundary condition , where components are calculated with functions.
  • MatNeumannBCImposes the integrated boundary condition , where is a constant, is a material property, and is a coefficient defined by the kernel for .
  • MatchedValueBCImplements a NodalBC which equates two different Variables' values on a specified boundary.
  • NeumannBCImposes the integrated boundary condition , where is a constant, controllable value.
  • OneDEqualValueConstraintBCComputes the integral of lambda times dg term from the mortar method (for two 1D domains only).
  • PenaltyDirichletBCEnforces a Dirichlet boundary condition in a weak sense by penalizing differences between the current solution and the Dirichlet data.
  • PostprocessorDirichletBCDirichlet boundary condition with value prescribed by a Postprocessor value.
  • PostprocessorNeumannBCNeumann boundary condition with value prescribed by a Postprocessor value.
  • SinDirichletBCImposes a time-varying essential boundary condition , where varies from an given initial value at time to a given final value over a specified duration.
  • SinNeumannBCImposes a time-varying flux boundary condition , where varies from an given initial value at time to a given final value over a specified duration.
  • VacuumBCVacuum boundary condition for diffusion.
  • VectorCurlPenaltyDirichletBCEnforces a Dirichlet boundary condition for the curl of vector nonlinear variables in a weak sense by applying a penalty to the difference in the current solution and the Dirichlet data.
  • VectorDirichletBCImposes the essential boundary condition , where are constant, controllable values.
  • VectorFunctionDirichletBCImposes the essential boundary condition , where components are calculated with functions.
  • VectorNeumannBCImposes the integrated boundary condition , where is a user-defined, constant vector.
  • VectorPenaltyDirichletBCEnforces a Dirichlet boundary condition for vector nonlinear variables in a weak sense by applying a penalty to the difference in the current solution and the Dirichlet data.
  • WeakGradientBCComputes a boundary residual contribution consistent with the Diffusion Kernel. Does not impose a boundary condition; instead computes the boundary contribution corresponding to the current value of grad(u) and accumulates it in the residual vector.
  • Tensor Mechanics App
  • ADPenaltyInclinedNoDisplacementBCPenalty Enforcement of an inclined boundary condition
  • ADPressureApplies a pressure on a given boundary in a given direction
  • ADTorqueApply a moment as tractions distributed over a surface around a pivot point. This should operate on the displaced mesh for large deformations.
  • CoupledPressureBCApplies a pressure from a variable on a given boundary in a given direction
  • DashpotBC
  • DisplacementAboutAxisImplements a boundary condition that enforces rotationaldisplacement around an axis on a boundary
  • InteractionIntegralBenchmarkBCImplements a boundary condition that enforces a displacement field around a crack tip based on applied stress intensity factors.
  • PenaltyInclinedNoDisplacementBCPenalty Enforcement of an inclined boundary condition
  • PresetAccelerationPrescribe acceleration on a given boundary in a given direction
  • PresetDisplacementPrescribe the displacement on a given boundary in a given direction.
  • PresetVelocity
  • PressureApplies a pressure on a given boundary in a given direction
  • StickyBCImposes the boundary condition if exceeds the bounds provided
  • TorqueApply a moment as tractions distributed over a surface around a pivot point. This should operate on the displaced mesh for large deformations.
  • Electromagnetics App
  • EMRobinBCFirst order Robin-style Absorbing/Port BC for scalar variables, assuming plane waves.
  • VectorEMRobinBCFirst order Robin-style Absorbing/Port BC for vector variables.
  • VectorTransientAbsorbingBCFirst order transient absorbing boundary condition for vector variables.
  • Ferret App
  • CoupledDirichletBC
  • ElectronCurrentDensityBC
  • HoleCurrentDensityBC
  • HydrostaticBC
  • SurfaceMechanicsBC

Available Subsystems

Available Actions

  • Moose App
  • AddBCActionAdd a BoundaryCondition object to the simulation.