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.
  • ADCoupledVarNeumannBCImposes the integrated boundary condition , where is a variable.
  • 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.
  • ADRobinBCImposes the Robin integrated boundary condition .
  • 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.
  • ADVectorRobinBCImposes the Robin integrated boundary condition .
  • 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.
  • DirectionalNeumannBCImposes the integrated boundary condition , where is a user-defined, constant 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.
  • FunctorDirichletBCImposes the Dirichlet boundary condition , where is a functor and can have complex dependencies.
  • 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.
  • VectorDivPenaltyDirichletBCEnforces, in a weak sense, a Dirichlet boundary condition on the divergence of a nonlinear vector variable by applying a penalty to the difference between the current solution and the Dirichlet data.
  • 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.
  • Solid 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
  • DashpotBCImposes a viscous friction stress, proportional to the velocity
  • DirectDirichletBCImposes the essential boundary condition , where is a constant, controllable value.
  • DirectFunctionDirichletBCImposes the essential boundary condition , where is a (possibly) time and space-dependent MOOSE Function.
  • 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.
  • PresetVelocitySets the boundary displacements through time from an imposed velocity
  • 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.
  • raccoon App
  • LoadingUnloadingDirichletBCThis class applies a loading/unloading BC. The load ramps up linearly until it reaches the load cap. Once the load cap is reached, the load cap is incremented and unlading begins. Once the unloaded indicator becomes negative, loading starts. If the load cap exceeds the ultimate load, the entire loading/unloading terminates, and the current simulation is terminated.
  • ModeISurfingDirichletBCThis class applies the Dirichlet BC conforming with the analytical solution of a Mode-I crack. The crack is assumed to be emanating from the origin. For the BC ramps up linearly to match the initial crack tip position, and for , the crack tip advances to the right with a velocity of v
  • Heat Transfer App
  • ADConvectiveHeatFluxBCConvective heat transfer boundary condition with temperature and heat transfer coefficient given by material properties.
  • ADFunctionRadiativeBCBoundary condition for radiative heat exchange where the emissivity function is supplied by a Function.
  • ADInfiniteCylinderRadiativeBCBoundary condition for radiative heat exchange with a cylinderwhere the boundary is approximated as a cylinder as well.
  • ConvectiveFluxFunctionDetermines boundary value by fluid heat transfer coefficient and far-field temperature
  • ConvectiveHeatFluxBCConvective heat transfer boundary condition with temperature and heat transfer coefficent given by material properties.
  • CoupledConvectiveFlux
  • CoupledConvectiveHeatFluxBCConvective heat transfer boundary condition with temperature and heat transfer coefficent given by auxiliary variables.
  • DirectionalFluxBCApplies a directional flux multiplied by the surface normal vector. Can utilize the self shadowing calculation from a SelfShadowSideUserObject.
  • FunctionRadiativeBCBoundary condition for radiative heat exchange where the emissivity function is supplied by a Function.
  • GapHeatTransferTransfers heat across a gap between two surfaces dependent on the gap geometry specified.
  • GapPerfectConductanceEnforces equal temperatures across the gap.
  • GaussianEnergyFluxBCDescribes an incoming heat flux beam with a Gaussian profile
  • GrayLambertNeumannBCThis BC imposes a heat flux density that is computed from the GrayLambertSurfaceRadiationBase userobject.
  • HeatConductionBC
  • InfiniteCylinderRadiativeBCBoundary condition for radiative heat exchange with a cylinderwhere the boundary is approximated as a cylinder as well.

Available Subsystems

Available Actions

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