- variableThe name of the variable that this residual object operates on
C++ Type:NonlinearVariableName
Controllable:No
Description:The name of the variable that this residual object operates on
XFEMSingleVariableConstraint
Enforce constraints on the value or flux associated with a variable at an XFEM interface.
Overview
Without any other intervention, the phantom node method used by MOOSE's XFEM system results in Heaviside enrichment of all solution fields at the locations of interfaces, with zero flux conditions. In many cases, there is a need to impose constraints across the interface on one or more of the solutions fields in a multiphysics XFEM simulation, which is the purpose of XFEMSingleVariableConstraint
. The object takes in jumps in solutions and fluxes for a single variable and enforces prescribed jumps as a constraint between element fragments.
The variable to be constrained and the UserObject defining the interface upon which the constraint is occurring must both be specified. Next, any jumps in the variable's value or flux at the interface are provided. Lastly, the method by which the constraint is to be enacted is defined in the use_penalty
parameter and a parameter dependent upon choice of enforcement method is given in alpha
.
Currently, there are two choices of enforcement method: Nitsche's formulation and the penalty method. Nitsche's method has the advantage of providing consistent results but does require the stabilization parameter (alpha
) to be as small as possible to maintain solution stability and is only applicable to simple diffusion problems. The penalty method, while stable, does not give results as consistent as Nitsche but can be applied to a wider variety of problems. When using the penalty method, the alpha
parameter should be quite large relative to the Jacobian entries for the physics to which the penalty method is being applied.
Example Input File Syntax
[Constraints]
[./xfem_constraint]
type = XFEMSingleVariableConstraint
variable = u
geometric_cut_userobject = 'level_set_cut_uo'
jump_flux = jump_flux_func
use_penalty = true
alpha = 1e5
[../]
[]
(modules/xfem/test/tests/moving_interface/verification/1D_xy_discrete2mat.i)Input Parameters
- alpha100Stabilization parameter in Nitsche's formulation and penalty factor in the Penalty Method. In Nitsche's formulation this should be as small as possible while the method is still stable; while in the Penalty Method you want this to be quite large (e.g. 1e6).
Default:100
C++ Type:double
Controllable:No
Description:Stabilization parameter in Nitsche's formulation and penalty factor in the Penalty Method. In Nitsche's formulation this should be as small as possible while the method is still stable; while in the Penalty Method you want this to be quite large (e.g. 1e6).
- geometric_cut_userobjectName of GeometricCutUserObject associated with this constraint.
C++ Type:UserObjectName
Controllable:No
Description:Name of GeometricCutUserObject associated with this constraint.
- interface_id0The id of the interface.
Default:0
C++ Type:unsigned int
Controllable:No
Description:The id of the interface.
- jump0Jump at the interface. Can be a Real or FunctionName.
Default:0
C++ Type:FunctionName
Controllable:No
Description:Jump at the interface. Can be a Real or FunctionName.
- jump_flux0Flux jump at the interface. Can be a Real or FunctionName.
Default:0
C++ Type:FunctionName
Controllable:No
Description:Flux jump at the interface. Can be a Real or FunctionName.
- use_penaltyFalseUse the Penalty instead of Nitsche (Nitsche only works for simple diffusion problems).
Default:False
C++ Type:bool
Controllable:No
Description:Use the Penalty instead of Nitsche (Nitsche only works for simple diffusion problems).
Optional Parameters
- absolute_value_vector_tagsThe tags for the vectors this residual object should fill with the absolute value of the residual contribution
C++ Type:std::vector<TagName>
Controllable:No
Description:The tags for the vectors this residual object should fill with the absolute value of the residual contribution
- extra_matrix_tagsThe extra tags for the matrices this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the matrices this Kernel should fill
- extra_vector_tagsThe extra tags for the vectors this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the vectors this Kernel should fill
- matrix_tagssystemThe tag for the matrices this Kernel should fill
Default:system
C++ Type:MultiMooseEnum
Options:nontime, system
Controllable:No
Description:The tag for the matrices this Kernel should fill
- vector_tagsnontimeThe tag for the vectors this Kernel should fill
Default:nontime
C++ Type:MultiMooseEnum
Options:nontime, time
Controllable:No
Description:The tag for the vectors this Kernel should fill
Tagging Parameters
- 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.
- 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
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Advanced Parameters
Input Files
- (modules/xfem/test/tests/moving_interface/moving_bimaterial_finite_strain.i)
- (modules/xfem/test/tests/moving_interface/verification/2D_xy_lsdep1mat.i)
- (modules/xfem/test/tests/single_var_constraint_2d/stationary_jump_fluxjump.i)
- (modules/xfem/test/tests/bimaterials/glued_ad_bimaterials_2d.i)
- (modules/xfem/test/tests/moving_interface/verification/1D_rz_homog1mat.i)
- (modules/xfem/test/tests/checkpoint/checkpoint.i)
- (modules/xfem/test/tests/moving_interface/moving_bimaterial_finite_strain_esm.i)
- (modules/xfem/test/tests/single_var_constraint_2d/stationary_fluxjump_func.i)
- (modules/xfem/test/tests/single_var_constraint_3d/stationary_fluxjump_3d.i)
- (modules/xfem/test/tests/single_var_constraint_2d/propagating_2field_2constraint.i)
- (modules/xfem/test/tests/moving_interface/moving_ad_bimaterial.i)
- (modules/xfem/test/tests/moving_interface/verification/1D_xy_discrete2mat.i)
- (modules/xfem/test/tests/bimaterials/inclusion_ad_bimaterials_2d.i)
- (modules/xfem/test/tests/single_var_constraint_3d/stationary_equal_3d.i)
- (modules/xfem/test/tests/moving_interface/moving_level_set.i)
- (modules/xfem/test/tests/single_var_constraint_2d/stationary_equal.i)
- (modules/xfem/test/tests/mechanical_constraint/glued_penalty.i)
- (modules/xfem/test/tests/single_var_constraint_3d/stationary_jump_3d.i)
- (modules/xfem/test/tests/moving_interface/moving_bimaterial.i)
- (modules/xfem/test/tests/single_var_constraint_2d/propagating_1field.i)
- (modules/xfem/test/tests/moving_interface/verification/1D_xy_homog1mat.i)
- (modules/xfem/test/tests/single_var_constraint_2d/stationary_jump.i)
- (modules/xfem/test/tests/moving_interface/moving_bimaterial_finite_strain_esm_using_cut_mesh.i)
- (modules/xfem/test/tests/moving_interface/moving_bimaterial_finite_strain_cut_mesh.i)
- (modules/xfem/test/tests/single_var_constraint_2d/stationary_fluxjump.i)
- (modules/xfem/test/tests/moving_interface/verification/1D_xy_lsdep1mat.i)
- (modules/xfem/test/tests/moving_interface/verification/2D_xy_homog1mat.i)
- (modules/xfem/test/tests/moving_interface/verification/2D_rz_lsdep1mat.i)
- (modules/xfem/test/tests/moving_interface/verification/1D_rz_lsdep1mat.i)
- (modules/xfem/test/tests/moving_interface/moving_diffusion.i)
- (modules/xfem/test/tests/single_var_constraint_2d/propagating_2field_1constraint.i)
- (modules/xfem/test/tests/moving_interface/verification/2D_rz_homog1mat.i)
- (modules/xfem/test/tests/bimaterials/glued_bimaterials_2d.i)
- (modules/xfem/test/tests/single_var_constraint_3d/stationary_jump_fluxjump_3d.i)
- (modules/xfem/test/tests/moving_interface/moving_ad_diffusion.i)
- (modules/xfem/test/tests/single_var_constraint_2d/stationary_jump_func.i)
- (modules/xfem/test/tests/bimaterials/inclusion_bimaterials_2d.i)
(modules/xfem/test/tests/moving_interface/verification/1D_xy_discrete2mat.i)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# XFEM Moving Interface Verification Problem
# Dimensionality: quasi-1D
# Coordinate System: xy
# Material Numbers/Types:discrete homog 2 material, 2 region
# Element Order: 1st
# Interface Characteristics: u independent, prescribed level set function
# Description
# A transient heat transfer problem in Cartesian coordinates designed with
# the Method of Manufactured Solutions. This problem was developed to verify
# XFEM performance in the presence of a moving interface separating two
# discrete material regions for linear element models. Both the temperature
# solution and level set function are designed to be linear to attempt to
# minimize error between the exact solution and XFEM results. Thermal
# conductivity, density, and heat capacity are homogeneous in each material
# region with a discontinuous jump in thermal flux between the two material
# regions.
# Results:
# The temperature at the left boundary is determined by the analytical
# solution, so temperature at the right boundary (x=1) should exhibit the
# largest difference between the analytical solution and XFEM results. We
# present the analytical and XFEM results at the material interface position
# and right side boundary at various times.
# Interface:
# Time Expected Temperature XFEM Calculated Temperature
# 20 746.75 746.7235521
# 40 893.05 893.0379081
# 60 1040.15 1040.1527530
#
# Right Boundary (x=1):
# Time Expected Temperature XFEM Calculated Temperature
# 20 720 719.9708681
# 40 840 839.9913293
# 60 960 960.0100886
#
# IMPORTANT NOTE:
# When running this input file, add the --allow-test-objects tag!!!
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 1
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 0.5
elem_type = QUAD4
[]
[XFEM]
qrule = moment_fitting
output_cut_plane = true
[]
[UserObjects]
[./level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = phi
heal_always = true
[../]
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./phi]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./heat_cond]
type = MatDiffusion
variable = u
diffusivity = 'diffusion_coefficient'
[../]
[./vol_heat_src]
type = BodyForce
variable = u
function = src_func
[../]
[./mat_time_deriv]
type = TestMatTimeDerivative
variable = u
mat_prop_value = rhoCp
[../]
[]
[AuxKernels]
[./ls_function]
type = FunctionAux
variable = phi
function = ls_func
[../]
[]
[Constraints]
[./xfem_constraint]
type = XFEMSingleVariableConstraint
variable = u
geometric_cut_userobject = 'level_set_cut_uo'
jump_flux = jump_flux_func
use_penalty = true
alpha = 1e5
[../]
[]
[Functions]
[./src_func]
type = ParsedFunction
expression = 'phi:=(0.75-x-0.001*t);
i:=(0.75-0.001*t);
if (phi>=0,
10*(8-x),
(7/(1-i))*((i-2)*x + (8-7*i)) )'
[../]
[./right_du_func]
type = ParsedFunction
expression = 'i:=(0.75-0.001*t);
(2.0/(1-i))*(-5+5*i+i*t-2*t)'
[../]
[./exact_u_func]
type = ParsedFunction
expression = 'phi:=(0.75-x-0.001*t);
i:=(0.75-0.001*t);
if (phi>=0,
605 - 5*x + t*(8-x),
(1/(1-i))*((-5+5*i+i*t-2*t)*x + (605-605*i+8*t-7*t*i)) )'
[../]
[./jump_flux_func]
type = ParsedFunction
expression = 'i:=(0.75-0.001*t);
k_1:=(20.0);
k_2:=(2.0);
k_1*(5+t) + (k_2/(1-i))*(-5+5*i+i*t-2*t)'
[../]
[./ls_func]
type = ParsedFunction
expression = '0.75 - x - 0.001*t'
[../]
[]
[Materials]
[./mat_time_deriv_prop]
type = GenericConstantMaterial
prop_names = 'A_rhoCp B_rhoCp'
prop_values = '10 7'
[../]
[./therm_cond_prop]
type = GenericConstantMaterial
prop_names = 'A_diffusion_coefficient B_diffusion_coefficient'
prop_values = '20.0 2.0'
[../]
[./combined_rhoCp]
type = LevelSetBiMaterialReal
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = phi
prop_name = rhoCp
[../]
[./combined_diffusion_coefficient]
type = LevelSetBiMaterialReal
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = phi
prop_name = diffusion_coefficient
[../]
[]
[BCs]
[./left_u]
type = FunctionDirichletBC
variable = u
boundary = 'left'
function = exact_u_func
[../]
[./right_du]
type = FunctionNeumannBC
variable = u
boundary = 'right'
function = right_du_func
[../]
[]
[ICs]
[./u_ic]
type = ConstantIC
value = 600
variable = u
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
# petsc_options_iname = '-pc_type -pc_hypre_type'
# petsc_options_value = 'hypre boomeramg'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
line_search = 'none'
l_tol = 1.0e-6
nl_max_its = 15
nl_rel_tol = 1.0e-10
nl_abs_tol = 1.0e-9
start_time = 0.0
dt = 20
end_time = 60.0
max_xfem_update = 2
[]
[Outputs]
time_step_interval = 1
execute_on = 'initial timestep_end'
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/moving_interface/moving_bimaterial_finite_strain.i)
# This test is for two layer materials with different youngs modulus with AD
# The global stress is determined by switching the stress based on level set values
# The material interface is marked by a level set function
# The two layer materials are glued together
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[XFEM]
output_cut_plane = true
[]
[UserObjects]
[level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = ls
heal_always = true
[]
[]
[Mesh]
use_displaced_mesh = true
[generated_mesh]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmin = 0
xmax = 5
ymin = 0
ymax = 5
elem_type = QUAD4
[]
[left_bottom]
type = ExtraNodesetGenerator
new_boundary = 'left_bottom'
coord = '0 0'
input = generated_mesh
[]
[left_top]
type = ExtraNodesetGenerator
new_boundary = 'left_top'
coord = '0 5'
input = left_bottom
[]
[]
[Functions]
[ls_func]
type = ParsedFunction
expression = 'y-2.73+t'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[AuxVariables]
[ls]
[]
[a_strain_xx]
order = CONSTANT
family = MONOMIAL
[]
[a_strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[a_strain_xy]
order = CONSTANT
family = MONOMIAL
[]
[b_strain_xx]
order = CONSTANT
family = MONOMIAL
[]
[b_strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[b_strain_xy]
order = CONSTANT
family = MONOMIAL
[]
[stress_xx]
order = CONSTANT
family = MONOMIAL
[]
[stress_yy]
order = CONSTANT
family = MONOMIAL
[]
[stress_xy]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[ls_function]
type = FunctionAux
variable = ls
function = ls_func
[]
[a_strain_xx]
type = RankTwoAux
variable = a_strain_xx
rank_two_tensor = A_total_strain
index_i = 0
index_j = 0
[]
[a_strain_yy]
type = RankTwoAux
variable = a_strain_yy
rank_two_tensor = A_total_strain
index_i = 1
index_j = 1
[]
[a_strain_xy]
type = RankTwoAux
variable = a_strain_xy
rank_two_tensor = A_total_strain
index_i = 0
index_j = 1
[]
[b_strain_xx]
type = RankTwoAux
variable = b_strain_xx
rank_two_tensor = B_total_strain
index_i = 0
index_j = 0
[]
[b_strain_yy]
type = RankTwoAux
variable = b_strain_yy
rank_two_tensor = B_total_strain
index_i = 1
index_j = 1
[]
[b_strain_xy]
type = RankTwoAux
variable = b_strain_xy
rank_two_tensor = B_total_strain
index_i = 0
index_j = 1
[]
[stress_xx]
type = RankTwoAux
variable = stress_xx
rank_two_tensor = stress
index_i = 0
index_j = 0
[]
[stress_xy]
type = RankTwoAux
variable = stress_xy
rank_two_tensor = stress
index_i = 0
index_j = 1
[]
[stress_yy]
type = RankTwoAux
variable = stress_yy
rank_two_tensor = stress
index_i = 1
index_j = 1
[]
[]
[Kernels]
[solid_x]
type = StressDivergenceTensors
variable = disp_x
component = 0
use_displaced_mesh = true
[]
[solid_y]
type = StressDivergenceTensors
variable = disp_y
component = 1
use_displaced_mesh = true
[]
[]
[Constraints]
[dispx_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_x
alpha = 1e8
geometric_cut_userobject = 'level_set_cut_uo'
[]
[dispy_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_y
alpha = 1e8
geometric_cut_userobject = 'level_set_cut_uo'
[]
[]
[BCs]
[bottomx]
type = DirichletBC
boundary = bottom
variable = disp_x
value = 0.0
[]
[bottomy]
type = DirichletBC
boundary = bottom
variable = disp_y
value = 0.0
[]
[topx]
type = FunctionDirichletBC
boundary = top
variable = disp_x
function = 0.03*t
[]
[topy]
type = FunctionDirichletBC
boundary = top
variable = disp_y
function = '0.03*t'
[]
[]
[Materials]
[elasticity_tensor_A]
type = ComputeIsotropicElasticityTensor
base_name = A
youngs_modulus = 1e9
poissons_ratio = 0.3
[]
[strain_A]
type = ComputeFiniteStrain
base_name = A
[]
[stress_A]
type = ComputeFiniteStrainElasticStress
base_name = A
[]
[elasticity_tensor_B]
type = ComputeIsotropicElasticityTensor
base_name = B
youngs_modulus = 1e7
poissons_ratio = 0.3
[]
[strain_B]
type = ComputeFiniteStrain
base_name = B
[]
[stress_B]
type = ComputeFiniteStrainElasticStress
base_name = B
[]
[combined_stress]
type = LevelSetBiMaterialRankTwo
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = stress
[]
[combined_jacob_mult]
type = LevelSetBiMaterialRankFour
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = Jacobian_mult
[]
[]
[Postprocessors]
[disp_x_norm]
type = ElementL2Norm
variable = disp_x
[]
[disp_y_norm]
type = ElementL2Norm
variable = disp_y
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
automatic_scaling = true
# controls for nonlinear iterations
nl_max_its = 15
nl_rel_tol = 1e-13
nl_abs_tol = 1e-50
# time control
start_time = 0.0
dt = 0.1
num_steps = 4
max_xfem_update = 1
[]
[Outputs]
print_linear_residuals = false
exodus = true
[]
(modules/xfem/test/tests/moving_interface/verification/2D_xy_lsdep1mat.i)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# XFEM Moving Interface Verification Problem
# Dimensionality: 2D
# Coordinate System: xy
# Material Numbers/Types: level set dep 1 material, 2 region
# Element Order: 1st
# Interface Characteristics: u independent, prescribed level set function
# Description:
# Transient 2D heat transfer problem in Cartesian coordinates designed with
# the Method of Manufactured Solutions. This problem was developed to verify
# XFEM performance on linear elements in the presence of a moving interface
# sweeping across the x-y coordinates of a system with thermal conductivity
# dependent upon the transient level set function. This problem can be
# exactly evaluated by FEM/Moose without the moving interface. Both the
# temperature and level set function are designed to be linear to attempt to
# minimize the error between the Moose/exact solution and XFEM results.
# Results:
# The temperature at the bottom left boundary (x=0, y=0) exhibits the largest
# difference between the FEM/Moose solution and XFEM results. We present the
# XFEM results at this location with 10 digits of precision:
# Time Expected Temperature XFEM Calculated Temperature
# 0.2 440 440
# 0.4 480 479.9998738
# 0.6 520 519.9995114
# 0.8 560 559.9989360
# 1.0 600 599.9983833
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 4
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
elem_type = QUAD4
[]
[XFEM]
qrule = moment_fitting
output_cut_plane = true
[]
[UserObjects]
[./level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = ls
heal_always = true
[../]
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./ls]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./heat_cond]
type = MatDiffusion
variable = u
diffusivity = diffusion_coefficient
[../]
[./vol_heat_src]
type = BodyForce
variable = u
function = src_func
[../]
[./mat_time_deriv]
type = TestMatTimeDerivative
variable = u
mat_prop_value = rhoCp
[../]
[]
[AuxKernels]
[./ls_function]
type = FunctionAux
variable = ls
function = ls_func
[../]
[]
[Constraints]
[./xfem_constraints]
type = XFEMSingleVariableConstraint
variable = u
geometric_cut_userobject = 'level_set_cut_uo'
use_penalty = true
alpha = 1e5
[../]
[]
[Functions]
[./src_func]
type = ParsedFunction
expression = '10*(-100*x-100*y+200)-(5*t/1.04)'
[../]
[./neumann_func]
type = ParsedFunction
expression = '((0.01/1.04)*(-2.5*x-2.5*y-t)+1.55)*100*t'
[../]
[./dirichlet_right_func]
type = ParsedFunction
expression = '(-100*y+100)*t+400'
[../]
[./dirichlet_top_func]
type = ParsedFunction
expression = '(-100*x+100)*t+400'
[../]
[./k_func]
type = ParsedFunction
expression = '(0.01/1.04)*(-2.5*x-2.5*y-t)+1.55'
[../]
[./ls_func]
type = ParsedFunction
expression = '-0.5*(x+y) + 1.04 -0.2*t'
[../]
[]
[Materials]
[./mat_time_deriv_prop]
type = GenericConstantMaterial
prop_names = 'rhoCp'
prop_values = 10
[../]
[./therm_cond_prop]
type = GenericFunctionMaterial
prop_names = 'diffusion_coefficient'
prop_values = 'k_func'
[../]
[]
[BCs]
[./left_du]
type = FunctionNeumannBC
variable = u
boundary = 'left'
function = neumann_func
[../]
[./right_u]
type = FunctionDirichletBC
variable = u
boundary = 'right'
function = dirichlet_right_func
[../]
[./bottom_du]
type = FunctionNeumannBC
variable = u
boundary = 'bottom'
function = neumann_func
[../]
[./top_u]
type = FunctionDirichletBC
variable = u
boundary = 'top'
function = dirichlet_top_func
[../]
[]
[ICs]
[./u_ic]
type = ConstantIC
value = 400
variable = u
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
line_search = 'none'
l_tol = 1.0e-6
nl_max_its = 15
nl_rel_tol = 1.0e-10
nl_abs_tol = 1.0e-9
start_time = 0.0
dt = 0.2
end_time = 1.0
max_xfem_update = 1
[]
[Outputs]
time_step_interval = 1
execute_on = 'initial timestep_end'
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/single_var_constraint_2d/stationary_jump_fluxjump.i)
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
elem_type = QUAD4
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./line_seg_cut_uo]
type = LineSegmentCutUserObject
cut_data = '0.5 1.0 0.5 0.0'
[../]
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[Constraints]
[./xfem_constraint]
type = XFEMSingleVariableConstraint
variable = u
jump = 0.5
jump_flux = 1
geometric_cut_userobject = 'line_seg_cut_uo'
[../]
[]
[BCs]
# Define boundary conditions
[./left_u]
type = DirichletBC
variable = u
boundary = 3
value = 1
[../]
[./right_u]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
line_search = 'none'
l_tol = 1e-3
nl_max_its = 15
nl_rel_tol = 1e-10
nl_abs_tol = 1e-10
start_time = 0.0
dt = 1.0
end_time = 2.0
[]
[Outputs]
time_step_interval = 1
execute_on = timestep_end
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/bimaterials/glued_ad_bimaterials_2d.i)
# This test is for two layer materials with different youngs modulus using AD
# The global stress is determined by switching the stress based on level set values
# The material interface is marked by a level set function
# The two layer materials are glued together
[GlobalParams]
order = FIRST
family = LAGRANGE
displacements = 'disp_x disp_y'
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = ls
[../]
[]
[Mesh]
displacements = 'disp_x disp_y'
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmin = 0.0
xmax = 5.
ymin = 0.0
ymax = 5.
elem_type = QUAD4
[]
[./left_bottom]
type = ExtraNodesetGenerator
new_boundary = 'left_bottom'
coord = '0.0 0.0'
input = gen
[../]
[./left_top]
type = ExtraNodesetGenerator
new_boundary = 'left_top'
coord = '0.0 5.'
input = left_bottom
[../]
[]
[AuxVariables]
[./ls]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxKernels]
[./ls_function]
type = FunctionAux
variable = ls
function = ls_func
[../]
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[]
[Functions]
[./ls_func]
type = ParsedFunction
expression = 'y-2.5'
[../]
[]
[AuxVariables]
[./a_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./a_strain_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./a_strain_xy]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_xy]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Modules/TensorMechanics/Master]
[./all]
strain = SMALL
use_automatic_differentiation = true
add_variables = true
generate_output = 'stress_xx stress_yy stress_xy'
[../]
[]
[AuxKernels]
[./a_strain_xx]
type = ADRankTwoAux
rank_two_tensor = A_total_strain
index_i = 0
index_j = 0
variable = a_strain_xx
[../]
[./a_strain_yy]
type = ADRankTwoAux
rank_two_tensor = A_total_strain
index_i = 1
index_j = 1
variable = a_strain_yy
[../]
[./a_strain_xy]
type = ADRankTwoAux
rank_two_tensor = A_total_strain
index_i = 0
index_j = 1
variable = a_strain_xy
[../]
[./b_strain_xx]
type = ADRankTwoAux
rank_two_tensor = B_total_strain
index_i = 0
index_j = 0
variable = b_strain_xx
[../]
[./b_strain_yy]
type = ADRankTwoAux
rank_two_tensor = B_total_strain
index_i = 1
index_j = 1
variable = b_strain_yy
[../]
[./b_strain_xy]
type = ADRankTwoAux
rank_two_tensor = B_total_strain
index_i = 0
index_j = 1
variable = b_strain_xy
[../]
[]
[Constraints]
[./dispx_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_x
alpha = 1e8
geometric_cut_userobject = 'level_set_cut_uo'
[../]
[./dispy_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_y
alpha = 1e8
geometric_cut_userobject = 'level_set_cut_uo'
[../]
[]
[BCs]
[./bottomx]
type = ADDirichletBC
boundary = bottom
variable = disp_x
value = 0.0
[../]
[./bottomy]
type = ADDirichletBC
boundary = bottom
variable = disp_y
value = 0.0
[../]
[./topx]
type = ADFunctionDirichletBC
boundary = top
variable = disp_x
function = 0.03*t
[../]
[./topy]
type = ADFunctionDirichletBC
boundary = top
variable = disp_y
function = '0.03*t'
[../]
[]
[Materials]
[./elasticity_tensor_A]
type = ADComputeIsotropicElasticityTensor
base_name = A
youngs_modulus = 1e9
poissons_ratio = 0.3
[../]
[./strain_A]
type = ADComputeSmallStrain
base_name = A
[../]
[./stress_A]
type = ADComputeLinearElasticStress
base_name = A
[../]
[./elasticity_tensor_B]
type = ADComputeIsotropicElasticityTensor
base_name = B
youngs_modulus = 1e5
poissons_ratio = 0.3
[../]
[./strain_B]
type = ADComputeSmallStrain
base_name = B
[../]
[./stress_B]
type = ADComputeLinearElasticStress
base_name = B
[../]
[./combined_stress]
type = ADLevelSetBiMaterialRankTwo
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = stress
[../]
[./combined_elasticity_tensor]
type = ADLevelSetBiMaterialRankFour
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = elasticity_tensor
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
petsc_options_value = '201 hypre boomeramg 8'
line_search = 'bt'
# controls for linear iterations
l_max_its = 20
l_tol = 1e-8
# controls for nonlinear iterations
nl_max_its = 15
nl_rel_tol = 1e-14
nl_abs_tol = 1e-50
# time control
start_time = 0.0
dt = 0.1
num_steps = 2
max_xfem_update = 1
[]
[Outputs]
exodus = true
file_base = glued_bimaterials_2d_out
execute_on = timestep_end
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/moving_interface/verification/1D_rz_homog1mat.i)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# XFEM Moving Interface Verification Problem
# Dimensionality: quasi-1D
# Coordinate System: rz
# Material Numbers/Types: homogeneous 1 material, 2 region
# Element Order: 1st
# Interface Characteristics: u independent, prescribed level set function
# Description:
# A simple transient heat transfer problem in cylindrical coordinates designed
# with the Method of Manufactured Solutions. This problem was developed to
# verify XFEM performance in the presence of a moving interface for linear
# element models that can be exactly evaluated by FEM/Moose. Both the
# temperature solution and level set function are designed to be linear to
# attempt to minimize error between the Moose/exact solution and XFEM results.
# Thermal conductivity is a single, constant value at all points in the system.
# Results:
# The temperature at the left boundary (x=1) exhibits the largest difference
# between the FEM/Moose solution and XFEM results. We present the XFEM results
# at this location with 10 digits of precision:
# Time Expected Temperature XFEM Calculated Temperature
# 0.2 440 440
# 0.4 480 480.0008118
# 0.6 520 520.0038529
# 0.8 560 560.0089177
# 1.0 600 600.0133344
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Problem]
coord_type = RZ
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 1
xmin = 1.0
xmax = 2.0
ymin = 0.0
ymax = 0.5
elem_type = QUAD4
[]
[XFEM]
qrule = moment_fitting
output_cut_plane = true
[]
[UserObjects]
[./level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = ls
heal_always = true
[../]
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./ls]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./heat_cond]
type = MatDiffusion
variable = u
diffusivity = diffusion_coefficient
[../]
[./vol_heat_src]
type = BodyForce
variable = u
function = src_func
[../]
[./mat_time_deriv]
type = TestMatTimeDerivative
variable = u
mat_prop_value = rhoCp
[../]
[]
[AuxKernels]
[./ls_function]
type = FunctionAux
variable = ls
function = ls_func
[../]
[]
[Constraints]
[./xfem_constraint]
type = XFEMSingleVariableConstraint
variable = u
geometric_cut_userobject = 'level_set_cut_uo'
use_penalty = true
alpha = 1e5
[../]
[]
[Functions]
[./src_func]
type = ParsedFunction
expression = '10*(-200*x+400) + 200*1.5*t/x'
[../]
[./neumann_func]
type = ParsedFunction
expression = '1.5*200*t'
[../]
[./ls_func]
type = ParsedFunction
expression = '2.04 - x - 0.2*t'
[../]
[]
[Materials]
[./mat_time_deriv_prop]
type = GenericConstantMaterial
prop_names = 'rhoCp'
prop_values = 10
[../]
[./therm_cond_prop]
type = GenericConstantMaterial
prop_names = 'diffusion_coefficient'
prop_values = 1.5
[../]
[]
[BCs]
[./left_u]
type = FunctionNeumannBC
variable = u
boundary = 'left'
function = neumann_func
[../]
[./right_u]
type = DirichletBC
variable = u
boundary = 'right'
value = 400
[../]
[]
[ICs]
[./u_ic]
type = ConstantIC
value = 400
variable = u
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
line_search = 'none'
l_tol = 1.0e-6
nl_max_its = 15
nl_rel_tol = 1.0e-10
nl_abs_tol = 1.0e-9
start_time = 0.0
dt = 0.2
end_time = 1.0
max_xfem_update = 1
[]
[Outputs]
time_step_interval = 1
execute_on = 'initial timestep_end'
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/checkpoint/checkpoint.i)
# This test is for two layer materials with different youngs modulus
# The global stress is determined by switching the stress based on level set values
# The material interface is marked by a level set function
# The two layer materials are glued together
[GlobalParams]
order = FIRST
family = LAGRANGE
displacements = 'disp_x disp_y'
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = ls
[../]
[]
[Mesh]
displacements = 'disp_x disp_y'
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmin = 0.0
xmax = 5.
ymin = 0.0
ymax = 5.
elem_type = QUAD4
[]
[./left_bottom]
type = ExtraNodesetGenerator
new_boundary = 'left_bottom'
coord = '0.0 0.0'
input = gen
[../]
[./left_top]
type = ExtraNodesetGenerator
new_boundary = 'left_top'
coord = '0.0 5.'
input = left_bottom
[../]
[]
[AuxVariables]
[./ls]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxKernels]
[./ls_function]
type = FunctionAux
variable = ls
function = ls_func
[../]
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[]
[Functions]
[./ls_func]
type = ParsedFunction
expression = 'y-2.5'
[../]
[]
[AuxVariables]
[./stress_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./stress_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./stress_xy]
order = CONSTANT
family = MONOMIAL
[../]
[./a_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./a_strain_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./a_strain_xy]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_xy]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./TensorMechanics]
[../]
[]
[AuxKernels]
[./stress_xx]
type = RankTwoAux
rank_two_tensor = stress
index_i = 0
index_j = 0
variable = stress_xx
[../]
[./stress_yy]
type = RankTwoAux
rank_two_tensor = stress
index_i = 1
index_j = 1
variable = stress_yy
[../]
[./stress_xy]
type = RankTwoAux
rank_two_tensor = stress
index_i = 0
index_j = 1
variable = stress_xy
[../]
[./a_strain_xx]
type = RankTwoAux
rank_two_tensor = A_total_strain
index_i = 0
index_j = 0
variable = a_strain_xx
[../]
[./a_strain_yy]
type = RankTwoAux
rank_two_tensor = A_total_strain
index_i = 1
index_j = 1
variable = a_strain_yy
[../]
[./a_strain_xy]
type = RankTwoAux
rank_two_tensor = A_total_strain
index_i = 0
index_j = 1
variable = a_strain_xy
[../]
[./b_strain_xx]
type = RankTwoAux
rank_two_tensor = B_total_strain
index_i = 0
index_j = 0
variable = b_strain_xx
[../]
[./b_strain_yy]
type = RankTwoAux
rank_two_tensor = B_total_strain
index_i = 1
index_j = 1
variable = b_strain_yy
[../]
[./b_strain_xy]
type = RankTwoAux
rank_two_tensor = B_total_strain
index_i = 0
index_j = 1
variable = b_strain_xy
[../]
[]
[Constraints]
[./dispx_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_x
alpha = 1e8
geometric_cut_userobject = 'level_set_cut_uo'
[../]
[./dispy_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_y
alpha = 1e8
geometric_cut_userobject = 'level_set_cut_uo'
[../]
[]
[BCs]
[./bottomx]
type = DirichletBC
boundary = bottom
variable = disp_x
value = 0.0
[../]
[./bottomy]
type = DirichletBC
boundary = bottom
variable = disp_y
value = 0.0
[../]
[./topx]
type = FunctionDirichletBC
boundary = top
variable = disp_x
function = 0.03*t
[../]
[./topy]
type = FunctionDirichletBC
boundary = top
variable = disp_y
function = '0.03*t'
[../]
[]
[Materials]
[./elasticity_tensor_A]
type = ComputeIsotropicElasticityTensor
base_name = A
youngs_modulus = 1e9
poissons_ratio = 0.3
[../]
[./strain_A]
type = ComputeSmallStrain
base_name = A
[../]
[./stress_A]
type = ComputeLinearElasticStress
base_name = A
[../]
[./elasticity_tensor_B]
type = ComputeIsotropicElasticityTensor
base_name = B
youngs_modulus = 1e5
poissons_ratio = 0.3
[../]
[./strain_B]
type = ComputeSmallStrain
base_name = B
[../]
[./stress_B]
type = ComputeLinearElasticStress
base_name = B
[../]
[./combined_stress]
type = LevelSetBiMaterialRankTwo
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = stress
[../]
[./combined_dstressdstrain]
type = LevelSetBiMaterialRankFour
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = Jacobian_mult
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
petsc_options_value = '201 hypre boomeramg 8'
line_search = 'bt'
# controls for linear iterations
l_max_its = 20
l_tol = 1e-3
# controls for nonlinear iterations
nl_max_its = 15
nl_rel_tol = 1e-14
nl_abs_tol = 1e-7
# time control
start_time = 0.0
dt = 0.1
num_steps = 2
max_xfem_update = 1
[]
[Outputs]
checkpoint = true
exodus = true
execute_on = timestep_end
csv = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/moving_interface/moving_bimaterial_finite_strain_esm.i)
# This test is for two layer materials with different youngs modulus with AD
# The global stress is determined by switching the stress based on level set values
# The material interface is marked by a level set function
# The two layer materials are glued together
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[XFEM]
output_cut_plane = true
[]
[UserObjects]
[level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = ls
heal_always = true
[]
[esm]
type = CutElementSubdomainModifier
geometric_cut_userobject = level_set_cut_uo
apply_initial_conditions = false
[]
[]
[Mesh]
use_displaced_mesh = true
[generated_mesh]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmin = 0
xmax = 5
ymin = 0
ymax = 5
elem_type = QUAD4
[]
[bottom]
type = SubdomainBoundingBoxGenerator
input = generated_mesh
block_id = 0
bottom_left = '0 0 0'
top_right = '5 2.5 0'
[]
[top]
type = SubdomainBoundingBoxGenerator
input = bottom
block_id = 1
bottom_left = '0 2.5 0'
top_right = '5 5 0'
[]
[]
[Functions]
[ls_func]
type = ParsedFunction
expression = 'y-2.73+t'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[AuxVariables]
[ls]
[]
[strain_xx]
order = CONSTANT
family = MONOMIAL
[]
[strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[strain_xy]
order = CONSTANT
family = MONOMIAL
[]
[stress_xx]
order = CONSTANT
family = MONOMIAL
[]
[stress_yy]
order = CONSTANT
family = MONOMIAL
[]
[stress_xy]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[ls_function]
type = FunctionAux
variable = ls
function = ls_func
[]
[strain_xx]
type = RankTwoAux
variable = strain_xx
rank_two_tensor = total_strain
index_i = 0
index_j = 0
[]
[strain_yy]
type = RankTwoAux
variable = strain_yy
rank_two_tensor = total_strain
index_i = 1
index_j = 1
[]
[strain_xy]
type = RankTwoAux
variable = strain_xy
rank_two_tensor = total_strain
index_i = 0
index_j = 1
[]
[stress_xx]
type = RankTwoAux
variable = stress_xx
rank_two_tensor = stress
index_i = 0
index_j = 0
[]
[stress_xy]
type = RankTwoAux
variable = stress_xy
rank_two_tensor = stress
index_i = 0
index_j = 1
[]
[stress_yy]
type = RankTwoAux
variable = stress_yy
rank_two_tensor = stress
index_i = 1
index_j = 1
[]
[]
[Kernels]
[solid_x]
type = StressDivergenceTensors
variable = disp_x
component = 0
use_displaced_mesh = true
[]
[solid_y]
type = StressDivergenceTensors
variable = disp_y
component = 1
use_displaced_mesh = true
[]
[]
[Constraints]
[dispx_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_x
alpha = 1e8
geometric_cut_userobject = 'level_set_cut_uo'
[]
[dispy_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_y
alpha = 1e8
geometric_cut_userobject = 'level_set_cut_uo'
[]
[]
[BCs]
[bottomx]
type = DirichletBC
boundary = bottom
variable = disp_x
value = 0.0
[]
[bottomy]
type = DirichletBC
boundary = bottom
variable = disp_y
value = 0.0
[]
[topx]
type = FunctionDirichletBC
boundary = top
variable = disp_x
function = 0.03*t
[]
[topy]
type = FunctionDirichletBC
boundary = top
variable = disp_y
function = '0.03*t'
[]
[]
[Materials]
[elasticity_tensor_A]
type = ComputeIsotropicElasticityTensor
block = 1
youngs_modulus = 1e9
poissons_ratio = 0.3
[]
[strain_A]
type = ComputeFiniteStrain
block = 1
[]
[stress_A]
type = ComputeFiniteStrainElasticStress
block = 1
[]
[elasticity_tensor_B]
type = ComputeIsotropicElasticityTensor
block = 0
youngs_modulus = 1e7
poissons_ratio = 0.3
[]
[strain_B]
type = ComputeFiniteStrain
block = 0
[]
[stress_B]
type = ComputeFiniteStrainElasticStress
block = 0
[]
[]
[Postprocessors]
[disp_x_norm]
type = ElementL2Norm
variable = disp_x
[]
[disp_y_norm]
type = ElementL2Norm
variable = disp_y
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
automatic_scaling = true
# controls for nonlinear iterations
nl_max_its = 15
nl_rel_tol = 1e-13
nl_abs_tol = 1e-50
# time control
start_time = 0.0
dt = 0.1
num_steps = 4
max_xfem_update = 1
[]
[Outputs]
print_linear_residuals = false
exodus = true
[]
(modules/xfem/test/tests/single_var_constraint_2d/stationary_fluxjump_func.i)
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
elem_type = QUAD4
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./line_seg_cut_uo]
type = LineSegmentCutUserObject
cut_data = '0.5 1.0 0.5 0.0'
[../]
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[Constraints]
[./xfem_constraint]
type = XFEMSingleVariableConstraint
variable = u
jump = 0
jump_flux = jump_flux_func
geometric_cut_userobject = 'line_seg_cut_uo'
[../]
[]
[Functions]
[./jump_flux_func]
type = ParsedFunction
expression = '1'
[../]
[]
[BCs]
# Define boundary conditions
[./left_u]
type = DirichletBC
variable = u
boundary = 3
value = 1
[../]
[./right_u]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
line_search = 'none'
l_tol = 1e-3
nl_max_its = 15
nl_rel_tol = 1e-10
nl_abs_tol = 1e-10
start_time = 0.0
dt = 1.0
end_time = 2.0
[]
[Outputs]
time_step_interval = 1
execute_on = timestep_end
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/single_var_constraint_3d/stationary_fluxjump_3d.i)
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Mesh]
type = GeneratedMesh
dim = 3
nx = 5
ny = 5
nz = 2
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
zmin = 0.0
zmax = 0.25
elem_type = HEX8
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./square_planar_cut_uo]
type = RectangleCutUserObject
cut_data = ' 0.5 -0.001 -0.001
0.5 1.001 -0.001
0.5 1.001 1.001
0.5 -0.001 1.001'
[../]
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[Constraints]
[./xfem_constraint]
type = XFEMSingleVariableConstraint
variable = u
jump = 0
jump_flux = 1
geometric_cut_userobject = 'square_planar_cut_uo'
[../]
[]
[BCs]
# Define boundary conditions
[./left_u]
type = DirichletBC
variable = u
boundary = left
value = 1
[../]
[./right_u]
type = DirichletBC
variable = u
boundary = right
value = 0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
line_search = 'none'
l_tol = 1e-3
nl_max_its = 15
nl_rel_tol = 1e-10
nl_abs_tol = 1e-10
start_time = 0.0
dt = 1.0
end_time = 2.0
[]
[Outputs]
time_step_interval = 1
execute_on = timestep_end
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/single_var_constraint_2d/propagating_2field_2constraint.i)
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
elem_type = QUAD4
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./line_seg_cut_uo]
type = LineSegmentCutUserObject
cut_data = '0.5 1.0 0.5 0.0'
time_start_cut = 0.0
time_end_cut = 2.0
[../]
[]
[Variables]
[./u]
[../]
[./v]
[../]
[]
[Kernels]
[./diff_u]
type = Diffusion
variable = u
[../]
[./diff_v]
type = Diffusion
variable = v
[../]
[]
[Constraints]
[./xfem_constraint_u]
type = XFEMSingleVariableConstraint
variable = u
jump = 0
jump_flux = 0
geometric_cut_userobject = 'line_seg_cut_uo'
[../]
[./xfem_constraint_v]
type = XFEMSingleVariableConstraint
variable = v
jump = 0
jump_flux = 0
geometric_cut_userobject = 'line_seg_cut_uo'
[../]
[]
[BCs]
# Define boundary conditions
[./left_u]
type = DirichletBC
variable = u
boundary = 3
value = 1
[../]
[./right_u]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[./left_v]
type = DirichletBC
variable = v
boundary = 3
value = 1
[../]
[./right_v]
type = DirichletBC
variable = v
boundary = 1
value = 0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
line_search = 'none'
l_tol = 1e-3
nl_max_its = 15
nl_rel_tol = 1e-10
nl_abs_tol = 1e-10
start_time = 0.0
dt = 1.0
end_time = 2.0
[]
[Outputs]
time_step_interval = 1
execute_on = timestep_end
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/moving_interface/moving_ad_bimaterial.i)
# This test is for two layer materials with different youngs modulus with AD
# The global stress is determined by switching the stress based on level set values
# The material interface is marked by a level set function
# The two layer materials are glued together
# This case is also meant to test for a bug in moving interfaces on displaced meshes
# It should fail during the healing step of the 2nd timestep if the bug is present.
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = ls
heal_always = true
[../]
[]
[Mesh]
displacements = 'disp_x disp_y'
[generated_mesh]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmin = 0.0
xmax = 5.
ymin = 0.0
ymax = 5.
elem_type = QUAD4
[]
[./left_bottom]
type = ExtraNodesetGenerator
new_boundary = 'left_bottom'
coord = '0.0 0.0'
input = generated_mesh
[../]
[./left_top]
type = ExtraNodesetGenerator
new_boundary = 'left_top'
coord = '0.0 5.'
input = left_bottom
[../]
[]
[AuxVariables]
[./ls]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxKernels]
[./ls_function]
type = FunctionAux
variable = ls
function = ls_func
[../]
[]
[Functions]
[./ls_func]
type = ParsedFunction
expression = 'y-3.153 + t'
[../]
[]
[AuxVariables]
[./a_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./a_strain_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./a_strain_xy]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_xy]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Modules/TensorMechanics/Master]
[./all]
strain = SMALL
use_automatic_differentiation = true
add_variables = true
generate_output = 'stress_xx stress_yy stress_xy'
[../]
[]
[AuxKernels]
[./a_strain_xx]
type = ADRankTwoAux
rank_two_tensor = A_total_strain
index_i = 0
index_j = 0
variable = a_strain_xx
[../]
[./a_strain_yy]
type = ADRankTwoAux
rank_two_tensor = A_total_strain
index_i = 1
index_j = 1
variable = a_strain_yy
[../]
[./a_strain_xy]
type = ADRankTwoAux
rank_two_tensor = A_total_strain
index_i = 0
index_j = 1
variable = a_strain_xy
[../]
[./b_strain_xx]
type = ADRankTwoAux
rank_two_tensor = B_total_strain
index_i = 0
index_j = 0
variable = b_strain_xx
[../]
[./b_strain_yy]
type = ADRankTwoAux
rank_two_tensor = B_total_strain
index_i = 1
index_j = 1
variable = b_strain_yy
[../]
[./b_strain_xy]
type = ADRankTwoAux
rank_two_tensor = B_total_strain
index_i = 0
index_j = 1
variable = b_strain_xy
[../]
[]
[Constraints]
[./dispx_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_x
alpha = 1e8
geometric_cut_userobject = 'level_set_cut_uo'
[../]
[./dispy_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_y
alpha = 1e8
geometric_cut_userobject = 'level_set_cut_uo'
[../]
[]
[BCs]
[./bottomx]
type = ADDirichletBC
boundary = bottom
variable = disp_x
value = 0.0
[../]
[./bottomy]
type = ADDirichletBC
boundary = bottom
variable = disp_y
value = 0.0
[../]
[./topx]
type = ADFunctionDirichletBC
boundary = top
variable = disp_x
function = 0.03*t
[../]
[./topy]
type = ADFunctionDirichletBC
boundary = top
variable = disp_y
function = '0.03*t'
[../]
[]
[Materials]
[./elasticity_tensor_A]
type = ADComputeIsotropicElasticityTensor
base_name = A
youngs_modulus = 1e9
poissons_ratio = 0.3
[../]
[./strain_A]
type = ADComputeSmallStrain
base_name = A
displacements = 'disp_x disp_y'
[../]
[./stress_A]
type = ADComputeLinearElasticStress
base_name = A
[../]
[./elasticity_tensor_B]
type = ADComputeIsotropicElasticityTensor
base_name = B
youngs_modulus = 1e7
poissons_ratio = 0.3
[../]
[./strain_B]
type = ADComputeSmallStrain
base_name = B
displacements = 'disp_x disp_y'
[../]
[./stress_B]
type = ADComputeLinearElasticStress
base_name = B
[../]
[./combined_stress]
type = ADLevelSetBiMaterialRankTwo
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = stress
[../]
[./combined_elasticity_tensor]
type = ADLevelSetBiMaterialRankFour
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = elasticity_tensor
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
petsc_options_value = '201 hypre boomeramg 8'
line_search = 'bt'
# controls for linear iterations
l_max_its = 20
l_tol = 1e-8
# controls for nonlinear iterations
nl_max_its = 15
nl_rel_tol = 1e-14
nl_abs_tol = 1e-50
# time control
start_time = 0.0
dt = 0.15
num_steps = 3
max_xfem_update = 1
[]
[Outputs]
exodus = true
execute_on = timestep_end
file_base = moving_bimaterial_out
perf_graph = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/moving_interface/verification/1D_xy_discrete2mat.i)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# XFEM Moving Interface Verification Problem
# Dimensionality: quasi-1D
# Coordinate System: xy
# Material Numbers/Types:discrete homog 2 material, 2 region
# Element Order: 1st
# Interface Characteristics: u independent, prescribed level set function
# Description
# A transient heat transfer problem in Cartesian coordinates designed with
# the Method of Manufactured Solutions. This problem was developed to verify
# XFEM performance in the presence of a moving interface separating two
# discrete material regions for linear element models. Both the temperature
# solution and level set function are designed to be linear to attempt to
# minimize error between the exact solution and XFEM results. Thermal
# conductivity, density, and heat capacity are homogeneous in each material
# region with a discontinuous jump in thermal flux between the two material
# regions.
# Results:
# The temperature at the left boundary is determined by the analytical
# solution, so temperature at the right boundary (x=1) should exhibit the
# largest difference between the analytical solution and XFEM results. We
# present the analytical and XFEM results at the material interface position
# and right side boundary at various times.
# Interface:
# Time Expected Temperature XFEM Calculated Temperature
# 20 746.75 746.7235521
# 40 893.05 893.0379081
# 60 1040.15 1040.1527530
#
# Right Boundary (x=1):
# Time Expected Temperature XFEM Calculated Temperature
# 20 720 719.9708681
# 40 840 839.9913293
# 60 960 960.0100886
#
# IMPORTANT NOTE:
# When running this input file, add the --allow-test-objects tag!!!
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 1
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 0.5
elem_type = QUAD4
[]
[XFEM]
qrule = moment_fitting
output_cut_plane = true
[]
[UserObjects]
[./level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = phi
heal_always = true
[../]
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./phi]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./heat_cond]
type = MatDiffusion
variable = u
diffusivity = 'diffusion_coefficient'
[../]
[./vol_heat_src]
type = BodyForce
variable = u
function = src_func
[../]
[./mat_time_deriv]
type = TestMatTimeDerivative
variable = u
mat_prop_value = rhoCp
[../]
[]
[AuxKernels]
[./ls_function]
type = FunctionAux
variable = phi
function = ls_func
[../]
[]
[Constraints]
[./xfem_constraint]
type = XFEMSingleVariableConstraint
variable = u
geometric_cut_userobject = 'level_set_cut_uo'
jump_flux = jump_flux_func
use_penalty = true
alpha = 1e5
[../]
[]
[Functions]
[./src_func]
type = ParsedFunction
expression = 'phi:=(0.75-x-0.001*t);
i:=(0.75-0.001*t);
if (phi>=0,
10*(8-x),
(7/(1-i))*((i-2)*x + (8-7*i)) )'
[../]
[./right_du_func]
type = ParsedFunction
expression = 'i:=(0.75-0.001*t);
(2.0/(1-i))*(-5+5*i+i*t-2*t)'
[../]
[./exact_u_func]
type = ParsedFunction
expression = 'phi:=(0.75-x-0.001*t);
i:=(0.75-0.001*t);
if (phi>=0,
605 - 5*x + t*(8-x),
(1/(1-i))*((-5+5*i+i*t-2*t)*x + (605-605*i+8*t-7*t*i)) )'
[../]
[./jump_flux_func]
type = ParsedFunction
expression = 'i:=(0.75-0.001*t);
k_1:=(20.0);
k_2:=(2.0);
k_1*(5+t) + (k_2/(1-i))*(-5+5*i+i*t-2*t)'
[../]
[./ls_func]
type = ParsedFunction
expression = '0.75 - x - 0.001*t'
[../]
[]
[Materials]
[./mat_time_deriv_prop]
type = GenericConstantMaterial
prop_names = 'A_rhoCp B_rhoCp'
prop_values = '10 7'
[../]
[./therm_cond_prop]
type = GenericConstantMaterial
prop_names = 'A_diffusion_coefficient B_diffusion_coefficient'
prop_values = '20.0 2.0'
[../]
[./combined_rhoCp]
type = LevelSetBiMaterialReal
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = phi
prop_name = rhoCp
[../]
[./combined_diffusion_coefficient]
type = LevelSetBiMaterialReal
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = phi
prop_name = diffusion_coefficient
[../]
[]
[BCs]
[./left_u]
type = FunctionDirichletBC
variable = u
boundary = 'left'
function = exact_u_func
[../]
[./right_du]
type = FunctionNeumannBC
variable = u
boundary = 'right'
function = right_du_func
[../]
[]
[ICs]
[./u_ic]
type = ConstantIC
value = 600
variable = u
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
# petsc_options_iname = '-pc_type -pc_hypre_type'
# petsc_options_value = 'hypre boomeramg'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
line_search = 'none'
l_tol = 1.0e-6
nl_max_its = 15
nl_rel_tol = 1.0e-10
nl_abs_tol = 1.0e-9
start_time = 0.0
dt = 20
end_time = 60.0
max_xfem_update = 2
[]
[Outputs]
time_step_interval = 1
execute_on = 'initial timestep_end'
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/bimaterials/inclusion_ad_bimaterials_2d.i)
# This test is for a matrix-inclusion composite materials using AD
# The global stress is determined by switching the stress based on level set values
# The inclusion geometry is marked by a level set function
# The matrix and inclusion are glued together
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = ls
[../]
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 11
ny = 11
xmin = 0.0
xmax = 5.
ymin = 0.0
ymax = 5.
elem_type = QUAD4
displacements = 'disp_x disp_y'
[]
[AuxVariables]
[./ls]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxKernels]
[./ls_function]
type = FunctionAux
variable = ls
function = ls_func
[../]
[]
[Functions]
[./ls_func]
type = ParsedFunction
expression = 'sqrt((y-2.5)*(y-2.5) + (x-2.5)*(x-2.5)) - 1.5'
[../]
[]
[AuxVariables]
[./a_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./a_strain_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./a_strain_xy]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_xy]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Modules/TensorMechanics/Master]
[./all]
strain = SMALL
use_automatic_differentiation = true
add_variables = true
generate_output = 'stress_xx stress_yy stress_xy'
[../]
[]
[AuxKernels]
[./a_strain_xx]
type = ADRankTwoAux
rank_two_tensor = A_total_strain
index_i = 0
index_j = 0
variable = a_strain_xx
[../]
[./a_strain_yy]
type = ADRankTwoAux
rank_two_tensor = A_total_strain
index_i = 1
index_j = 1
variable = a_strain_yy
[../]
[./a_strain_xy]
type = ADRankTwoAux
rank_two_tensor = A_total_strain
index_i = 0
index_j = 1
variable = a_strain_xy
[../]
[./b_strain_xx]
type = ADRankTwoAux
rank_two_tensor = B_total_strain
index_i = 0
index_j = 0
variable = b_strain_xx
[../]
[./b_strain_yy]
type = ADRankTwoAux
rank_two_tensor = B_total_strain
index_i = 1
index_j = 1
variable = b_strain_yy
[../]
[./b_strain_xy]
type = ADRankTwoAux
rank_two_tensor = B_total_strain
index_i = 0
index_j = 1
variable = b_strain_xy
[../]
[]
[Constraints]
[./dispx_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_x
alpha = 1e8
geometric_cut_userobject = 'level_set_cut_uo'
[../]
[./dispy_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_y
alpha = 1e8
geometric_cut_userobject = 'level_set_cut_uo'
[../]
[]
[BCs]
[./bottomx]
type = ADDirichletBC
boundary = bottom
variable = disp_x
value = 0.0
[../]
[./bottomy]
type = ADDirichletBC
boundary = bottom
variable = disp_y
value = 0.0
[../]
[./topx]
type = ADFunctionDirichletBC
boundary = top
variable = disp_x
function = '0.03*t'
[../]
[./topy]
type = ADFunctionDirichletBC
boundary = top
variable = disp_y
function = '0.03*t'
[../]
[]
[Materials]
[./elasticity_tensor_A]
type = ADComputeIsotropicElasticityTensor
base_name = A
youngs_modulus = 1e9
poissons_ratio = 0.3
[../]
[./strain_A]
type = ADComputeSmallStrain
base_name = A
[../]
[./stress_A]
type = ADComputeLinearElasticStress
base_name = A
[../]
[./elasticity_tensor_B]
type = ADComputeIsotropicElasticityTensor
base_name = B
youngs_modulus = 1e5
poissons_ratio = 0.3
[../]
[./strain_B]
type = ADComputeSmallStrain
base_name = B
[../]
[./stress_B]
type = ADComputeLinearElasticStress
base_name = B
[../]
[./combined_stress]
type = ADLevelSetBiMaterialRankTwo
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = stress
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
petsc_options_value = '201 hypre boomeramg 8'
# controls for linear iterations
l_max_its = 20
l_tol = 1e-8
# controls for nonlinear iterations
nl_max_its = 15
nl_rel_tol = 1e-14
nl_abs_tol = 1e-50 #1e-7
# time control
start_time = 0.0
dt = 0.5
end_time = 1.0
num_steps = 2
max_xfem_update = 1
[]
[Outputs]
exodus = true
file_base = inclusion_bimaterials_2d_out
execute_on = timestep_end
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/single_var_constraint_3d/stationary_equal_3d.i)
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Mesh]
type = GeneratedMesh
dim = 3
nx = 5
ny = 5
nz = 2
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
zmin = 0.0
zmax = 0.25
elem_type = HEX8
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./square_planar_cut_uo]
type = RectangleCutUserObject
cut_data = ' 0.5 -0.001 -0.001
0.5 1.001 -0.001
0.5 1.001 1.001
0.5 -0.001 1.001'
[../]
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[Constraints]
[./xfem_constraint]
type = XFEMSingleVariableConstraint
variable = u
jump = 0
jump_flux = 0
geometric_cut_userobject = 'square_planar_cut_uo'
[../]
[]
[BCs]
# Define boundary conditions
[./left_u]
type = DirichletBC
variable = u
boundary = left
value = 1
[../]
[./right_u]
type = DirichletBC
variable = u
boundary = right
value = 0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
line_search = 'none'
l_tol = 1e-3
nl_max_its = 15
nl_rel_tol = 1e-10
nl_abs_tol = 1e-10
start_time = 0.0
dt = 1.0
end_time = 2.0
[]
[Outputs]
time_step_interval = 1
execute_on = timestep_end
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/moving_interface/moving_level_set.i)
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
xmin = 0
xmax = 1
ymin = 0
ymax = 1
elem_type = QUAD4
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./line_seg_cut_uo]
type = LineSegmentCutSetUserObject
cut_data = '0.3 1.0 0.3 0.2 0 3'
heal_always = false
[../]
[./level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = ls
heal_always = true
[../]
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./ls]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxKernels]
[./ls_function]
type = FunctionAux
variable = ls
function = ls_func
[../]
[]
[Functions]
[./u_left]
type = PiecewiseLinear
x = '0 2'
y = '3 5'
[../]
[./ls_func]
type = ParsedFunction
expression = 'x-0.7-0.07*(t-1)'
[../]
[]
[Constraints]
[./u_constraint]
type = XFEMSingleVariableConstraint
geometric_cut_userobject = 'level_set_cut_uo'
use_displaced_mesh = false
variable = u
use_penalty = true
alpha = 1e5
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
# Define boundary conditions
[./left_u]
type = DirichletBC
variable = u
boundary = 3
value = 3
[../]
[./right_u]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
# petsc_options_iname = '-pc_type -pc_hypre_type'
# petsc_options_value = 'hypre boomeramg'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
line_search = 'none'
l_tol = 1e-3
nl_max_its = 15
nl_rel_tol = 1e-10
nl_abs_tol = 1e-9
start_time = 0.0
dt = 1
end_time = 3.0
max_xfem_update = 1
[]
[Outputs]
time_step_interval = 1
execute_on = timestep_end
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/single_var_constraint_2d/stationary_equal.i)
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
elem_type = QUAD4
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./line_seg_cut_uo]
type = LineSegmentCutUserObject
cut_data = '0.5 1.0 0.5 0.0'
[../]
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[Constraints]
[./xfem_constraint]
type = XFEMSingleVariableConstraint
variable = u
jump = 0
jump_flux = 0
geometric_cut_userobject = 'line_seg_cut_uo'
[../]
[]
[BCs]
# Define boundary conditions
[./left_u]
type = DirichletBC
variable = u
boundary = 3
value = 1
[../]
[./right_u]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
line_search = 'none'
l_tol = 1e-3
nl_max_its = 15
nl_rel_tol = 1e-10
nl_abs_tol = 1e-10
start_time = 0.0
dt = 1.0
end_time = 2.0
[]
[Outputs]
time_step_interval = 1
execute_on = timestep_end
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/mechanical_constraint/glued_penalty.i)
[GlobalParams]
displacements = 'disp_x disp_y'
volumetric_locking_correction = false
[]
[XFEM]
geometric_cut_userobjects = 'line_seg_cut_uo'
qrule = volfrac
output_cut_plane = true
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 11
ny = 11
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
elem_type = QUAD4
[]
[UserObjects]
[./line_seg_cut_uo]
type = LineSegmentCutUserObject
cut_data = '1.0 0.5 0.0 0.5'
time_start_cut = 0.0
time_end_cut = 0.0
[../]
[]
[Modules/TensorMechanics/Master]
[./all]
strain = FINITE
planar_formulation = plane_strain
add_variables = true
[../]
[]
[Functions]
[./pull]
type = PiecewiseLinear
x='0 50 100'
y='0 0.02 0.1'
[../]
[]
[BCs]
[./bottomx]
type = DirichletBC
boundary = bottom
variable = disp_x
value = 0.0
[../]
[./bottomy]
type = DirichletBC
boundary = bottom
variable = disp_y
value = 0.0
[../]
[./topx]
type = DirichletBC
boundary = top
variable = disp_x
value = 0.0
[../]
[./topy]
type = FunctionDirichletBC
boundary = top
variable = disp_y
function = pull
[../]
[]
[Constraints]
[./disp_x]
type = XFEMSingleVariableConstraint
variable = disp_x
use_penalty = true
alpha = 1.0e8
use_displaced_mesh = true
geometric_cut_userobject = 'line_seg_cut_uo'
[../]
[./disp_y]
type = XFEMSingleVariableConstraint
variable = disp_y
use_penalty = true
alpha = 1.0e8
use_displaced_mesh = true
geometric_cut_userobject = 'line_seg_cut_uo'
[../]
[]
[Materials]
[./elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1e6
poissons_ratio = 0.3
block = 0
[../]
[./_elastic_strain]
type = ComputeFiniteStrainElasticStress
block = 0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
petsc_options_value = '201 hypre boomeramg 8'
line_search = 'none'
[./Predictor]
type = SimplePredictor
scale = 1.0
[../]
# controls for linear iterations
l_max_its = 100
l_tol = 1e-2
# controls for nonlinear iterations
nl_max_its = 15
nl_rel_tol = 1e-14
nl_abs_tol = 1e-9
# time control
start_time = 0.0
dt = 1.0
end_time = 2.0
num_steps = 5000
max_xfem_update = 1
[]
[Outputs]
exodus = true
execute_on = timestep_end
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/single_var_constraint_3d/stationary_jump_3d.i)
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Mesh]
type = GeneratedMesh
dim = 3
nx = 5
ny = 5
nz = 2
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
zmin = 0.0
zmax = 0.25
elem_type = HEX8
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./square_planar_cut_uo]
type = RectangleCutUserObject
cut_data = ' 0.5 -0.001 -0.001
0.5 1.001 -0.001
0.5 1.001 1.001
0.5 -0.001 1.001'
[../]
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[Constraints]
[./xfem_constraint]
type = XFEMSingleVariableConstraint
variable = u
jump = 0.5
jump_flux = 0
geometric_cut_userobject = 'square_planar_cut_uo'
[../]
[]
[BCs]
# Define boundary conditions
[./left_u]
type = DirichletBC
variable = u
boundary = left
value = 1
[../]
[./right_u]
type = DirichletBC
variable = u
boundary = right
value = 0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
line_search = 'none'
l_tol = 1e-3
nl_max_its = 15
nl_rel_tol = 1e-10
nl_abs_tol = 1e-10
start_time = 0.0
dt = 1.0
end_time = 2.0
[]
[Outputs]
time_step_interval = 1
execute_on = timestep_end
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/moving_interface/moving_bimaterial.i)
# This test is for two layer materials with different youngs modulus
# The global stress is determined by switching the stress based on level set values
# The material interface is marked by a level set function
# The two layer materials are glued together
# This case is also meant to test for a bug in moving interfaces on displaced meshes
# It should fail during the healing step of the 2nd timestep if the bug is present.
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = ls
heal_always = true
[../]
[]
[Mesh]
displacements = 'disp_x disp_y'
[generated_mesh]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmin = 0.0
xmax = 5.
ymin = 0.0
ymax = 5.
elem_type = QUAD4
[]
[./left_bottom]
type = ExtraNodesetGenerator
new_boundary = 'left_bottom'
coord = '0.0 0.0'
input = generated_mesh
[../]
[./left_top]
type = ExtraNodesetGenerator
new_boundary = 'left_top'
coord = '0.0 5.'
input = left_bottom
[../]
[]
[AuxVariables]
[./ls]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxKernels]
[./ls_function]
type = FunctionAux
variable = ls
function = ls_func
[../]
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[]
[Functions]
[./ls_func]
type = ParsedFunction
expression = 'y-3.153 + t'
[../]
[]
[AuxVariables]
[./stress_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./stress_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./stress_xy]
order = CONSTANT
family = MONOMIAL
[../]
[./a_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./a_strain_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./a_strain_xy]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_xy]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./TensorMechanics]
displacements = 'disp_x disp_y'
[../]
[]
[AuxKernels]
[./stress_xx]
type = RankTwoAux
rank_two_tensor = stress
index_i = 0
index_j = 0
variable = stress_xx
[../]
[./stress_yy]
type = RankTwoAux
rank_two_tensor = stress
index_i = 1
index_j = 1
variable = stress_yy
[../]
[./stress_xy]
type = RankTwoAux
rank_two_tensor = stress
index_i = 0
index_j = 1
variable = stress_xy
[../]
[./a_strain_xx]
type = RankTwoAux
rank_two_tensor = A_total_strain
index_i = 0
index_j = 0
variable = a_strain_xx
[../]
[./a_strain_yy]
type = RankTwoAux
rank_two_tensor = A_total_strain
index_i = 1
index_j = 1
variable = a_strain_yy
[../]
[./a_strain_xy]
type = RankTwoAux
rank_two_tensor = A_total_strain
index_i = 0
index_j = 1
variable = a_strain_xy
[../]
[./b_strain_xx]
type = RankTwoAux
rank_two_tensor = B_total_strain
index_i = 0
index_j = 0
variable = b_strain_xx
[../]
[./b_strain_yy]
type = RankTwoAux
rank_two_tensor = B_total_strain
index_i = 1
index_j = 1
variable = b_strain_yy
[../]
[./b_strain_xy]
type = RankTwoAux
rank_two_tensor = B_total_strain
index_i = 0
index_j = 1
variable = b_strain_xy
[../]
[]
[Constraints]
[./dispx_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_x
alpha = 1e8
geometric_cut_userobject = 'level_set_cut_uo'
[../]
[./dispy_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_y
alpha = 1e8
geometric_cut_userobject = 'level_set_cut_uo'
[../]
[]
[BCs]
[./bottomx]
type = DirichletBC
boundary = bottom
variable = disp_x
value = 0.0
[../]
[./bottomy]
type = DirichletBC
boundary = bottom
variable = disp_y
value = 0.0
[../]
[./topx]
type = FunctionDirichletBC
boundary = top
variable = disp_x
function = 0.03*t
[../]
[./topy]
type = FunctionDirichletBC
boundary = top
variable = disp_y
function = '0.03*t'
[../]
[]
[Materials]
[./elasticity_tensor_A]
type = ComputeIsotropicElasticityTensor
base_name = A
youngs_modulus = 1e9
poissons_ratio = 0.3
[../]
[./strain_A]
type = ComputeSmallStrain
base_name = A
displacements = 'disp_x disp_y'
[../]
[./stress_A]
type = ComputeLinearElasticStress
base_name = A
[../]
[./elasticity_tensor_B]
type = ComputeIsotropicElasticityTensor
base_name = B
youngs_modulus = 1e7
poissons_ratio = 0.3
[../]
[./strain_B]
type = ComputeSmallStrain
base_name = B
displacements = 'disp_x disp_y'
[../]
[./stress_B]
type = ComputeLinearElasticStress
base_name = B
[../]
[./combined_stress]
type = LevelSetBiMaterialRankTwo
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = stress
[../]
[./combined_dstressdstrain]
type = LevelSetBiMaterialRankFour
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = Jacobian_mult
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
petsc_options_value = '201 hypre boomeramg 8'
line_search = 'bt'
# controls for linear iterations
l_max_its = 20
l_tol = 1e-3
# controls for nonlinear iterations
nl_max_its = 15
nl_rel_tol = 1e-12
nl_abs_tol = 1e-12
# time control
start_time = 0.0
dt = 0.15
num_steps = 3
max_xfem_update = 1
[]
[Outputs]
exodus = true
execute_on = timestep_end
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/single_var_constraint_2d/propagating_1field.i)
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
elem_type = QUAD4
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./line_seg_cut_uo]
type = LineSegmentCutUserObject
cut_data = '0.5 1.0 0.5 0.0'
time_start_cut = 0.0
time_end_cut = 2.0
[../]
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[Constraints]
[./xfem_constraint]
type = XFEMSingleVariableConstraint
variable = u
jump = 0
jump_flux = 0
geometric_cut_userobject = 'line_seg_cut_uo'
[../]
[]
[BCs]
# Define boundary conditions
[./left_u]
type = DirichletBC
variable = u
boundary = 3
value = 1
[../]
[./right_u]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
line_search = 'none'
l_tol = 1e-3
nl_max_its = 15
nl_rel_tol = 1e-10
nl_abs_tol = 1e-10
start_time = 0.0
dt = 1.0
end_time = 2.0
[]
[Outputs]
time_step_interval = 1
execute_on = timestep_end
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/moving_interface/verification/1D_xy_homog1mat.i)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# XFEM Moving Interface Verification Problem
# Dimensionality: quasi-1D
# Coordinate System: xy
# Material Numbers/Types: homogeneous 1 material, 2 region
# Element Order: 1st
# Interface Characteristics: u independent, prescribed linear level set function
# Description:
# A simple transient heat transfer problem in Cartesian coordinates designed
# with the Method of Manufactured Solutions. This problem was developed to
# verify XFEM performance in the presence of a moving interface for linear
# element models that can be exactly evaluated by FEM/Moose. Both the
# temperature solution and level set function are designed to be linear to
# attempt to minimize error between the Moose/exact solution and XFEM results.
# Thermal conductivity is a single, constant value at all points in the system.
# Results:
# The temperature at the left boundary (x=0) exhibits the largest difference
# between the FEM/Moose solution and XFEM results. We present the XFEM results
# at this location with 10 digits of precision:
# Time Expected Temperature XFEM Calculated Temperature
# 0.2 440 440
# 0.4 480 480.0000064
# 0.6 520 520.0000323
# 0.8 560 560.0000896
# 1.0 600 600.0001870
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 1
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 0.5
elem_type = QUAD4
[]
[XFEM]
qrule = moment_fitting
output_cut_plane = true
[]
[UserObjects]
[./level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = ls
heal_always = true
[../]
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./ls]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./heat_cond]
type = MatDiffusion
variable = u
diffusivity = diffusion_coefficient
[../]
[./vol_heat_src]
type = BodyForce
variable = u
function = src_func
[../]
[./mat_time_deriv]
type = TestMatTimeDerivative
variable = u
mat_prop_value = rhoCp
[../]
[]
[AuxKernels]
[./ls_function]
type = FunctionAux
variable = ls
function = ls_func
[../]
[]
[Constraints]
[./xfem_constraint]
type = XFEMSingleVariableConstraint
variable = u
geometric_cut_userobject = 'level_set_cut_uo'
use_penalty = true
alpha = 1e5
[../]
[]
[Functions]
[./src_func]
type = ParsedFunction
expression = '10*(-200*x+200)'
[../]
[./ls_func]
type = ParsedFunction
expression = '1-(x-0.04)-0.2*t'
[../]
[./neumann_func]
type = ParsedFunction
expression = '1.5*200*t'
[../]
[]
[Materials]
[./mat_time_deriv_prop]
type = GenericConstantMaterial
prop_names = 'rhoCp'
prop_values = 10
[../]
[./therm_cond_prop]
type = GenericConstantMaterial
prop_names = 'diffusion_coefficient'
prop_values = 1.5
[../]
[]
[BCs]
[./left_du]
type = FunctionNeumannBC
variable = u
boundary = 'left'
function = neumann_func
[../]
[./right_u]
type = DirichletBC
variable = u
boundary = 'right'
value = 400
[../]
[]
[ICs]
[./u_ic]
type = ConstantIC
value = 400
variable = u
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
line_search = 'none'
l_tol = 1.0e-6
nl_max_its = 15
nl_rel_tol = 1.0e-10
nl_abs_tol = 1.0e-9
start_time = 0.0
dt = 0.2
end_time = 1.0
max_xfem_update = 1
[]
[Outputs]
time_step_interval = 1
execute_on = 'initial timestep_end'
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/single_var_constraint_2d/stationary_jump.i)
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
elem_type = QUAD4
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./line_seg_cut_uo]
type = LineSegmentCutUserObject
cut_data = '0.5 1.0 0.5 0.0'
[../]
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[Constraints]
[./xfem_constraint]
type = XFEMSingleVariableConstraint
variable = u
jump = 0.5
jump_flux = 0
geometric_cut_userobject = 'line_seg_cut_uo'
[../]
[]
[BCs]
# Define boundary conditions
[./left_u]
type = DirichletBC
variable = u
boundary = 3
value = 1
[../]
[./right_u]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
line_search = 'none'
l_tol = 1e-3
nl_max_its = 15
nl_rel_tol = 1e-10
nl_abs_tol = 1e-10
start_time = 0.0
dt = 1.0
end_time = 2.0
[]
[Outputs]
time_step_interval = 1
execute_on = timestep_end
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/moving_interface/moving_bimaterial_finite_strain_esm_using_cut_mesh.i)
# This test is for two layer materials with different youngs modulus with AD
# The global stress is determined by switching the stress based on level set values
# The material interface is marked by a level set function
# The two layer materials are glued together
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[XFEM]
output_cut_plane = true
[]
[UserObjects]
[cut]
type = InterfaceMeshCut2DUserObject
mesh_file = line.e
interface_velocity_function = 1
heal_always = true
[]
[esm]
type = CutElementSubdomainModifier
geometric_cut_userobject = cut
apply_initial_conditions = false
[]
[]
[Mesh]
use_displaced_mesh = true
[generated_mesh]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmin = 0
xmax = 5
ymin = 0
ymax = 5
elem_type = QUAD4
[]
[bottom]
type = SubdomainBoundingBoxGenerator
input = generated_mesh
block_id = 0
bottom_left = '0 0 0'
top_right = '5 2.5 0'
[]
[top]
type = SubdomainBoundingBoxGenerator
input = bottom
block_id = 1
bottom_left = '0 2.5 0'
top_right = '5 5 0'
[]
[]
[Functions]
[ls_func]
type = ParsedFunction
expression = 'y-2.73+t'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[AuxVariables]
[ls]
[]
[strain_xx]
order = CONSTANT
family = MONOMIAL
[]
[strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[strain_xy]
order = CONSTANT
family = MONOMIAL
[]
[stress_xx]
order = CONSTANT
family = MONOMIAL
[]
[stress_yy]
order = CONSTANT
family = MONOMIAL
[]
[stress_xy]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[ls_function]
type = FunctionAux
variable = ls
function = ls_func
[]
[strain_xx]
type = RankTwoAux
variable = strain_xx
rank_two_tensor = total_strain
index_i = 0
index_j = 0
[]
[strain_yy]
type = RankTwoAux
variable = strain_yy
rank_two_tensor = total_strain
index_i = 1
index_j = 1
[]
[strain_xy]
type = RankTwoAux
variable = strain_xy
rank_two_tensor = total_strain
index_i = 0
index_j = 1
[]
[stress_xx]
type = RankTwoAux
variable = stress_xx
rank_two_tensor = stress
index_i = 0
index_j = 0
[]
[stress_xy]
type = RankTwoAux
variable = stress_xy
rank_two_tensor = stress
index_i = 0
index_j = 1
[]
[stress_yy]
type = RankTwoAux
variable = stress_yy
rank_two_tensor = stress
index_i = 1
index_j = 1
[]
[]
[Kernels]
[solid_x]
type = StressDivergenceTensors
variable = disp_x
component = 0
use_displaced_mesh = true
[]
[solid_y]
type = StressDivergenceTensors
variable = disp_y
component = 1
use_displaced_mesh = true
[]
[]
[Constraints]
[dispx_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_x
alpha = 1e8
geometric_cut_userobject = 'cut'
[]
[dispy_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_y
alpha = 1e8
geometric_cut_userobject = 'cut'
[]
[]
[BCs]
[bottomx]
type = DirichletBC
boundary = bottom
variable = disp_x
value = 0.0
[]
[bottomy]
type = DirichletBC
boundary = bottom
variable = disp_y
value = 0.0
[]
[topx]
type = FunctionDirichletBC
boundary = top
variable = disp_x
function = 0.03*t
[]
[topy]
type = FunctionDirichletBC
boundary = top
variable = disp_y
function = '0.03*t'
[]
[]
[Materials]
[elasticity_tensor_A]
type = ComputeIsotropicElasticityTensor
block = 1
youngs_modulus = 1e9
poissons_ratio = 0.3
[]
[strain_A]
type = ComputeFiniteStrain
block = 1
[]
[stress_A]
type = ComputeFiniteStrainElasticStress
block = 1
[]
[elasticity_tensor_B]
type = ComputeIsotropicElasticityTensor
block = 0
youngs_modulus = 1e7
poissons_ratio = 0.3
[]
[strain_B]
type = ComputeFiniteStrain
block = 0
[]
[stress_B]
type = ComputeFiniteStrainElasticStress
block = 0
[]
[]
[Postprocessors]
[disp_x_norm]
type = ElementL2Norm
variable = disp_x
[]
[disp_y_norm]
type = ElementL2Norm
variable = disp_y
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
automatic_scaling = true
# controls for nonlinear iterations
nl_max_its = 15
nl_rel_tol = 1e-13
nl_abs_tol = 1e-50
# time control
start_time = 0.0
dt = 0.1
num_steps = 4
max_xfem_update = 1
[]
[Outputs]
print_linear_residuals = false
exodus = true
[]
(modules/xfem/test/tests/moving_interface/moving_bimaterial_finite_strain_cut_mesh.i)
# This test is for two layer materials with different youngs modulus with AD
# The global stress is determined by switching the stress based on level set values
# The material interface is marked by a level set function
# The two layer materials are glued together
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[XFEM]
output_cut_plane = true
[]
[UserObjects]
[cut]
type = InterfaceMeshCut2DUserObject
mesh_file = line.e
interface_velocity_function = -1
heal_always = true
[]
[]
[Mesh]
use_displaced_mesh = true
[generated_mesh]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmin = 0
xmax = 5
ymin = 0
ymax = 5
elem_type = QUAD4
[]
[left_bottom]
type = ExtraNodesetGenerator
new_boundary = 'left_bottom'
coord = '0 0'
input = generated_mesh
[]
[left_top]
type = ExtraNodesetGenerator
new_boundary = 'left_top'
coord = '0 5'
input = left_bottom
[]
[]
# [Functions]
# [ls_func]
# type = ParsedFunction
# expression = 'y-2.73+t'
# []
# []
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[AuxVariables]
[ls]
[]
[a_strain_xx]
order = CONSTANT
family = MONOMIAL
[]
[a_strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[a_strain_xy]
order = CONSTANT
family = MONOMIAL
[]
[b_strain_xx]
order = CONSTANT
family = MONOMIAL
[]
[b_strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[b_strain_xy]
order = CONSTANT
family = MONOMIAL
[]
[stress_xx]
order = CONSTANT
family = MONOMIAL
[]
[stress_yy]
order = CONSTANT
family = MONOMIAL
[]
[stress_xy]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
# [ls_function]
# type = FunctionAux
# variable = ls
# function = ls_func
# []
[a_strain_xx]
type = RankTwoAux
variable = a_strain_xx
rank_two_tensor = A_total_strain
index_i = 0
index_j = 0
[]
[a_strain_yy]
type = RankTwoAux
variable = a_strain_yy
rank_two_tensor = A_total_strain
index_i = 1
index_j = 1
[]
[a_strain_xy]
type = RankTwoAux
variable = a_strain_xy
rank_two_tensor = A_total_strain
index_i = 0
index_j = 1
[]
[b_strain_xx]
type = RankTwoAux
variable = b_strain_xx
rank_two_tensor = B_total_strain
index_i = 0
index_j = 0
[]
[b_strain_yy]
type = RankTwoAux
variable = b_strain_yy
rank_two_tensor = B_total_strain
index_i = 1
index_j = 1
[]
[b_strain_xy]
type = RankTwoAux
variable = b_strain_xy
rank_two_tensor = B_total_strain
index_i = 0
index_j = 1
[]
[stress_xx]
type = RankTwoAux
variable = stress_xx
rank_two_tensor = stress
index_i = 0
index_j = 0
[]
[stress_xy]
type = RankTwoAux
variable = stress_xy
rank_two_tensor = stress
index_i = 0
index_j = 1
[]
[stress_yy]
type = RankTwoAux
variable = stress_yy
rank_two_tensor = stress
index_i = 1
index_j = 1
[]
[]
[Kernels]
[solid_x]
type = StressDivergenceTensors
variable = disp_x
component = 0
use_displaced_mesh = true
[]
[solid_y]
type = StressDivergenceTensors
variable = disp_y
component = 1
use_displaced_mesh = true
[]
[]
[Constraints]
[dispx_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_x
alpha = 1e8
geometric_cut_userobject = 'level_set_cut_uo'
[]
[dispy_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_y
alpha = 1e8
geometric_cut_userobject = 'level_set_cut_uo'
[]
[]
[BCs]
[bottomx]
type = DirichletBC
boundary = bottom
variable = disp_x
value = 0.0
[]
[bottomy]
type = DirichletBC
boundary = bottom
variable = disp_y
value = 0.0
[]
[topx]
type = FunctionDirichletBC
boundary = top
variable = disp_x
function = 0.03*t
[]
[topy]
type = FunctionDirichletBC
boundary = top
variable = disp_y
function = '0.03*t'
[]
[]
[Materials]
[elasticity_tensor_A]
type = ComputeIsotropicElasticityTensor
base_name = A
youngs_modulus = 1e9
poissons_ratio = 0.3
[]
[strain_A]
type = ComputeFiniteStrain
base_name = A
[]
[stress_A]
type = ComputeFiniteStrainElasticStress
base_name = A
[]
[elasticity_tensor_B]
type = ComputeIsotropicElasticityTensor
base_name = B
youngs_modulus = 1e7
poissons_ratio = 0.3
[]
[strain_B]
type = ComputeFiniteStrain
base_name = B
[]
[stress_B]
type = ComputeFiniteStrainElasticStress
base_name = B
[]
[combined_stress]
type = LevelSetBiMaterialRankTwo
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = stress
[]
[combined_jacob_mult]
type = LevelSetBiMaterialRankFour
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = Jacobian_mult
[]
[]
[Postprocessors]
[disp_x_norm]
type = ElementL2Norm
variable = disp_x
[]
[disp_y_norm]
type = ElementL2Norm
variable = disp_y
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
automatic_scaling = true
# controls for nonlinear iterations
nl_max_its = 15
nl_rel_tol = 1e-13
nl_abs_tol = 1e-50
# time control
start_time = 0.0
dt = 0.1
num_steps = 4
max_xfem_update = 1
[]
[Outputs]
print_linear_residuals = false
exodus = true
[]
(modules/xfem/test/tests/single_var_constraint_2d/stationary_fluxjump.i)
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
elem_type = QUAD4
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./line_seg_cut_uo]
type = LineSegmentCutUserObject
cut_data = '0.5 1.0 0.5 0.0'
[../]
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[Constraints]
[./xfem_constraint]
type = XFEMSingleVariableConstraint
variable = u
jump = 0
jump_flux = 1
geometric_cut_userobject = 'line_seg_cut_uo'
[../]
[]
[BCs]
# Define boundary conditions
[./left_u]
type = DirichletBC
variable = u
boundary = 3
value = 1
[../]
[./right_u]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
line_search = 'none'
l_tol = 1e-3
nl_max_its = 15
nl_rel_tol = 1e-10
nl_abs_tol = 1e-10
start_time = 0.0
dt = 1.0
end_time = 2.0
[]
[Outputs]
time_step_interval = 1
execute_on = timestep_end
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/moving_interface/verification/1D_xy_lsdep1mat.i)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# XFEM Moving Interface Verification Problem
# Dimensionality: quasi-1D
# Coordinate System: xy
# Material Numbers/Types: level set dep 1 material, 2 region
# Element Order: 1st
# Interface Characteristics: u independent, prescribed level set function
# Description:
# A simple transient heat transfer problem in Cartesian coordinates designed
# with the Method of Manufactured Solutions. This problem was developed to
# verify XFEM performance in the presence of a moving interface for linear
# element models that can be exactly evaluated by FEM/Moose. Both the
# temperature solution and level set function are designed to be linear to
# attempt to minimize error between the Moose/exact solution and XFEM results.
# Thermal conductivity is dependent upon the value of the level set function
# at each timestep.
# Results:
# The temperature at the left boundary (x=0) exhibits the largest difference
# between the FEM/Moose solution and XFEM results. We present the XFEM
# results at this location with 10 digits of precision:
# Time Expected Temperature XFEM Calculated Temperature
# 0.2 440 440
# 0.4 480 479.9999722
# 0.6 520 519.9998726
# 0.8 560 559.9997314
# 1.0 600 599.9996885
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 1
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 0.5
elem_type = QUAD4
[]
[XFEM]
qrule = moment_fitting
output_cut_plane = true
[]
[UserObjects]
[./level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = ls
heal_always = true
[../]
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./ls]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./heat_cond]
type = MatDiffusion
variable = u
diffusivity = diffusion_coefficient
[../]
[./vol_heat_src]
type = BodyForce
variable = u
function = src_func
[../]
[./mat_time_deriv]
type = TestMatTimeDerivative
variable = u
mat_prop_value = rhoCp
[../]
[]
[AuxKernels]
[./ls_function]
type = FunctionAux
variable = ls
function = ls_func
[../]
[]
[Constraints]
[./xfem_constraint]
type = XFEMSingleVariableConstraint
variable = u
geometric_cut_userobject = 'level_set_cut_uo'
use_penalty = true
alpha = 1e5
[../]
[]
[Functions]
[./src_func]
type = ParsedFunction
expression = 'rhoCp*(-200*x+200)-(0.05*200*t/1.04)'
symbol_names = 'rhoCp'
symbol_values = 10
[../]
[./neumann_func]
type = ParsedFunction
expression = '((0.05/1.04)*(1-(x-0.04)-0.2*t) + 1.5)*200*t'
[../]
[./k_func]
type = ParsedFunction
expression = '(0.05/1.04)*(1-(x-0.04)-0.2*t) + 1.5'
[../]
[./ls_func]
type = ParsedFunction
expression = '1.04 - x - 0.2*t'
[../]
[]
[Materials]
[./mat_time_deriv_prop]
type = GenericConstantMaterial
prop_names = 'rhoCp'
prop_values = 10
[../]
[./therm_cond_prop]
type = GenericFunctionMaterial
prop_names = 'diffusion_coefficient'
prop_values = 'k_func'
[../]
[]
[BCs]
[./left_u]
type = FunctionNeumannBC
variable = u
boundary = 'left'
function = neumann_func
[../]
[./right_u]
type = DirichletBC
variable = u
boundary = 'right'
value = 400
[../]
[]
[ICs]
[./u_ic]
type = ConstantIC
value = 400
variable = u
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
line_search = 'none'
l_tol = 1.0e-6
nl_max_its = 15
nl_rel_tol = 1.0e-10
nl_abs_tol = 1.0e-9
start_time = 0.0
dt = 0.2
end_time = 1.0
max_xfem_update = 1
[]
[Outputs]
time_step_interval = 1
execute_on = 'initial timestep_end'
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/moving_interface/verification/2D_xy_homog1mat.i)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# XFEM Moving Interface Verification Problem
# Dimensionality: 2D
# Coordinate System: xy
# Material Numbers/Types: homogeneous 1 material, 2 region
# Element Order: 1st
# Interface Characteristics: u independent, prescribed level set function
# Description:
# Transient 2D heat transfer problem in Cartesian coordinates designed with
# the Method of Manufactured Solutions. This problem was developed to verify
# XFEM performance on linear elements in the presence of a moving interface
# sweeping across the x-y coordinates of a system with homogeneous material
# properties. This problem can be exactly evaluated by FEM/Moose without the
# moving interface. Both the temperature and level set function are designed
# to be linear to attempt to minimize error between the Moose/exact solution
# and XFEM results.
# Results:
# The temperature at the bottom left boundary (x=0, y=0) exhibits the largest
# difference between the FEM/Moose solution and XFEM results. We present the
# XFEM results at this location with 10 digits of precision:
# Time Expected Temperature XFEM Calculated Temperature
# 0.2 440 440
# 0.4 480 479.9998791
# 0.6 520 519.9995307
# 0.8 560 559.9989724
# 1.0 600 599.9984541
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 4
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
elem_type = QUAD4
[]
[XFEM]
qrule = moment_fitting
output_cut_plane = true
[]
[UserObjects]
[./level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = ls
heal_always = true
[../]
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./ls]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./heat_cond]
type = MatDiffusion
variable = u
diffusivity = diffusion_coefficient
[../]
[./vol_heat_src]
type = BodyForce
variable = u
function = src_func
[../]
[./mat_time_deriv]
type = TestMatTimeDerivative
variable = u
mat_prop_value = rhoCp
[../]
[]
[AuxKernels]
[./ls_function]
type = FunctionAux
variable = ls
function = ls_func
[../]
[]
[Constraints]
[./xfem_constraints]
type = XFEMSingleVariableConstraint
variable = u
geometric_cut_userobject = 'level_set_cut_uo'
use_penalty = true
alpha = 1e5
[../]
[]
[Functions]
[./src_func]
type = ParsedFunction
expression = '10*(-100*x-100*y+200)'
[../]
[./neumann_func]
type = ParsedFunction
expression = '1.5*100*t'
[../]
[./dirichlet_right_func]
type = ParsedFunction
expression = '(-100*y+100)*t+400'
[../]
[./dirichlet_top_func]
type = ParsedFunction
expression = '(-100*x+100)*t+400'
[../]
[./ls_func]
type = ParsedFunction
expression = '-0.5*(x+y) + 1.04 - 0.2*t'
[../]
[]
[Materials]
[./mat_time_deriv_prop]
type = GenericConstantMaterial
prop_names = 'rhoCp'
prop_values = 10
[../]
[./therm_cond_prop]
type = GenericConstantMaterial
prop_names = 'diffusion_coefficient'
prop_values = 1.5
[../]
[]
[BCs]
[./left_du]
type = FunctionNeumannBC
variable = u
boundary = 'left'
function = neumann_func
[../]
[./right_u]
type = FunctionDirichletBC
variable = u
boundary = 'right'
function = dirichlet_right_func
[../]
[./bottom_du]
type = FunctionNeumannBC
variable = u
boundary = 'bottom'
function = neumann_func
[../]
[./top_u]
type = FunctionDirichletBC
variable = u
boundary = 'top'
function = dirichlet_top_func
[../]
[]
[ICs]
[./u_ic]
type = ConstantIC
value = 400
variable = u
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
line_search = 'none'
l_tol = 1.0e-6
nl_max_its = 15
nl_rel_tol = 1.0e-10
nl_abs_tol = 1.0e-9
start_time = 0.0
dt = 0.2
end_time = 1.0
max_xfem_update = 1
[]
[Outputs]
time_step_interval = 1
execute_on = 'initial timestep_end'
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/moving_interface/verification/2D_rz_lsdep1mat.i)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# XFEM Moving Interface Verification Problem
# Dimensionality: 2D
# Coordinate System: rz
# Material Numbers/Types: level set dep 1 material, 2 region
# Element Order: 1st
# Interface Characteristics: u independent, prescribed level set function
# Description:
# Transient 2D heat transfer problem in cylindrical coordinates designed with
# the Method of Manufactured Solutions. This problem was developed to verify
# XFEM performance on linear elements in the presence of a moving interface
# sweeping across the x-y coordinates of a system with thermal conductivity
# dependent upon the transient level set function. This problem can be
# exactly evaluated by FEM/Moose without the moving interface. Both the
# temperature and level set function are designed to be linear to attempt to
# minimize the error between the Moose/exact solution and XFEM results.
# Results:
# The temperature at the bottom left boundary (x=1, y=1) exhibits the largest
# difference between the FEM/Moose solution and XFEM results. We present the
# XFEM results at this location with 10 digits of precision:
# Time Expected Temperature XFEM Calculated Temperature
# 0.2 440 440
# 0.4 480 479.9998717
# 0.6 520 519.9994963
# 0.8 560 559.9989217
# 1.0 600 599.9986735
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Problem]
coord_type = RZ
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 4
xmin = 1.0
xmax = 2.0
ymin = 1.0
ymax = 2.0
elem_type = QUAD4
[]
[XFEM]
qrule = moment_fitting
output_cut_plane = true
[]
[UserObjects]
[./level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = ls
heal_always = true
[../]
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./ls]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./heat_cond]
type = MatDiffusion
variable = u
diffusivity = diffusion_coefficient
[../]
[./vol_heat_src]
type = BodyForce
variable = u
function = src_func
[../]
[./mat_time_deriv]
type = TestMatTimeDerivative
variable = u
mat_prop_value = rhoCp
[../]
[]
[AuxKernels]
[./ls_function]
type = FunctionAux
variable = ls
function = ls_func
[../]
[]
[Constraints]
[./xfem_constraint]
type = XFEMSingleVariableConstraint
variable = u
geometric_cut_userobject = 'level_set_cut_uo'
use_penalty = true
alpha = 1e5
[../]
[]
[Functions]
[./src_func]
type = ParsedFunction
expression = '10*(-100*x-100*y+400) + t*(-2.5*y/(2.04*x) + 155/x - t/(2.04*x)
- 7.5/2.04)'
[../]
[./neumann_func]
type = ParsedFunction
expression = '((0.01/2.04)*(-2.5*x-2.5*y-t)+1.55)*100*t'
[../]
[./dirichlet_right_func]
type = ParsedFunction
expression = '(-100*y+200)*t+400'
[../]
[./dirichlet_top_func]
type = ParsedFunction
expression = '(-100*x+200)*t+400'
[../]
[./k_func]
type = ParsedFunction
expression = '(0.01/2.04)*(-2.5*x-2.5*y-t) + 1.55'
[../]
[./ls_func]
type = ParsedFunction
expression = '-0.5*(x+y) + 2.04 -0.2*t'
[../]
[]
[Materials]
[./mat_time_deriv_prop]
type = GenericConstantMaterial
prop_names = 'rhoCp'
prop_values = 10
[../]
[./therm_cond_prop]
type = GenericFunctionMaterial
prop_names = 'diffusion_coefficient'
prop_values = 'k_func'
[../]
[]
[BCs]
[./left_du]
type = FunctionNeumannBC
variable = u
boundary = 'left'
function = neumann_func
[../]
[./right_u]
type = FunctionDirichletBC
variable = u
boundary = 'right'
function = dirichlet_right_func
[../]
[./bottom_du]
type = FunctionNeumannBC
variable = u
boundary = 'bottom'
function = neumann_func
[../]
[./top_u]
type = FunctionDirichletBC
variable = u
boundary = 'top'
function = dirichlet_top_func
[../]
[]
[ICs]
[./u_ic]
type = ConstantIC
value = 400
variable = u
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
line_search = 'none'
l_tol = 1.0e-6
nl_max_its = 15
nl_rel_tol = 1.0e-10
nl_abs_tol = 1.0e-9
start_time = 0.0
dt = 0.2
end_time = 1.0
max_xfem_update = 1
[]
[Outputs]
time_step_interval = 1
execute_on = 'initial timestep_end'
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/moving_interface/verification/1D_rz_lsdep1mat.i)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# XFEM Moving Interface Verification Problem
# Dimensionality: quasi-1D
# Coordinate System: rz
# Material Numbers/Types: level set dep 1 material, 2 region
# Element Order: 1st
# Interface Characteristics: u independent, prescribed level set function
# Description:
# A simple transient heat transfer problem in cylindrical coordinates designed
# with the Method of Manufactured Solutions. This problem was developed to
# verify XFEM performance in the presence of a moving interface for linear
# element models that can be exactly evaluated by FEM/Moose. Both the
# temperature solution and level set function are designed to be linear to
# attempt to minimize error between the Moose/exact solution and XFEM results.
# Thermal conductivity is dependent upon the value of the level set function
# at each timestep.
# Results:
# The temperature at the left boundary (x=1) exhibits the largest difference
# between the FEM/Moose solution and XFEM results. We present the XFEM
# results at this location with 10 digits of precision:
# Time Expected Temperature XFEM Calculated Temperature
# 0.2 440 440
# 0.4 480 480.0008131
# 0.6 520 520.0038333
# 0.8 560 560.0088286
# 1.0 600 600.0131612
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Problem]
coord_type = RZ
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 1
xmin = 1.0
xmax = 2.0
ymin = 0.0
ymax = 0.5
elem_type = QUAD4
[]
[XFEM]
qrule = moment_fitting
output_cut_plane = true
[]
[UserObjects]
[./level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = ls
heal_always = true
[../]
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./ls]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./heat_cond]
type = MatDiffusion
variable = u
diffusivity = diffusion_coefficient
[../]
[./vol_heat_src]
type = BodyForce
variable = u
function = src_func
[../]
[./mat_time_deriv]
type = TestMatTimeDerivative
variable = u
mat_prop_value = rhoCp
[../]
[]
[AuxKernels]
[./ls_function]
type = FunctionAux
variable = ls
function = ls_func
[../]
[]
[Constraints]
[./xfem_constraint]
type = XFEMSingleVariableConstraint
variable = u
geometric_cut_userobject = 'level_set_cut_uo'
use_penalty = true
alpha = 1e5
[../]
[]
[Functions]
[./src_func]
type = ParsedFunction
expression = '10*(-200*x+400) + (1/x)*(310*t - (10/1.02)*x*t - (1/1.02)*t^2)'
[../]
[./neumann_func]
type = ParsedFunction
expression = '((0.05/2.04)*(2.04-x-0.2*t) + 1.5)*200*t'
[../]
[./k_func]
type = ParsedFunction
expression = '(0.05/2.04)*(2.04-x-0.2*t) + 1.5'
[../]
[./ls_func]
type = ParsedFunction
expression = '2.04 - x -0.2*t'
[../]
[]
[Materials]
[./mat_time_deriv_prop]
type = GenericConstantMaterial
prop_names = 'rhoCp'
prop_values = 10
[../]
[./therm_cond_prop]
type = GenericFunctionMaterial
prop_names = 'diffusion_coefficient'
prop_values = 'k_func'
[../]
[]
[BCs]
[./left_u]
type = FunctionNeumannBC
variable = u
boundary = 'left'
function = neumann_func
[../]
[./right_u]
type = DirichletBC
variable = u
boundary = 'right'
value = 400
[../]
[]
[ICs]
[./u_ic]
type = ConstantIC
value = 400
variable = u
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
line_search = 'none'
l_tol = 1.0e-6
nl_max_its = 15
nl_rel_tol = 1.0e-10
nl_abs_tol = 1.0e-9
start_time = 0.0
dt = 0.2
end_time = 1.0
max_xfem_update = 1
[]
[Outputs]
time_step_interval = 1
execute_on = 'initial timestep_end'
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/moving_interface/moving_diffusion.i)
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = ls
heal_always = true
[../]
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 3
xmin = 0.0
xmax = 1
ymin = 0.0
ymax = 1
elem_type = QUAD4
[]
[AuxVariables]
[./ls]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxKernels]
[./ls_function]
type = FunctionAux
variable = ls
function = ls_func
[../]
[]
[Variables]
[./u]
[../]
[]
[Functions]
[./ls_func]
type = ParsedFunction
expression = 'x-0.76+0.21*t'
[../]
[]
[Kernels]
[./diff]
type = MatDiffusion
variable = u
diffusivity = diffusion_coefficient
[../]
[./time_deriv]
type = TimeDerivative
variable = u
[../]
[]
[Constraints]
[./u_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = u
jump = 0
use_penalty = true
alpha = 1e5
geometric_cut_userobject = 'level_set_cut_uo'
[../]
[]
[BCs]
[./right_u]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./left_u]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Materials]
[./diffusivity_A]
type = GenericConstantMaterial
prop_names = A_diffusion_coefficient
prop_values = 5
[../]
[./diffusivity_B]
type = GenericConstantMaterial
prop_names = B_diffusion_coefficient
prop_values = 0.5
[../]
[./diff_combined]
type = LevelSetBiMaterialReal
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = diffusion_coefficient
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
petsc_options_value = '201 hypre boomeramg 8'
l_max_its = 20
l_tol = 1e-3
nl_max_its = 15
nl_rel_tol = 1e-6
nl_abs_tol = 1e-5
start_time = 0.0
dt = 1
end_time = 2
max_xfem_update = 1
[]
[Outputs]
exodus = true
execute_on = timestep_end
perf_graph = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/single_var_constraint_2d/propagating_2field_1constraint.i)
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
elem_type = QUAD4
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./line_seg_cut_uo]
type = LineSegmentCutUserObject
cut_data = '0.5 1.0 0.5 0.0'
time_start_cut = 0.0
time_end_cut = 2.0
[../]
[]
[Variables]
[./u]
[../]
[./v]
[../]
[]
[Kernels]
[./diff_u]
type = Diffusion
variable = u
[../]
[./diff_v]
type = Diffusion
variable = v
[../]
[]
[Constraints]
[./xfem_constraint]
type = XFEMSingleVariableConstraint
variable = u
jump = 0
jump_flux = 0
geometric_cut_userobject = 'line_seg_cut_uo'
[../]
[]
[BCs]
# Define boundary conditions
[./left_u]
type = DirichletBC
variable = u
boundary = 3
value = 1
[../]
[./right_u]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[./left_v]
type = DirichletBC
variable = v
boundary = 3
value = 1
[../]
[./right_v]
type = DirichletBC
variable = v
boundary = 1
value = 0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
line_search = 'none'
l_tol = 1e-3
nl_max_its = 15
nl_rel_tol = 1e-10
nl_abs_tol = 1e-10
start_time = 0.0
dt = 1.0
end_time = 2.0
[]
[Outputs]
time_step_interval = 1
execute_on = timestep_end
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/moving_interface/verification/2D_rz_homog1mat.i)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# XFEM Moving Interface Verification Problem
# Dimensionality: 2D
# Coordinate System: rz
# Material Numbers/Types: homogeneous 1 material, 2 region
# Element Order: 1st
# Interface Characteristics: u independent, prescribed level set function
# Description:
# Transient 2D heat transfer problem in cylindrical coordinates designed with
# the Method of Manufactured Solutions. This problem was developed to verify
# XFEM performance on linear elements in the presence of a moving interface
# sweeping across the x-y coordinates of a system with homogeneous material
# properties. This problem can be exactly evaluated by FEM/Moose without the
# moving interface. Both the temperature and level set function are designed
# to be linear to attempt to minimize error between the Moose/exact solution
# and XFEM results.
# Results:
# The temperature at the bottom left boundary (x=1, y=1) exhibits the largest
# difference between the FEM/Moose solution and XFEM results. We present the
# XFEM results at this location with 10 digits of precision:
# Time Expected Temperature XFEM Calculated Temperature
# 0.2 440 440
# 0.4 480 479.9998745
# 0.6 520 519.9995067
# 0.8 560 559.9989409
# 1.0 600 599.9987054
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Problem]
coord_type = RZ
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 4
xmin = 1.0
xmax = 2.0
ymin = 1.0
ymax = 2.0
elem_type = QUAD4
[]
[XFEM]
qrule = moment_fitting
output_cut_plane = true
[]
[UserObjects]
[./level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = ls
heal_always = true
[../]
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./ls]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./heat_cond]
type = MatDiffusion
variable = u
diffusivity = diffusion_coefficient
[../]
[./vol_heat_src]
type = BodyForce
variable = u
function = src_func
[../]
[./mat_time_deriv]
type = TestMatTimeDerivative
variable = u
mat_prop_value = rhoCp
[../]
[]
[AuxKernels]
[./ls_function]
type = FunctionAux
variable = ls
function = ls_func
[../]
[]
[Constraints]
[./xfem_constraints]
type = XFEMSingleVariableConstraint
variable = u
geometric_cut_userobject = 'level_set_cut_uo'
use_penalty = true
alpha = 1e5
[../]
[]
[Functions]
[./src_func]
type = ParsedFunction
expression = '10*(-100*x-100*y+400) + 100*1.5*t/x'
[../]
[./neumann_func]
type = ParsedFunction
expression = '1.5*100*t'
[../]
[./dirichlet_right_func]
type = ParsedFunction
expression = '(-100*y+200)*t+400'
[../]
[./dirichlet_top_func]
type = ParsedFunction
expression = '(-100*x+200)*t+400'
[../]
[./ls_func]
type = ParsedFunction
expression = '-0.5*(x+y) + 2.04 - 0.2*t'
[../]
[]
[Materials]
[./mat_time_deriv_prop]
type = GenericConstantMaterial
prop_names = 'rhoCp'
prop_values = 10
[../]
[./therm_cond_prop]
type = GenericConstantMaterial
prop_names = 'diffusion_coefficient'
prop_values = 1.5
[../]
[]
[BCs]
[./left_du]
type = FunctionNeumannBC
variable = u
boundary = 'left'
function = neumann_func
[../]
[./right_u]
type = FunctionDirichletBC
variable = u
boundary = 'right'
function = dirichlet_right_func
[../]
[./bottom_du]
type = FunctionNeumannBC
variable = u
boundary = 'bottom'
function = neumann_func
[../]
[./top_u]
type = FunctionDirichletBC
variable = u
boundary = 'top'
function = dirichlet_top_func
[../]
[]
[ICs]
[./u_ic]
type = ConstantIC
value = 400
variable = u
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
line_search = 'none'
l_tol = 1.0e-6
nl_max_its = 15
nl_rel_tol = 1.0e-10
nl_abs_tol = 1.0e-9
start_time = 0.0
dt = 0.2
end_time = 1.0
max_xfem_update = 1
[]
[Outputs]
time_step_interval = 1
execute_on = 'initial timestep_end'
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/bimaterials/glued_bimaterials_2d.i)
# This test is for two layer materials with different youngs modulus
# The global stress is determined by switching the stress based on level set values
# The material interface is marked by a level set function
# The two layer materials are glued together
[GlobalParams]
order = FIRST
family = LAGRANGE
displacements = 'disp_x disp_y'
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = ls
[../]
[]
[Mesh]
displacements = 'disp_x disp_y'
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmin = 0.0
xmax = 5.
ymin = 0.0
ymax = 5.
elem_type = QUAD4
[]
[./left_bottom]
type = ExtraNodesetGenerator
new_boundary = 'left_bottom'
coord = '0.0 0.0'
input = gen
[../]
[./left_top]
type = ExtraNodesetGenerator
new_boundary = 'left_top'
coord = '0.0 5.'
input = left_bottom
[../]
[]
[AuxVariables]
[./ls]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxKernels]
[./ls_function]
type = FunctionAux
variable = ls
function = ls_func
[../]
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[]
[Functions]
[./ls_func]
type = ParsedFunction
expression = 'y-2.5'
[../]
[]
[AuxVariables]
[./stress_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./stress_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./stress_xy]
order = CONSTANT
family = MONOMIAL
[../]
[./a_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./a_strain_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./a_strain_xy]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_xy]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./TensorMechanics]
[../]
[]
[AuxKernels]
[./stress_xx]
type = RankTwoAux
rank_two_tensor = stress
index_i = 0
index_j = 0
variable = stress_xx
[../]
[./stress_yy]
type = RankTwoAux
rank_two_tensor = stress
index_i = 1
index_j = 1
variable = stress_yy
[../]
[./stress_xy]
type = RankTwoAux
rank_two_tensor = stress
index_i = 0
index_j = 1
variable = stress_xy
[../]
[./a_strain_xx]
type = RankTwoAux
rank_two_tensor = A_total_strain
index_i = 0
index_j = 0
variable = a_strain_xx
[../]
[./a_strain_yy]
type = RankTwoAux
rank_two_tensor = A_total_strain
index_i = 1
index_j = 1
variable = a_strain_yy
[../]
[./a_strain_xy]
type = RankTwoAux
rank_two_tensor = A_total_strain
index_i = 0
index_j = 1
variable = a_strain_xy
[../]
[./b_strain_xx]
type = RankTwoAux
rank_two_tensor = B_total_strain
index_i = 0
index_j = 0
variable = b_strain_xx
[../]
[./b_strain_yy]
type = RankTwoAux
rank_two_tensor = B_total_strain
index_i = 1
index_j = 1
variable = b_strain_yy
[../]
[./b_strain_xy]
type = RankTwoAux
rank_two_tensor = B_total_strain
index_i = 0
index_j = 1
variable = b_strain_xy
[../]
[]
[Constraints]
[./dispx_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_x
alpha = 1e8
geometric_cut_userobject = 'level_set_cut_uo'
[../]
[./dispy_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_y
alpha = 1e8
geometric_cut_userobject = 'level_set_cut_uo'
[../]
[]
[BCs]
[./bottomx]
type = DirichletBC
boundary = bottom
variable = disp_x
value = 0.0
[../]
[./bottomy]
type = DirichletBC
boundary = bottom
variable = disp_y
value = 0.0
[../]
[./topx]
type = FunctionDirichletBC
boundary = top
variable = disp_x
function = 0.03*t
[../]
[./topy]
type = FunctionDirichletBC
boundary = top
variable = disp_y
function = '0.03*t'
[../]
[]
[Materials]
[./elasticity_tensor_A]
type = ComputeIsotropicElasticityTensor
base_name = A
youngs_modulus = 1e9
poissons_ratio = 0.3
[../]
[./strain_A]
type = ComputeSmallStrain
base_name = A
[../]
[./stress_A]
type = ComputeLinearElasticStress
base_name = A
[../]
[./elasticity_tensor_B]
type = ComputeIsotropicElasticityTensor
base_name = B
youngs_modulus = 1e5
poissons_ratio = 0.3
[../]
[./strain_B]
type = ComputeSmallStrain
base_name = B
[../]
[./stress_B]
type = ComputeLinearElasticStress
base_name = B
[../]
[./combined_stress]
type = LevelSetBiMaterialRankTwo
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = stress
[../]
[./combined_dstressdstrain]
type = LevelSetBiMaterialRankFour
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = Jacobian_mult
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
petsc_options_value = '201 hypre boomeramg 8'
line_search = 'bt'
# controls for linear iterations
l_max_its = 20
l_tol = 1e-3
# controls for nonlinear iterations
nl_max_its = 15
nl_rel_tol = 1e-14
nl_abs_tol = 1e-7
# time control
start_time = 0.0
dt = 0.1
num_steps = 2
max_xfem_update = 1
[]
[Outputs]
exodus = true
execute_on = timestep_end
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/single_var_constraint_3d/stationary_jump_fluxjump_3d.i)
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Mesh]
type = GeneratedMesh
dim = 3
nx = 5
ny = 5
nz = 2
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
zmin = 0.0
zmax = 0.25
elem_type = HEX8
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./square_planar_cut_uo]
type = RectangleCutUserObject
cut_data = ' 0.5 -0.001 -0.001
0.5 1.001 -0.001
0.5 1.001 1.001
0.5 -0.001 1.001'
[../]
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[Constraints]
[./xfem_constraint]
type = XFEMSingleVariableConstraint
variable = u
jump = 0.5
jump_flux = 1
geometric_cut_userobject = 'square_planar_cut_uo'
[../]
[]
[BCs]
# Define boundary conditions
[./left_u]
type = DirichletBC
variable = u
boundary = left
value = 1
[../]
[./right_u]
type = DirichletBC
variable = u
boundary = right
value = 0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
line_search = 'none'
l_tol = 1e-3
nl_max_its = 15
nl_rel_tol = 1e-10
nl_abs_tol = 1e-10
start_time = 0.0
dt = 1.0
end_time = 2.0
[]
[Outputs]
time_step_interval = 1
execute_on = timestep_end
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/moving_interface/moving_ad_diffusion.i)
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = ls
heal_always = true
[../]
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 3
xmin = 0.0
xmax = 1
ymin = 0.0
ymax = 1
elem_type = QUAD4
[]
[AuxVariables]
[./ls]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxKernels]
[./ls_function]
type = FunctionAux
variable = ls
function = ls_func
[../]
[]
[Variables]
[./u]
[../]
[]
[Functions]
[./ls_func]
type = ParsedFunction
expression = 'x-0.76+0.21*t'
[../]
[]
[Kernels]
[./diff]
type = ADMatDiffusion
variable = u
diffusivity = diffusion_coefficient
[../]
[./time_deriv]
type = ADTimeDerivative
variable = u
[../]
[]
[Constraints]
[./u_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = u
jump = 0
use_penalty = true
alpha = 1e5
geometric_cut_userobject = 'level_set_cut_uo'
[../]
[]
[BCs]
[./right_u]
type = ADDirichletBC
variable = u
boundary = left
value = 0
[../]
[./left_u]
type = ADDirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Materials]
[./diffusivity_A]
type = ADGenericConstantMaterial
prop_names = A_diffusion_coefficient
prop_values = 5
[../]
[./diffusivity_B]
type = ADGenericConstantMaterial
prop_names = B_diffusion_coefficient
prop_values = 0.5
[../]
[./diff_combined]
type = ADLevelSetBiMaterialReal
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = diffusion_coefficient
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
petsc_options_value = '201 hypre boomeramg 8'
l_max_its = 20
l_tol = 1e-8
nl_max_its = 15
nl_rel_tol = 2e-12
nl_abs_tol = 1e-50
start_time = 0.0
dt = 1
end_time = 2
max_xfem_update = 1
[]
[Outputs]
exodus = true
execute_on = timestep_end
file_base = moving_diffusion_out
perf_graph = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/single_var_constraint_2d/stationary_jump_func.i)
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
elem_type = QUAD4
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./line_seg_cut_uo]
type = LineSegmentCutUserObject
cut_data = '0.5 1.0 0.5 0.0'
[../]
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[Constraints]
[./xfem_constraint]
type = XFEMSingleVariableConstraint
variable = u
jump = jump_func
jump_flux = 0
geometric_cut_userobject = 'line_seg_cut_uo'
[../]
[]
[Functions]
[./jump_func]
type = ParsedFunction
expression = '0.5'
[../]
[]
[BCs]
# Define boundary conditions
[./left_u]
type = DirichletBC
variable = u
boundary = 3
value = 1
[../]
[./right_u]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
line_search = 'none'
l_tol = 1e-3
nl_max_its = 15
nl_rel_tol = 1e-10
nl_abs_tol = 1e-10
start_time = 0.0
dt = 1.0
end_time = 2.0
[]
[Outputs]
time_step_interval = 1
execute_on = timestep_end
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/xfem/test/tests/bimaterials/inclusion_bimaterials_2d.i)
# This test is for a matrix-inclusion composite materials
# The global stress is determined by switching the stress based on level set values
# The inclusion geometry is marked by a level set function
# The matrix and inclusion are glued together
[GlobalParams]
order = FIRST
family = LAGRANGE
displacements = 'disp_x disp_y'
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = ls
[../]
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 11
ny = 11
xmin = 0.0
xmax = 5.
ymin = 0.0
ymax = 5.
elem_type = QUAD4
displacements = 'disp_x disp_y'
[]
[AuxVariables]
[./ls]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxKernels]
[./ls_function]
type = FunctionAux
variable = ls
function = ls_func
[../]
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[]
[Functions]
[./ls_func]
type = ParsedFunction
expression = 'sqrt((y-2.5)*(y-2.5) + (x-2.5)*(x-2.5)) - 1.5'
[../]
[]
[AuxVariables]
[./stress_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./stress_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./stress_xy]
order = CONSTANT
family = MONOMIAL
[../]
[./a_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./a_strain_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./a_strain_xy]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_xy]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./TensorMechanics]
[../]
[]
[AuxKernels]
[./stress_xx]
type = RankTwoAux
rank_two_tensor = stress
index_i = 0
index_j = 0
variable = stress_xx
[../]
[./stress_yy]
type = RankTwoAux
rank_two_tensor = stress
index_i = 1
index_j = 1
variable = stress_yy
[../]
[./stress_xy]
type = RankTwoAux
rank_two_tensor = stress
index_i = 0
index_j = 1
variable = stress_xy
[../]
[./a_strain_xx]
type = RankTwoAux
rank_two_tensor = A_total_strain
index_i = 0
index_j = 0
variable = a_strain_xx
[../]
[./a_strain_yy]
type = RankTwoAux
rank_two_tensor = A_total_strain
index_i = 1
index_j = 1
variable = a_strain_yy
[../]
[./a_strain_xy]
type = RankTwoAux
rank_two_tensor = A_total_strain
index_i = 0
index_j = 1
variable = a_strain_xy
[../]
[./b_strain_xx]
type = RankTwoAux
rank_two_tensor = B_total_strain
index_i = 0
index_j = 0
variable = b_strain_xx
[../]
[./b_strain_yy]
type = RankTwoAux
rank_two_tensor = B_total_strain
index_i = 1
index_j = 1
variable = b_strain_yy
[../]
[./b_strain_xy]
type = RankTwoAux
rank_two_tensor = B_total_strain
index_i = 0
index_j = 1
variable = b_strain_xy
[../]
[]
[Constraints]
[./dispx_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_x
alpha = 1e8
geometric_cut_userobject = 'level_set_cut_uo'
[../]
[./dispy_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_y
alpha = 1e8
geometric_cut_userobject = 'level_set_cut_uo'
[../]
[]
[BCs]
[./bottomx]
type = DirichletBC
boundary = bottom
variable = disp_x
value = 0.0
[../]
[./bottomy]
type = DirichletBC
boundary = bottom
variable = disp_y
value = 0.0
[../]
[./topx]
type = FunctionDirichletBC
boundary = top
variable = disp_x
function = '0.03*t'
[../]
[./topy]
type = FunctionDirichletBC
boundary = top
variable = disp_y
function = '0.03*t'
[../]
[]
[Materials]
[./elasticity_tensor_A]
type = ComputeIsotropicElasticityTensor
base_name = A
youngs_modulus = 1e9
poissons_ratio = 0.3
[../]
[./strain_A]
type = ComputeSmallStrain
base_name = A
[../]
[./stress_A]
type = ComputeLinearElasticStress
base_name = A
[../]
[./elasticity_tensor_B]
type = ComputeIsotropicElasticityTensor
base_name = B
youngs_modulus = 1e5
poissons_ratio = 0.3
[../]
[./strain_B]
type = ComputeSmallStrain
base_name = B
[../]
[./stress_B]
type = ComputeLinearElasticStress
base_name = B
[../]
[./combined_stress]
type = LevelSetBiMaterialRankTwo
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = stress
[../]
[./combined_dstressdstrain]
type = LevelSetBiMaterialRankFour
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = Jacobian_mult
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
petsc_options_value = '201 hypre boomeramg 8'
# controls for linear iterations
l_max_its = 20
l_tol = 1e-3
# controls for nonlinear iterations
nl_max_its = 15
nl_rel_tol = 1e-14
nl_abs_tol = 1e-7
# time control
start_time = 0.0
dt = 0.5
end_time = 1.0
num_steps = 2
max_xfem_update = 1
[]
[Outputs]
exodus = true
execute_on = timestep_end
[./console]
type = Console
output_linear = true
[../]
[]