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;
}
(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();
}
(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]);
}
(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.
  • 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.
  • Heat Transfer App
  • ADConvectiveHeatFluxBCConvective heat transfer boundary condition with temperature and heat transfer coefficent 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.
  • 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.
  • XFEMApp
  • CrackTipEnrichmentCutOffBCImposes the essential boundary condition , where is a constant, controllable value.
  • Navier Stokes App
  • AdvectionBCBoundary conditions for outflow/outflow of advected quantities: phi * velocity * normal, where phi is the advected quantitiy
  • EnergyFreeBCImplements free advective flow boundary conditions for the energy equation.
  • FluidWallMomentumBCImplicitly sets normal component of velocity to zero if the advection term of the momentum equation is integrated by parts
  • INSADDisplaceBoundaryBCBoundary condition for displacing a boundary
  • INSADDummyDisplaceBoundaryIntegratedBCThis object adds Jacobian entries for the boundary displacement dependence on the velocity
  • INSADMomentumNoBCBCThis class implements the 'No BC' boundary condition based on the 'Laplace' form of the viscous stress tensor.
  • INSADVaporRecoilPressureMomentumFluxBCVapor recoil pressure momentum flux
  • INSFEFluidEnergyBCSpecifies flow of energy through a boundary
  • INSFEFluidEnergyDirichletBCImposes a Dirichlet condition on temperature at inlets. Is not applied at outlets
  • INSFEFluidMassBCSpecifies flow of mass through a boundary given a velocity function or postprocessor
  • INSFEFluidMomentumBCSpecifies flow of momentum through a boundary
  • INSFEFluidWallMomentumBCImplicitly sets normal component of velocity to zero if the advection term of the momentum equation is integrated by parts
  • INSFEMomentumFreeSlipBCImplements free slip boundary conditions for the Navier Stokesmomentum equation.
  • INSMomentumNoBCBCLaplaceFormThis class implements the 'No BC' boundary condition based on the 'Laplace' form of the viscous stress tensor.
  • INSMomentumNoBCBCTractionFormThis class implements the 'No BC' boundary condition based on the 'traction' form of the viscous stress tensor.
  • INSTemperatureNoBCBCThis class implements the 'No BC' boundary condition discussed by Griffiths, Papanastiou, and others.
  • ImplicitNeumannBCThis class implements a form of the Neumann boundary condition in which the boundary term is treated 'implicitly'.
  • MDFluidEnergyBCSpecifies flow of energy through a boundary
  • MDFluidEnergyDirichletBCImposes a Dirichlet condition on temperature at inlets. Is not applied at outlets
  • MDFluidMassBCSpecifies flow of mass through a boundary given a velocity function or postprocessor
  • MDFluidMomentumBCSpecifies flow of momentum through a boundary
  • MDMomentumFreeSlipBCImplements free slip boundary conditions for the Navier Stokesmomentum equation.
  • MassFreeBCImplements free advective flow boundary conditions for the mass equation.
  • MomentumFreeBCImplements free flow boundary conditions for one of the momentum equations.
  • MomentumFreeSlipBCImplements free slip boundary conditions for the Navier Stokesmomentum equation.
  • NSEnergyInviscidSpecifiedBCThis class corresponds to the inviscid part of the 'natural' boundary condition for the energy equation.
  • NSEnergyInviscidSpecifiedDensityAndVelocityBCThis class corresponds to the inviscid part of the 'natural' boundary condition for the energy equation.
  • NSEnergyInviscidSpecifiedNormalFlowBCThis class corresponds to the inviscid part of the 'natural' boundary condition for the energy equation.
  • NSEnergyInviscidSpecifiedPressureBCThis class corresponds to the inviscid part of the 'natural' boundary condition for the energy equation.
  • NSEnergyInviscidUnspecifiedBCThis class corresponds to the inviscid part of the 'natural' boundary condition for the energy equation.
  • NSEnergyViscousBCThis class couples together all the variables for the compressible Navier-Stokes equations to allow them to be used in derived IntegratedBC classes.
  • NSEnergyWeakStagnationBCThe inviscid energy BC term with specified normal flow.
  • NSImposedVelocityBCImpose Velocity BC.
  • NSImposedVelocityDirectionBCThis class imposes a velocity direction component as a Dirichlet condition on the appropriate momentum equation.
  • NSInflowThermalBCThis class is used on a boundary where the incoming flow values (rho, u, v, T) are all completely specified.
  • NSMassSpecifiedNormalFlowBCThis class implements the mass equation boundary term with a specified value of rho*(u.n) imposed weakly.
  • NSMassUnspecifiedNormalFlowBCThis class implements the mass equation boundary term with the rho*(u.n) boundary integral computed implicitly.
  • NSMassWeakStagnationBCThe inviscid energy BC term with specified normal flow.
  • NSMomentumConvectiveWeakStagnationBCThe convective part (sans pressure term) of the momentum equation boundary integral evaluated at specified stagnation temperature, stagnation pressure, and flow direction values.
  • NSMomentumInviscidNoPressureImplicitFlowBCMomentum equation boundary condition used when pressure is not integrated by parts.
  • NSMomentumInviscidSpecifiedNormalFlowBCMomentum equation boundary condition in which pressure is specified (given) and the value of the convective part is allowed to vary (is computed implicitly).
  • NSMomentumInviscidSpecifiedPressureBCMomentum equation boundary condition in which pressure is specified (given) and the value of the convective part is allowed to vary (is computed implicitly).
  • NSMomentumPressureWeakStagnationBCThis class implements the pressure term of the momentum equation boundary integral for use in weak stagnation boundary conditions.
  • NSMomentumViscousBCThis class corresponds to the viscous part of the 'natural' boundary condition for the momentum equations.
  • NSPenalizedNormalFlowBCThis class penalizes the the value of u.n on the boundary so that it matches some desired value.
  • NSPressureNeumannBCThis kernel is appropriate for use with a 'zero normal flow' boundary condition in the context of the Euler equations.
  • NSStagnationPressureBCThis Dirichlet condition imposes the condition p_0 = p_0_desired.
  • NSStagnationTemperatureBCThis Dirichlet condition imposes the condition T_0 = T_0_desired.
  • NSThermalBCNS thermal BC.
  • Peridynamics App
  • RBMPresetOldValuePDClass to apply a preset BC to nodes with rigid body motion (RBM).
  • Porous Flow App
  • PorousFlowEnthalpySinkApplies a source equal to the product of the mass flux and the fluid enthalpy. The enthalpy is computed at temperature T_in and pressure equal to the porepressure in the porous medium, if fluid_phase is given, otherwise at the supplied porepressure. Hence this adds heat energy to the porous medium at rate corresponding to a fluid being injected at (porepressure, T_in) at rate (-flux_function).
  • PorousFlowHalfCubicSinkApplies a flux sink to a boundary. The base flux defined by PorousFlowSink is multiplied by a cubic.
  • PorousFlowHalfGaussianSinkApplies a flux sink to a boundary. The base flux defined by PorousFlowSink is multiplied by a Gaussian.
  • PorousFlowOutflowBCApplies an 'outflow' boundary condition, which allows fluid components or heat energy to flow freely out of the boundary as if it weren't there. This is fully upwinded
  • PorousFlowPiecewiseLinearSinkApplies a flux sink to a boundary. The base flux defined by PorousFlowSink is multiplied by a piecewise linear function.
  • PorousFlowSinkApplies a flux sink to a boundary.
  • Rdg App
  • AEFVBCA boundary condition kernel for the advection equation using a cell-centered finite volume method.
  • Fsi App
  • FluidFreeSurfaceBCApplies a mixed Dirichlet-Neumann BC on the fluid surface.
  • 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
  • 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.
  • Functional Expansion Tools App
  • FXFluxBCSets a flux boundary condition, evaluated using a FunctionSeries instance. This does not fix the flux, but rather 'strongly encourages' flux agreement by penalizing the differences through contributions to the residual.
  • FXValueBCImposes a fixed value boundary condition, evaluated using a FunctionSeries instance.
  • FXValuePenaltyBCSets a value boundary condition, evaluated using a FunctionSeries instance. This does not fix the value, but rather 'strongly encourages' value agreement by penalizing the differences through contributions to the residual.
  • Scalar Transport App
  • BinaryRecombinationBCModels recombination of the variable with a coupled species at boundaries, resulting in loss
  • DissociationFluxBCModels creation of the variable at boundaries due to dissociation of a coupled variable, e.g. B -> A
  • Thermal Hydraulics App
  • ADBoundaryFlux3EqnBCBoundary conditions for the 1-D, 1-phase, variable-area Euler equations
  • ADConvectionHeatTransfer3DBCAdds a convective heat flux boundary condition between the local component heat structure and a 3D heat structure
  • ADConvectionHeatTransferBCAdds a convective heat flux boundary condition with user-specified ambient temperature and heat transfer coefficient functions
  • ADConvectionHeatTransferRZBCConvection BC for RZ domain in XY coordinate system
  • ADExternalAppConvectionHeatTransferBCConvection BC from an external application
  • ADExternalAppConvectionHeatTransferRZBCConvection BC from an external application for RZ domain in XY coordinate system
  • ADGateValve1PhaseBCAdds boundary fluxes for flow channels connected to a 1-phase gate valve
  • ADHSHeatFluxBCApplies a specified heat flux to the side of a plate heat structure
  • ADHSHeatFluxRZBCApplies a specified heat flux to the side of a cylindrical heat structure in XY coordinates
  • ADHeatFlux3EqnBCWall heat flux boundary condition for the energy equation
  • ADJunctionOneToOne1PhaseBCAdds boundary fluxes for flow channels connected to a 1-phase one-to-one junction
  • ADRadiativeHeatFluxBCRadiative heat transfer boundary condition for a plate heat structure
  • ADRadiativeHeatFluxRZBCRadiative heat transfer boundary condition for a cylindrical heat structure
  • ADVolumeJunction1PhaseBCAdds boundary fluxes for flow channels connected to a 1-phase volume junction
  • BoundaryFlux3EqnBCBoundary conditions for the 1-D, 1-phase, variable-area Euler equations
  • ConvectionHeatTransferBCAdds a convective heat flux boundary condition with user-specified ambient temperature and heat transfer coefficient functions
  • ConvectionHeatTransferRZBCConvection BC for RZ domain in XY coordinate system
  • ExternalAppConvectionHeatTransferBCConvection BC from an external application
  • ExternalAppConvectionHeatTransferRZBCConvection BC from an external application for RZ domain in XY coordinate system
  • HSCoupler2D3DBCAdds boundary heat flux terms for HSCoupler2D3D
  • HeatStructure2DCouplerBCApplies BC for HeatStructure2DCoupler for plate heat structure
  • HeatStructure2DCouplerRZBCApplies BC for HeatStructure2DCoupler for cylindrical heat structure in a XY coordinate system
  • HeatStructure2DRadiationCouplerRZBCApplies BC for HeatStructure2DRadiationCouplerRZ
  • RadiativeHeatFluxBCRadiative heat transfer boundary condition for a plate heat structure
  • RadiativeHeatFluxRZBCRadiative heat transfer boundary condition for a cylindrical heat structure in a XY coordinate system
  • Chemical Reactions App
  • ChemicalOutFlowBCChemical flux boundary condition

Available Subsystems

Available Actions

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