Skip to content

Need a simple way to apply BCs to _all_ boundaries #30221

@dschwen

Description

@dschwen

Motivation

Looking at the code for BoundaryRestrictable one might get the impression that an empty boundary list, or the special boundary name ANY_BOUNDARY_ID would apply the BC simply to all boundaries in the simulation. However that's not the case.

[Mesh]
  [gen]
    type = GeneratedMeshGenerator
    dim = 2
    nx = 10
    ny = 10
  []
[]

[Variables]
  [u]
  []
[]

[Kernels]
  [dt]
    type = TimeDerivative
    variable = u
  []
  [diff]
    type = Diffusion
    variable = u
  []
  [body_force]
    type = BodyForce
    variable = u
    function = 1.0
  []
[]

[BCs]
  [zero]
    type = DirichletBC
    variable = u
    value = 0.0
    # boundary = ''
    boundary = 'ANY_BOUNDARY_ID' # This will match any boundary, including node sets and side sets
    # boundary = 'left right top bottom'
  []
[]

[Postprocessors]
  [int]
    type = ElementIntegralVariablePostprocessor
    variable = u
  []
[]

[Executioner]
  type = Transient
  num_steps = 10
  dt = 0.1
[]

[Outputs]
  exodus = true
[]

Design

Let's discuss what's in the code and whether we want to make the half implemented (?) behavior more consistent. Why - for example - wouldn't we make the boundary parameter optional, just like the block parameter, where not specifying it just means "no restriction"...?

Impact

More consistent application behavior. @jessecarterMOOSE

Metadata

Metadata

Assignees

No one assigned

    Labels

    T: taskAn enhancement to the software.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions