diff --git a/framework/doc/content/media/userobjects/esm_ext.png b/framework/doc/content/media/userobjects/esm_ext.png new file mode 100644 index 000000000000..c42c59aeceed Binary files /dev/null and b/framework/doc/content/media/userobjects/esm_ext.png differ diff --git a/framework/doc/content/source/userobjects/CoupledVarThresholdElementSubdomainModifier.md b/framework/doc/content/source/userobjects/CoupledVarThresholdElementSubdomainModifier.md index fbef97d88f66..55916868ddf2 100644 --- a/framework/doc/content/source/userobjects/CoupledVarThresholdElementSubdomainModifier.md +++ b/framework/doc/content/source/userobjects/CoupledVarThresholdElementSubdomainModifier.md @@ -32,17 +32,23 @@ If the `CoupledVarThresholdElementSubdomainModifier` is applied onto the entire However, in many applications, e.g. element death and activation, the equivalent movement of element subdomains is not reversible. In this case, omitting the parameter `complement_subdomain_id` will make the subdomain modification irreversible: -!listing test/tests/userobjects/element_subdomain_modifier/block_restricted.i start=[moving_circle] end=[] include-end=true +!listing test/tests/userobjects/element_subdomain_modifier/irreversible.i start=[moving_circle] end=[] include-end=true !media media/userobjects/esm_irreversible.jpg style=float:center;width:100%; caption=The result of an irreversible element subdomain modifier at three different time steps ## Moving boundary/interface nodeset/sideset modification -The change of element subdomains will alter the definition of certain sidesets and nodesets. The `CoupledVarThresholdElementSubdomainModifier` optionally takes the parameter `moving_boundary_name` to help modify the corresponding sideset/nodeset. If the boundary provided through the `moving_boundary_name` parameter already exists, the modifier will attempt to modify the provided sideset/nodeset whenever an element changes subdomain. If the boundary does not exist, the modifier will create a sideset and a nodeset with the provided name. +The change of element subdomains will alter the definition of certain sidesets and nodesets. The `CoupledVarThresholdElementSubdomainModifier` optionally takes the parameter `moving_boundaries` to help modify the corresponding sideset/nodeset. If the boundary provided through the `moving_boundaries` parameter already exists, the modifier will attempt to modify the provided sideset/nodeset whenever an element changes subdomain. If the boundary does not exist, the modifier will create a sideset and a nodeset with the provided name. This parameter must also be set with `moving_boundary_subdomain_pairs`, for the subdomains the boundary lies between. -!media media/userobjects/esm_sideset.jpg style=float:center;width:100%; caption=The evolving sideset (green) at three different time steps +!listing test/tests/userobjects/element_subdomain_modifier/moving_boundary.i start=[moving_circle] end=[] include-end=true -!media media/userobjects/esm_nodeset.jpg style=float:center;width:100%; caption=The evolving nodeset (green) at three different time steps +!media media/userobjects/esm_sideset.jpg style=float:center;width:100%; caption=The evolving sideset (green) at three different time steps, without a provided boundary from the user. + +!media media/userobjects/esm_nodeset.jpg style=float:center;width:100%; caption=The evolving nodeset (green) at three different time steps, without a provided boundary from the user. + +The parameter `moving_boundary_subdomain_pairs` also allows for the external parts of the boundary to be included by setting the subdomain pair to only one subdomain. + +!listing test/tests/userobjects/element_subdomain_modifier/external_moving_boundary.i start=[moving_circle] end=[] include-end=true Nodal and integrated BCs can be applied on the moving boundary. diff --git a/test/tests/userobjects/element_subdomain_modifier/external_moving_boundary.i b/test/tests/userobjects/element_subdomain_modifier/external_moving_boundary.i new file mode 100644 index 000000000000..a2e2769419ac --- /dev/null +++ b/test/tests/userobjects/element_subdomain_modifier/external_moving_boundary.i @@ -0,0 +1,67 @@ +[Problem] + solve = false +[] + +[Mesh] + [gen] + type = GeneratedMeshGenerator + dim = 2 + nx = 16 + ny = 16 + [] + [left] + type = SubdomainBoundingBoxGenerator + input = 'gen' + block_id = 1 + bottom_left = '0 0 0' + top_right = '0.25 1 1' + [] + [right] + type = SubdomainBoundingBoxGenerator + input = 'left' + block_id = 2 + bottom_left = '0.25 0 0' + top_right = '1 1 1' + [] + [ext] + type = SideSetsAroundSubdomainGenerator + input = 'right' + block = 1 + new_boundary = 'moving_boundary' + [] +[] + +[UserObjects] + [moving_circle] + type = CoupledVarThresholdElementSubdomainModifier + coupled_var = 'phi' + criterion_type = 'BELOW' + threshold = 0 + subdomain_id = 1 + moving_boundaries = 'moving_boundary moving_boundary' + moving_boundary_subdomain_pairs = '1 2; 1' + execute_on = 'INITIAL TIMESTEP_BEGIN' + [] +[] + +[AuxVariables] + [phi] + [AuxKernel] + type = ParsedAux + expression = '(x-t)^2+(y)^2-0.5^2' + use_xyzt = true + execute_on = 'INITIAL TIMESTEP_BEGIN' + [] + [] +[] + +[Executioner] + type = Transient + dt = 0.3 + num_steps = 3 +[] + +[Outputs] + exodus = true +[] + diff --git a/test/tests/userobjects/element_subdomain_modifier/gold/complement_moving_boundary_out.e b/test/tests/userobjects/element_subdomain_modifier/gold/complement_moving_boundary_out.e index cc0d40bd4cd3..055134b4ce32 100644 Binary files a/test/tests/userobjects/element_subdomain_modifier/gold/complement_moving_boundary_out.e and b/test/tests/userobjects/element_subdomain_modifier/gold/complement_moving_boundary_out.e differ diff --git a/test/tests/userobjects/element_subdomain_modifier/gold/complement_moving_boundary_out.e-s002 b/test/tests/userobjects/element_subdomain_modifier/gold/complement_moving_boundary_out.e-s002 index 6f34430d7888..e400379ed3f1 100644 Binary files a/test/tests/userobjects/element_subdomain_modifier/gold/complement_moving_boundary_out.e-s002 and b/test/tests/userobjects/element_subdomain_modifier/gold/complement_moving_boundary_out.e-s002 differ diff --git a/test/tests/userobjects/element_subdomain_modifier/gold/complement_moving_boundary_out.e-s003 b/test/tests/userobjects/element_subdomain_modifier/gold/complement_moving_boundary_out.e-s003 index c941e058f633..de4114c13d1c 100644 Binary files a/test/tests/userobjects/element_subdomain_modifier/gold/complement_moving_boundary_out.e-s003 and b/test/tests/userobjects/element_subdomain_modifier/gold/complement_moving_boundary_out.e-s003 differ diff --git a/test/tests/userobjects/element_subdomain_modifier/gold/complement_moving_boundary_out.e-s004 b/test/tests/userobjects/element_subdomain_modifier/gold/complement_moving_boundary_out.e-s004 new file mode 100644 index 000000000000..e4c5a6a411a2 Binary files /dev/null and b/test/tests/userobjects/element_subdomain_modifier/gold/complement_moving_boundary_out.e-s004 differ diff --git a/test/tests/userobjects/element_subdomain_modifier/gold/external_moving_boundary_out.e b/test/tests/userobjects/element_subdomain_modifier/gold/external_moving_boundary_out.e new file mode 100644 index 000000000000..c33d6c4c97df Binary files /dev/null and b/test/tests/userobjects/element_subdomain_modifier/gold/external_moving_boundary_out.e differ diff --git a/test/tests/userobjects/element_subdomain_modifier/gold/external_moving_boundary_out.e-s002 b/test/tests/userobjects/element_subdomain_modifier/gold/external_moving_boundary_out.e-s002 new file mode 100644 index 000000000000..ca5021b4309c Binary files /dev/null and b/test/tests/userobjects/element_subdomain_modifier/gold/external_moving_boundary_out.e-s002 differ diff --git a/test/tests/userobjects/element_subdomain_modifier/gold/external_moving_boundary_out.e-s003 b/test/tests/userobjects/element_subdomain_modifier/gold/external_moving_boundary_out.e-s003 new file mode 100644 index 000000000000..e76491736e7a Binary files /dev/null and b/test/tests/userobjects/element_subdomain_modifier/gold/external_moving_boundary_out.e-s003 differ diff --git a/test/tests/userobjects/element_subdomain_modifier/gold/external_moving_boundary_out.e-s004 b/test/tests/userobjects/element_subdomain_modifier/gold/external_moving_boundary_out.e-s004 new file mode 100644 index 000000000000..92882eec4567 Binary files /dev/null and b/test/tests/userobjects/element_subdomain_modifier/gold/external_moving_boundary_out.e-s004 differ diff --git a/test/tests/userobjects/element_subdomain_modifier/gold/irreversible_out.e b/test/tests/userobjects/element_subdomain_modifier/gold/irreversible_out.e index 037fc5b685cc..e5cd7e9754b8 100644 Binary files a/test/tests/userobjects/element_subdomain_modifier/gold/irreversible_out.e and b/test/tests/userobjects/element_subdomain_modifier/gold/irreversible_out.e differ diff --git a/test/tests/userobjects/element_subdomain_modifier/gold/irreversible_out.e-s002 b/test/tests/userobjects/element_subdomain_modifier/gold/irreversible_out.e-s002 index 1c4e906b73f5..869516276610 100644 Binary files a/test/tests/userobjects/element_subdomain_modifier/gold/irreversible_out.e-s002 and b/test/tests/userobjects/element_subdomain_modifier/gold/irreversible_out.e-s002 differ diff --git a/test/tests/userobjects/element_subdomain_modifier/gold/irreversible_out.e-s003 b/test/tests/userobjects/element_subdomain_modifier/gold/irreversible_out.e-s003 index dea5879f078f..a7e45d7f012c 100644 Binary files a/test/tests/userobjects/element_subdomain_modifier/gold/irreversible_out.e-s003 and b/test/tests/userobjects/element_subdomain_modifier/gold/irreversible_out.e-s003 differ diff --git a/test/tests/userobjects/element_subdomain_modifier/gold/irreversible_out.e-s004 b/test/tests/userobjects/element_subdomain_modifier/gold/irreversible_out.e-s004 index c0f900d6eb79..92e99974cef8 100644 Binary files a/test/tests/userobjects/element_subdomain_modifier/gold/irreversible_out.e-s004 and b/test/tests/userobjects/element_subdomain_modifier/gold/irreversible_out.e-s004 differ diff --git a/test/tests/userobjects/element_subdomain_modifier/gold/moving_boundary_out.e b/test/tests/userobjects/element_subdomain_modifier/gold/moving_boundary_out.e index a075c44daa7d..490b6fc9ff1f 100644 Binary files a/test/tests/userobjects/element_subdomain_modifier/gold/moving_boundary_out.e and b/test/tests/userobjects/element_subdomain_modifier/gold/moving_boundary_out.e differ diff --git a/test/tests/userobjects/element_subdomain_modifier/gold/moving_boundary_out.e-s002 b/test/tests/userobjects/element_subdomain_modifier/gold/moving_boundary_out.e-s002 index 701d04950f99..188d284886cc 100644 Binary files a/test/tests/userobjects/element_subdomain_modifier/gold/moving_boundary_out.e-s002 and b/test/tests/userobjects/element_subdomain_modifier/gold/moving_boundary_out.e-s002 differ diff --git a/test/tests/userobjects/element_subdomain_modifier/gold/moving_boundary_out.e-s003 b/test/tests/userobjects/element_subdomain_modifier/gold/moving_boundary_out.e-s003 index c941e058f633..afd13137f2ee 100644 Binary files a/test/tests/userobjects/element_subdomain_modifier/gold/moving_boundary_out.e-s003 and b/test/tests/userobjects/element_subdomain_modifier/gold/moving_boundary_out.e-s003 differ diff --git a/test/tests/userobjects/element_subdomain_modifier/gold/moving_boundary_out.e-s004 b/test/tests/userobjects/element_subdomain_modifier/gold/moving_boundary_out.e-s004 new file mode 100644 index 000000000000..0593e0b75da8 Binary files /dev/null and b/test/tests/userobjects/element_subdomain_modifier/gold/moving_boundary_out.e-s004 differ diff --git a/test/tests/userobjects/element_subdomain_modifier/gold/no_moving_boundary_out.e b/test/tests/userobjects/element_subdomain_modifier/gold/no_moving_boundary_out.e deleted file mode 100644 index e5a7f189e709..000000000000 Binary files a/test/tests/userobjects/element_subdomain_modifier/gold/no_moving_boundary_out.e and /dev/null differ diff --git a/test/tests/userobjects/element_subdomain_modifier/gold/no_moving_boundary_out.e-s002 b/test/tests/userobjects/element_subdomain_modifier/gold/no_moving_boundary_out.e-s002 deleted file mode 100644 index 2c32b46f48c0..000000000000 Binary files a/test/tests/userobjects/element_subdomain_modifier/gold/no_moving_boundary_out.e-s002 and /dev/null differ diff --git a/test/tests/userobjects/element_subdomain_modifier/gold/no_moving_boundary_out.e-s003 b/test/tests/userobjects/element_subdomain_modifier/gold/no_moving_boundary_out.e-s003 deleted file mode 100644 index 306ccbac474a..000000000000 Binary files a/test/tests/userobjects/element_subdomain_modifier/gold/no_moving_boundary_out.e-s003 and /dev/null differ diff --git a/test/tests/userobjects/element_subdomain_modifier/gold/reversible_out.e b/test/tests/userobjects/element_subdomain_modifier/gold/reversible_out.e index 3cf24deb1fd2..9732b5a88fe0 100644 Binary files a/test/tests/userobjects/element_subdomain_modifier/gold/reversible_out.e and b/test/tests/userobjects/element_subdomain_modifier/gold/reversible_out.e differ diff --git a/test/tests/userobjects/element_subdomain_modifier/gold/reversible_out.e-s002 b/test/tests/userobjects/element_subdomain_modifier/gold/reversible_out.e-s002 index 6fa065c412c9..7616947c85ee 100644 Binary files a/test/tests/userobjects/element_subdomain_modifier/gold/reversible_out.e-s002 and b/test/tests/userobjects/element_subdomain_modifier/gold/reversible_out.e-s002 differ diff --git a/test/tests/userobjects/element_subdomain_modifier/gold/reversible_out.e-s003 b/test/tests/userobjects/element_subdomain_modifier/gold/reversible_out.e-s003 index 4a5b95282e8c..33adbf6daddb 100644 Binary files a/test/tests/userobjects/element_subdomain_modifier/gold/reversible_out.e-s003 and b/test/tests/userobjects/element_subdomain_modifier/gold/reversible_out.e-s003 differ diff --git a/test/tests/userobjects/element_subdomain_modifier/gold/reversible_out.e-s004 b/test/tests/userobjects/element_subdomain_modifier/gold/reversible_out.e-s004 index 2e780d85291e..f5bedc872781 100644 Binary files a/test/tests/userobjects/element_subdomain_modifier/gold/reversible_out.e-s004 and b/test/tests/userobjects/element_subdomain_modifier/gold/reversible_out.e-s004 differ diff --git a/test/tests/userobjects/element_subdomain_modifier/irreversible.i b/test/tests/userobjects/element_subdomain_modifier/irreversible.i index 68d75616c50e..a0e34947f678 100644 --- a/test/tests/userobjects/element_subdomain_modifier/irreversible.i +++ b/test/tests/userobjects/element_subdomain_modifier/irreversible.i @@ -32,9 +32,6 @@ criterion_type = 'BELOW' threshold = 0 subdomain_id = 1 - complement_subdomain_id = 2 - moving_boundaries = 'moving_boundary' - moving_boundary_subdomain_pairs = '1 2' execute_on = 'INITIAL TIMESTEP_BEGIN' [] [] diff --git a/test/tests/userobjects/element_subdomain_modifier/moving_boundary.i b/test/tests/userobjects/element_subdomain_modifier/moving_boundary.i index f5578e325816..b2f84ae53cec 100644 --- a/test/tests/userobjects/element_subdomain_modifier/moving_boundary.i +++ b/test/tests/userobjects/element_subdomain_modifier/moving_boundary.i @@ -3,75 +3,58 @@ [] [Mesh] - [gmg] + [gen] type = GeneratedMeshGenerator dim = 2 - nx = 3 - ny = 1 - xmax = 3 - ymax = 1 + nx = 16 + ny = 16 [] - [block_1] + [left] type = SubdomainBoundingBoxGenerator - input = 'gmg' + input = 'gen' block_id = 1 - block_name = 'block_1' bottom_left = '0 0 0' - top_right = '1 1 0' + top_right = '0.25 1 1' [] - [block_2] + [right] type = SubdomainBoundingBoxGenerator - input = 'block_1' + input = 'left' block_id = 2 - block_name = 'block_2' - bottom_left = '1 0 0' - top_right = '2 1 0' - [] - [block_3] - type = SubdomainBoundingBoxGenerator - input = 'block_2' - block_id = 3 - block_name = 'block_3' - bottom_left = '2 0 0' - top_right = '3 1 0' - [] - [moving_boundary] - type = SideSetsAroundSubdomainGenerator - input = 'block_3' - block = 1 - new_boundary = 'moving' - [] -[] - -[AuxVariables] - [u] - [AuxKernel] - type = FunctionAux - function = 't-x' - execute_on = 'INITIAL TIMESTEP_BEGIN' - [] + bottom_left = '0.25 0 0' + top_right = '1 1 1' [] [] [UserObjects] - [w_mvg_bnd] + [moving_circle] type = CoupledVarThresholdElementSubdomainModifier - coupled_var = 'u' - criterion_type = 'ABOVE' + coupled_var = 'phi' + criterion_type = 'BELOW' threshold = 0 subdomain_id = 1 - moving_boundaries = 'moving moving' - moving_boundary_subdomain_pairs = '1 3; 1' + moving_boundaries = 'moving_boundary' + moving_boundary_subdomain_pairs = '1 2' execute_on = 'INITIAL TIMESTEP_BEGIN' [] [] +[AuxVariables] + [phi] + [AuxKernel] + type = ParsedAux + expression = '(x-t)^2+(y)^2-0.5^2' + use_xyzt = true + execute_on = 'INITIAL TIMESTEP_BEGIN' + [] + [] +[] + [Executioner] type = Transient - end_time = 3 - dt = 1 + dt = 0.3 + num_steps = 3 [] [Outputs] exodus = true -[] \ No newline at end of file +[] diff --git a/test/tests/userobjects/element_subdomain_modifier/reversible.i b/test/tests/userobjects/element_subdomain_modifier/reversible.i new file mode 100644 index 000000000000..ac5fe1b1ade6 --- /dev/null +++ b/test/tests/userobjects/element_subdomain_modifier/reversible.i @@ -0,0 +1,59 @@ +[Problem] + solve = false +[] + +[Mesh] + [gen] + type = GeneratedMeshGenerator + dim = 2 + nx = 16 + ny = 16 + [] + [left] + type = SubdomainBoundingBoxGenerator + input = 'gen' + block_id = 1 + bottom_left = '0 0 0' + top_right = '0.25 1 1' + [] + [right] + type = SubdomainBoundingBoxGenerator + input = 'left' + block_id = 2 + bottom_left = '0.25 0 0' + top_right = '1 1 1' + [] +[] + +[UserObjects] + [moving_circle] + type = CoupledVarThresholdElementSubdomainModifier + coupled_var = 'phi' + criterion_type = 'BELOW' + threshold = 0 + subdomain_id = 1 + complement_subdomain_id = 2 + execute_on = 'INITIAL TIMESTEP_BEGIN' + [] +[] + +[AuxVariables] + [phi] + [AuxKernel] + type = ParsedAux + expression = '(x-t)^2+(y)^2-0.5^2' + use_xyzt = true + execute_on = 'INITIAL TIMESTEP_BEGIN' + [] + [] +[] + +[Executioner] + type = Transient + dt = 0.3 + num_steps = 3 +[] + +[Outputs] + exodus = true +[] diff --git a/test/tests/userobjects/element_subdomain_modifier/tests b/test/tests/userobjects/element_subdomain_modifier/tests index d6d0a5c87f3c..3022aaf2ace1 100644 --- a/test/tests/userobjects/element_subdomain_modifier/tests +++ b/test/tests/userobjects/element_subdomain_modifier/tests @@ -4,42 +4,40 @@ [group] requirement = 'The framework shall include the ability to change element subdomain during simulation' - [moving_boundary] + [irreversible] type = 'Exodiff' - input = 'moving_boundary.i' - exodiff = 'moving_boundary_out.e moving_boundary_out.e-s002 moving_boundary_out.e-s003' - detail = 'with a specified boundary, ' + input = 'irreversible.i' + exodiff = 'irreversible_out.e irreversible_out.e-s002 irreversible_out.e-s003 irreversible_out.e-s004' + detail = 'irreversibly, ' [] - [complement_moving_boundary] + [reversible] type = 'Exodiff' - input = 'moving_boundary.i' - cli_args = "UserObjects/w_mvg_bnd/moving_boundary_subdomain_pairs='3 1; 1' Outputs/file_base='complement_moving_boundary_out'" - exodiff = 'complement_moving_boundary_out.e complement_moving_boundary_out.e-s002 complement_moving_boundary_out.e-s003' - detail = 'with a complement boundary, ' + input = 'reversible.i' + exodiff = 'reversible_out.e reversible_out.e-s002 reversible_out.e-s003 reversible_out.e-s004' + detail = 'reversibly, ' [] - - [no_moving_boundary] + + [moving_boundary] type = 'Exodiff' input = 'moving_boundary.i' - cli_args = "UserObjects/w_mvg_bnd/moving_boundaries="" UserObjects/w_mvg_bnd/moving_boundary_subdomain_pairs="" Outputs/file_base='no_moving_boundary_out'" - exodiff = 'no_moving_boundary_out.e no_moving_boundary_out.e-s002 no_moving_boundary_out.e-s003' - detail = 'without a specified boundary, ' + exodiff = 'moving_boundary_out.e moving_boundary_out.e-s002 moving_boundary_out.e-s003 moving_boundary_out.e-s004' + detail = 'with a moving boundary, ' [] - [irreversible] + [complement_moving_boundary] type = 'Exodiff' - input = 'irreversible.i' - exodiff = 'irreversible_out.e irreversible_out.e-s002 irreversible_out.e-s003 irreversible_out.e-s004' - detail = 'irreversibly, ' + input = 'moving_boundary.i' + cli_args = "UserObjects/moving_circle/moving_boundary_subdomain_pairs='2 1' Outputs/file_base='complement_moving_boundary_out'" + exodiff = 'complement_moving_boundary_out.e complement_moving_boundary_out.e-s002 complement_moving_boundary_out.e-s003 complement_moving_boundary_out.e-s004' + detail = 'with a complement moving boundary, ' [] - [reversible] + [external_moving_boundary] type = 'Exodiff' - input = 'irreversible.i' - cli_args = "UserObjects/moving_circle/complement_subdomain_id=2 Outputs/file_base='reversible_out'" - exodiff = 'reversible_out.e reversible_out.e-s002 reversible_out.e-s003 reversible_out.e-s004' - detail = 'reversibly, ' + input = 'external_moving_boundary.i' + exodiff = 'external_moving_boundary_out.e external_moving_boundary_out.e-s002 external_moving_boundary_out.e-s003 external_moving_boundary_out.e-s004' + detail = 'with an external moving boundary, ' [] [parallel]