- fi_namesList of free energies for the n phases
C++ Type:std::vector<MaterialPropertyName>
Controllable:No
Description:List of free energies for the n phases
DerivativeMultiPhaseMaterial
The DerivativeMultiPhaseMaterial has not been documented. The content listed below should be used as a starting point for documenting the class, which includes the typical automatic documentation associated with a MooseObject; however, what is contained is ultimately determined by what is necessary to make the documentation clear for users.
Two phase material that combines n phase materials using a switching function with and n non-conserved order parameters (to be used with SwitchingFunctionConstraint*).
Overview
Example Input File Syntax
Input Parameters
- W0Energy barrier for the phase transformation from A to B
Default:0
C++ Type:double
Controllable:No
Description:Energy barrier for the phase transformation from A to B
- blockThe list of blocks (ids or names) that this object will be applied
C++ Type:std::vector<SubdomainName>
Controllable:No
Description:The list of blocks (ids or names) that this object will be applied
- boundaryThe list of boundaries (ids or names) from the mesh where this object applies
C++ Type:std::vector<BoundaryName>
Controllable:No
Description:The list of boundaries (ids or names) from the mesh where this object applies
- computeTrueWhen false, MOOSE will not call compute methods on this material. The user must call computeProperties() after retrieving the MaterialBase via MaterialBasePropertyInterface::getMaterialBase(). Non-computed MaterialBases are not sorted for dependencies.
Default:True
C++ Type:bool
Controllable:No
Description:When false, MOOSE will not call compute methods on this material. The user must call computeProperties() after retrieving the MaterialBase via MaterialBasePropertyInterface::getMaterialBase(). Non-computed MaterialBases are not sorted for dependencies.
- constant_onNONEWhen ELEMENT, MOOSE will only call computeQpProperties() for the 0th quadrature point, and then copy that value to the other qps.When SUBDOMAIN, MOOSE will only call computeQpProperties() for the 0th quadrature point, and then copy that value to the other qps. Evaluations on element qps will be skipped
Default:NONE
C++ Type:MooseEnum
Options:NONE, ELEMENT, SUBDOMAIN
Controllable:No
Description:When ELEMENT, MOOSE will only call computeQpProperties() for the 0th quadrature point, and then copy that value to the other qps.When SUBDOMAIN, MOOSE will only call computeQpProperties() for the 0th quadrature point, and then copy that value to the other qps. Evaluations on element qps will be skipped
- coupled_variables
C++ Type:std::vector<VariableName>
Controllable:No
- declare_suffixAn optional suffix parameter that can be appended to any declared properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Controllable:No
Description:An optional suffix parameter that can be appended to any declared properties. The suffix will be prepended with a '_' character.
- derivative_order3Maximum order of derivatives taken (2 or 3)
Default:3
C++ Type:unsigned int
Controllable:No
Description:Maximum order of derivatives taken (2 or 3)
- displacement_gradientsVector of displacement gradient variables (see Modules/PhaseField/DisplacementGradients action)
C++ Type:std::vector<VariableName>
Controllable:No
Description:Vector of displacement gradient variables (see Modules/PhaseField/DisplacementGradients action)
- etasOrder parameters for all phases.
C++ Type:std::vector<VariableName>
Controllable:No
Description:Order parameters for all phases.
- ggBarrier Function Material that provides g(eta_i)
Default:g
C++ Type:MaterialPropertyName
Controllable:No
Description:Barrier Function Material that provides g(eta_i)
- hi_namesSwitching Function Materials that provide h(eta_i)
C++ Type:std::vector<MaterialPropertyName>
Controllable:No
Description:Switching Function Materials that provide h(eta_i)
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
- property_nameFName of the parsed material property
Default:F
C++ Type:std::string
Controllable:No
Description:Name of the parsed material property
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Default:False
C++ Type:bool
Controllable:No
Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Optional 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
- output_propertiesList of material properties, from this material, to output (outputs must also be defined to an output type)
C++ Type:std::vector<std::string>
Controllable:No
Description:List of material properties, from this material, to output (outputs must also be defined to an output type)
- outputsnone Vector of output names where you would like to restrict the output of variables(s) associated with this object
Default:none
C++ Type:std::vector<OutputName>
Controllable:No
Description:Vector of output names where you would like to restrict the output of variables(s) associated with this object
Outputs Parameters
Input Files
- (modules/phase_field/test/tests/MultiPhase/acmultiinterface.i)
- (modules/combined/examples/phase_field-mechanics/Pattern1.i)
- (modules/phase_field/examples/multiphase/DerivativeMultiPhaseMaterial.i)
- (modules/phase_field/test/tests/MultiPhase/penalty.i)
- (modules/phase_field/test/tests/MultiPhase/acmultiinterface_aux.i)
- (modules/phase_field/test/tests/MultiPhase/lagrangemult.i)
- (modules/combined/examples/publications/rapid_dev/fig8.i)
(modules/phase_field/test/tests/MultiPhase/acmultiinterface.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 10
nz = 0
xmin = -10
xmax = 10
ymin = -5
ymax = 5
elem_type = QUAD4
[]
[Variables]
[./eta1]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = SmoothCircleIC
x1 = -3.5
y1 = 0.0
radius = 4.0
invalue = 0.9
outvalue = 0.1
int_width = 2.0
[../]
[../]
[./eta2]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = SmoothCircleIC
x1 = 3.5
y1 = 0.0
radius = 4.0
invalue = 0.9
outvalue = 0.1
int_width = 2.0
[../]
[../]
[./eta3]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = SpecifiedSmoothCircleIC
x_positions = '-4.0 4.0'
y_positions = ' 0.0 0.0'
z_positions = ' 0.0 0.0'
radii = '4.0 4.0'
invalue = 0.1
outvalue = 0.9
int_width = 2.0
[../]
[../]
[./lambda]
order = FIRST
family = LAGRANGE
initial_condition = 1.0
[../]
[]
[Kernels]
[./deta1dt]
type = TimeDerivative
variable = eta1
[../]
[./ACBulk1]
type = AllenCahn
variable = eta1
coupled_variables = 'eta2 eta3'
mob_name = L1
f_name = F
[../]
[./ACInterface1]
type = ACMultiInterface
variable = eta1
etas = 'eta1 eta2 eta3'
mob_name = L1
kappa_names = 'kappa11 kappa12 kappa13'
[../]
[./lagrange1]
type = SwitchingFunctionConstraintEta
variable = eta1
h_name = h1
lambda = lambda
[../]
[./deta2dt]
type = TimeDerivative
variable = eta2
[../]
[./ACBulk2]
type = AllenCahn
variable = eta2
coupled_variables = 'eta1 eta3'
mob_name = L2
f_name = F
[../]
[./ACInterface2]
type = ACMultiInterface
variable = eta2
etas = 'eta1 eta2 eta3'
mob_name = L2
kappa_names = 'kappa21 kappa22 kappa23'
[../]
[./lagrange2]
type = SwitchingFunctionConstraintEta
variable = eta2
h_name = h2
lambda = lambda
[../]
[./deta3dt]
type = TimeDerivative
variable = eta3
[../]
[./ACBulk3]
type = AllenCahn
variable = eta3
coupled_variables = 'eta1 eta2'
mob_name = L3
f_name = F
[../]
[./ACInterface3]
type = ACMultiInterface
variable = eta3
etas = 'eta1 eta2 eta3'
mob_name = L3
kappa_names = 'kappa31 kappa32 kappa33'
[../]
[./lagrange3]
type = SwitchingFunctionConstraintEta
variable = eta3
h_name = h3
lambda = lambda
[../]
[./lagrange]
type = SwitchingFunctionConstraintLagrange
variable = lambda
etas = 'eta1 eta2 eta3'
h_names = 'h1 h2 h3'
epsilon = 0
[../]
[]
[BCs]
[./Periodic]
[./All]
auto_direction = 'x y'
[../]
[../]
[]
[Materials]
[./consts]
type = GenericConstantMaterial
prop_names = 'Fx L1 L2 L3 kappa11 kappa12 kappa13 kappa21 kappa22 kappa23 kappa31 kappa32 kappa33'
prop_values = '0 1 1 1 1 1 1 1 1 1 1 1 1 '
[../]
[./etasummat]
type = ParsedMaterial
property_name = etasum
coupled_variables = 'eta1 eta2 eta3'
material_property_names = 'h1 h2 h3'
expression = 'h1+h2+h3'
[../]
[./switching1]
type = SwitchingFunctionMaterial
function_name = h1
eta = eta1
h_order = SIMPLE
[../]
[./switching2]
type = SwitchingFunctionMaterial
function_name = h2
eta = eta2
h_order = SIMPLE
[../]
[./switching3]
type = SwitchingFunctionMaterial
function_name = h3
eta = eta3
h_order = SIMPLE
[../]
[./barrier]
type = MultiBarrierFunctionMaterial
etas = 'eta1 eta2 eta3'
[../]
[./free_energy]
type = DerivativeMultiPhaseMaterial
property_name = F
# we use a constant free energy (GeneriConstantmaterial property Fx)
fi_names = 'Fx Fx Fx'
hi_names = 'h1 h2 h3'
etas = 'eta1 eta2 eta3'
# the free energy is given by the MultiBarrierFunctionMaterial only
W = 1
derivative_order = 2
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
solve_type = 'PJFNK'
#petsc_options = '-snes_ksp -snes_ksp_ew'
#petsc_options = '-ksp_monitor_snes_lg-snes_ksp_ew'
#petsc_options_iname = '-ksp_gmres_restart'
#petsc_options_value = '1000 '
l_max_its = 15
l_tol = 1.0e-6
nl_max_its = 50
nl_rel_tol = 1.0e-8
nl_abs_tol = 1.0e-10
start_time = 0.0
num_steps = 2
dt = 0.2
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(modules/combined/examples/phase_field-mechanics/Pattern1.i)
#
# Pattern example 1
#
# Phase changes driven by a combination mechanical (elastic) and chemical
# driving forces. In this three phase system a matrix phase, an oversized and
# an undersized precipitate phase compete. The chemical free energy favors a
# phase separation into either precipitate phase. A mix of both precipitate
# emerges to balance lattice expansion and contraction.
#
# This example demonstrates the use of
# * ACMultiInterface
# * SwitchingFunctionConstraintEta and SwitchingFunctionConstraintLagrange
# * DerivativeParsedMaterial
# * ElasticEnergyMaterial
# * DerivativeMultiPhaseMaterial
# * MultiPhaseStressMaterial
# which are the components to se up a phase field model with an arbitrary number
# of phases
#
[Mesh]
type = GeneratedMesh
dim = 2
nx = 80
ny = 80
nz = 0
xmin = -20
xmax = 20
ymin = -20
ymax = 20
zmin = 0
zmax = 0
elem_type = QUAD4
[]
[GlobalParams]
# CahnHilliard needs the third derivatives
derivative_order = 3
enable_jit = true
displacements = 'disp_x disp_y'
[]
# AuxVars to compute the free energy density for outputting
[AuxVariables]
[./local_energy]
order = CONSTANT
family = MONOMIAL
[../]
[./cross_energy]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./local_free_energy]
type = TotalFreeEnergy
variable = local_energy
interfacial_vars = 'c'
kappa_names = 'kappa_c'
additional_free_energy = cross_energy
[../]
[./cross_terms]
type = CrossTermGradientFreeEnergy
variable = cross_energy
interfacial_vars = 'eta1 eta2 eta3'
kappa_names = 'kappa11 kappa12 kappa13
kappa21 kappa22 kappa23
kappa31 kappa32 kappa33'
[../]
[]
[Variables]
# Solute concentration variable
[./c]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = RandomIC
min = 0
max = 0.8
seed = 1235
[../]
[../]
# Order parameter for the Matrix
[./eta1]
order = FIRST
family = LAGRANGE
initial_condition = 0.5
[../]
# Order parameters for the 2 different inclusion orientations
[./eta2]
order = FIRST
family = LAGRANGE
initial_condition = 0.1
[../]
[./eta3]
order = FIRST
family = LAGRANGE
initial_condition = 0.1
[../]
# Mesh displacement
[./disp_x]
order = FIRST
family = LAGRANGE
[../]
[./disp_y]
order = FIRST
family = LAGRANGE
[../]
# Lagrange-multiplier
[./lambda]
order = FIRST
family = LAGRANGE
initial_condition = 1.0
[../]
[]
[Kernels]
# Set up stress divergence kernels
[./TensorMechanics]
[../]
# Cahn-Hilliard kernels
[./c_res]
type = CahnHilliard
variable = c
f_name = F
args = 'eta1 eta2 eta3'
[../]
[./time]
type = TimeDerivative
variable = c
[../]
# Allen-Cahn and Lagrange-multiplier constraint kernels for order parameter 1
[./deta1dt]
type = TimeDerivative
variable = eta1
[../]
[./ACBulk1]
type = AllenCahn
variable = eta1
args = 'eta2 eta3 c'
mob_name = L1
f_name = F
[../]
[./ACInterface1]
type = ACMultiInterface
variable = eta1
etas = 'eta1 eta2 eta3'
mob_name = L1
kappa_names = 'kappa11 kappa12 kappa13'
[../]
[./lagrange1]
type = SwitchingFunctionConstraintEta
variable = eta1
h_name = h1
lambda = lambda
[../]
# Allen-Cahn and Lagrange-multiplier constraint kernels for order parameter 2
[./deta2dt]
type = TimeDerivative
variable = eta2
[../]
[./ACBulk2]
type = AllenCahn
variable = eta2
args = 'eta1 eta3 c'
mob_name = L2
f_name = F
[../]
[./ACInterface2]
type = ACMultiInterface
variable = eta2
etas = 'eta1 eta2 eta3'
mob_name = L2
kappa_names = 'kappa21 kappa22 kappa23'
[../]
[./lagrange2]
type = SwitchingFunctionConstraintEta
variable = eta2
h_name = h2
lambda = lambda
[../]
# Allen-Cahn and Lagrange-multiplier constraint kernels for order parameter 3
[./deta3dt]
type = TimeDerivative
variable = eta3
[../]
[./ACBulk3]
type = AllenCahn
variable = eta3
args = 'eta1 eta2 c'
mob_name = L3
f_name = F
[../]
[./ACInterface3]
type = ACMultiInterface
variable = eta3
etas = 'eta1 eta2 eta3'
mob_name = L3
kappa_names = 'kappa31 kappa32 kappa33'
[../]
[./lagrange3]
type = SwitchingFunctionConstraintEta
variable = eta3
h_name = h3
lambda = lambda
[../]
# Lagrange-multiplier constraint kernel for lambda
[./lagrange]
type = SwitchingFunctionConstraintLagrange
variable = lambda
etas = 'eta1 eta2 eta3'
h_names = 'h1 h2 h3'
epsilon = 1e-6
[../]
[]
[Materials]
# declare a few constants, such as mobilities (L,M) and interface gradient prefactors (kappa*)
[./consts]
type = GenericConstantMaterial
prop_names = 'M kappa_c L1 L2 L3 kappa11 kappa12 kappa13 kappa21 kappa22 kappa23 kappa31 kappa32 kappa33'
prop_values = '0.2 0 1 1 1 2.00 2.00 2.00 2.00 2.00 2.00 2.00 2.00 2.00 '
[../]
# We use this to output the level of constraint enforcement
# ideally it should be 0 everywhere, if the constraint is fully enforced
[./etasummat]
type = ParsedMaterial
property_name = etasum
coupled_variables = 'eta1 eta2 eta3'
material_property_names = 'h1 h2 h3'
expression = 'h1+h2+h3-1'
outputs = exodus
[../]
# This parsed material creates a single property for visualization purposes.
# It will be 0 for phase 1, -1 for phase 2, and 1 for phase 3
[./phasemap]
type = ParsedMaterial
property_name = phase
coupled_variables = 'eta2 eta3'
expression = 'if(eta3>0.5,1,0)-if(eta2>0.5,1,0)'
outputs = exodus
[../]
# matrix phase
[./elasticity_tensor_1]
type = ComputeElasticityTensor
base_name = phase1
C_ijkl = '3 3'
fill_method = symmetric_isotropic
[../]
[./strain_1]
type = ComputeSmallStrain
base_name = phase1
displacements = 'disp_x disp_y'
[../]
[./stress_1]
type = ComputeLinearElasticStress
base_name = phase1
[../]
# oversized phase
[./elasticity_tensor_2]
type = ComputeElasticityTensor
base_name = phase2
C_ijkl = '7 7'
fill_method = symmetric_isotropic
[../]
[./strain_2]
type = ComputeSmallStrain
base_name = phase2
displacements = 'disp_x disp_y'
eigenstrain_names = eigenstrain
[../]
[./stress_2]
type = ComputeLinearElasticStress
base_name = phase2
[../]
[./eigenstrain_2]
type = ComputeEigenstrain
base_name = phase2
eigen_base = '0.02'
eigenstrain_name = eigenstrain
[../]
# undersized phase
[./elasticity_tensor_3]
type = ComputeElasticityTensor
base_name = phase3
C_ijkl = '7 7'
fill_method = symmetric_isotropic
[../]
[./strain_3]
type = ComputeSmallStrain
base_name = phase3
displacements = 'disp_x disp_y'
eigenstrain_names = eigenstrain
[../]
[./stress_3]
type = ComputeLinearElasticStress
base_name = phase3
[../]
[./eigenstrain_3]
type = ComputeEigenstrain
base_name = phase3
eigen_base = '-0.05'
eigenstrain_name = eigenstrain
[../]
# switching functions
[./switching1]
type = SwitchingFunctionMaterial
function_name = h1
eta = eta1
h_order = SIMPLE
[../]
[./switching2]
type = SwitchingFunctionMaterial
function_name = h2
eta = eta2
h_order = SIMPLE
[../]
[./switching3]
type = SwitchingFunctionMaterial
function_name = h3
eta = eta3
h_order = SIMPLE
[../]
[./barrier]
type = MultiBarrierFunctionMaterial
etas = 'eta1 eta2 eta3'
[../]
# chemical free energies
[./chemical_free_energy_1]
type = DerivativeParsedMaterial
property_name = Fc1
expression = '4*c^2'
coupled_variables = 'c'
derivative_order = 2
[../]
[./chemical_free_energy_2]
type = DerivativeParsedMaterial
property_name = Fc2
expression = '(c-0.9)^2-0.4'
coupled_variables = 'c'
derivative_order = 2
[../]
[./chemical_free_energy_3]
type = DerivativeParsedMaterial
property_name = Fc3
expression = '(c-0.9)^2-0.5'
coupled_variables = 'c'
derivative_order = 2
[../]
# elastic free energies
[./elastic_free_energy_1]
type = ElasticEnergyMaterial
base_name = phase1
f_name = Fe1
derivative_order = 2
args = 'c' # should be empty
[../]
[./elastic_free_energy_2]
type = ElasticEnergyMaterial
base_name = phase2
f_name = Fe2
derivative_order = 2
args = 'c' # should be empty
[../]
[./elastic_free_energy_3]
type = ElasticEnergyMaterial
base_name = phase3
f_name = Fe3
derivative_order = 2
args = 'c' # should be empty
[../]
# phase free energies (chemical + elastic)
[./phase_free_energy_1]
type = DerivativeSumMaterial
property_name = F1
sum_materials = 'Fc1 Fe1'
coupled_variables = 'c'
derivative_order = 2
[../]
[./phase_free_energy_2]
type = DerivativeSumMaterial
property_name = F2
sum_materials = 'Fc2 Fe2'
coupled_variables = 'c'
derivative_order = 2
[../]
[./phase_free_energy_3]
type = DerivativeSumMaterial
property_name = F3
sum_materials = 'Fc3 Fe3'
coupled_variables = 'c'
derivative_order = 2
[../]
# global free energy
[./free_energy]
type = DerivativeMultiPhaseMaterial
f_name = F
fi_names = 'F1 F2 F3'
hi_names = 'h1 h2 h3'
etas = 'eta1 eta2 eta3'
coupled_variables = 'c'
W = 3
[../]
# Generate the global stress from the phase stresses
[./global_stress]
type = MultiPhaseStressMaterial
phase_base = 'phase1 phase2 phase3'
h = 'h1 h2 h3'
[../]
[]
[BCs]
# the boundary conditions on the displacement enforce periodicity
# at zero total shear and constant volume
[./bottom_y]
type = DirichletBC
variable = disp_y
boundary = 'bottom'
value = 0
[../]
[./top_y]
type = DirichletBC
variable = disp_y
boundary = 'top'
value = 0
[../]
[./left_x]
type = DirichletBC
variable = disp_x
boundary = 'left'
value = 0
[../]
[./right_x]
type = DirichletBC
variable = disp_x
boundary = 'right'
value = 0
[../]
[./Periodic]
[./disp_x]
auto_direction = 'y'
[../]
[./disp_y]
auto_direction = 'x'
[../]
# all other phase field variables are fully periodic
[./c]
auto_direction = 'x y'
[../]
[./eta1]
auto_direction = 'x y'
[../]
[./eta2]
auto_direction = 'x y'
[../]
[./eta3]
auto_direction = 'x y'
[../]
[./lambda]
auto_direction = 'x y'
[../]
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
# We monitor the total free energy and the total solute concentration (should be constant)
[Postprocessors]
[./total_free_energy]
type = ElementIntegralVariablePostprocessor
variable = local_energy
[../]
[./total_solute]
type = ElementIntegralVariablePostprocessor
variable = c
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -sub_pc_type'
petsc_options_value = 'asm ilu'
l_max_its = 30
nl_max_its = 10
l_tol = 1.0e-4
nl_rel_tol = 1.0e-8
nl_abs_tol = 1.0e-10
start_time = 0.0
num_steps = 200
[./TimeStepper]
type = SolutionTimeAdaptiveDT
dt = 0.1
[../]
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[./table]
type = CSV
delimiter = ' '
[../]
[]
[Debug]
# show_var_residual_norms = true
[]
(modules/phase_field/examples/multiphase/DerivativeMultiPhaseMaterial.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 40
ny = 40
nz = 0
xmin = -12
xmax = 12
ymin = -12
ymax = 12
elem_type = QUAD4
[]
[GlobalParams]
# let's output all material properties for demonstration purposes
outputs = exodus
# prefactor on the penalty function kernels. The higher this value is, the
# more rigorously the constraint is enforced
penalty = 1e3
[]
#
# These AuxVariables hold the directly calculated free energy density in the
# simulation cell. They are provided for visualization purposes.
#
[AuxVariables]
[./local_energy]
order = CONSTANT
family = MONOMIAL
[../]
[./cross_energy]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./local_free_energy]
type = TotalFreeEnergy
variable = local_energy
interfacial_vars = 'c'
kappa_names = 'kappa_c'
additional_free_energy = cross_energy
[../]
#
# Helper kernel to cpompute the gradient contribution from interfaces of order
# parameters evolved using the ACMultiInterface kernel
#
[./cross_terms]
type = CrossTermGradientFreeEnergy
variable = cross_energy
interfacial_vars = 'eta1 eta2 eta3'
#
# The interface coefficient matrix. This should be symmetrical!
#
kappa_names = 'kappa11 kappa12 kappa13
kappa21 kappa22 kappa23
kappa31 kappa32 kappa33'
[../]
[]
[Variables]
[./c]
order = FIRST
family = LAGRANGE
#
# We set up a smooth cradial concentrtaion gradient
# The concentration will quickly change to adapt to the preset order
# parameters eta1, eta2, and eta3
#
[./InitialCondition]
type = SmoothCircleIC
x1 = 0.0
y1 = 0.0
radius = 5.0
invalue = 1.0
outvalue = 0.01
int_width = 10.0
[../]
[../]
[./eta1]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = FunctionIC
#
# Note: this initial conditions sets up a _sharp_ interface. Ideally
# we should start with a smooth interface with a width consistent
# with the kappa parameter supplied for the given interface.
#
function = 'r:=sqrt(x^2+y^2);if(r<=4,1,0)'
[../]
[../]
[./eta2]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = FunctionIC
function = 'r:=sqrt(x^2+y^2);if(r>4&r<=7,1,0)'
[../]
[../]
[./eta3]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = FunctionIC
function = 'r:=sqrt(x^2+y^2);if(r>7,1,0)'
[../]
[../]
[]
[Kernels]
#
# Cahn-Hilliard kernel for the concentration variable.
# Note that we are not using an interfcae kernel on this variable, but rather
# rely on the interface width enforced on the order parameters. This allows us
# to use a direct solve using the CahnHilliard kernel _despite_ only using first
# order elements.
#
[./c_res]
type = CahnHilliard
variable = c
f_name = F
coupled_variables = 'eta1 eta2 eta3'
[../]
[./time]
type = TimeDerivative
variable = c
[../]
#
# Order parameter eta1
# Each order parameter is acted on by 4 kernels:
# 1. The stock time derivative deta_i/dt kernel
# 2. The Allen-Cahn kernel that takes a Dervative Material for the free energy
# 3. A gradient interface kernel that includes cross terms
# see http://mooseframework.org/wiki/PhysicsModules/PhaseField/DevelopingModels/MultiPhaseModels/ACMultiInterface/
# 4. A penalty contribution that forces the interface contributions h(eta)
# to sum up to unity
#
[./deta1dt]
type = TimeDerivative
variable = eta1
[../]
[./ACBulk1]
type = AllenCahn
variable = eta1
coupled_variables = 'eta2 eta3 c'
mob_name = L1
f_name = F
[../]
[./ACInterface1]
type = ACMultiInterface
variable = eta1
etas = 'eta1 eta2 eta3'
mob_name = L1
kappa_names = 'kappa11 kappa12 kappa13'
[../]
[./penalty1]
type = SwitchingFunctionPenalty
variable = eta1
etas = 'eta1 eta2 eta3'
h_names = 'h1 h2 h3'
[../]
#
# Order parameter eta2
#
[./deta2dt]
type = TimeDerivative
variable = eta2
[../]
[./ACBulk2]
type = AllenCahn
variable = eta2
coupled_variables = 'eta1 eta3 c'
mob_name = L2
f_name = F
[../]
[./ACInterface2]
type = ACMultiInterface
variable = eta2
etas = 'eta1 eta2 eta3'
mob_name = L2
kappa_names = 'kappa21 kappa22 kappa23'
[../]
[./penalty2]
type = SwitchingFunctionPenalty
variable = eta2
etas = 'eta1 eta2 eta3'
h_names = 'h1 h2 h3'
[../]
#
# Order parameter eta3
#
[./deta3dt]
type = TimeDerivative
variable = eta3
[../]
[./ACBulk3]
type = AllenCahn
variable = eta3
coupled_variables = 'eta1 eta2 c'
mob_name = L3
f_name = F
[../]
[./ACInterface3]
type = ACMultiInterface
variable = eta3
etas = 'eta1 eta2 eta3'
mob_name = L3
kappa_names = 'kappa31 kappa32 kappa33'
[../]
[./penalty3]
type = SwitchingFunctionPenalty
variable = eta3
etas = 'eta1 eta2 eta3'
h_names = 'h1 h2 h3'
[../]
[]
[BCs]
[./Periodic]
[./All]
auto_direction = 'x y'
[../]
[../]
[]
[Materials]
# here we declare some of the model parameters: the mobilities and interface
# gradient prefactors. For this example we use arbitrary numbers. In an actual simulation
# physical mobilities would be used, and the interface gradient prefactors would
# be readjusted to the free energy magnitudes.
[./consts]
type = GenericConstantMaterial
prop_names = 'M kappa_c L1 L2 L3 kappa11 kappa12 kappa13 kappa21 kappa22 kappa23 kappa31 kappa32 kappa33'
prop_values = '0.2 0.75 1 1 1 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 '
[../]
# This material sums up the individual phase contributions. It is written to the output file
# (see GlobalParams section above) and can be used to check the constraint enforcement.
[./etasummat]
type = ParsedMaterial
property_name = etasum
material_property_names = 'h1 h2 h3'
expression = 'h1+h2+h3'
[../]
# The phase contribution factors for each material point are computed using the
# SwitchingFunctionMaterials. Each phase with an order parameter eta contributes h(eta)
# to the global free energy density. h is a function that switches smoothly from 0 to 1
[./switching1]
type = SwitchingFunctionMaterial
function_name = h1
eta = eta1
h_order = SIMPLE
[../]
[./switching2]
type = SwitchingFunctionMaterial
function_name = h2
eta = eta2
h_order = SIMPLE
[../]
[./switching3]
type = SwitchingFunctionMaterial
function_name = h3
eta = eta3
h_order = SIMPLE
[../]
# The barrier function adds a phase transformation energy barrier. It also
# Drives order parameters toward the [0:1] interval to avoid negative or larger than 1
# order parameters (these are set to 0 and 1 contribution by the switching functions
# above)
[./barrier]
type = MultiBarrierFunctionMaterial
etas = 'eta1 eta2 eta3'
[../]
# We use DerivativeParsedMaterials to specify three (very) simple free energy
# expressions for the three phases. All necessary derivatives are built automatically.
# In a real problem these expressions can be arbitrarily complex (or even provided
# by custom kernels).
[./phase_free_energy_1]
type = DerivativeParsedMaterial
property_name = F1
expression = '(c-1)^2'
coupled_variables = 'c'
[../]
[./phase_free_energy_2]
type = DerivativeParsedMaterial
property_name = F2
expression = '(c-0.5)^2'
coupled_variables = 'c'
[../]
[./phase_free_energy_3]
type = DerivativeParsedMaterial
property_name = F3
expression = 'c^2'
coupled_variables = 'c'
[../]
# The DerivativeMultiPhaseMaterial ties the phase free energies together into a global free energy.
# http://mooseframework.org/wiki/PhysicsModules/PhaseField/DevelopingModels/MultiPhaseModels/
[./free_energy]
type = DerivativeMultiPhaseMaterial
property_name = F
# we use a constant free energy (GeneriConstantmaterial property Fx)
fi_names = 'F1 F2 F3'
hi_names = 'h1 h2 h3'
etas = 'eta1 eta2 eta3'
coupled_variables = 'c'
W = 1
[../]
[]
[Postprocessors]
# The total free energy of the simulation cell to observe the energy reduction.
[./total_free_energy]
type = ElementIntegralVariablePostprocessor
variable = local_energy
[../]
# for testing we also monitor the total solute amount, which should be conserved.
[./total_solute]
type = ElementIntegralVariablePostprocessor
variable = c
[../]
[]
[Preconditioning]
# This preconditioner makes sure the Jacobian Matrix is fully populated. Our
# kernels compute all Jacobian matrix entries.
# This allows us to use the Newton solver below.
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
# Automatic differentiation provedes a _full_ Jacobian in this example
# so we can safely use NEWTON for a fast solve
solve_type = 'NEWTON'
l_max_its = 15
l_tol = 1.0e-6
nl_max_its = 50
nl_rel_tol = 1.0e-6
nl_abs_tol = 1.0e-6
start_time = 0.0
end_time = 150.0
[./TimeStepper]
type = SolutionTimeAdaptiveDT
dt = 0.1
[../]
[]
[Debug]
# show_var_residual_norms = true
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[./table]
type = CSV
delimiter = ' '
[../]
[]
(modules/phase_field/test/tests/MultiPhase/penalty.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 14
ny = 10
nz = 0
xmin = 10
xmax = 40
ymin = 15
ymax = 35
elem_type = QUAD4
[]
[GlobalParams]
penalty = 5
[]
[Variables]
[./c]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = SmoothCircleIC
x1 = 25.0
y1 = 25.0
radius = 6.0
invalue = 0.9
outvalue = 0.1
int_width = 3.0
[../]
[../]
[./w]
order = FIRST
family = LAGRANGE
[../]
[./eta1]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = SmoothCircleIC
x1 = 30.0
y1 = 25.0
radius = 4.0
invalue = 0.9
outvalue = 0.1
int_width = 2.0
[../]
[../]
[./eta2]
order = FIRST
family = LAGRANGE
initial_condition = 0.5
[../]
[]
[Kernels]
[./deta1dt]
type = TimeDerivative
variable = eta1
[../]
[./ACBulk1]
type = AllenCahn
variable = eta1
coupled_variables = 'c eta2'
f_name = F
[../]
[./ACInterface1]
type = ACInterface
variable = eta1
kappa_name = kappa_eta
[../]
[./penalty1]
type = SwitchingFunctionPenalty
variable = eta1
etas = 'eta1 eta2'
h_names = 'h1 h2'
[../]
[./deta2dt]
type = TimeDerivative
variable = eta2
[../]
[./ACBulk2]
type = AllenCahn
variable = eta2
coupled_variables = 'c eta1'
f_name = F
[../]
[./ACInterface2]
type = ACInterface
variable = eta2
kappa_name = kappa_eta
[../]
[./penalty2]
type = SwitchingFunctionPenalty
variable = eta2
etas = 'eta1 eta2'
h_names = 'h1 h2'
[../]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
w = w
coupled_variables = 'eta1 eta2'
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time1]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[]
[BCs]
[./Periodic]
[./All]
auto_direction = 'x y'
[../]
[../]
[]
[Materials]
[./consts]
type = GenericConstantMaterial
prop_names = 'L kappa_eta'
prop_values = '1 1 '
[../]
[./consts2]
type = GenericConstantMaterial
prop_names = 'M kappa_c'
prop_values = '1 1'
[../]
[./hsum]
type = ParsedMaterial
expression = h1+h2
property_name = hsum
material_property_names = 'h1 h2'
coupled_variables = 'c'
outputs = exodus
[../]
[./switching1]
type = SwitchingFunctionMaterial
function_name = h1
eta = eta1
h_order = SIMPLE
[../]
[./switching2]
type = SwitchingFunctionMaterial
function_name = h2
eta = eta2
h_order = SIMPLE
[../]
[./barrier]
type = MultiBarrierFunctionMaterial
etas = 'eta1 eta2'
[../]
[./free_energy_A]
type = DerivativeParsedMaterial
property_name = Fa
coupled_variables = 'c'
expression = '(c-0.1)^2'
derivative_order = 2
[../]
[./free_energy_B]
type = DerivativeParsedMaterial
property_name = Fb
coupled_variables = 'c'
expression = '(c-0.9)^2'
derivative_order = 2
[../]
[./free_energy]
type = DerivativeMultiPhaseMaterial
property_name = F
fi_names = 'Fa Fb'
hi_names = 'h1 h2'
etas = 'eta1 eta2'
coupled_variables = 'c'
derivative_order = 2
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -sub_pc_type'
petsc_options_value = 'asm lu'
l_max_its = 15
l_tol = 1.0e-6
nl_max_its = 50
nl_rel_tol = 1.0e-7
nl_abs_tol = 1.0e-9
start_time = 0.0
num_steps = 2
dt = 0.05
dtmin = 0.01
[]
[Debug]
# show_var_residual_norms = true
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(modules/phase_field/test/tests/MultiPhase/acmultiinterface_aux.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 10
nz = 0
xmin = -10
xmax = 10
ymin = -5
ymax = 5
elem_type = QUAD4
[]
[AuxVariables]
[./eta1]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = SmoothCircleIC
x1 = -3.5
y1 = 0.0
radius = 4.0
invalue = 0.9
outvalue = 0.1
int_width = 2.0
[../]
[../]
[]
[Variables]
[./eta2]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = SmoothCircleIC
x1 = 3.5
y1 = 0.0
radius = 4.0
invalue = 0.9
outvalue = 0.1
int_width = 2.0
[../]
[../]
[./eta3]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = SpecifiedSmoothCircleIC
x_positions = '-4.0 4.0'
y_positions = ' 0.0 0.0'
z_positions = ' 0.0 0.0'
radii = '4.0 4.0'
invalue = 0.1
outvalue = 0.9
int_width = 2.0
[../]
[../]
[./lambda]
order = FIRST
family = LAGRANGE
initial_condition = 1.0
[../]
[]
[Kernels]
[./deta2dt]
type = TimeDerivative
variable = eta2
[../]
[./ACBulk2]
type = AllenCahn
variable = eta2
coupled_variables = 'eta1 eta3'
mob_name = L2
f_name = F
[../]
[./ACInterface2]
type = ACMultiInterface
variable = eta2
etas = 'eta1 eta2 eta3'
mob_name = L2
kappa_names = 'kappa21 kappa22 kappa23'
[../]
[./lagrange2]
type = SwitchingFunctionConstraintEta
variable = eta2
h_name = h2
lambda = lambda
[../]
[./deta3dt]
type = TimeDerivative
variable = eta3
[../]
[./ACBulk3]
type = AllenCahn
variable = eta3
coupled_variables = 'eta1 eta2'
mob_name = L3
f_name = F
[../]
[./ACInterface3]
type = ACMultiInterface
variable = eta3
etas = 'eta1 eta2 eta3'
mob_name = L3
kappa_names = 'kappa31 kappa32 kappa33'
[../]
[./lagrange3]
type = SwitchingFunctionConstraintEta
variable = eta3
h_name = h3
lambda = lambda
[../]
[./lagrange]
type = SwitchingFunctionConstraintLagrange
variable = lambda
etas = 'eta1 eta2 eta3'
h_names = 'h1 h2 h3'
epsilon = 0
[../]
[]
[BCs]
[./Periodic]
[./All]
auto_direction = 'x y'
[../]
[../]
[]
[Materials]
[./consts]
type = GenericConstantMaterial
prop_names = 'Fx L1 L2 L3 kappa11 kappa12 kappa13 kappa21 kappa22 kappa23 kappa31 kappa32 kappa33'
prop_values = '0 1 1 1 1 1 1 1 1 1 1 1 1 '
[../]
[./switching1]
type = SwitchingFunctionMaterial
function_name = h1
eta = eta1
h_order = SIMPLE
[../]
[./switching2]
type = SwitchingFunctionMaterial
function_name = h2
eta = eta2
h_order = SIMPLE
[../]
[./switching3]
type = SwitchingFunctionMaterial
function_name = h3
eta = eta3
h_order = SIMPLE
[../]
[./barrier]
type = MultiBarrierFunctionMaterial
etas = 'eta1 eta2 eta3'
[../]
[./free_energy]
type = DerivativeMultiPhaseMaterial
property_name = F
# we use a constant free energy (GeneriConstantmaterial property Fx)
fi_names = 'Fx Fx Fx'
hi_names = 'h1 h2 h3'
etas = 'eta1 eta2 eta3'
# the free energy is given by the MultiBarrierFunctionMaterial only
W = 1
derivative_order = 2
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
solve_type = 'PJFNK'
#petsc_options = '-snes_ksp -snes_ksp_ew'
#petsc_options = '-ksp_monitor_snes_lg-snes_ksp_ew'
#petsc_options_iname = '-ksp_gmres_restart'
#petsc_options_value = '1000 '
l_max_its = 15
l_tol = 1.0e-6
nl_max_its = 50
nl_rel_tol = 1.0e-8
nl_abs_tol = 1.0e-10
start_time = 0.0
num_steps = 2
dt = 0.2
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(modules/phase_field/test/tests/MultiPhase/lagrangemult.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 14
ny = 10
nz = 0
xmin = 10
xmax = 40
ymin = 15
ymax = 35
elem_type = QUAD4
[]
[Variables]
[./c]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = SmoothCircleIC
x1 = 25.0
y1 = 25.0
radius = 6.0
invalue = 0.9
outvalue = 0.1
int_width = 3.0
[../]
[../]
[./w]
order = FIRST
family = LAGRANGE
[../]
[./eta1]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = SmoothCircleIC
x1 = 30.0
y1 = 25.0
radius = 4.0
invalue = 0.9
outvalue = 0.1
int_width = 2.0
[../]
[../]
[./eta2]
order = FIRST
family = LAGRANGE
initial_condition = 0.5
[../]
[./lambda]
order = FIRST
family = LAGRANGE
initial_condition = 1.0
[../]
[]
[Kernels]
[./deta1dt]
type = TimeDerivative
variable = eta1
[../]
[./ACBulk1]
type = AllenCahn
variable = eta1
coupled_variables = 'c eta2'
f_name = F
[../]
[./ACInterface1]
type = ACInterface
variable = eta1
kappa_name = kappa_eta
[../]
[./lagrange1]
type = SwitchingFunctionConstraintEta
variable = eta1
h_name = h1
lambda = lambda
[../]
[./deta2dt]
type = TimeDerivative
variable = eta2
[../]
[./ACBulk2]
type = AllenCahn
variable = eta2
coupled_variables = 'c eta1'
f_name = F
[../]
[./ACInterface2]
type = ACInterface
variable = eta2
kappa_name = kappa_eta
[../]
[./lagrange2]
type = SwitchingFunctionConstraintEta
variable = eta2
h_name = h2
lambda = lambda
[../]
[./lagrange]
type = SwitchingFunctionConstraintLagrange
variable = lambda
etas = 'eta1 eta2'
h_names = 'h1 h2'
epsilon = 0
[../]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
w = w
coupled_variables = 'eta1 eta2'
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time1]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[]
[BCs]
[./Periodic]
[./All]
auto_direction = 'x y'
[../]
[../]
[]
[Materials]
[./consts]
type = GenericConstantMaterial
prop_names = 'L kappa_eta'
prop_values = '1 1 '
[../]
[./consts2]
type = GenericConstantMaterial
prop_names = 'M kappa_c'
prop_values = '1 1'
[../]
[./switching1]
type = SwitchingFunctionMaterial
function_name = h1
eta = eta1
h_order = SIMPLE
outputs = exodus
[../]
[./switching2]
type = SwitchingFunctionMaterial
function_name = h2
eta = eta2
h_order = SIMPLE
outputs = exodus
[../]
[./barrier]
type = MultiBarrierFunctionMaterial
etas = 'eta1 eta2'
[../]
[./free_energy_A]
type = DerivativeParsedMaterial
property_name = Fa
coupled_variables = 'c'
expression = '(c-0.1)^2'
derivative_order = 2
enable_jit = true
[../]
[./free_energy_B]
type = DerivativeParsedMaterial
property_name = Fb
coupled_variables = 'c'
expression = '(c-0.9)^2'
derivative_order = 2
enable_jit = true
[../]
[./free_energy]
type = DerivativeMultiPhaseMaterial
property_name = F
fi_names = 'Fa Fb'
hi_names = 'h1 h2'
etas = 'eta1 eta2'
coupled_variables = 'c'
derivative_order = 2
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
solve_type = 'PJFNK'
#petsc_options = '-snes_ksp -snes_ksp_ew'
#petsc_options = '-ksp_monitor_snes_lg-snes_ksp_ew'
#petsc_options_iname = '-ksp_gmres_restart'
#petsc_options_value = '1000 '
l_max_its = 15
l_tol = 1.0e-6
nl_max_its = 50
nl_rel_tol = 1.0e-8
nl_abs_tol = 1.0e-10
start_time = 0.0
num_steps = 1
dt = 0.01
dtmin = 0.01
[]
[Debug]
# show_var_residual_norms = true
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(modules/combined/examples/publications/rapid_dev/fig8.i)
#
# Fig. 8 input for 10.1016/j.commatsci.2017.02.017
# D. Schwen et al./Computational Materials Science 132 (2017) 36-45
# Two growing particles with differnet anisotropic Eigenstrains
#
[Mesh]
[./gen]
type = GeneratedMeshGenerator
dim = 2
nx = 80
ny = 40
xmin = -20
xmax = 20
ymin = 0
ymax = 20
elem_type = QUAD4
[../]
[./cnode]
type = ExtraNodesetGenerator
input = gen
coord = '0.0 0.0'
new_boundary = 100
tolerance = 0.1
[../]
[]
[GlobalParams]
# CahnHilliard needs the third derivatives
derivative_order = 3
enable_jit = true
displacements = 'disp_x disp_y'
int_width = 1
[]
# AuxVars to compute the free energy density for outputting
[AuxVariables]
[./local_energy]
order = CONSTANT
family = MONOMIAL
[../]
[./cross_energy]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./local_free_energy]
type = TotalFreeEnergy
variable = local_energy
interfacial_vars = 'c'
kappa_names = 'kappa_c'
additional_free_energy = cross_energy
execute_on = 'INITIAL TIMESTEP_END'
[../]
[./cross_terms]
type = CrossTermGradientFreeEnergy
variable = cross_energy
interfacial_vars = 'eta1 eta2 eta3'
kappa_names = 'kappa11 kappa12 kappa13
kappa21 kappa22 kappa23
kappa31 kappa32 kappa33'
execute_on = 'INITIAL TIMESTEP_END'
[../]
[]
# particle x positions and radius
P1X=8
P2X=-4
PR=2
[Variables]
# Solute concentration variable
[./c]
[./InitialCondition]
type = SpecifiedSmoothCircleIC
x_positions = '${P1X} ${P2X}'
y_positions = '0 0'
z_positions = '0 0'
radii = '${PR} ${PR}'
outvalue = 0.5
invalue = 0.9
[../]
[../]
[./w]
[../]
# Order parameter for the Matrix
[./eta1]
[./InitialCondition]
type = SpecifiedSmoothCircleIC
x_positions = '${P1X} ${P2X}'
y_positions = '0 0'
z_positions = '0 0'
radii = '${PR} ${PR}'
outvalue = 1.0
invalue = 0.0
[../]
[../]
# Order parameters for the 2 different inclusion orientations
[./eta2]
[./InitialCondition]
type = SmoothCircleIC
x1 = ${P2X}
y1 = 0
radius = ${PR}
invalue = 1.0
outvalue = 0.0
[../]
[../]
[./eta3]
[./InitialCondition]
type = SmoothCircleIC
x1 = ${P1X}
y1 = 0
radius = ${PR}
invalue = 1.0
outvalue = 0.0
[../]
[../]
# Lagrange-multiplier
[./lambda]
initial_condition = 1.0
[../]
[]
[Modules]
[./TensorMechanics]
[./Master]
[./all]
add_variables = true
strain = SMALL
eigenstrain_names = eigenstrain
[../]
[../]
[../]
[]
[Kernels]
# Split Cahn-Hilliard kernels
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
args = 'eta1 eta2 eta3'
kappa_name = kappa_c
w = w
[../]
[./wres]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
# Allen-Cahn and Lagrange-multiplier constraint kernels for order parameter 1
[./deta1dt]
type = TimeDerivative
variable = eta1
[../]
[./ACBulk1]
type = AllenCahn
variable = eta1
args = 'eta2 eta3 c'
mob_name = L1
f_name = F
[../]
[./ACInterface1]
type = ACMultiInterface
variable = eta1
etas = 'eta1 eta2 eta3'
mob_name = L1
kappa_names = 'kappa11 kappa12 kappa13'
[../]
[./lagrange1]
type = SwitchingFunctionConstraintEta
variable = eta1
h_name = h1
lambda = lambda
[../]
# Allen-Cahn and Lagrange-multiplier constraint kernels for order parameter 2
[./deta2dt]
type = TimeDerivative
variable = eta2
[../]
[./ACBulk2]
type = AllenCahn
variable = eta2
args = 'eta1 eta3 c'
mob_name = L2
f_name = F
[../]
[./ACInterface2]
type = ACMultiInterface
variable = eta2
etas = 'eta1 eta2 eta3'
mob_name = L2
kappa_names = 'kappa21 kappa22 kappa23'
[../]
[./lagrange2]
type = SwitchingFunctionConstraintEta
variable = eta2
h_name = h2
lambda = lambda
[../]
# Allen-Cahn and Lagrange-multiplier constraint kernels for order parameter 3
[./deta3dt]
type = TimeDerivative
variable = eta3
[../]
[./ACBulk3]
type = AllenCahn
variable = eta3
args = 'eta1 eta2 c'
mob_name = L3
f_name = F
[../]
[./ACInterface3]
type = ACMultiInterface
variable = eta3
etas = 'eta1 eta2 eta3'
mob_name = L3
kappa_names = 'kappa31 kappa32 kappa33'
[../]
[./lagrange3]
type = SwitchingFunctionConstraintEta
variable = eta3
h_name = h3
lambda = lambda
[../]
# Lagrange-multiplier constraint kernel for lambda
[./lagrange]
type = SwitchingFunctionConstraintLagrange
variable = lambda
etas = 'eta1 eta2 eta3'
h_names = 'h1 h2 h3'
epsilon = 1e-6
[../]
[]
[Materials]
# declare a few constants, such as mobilities (L,M) and interface gradient prefactors (kappa*)
[./consts]
type = GenericConstantMaterial
block = 0
prop_names = 'M kappa_c L1 L2 L3 kappa11 kappa12 kappa13 kappa21 kappa22 kappa23 kappa31 kappa32 kappa33'
prop_values = '0.2 0.5 1 1 1 2.00 2.00 2.00 2.00 2.00 2.00 2.00 2.00 2.00 '
[../]
# We use this to output the level of constraint enforcement
# ideally it should be 0 everywhere, if the constraint is fully enforced
[./etasummat]
type = ParsedMaterial
property_name = etasum
coupled_variables = 'eta1 eta2 eta3'
material_property_names = 'h1 h2 h3'
expression = 'h1+h2+h3-1'
outputs = exodus
[../]
# This parsed material creates a single property for visualization purposes.
# It will be 0 for phase 1, -1 for phase 2, and 1 for phase 3
[./phasemap]
type = ParsedMaterial
property_name = phase
coupled_variables = 'eta2 eta3'
expression = 'if(eta3>0.5,1,0)-if(eta2>0.5,1,0)'
outputs = exodus
[../]
# global mechanical properties
[./elasticity_tensor]
type = ComputeElasticityTensor
C_ijkl = '400 400'
fill_method = symmetric_isotropic
[../]
[./stress]
type = ComputeLinearElasticStress
[../]
# eigenstrain
[./eigenstrain_2]
type = GenericConstantRankTwoTensor
tensor_name = s2
tensor_values = '0 -0.05 0 0 0 0'
[../]
[./eigenstrain_3]
type = GenericConstantRankTwoTensor
tensor_name = s3
tensor_values = '-0.05 0 0 0 0 0'
[../]
[./eigenstrain]
type = CompositeEigenstrain
weights = 'h2 h3'
tensors = 's2 s3'
args = 'eta2 eta3'
eigenstrain_name = eigenstrain
[../]
# switching functions
[./switching1]
type = SwitchingFunctionMaterial
function_name = h1
eta = eta1
h_order = SIMPLE
[../]
[./switching2]
type = SwitchingFunctionMaterial
function_name = h2
eta = eta2
h_order = SIMPLE
[../]
[./switching3]
type = SwitchingFunctionMaterial
function_name = h3
eta = eta3
h_order = SIMPLE
[../]
[./barrier]
type = MultiBarrierFunctionMaterial
etas = 'eta1 eta2 eta3'
[../]
# chemical free energies
[./chemical_free_energy_1]
type = DerivativeParsedMaterial
property_name = Fc1
expression = '4*c^2'
coupled_variables = 'c'
derivative_order = 2
[../]
[./chemical_free_energy_2]
type = DerivativeParsedMaterial
property_name = Fc2
expression = '(c-0.9)^2-0.4'
coupled_variables = 'c'
derivative_order = 2
[../]
[./chemical_free_energy_3]
type = DerivativeParsedMaterial
property_name = Fc3
expression = '(c-0.9)^2-0.5'
coupled_variables = 'c'
derivative_order = 2
[../]
# global chemical free energy
[./chemical_free_energy]
type = DerivativeMultiPhaseMaterial
f_name = Fc
fi_names = 'Fc1 Fc2 Fc3'
hi_names = 'h1 h2 h3'
etas = 'eta1 eta2 eta3'
coupled_variables = 'c'
W = 3
[../]
# global elastic free energy
[./elastic_free_energy]
type = ElasticEnergyMaterial
f_name = Fe
args = 'eta2 eta3'
outputs = exodus
output_properties = Fe
derivative_order = 2
[../]
# Penalize phase 2 and 3 coexistence
[./multi_phase_penalty]
type = DerivativeParsedMaterial
property_name = Fp
expression = '50*(eta2*eta3)^2'
coupled_variables = 'eta2 eta3'
derivative_order = 2
outputs = exodus
output_properties = Fp
[../]
# free energy
[./free_energy]
type = DerivativeSumMaterial
property_name = F
sum_materials = 'Fc Fe Fp'
coupled_variables = 'c eta1 eta2 eta3'
derivative_order = 2
[../]
[]
[BCs]
# fix center point location
[./centerfix_x]
type = DirichletBC
boundary = 100
variable = disp_x
value = 0
[../]
# fix side point x coordinate to inhibit rotation
[./angularfix]
type = DirichletBC
boundary = bottom
variable = disp_y
value = 0
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
# We monitor the total free energy and the total solute concentration (should be constant)
[Postprocessors]
[./total_free_energy]
type = ElementIntegralVariablePostprocessor
variable = local_energy
execute_on = 'INITIAL TIMESTEP_END'
[../]
[./total_solute]
type = ElementIntegralVariablePostprocessor
variable = c
execute_on = 'INITIAL TIMESTEP_END'
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -sub_pc_type'
petsc_options_value = 'asm lu'
l_max_its = 30
nl_max_its = 10
l_tol = 1.0e-4
nl_rel_tol = 1.0e-8
nl_abs_tol = 1.0e-10
start_time = 0.0
end_time = 12.0
[./TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 8
iteration_window = 1
dt = 0.01
[../]
[]
[Outputs]
print_linear_residuals = false
execute_on = 'INITIAL TIMESTEP_END'
exodus = true
[./table]
type = CSV
delimiter = ' '
[../]
[]
[Debug]
# show_var_residual_norms = true
[]