- coupled_varCoupled variable whose value is used in the criterion
C++ Type:std::vector<VariableName>
Controllable:No
Description:Coupled variable whose value is used in the criterion
- subdomain_idThe subdomain ID of the element when the criterion is met
C++ Type:unsigned short
Controllable:No
Description:The subdomain ID of the element when the criterion is met
- thresholdThe value above (or below) which to change the element subdomain
C++ Type:double
Controllable:No
Description:The value above (or below) which to change the element subdomain
CoupledVarThresholdElementSubdomainModifier
Modify element subdomain ID. This userobject only runs on the undisplaced mesh, and it will modify both the undisplaced and the displaced mesh.
Overview
The CoupledVarThresholdElementSubdomainModifier
can model
Element death (with applications in ablation, fracture, etc.);
Element activation (with applications in additive manufacturing, sintering, solidification, etc.);
Moving interface (with applications in metal oxidation, phase transformation, melt pool, etc.).
The CoupledVarThresholdElementSubdomainModifier
changes the element subdomain based on the given criterion. It also handles the corresponding
Moving boundary/interface nodeset/sideset modification,
Solution initialization, and
Stateful material property initialization,
all of which are demonstrated using the following example.
Consider a unit square domain, and an auxiliary variable defined by the function . The function represents a signed-distance function of a circle of radius whose center is moving along the x-axis towards right.
Initially, the domain is decomposed by a vertical line . The elements on the left side of the vertical line have subdomain ID of 1, and the elements on the right side have subdomain ID of 2. The CoupledVarThresholdElementSubdomainModifier
is used to change the subdomain ID from 2 to 1 for elements within the circle.
Reversible vs. irreversible modification
If the CoupledVarThresholdElementSubdomainModifier
is applied onto the entire domain, and the parameter complement_subdomain_id
is set to 2, then the subdomain ID of all elements outside the circle will be set to 2:
[moving_circle]
type = CoupledVarThresholdElementSubdomainModifier
coupled_var = 'phi'
criterion_type = BELOW
threshold = 0
subdomain_id = 1
complement_subdomain_id = 2
moving_boundary_name = moving_boundary
execute_on = 'INITIAL TIMESTEP_BEGIN'
[]
(../moose/test/tests/userobjects/element_subdomain_modifier/reversible.i)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:
[moving_circle]
type = CoupledVarThresholdElementSubdomainModifier
coupled_var = 'phi'
block = 2
criterion_type = BELOW
threshold = 0
subdomain_id = 1
moving_boundary_name = moving_boundary
execute_on = 'INITIAL TIMESTEP_BEGIN'
[]
(../moose/test/tests/userobjects/element_subdomain_modifier/block_restricted.i)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.
Nodal and integrated BCs can be applied on the moving boundary.
Solution initialization
Depending on the physics, one may or may not want to initialize the solution when an element and its related nodes change subdomain. The parameter apply_initial_conditions
defaults to true and determines whether the initial conditions should be re-evaluated.
Suppose initially there is an auxiliary variable everywhere inside the domain, and the variable value in subdomain 1 (blue) doubles at each time step:
[AuxVariables]
[u]
[InitialCondition]
type = ConstantIC
value = 1
[]
[]
[phi]
[]
# for the 'displaced' test only
inactive = 'disp_x disp_y'
[disp_x]
[]
[disp_y]
[]
[]
[AuxKernels]
[phi]
type = FunctionAux
variable = phi
function = moving_circle
execute_on = 'INITIAL TIMESTEP_BEGIN'
[]
[double_u]
type = StatefulAux
variable = u
coupled = u
block = 1
[]
[]
[Postprocessors]
# for the 'subdomain_caching' test only
active = ''
[average]
type = SideAverageValue
variable = u
boundary = bottom
execute_on = 'INITIAL TIMESTEP_BEGIN'
[]
[]
(../moose/test/tests/userobjects/element_subdomain_modifier/initial_condition.i)Stateful material property initialization
Similarly, all stateful material properties will be re-initialized when an element changes subdomain. Suppose initially the diffusivity is everywhere, and the diffusivity doubles at each time step:
[Materials]
[stateful]
type = StatefulMaterial
initial_diffusivity = 0.5
multiplier = 2
block = 1
outputs = exodus
[]
[non_stateful]
type = GenericConstantMaterial
prop_names = 'diffusivity'
prop_values = '0.5'
block = 2
outputs = exodus
[]
[]
(../moose/test/tests/userobjects/element_subdomain_modifier/stateful_property.i)Input Parameters
- apply_initial_conditionsTrueWhether to apply initial conditions on the moved nodes and elements
Default:True
C++ Type:bool
Controllable:No
Description:Whether to apply initial conditions on the moved nodes and elements
- blockThe list of blocks (ids or names) that this object will be applied
C++ Type:std::vector<SubdomainName>
Controllable:No
Description:The list of blocks (ids or names) that this object will be applied
- complement_moving_boundary_nameBoundary that associated with the unmoved domain when neighbor element(s) is moved. A boundary with the provided name will be created if not already exists on the mesh.
C++ Type:BoundaryName
Controllable:No
Description:Boundary that associated with the unmoved domain when neighbor element(s) is moved. A boundary with the provided name will be created if not already exists on the mesh.
- complement_subdomain_idThe subdomain ID of the element when the criterion is not met. If not provided, the element subdomain ID will not be modified if the criterion is not met.
C++ Type:unsigned short
Controllable:No
Description:The subdomain ID of the element when the criterion is not met. If not provided, the element subdomain ID will not be modified if the criterion is not met.
- criterion_typeABOVECriterion to use for the threshold
Default:ABOVE
C++ Type:MooseEnum
Controllable:No
Description:Criterion to use for the threshold
- execute_onTIMESTEP_ENDThe list of flag(s) indicating when this object should be executed, the available options include NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM, ALWAYS.
Default:TIMESTEP_END
C++ Type:ExecFlagEnum
Controllable:No
Description:The list of flag(s) indicating when this object should be executed, the available options include NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM, ALWAYS.
- moving_boundary_nameBoundary to modify when an element is moved. A boundary with the provided name will be created if not already exists on the mesh.
C++ Type:BoundaryName
Controllable:No
Description:Boundary to modify when an element is moved. A boundary with the provided name will be created if not already exists on the mesh.
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
Optional Parameters
- allow_duplicate_execution_on_initialFalseIn the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
Default:False
C++ Type:bool
Controllable:No
Description:In the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- execution_order_group0Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
Default:0
C++ Type:int
Controllable:No
Description:Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
- force_postauxFalseForces the UserObject to be executed in POSTAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in POSTAUX
- force_preauxFalseForces the UserObject to be executed in PREAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREAUX
- force_preicFalseForces the UserObject to be executed in PREIC during initial setup
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREIC during initial setup
- implicitTrueDetermines whether this object is calculated using an implicit or explicit form
Default:True
C++ Type:bool
Controllable:No
Description:Determines whether this object is calculated using an implicit or explicit form
- seed0The seed for the master random number generator
Default:0
C++ Type:unsigned int
Controllable:No
Description:The seed for the master random number generator