Skip to content

Commit 2795b0f

Browse files
committed
Added a 3D test case for AMR with moving boundary in element subdomain modifier
Closes #20387
1 parent 29962f9 commit 2795b0f

9 files changed

+112
-1
lines changed

framework/src/userobject/ElementSubdomainModifier.C

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ ElementSubdomainModifier::updateBoundaryInfo(MooseMesh & mesh,
185185
return;
186186

187187
if (_moving_boundary_subdomains.size())
188-
mooseAssert(_moving_boundary_subdomains.size() == 2, "The number of moving subdomains should be two");
188+
mooseAssert(_moving_boundary_subdomains.size() == 2,
189+
"The number of moving subdomains should be two");
189190
/*
190191
There are a couple of steps to reconstruct the moving boundary.
191192
1) Retrieve all the active elements associated with the moving boundary
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
[Problem]
2+
solve = false
3+
[]
4+
5+
[Mesh]
6+
[gen]
7+
type = GeneratedMeshGenerator
8+
dim = 3
9+
xmin = -1
10+
xmax = 1
11+
ymin = -1
12+
ymax = 1
13+
nx = 16
14+
ny = 16
15+
nz = 16
16+
[]
17+
[left]
18+
type = SubdomainBoundingBoxGenerator
19+
input = 'gen'
20+
block_id = 1
21+
bottom_left = '-1 -1 0'
22+
top_right = '0 1 1'
23+
[]
24+
[right]
25+
type = SubdomainBoundingBoxGenerator
26+
input = 'left'
27+
block_id = 2
28+
bottom_left = '0 -1 0'
29+
top_right = '1 1 1'
30+
[]
31+
[moving_boundary]
32+
type = SideSetsAroundSubdomainGenerator
33+
input = 'right'
34+
block = 1
35+
new_boundary = 'moving_boundary'
36+
normal = '1 0 0'
37+
[]
38+
[]
39+
40+
[UserObjects]
41+
[moving_circle]
42+
type = CoupledVarThresholdElementSubdomainModifier
43+
coupled_var = 'phi'
44+
block = 2
45+
criterion_type = ABOVE
46+
threshold = 0.5
47+
subdomain_id = 1
48+
moving_boundary_name = moving_boundary
49+
execute_on = 'TIMESTEP_BEGIN'
50+
[]
51+
[]
52+
53+
[Functions]
54+
[moving_gauss]
55+
type = ParsedFunction
56+
value = 'exp(-((x+0.5-t)^2+(y)^2)/0.25)'
57+
[]
58+
[]
59+
60+
[AuxVariables]
61+
[phi]
62+
[]
63+
[]
64+
65+
[AuxKernels]
66+
[phi]
67+
type = FunctionAux
68+
variable = phi
69+
function = moving_gauss
70+
execute_on = 'INITIAL TIMESTEP_BEGIN TIMESTEP_END'
71+
[]
72+
[]
73+
74+
[Adaptivity]
75+
steps = 1
76+
marker = marker
77+
initial_marker = marker
78+
max_h_level = 1
79+
[Indicators/indicator]
80+
type = GradientJumpIndicator
81+
variable = phi
82+
[]
83+
[Markers/marker]
84+
type = BoundaryPreservedMarker
85+
preserved_boundary = moving_boundary
86+
indicator = indicator
87+
coarsen = 0.2
88+
refine = 0.5
89+
[]
90+
[]
91+
92+
[Executioner]
93+
type = Transient
94+
dt = 0.1
95+
num_steps = 5
96+
[]
97+
98+
[Outputs]
99+
exodus = true
100+
[]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

test/tests/userobjects/element_subdomain_modifier/tests

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,14 @@
6363

6464
requirement = 'The framework shall support adaptive mesh refinement in the element subdomain modifier'
6565
[]
66+
67+
[amr_moving_boundary_3d]
68+
type = 'Exodiff'
69+
input = 'adaptivity_moving_boundary_3d.i'
70+
exodiff = 'adaptivity_moving_boundary_3d_out.e
71+
adaptivity_moving_boundary_3d_out.e-s002 adaptivity_moving_boundary_3d_out.e-s003 adaptivity_moving_boundary_3d_out.e-s004
72+
adaptivity_moving_boundary_3d_out.e-s005 adaptivity_moving_boundary_3d_out.e-s006'
73+
74+
requirement = 'The framework shall support adaptive mesh refinement in the element subdomain modifier for 3D problems'
75+
[]
6676
[]

0 commit comments

Comments
 (0)