Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BoundaryElemIntegrityCheckThread Bug Fix for Boundary Integrity Check on SideUserObject Using Lower-d Variable #21567

Merged
merged 1 commit into from
Jul 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion framework/src/loops/BoundaryElemIntegrityCheckThread.C
Expand Up @@ -77,7 +77,16 @@ BoundaryElemIntegrityCheckThread::operator()(const ConstBndElemRange & range)
.queryInto(objs);
for (const auto & uo : objs)
if (uo->checkVariableBoundaryIntegrity())
boundaryIntegrityCheckError(*uo, uo->checkAllVariables(*elem), bnd_name);
{
auto leftover_vars = uo->checkAllVariables(*elem);
if (!leftover_vars.empty())
{
const Elem * const lower_d_elem = mesh.getLowerDElem(elem, side);
if (lower_d_elem)
leftover_vars = uo->checkVariables(*lower_d_elem, leftover_vars);
}
boundaryIntegrityCheckError(*uo, leftover_vars, bnd_name);
}

auto check = [elem, boundary_id, &bnd_name, tid, &mesh, side](const auto & warehouse)
{
Expand Down
@@ -0,0 +1,106 @@
[Mesh]
[square]
type = GeneratedMeshGenerator
nx = 3
ny = 3
dim = 2
[]
build_all_side_lowerd_mesh = true
[]

[Variables]
[u]
order = THIRD
family = MONOMIAL
block = 0
[]
[uhat]
order = CONSTANT
family = MONOMIAL
block = BOUNDARY_SIDE_LOWERD_SUBDOMAIN
[]
[lambda]
order = CONSTANT
family = MONOMIAL
block = INTERNAL_SIDE_LOWERD_SUBDOMAIN
[]
[lambdab]
order = CONSTANT
family = MONOMIAL
block = BOUNDARY_SIDE_LOWERD_SUBDOMAIN
[]
[]

[AuxVariables]
[v]
order = CONSTANT
family = MONOMIAL
block = 0
initial_condition = '1'
[]
[]

[Kernels]
[diff]
type = MatDiffusion
variable = u
diffusivity = '1'
block = 0
[]
[source]
type = CoupledForce
variable = u
v = v
coef = '1'
block = 0
[]
[reaction]
type = Reaction
variable = uhat
rate = '1'
block = BOUNDARY_SIDE_LOWERD_SUBDOMAIN
[]
[uhat_coupled]
type = CoupledForce
variable = uhat
block = BOUNDARY_SIDE_LOWERD_SUBDOMAIN
v = lambdab
coef = '1'
[]
[]

[DGKernels]
[surface]
type = HFEMDiffusion
variable = u
lowerd_variable = lambda
[]
[]

[BCs]
[all]
type = HFEMDirichletBC
boundary = 'left right top bottom'
variable = u
lowerd_variable = lambdab
uhat = uhat
[]
[]

[Problem]
solve = false
[]

[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu basic mumps'
[]

[Postprocessors]
[avg]
type = SideAverageValue
boundary = 'left right top bottom'
[]
[]
23 changes: 20 additions & 3 deletions test/tests/userobjects/side_user_object_no_boundary_error/tests
@@ -1,12 +1,29 @@
[Tests]
design = 'SideAverageValue.md'
issues = '#9103'
issues = '#9103 #21566'

[./test]
[test]
type = RunException
input = side_no_boundary.i
expect_err = "missing required parameter 'Postprocessors/avg/boundary'"

requirement = "The system shall error if the boundary is not specified when computing the average value of a variable on a boundary."
[../]
[]

[lower_d_test]
type = RunApp
input = lower_d_side_boundary.i
cli_args = "Postprocessors/avg/variable='lambdab'"
mesh_mode = replicated
requirement = "The system shall check if the lower-d variable is properly defined on a boundary."
[]

[lower_d_test_error]
type = RunException
input = lower_d_side_boundary.i
cli_args = "Postprocessors/avg/variable='lambda'"
mesh_mode = replicated
expect_err="'avg' of type 'SideAverageValue' depends on variable\(s\) 'lambda'."
requirement = "The system shall error if the lower-d variable is not properly defined on a boundary."
[]
[]