- f_nameBase name of the free energy function F defined in a DerivativeParsedMaterial
C++ Type:MaterialPropertyName
Controllable:No
Description:Base name of the free energy function F defined in a DerivativeParsedMaterial
- kappa_nameThe kappa used with the kernel
C++ Type:MaterialPropertyName
Controllable:No
Description:The kappa used with the kernel
- 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
- wChemical potential
C++ Type:std::vector<VariableName>
Controllable:No
Description:Chemical potential
SplitCHParsed
Split formulation Cahn-Hilliard Kernel that uses a DerivativeMaterial Free Energy
Implements the weak form
where is the concentration variable the kernel is operating on, is a free energy material property (with accompanying derivative properties), is the chemical potential variable, and is the gradient energy coefficient.
It is used together with SplitCHWRes
and CoupledTimeDerivative
to set up a system of two first order PDEs using a concentration order parameter and a chemical potential variable.
Input Parameters
- 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
- coupled_variables
C++ Type:std::vector<VariableName>
Controllable:No
- displacementsThe displacements
C++ Type:std::vector<VariableName>
Controllable:No
Description:The displacements
- 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.
- 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
- 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.
- diag_save_inThe name of auxiliary variables to save this Kernel's diagonal Jacobian contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
C++ Type:std::vector<AuxVariableName>
Controllable:No
Description:The name of auxiliary variables to save this Kernel's diagonal Jacobian contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
- 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
- save_inThe name of auxiliary variables to save this Kernel's residual contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
C++ Type:std::vector<AuxVariableName>
Controllable:No
Description:The name of auxiliary variables to save this Kernel's residual contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
- 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/combined/examples/publications/rapid_dev/fig8.i)
- (modules/phase_field/examples/rigidbodymotion/grain_motion_GT.i)
- (modules/phase_field/test/tests/rigidbodymotion/update_orientation.i)
- (modules/phase_field/test/tests/free_energy_material/MathCTDFreeEnergy_split.i)
- (modules/phase_field/test/tests/rigidbodymotion/update_orientation_verify.i)
- (modules/combined/examples/mortar/eigenstrain_action.i)
- (modules/phase_field/test/tests/MultiPhase/derivativetwophasematerial.i)
- (modules/phase_field/test/tests/rigidbodymotion/grain_maskedforce.i)
- (modules/phase_field/examples/rigidbodymotion/grain_forcedensity_ext.i)
- (modules/phase_field/test/tests/free_energy_material/MathFreeEnergy_split.i)
- (modules/phase_field/test/tests/free_energy_material/MathEBFreeEnergy_split.i)
- (modules/phase_field/test/tests/rigidbodymotion/grain_motion_fauxGT.i)
- (modules/phase_field/tutorials/spinodal_decomposition/s4_mobility.i)
- (modules/phase_field/test/tests/phase_field_kernels/SplitCHWRes.i)
- (modules/phase_field/test/tests/SoretDiffusion/split_temp.i)
- (modules/phase_field/test/tests/rigidbodymotion/grain_forcesum.i)
- (modules/phase_field/test/tests/rigidbodymotion/grain_appliedforcedensity.i)
- (modules/combined/examples/mortar/eigenstrain.i)
- (modules/combined/examples/publications/rapid_dev/fig7a.i)
- (modules/combined/examples/phase_field-mechanics/Conserved.i)
- (modules/phase_field/tutorials/spinodal_decomposition/s1_testmodel.i)
- (modules/phase_field/test/tests/phase_field_kernels/SplitCahnHilliard.i)
- (modules/combined/examples/publications/rapid_dev/fig7b.i)
- (modules/combined/test/tests/eigenstrain/variable_cahnhilliard.i)
- (modules/phase_field/test/tests/SoretDiffusion/split.i)
- (modules/phase_field/examples/rigidbodymotion/AC_CH_advection_constforce_rect.i)
- (modules/phase_field/test/tests/PolynomialFreeEnergy/split_order6_test.i)
- (modules/phase_field/test/tests/MultiPhase/lagrangemult.i)
- (modules/phase_field/test/tests/anisotropic_mobility/split.i)
- (modules/phase_field/test/tests/rigidbodymotion/grain_motion2.i)
- (modules/phase_field/test/tests/mobility_derivative/mobility_derivative_split_coupled_test.i)
- (modules/phase_field/test/tests/feature_volume_vpp_test/centroid.i)
- (modules/phase_field/examples/rigidbodymotion/AC_CH_Multigrain.i)
- (modules/combined/examples/publications/rapid_dev/fig3.i)
- (modules/phase_field/examples/measure_interface_energy/1Dinterface_energy.i)
- (modules/phase_field/tutorials/spinodal_decomposition/s3_decomp.i)
- (modules/phase_field/test/tests/rigidbodymotion/polycrystal_action.i)
- (modules/phase_field/test/tests/rigidbodymotion/grain_forcedensity.i)
- (modules/phase_field/test/tests/free_energy_material/MathEBFreeEnergy_split_name.i)
- (modules/phase_field/tutorials/spinodal_decomposition/s2_fasttest.i)
- (modules/phase_field/test/tests/PolynomialFreeEnergy/split_order4_test.i)
- (modules/phase_field/test/tests/MultiPhase/penalty.i)
- (modules/phase_field/test/tests/mobility_derivative/mobility_derivative_test.i)
- (modules/phase_field/test/tests/rigidbodymotion/grain_motion.i)
- (modules/phase_field/test/tests/MultiPhase/switchingfunctionmultiphasematerial.i)
- (modules/phase_field/test/tests/TotalFreeEnergy/TotalFreeEnergy_test.i)
- (modules/phase_field/test/tests/PolynomialFreeEnergy/split_order8_test.i)
- (modules/combined/examples/periodic_strain/global_strain_pfm_3D.i)
- (modules/phase_field/test/tests/phase_field_kernels/SimpleSplitCHWRes.i)
- (modules/combined/examples/periodic_strain/global_strain_pfm.i)
- (modules/phase_field/tutorials/spinodal_decomposition/s5_energycurve.i)
References
No citations exist within this document.(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
[]
(modules/phase_field/examples/rigidbodymotion/grain_motion_GT.i)
# example showing grain motion due to applied force density on grains
[GlobalParams]
var_name_base = eta
op_num = 4
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 80
ny = 40
nz = 0
xmin = 0.0
xmax = 40.0
ymin = 0.0
ymax = 20.0
zmax = 0
elem_type = QUAD4
[]
[Variables]
[./c]
[../]
[./w]
[../]
[./PolycrystalVariables]
[../]
[]
[Kernels]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
w = w
coupled_variables = 'eta0 eta1 eta2 eta3'
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[./motion]
type = MultiGrainRigidBodyMotion
variable = w
c = c
v = 'eta0 eta1 eta2 eta3'
grain_tracker_object = grain_center
grain_force = grain_force
grain_volumes = grain_volumes
[../]
[./RigidBodyMultiKernel]
# Creates all of the necessary Allen Cahn kernels automatically
c = c
f_name = F
mob_name = L
kappa_name = kappa_eta
grain_force = grain_force
grain_volumes = grain_volumes
grain_tracker_object = grain_center
[../]
[]
[Functions]
[./load_x]
# Defines the force on the grains in the x-direction
type = ParsedFunction
expression = 0.005*cos(x*pi/600)
[../]
[./load_y]
# Defines the force on the grains in the y-direction
type = ConstantFunction
value = 0.002
[../]
[]
[Materials]
[./pfmobility]
type = GenericConstantMaterial
prop_names = 'M L kappa_c kappa_eta'
prop_values = '4.5 60 250 4000'
[../]
[./free_energy]
type = DerivativeParsedMaterial
property_name = F
#coupled_variables = 'c eta0 eta1 eta2 eta3'
#constant_names = 'barr_height cv_eq'
#constant_expressions = '0.1 1.0e-2'
#function = '16*barr_height*(c-cv_eq)^2*(1-cv_eq-c)^2
# +eta0*(1-eta0)*c+eta1*(1-eta1)*c
# +eta2*(1-eta2)*c+eta3*(1-eta3)*c'
constant_names = 'A B'
constant_expressions = '450 1.5'
coupled_variables = 'c eta0 eta1 eta2 eta3' #Must be changed as op_num changes. Copy/paste from line 4
expression = 'A*c^2*(1-c)^2+B*(c^2+6*(1-c)*(eta0^2+eta1^2+eta2^2+eta3^2)
-4*(2-c)*(eta0^3+eta1^3+eta2^3+eta3^3)
+3*(eta0^2+eta1^2+eta2^2+eta3^2)^2)'
derivative_order = 2
[../]
#[./force_density]
# type = ForceDensityMaterial
# c = c
# etas = 'eta0 eta1 eta2 eta3'
#[../]
[./force_density]
type = ExternalForceDensityMaterial
c = c
k = 10.0
etas = 'eta0 eta1 eta2 eta3'
force_x = load_x
force_y = load_y
[../]
[]
[AuxVariables]
[./bnds]
[../]
[./unique_grains]
order = CONSTANT
family = MONOMIAL
[../]
[./var_indices]
order = CONSTANT
family = MONOMIAL
[../]
[./centroids]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./bnds]
type = BndsCalcAux
variable = bnds
#var_name_base = eta
#op_num = 4.0
v = 'eta0 eta1 eta2 eta3'
[../]
[./unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_center
field_display = UNIQUE_REGION
execute_on = timestep_begin
[../]
[./var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_center
field_display = VARIABLE_COLORING
execute_on = timestep_begin
[../]
[./centroids]
type = FeatureFloodCountAux
variable = centroids
execute_on = timestep_begin
field_display = CENTROID
flood_counter = grain_center
[../]
[]
[ICs]
[./ic_eta1]
x_positions = '32.5 24.0'
int_width = 1.0
z_positions = '0 0'
y_positions = '6.0 14.0'
radii = '4.0 4.0'
3D_spheres = false
outvalue = 0
variable = eta1
invalue = 1
type = SpecifiedSmoothCircleIC
block = 0
[../]
[./multip]
x_positions = '5.5 15.5 24.0 32.5 7.0 15.5 24.0 32.5'
int_width = 1.0
z_positions = '0 0'
y_positions = '6.0 6.0 6.0 6.0 14.5 14.5 14.0 14.5'
radii = '4.0 4.0 4.0 4.0 4.0 4.0 4.0 4.0'
3D_spheres = false
outvalue = 0.001
variable = c
invalue = 0.999
type = SpecifiedSmoothCircleIC
block = 0
[../]
[./ic_eta0]
x_positions = '5.5 15.5'
int_width = 1.0
z_positions = '0 0'
y_positions = '6.0 6.0'
radii = '4.0 4.0'
3D_spheres = false
outvalue = 0.0
variable = eta0
invalue = 1.0
type = SpecifiedSmoothCircleIC
block = 0
[../]
[./ic_eta2]
x_positions = '24.0 7.0'
int_width = 1.0
z_positions = '0 0'
y_positions = '6.0 14.5 '
radii = '4.0 4.0 '
3D_spheres = false
outvalue = 0.0
variable = eta2
invalue = 1.0
type = SpecifiedSmoothCircleIC
block = 0
[../]
[./ic_eta3]
x_positions = '15.5 32.5'
int_width = 1.0
z_positions = '0 0'
y_positions = '14.5 14.5'
radii = '4.0 4.0'
3D_spheres = false
outvalue = 0.0
variable = eta3
invalue = 1.0
type = SpecifiedSmoothCircleIC
block = 0
[../]
[]
[VectorPostprocessors]
[./forces]
type = GrainForcesPostprocessor
grain_force = grain_force
[../]
[./grain_volumes]
type = FeatureVolumeVectorPostprocessor
flood_counter = grain_center
execute_on = 'initial timestep_begin'
[../]
[]
[UserObjects]
[./grain_center]
type = GrainTracker
outputs = none
compute_var_to_feature_map = true
execute_on = 'initial timestep_begin'
[../]
[./grain_force]
type = ComputeExternalGrainForceAndTorque
c = c
grain_data = grain_center
force_density = force_density_ext
etas = 'eta0 eta1 eta2 eta3'
execute_on = 'initial linear nonlinear'
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly lu 1'
l_max_its = 30
l_tol = 1.0e-4
nl_rel_tol = 1.0e-10
start_time = 0.0
num_steps = 20
dt = 0.01
[]
[Outputs]
exodus = true
[]
(modules/phase_field/test/tests/rigidbodymotion/update_orientation.i)
# test file for applyting advection term and observing rigid body motion of grains
[Mesh]
type = GeneratedMesh
dim = 2
nx = 25
ny = 15
nz = 0
xmax = 50
ymax = 25
zmax = 0
elem_type = QUAD4
[]
[Variables]
[./c]
order = FIRST
family = LAGRANGE
[../]
[./w]
order = FIRST
family = LAGRANGE
[../]
[./eta]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
w = w
coupled_variables = eta
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[./motion]
type = MultiGrainRigidBodyMotion
variable = w
c = c
v = eta
grain_tracker_object = grain_center
grain_force = grain_force
grain_volumes = grain_volumes
[../]
[./eta_dot]
type = TimeDerivative
variable = eta
[../]
[./vadv_eta]
type = SingleGrainRigidBodyMotion
variable = eta
c = c
v = eta
grain_tracker_object = grain_center
grain_force = grain_force
grain_volumes = grain_volumes
[../]
[./acint_eta]
type = ACInterface
variable = eta
mob_name = M
coupled_variables = c
kappa_name = kappa_eta
[../]
[./acbulk_eta]
type = AllenCahn
variable = eta
mob_name = M
f_name = F
coupled_variables = c
[../]
[]
[Materials]
[./pfmobility]
type = GenericConstantMaterial
prop_names = 'M kappa_c kappa_eta'
prop_values = '5.0 2.0 0.1'
[../]
[./free_energy]
type = DerivativeParsedMaterial
coupled_variables = 'c eta'
constant_names = 'barr_height cv_eq'
constant_expressions = '0.1 1.0e-2'
expression = 16*barr_height*(c-cv_eq)^2*(1-cv_eq-c)^2+(c-eta)^2
derivative_order = 2
[../]
[]
[AuxVariables]
[./unique_grains]
order = CONSTANT
family = MONOMIAL
[../]
[./var_indices]
order = CONSTANT
family = MONOMIAL
[../]
[./centroids]
order = CONSTANT
family = MONOMIAL
[../]
[./vadv_x]
order = CONSTANT
family = MONOMIAL
[../]
[./vadv_y]
order = CONSTANT
family = MONOMIAL
[../]
[./angle_initial]
order = CONSTANT
family = MONOMIAL
[../]
[./euler_angle]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_center
field_display = UNIQUE_REGION
execute_on = timestep_begin
[../]
[./var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_center
field_display = VARIABLE_COLORING
execute_on = timestep_begin
[../]
[./centroids]
type = FeatureFloodCountAux
variable = centroids
execute_on = timestep_begin
field_display = CENTROID
flood_counter = grain_center
[../]
[./vadv_x]
type = GrainAdvectionAux
grain_force = grain_force
grain_volumes = grain_volumes
grain_tracker_object = grain_center
execute_on = timestep_begin
component = x
variable = vadv_x
[../]
[./vadv_y]
type = GrainAdvectionAux
grain_force = grain_force
grain_volumes = grain_volumes
grain_tracker_object = grain_center
execute_on = timestep_begin
component = y
variable = vadv_y
[../]
[./angle_initial]
type = OutputEulerAngles
variable = angle_initial
euler_angle_provider = euler_angle_initial
grain_tracker = grain_center
output_euler_angle = phi2
execute_on = timestep_begin
[../]
[./angle]
type = OutputEulerAngles
variable = euler_angle
euler_angle_provider = euler_angle
grain_tracker = grain_center
output_euler_angle = phi2
execute_on = timestep_begin
[../]
[]
[VectorPostprocessors]
[./forces]
type = GrainForcesPostprocessor
grain_force = grain_force
[../]
[./grain_volumes]
type = FeatureVolumeVectorPostprocessor
flood_counter = grain_center
execute_on = 'initial timestep_begin'
[../]
[]
[UserObjects]
[./grain_center]
type = GrainTracker
variable = eta
outputs = none
compute_var_to_feature_map = true
execute_on = 'initial timestep_begin'
[../]
[./grain_force]
type = ConstantGrainForceAndTorque
execute_on = 'initial timestep_begin linear nonlinear'
force = '0.5 0.0 0.0 '
torque = '0.0 0.0 10.0'
[../]
[./euler_angle_initial]
type = RandomEulerAngleProvider
grain_tracker_object = grain_center
execute_on = 'initial timestep_begin'
[../]
[./euler_angle]
type = EulerAngleUpdater
grain_tracker_object = grain_center
euler_angle_provider = euler_angle_initial
grain_torques_object = grain_force
grain_volumes = grain_volumes
execute_on = timestep_begin
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly lu 1'
nl_max_its = 30
l_max_its = 30
l_tol = 1.0e-4
nl_rel_tol = 1.0e-10
start_time = 0.0
dt = 0.2
num_steps = 5
[]
[Outputs]
exodus = true
[]
[ICs]
[./rect_c]
y2 = 20.0
y1 = 5.0
inside = 1.0
x2 = 30.0
variable = c
x1 = 10.0
type = BoundingBoxIC
[../]
[./rect_eta]
y2 = 20.0
y1 = 5.0
inside = 1.0
x2 = 30.0
variable = eta
x1 = 10.0
type = BoundingBoxIC
[../]
[]
(modules/phase_field/test/tests/free_energy_material/MathCTDFreeEnergy_split.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 30
ny = 30
xmin = 0.0
xmax = 30.0
ymin = 0.0
ymax = 30.0
elem_type = QUAD4
[]
[Variables]
[c]
[InitialCondition]
type = CrossIC
x1 = 0.0
x2 = 30.0
y1 = 0.0
y2 = 30.0
[]
[]
[w]
[]
[]
[Kernels]
[cres]
type = SplitCHParsed
variable = c
kappa_name = 2.0 # kappa_c - we are not using a mat prop here to support AD+nonAD
w = w
f_name = F
[]
[wres]
type = SplitCHWRes
variable = w
mob_name = M
[]
[time]
type = CoupledTimeDerivative
variable = w
v = c
[]
[]
[BCs]
[Periodic]
[all]
auto_direction = 'x y'
variable = 'c w'
[]
[]
[]
[Materials]
[constant]
type = GenericConstantMaterial
prop_names = 'M'
prop_values = '1.0'
[]
[free_energy]
type = MathCTDFreeEnergy
property_name = F
c = c
[]
[]
[Executioner]
type = Transient
scheme = BDF2
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
l_max_its = 30
l_tol = 1.0e-3
nl_max_its = 50
nl_rel_tol = 1.0e-10
dt = 10.0
num_steps = 2
[]
[Outputs]
exodus = true
[]
(modules/phase_field/test/tests/rigidbodymotion/update_orientation_verify.i)
# test file for applyting advection term and observing rigid body motion of grains
[Mesh]
type = GeneratedMesh
dim = 3
nx = 14
ny = 7
nz = 7
xmax = 40
ymax = 25
zmax = 25
elem_type = HEX8
[]
[Variables]
[./c]
order = FIRST
family = LAGRANGE
[../]
[./w]
order = FIRST
family = LAGRANGE
[../]
[./eta]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
w = w
coupled_variables = eta
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[./motion]
type = MultiGrainRigidBodyMotion
variable = w
c = c
v = eta
grain_tracker_object = grain_center
grain_force = grain_force
grain_volumes = grain_volumes
[../]
[./eta_dot]
type = TimeDerivative
variable = eta
[../]
[./vadv_eta]
type = SingleGrainRigidBodyMotion
variable = eta
c = c
v = eta
grain_tracker_object = grain_center
grain_force = grain_force
grain_volumes = grain_volumes
[../]
[./acint_eta]
type = ACInterface
variable = eta
mob_name = M
coupled_variables = c
kappa_name = kappa_eta
[../]
[./acbulk_eta]
type = AllenCahn
variable = eta
mob_name = M
f_name = F
coupled_variables = c
[../]
[]
[Materials]
[./pfmobility]
type = GenericConstantMaterial
prop_names = 'M kappa_c kappa_eta'
prop_values = '5.0 2.0 0.1'
[../]
[./free_energy]
type = DerivativeParsedMaterial
coupled_variables = 'c eta'
constant_names = 'barr_height cv_eq'
constant_expressions = '0.1 1.0e-2'
expression = 16*barr_height*(c-cv_eq)^2*(1-cv_eq-c)^2+(c-eta)^2
derivative_order = 2
[../]
[]
[AuxVariables]
[./unique_grains]
order = CONSTANT
family = MONOMIAL
[../]
[./var_indices]
order = CONSTANT
family = MONOMIAL
[../]
[./centroids]
order = CONSTANT
family = MONOMIAL
[../]
[./vadv_x]
order = CONSTANT
family = MONOMIAL
[../]
[./vadv_y]
order = CONSTANT
family = MONOMIAL
[../]
[./angle_initial]
order = CONSTANT
family = MONOMIAL
[../]
[./euler_angle]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_center
field_display = UNIQUE_REGION
execute_on = timestep_begin
[../]
[./var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_center
field_display = VARIABLE_COLORING
execute_on = timestep_begin
[../]
[./centroids]
type = FeatureFloodCountAux
variable = centroids
execute_on = timestep_begin
field_display = CENTROID
flood_counter = grain_center
[../]
[./vadv_x]
type = GrainAdvectionAux
grain_force = grain_force
grain_volumes = grain_volumes
grain_tracker_object = grain_center
execute_on = timestep_begin
component = x
variable = vadv_x
[../]
[./vadv_y]
type = GrainAdvectionAux
grain_force = grain_force
grain_volumes = grain_volumes
grain_tracker_object = grain_center
execute_on = timestep_begin
component = y
variable = vadv_y
[../]
[./angle_initial]
type = OutputEulerAngles
variable = angle_initial
euler_angle_provider = euler_angle_initial
grain_tracker = grain_center
output_euler_angle = phi2
execute_on = timestep_begin
[../]
[./angle]
type = OutputEulerAngles
variable = euler_angle
euler_angle_provider = euler_angle
grain_tracker = grain_center
output_euler_angle = phi2
execute_on = timestep_begin
[../]
[]
[VectorPostprocessors]
[./forces]
type = GrainForcesPostprocessor
grain_force = grain_force
[../]
[./grain_volumes]
type = FeatureVolumeVectorPostprocessor
flood_counter = grain_center
execute_on = 'initial timestep_begin'
[../]
[./angle_check]
type = EulerAngleUpdaterCheck
grain_tracker_object = grain_center
euler_angle_updater = euler_angle
grain_torques_object = grain_force
grain_volumes = grain_volumes
execute_on = timestep_begin
[../]
[]
[UserObjects]
[./grain_center]
type = GrainTracker
variable = eta
outputs = none
compute_var_to_feature_map = true
execute_on = 'initial timestep_begin'
[../]
[./grain_force]
type = ConstantGrainForceAndTorque
execute_on = 'initial timestep_begin linear nonlinear'
force = '0.5 0.0 0.0 '
torque = '-200.0 -120.0 1000.0'
[../]
[./euler_angle_initial]
type = RandomEulerAngleProvider
grain_tracker_object = grain_center
seed = 12356
execute_on = 'initial timestep_begin'
[../]
[./euler_angle]
type = EulerAngleUpdater
grain_tracker_object = grain_center
euler_angle_provider = euler_angle_initial
grain_torques_object = grain_force
grain_volumes = grain_volumes
execute_on = timestep_begin
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly lu 1'
nl_max_its = 30
l_max_its = 30
l_tol = 1.0e-4
nl_rel_tol = 1.0e-10
start_time = 0.0
dt = 0.2
num_steps = 2
[]
[Outputs]
csv = true
exodus = true
[]
[ICs]
[./rect_c]
y2 = 20.0
y1 = 5.0
z1 = 5.0
z2 = 20.0
inside = 1.0
x2 = 30.0
variable = c
x1 = 10.0
type = BoundingBoxIC
[../]
[./rect_eta]
y2 = 20.0
y1 = 5.0
inside = 1.0
x2 = 30.0
variable = eta
x1 = 10.0
z1 = 5.0
z2 = 20.0
type = BoundingBoxIC
[../]
[]
(modules/combined/examples/mortar/eigenstrain_action.i)
#
# Eigenstrain with Mortar gradient periodicity
#
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 50
ny = 50
xmin = -0.5
xmax = 0.5
ymin = -0.5
ymax = 0.5
[]
[./cnode]
input = gen
type = ExtraNodesetGenerator
coord = '0.0 0.0'
new_boundary = 100
[../]
[./anode]
input = cnode
type = ExtraNodesetGenerator
coord = '0.0 0.5'
new_boundary = 101
[../]
[]
[Modules/PhaseField/MortarPeriodicity]
[./strain]
variable = 'disp_x disp_y'
periodicity = gradient
periodic_directions = 'x y'
[../]
[]
[GlobalParams]
derivative_order = 2
enable_jit = true
displacements = 'disp_x disp_y'
[]
# AuxVars to compute the free energy density for outputting
[AuxVariables]
[./local_energy]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./local_free_energy]
type = TotalFreeEnergy
block = 0
execute_on = 'initial LINEAR'
variable = local_energy
interfacial_vars = 'c'
kappa_names = 'kappa_c'
[../]
[]
[Variables]
# Solute concentration variable
[./c]
[./InitialCondition]
type = RandomIC
min = 0.49
max = 0.51
[../]
block = 0
[../]
[./w]
block = 0
[../]
# Mesh displacement
[./disp_x]
block = 0
[../]
[./disp_y]
block = 0
[../]
[]
[Kernels]
# Set up stress divergence kernels
[./TensorMechanics]
[../]
# Cahn-Hilliard kernels
[./c_dot]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
w = w
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[]
[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'
prop_values = '0.2 0.01 '
[../]
[./shear1]
type = GenericConstantRankTwoTensor
block = 0
tensor_values = '0 0 0 0 0 0.5'
tensor_name = shear1
[../]
[./shear2]
type = GenericConstantRankTwoTensor
block = 0
tensor_values = '0 0 0 0 0 -0.5'
tensor_name = shear2
[../]
[./expand3]
type = GenericConstantRankTwoTensor
block = 0
tensor_values = '1 1 0 0 0 0'
tensor_name = expand3
[../]
[./weight1]
type = DerivativeParsedMaterial
block = 0
expression = '0.3*c^2'
property_name = weight1
coupled_variables = c
[../]
[./weight2]
type = DerivativeParsedMaterial
block = 0
expression = '0.3*(1-c)^2'
property_name = weight2
coupled_variables = c
[../]
[./weight3]
type = DerivativeParsedMaterial
block = 0
expression = '4*(0.5-c)^2'
property_name = weight3
coupled_variables = c
[../]
# matrix phase
[./elasticity_tensor]
type = ComputeElasticityTensor
block = 0
C_ijkl = '1 1'
fill_method = symmetric_isotropic
[../]
[./strain]
type = ComputeSmallStrain
block = 0
displacements = 'disp_x disp_y'
[../]
[./eigenstrain]
type = CompositeEigenstrain
block = 0
tensors = 'shear1 shear2 expand3'
weights = 'weight1 weight2 weight3'
args = c
eigenstrain_name = eigenstrain
[../]
[./stress]
type = ComputeLinearElasticStress
block = 0
[../]
# chemical free energies
[./chemical_free_energy]
type = DerivativeParsedMaterial
block = 0
property_name = Fc
expression = '4*c^2*(1-c)^2'
coupled_variables = 'c'
outputs = exodus
output_properties = Fc
[../]
# elastic free energies
[./elastic_free_energy]
type = ElasticEnergyMaterial
f_name = Fe
block = 0
args = 'c'
outputs = exodus
output_properties = Fe
[../]
# free energy (chemical + elastic)
[./free_energy]
type = DerivativeSumMaterial
block = 0
property_name = F
sum_materials = 'Fc Fe'
coupled_variables = 'c'
[../]
[]
[BCs]
[./Periodic]
[./up_down]
primary = top
secondary = bottom
translation = '0 -1 0'
variable = 'c w'
[../]
[./left_right]
primary = left
secondary = right
translation = '1 0 0'
variable = 'c w'
[../]
[../]
# fix center point location
[./centerfix_x]
type = DirichletBC
boundary = 100
variable = disp_x
value = 0
[../]
[./centerfix_y]
type = DirichletBC
boundary = 100
variable = disp_y
value = 0
[../]
# fix side point x coordinate to inhibit rotation
[./angularfix]
type = DirichletBC
boundary = 101
variable = disp_x
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
block = 0
execute_on = 'initial TIMESTEP_END'
variable = local_energy
[../]
[./total_solute]
type = ElementIntegralVariablePostprocessor
block = 0
execute_on = 'initial TIMESTEP_END'
variable = c
[../]
[./min]
type = ElementExtremeValue
block = 0
execute_on = 'initial TIMESTEP_END'
value_type = min
variable = c
[../]
[./max]
type = ElementExtremeValue
block = 0
execute_on = 'initial TIMESTEP_END'
value_type = max
variable = c
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = 'PJFNK'
line_search = basic
# mortar currently does not support MPI parallelization
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = ' lu NONZERO 1e-10'
l_max_its = 30
nl_max_its = 12
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.01
[../]
[]
[Outputs]
execute_on = 'timestep_end'
print_linear_residuals = false
exodus = true
[./table]
type = CSV
delimiter = ' '
[../]
[]
(modules/phase_field/test/tests/MultiPhase/derivativetwophasematerial.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
[../]
[./eta]
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
[../]
[../]
[]
[Kernels]
[./detadt]
type = TimeDerivative
variable = eta
[../]
[./ACBulk]
type = AllenCahn
variable = eta
coupled_variables = c
f_name = F
[../]
[./ACInterface]
type = ACInterface
variable = eta
kappa_name = kappa_eta
[../]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
w = w
coupled_variables = 'eta'
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
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'
[../]
[./switching]
type = SwitchingFunctionMaterial
eta = eta
h_order = SIMPLE
[../]
[./barrier]
type = BarrierFunctionMaterial
eta = eta
g_order = SIMPLE
[../]
[./free_energy_A]
type = DerivativeParsedMaterial
property_name = Fa
coupled_variables = 'c'
expression = '(c-0.1)^2*(c-1)^2 + c*0.01'
derivative_order = 2
enable_jit = true
[../]
[./free_energy_B]
type = DerivativeParsedMaterial
property_name = Fb
coupled_variables = 'c'
expression = 'c^2*(c-0.9)^2 + (1-c)*0.01'
derivative_order = 2
enable_jit = true
[../]
[./free_energy]
type = DerivativeTwoPhaseMaterial
property_name = F
fa_name = Fa
fb_name = Fb
coupled_variables = 'c'
eta = eta
derivative_order = 2
outputs = exodus
output_properties = 'F dF/dc dF/deta d^2F/dc^2 d^2F/dcdeta d^2F/deta^2'
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
solve_type = 'NEWTON'
l_max_its = 15
l_tol = 1.0e-4
nl_max_its = 10
nl_rel_tol = 1.0e-11
start_time = 0.0
num_steps = 1
dt = 0.1
[]
[Outputs]
exodus = true
[]
(modules/phase_field/test/tests/rigidbodymotion/grain_maskedforce.i)
# test file for showing pinning of grains
[GlobalParams]
var_name_base = eta
op_num = 2
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 25
ny = 15
nz = 0
xmax = 50
ymax = 25
zmax = 0
elem_type = QUAD4
[]
[Variables]
[./c]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = SpecifiedSmoothCircleIC
invalue = 1.0
outvalue = 0.1
int_width = 4.0
x_positions = '20.0 30.0 '
z_positions = '0.0 0.0 '
y_positions = '0.0 25.0 '
radii = '10.0 10.0'
3D_spheres = false
variable = c
block = 0
[../]
[../]
[./w]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
w = w
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[./motion]
type = MultiGrainRigidBodyMotion
c = c
variable = w
v = 'eta0 eta1'
grain_tracker_object = grain_center
grain_force = grain_force
grain_volumes = grain_volumes
[../]
[]
[Materials]
[./pfmobility]
type = GenericConstantMaterial
block = 0
prop_names = 'M kappa_c kappa_eta'
prop_values = '5.0 2.0 0.1'
[../]
[./free_energy]
type = DerivativeParsedMaterial
block = 0
property_name = F
coupled_variables = c
constant_names = 'barr_height cv_eq'
constant_expressions = '0.1 1.0e-2'
expression = 16*barr_height*(c-cv_eq)^2*(1-cv_eq-c)^2
derivative_order = 2
[../]
[]
[AuxVariables]
[./eta0]
[../]
[./eta1]
[../]
[./bnds]
[../]
[]
[AuxKernels]
[./bnds]
type = BndsCalcAux
variable = bnds
var_name_base = eta
op_num = 2
v = 'eta0 eta1'
block = 0
[../]
[]
[ICs]
[./ic_eta0]
int_width = 4.0
x1 = 20.0
y1 = 0.0
radius = 10.0
outvalue = 0.0
variable = eta0
invalue = 1.0
type = SmoothCircleIC
[../]
[./IC_eta1]
int_width = 4.0
x1 = 30.0
y1 = 25.0
radius = 10.0
outvalue = 0.0
variable = eta1
invalue = 1.0
type = SmoothCircleIC
[../]
[]
[VectorPostprocessors]
[./forces_cosnt]
type = GrainForcesPostprocessor
grain_force = grain_force_const
[../]
[./forces_total]
type = GrainForcesPostprocessor
grain_force = grain_force
[../]
[./grain_volumes]
type = FeatureVolumeVectorPostprocessor
flood_counter = grain_center
execute_on = 'initial timestep_begin'
[../]
[]
[UserObjects]
[./grain_center]
type = GrainTracker
outputs = none
compute_var_to_feature_map = true
execute_on = 'initial timestep_begin'
[../]
[./grain_force_const]
type = ConstantGrainForceAndTorque
execute_on = 'linear nonlinear'
force = '5.0 10.0 0.0 1.0 0.0 0.0'
torque = '0.0 0.0 50.0 0.0 0.0 5.0'
[../]
[./grain_force]
type = MaskedGrainForceAndTorque
grain_force = grain_force_const
pinned_grains = 0
execute_on = 'linear nonlinear'
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly lu 1'
l_max_its = 20
nl_max_its = 20
l_tol = 1.0e-4
nl_rel_tol = 1.0e-10
start_time = 0.0
num_steps = 1
dt = 1.0
[]
[Outputs]
exodus = true
csv = true
[]
(modules/phase_field/examples/rigidbodymotion/grain_forcedensity_ext.i)
# example showing grain motion due to applied force density on grains
[GlobalParams]
var_name_base = eta
op_num = 2
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 40
ny = 20
nz = 0
xmin = 0.0
xmax = 40.0
ymin = 0.0
ymax = 20.0
zmax = 0
elem_type = QUAD4
[]
[Variables]
[./c]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = SpecifiedSmoothCircleIC
invalue = 1.0
outvalue = 0.0
int_width = 6.0
x_positions = '20.0 30.0 '
z_positions = '0.0 0.0 '
y_positions = '0.0 25.0 '
radii = '14.0 14.0'
3D_spheres = false
variable = c
[../]
[../]
[./w]
order = FIRST
family = LAGRANGE
[../]
[]
[Functions]
[./load]
type = ConstantFunction
value = -0.01
[../]
[]
[Kernels]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
w = w
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[./motion]
type = MultiGrainRigidBodyMotion
variable = w
c = c
v = 'eta0 eta1'
grain_tracker_object = grain_center
grain_force = grain_force
grain_volumes = grain_volumes
[../]
[]
[Materials]
[./pfmobility]
type = GenericConstantMaterial
prop_names = 'M kappa_c kappa_eta'
prop_values = '1.0 2.0 0.1'
[../]
[./free_energy]
type = DerivativeParsedMaterial
property_name = F
coupled_variables = c
constant_names = 'barr_height cv_eq'
constant_expressions = '0.1 1.0e-2'
expression = 16*barr_height*(c-cv_eq)^2*(1-cv_eq-c)^2
derivative_order = 2
[../]
[./force_density]
type = ExternalForceDensityMaterial
c = c
etas = 'eta0 eta1'
k = 1.0
force_y = load
[../]
[]
[AuxVariables]
[./eta0]
[../]
[./eta1]
[../]
[./bnds]
[../]
[./df00]
order = CONSTANT
family = MONOMIAL
[../]
[./df01]
order = CONSTANT
family = MONOMIAL
[../]
[./df10]
order = CONSTANT
family = MONOMIAL
[../]
[./df11]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./bnds]
type = BndsCalcAux
variable = bnds
var_name_base = eta
op_num = 2
v = 'eta0 eta1'
[../]
[./df01]
type = MaterialStdVectorRealGradientAux
variable = df01
component = 1
property = force_density_ext
[../]
[./df11]
type = MaterialStdVectorRealGradientAux
variable = df11
index = 1
component = 1
property = force_density_ext
[../]
[./df00]
type = MaterialStdVectorRealGradientAux
variable = df00
property = force_density_ext
[../]
[./df10]
type = MaterialStdVectorRealGradientAux
variable = df10
index = 1
property = force_density_ext
[../]
[]
[ICs]
[./ic_eta0]
int_width = 6.0
x1 = 20.0
y1 = 0.0
radius = 14.0
outvalue = 0.0
variable = eta0
invalue = 1.0
type = SmoothCircleIC
[../]
[./IC_eta1]
int_width = 6.0
x1 = 30.0
y1 = 25.0
radius = 14.0
outvalue = 0.0
variable = eta1
invalue = 1.0
type = SmoothCircleIC
[../]
[]
[VectorPostprocessors]
[./forces]
type = GrainForcesPostprocessor
grain_force = grain_force
[../]
[./grain_volumes]
type = FeatureVolumeVectorPostprocessor
flood_counter = grain_center
execute_on = 'initial timestep_begin'
[../]
[]
[UserObjects]
[./grain_center]
type = GrainTracker
outputs = none
compute_var_to_feature_map = true
execute_on = 'initial timestep_begin'
[../]
[./grain_force]
type = ComputeExternalGrainForceAndTorque
c = c
etas = 'eta0 eta1'
grain_data = grain_center
force_density = force_density_ext
execute_on = 'initial linear nonlinear'
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly lu 1'
l_max_its = 30
l_tol = 1.0e-4
nl_rel_tol = 1.0e-10
start_time = 0.0
num_steps = 5
dt = 0.1
[./Adaptivity]
refine_fraction = 0.7
coarsen_fraction = 0.1
max_h_level = 2
initial_adaptivity = 1
[../]
[]
[Outputs]
exodus = true
[]
(modules/phase_field/test/tests/free_energy_material/MathFreeEnergy_split.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 30
ny = 30
xmin = 0.0
xmax = 30.0
ymin = 0.0
ymax = 30.0
elem_type = QUAD4
[]
[Variables]
[./c]
[./InitialCondition]
type = CrossIC
x1 = 0.0
x2 = 30.0
y1 = 0.0
y2 = 30.0
[../]
[../]
[./w]
[../]
[]
[Preconditioning]
active = 'SMP'
[./PBP]
type = PBP
solve_order = 'w c'
preconditioner = 'AMG ASM'
off_diag_row = 'c '
off_diag_column = 'w '
[../]
[./SMP]
type = SMP
coupled_groups = 'c,w'
[../]
[]
[Kernels]
[./cres]
type = SplitCHParsed
variable = c
kappa_name = kappa_c
w = w
f_name = F
[../]
[./wres]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[]
[BCs]
[./Periodic]
[./top_bottom]
primary = 0
secondary = 2
translation = '0 30.0 0'
[../]
[./left_right]
primary = 1
secondary = 3
translation = '-30.0 0 0'
[../]
[../]
[]
[Materials]
[./constant]
type = GenericConstantMaterial
prop_names = 'M kappa_c'
prop_values = '1.0 2.0'
[../]
[./free_energy]
type = MathFreeEnergy
property_name = F
c = c
derivative_order = 2
[../]
[]
[Executioner]
type = Transient
scheme = 'BDF2'
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
l_max_its = 30
l_tol = 1.0e-3
nl_max_its = 50
nl_rel_tol = 1.0e-10
dt = 10.0
num_steps = 2
[]
[Outputs]
exodus = true
[]
(modules/phase_field/test/tests/free_energy_material/MathEBFreeEnergy_split.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 30
ny = 30
xmin = 0.0
xmax = 30.0
ymin = 0.0
ymax = 30.0
elem_type = QUAD4
[]
[Variables]
[c]
[InitialCondition]
type = CrossIC
x1 = 0.0
x2 = 30.0
y1 = 0.0
y2 = 30.0
[]
[]
[w]
[]
[]
[Preconditioning]
active = 'SMP'
[PBP]
type = PBP
solve_order = 'w c'
preconditioner = 'AMG ASM'
off_diag_row = 'c '
off_diag_column = 'w '
[]
[SMP]
type = SMP
off_diag_row = 'w c'
off_diag_column = 'c w'
[]
[]
[Kernels]
[cres]
type = SplitCHParsed
variable = c
kappa_name = kappa_c
w = w
f_name = F
[]
[wres]
type = SplitCHWRes
variable = w
mob_name = M
[]
[time]
type = CoupledTimeDerivative
variable = w
v = c
[]
[]
[BCs]
[Periodic]
[top_bottom]
primary = 0
secondary = 2
translation = '0 30.0 0'
[]
[left_right]
primary = 1
secondary = 3
translation = '-30.0 0 0'
[]
[]
[]
[Materials]
[constant]
type = GenericConstantMaterial
prop_names = 'M kappa_c'
prop_values = '1.0 2.0'
[]
[free_energy]
type = MathEBFreeEnergy
property_name = F
c = c
[]
[]
[Executioner]
type = Transient
scheme = 'BDF2'
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
l_max_its = 30
l_tol = 1.0e-3
nl_max_its = 50
nl_rel_tol = 1.0e-10
dt = 10.0
num_steps = 2
[]
[Outputs]
exodus = true
[]
(modules/phase_field/test/tests/rigidbodymotion/grain_motion_fauxGT.i)
# test file for showing reaction forces between particles
[GlobalParams]
var_name_base = eta
op_num = 2
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 5
nz = 0
xmax = 50
ymax = 25
zmax = 0
elem_type = QUAD4
uniform_refine = 1
[]
[Variables]
[./c]
order = FIRST
family = LAGRANGE
[../]
[./w]
order = FIRST
family = LAGRANGE
[../]
[./eta0]
[../]
[./eta1]
[../]
[]
[Kernels]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
coupled_variables = 'eta0 eta1'
w = w
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[./motion]
type = MultiGrainRigidBodyMotion
variable = w
c = c
v = 'eta0 eta1'
grain_force = grain_force
grain_tracker_object = grain_center
grain_volumes = grain_volumes
[../]
[./eta0_dot]
type = TimeDerivative
variable = eta0
[../]
[./vadv_eta]
type = SingleGrainRigidBodyMotion
variable = eta0
c = c
v = 'eta0 eta1'
grain_force = grain_force
grain_tracker_object = grain_center
grain_volumes = grain_volumes
op_index = 0
[../]
[./acint_eta0]
type = ACInterface
variable = eta0
mob_name = M
#coupled_variables = c
kappa_name = kappa_eta
[../]
[./acbulk_eta0]
type = AllenCahn
variable = eta0
mob_name = M
f_name = F
coupled_variables = 'c eta1'
[../]
[./eta1_dot]
type = TimeDerivative
variable = eta1
[../]
[./vadv_eta1]
type = SingleGrainRigidBodyMotion
variable = eta1
c = c
v = 'eta0 eta1'
op_index = 1
grain_force = grain_force
grain_tracker_object = grain_center
grain_volumes = grain_volumes
[../]
[./acint_eta1]
type = ACInterface
variable = eta1
mob_name = M
#coupled_variables = c
kappa_name = kappa_eta
[../]
[./acbulk_eta1]
type = AllenCahn
variable = eta1
mob_name = M
f_name = F
coupled_variables = 'c eta0'
[../]
[]
[Materials]
[./pfmobility]
type = GenericConstantMaterial
prop_names = 'M kappa_c kappa_eta'
prop_values = '1.0 0.5 0.5'
[../]
[./free_energy]
type = DerivativeParsedMaterial
property_name = F
coupled_variables = 'c eta0 eta1'
constant_names = 'barr_height cv_eq'
constant_expressions = '0.1 1.0e-2'
expression = 16*barr_height*(c-cv_eq)^2*(1-cv_eq-c)^2+eta0*(1-eta0)*c+eta1*(1-eta1)*c
derivative_order = 2
[../]
[./force_density]
type = ForceDensityMaterial
c = c
etas ='eta0 eta1'
[../]
[]
[AuxVariables]
[./bnds]
[../]
[./df00]
order = CONSTANT
family = MONOMIAL
[../]
[./df01]
order = CONSTANT
family = MONOMIAL
[../]
[./df10]
order = CONSTANT
family = MONOMIAL
[../]
[./df11]
order = CONSTANT
family = MONOMIAL
[../]
[./unique_grains]
order = CONSTANT
family = MONOMIAL
[../]
[./var_indices]
order = CONSTANT
family = MONOMIAL
[../]
[./centroids]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./bnds]
type = BndsCalcAux
variable = bnds
var_name_base = eta
op_num = 2
v = 'eta0 eta1'
[../]
[./df01]
type = MaterialStdVectorRealGradientAux
variable = df01
index = 0
component = 1
property = force_density
[../]
[./df11]
type = MaterialStdVectorRealGradientAux
variable = df11
index = 1
component = 1
property = force_density
[../]
[./df00]
type = MaterialStdVectorRealGradientAux
variable = df00
index = 0
component = 0
property = force_density
[../]
[./df10]
type = MaterialStdVectorRealGradientAux
variable = df10
index = 1
component = 0
property = force_density
[../]
[./unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_center
field_display = UNIQUE_REGION
execute_on = 'initial timestep_end'
[../]
[./var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_center
field_display = VARIABLE_COLORING
execute_on = 'initial timestep_end'
[../]
[./centroids]
type = FeatureFloodCountAux
variable = centroids
execute_on = 'initial timestep_end'
field_display = CENTROID
flood_counter = grain_center
[../]
[]
[ICs]
[./ic_eta0]
int_width = 1.0
x1 = 20.0
y1 = 0.0
radius = 14.0
outvalue = 0.0
variable = eta0
invalue = 1.0
type = SmoothCircleIC
[../]
[./IC_eta1]
int_width = 1.0
x1 = 30.0
y1 = 25.0
radius = 14.0
outvalue = 0.0
variable = eta1
invalue = 1.0
type = SmoothCircleIC
[../]
[./ic_c]
type = SpecifiedSmoothCircleIC
invalue = 1.0
outvalue = 0.1
int_width = 1.0
x_positions = '20.0 30.0 '
z_positions = '0.0 0.0 '
y_positions = '0.0 25.0 '
radii = '14.0 14.0'
3D_spheres = false
variable = c
block = 0
[../]
[]
[VectorPostprocessors]
[./forces]
type = GrainForcesPostprocessor
grain_force = grain_force
[../]
[./grain_volumes]
type = FeatureVolumeVectorPostprocessor
flood_counter = grain_center
execute_on = 'initial timestep_begin'
[../]
[]
[UserObjects]
[./grain_center]
type = FauxGrainTracker
outputs = none
compute_var_to_feature_map = true
execute_on = 'initial timestep_begin'
variable = 'eta0 eta1'
[../]
[./grain_force]
type = ComputeGrainForceAndTorque
execute_on = 'linear nonlinear'
grain_data = grain_center
force_density = force_density
c = c
etas = 'eta0 eta1'
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly lu 1'
l_max_its = 30
l_tol = 1.0e-4
nl_rel_tol = 1.0e-10
start_time = 0.0
num_steps = 1
dt = 0.1
[]
[Outputs]
exodus = true
csv = true
[]
(modules/phase_field/tutorials/spinodal_decomposition/s4_mobility.i)
#
# Example simulation of an iron-chromium alloy at 500 C. Equilibrium
# concentrations are at 23.6 and 82.3 mol% Cr. Kappa value, free energy equation,
# and mobility equation were provided by Lars Hoglund. Solved using the split
# form of the Cahn-Hilliard equation.
#
[Mesh]
type = GeneratedMesh
dim = 2
elem_type = QUAD4
nx = 25
ny = 25
nz = 0
xmin = 0
xmax = 25
ymin = 0
ymax = 25
zmin = 0
zmax = 0
uniform_refine = 2
[]
[Variables]
[./c] # Mole fraction of Cr (unitless)
order = FIRST
family = LAGRANGE
[../]
[./w] # Chemical potential (eV/mol)
order = FIRST
family = LAGRANGE
[../]
[]
[ICs]
[./concentrationIC] # 46.774 mol% Cr with variations
type = RandomIC
min = 0.44774
max = 0.48774
seed = 210
variable = c
[../]
[]
[BCs]
[./Periodic]
[./c_bcs]
auto_direction = 'x y'
[../]
[../]
[]
[Kernels]
[./w_dot]
variable = w
v = c
type = CoupledTimeDerivative
[../]
[./coupled_res]
variable = w
type = SplitCHWRes
mob_name = M
[../]
[./coupled_parsed]
variable = c
type = SplitCHParsed
f_name = f_loc
kappa_name = kappa_c
w = w
[../]
[]
[Materials]
# d is a scaling factor that makes it easier for the solution to converge
# without changing the results. It is defined in each of the first three
# materials and must have the same value in each one.
[./kappa] # Gradient energy coefficient (eV nm^2/mol)
type = GenericFunctionMaterial
prop_names = 'kappa_c'
prop_values = '8.125e-16*6.24150934e+18*1e+09^2*1e-27'
# kappa_c *eV_J*nm_m^2* d
[../]
[./mobility] # Mobility (nm^2 mol/eV/s)
# NOTE: This is a fitted equation, so only 'Conv' has units
type = DerivativeParsedMaterial
property_name = M
coupled_variables = c
constant_names = 'Acr Bcr Ccr Dcr
Ecr Fcr Gcr
Afe Bfe Cfe Dfe
Efe Ffe Gfe
nm_m eV_J d'
constant_expressions = '-32.770969 -25.8186669 -3.29612744 17.669757
37.6197853 20.6941796 10.8095813
-31.687117 -26.0291774 0.2286581 24.3633544
44.3334237 8.72990497 20.956768
1e+09 6.24150934e+18 1e-27'
expression = 'nm_m^2/eV_J/d*((1-c)^2*c*10^
(Acr*c+Bcr*(1-c)+Ccr*c*log(c)+Dcr*(1-c)*log(1-c)+
Ecr*c*(1-c)+Fcr*c*(1-c)*(2*c-1)+Gcr*c*(1-c)*(2*c-1)^2)
+c^2*(1-c)*10^
(Afe*c+Bfe*(1-c)+Cfe*c*log(c)+Dfe*(1-c)*log(1-c)+
Efe*c*(1-c)+Ffe*c*(1-c)*(2*c-1)+Gfe*c*(1-c)*(2*c-1)^2))'
derivative_order = 1
outputs = exodus
[../]
[./local_energy] # Local free energy function (eV/mol)
type = DerivativeParsedMaterial
property_name = f_loc
coupled_variables = c
constant_names = 'A B C D E F G eV_J d'
constant_expressions = '-2.446831e+04 -2.827533e+04 4.167994e+03 7.052907e+03
1.208993e+04 2.568625e+03 -2.354293e+03
6.24150934e+18 1e-27'
expression = 'eV_J*d*(A*c+B*(1-c)+C*c*log(c)+D*(1-c)*log(1-c)+
E*c*(1-c)+F*c*(1-c)*(2*c-1)+G*c*(1-c)*(2*c-1)^2)'
derivative_order = 2
[../]
[./precipitate_indicator] # Returns 1/625 if precipitate
type = ParsedMaterial
property_name = prec_indic
coupled_variables = c
expression = if(c>0.6,0.0016,0)
[../]
[]
[Postprocessors]
[./step_size] # Size of the time step
type = TimestepSize
[../]
[./iterations] # Number of iterations needed to converge timestep
type = NumNonlinearIterations
[../]
[./nodes] # Number of nodes in mesh
type = NumNodes
[../]
[./evaluations] # Cumulative residual calculations for simulation
type = NumResidualEvaluations
[../]
[./precipitate_area] # Fraction of surface devoted to precipitates
type = ElementIntegralMaterialProperty
mat_prop = prec_indic
[../]
[./active_time] # Time computer spent on simulation
type = PerfGraphData
section_name = "Root"
data_type = total
[../]
[]
[Preconditioning]
[./coupled]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
l_max_its = 30
l_tol = 1e-6
nl_max_its = 50
nl_abs_tol = 1e-9
end_time = 604800 # 7 days
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type
-sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly
ilu 1'
[./TimeStepper]
type = IterationAdaptiveDT
dt = 10
cutback_factor = 0.8
growth_factor = 1.5
optimal_iterations = 7
[../]
[./Adaptivity]
coarsen_fraction = 0.1
refine_fraction = 0.7
max_h_level = 2
[../]
[]
[Debug]
show_var_residual_norms = true
[]
[Outputs]
exodus = true
console = true
csv = true
[./console]
type = Console
max_rows = 10
[../]
[]
(modules/phase_field/test/tests/phase_field_kernels/SplitCHWRes.i)
#
# Test the split parsed function free enery Cahn-Hilliard Bulk kernel
# with two concentration variables and coupling through off-diagonal Onsager
# matrix coefficients
#
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmin = 0
xmax = 60
ymin = 0
ymax = 60
elem_type = QUAD4
[]
[Variables]
[./c1]
[./InitialCondition]
type = FunctionIC
function = 'cos(x/60*pi)'
[../]
[../]
[./c2]
[./InitialCondition]
type = FunctionIC
function = 'cos(y/60*pi)'
[../]
[../]
[./w1]
[../]
[./w2]
[../]
[]
[Kernels]
[./c1_res]
type = SplitCHParsed
variable = c1
f_name = F
kappa_name = kappa_c
w = w1
[../]
[./w11_res]
type = SplitCHWRes
variable = w1
mob_name = M11
[../]
[./w12_res]
type = SplitCHWRes
variable = w1
w = w2
mob_name = M12
[../]
[./c2_res]
type = SplitCHParsed
variable = c2
f_name = F
kappa_name = kappa_c
w = w2
[../]
[./w22_res]
type = SplitCHWRes
variable = w2
mob_name = M22
[../]
[./w21_res]
type = SplitCHWRes
variable = w2
w = w1
mob_name = M21
[../]
[./time1]
type = CoupledTimeDerivative
variable = w1
v = c1
[../]
[./time2]
type = CoupledTimeDerivative
variable = w2
v = c2
[../]
[]
[Materials]
[./pfmobility]
type = GenericConstantMaterial
prop_names = 'M11 M12 M21 M22 kappa_c'
prop_values = '10 2.5 20 5 40'
[../]
[./free_energy]
# equivalent to `MathFreeEnergy`
type = DerivativeParsedMaterial
property_name = F
coupled_variables = 'c1 c2'
expression = '0.25*(1+c1)^2*(1-c1)^2 + 0.25*(1+c2)^2*(1-c2)^2'
derivative_order = 2
[../]
[]
[Preconditioning]
# active = ' '
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = 'NEWTON'
petsc_options_iname = -pc_type
petsc_options_value = lu
l_max_its = 30
l_tol = 1.0e-4
nl_rel_tol = 1.0e-10
start_time = 0.0
num_steps = 2
dt = 10
[]
[Outputs]
exodus = true
[]
(modules/phase_field/test/tests/SoretDiffusion/split_temp.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 60
xmax = 500
elem_type = EDGE
[]
[GlobalParams]
polynomial_order = 8
[]
[Variables]
[./c]
[../]
[./w]
scaling = 1.0e2
[../]
[./T]
initial_condition = 1000.0
scaling = 1.0e5
[../]
[]
[ICs]
[./c_IC]
type = SmoothCircleIC
x1 = 125.0
y1 = 0.0
radius = 60.0
invalue = 1.0
outvalue = 0.1
int_width = 100.0
variable = c
[../]
[]
[Kernels]
[./c_res]
type = SplitCHParsed
variable = c
kappa_name = kappa
w = w
f_name = F
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./w_res_soret]
type = SoretDiffusion
variable = w
c = c
T = T
diff_name = D
Q_name = Qstar
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[./HtCond]
type = MatDiffusion
variable = T
diffusivity = thermal_conductivity
[../]
[]
[BCs]
[./Left_T]
type = DirichletBC
variable = T
boundary = left
value = 1000.0
[../]
[./Right_T]
type = DirichletBC
variable = T
boundary = right
value = 1015.0
[../]
[]
[Materials]
[./Copper]
type = PFParamsPolyFreeEnergy
block = 0
c = c
T = T # K
int_width = 60.0
length_scale = 1.0e-9
time_scale = 1.0e-9
D0 = 3.1e-5 # m^2/s, from Brown1980
Em = 0.71 # in eV, from Balluffi1978 Table 2
Ef = 1.28 # in eV, from Balluffi1978 Table 2
surface_energy = 0.708 # Total guess
[../]
[./thcond]
type = ParsedMaterial
block = 0
coupled_variables = 'c'
expression = 'if(c>0.7,1e-8,4e-8)'
property_name = thermal_conductivity
outputs = exodus
[../]
[./free_energy]
type = PolynomialFreeEnergy
block = 0
c = c
derivative_order = 2
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
solve_type = 'PJFNK'
l_max_its = 30
l_tol = 1.0e-4
nl_max_its = 25
nl_rel_tol = 1.0e-9
num_steps = 60
dt = 20.0
[]
[Outputs]
exodus = true
[]
(modules/phase_field/test/tests/rigidbodymotion/grain_forcesum.i)
# test file for showing summing forces and torques obtained from other userobjects
[GlobalParams]
var_name_base = eta
op_num = 2
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 3
nz = 0
xmax = 50
ymax = 25
zmax = 0
elem_type = QUAD4
[]
[Variables]
[./c]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = SpecifiedSmoothCircleIC
invalue = 1.0
outvalue = 0.1
int_width = 6.0
x_positions = '20.0 30.0 '
z_positions = '0.0 0.0 '
y_positions = '0.0 25.0 '
radii = '14.0 14.0'
3D_spheres = false
variable = c
[../]
[../]
[./w]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
w = w
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[]
[Materials]
[./pfmobility]
type = GenericConstantMaterial
prop_names = 'M kappa_c kappa_eta'
prop_values = '5.0 2.0 0.1'
[../]
[./free_energy]
type = DerivativeParsedMaterial
property_name = F
coupled_variables = c
constant_names = 'barr_height cv_eq'
constant_expressions = '0.1 1.0e-2'
expression = 16*barr_height*(c-cv_eq)^2*(1-cv_eq-c)^2
derivative_order = 2
[../]
[./force_density]
type = ForceDensityMaterial
c = c
etas ='eta0 eta1'
[../]
[]
[AuxVariables]
[./eta0]
[../]
[./eta1]
[../]
[./bnds]
[../]
[./df00]
order = CONSTANT
family = MONOMIAL
[../]
[./df01]
order = CONSTANT
family = MONOMIAL
[../]
[./df10]
order = CONSTANT
family = MONOMIAL
[../]
[./df11]
order = CONSTANT
family = MONOMIAL
[../]
[]
[ICs]
[./ic_eta0]
int_width = 6.0
x1 = 20.0
y1 = 0.0
radius = 14.0
outvalue = 0.0
variable = eta0
invalue = 1.0
type = SmoothCircleIC
[../]
[./IC_eta1]
int_width = 6.0
x1 = 30.0
y1 = 25.0
radius = 14.0
outvalue = 0.0
variable = eta1
invalue = 1.0
type = SmoothCircleIC
[../]
[]
[VectorPostprocessors]
[./forces_dns]
type = GrainForcesPostprocessor
grain_force = grain_force_dns
[../]
[./forces_cosnt]
type = GrainForcesPostprocessor
grain_force = grain_force_const
[../]
[./forces_total]
type = GrainForcesPostprocessor
grain_force = grain_force
[../]
[]
[UserObjects]
[./grain_center]
type = GrainTracker
outputs = none
compute_var_to_feature_map = true
execute_on = 'initial timestep_begin'
[../]
[./grain_force_dns]
type = ComputeGrainForceAndTorque
c = c
etas = 'eta0 eta1'
execute_on = 'linear nonlinear'
grain_data = grain_center
force_density = force_density
[../]
[./grain_force_const]
type = ConstantGrainForceAndTorque
execute_on = 'linear nonlinear'
force = '2.0 0.0 0.0 0.0 0.0 0.0'
torque = '0.0 0.0 0.0 0.0 0.0 0.0'
[../]
[./grain_force]
type = GrainForceAndTorqueSum
execute_on = 'linear nonlinear'
grain_forces = 'grain_force_dns grain_force_const'
grain_num = 2
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly lu 1'
l_max_its = 20
nl_max_its = 20
l_tol = 1.0e-4
nl_rel_tol = 1.0e-10
start_time = 0.0
num_steps = 2
dt = 0.1
[]
[Outputs]
exodus = true
csv = true
[]
(modules/phase_field/test/tests/rigidbodymotion/grain_appliedforcedensity.i)
# test file for showing grain motion due to applied force density on grains
[GlobalParams]
var_name_base = eta
op_num = 2
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 25
ny = 10
nz = 0
xmax = 50
ymax = 25
zmax = 0
elem_type = QUAD4
[]
[Variables]
[./c]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = SpecifiedSmoothCircleIC
invalue = 1.0
outvalue = 0.1
int_width = 6.0
x_positions = '20.0 30.0 '
z_positions = '0.0 0.0 '
y_positions = '0.0 25.0 '
radii = '14.0 14.0'
3D_spheres = false
variable = c
[../]
[../]
[./w]
order = FIRST
family = LAGRANGE
[../]
[]
[Functions]
[./load]
type = ConstantFunction
value = 0.01
[../]
[]
[Kernels]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
w = w
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[./motion]
type = MultiGrainRigidBodyMotion
variable = w
c = c
v = 'eta0 eta1'
grain_tracker_object = grain_center
grain_force = grain_force
grain_volumes = grain_volumes
[../]
[]
[Materials]
[./pfmobility]
type = GenericConstantMaterial
prop_names = 'M kappa_c kappa_eta'
prop_values = '5.0 2.0 0.1'
[../]
[./free_energy]
type = DerivativeParsedMaterial
property_name = F
coupled_variables = c
constant_names = 'barr_height cv_eq'
constant_expressions = '0.1 1.0e-2'
expression = 16*barr_height*(c-cv_eq)^2*(1-cv_eq-c)^2
derivative_order = 2
[../]
[./force_density_ext]
type = ExternalForceDensityMaterial
c = c
etas = 'eta0 eta1'
k = 1.0
force_y = load
[../]
[]
[AuxVariables]
[./eta0]
[../]
[./eta1]
[../]
[./bnds]
[../]
[]
[AuxKernels]
[./bnds]
type = BndsCalcAux
variable = bnds
var_name_base = eta
op_num = 2
v = 'eta0 eta1'
[../]
[]
[ICs]
[./ic_eta0]
int_width = 6.0
x1 = 20.0
y1 = 0.0
radius = 14.0
outvalue = 0.0
variable = eta0
invalue = 1.0
type = SmoothCircleIC
[../]
[./IC_eta1]
int_width = 6.0
x1 = 30.0
y1 = 25.0
radius = 14.0
outvalue = 0.0
variable = eta1
invalue = 1.0
type = SmoothCircleIC
[../]
[]
[VectorPostprocessors]
[./forces]
type = GrainForcesPostprocessor
grain_force = grain_force
[../]
[./grain_volumes]
type = FeatureVolumeVectorPostprocessor
flood_counter = grain_center
execute_on = 'initial timestep_begin'
[../]
[]
[UserObjects]
[./grain_center]
type = GrainTracker
outputs = none
compute_var_to_feature_map = true
execute_on = 'initial timestep_begin'
[../]
[./grain_force]
type = ComputeExternalGrainForceAndTorque
execute_on = 'linear nonlinear'
grain_data = grain_center
c = c
etas = 'eta0 eta1'
force_density = force_density_ext
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly lu 1'
l_max_its = 30
l_tol = 1.0e-4
nl_rel_tol = 1.0e-10
start_time = 0.0
num_steps = 1
dt = 0.1
[]
[Outputs]
exodus = true
csv = true
[]
(modules/combined/examples/mortar/eigenstrain.i)
#
# Eigenstrain with Mortar gradient periodicity
#
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 50
ny = 50
xmin = -0.5
xmax = 0.5
ymin = -0.5
ymax = 0.5
[]
[./cnode]
input = gen
type = ExtraNodesetGenerator
coord = '0.0 0.0'
new_boundary = 100
[../]
[./anode]
input = cnode
type = ExtraNodesetGenerator
coord = '0.0 0.5'
new_boundary = 101
[../]
[secondary_x]
input = anode
type = LowerDBlockFromSidesetGenerator
sidesets = '3'
new_block_id = 10
new_block_name = "secondary_x"
[]
[primary_x]
input = secondary_x
type = LowerDBlockFromSidesetGenerator
sidesets = '1'
new_block_id = 12
new_block_name = "primary_x"
[]
[secondary_y]
input = primary_x
type = LowerDBlockFromSidesetGenerator
sidesets = '0'
new_block_id = 11
new_block_name = "secondary_y"
[]
[primary_y]
input = secondary_y
type = LowerDBlockFromSidesetGenerator
sidesets = '2'
new_block_id = 13
new_block_name = "primary_y"
[]
[]
[GlobalParams]
derivative_order = 2
enable_jit = true
displacements = 'disp_x disp_y'
[]
# AuxVars to compute the free energy density for outputting
[AuxVariables]
[./local_energy]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./local_free_energy]
type = TotalFreeEnergy
block = 0
execute_on = 'initial LINEAR'
variable = local_energy
interfacial_vars = 'c'
kappa_names = 'kappa_c'
[../]
[]
[Variables]
# Solute concentration variable
[./c]
[./InitialCondition]
type = RandomIC
min = 0.49
max = 0.51
[../]
block = 0
[../]
[./w]
block = 0
[../]
# Mesh displacement
[./disp_x]
block = 0
[../]
[./disp_y]
block = 0
[../]
# Lagrange multipliers for gradient component periodicity
[./lm_left_right_xx]
order = FIRST
family = LAGRANGE
block = secondary_x
[../]
[./lm_left_right_xy]
order = FIRST
family = LAGRANGE
block = secondary_x
[../]
[./lm_left_right_yx]
order = FIRST
family = LAGRANGE
block = secondary_x
[../]
[./lm_left_right_yy]
order = FIRST
family = LAGRANGE
block = secondary_x
[../]
[./lm_up_down_xx]
order = FIRST
family = LAGRANGE
block = secondary_y
[../]
[./lm_up_down_xy]
order = FIRST
family = LAGRANGE
block = secondary_y
[../]
[./lm_up_down_yx]
order = FIRST
family = LAGRANGE
block = secondary_y
[../]
[./lm_up_down_yy]
order = FIRST
family = LAGRANGE
block = secondary_y
[../]
[]
[Constraints]
[./ud_disp_x_grad_x]
type = EqualGradientConstraint
variable = lm_up_down_xx
component = 0
secondary_variable = disp_x
secondary_boundary = bottom
primary_boundary = top
secondary_subdomain = secondary_y
primary_subdomain = primary_y
periodic = true
[../]
[./ud_disp_x_grad_y]
type = EqualGradientConstraint
variable = lm_up_down_xy
component = 1
secondary_variable = disp_x
secondary_boundary = bottom
primary_boundary = top
secondary_subdomain = secondary_y
primary_subdomain = primary_y
periodic = true
[../]
[./ud_disp_y_grad_x]
type = EqualGradientConstraint
variable = lm_up_down_yx
component = 0
secondary_variable = disp_y
secondary_boundary = bottom
primary_boundary = top
secondary_subdomain = secondary_y
primary_subdomain = primary_y
periodic = true
[../]
[./ud_disp_y_grad_y]
type = EqualGradientConstraint
variable = lm_up_down_yy
component = 1
secondary_variable = disp_y
secondary_boundary = bottom
primary_boundary = top
secondary_subdomain = secondary_y
primary_subdomain = primary_y
periodic = true
[../]
[./lr_disp_x_grad_x]
type = EqualGradientConstraint
variable = lm_left_right_xx
component = 0
secondary_variable = disp_x
secondary_boundary = left
primary_boundary = right
secondary_subdomain = secondary_x
primary_subdomain = primary_x
periodic = true
[../]
[./lr_disp_x_grad_y]
type = EqualGradientConstraint
variable = lm_left_right_xy
component = 1
secondary_variable = disp_x
secondary_boundary = left
primary_boundary = right
secondary_subdomain = secondary_x
primary_subdomain = primary_x
periodic = true
[../]
[./lr_disp_y_grad_x]
type = EqualGradientConstraint
variable = lm_left_right_yx
component = 0
secondary_variable = disp_y
secondary_boundary = left
primary_boundary = right
secondary_subdomain = secondary_x
primary_subdomain = primary_x
periodic = true
[../]
[./lr_disp_y_grad_y]
type = EqualGradientConstraint
variable = lm_left_right_yy
component = 1
secondary_variable = disp_y
secondary_boundary = left
primary_boundary = right
secondary_subdomain = secondary_x
primary_subdomain = primary_x
periodic = true
[../]
[]
[Kernels]
# Set up stress divergence kernels
[./TensorMechanics]
block = 0
[../]
# Cahn-Hilliard kernels
[./c_dot]
type = CoupledTimeDerivative
variable = w
v = c
block = 0
[../]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
w = w
block = 0
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
block = 0
[../]
[]
[Materials]
# declare a few constants, such as mobilities (L,M) and interface gradient prefactors (kappa*)
[./consts]
type = GenericConstantMaterial
block = '0 10 11'
prop_names = 'M kappa_c'
prop_values = '0.2 0.01 '
[../]
[./shear1]
type = GenericConstantRankTwoTensor
block = 0
tensor_values = '0 0 0 0 0 0.5'
tensor_name = shear1
[../]
[./shear2]
type = GenericConstantRankTwoTensor
block = 0
tensor_values = '0 0 0 0 0 -0.5'
tensor_name = shear2
[../]
[./expand3]
type = GenericConstantRankTwoTensor
block = 0
tensor_values = '1 1 0 0 0 0'
tensor_name = expand3
[../]
[./weight1]
type = DerivativeParsedMaterial
block = 0
expression = '0.3*c^2'
property_name = weight1
coupled_variables = c
[../]
[./weight2]
type = DerivativeParsedMaterial
block = 0
expression = '0.3*(1-c)^2'
property_name = weight2
coupled_variables = c
[../]
[./weight3]
type = DerivativeParsedMaterial
block = 0
expression = '4*(0.5-c)^2'
property_name = weight3
coupled_variables = c
[../]
# matrix phase
[./elasticity_tensor]
type = ComputeElasticityTensor
block = 0
C_ijkl = '1 1'
fill_method = symmetric_isotropic
[../]
[./strain]
type = ComputeSmallStrain
block = 0
displacements = 'disp_x disp_y'
eigenstrain_names = eigenstrain
[../]
[./eigenstrain]
type = CompositeEigenstrain
block = 0
tensors = 'shear1 shear2 expand3'
weights = 'weight1 weight2 weight3'
args = c
eigenstrain_name = eigenstrain
[../]
[./stress]
type = ComputeLinearElasticStress
block = 0
[../]
# chemical free energies
[./chemical_free_energy]
type = DerivativeParsedMaterial
block = 0
property_name = Fc
expression = '4*c^2*(1-c)^2'
coupled_variables = 'c'
outputs = exodus
output_properties = Fc
[../]
# elastic free energies
[./elastic_free_energy]
type = ElasticEnergyMaterial
f_name = Fe
block = 0
args = 'c'
outputs = exodus
output_properties = Fe
[../]
# free energy (chemical + elastic)
[./free_energy]
type = DerivativeSumMaterial
block = 0
property_name = F
sum_materials = 'Fc Fe'
coupled_variables = 'c'
[../]
[]
[BCs]
[./Periodic]
[./up_down]
primary = top
secondary = bottom
translation = '0 -1 0'
variable = 'c w'
[../]
[./left_right]
primary = left
secondary = right
translation = '1 0 0'
variable = 'c w'
[../]
[../]
# fix center point location
[./centerfix_x]
type = DirichletBC
boundary = 100
variable = disp_x
value = 0
[../]
[./centerfix_y]
type = DirichletBC
boundary = 100
variable = disp_y
value = 0
[../]
# fix side point x coordinate to inhibit rotation
[./angularfix]
type = DirichletBC
boundary = 101
variable = disp_x
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
block = 0
execute_on = 'initial TIMESTEP_END'
variable = local_energy
[../]
[./total_solute]
type = ElementIntegralVariablePostprocessor
block = 0
execute_on = 'initial TIMESTEP_END'
variable = c
[../]
[./min]
type = ElementExtremeValue
block = 0
execute_on = 'initial TIMESTEP_END'
value_type = min
variable = c
[../]
[./max]
type = ElementExtremeValue
block = 0
execute_on = 'initial TIMESTEP_END'
value_type = max
variable = c
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = 'PJFNK'
line_search = basic
# mortar currently does not support MPI parallelization
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = ' lu NONZERO 1e-10'
l_max_its = 30
nl_max_its = 12
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.01
[../]
[]
[Outputs]
execute_on = 'timestep_end'
print_linear_residuals = false
exodus = true
[./table]
type = CSV
delimiter = ' '
[../]
[]
(modules/combined/examples/publications/rapid_dev/fig7a.i)
#
# Fig. 7 input for 10.1016/j.commatsci.2017.02.017
# D. Schwen et al./Computational Materials Science 132 (2017) 36-45
# Solid gray curve (1)
# Eigenstrain and elastic energies ar computed per phase and then interpolated.
# Supply the RADIUS parameter (10-35) on the command line to generate data
# for all curves in the plot.
#
[Mesh]
type = GeneratedMesh
dim = 1
nx = 32
xmin = 0
xmax = 100
second_order = true
[]
[Problem]
coord_type = RSPHERICAL
[]
[GlobalParams]
displacements = 'disp_r'
[]
[Functions]
[./diff]
type = ParsedFunction
expression = '${RADIUS}-pos_c'
symbol_names = pos_c
symbol_values = pos_c
[../]
[]
# 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'
execute_on = 'INITIAL TIMESTEP_END'
[../]
[]
[Variables]
# Solute concentration variable
[./c]
[./InitialCondition]
type = SmoothCircleIC
invalue = 1
outvalue = 0
x1 = 0
y1 = 0
radius = ${RADIUS}
int_width = 3
[../]
[../]
[./w]
[../]
# Phase order parameter
[./eta]
[./InitialCondition]
type = SmoothCircleIC
invalue = 1
outvalue = 0
x1 = 0
y1 = 0
radius = ${RADIUS}
int_width = 3
[../]
[../]
# Mesh displacement
[./disp_r]
order = SECOND
[../]
[./Fe_fit]
order = SECOND
[../]
[]
[Kernels]
# Set up stress divergence kernels
[./TensorMechanics]
[../]
# Split Cahn-Hilliard kernels
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
args = 'eta'
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
[./detadt]
type = TimeDerivative
variable = eta
[../]
[./ACBulk1]
type = AllenCahn
variable = eta
args = 'c'
mob_name = L
f_name = F
[../]
[./ACInterface]
type = ACInterface
variable = eta
mob_name = L
kappa_name = kappa_eta
[../]
[./Fe]
type = MaterialPropertyValue
prop_name = Fe
variable = Fe_fit
[../]
[./autoadjust]
type = MaskedBodyForce
variable = w
function = diff
mask = mask
[../]
[]
[Materials]
# declare a few constants, such as mobilities (L,M) and interface gradient prefactors (kappa*)
[./consts]
type = GenericConstantMaterial
prop_names = 'M L kappa_c kappa_eta'
prop_values = '1.0 1.0 0.5 1'
[../]
# forcing function mask
[./mask]
type = ParsedMaterial
property_name = mask
expression = grad/dt
material_property_names = 'grad dt'
[../]
[./grad]
type = VariableGradientMaterial
variable = c
prop = grad
[../]
[./time]
type = TimeStepMaterial
[../]
# global mechanical properties
[./elasticity_tensor_1]
type = ComputeElasticityTensor
C_ijkl = '1 1'
base_name = phase1
fill_method = symmetric_isotropic
[../]
[./elasticity_tensor_2]
type = ComputeElasticityTensor
C_ijkl = '1 1'
base_name = phase2
fill_method = symmetric_isotropic
[../]
[./strain_1]
type = ComputeRSphericalSmallStrain
base_name = phase1
[../]
[./strain_2]
type = ComputeRSphericalSmallStrain
base_name = phase2
eigenstrain_names = eigenstrain
[../]
[./stress_1]
type = ComputeLinearElasticStress
base_name = phase1
[../]
[./stress_2]
type = ComputeLinearElasticStress
base_name = phase2
[../]
# eigenstrain per phase
[./eigenstrain2]
type = ComputeEigenstrain
eigen_base = '0.05 0.05 0.05 0 0 0'
base_name = phase2
eigenstrain_name = eigenstrain
[../]
# switching functions
[./switching]
type = SwitchingFunctionMaterial
function_name = h
eta = eta
h_order = SIMPLE
[../]
[./barrier]
type = BarrierFunctionMaterial
eta = eta
[../]
# chemical free energies
[./chemical_free_energy_1]
type = DerivativeParsedMaterial
property_name = Fc1
expression = 'c^2'
coupled_variables = 'c'
derivative_order = 2
[../]
[./chemical_free_energy_2]
type = DerivativeParsedMaterial
property_name = Fc2
expression = '(1-c)^2'
coupled_variables = 'c'
derivative_order = 2
[../]
# elastic free energies
[./elastic_free_energy_1]
type = ElasticEnergyMaterial
f_name = Fe1
args = ''
base_name = phase1
derivative_order = 2
[../]
[./elastic_free_energy_2]
type = ElasticEnergyMaterial
f_name = Fe2
args = ''
base_name = phase2
derivative_order = 2
[../]
# per phase free energies
[./free_energy_1]
type = DerivativeSumMaterial
property_name = F1
sum_materials = 'Fc1 Fe1'
coupled_variables = 'c'
derivative_order = 2
[../]
[./free_energy_2]
type = DerivativeSumMaterial
property_name = F2
sum_materials = 'Fc2 Fe2'
coupled_variables = 'c'
derivative_order = 2
[../]
# global chemical free energy
[./global_free_energy]
type = DerivativeTwoPhaseMaterial
f_name = F
fa_name = F1
fb_name = F2
eta = eta
args = 'c'
W = 4
[../]
# global stress
[./global_stress]
type = TwoPhaseStressMaterial
base_A = phase1
base_B = phase2
[../]
[./elastic_free_energy]
type = DerivativeTwoPhaseMaterial
f_name = Fe
fa_name = Fe1
fb_name = Fe2
eta = eta
args = 'c'
W = 0
[../]
[]
[BCs]
[./left_r]
type = DirichletBC
variable = disp_r
boundary = 'left'
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'
outputs = 'table console'
[../]
[./total_solute]
type = ElementIntegralVariablePostprocessor
variable = c
execute_on = 'INITIAL TIMESTEP_END'
outputs = 'table console'
[../]
[./pos_c]
type = FindValueOnLine
start_point = '0 0 0'
end_point = '100 0 0'
v = c
target = 0.582
tol = 1e-8
execute_on = 'INITIAL TIMESTEP_END'
outputs = 'table console'
[../]
[./pos_eta]
type = FindValueOnLine
start_point = '0 0 0'
end_point = '100 0 0'
v = eta
target = 0.5
tol = 1e-8
execute_on = 'INITIAL TIMESTEP_END'
outputs = 'table console'
[../]
[./c_min]
type = ElementExtremeValue
value_type = min
variable = c
execute_on = 'INITIAL TIMESTEP_END'
outputs = 'table console'
[../]
[]
[VectorPostprocessors]
[./line]
type = LineValueSampler
variable = 'Fe_fit c w'
start_point = '0 0 0'
end_point = '100 0 0'
num_points = 5000
sort_by = x
outputs = vpp
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 = 15
l_tol = 1.0e-4
nl_rel_tol = 1.0e-8
nl_abs_tol = 2.0e-9
start_time = 0.0
end_time = 100000.0
[./TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 7
iteration_window = 1
dt = 1
[../]
[./Adaptivity]
initial_adaptivity = 5
interval = 10
max_h_level = 5
refine_fraction = 0.9
coarsen_fraction = 0.1
[../]
[]
[Outputs]
print_linear_residuals = false
perf_graph = true
execute_on = 'INITIAL TIMESTEP_END'
[./table]
type = CSV
delimiter = ' '
file_base = radius_${RADIUS}/energy_pp
[../]
[./vpp]
type = CSV
delimiter = ' '
sync_times = '10 50 100 500 1000 5000 10000 50000 100000'
sync_only = true
time_data = true
file_base = radius_${RADIUS}/energy_vpp
[../]
[]
(modules/combined/examples/phase_field-mechanics/Conserved.i)
#
# Example 1
# Illustrating the coupling between chemical and mechanical (elastic) driving forces.
# An oversized precipitate deforms under a uniaxial compressive stress
# Check the file below for comments and suggestions for parameter modifications.
#
[Mesh]
type = GeneratedMesh
dim = 2
nx = 40
ny = 40
nz = 0
xmin = 0
xmax = 50
ymin = 0
ymax = 50
zmin = 0
zmax = 0
elem_type = QUAD4
[]
[Variables]
[./c]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = SmoothCircleIC
x1 = 0
y1 = 0
radius = 25.0
invalue = 1.0
outvalue = 0.0
int_width = 50.0
[../]
[../]
[./w]
order = FIRST
family = LAGRANGE
[../]
[./disp_x]
order = FIRST
family = LAGRANGE
[../]
[./disp_y]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./TensorMechanics]
displacements = 'disp_x disp_y'
[../]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
w = w
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[]
#
# The AuxVariables and AuxKernels below are added to visualize the xx and yy stress tensor components
#
[AuxVariables]
[./sigma11_aux]
order = CONSTANT
family = MONOMIAL
[../]
[./sigma22_aux]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./matl_sigma11]
type = RankTwoAux
rank_two_tensor = stress
index_i = 0
index_j = 0
variable = sigma11_aux
[../]
[./matl_sigma22]
type = RankTwoAux
rank_two_tensor = stress
index_i = 1
index_j = 1
variable = sigma22_aux
[../]
[]
[Materials]
[./pfmobility]
type = GenericConstantMaterial
prop_names = 'M kappa_c'
prop_values = '1 5'
block = 0
#kappa = 0.1
#mob = 1e-3
[../]
# simple chemical free energy with a miscibility gap
[./chemical_free_energy]
type = DerivativeParsedMaterial
block = 0
property_name = Fc
coupled_variables = 'c'
constant_names = 'barr_height cv_eq'
constant_expressions = '0.1 1.0e-2'
expression = 16*barr_height*(c-cv_eq)^2*(1-cv_eq-c)^2
enable_jit = true
derivative_order = 2
[../]
# undersized solute (voidlike)
[./elasticity_tensor]
type = ComputeElasticityTensor
block = 0
# lambda, mu values
C_ijkl = '7 7'
# Stiffness tensor is created from lambda=7, mu=7 using symmetric_isotropic fill method
fill_method = symmetric_isotropic
# See RankFourTensor.h for details on fill methods
# '15 15' results in a high stiffness (the elastic free energy will dominate)
# '7 7' results in a low stiffness (the chemical free energy will dominate)
[../]
[./stress]
type = ComputeLinearElasticStress
block = 0
[../]
[./var_dependence]
type = DerivativeParsedMaterial
block = 0
# eigenstrain coefficient
# -0.1 will result in an undersized precipitate
# 0.1 will result in an oversized precipitate
expression = 0.1*c
coupled_variables = c
f_name = var_dep
enable_jit = true
derivative_order = 2
[../]
[./eigenstrain]
type = ComputeVariableEigenstrain
block = 0
eigen_base = '1 1 1 0 0 0'
prefactor = var_dep
#outputs = exodus
args = 'c'
eigenstrain_name = eigenstrain
[../]
[./strain]
type = ComputeSmallStrain
block = 0
displacements = 'disp_x disp_y'
eigenstrain_names = eigenstrain
[../]
[./elastic_free_energy]
type = ElasticEnergyMaterial
f_name = Fe
block = 0
args = 'c'
derivative_order = 2
[../]
# Sum up chemical and elastic contributions
[./free_energy]
type = DerivativeSumMaterial
block = 0
property_name = F
sum_materials = 'Fc Fe'
coupled_variables = 'c'
derivative_order = 2
[../]
[]
[BCs]
[./bottom_y]
type = DirichletBC
variable = disp_y
boundary = 'bottom'
value = 0
[../]
[./top_y]
type = DirichletBC
variable = disp_y
boundary = 'top'
# prescribed displacement
# -5 will result in a compressive stress
# 5 will result in a tensile stress
value = -5
[../]
[./left_x]
type = DirichletBC
variable = disp_x
boundary = 'left'
value = 0
[../]
[]
[Preconditioning]
# active = ' '
[./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 = 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 = 1
[../]
[]
[Outputs]
exodus = true
[]
(modules/phase_field/tutorials/spinodal_decomposition/s1_testmodel.i)
#
# Simulation of an iron-chromium alloy using simplest possible code and a test
# set of initial conditions.
#
[Mesh]
# generate a 2D, 25nm x 25nm mesh
type = GeneratedMesh
dim = 2
elem_type = QUAD4
nx = 100
ny = 100
nz = 0
xmin = 0
xmax = 25
ymin = 0
ymax = 25
zmin = 0
zmax = 0
[]
[Variables]
[./c] # Mole fraction of Cr (unitless)
order = FIRST
family = LAGRANGE
[../]
[./w] # Chemical potential (eV/mol)
order = FIRST
family = LAGRANGE
[../]
[]
[ICs]
# Use a bounding box IC at equilibrium concentrations to make sure the
# model behaves as expected.
[./testIC]
type = BoundingBoxIC
variable = c
x1 = 5
x2 = 20
y1 = 5
y2 = 20
inside = 0.823
outside = 0.236
[../]
[]
[BCs]
# periodic BC as is usually done on phase-field models
[./Periodic]
[./c_bcs]
auto_direction = 'x y'
[../]
[../]
[]
[Kernels]
# See wiki page "Developing Phase Field Models" for more information on Split
# Cahn-Hilliard equation kernels.
# http://mooseframework.org/wiki/PhysicsModules/PhaseField/DevelopingModels/
[./w_dot]
variable = w
v = c
type = CoupledTimeDerivative
[../]
[./coupled_res]
variable = w
type = SplitCHWRes
mob_name = M
[../]
[./coupled_parsed]
variable = c
type = SplitCHParsed
f_name = f_loc
kappa_name = kappa_c
w = w
[../]
[]
[Materials]
# d is a scaling factor that makes it easier for the solution to converge
# without changing the results. It is defined in each of the materials and
# must have the same value in each one.
[./constants]
# Define constant values kappa_c and M. Eventually M will be replaced with
# an equation rather than a constant.
type = GenericFunctionMaterial
prop_names = 'kappa_c M'
prop_values = '8.125e-16*6.24150934e+18*1e+09^2*1e-27
2.2841e-26*1e+09^2/6.24150934e+18/1e-27'
# kappa_c*eV_J*nm_m^2*d
# M*nm_m^2/eV_J/d
[../]
[./local_energy]
# Defines the function for the local free energy density as given in the
# problem, then converts units and adds scaling factor.
type = DerivativeParsedMaterial
property_name = f_loc
coupled_variables = c
constant_names = 'A B C D E F G eV_J d'
constant_expressions = '-2.446831e+04 -2.827533e+04 4.167994e+03 7.052907e+03
1.208993e+04 2.568625e+03 -2.354293e+03
6.24150934e+18 1e-27'
expression = 'eV_J*d*(A*c+B*(1-c)+C*c*log(c)+D*(1-c)*log(1-c)+
E*c*(1-c)+F*c*(1-c)*(2*c-1)+G*c*(1-c)*(2*c-1)^2)'
[../]
[]
[Preconditioning]
# Preconditioning is required for Newton's method. See wiki page "Solving
# Phase Field Models" for more information.
# http://mooseframework.org/wiki/PhysicsModules/PhaseField/SolvingModels/
[./coupled]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
l_max_its = 30
l_tol = 1e-6
nl_max_its = 50
nl_abs_tol = 1e-9
end_time = 86400 # 1 day. We only need to run this long enough to verify
# the model is working properly.
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type
-sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly
ilu 1'
dt = 100
[]
[Outputs]
exodus = true
console = true
[]
(modules/phase_field/test/tests/phase_field_kernels/SplitCahnHilliard.i)
#
# Test the split parsed function free enery Cahn-Hilliard Bulk kernel
# The free energy used here has the same functional form as the SplitCHPoly kernel
# If everything works, the output of this test should replicate the output
# of marmot/tests/chpoly_test/CHPoly_Cu_Split_test.i (exodiff match)
#
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmin = 0
xmax = 60
ymin = 0
ymax = 60
elem_type = QUAD4
[]
[Variables]
[./c]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = SmoothCircleIC
x1 = 0
y1 = 0
radius = 30.0
invalue = 1.0
outvalue = -0.5
int_width = 30.0
[../]
[../]
[./w]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
w = w
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[]
[Materials]
[./pfmobility]
type = GenericConstantMaterial
prop_names = 'M kappa_c'
prop_values = '100 40'
[../]
[./free_energy]
# equivalent to `MathFreeEnergy`
type = DerivativeParsedMaterial
property_name = F
coupled_variables = 'c'
expression = '0.25*(1+c)^2*(1-c)^2'
derivative_order = 2
[../]
[]
[Preconditioning]
# active = ' '
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = 'NEWTON'
petsc_options_iname = -pc_type
petsc_options_value = lu
l_max_its = 30
l_tol = 1.0e-4
nl_rel_tol = 1.0e-10
start_time = 0.0
num_steps = 2
dt = 1
[]
[Outputs]
exodus = true
[]
(modules/combined/examples/publications/rapid_dev/fig7b.i)
#
# Fig. 7 input for 10.1016/j.commatsci.2017.02.017
# D. Schwen et al./Computational Materials Science 132 (2017) 36-45
# Dashed black curve (2)
# Eigenstrain is globally applied. Single global elastic free energies.
# Supply the RADIUS parameter (10-35) on the command line to generate data
# for all curves in the plot.
#
[Mesh]
type = GeneratedMesh
dim = 1
nx = 32
xmin = 0
xmax = 100
second_order = true
[]
[Problem]
coord_type = RSPHERICAL
[]
[GlobalParams]
displacements = 'disp_r'
[]
[Functions]
[./diff]
type = ParsedFunction
expression = '${RADIUS}-pos_c'
symbol_names = pos_c
symbol_values = pos_c
[../]
[]
# 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'
execute_on = 'INITIAL TIMESTEP_END'
[../]
[]
[Variables]
# Solute concentration variable
[./c]
[./InitialCondition]
type = SmoothCircleIC
invalue = 1
outvalue = 0
x1 = 0
y1 = 0
radius = ${RADIUS}
int_width = 3
[../]
[../]
[./w]
[../]
# Phase order parameter
[./eta]
[./InitialCondition]
type = SmoothCircleIC
invalue = 1
outvalue = 0
x1 = 0
y1 = 0
radius = ${RADIUS}
int_width = 3
[../]
[../]
[./Fe_fit]
order = SECOND
[../]
[]
[Modules/TensorMechanics/Master/all]
add_variables = true
eigenstrain_names = eigenstrain
[]
[Kernels]
# Split Cahn-Hilliard kernels
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
args = 'eta'
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
[./detadt]
type = TimeDerivative
variable = eta
[../]
[./ACBulk1]
type = AllenCahn
variable = eta
args = 'c'
mob_name = L
f_name = F
[../]
[./ACInterface]
type = ACInterface
variable = eta
mob_name = L
kappa_name = kappa_eta
[../]
[./Fe]
type = MaterialPropertyValue
prop_name = Fe
variable = Fe_fit
[../]
[./autoadjust]
type = MaskedBodyForce
variable = w
function = diff
mask = mask
[../]
[]
[Materials]
# declare a few constants, such as mobilities (L,M) and interface gradient prefactors (kappa*)
[./consts]
type = GenericConstantMaterial
prop_names = 'M L kappa_c kappa_eta'
prop_values = '1.0 1.0 0.5 1'
[../]
# forcing function mask
[./mask]
type = ParsedMaterial
property_name = mask
expression = grad/dt
material_property_names = 'grad dt'
[../]
[./grad]
type = VariableGradientMaterial
variable = c
prop = grad
[../]
[./time]
type = TimeStepMaterial
[../]
# global mechanical properties
[./elasticity_tensor]
type = ComputeElasticityTensor
C_ijkl = '1 1'
fill_method = symmetric_isotropic
[../]
[./stress]
type = ComputeLinearElasticStress
[../]
# eigenstrain as a function of phase
[./eigenstrain]
type = ComputeVariableEigenstrain
eigen_base = '0.05 0.05 0.05 0 0 0'
prefactor = h
args = eta
eigenstrain_name = eigenstrain
[../]
# switching functions
[./switching]
type = SwitchingFunctionMaterial
function_name = h
eta = eta
h_order = SIMPLE
[../]
[./barrier]
type = BarrierFunctionMaterial
eta = eta
[../]
# chemical free energies
[./chemical_free_energy_1]
type = DerivativeParsedMaterial
property_name = Fc1
expression = 'c^2'
coupled_variables = 'c'
derivative_order = 2
[../]
[./chemical_free_energy_2]
type = DerivativeParsedMaterial
property_name = Fc2
expression = '(1-c)^2'
coupled_variables = 'c'
derivative_order = 2
[../]
# global chemical free energy
[./chemical_free_energy]
type = DerivativeTwoPhaseMaterial
f_name = Fc
fa_name = Fc1
fb_name = Fc2
eta = eta
args = 'c'
W = 4
[../]
# global elastic free energy
[./elastic_free_energy]
type = ElasticEnergyMaterial
f_name = Fe
args = 'eta'
output_properties = Fe
derivative_order = 2
[../]
# free energy
[./free_energy]
type = DerivativeSumMaterial
property_name = F
sum_materials = 'Fc Fe'
coupled_variables = 'c eta'
derivative_order = 2
[../]
[]
[BCs]
[./left_r]
type = DirichletBC
variable = disp_r
boundary = 'left'
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'
outputs = 'table console'
[../]
[./total_solute]
type = ElementIntegralVariablePostprocessor
variable = c
execute_on = 'INITIAL TIMESTEP_END'
outputs = 'table console'
[../]
[./pos_c]
type = FindValueOnLine
start_point = '0 0 0'
end_point = '100 0 0'
v = c
target = 0.582
tol = 1e-8
execute_on = 'INITIAL TIMESTEP_END'
outputs = 'table console'
[../]
[./pos_eta]
type = FindValueOnLine
start_point = '0 0 0'
end_point = '100 0 0'
v = eta
target = 0.5
tol = 1e-8
execute_on = 'INITIAL TIMESTEP_END'
outputs = 'table console'
[../]
[./c_min]
type = ElementExtremeValue
value_type = min
variable = c
execute_on = 'INITIAL TIMESTEP_END'
outputs = 'table console'
[../]
[]
[VectorPostprocessors]
[./line]
type = LineValueSampler
variable = 'Fe_fit c w'
start_point = '0 0 0'
end_point = '100 0 0'
num_points = 5000
sort_by = x
outputs = vpp
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 = 15
l_tol = 1.0e-4
nl_rel_tol = 1.0e-8
nl_abs_tol = 2.0e-9
start_time = 0.0
end_time = 100000.0
[./TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 8
iteration_window = 1
dt = 1
[../]
[./Adaptivity]
initial_adaptivity = 5
interval = 10
max_h_level = 5
refine_fraction = 0.9
coarsen_fraction = 0.1
[../]
[]
[Outputs]
print_linear_residuals = false
perf_graph = true
execute_on = 'INITIAL TIMESTEP_END'
[./table]
type = CSV
delimiter = ' '
file_base = radius_${RADIUS}/eigenstrain_pp
[../]
[./vpp]
type = CSV
delimiter = ' '
sync_times = '10 50 100 500 1000 5000 10000 50000 100000'
sync_only = true
time_data = true
file_base = radius_${RADIUS}/eigenstrain_vpp
[../]
[]
(modules/combined/test/tests/eigenstrain/variable_cahnhilliard.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 16
ny = 16
xmin = 0
xmax = 50
ymin = 0
ymax = 50
elem_type = QUAD4
[]
[Variables]
[./c]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = SmoothCircleIC
x1 = 0
y1 = 0
radius = 25.0
invalue = 1.0
outvalue = 0.0
int_width = 50.0
[../]
[../]
[./w]
order = FIRST
family = LAGRANGE
[../]
[./disp_x]
order = FIRST
family = LAGRANGE
[../]
[./disp_y]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./TensorMechanics]
displacements = 'disp_x disp_y'
[../]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
w = w
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[]
[AuxVariables]
[./sigma11_aux]
order = CONSTANT
family = MONOMIAL
[../]
[./sigma22_aux]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./matl_sigma11]
type = RankTwoAux
rank_two_tensor = stress
index_i = 0
index_j = 0
variable = sigma11_aux
[../]
[./matl_sigma22]
type = RankTwoAux
rank_two_tensor = stress
index_i = 1
index_j = 1
variable = sigma22_aux
[../]
[]
[Materials]
[./pfmobility]
type = GenericConstantMaterial
prop_names = 'M kappa_c'
prop_values = '1 5'
block = 0
[../]
[./chemical_free_energy]
type = DerivativeParsedMaterial
block = 0
property_name = Fc
coupled_variables = 'c'
constant_names = 'barr_height cv_eq'
constant_expressions = '0.1 1.0e-2'
expression = 16*barr_height*(c-cv_eq)^2*(1-cv_eq-c)^2
enable_jit = true
derivative_order = 2
[../]
[./elasticity_tensor]
type = ComputeElasticityTensor
block = 0
C_ijkl = '7 7'
fill_method = symmetric_isotropic
[../]
[./stress]
type = ComputeLinearElasticStress
block = 0
[../]
[./var_dependence]
type = DerivativeParsedMaterial
block = 0
expression = 0.1*c
coupled_variables = c
property_name = var_dep
enable_jit = true
derivative_order = 2
[../]
[./eigenstrain]
type = ComputeVariableEigenstrain
block = 0
eigen_base = '1 1 1 0 0 0'
prefactor = var_dep
args = 'c'
eigenstrain_name = eigenstrain
[../]
[./strain]
type = ComputeSmallStrain
block = 0
displacements = 'disp_x disp_y'
eigenstrain_names = eigenstrain
[../]
[./elastic_free_energy]
type = ElasticEnergyMaterial
f_name = Fe
block = 0
args = 'c'
derivative_order = 2
[../]
[./free_energy]
type = DerivativeSumMaterial
block = 0
property_name = F
sum_materials = 'Fc Fe'
coupled_variables = 'c'
derivative_order = 2
[../]
[]
[BCs]
[./bottom_y]
type = DirichletBC
variable = disp_y
boundary = 'bottom'
value = 0
[../]
[./top_y]
type = DirichletBC
variable = disp_y
boundary = 'top'
value = -5
[../]
[./left_x]
type = DirichletBC
variable = disp_x
boundary = 'left'
value = 0
[../]
[]
[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 = 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 = 2
dt = 1
[]
[Outputs]
exodus = true
[]
(modules/phase_field/test/tests/SoretDiffusion/split.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmax = 1000
nx = 50
[]
[GlobalParams]
polynomial_order = 8
[]
[Variables]
[./c]
[../]
[./w]
scaling = 1.0e3
[../]
[]
[ICs]
[./c_IC]
type = SmoothCircleIC
x1 = 175.0
y1 = 0.0
radius = 100
invalue = 1.0
outvalue = 0.01
int_width = 100.0
variable = c
[../]
[]
[AuxVariables]
[./T]
[../]
[]
[Kernels]
[./c_res]
type = SplitCHParsed
variable = c
kappa_name = kappa
w = w
f_name = F
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./w_res_soret]
type = SoretDiffusion
variable = w
c = c
T = T
diff_name = D
Q_name = Qstar
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[]
[AuxKernels]
[./Temp]
type = FunctionAux
variable = T
function = 1000.0+0.025*x
[../]
[]
[Materials]
[./Copper]
type = PFParamsPolyFreeEnergy
c = c
T = T # K
int_width = 80.0
length_scale = 1.0e-9
time_scale = 1.0e-6
D0 = 3.1e-5 # m^2/s, from Brown1980
Em = 0.71 # in eV, from Balluffi1978 Table 2
Ef = 1.28 # in eV, from Balluffi1978 Table 2
surface_energy = 0.708 # Total guess
[../]
[./free_energy]
type = PolynomialFreeEnergy
c = c
outputs = exodus
derivative_order = 2
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
solve_type = 'NEWTON'
# petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
# petsc_options_value = 'asm 31 preonly lu 1'
l_max_its = 10
l_tol = 1.0e-4
nl_max_its = 25
nl_rel_tol = 1.0e-9
start_time = 0.0
num_steps = 20
dt = 3
[]
[Outputs]
exodus = true
[]
(modules/phase_field/examples/rigidbodymotion/AC_CH_advection_constforce_rect.i)
#
# Tests the Rigid Body Motion of grains due to applied forces.
# Concenterated forces and torques have been applied and corresponding
# advection velocities are calculated.
# Grain motion kernels make the grains translate and rotate as a rigidbody,
# applicable to grain movement in porous media
#
[Mesh]
type = GeneratedMesh
dim = 2
nx = 50
ny = 25
nz = 0
xmax = 50
ymax = 25
zmax = 0
elem_type = QUAD4
[]
[Variables]
[./c]
order = FIRST
family = LAGRANGE
[../]
[./w]
order = FIRST
family = LAGRANGE
[../]
[./eta]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./vadvx]
order = CONSTANT
family = MONOMIAL
[../]
[./vadvy]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
w = w
coupled_variables = eta
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[./motion]
# advection kernel corrsponding to CH equation
type = MultiGrainRigidBodyMotion
variable = w
c = c
v = eta
grain_tracker_object = grain_center
grain_force = grain_force
grain_volumes = grain_volumes
[../]
[./eta_dot]
type = TimeDerivative
variable = eta
[../]
[./vadv_eta]
# advection kernel corrsponding to AC equation
type = SingleGrainRigidBodyMotion
variable = eta
c = c
v = eta
grain_tracker_object = grain_center
grain_force = grain_force
grain_volumes = grain_volumes
[../]
[./acint_eta]
type = ACInterface
variable = eta
mob_name = M
coupled_variables = c
kappa_name = kappa_eta
[../]
[./acbulk_eta]
type = AllenCahn
variable = eta
mob_name = M
f_name = F
coupled_variables = c
[../]
[]
[AuxKernels]
[./vadv_x]
type = GrainAdvectionAux
component = x
grain_tracker_object = grain_center
grain_force = grain_force
grain_volumes = grain_volumes
variable = vadvx
[../]
[./vadv_y]
type = GrainAdvectionAux
component = y
grain_tracker_object = grain_center
grain_force = grain_force
grain_volumes = grain_volumes
variable = vadvy
[../]
[]
[Materials]
[./pfmobility]
type = GenericConstantMaterial
prop_names = 'M kappa_c kappa_eta'
prop_values = '1.0 2.0 0.1'
[../]
[./free_energy]
type = DerivativeParsedMaterial
coupled_variables = 'c eta'
constant_names = 'barr_height cv_eq'
constant_expressions = '0.1 1.0e-2'
expression = 16*barr_height*(c-cv_eq)^2*(1-cv_eq-c)^2+(c-eta)^2
derivative_order = 2
[../]
[]
[VectorPostprocessors]
[./forces]
# VectorPostprocessor for outputting grain forces and torques
type = GrainForcesPostprocessor
grain_force = grain_force
[../]
[./grain_volumes]
type = FeatureVolumeVectorPostprocessor
flood_counter = grain_center
execute_on = 'initial timestep_begin'
[../]
[]
[UserObjects]
[./grain_center]
type = GrainTracker
variable = eta
outputs = none
compute_var_to_feature_map = true
execute_on = 'initial timestep_begin'
[../]
[./grain_force]
type = ConstantGrainForceAndTorque
execute_on = 'linear nonlinear'
force = '0.2 0.0 0.0 ' # size should be 3 * no. of grains
torque = '0.0 0.0 5.0 ' # size should be 3 * no. of grains
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
nl_max_its = 30
scheme = bdf2
solve_type = NEWTON
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly lu 1'
l_max_its = 30
l_tol = 1.0e-4
nl_rel_tol = 1.0e-10
start_time = 0.0
dt = 0.1
end_time = 10
[]
[Outputs]
exodus = true
[]
[ICs]
[./rect_c]
y2 = 20.0
y1 = 5.0
inside = 1.0
x2 = 30.0
variable = c
x1 = 10.0
type = BoundingBoxIC
[../]
[./rect_eta]
y2 = 20.0
y1 = 5.0
inside = 1.0
x2 = 30.0
variable = eta
x1 = 10.0
type = BoundingBoxIC
[../]
[]
(modules/phase_field/test/tests/PolynomialFreeEnergy/split_order6_test.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 15
xmin = 0
xmax = 125
[]
[GlobalParams]
polynomial_order = 6
[]
[Variables]
[./c]
[../]
[./w]
[../]
[]
[ICs]
[./c_IC]
type = SmoothCircleIC
x1 = 0.0
y1 = 0.0
radius = 60.0
invalue = 1.0
outvalue = 0.1
int_width = 60.0
variable = c
[../]
[]
[Kernels]
[./c_res]
type = SplitCHParsed
variable = c
kappa_name = kappa
w = w
f_name = F
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[]
[Materials]
[./Copper]
type = PFParamsPolyFreeEnergy
c = c
T = 1000 # K
int_width = 30.0
length_scale = 1.0e-9
time_scale = 1.0e-9
D0 = 3.1e-5 # m^2/s, from Brown1980
Em = 0.71 # in eV, from Balluffi1978 Table 2
Ef = 1.28 # in eV, from Balluffi1978 Table 2
surface_energy = 0.7 # Total guess
[../]
[./free_energy]
type = PolynomialFreeEnergy
c = c
derivative_order = 2
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
l_max_its = 30
l_tol = 1.0e-4
nl_rel_tol = 1.0e-8
start_time = 0.0
num_steps = 50
dt = 15
petsc_options_iname = -pc_type
petsc_options_value = lu
[]
[Outputs]
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/phase_field/test/tests/anisotropic_mobility/split.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 15
ny = 15
xmax = 15.0
ymax = 15.0
[]
[Variables]
[./c]
[./InitialCondition]
type = CrossIC
x1 = 0.0
x2 = 30.0
y1 = 0.0
y2 = 30.0
[../]
[../]
[./w]
[../]
[]
[Kernels]
[./cres]
type = SplitCHParsed
variable = c
kappa_name = kappa_c
w = w
f_name = F
[../]
[./wres]
type = SplitCHWResAniso
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[]
[Materials]
[./kappa]
type = GenericConstantMaterial
prop_names = 'kappa_c'
prop_values = '2.0'
[../]
[./mob]
type = ConstantAnisotropicMobility
tensor = '0.1 0 0
0 1 0
0 0 0'
M_name = M
[../]
[./free_energy]
type = MathEBFreeEnergy
property_name = F
c = c
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = 'BDF2'
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 lu 1'
l_max_its = 30
l_tol = 1.0e-4
nl_max_its = 50
nl_rel_tol = 1.0e-10
dt = 10.0
num_steps = 2
[]
[Outputs]
exodus = true
print_linear_residuals = true
perf_graph = true
[]
(modules/phase_field/test/tests/rigidbodymotion/grain_motion2.i)
# test file for applyting advection term and observing rigid body motion of grains
[Mesh]
type = GeneratedMesh
dim = 2
nx = 25
ny = 15
nz = 0
xmax = 50
ymax = 25
zmax = 0
elem_type = QUAD4
[]
[Variables]
[./c]
order = FIRST
family = LAGRANGE
[../]
[./w]
order = FIRST
family = LAGRANGE
[../]
[./eta]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./vadvx]
order = CONSTANT
family = MONOMIAL
[../]
[./vadvy]
order = CONSTANT
family = MONOMIAL
[../]
[./unique_grains]
order = CONSTANT
family = MONOMIAL
[../]
[./centroids]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
w = w
coupled_variables = eta
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[./motion]
type = MultiGrainRigidBodyMotion
variable = w
c = c
v = eta
grain_tracker_object = grain_center
grain_force = grain_force
grain_volumes = grain_volumes
[../]
[./eta_dot]
type = TimeDerivative
variable = eta
[../]
[./vadv_eta]
type = SingleGrainRigidBodyMotion
variable = eta
c = c
v = eta
grain_tracker_object = grain_center
grain_force = grain_force
grain_volumes = grain_volumes
[../]
[./acint_eta]
type = ACInterface
variable = eta
mob_name = M
coupled_variables = c
kappa_name = kappa_eta
[../]
[./acbulk_eta]
type = AllenCahn
variable = eta
mob_name = M
f_name = F
coupled_variables = c
[../]
[]
[AuxKernels]
[./vadv_x]
type = GrainAdvectionAux
component = x
grain_tracker_object = grain_center
grain_force = grain_force
grain_volumes = grain_volumes
variable = vadvx
[../]
[./vadv_y]
type = GrainAdvectionAux
component = y
grain_tracker_object = grain_center
grain_force = grain_force
grain_volumes = grain_volumes
variable = vadvy
[../]
[./unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_center
field_display = UNIQUE_REGION
execute_on = 'initial timestep_begin'
[../]
[./centroids]
type = FeatureFloodCountAux
variable = centroids
execute_on = 'initial timestep_begin'
field_display = CENTROID
flood_counter = grain_center
[../]
[]
[Materials]
[./pfmobility]
type = GenericConstantMaterial
prop_names = 'M kappa_c kappa_eta'
prop_values = '5.0 2.0 0.1'
[../]
[./free_energy]
type = DerivativeParsedMaterial
coupled_variables = 'c eta'
constant_names = 'barr_height cv_eq'
constant_expressions = '0.1 1.0e-2'
expression = 16*barr_height*(c-cv_eq)^2*(1-cv_eq-c)^2+(c-eta)^2
derivative_order = 2
[../]
[]
[VectorPostprocessors]
[./forces]
type = GrainForcesPostprocessor
grain_force = grain_force
[../]
[./grain_volumes]
type = FeatureVolumeVectorPostprocessor
flood_counter = grain_center
execute_on = 'initial timestep_begin'
[../]
[]
[UserObjects]
[./grain_center]
type = FauxGrainTracker
variable = eta
outputs = none
compute_var_to_feature_map = true
execute_on = 'initial timestep_begin'
[../]
[./grain_force]
type = ConstantGrainForceAndTorque
execute_on = 'initial linear nonlinear'
force = '0.5 0.0 0.0 '
torque = '0.0 0.0 10.0 '
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
nl_max_its = 30
scheme = bdf2
solve_type = NEWTON
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly lu 1'
l_max_its = 30
l_tol = 1.0e-4
nl_rel_tol = 1.0e-10
start_time = 0.0
dt = 0.5
num_steps = 1
[]
[Outputs]
exodus = true
[]
[ICs]
[./rect_c]
y2 = 20.0
y1 = 5.0
inside = 1.0
x2 = 30.0
variable = c
x1 = 10.0
type = BoundingBoxIC
[../]
[./rect_eta]
y2 = 20.0
y1 = 5.0
inside = 1.0
x2 = 30.0
variable = eta
x1 = 10.0
type = BoundingBoxIC
[../]
[]
(modules/phase_field/test/tests/mobility_derivative/mobility_derivative_split_coupled_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 30
ny = 30
xmax = 30.0
ymax = 30.0
elem_type = QUAD4
[]
[Variables]
[./c]
[../]
[./w]
[../]
[./d]
[../]
[]
[ICs]
[./c_IC]
type = CrossIC
x1 = 0.0
x2 = 30.0
y1 = 0.0
y2 = 30.0
variable = c
[../]
[./d_IC]
type = BoundingBoxIC
x1 = 0.0
x2 = 15.0
y1 = 0.0
y2 = 30.0
inside = 1.0
outside = 0.0
variable = d
[../]
[]
[Kernels]
[./cres]
type = SplitCHParsed
variable = c
kappa_name = kappa_c
w = w
f_name = F
[../]
[./wres]
type = SplitCHWRes
variable = w
mob_name = M
coupled_variables = 'c d'
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[./d_dot]
type = TimeDerivative
variable = d
[../]
[./d_diff]
type = MatDiffusion
variable = d
diffusivity = diffusivity
[../]
[]
[BCs]
[./Periodic]
[./all]
auto_direction = 'x y'
[../]
[../]
[]
[Materials]
[./kappa]
type = GenericConstantMaterial
prop_names = 'kappa_c'
prop_values = '2.0'
[../]
[./mob]
type = DerivativeParsedMaterial
property_name = M
coupled_variables = 'c d'
expression = 'if(d>0.001,d,0.001)*(1-0.5*c^2)'
outputs = exodus
derivative_order = 1
[../]
[./free_energy]
type = MathEBFreeEnergy
property_name = F
c = c
[../]
[./d_diff]
type = GenericConstantMaterial
prop_names = diffusivity
prop_values = 0.1
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = 'BDF2'
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 lu 1'
l_max_its = 30
l_tol = 1.0e-4
nl_max_its = 50
nl_rel_tol = 1.0e-10
dt = 10.0
num_steps = 2
[]
[Outputs]
exodus = true
[]
(modules/phase_field/test/tests/feature_volume_vpp_test/centroid.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 25
ny = 15
nz = 0
xmax = 50
ymax = 25
zmax = 0
elem_type = QUAD4
[]
[Variables]
[c]
[]
[w]
[]
[eta]
[]
[]
[ICs]
[rect_c]
y2 = 20.0
y1 = 5.0
inside = 1.0
x2 = 30.0
variable = c
x1 = 10.0
type = BoundingBoxIC
[]
[rect_eta]
y2 = 20.0
y1 = 5.0
inside = 1.0
x2 = 30.0
variable = eta
x1 = 10.0
type = BoundingBoxIC
[]
[]
[Kernels]
[c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
w = w
coupled_variables = eta
[]
[w_res]
type = SplitCHWRes
variable = w
mob_name = M
[]
[time]
type = CoupledTimeDerivative
variable = w
v = c
[]
[eta_dot]
type = TimeDerivative
variable = eta
[]
[acint_eta]
type = ACInterface
variable = eta
mob_name = M
coupled_variables = c
kappa_name = kappa_eta
[]
[acbulk_eta]
type = AllenCahn
variable = eta
mob_name = M
f_name = F
coupled_variables = c
[]
[]
[Materials]
[pfmobility]
type = GenericConstantMaterial
prop_names = 'M kappa_c kappa_eta'
prop_values = '5.0 2.0 0.1'
[]
[free_energy]
type = DerivativeParsedMaterial
coupled_variables = 'c eta'
constant_names = 'barr_height cv_eq'
constant_expressions = '0.1 1.0e-2'
expression = 16*barr_height*(c-cv_eq)^2*(1-cv_eq-c)^2+(c-eta)^2
derivative_order = 2
[]
[]
[Postprocessors]
[grain_center]
type = GrainTracker
variable = eta
outputs = none
compute_var_to_feature_map = true
execute_on = 'timestep_begin'
[]
[]
[VectorPostprocessors]
[grain_volumes]
type = FeatureVolumeVectorPostprocessor
flood_counter = grain_center
execute_on = 'timestep_begin'
output_centroids = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
dt = 0.2
num_steps = 4
[]
[Outputs]
csv = true
[]
(modules/phase_field/examples/rigidbodymotion/AC_CH_Multigrain.i)
# Tests the rigid body motion due to applied force of multiple particles.
# ***COPY AND PASTE THESE AS NEEDED***
# 'gr0 gr1 gr2 gr3 gr4 gr5 gr6 gr7 gr8 gr9 gr10 gr11 gr12 gr13 gr14 gr15 gr16 gr17 gr18 gr19'
# (gr0^2+gr1^2+gr2^2+gr3^2+gr4^2+gr5^2+gr6^2+gr7^2+gr8^2+gr9^2+gr10^2+gr11^2+gr12^2+gr13^2+gr14^2+gr15^2+gr16^2+gr17^2+gr18^2+gr19^2)
# (gr0^3+gr1^3+gr2^3+gr3^3+gr4^3+gr5^3+gr6^3+gr7^3+gr8^3+gr9^3+gr10^3+gr11^3+gr12^3+gr13^3+gr14^3+gr15^3+gr16^3+gr17^3+gr18^3+gr19^3)
[GlobalParams]
op_num = 4
var_name_base = gr
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 15
ny = 15
xmin = 0
xmax = 600
ymin = 0
ymax = 600
elem_type = QUAD4
uniform_refine = 1
[]
[Variables]
[./c]
[../]
[./w]
[../]
[./PolycrystalVariables] # Automatically creates order parameter variables
[../]
[]
[AuxVariables]
[./bnds]
[../]
[./force]
order = CONSTANT
family = MONOMIAL
[../]
[./free_energy]
order = CONSTANT
family = MONOMIAL
[../]
[./unique_grains]
order = CONSTANT
family = MONOMIAL
[../]
[./var_indices]
order = CONSTANT
family = MONOMIAL
[../]
[./centroids]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Functions]
[./load_x]
# Defines the force on the grains in the x-direction
type = ParsedFunction
expression = 0.005*cos(x*pi/600)
[../]
[./load_y]
# Defines the force on the grains in the y-direction
type = ConstantFunction
value = 0.002
[../]
[]
[Kernels]
[./RigidBodyMultiKernel]
# Creates all of the necessary Allen Cahn kernels automatically
c = c
f_name = f_loc
mob_name = L
kappa_name = kappa_gr
grain_force = grain_force
grain_volumes = grain_volumes
grain_tracker_object = grain_center
[../]
# Cahn Hilliard kernels
[./dt_w]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[./CH_wres]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./CH_Parsed]
type = SplitCHParsed
variable = c
f_name = f_loc
w = w
kappa_name = kappa_c
coupled_variables = 'gr0 gr1 gr2 gr3' # Must be changed as op_num changes. Copy/paste from line 4
[../]
[./CH_RBM]
type = MultiGrainRigidBodyMotion
variable = w
c = c
v = 'gr0 gr1 gr2 gr3'
grain_force = grain_force
grain_volumes = grain_volumes
grain_tracker_object = grain_center
[../]
[]
[AuxKernels]
[./force_x]
type = FunctionAux
variable = force
function = load_x
[../]
[./force_y]
type = FunctionAux
variable = force
function = load_y
[../]
[./energy_density]
type = TotalFreeEnergy
variable = free_energy
f_name = f_loc
kappa_names = kappa_c
interfacial_vars = c
[../]
[./bnds]
type = BndsCalcAux
variable = bnds
[../]
[]
[BCs]
[./bcs]
#zero flux BC
type = NeumannBC
value = 0
variable = c
boundary = '0 1 2 3'
[../]
[]
[Materials]
[./constants]
type = GenericConstantMaterial
prop_names = 'kappa_gr kappa_c M L'
prop_values = '250 4000 4.5 60'
[../]
[./free_energy]
type = DerivativeParsedMaterial
property_name = f_loc
constant_names = 'A B'
constant_expressions = '450 1.5'
coupled_variables = 'c gr0 gr1 gr2 gr3' #Must be changed as op_num changes. Copy/paste from line 4
expression = 'A*c^2*(1-c)^2+B*(c^2+6*(1-c)*(gr0^2+gr1^2+gr2^2+gr3^2)
-4*(2-c)*(gr0^3+gr1^3+gr2^3+gr3^3)
+3*(gr0^2+gr1^2+gr2^2+gr3^2)^2)'
#Copy/paste from lines 5-6
derivative_order = 2
[../]
[./force_density]
type = ExternalForceDensityMaterial
c = c
k = 10.0
force_x = load_x
force_y = load_y
[../]
[]
[Postprocessors]
[./total_energy]
type = ElementIntegralVariablePostprocessor
variable = free_energy
execute_on = 'initial timestep_end'
[../]
[]
[VectorPostprocessors]
[./forces]
type = GrainForcesPostprocessor
grain_force = grain_force
[../]
[./grain_volumes]
type = FeatureVolumeVectorPostprocessor
flood_counter = grain_center
execute_on = 'initial timestep_begin'
[../]
[]
[UserObjects]
[./grain_center]
type = GrainTracker
outputs = none
compute_var_to_feature_map = true
execute_on = 'initial timestep_begin'
[../]
[./grain_force]
type = ComputeExternalGrainForceAndTorque
grain_data = grain_center
c = c
etas = 'gr0 gr1 gr2 gr3'
force_density = force_density_ext
execute_on = 'linear nonlinear'
[../]
[]
[Preconditioning]
[./coupled]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type
-sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly
ilu 2'
l_tol = 1e-05
nl_max_its = 30
l_max_its = 30
nl_rel_tol = 1e-07
nl_abs_tol = 1e-09
start_time = 0.0
end_time = 4
dt = 0.05
[]
[Outputs]
exodus = true
perf_graph = true
[./display]
type = Console
max_rows = 12
[../]
[]
[ICs]
[./concentration_IC]
type = SpecifiedSmoothCircleIC
x_positions = '150 450 150 450'
y_positions = '150 150 450 450'
z_positions = '0 0 0 0'
radii = '120 120 120 120'
variable = c
invalue = 1.0
outvalue = 0.0
int_width = 25
[../]
[./gr0_IC]
type = SmoothCircleIC
variable = gr0
x1 = 150
y1 = 150
radius = 120
invalue = 1.0
outvalue = 0.0
int_width = 25
[../]
[./gr1_IC]
type = SmoothCircleIC
variable = gr1
x1 = 450
y1 = 150
radius = 120
invalue = 1.0
outvalue = 0.0
int_width = 25
[../]
[./gr2_IC]
type = SmoothCircleIC
variable = gr2
x1 = 150
y1 = 450
radius = 120
invalue = 1.0
outvalue = 0.0
int_width = 25
[../]
[./gr3_IC]
type = SmoothCircleIC
variable = gr3
x1 = 450
y1 = 450
radius = 120
invalue = 1.0
outvalue = 0.0
int_width = 25
[../]
[]
(modules/combined/examples/publications/rapid_dev/fig3.i)
#
# Fig. 3 input for 10.1016/j.commatsci.2017.02.017
# D. Schwen et al./Computational Materials Science 132 (2017) 36-45
# Comparison of an analytical (ca) and numerical (c) phase field interface
# profile. Supply the L parameter on the command line to gather the data for
# the inset plot.
#
[Mesh]
type = GeneratedMesh
dim = 1
nx = ${L}
xmin = -30
xmax = 30
[]
[Functions]
[./solution]
type = ParsedFunction
expression = 0.5*(1+tanh(x/2^0.5))
[../]
[]
[Variables]
[./c]
[./InitialCondition]
type = FunctionIC
function = solution
#type = FunctionIC
#function = if(x>0,1,0)
[../]
[../]
[./w]
[../]
[]
[AuxVariables]
[./diff]
[../]
[./ca]
[./InitialCondition]
type = FunctionIC
function = '0.5*(1+tanh(x/2^0.5))'
[../]
[../]
[]
[AuxKernels]
[./diff]
type = ParsedAux
variable = diff
expression = c-ca
coupled_variables = 'c ca'
[../]
[]
[Materials]
[./F]
type = DerivativeParsedMaterial
property_name = F
expression = 'c^2*(1-c)^2'
coupled_variables = c
[../]
[]
[Kernels]
# Split Cahn-Hilliard kernels
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = 1
w = w
[../]
[./wres]
type = SplitCHWRes
variable = w
mob_name = 1
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[]
[Postprocessors]
[./L2]
type = ElementL2Error
function = solution
variable = c
[../]
[]
[VectorPostprocessors]
[./c]
type = LineValueSampler
variable = 'c ca diff'
start_point = '-10 0 0'
end_point = '10 0 0'
num_points = 200
sort_by = x
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
nl_rel_tol = 1e-10
nl_abs_tol = 1e-12
end_time = 1e+6
[./TimeStepper]
type = IterationAdaptiveDT
dt = 1
optimal_iterations = 5
iteration_window = 1
[../]
[]
[Outputs]
csv = true
execute_on = final
[]
(modules/phase_field/examples/measure_interface_energy/1Dinterface_energy.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 100
xmax = 100
xmin = 0
elem_type = EDGE
[]
[AuxVariables]
[./local_energy]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./local_free_energy]
type = TotalFreeEnergy
variable = local_energy
kappa_names = kappa_c
interfacial_vars = c
[../]
[]
[Variables]
[./c]
order = FIRST
family = LAGRANGE
scaling = 1e1
[./InitialCondition]
type = RampIC
variable = c
value_left = 0
value_right = 1
[../]
[../]
[./w]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
w = w
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[]
[Functions]
[./Int_energy]
type = ParsedFunction
symbol_values = 'total_solute Cleft Cright Fleft Fright volume'
expression = '((total_solute-Cleft*volume)/(Cright-Cleft))*Fright+(volume-(total_solute-Cleft*volume)/(Cright-Cleft))*Fleft'
symbol_names = 'total_solute Cleft Cright Fleft Fright volume'
[../]
[./Diff]
type = ParsedFunction
symbol_values = 'total_free_energy total_no_int'
symbol_names = 'total_free_energy total_no_int'
expression = total_free_energy-total_no_int
[../]
[]
[Materials]
[./consts]
type = GenericConstantMaterial
prop_names = 'kappa_c M'
prop_values = '25 150'
[../]
[./Free_energy]
type = DerivativeParsedMaterial
property_name = F
expression = 'c^2*(c-1)^2'
coupled_variables = c
derivative_order = 2
[../]
[]
[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,
# gives Cavg in % for this problem.
[./total_solute]
type = ElementIntegralVariablePostprocessor
variable = c
[../]
# Get simulation cell size (1D volume) from postprocessor
[./volume]
type = ElementIntegralMaterialProperty
mat_prop = 1
[../]
# Find concentration in each phase using SideAverageValue
[./Cleft]
type = SideAverageValue
boundary = left
variable = c
[../]
[./Cright]
type = SideAverageValue
boundary = right
variable = c
[../]
# Find local energy in each phase by checking boundaries
[./Fleft]
type = SideAverageValue
boundary = left
variable = local_energy
[../]
[./Fright]
type = SideAverageValue
boundary = right
variable = local_energy
[../]
# Use concentrations and energies to find total free energy without any interface,
# only applies once equilibrium is reached!!
# Difference between energy with and without interface
# gives interface energy per unit area.
[./total_no_int]
type = FunctionValuePostprocessor
function = Int_energy
[../]
[./Energy_of_Interface]
type = FunctionValuePostprocessor
function = Diff
[../]
[]
[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 provides 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 = 15
nl_rel_tol = 1.0e-10
nl_abs_tol = 1.0e-4
start_time = 0.0
# make sure that the result obtained for the interfacial free energy is fully converged
end_time = 40
[./TimeStepper]
type = SolutionTimeAdaptiveDT
dt = 0.5
[../]
[]
[Outputs]
gnuplot = true
csv = true
[./exodus]
type = Exodus
show = 'c local_energy'
execute_on = 'failed initial nonlinear timestep_end final'
[../]
[./console]
type = Console
execute_on = 'FAILED INITIAL NONLINEAR TIMESTEP_END final'
[../]
perf_graph = true
[]
(modules/phase_field/tutorials/spinodal_decomposition/s3_decomp.i)
#
# Simulation of iron-chromium alloy decomposition using simplified conditions.
#
[Mesh]
type = GeneratedMesh
dim = 2
elem_type = QUAD4
nx = 25
ny = 25
nz = 0
xmin = 0
xmax = 25
ymin = 0
ymax = 25
zmin = 0
zmax = 0
uniform_refine = 2
[]
[Variables]
[./c] # Mole fraction of Cr (unitless)
order = FIRST
family = LAGRANGE
[../]
[./w] # Chemical potential (eV/mol)
order = FIRST
family = LAGRANGE
[../]
[]
[ICs]
[./concentrationIC] # 46.774 mol% Cr with variations
type = RandomIC
min = 0.44774
max = 0.48774
seed = 210
variable = c
[../]
[]
[BCs]
[./Periodic]
[./c_bcs]
auto_direction = 'x y'
[../]
[../]
[]
[Kernels]
[./w_dot]
variable = w
v = c
type = CoupledTimeDerivative
[../]
[./coupled_res]
variable = w
type = SplitCHWRes
mob_name = M
[../]
[./coupled_parsed]
variable = c
type = SplitCHParsed
f_name = f_loc
kappa_name = kappa_c
w = w
[../]
[]
[Materials]
# d is a scaling factor that makes it easier for the solution to converge
# without changing the results. It is defined in each of the materials and
# must have the same value in each one.
[./constants]
# Define constant values kappa_c and M. Eventually M will be replaced with
# an equation rather than a constant.
type = GenericFunctionMaterial
prop_names = 'kappa_c M'
prop_values = '8.125e-16*6.24150934e+18*1e+09^2*1e-27
2.2841e-26*1e+09^2/6.24150934e+18/1e-27'
# kappa_c*eV_J*nm_m^2*d
# M*nm_m^2/eV_J/d
[../]
[./local_energy]
# Defines the function for the local free energy density as given in the
# problem, then converts units and adds scaling factor.
type = DerivativeParsedMaterial
property_name = f_loc
coupled_variables = c
constant_names = 'A B C D E F G eV_J d'
constant_expressions = '-2.446831e+04 -2.827533e+04 4.167994e+03 7.052907e+03
1.208993e+04 2.568625e+03 -2.354293e+03
6.24150934e+18 1e-27'
expression = 'eV_J*d*(A*c+B*(1-c)+C*c*log(c)+D*(1-c)*log(1-c)+
E*c*(1-c)+F*c*(1-c)*(2*c-1)+G*c*(1-c)*(2*c-1)^2)'
derivative_order = 2
[../]
[]
[Postprocessors]
[./step_size] # Size of the time step
type = TimestepSize
[../]
[./iterations] # Number of iterations needed to converge timestep
type = NumNonlinearIterations
[../]
[./nodes] # Number of nodes in mesh
type = NumNodes
[../]
[./evaluations] # Cumulative residual calculations for simulation
type = NumResidualEvaluations
[../]
[./active_time] # Time computer spent on simulation
type = PerfGraphData
section_name = "Root"
data_type = total
[../]
[]
[Preconditioning]
[./coupled]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
l_max_its = 30
l_tol = 1e-6
nl_max_its = 50
nl_abs_tol = 1e-9
end_time = 604800 # 7 days
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type
-sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly
ilu 1'
[./TimeStepper]
type = IterationAdaptiveDT
dt = 10
cutback_factor = 0.8
growth_factor = 1.5
optimal_iterations = 7
[../]
[./Adaptivity]
coarsen_fraction = 0.1
refine_fraction = 0.7
max_h_level = 2
[../]
[]
[Debug]
show_var_residual_norms = true
[]
[Outputs]
exodus = true
console = true
csv = true
[./console]
type = Console
max_rows = 10
[../]
[]
(modules/phase_field/test/tests/rigidbodymotion/polycrystal_action.i)
# test file for showing reaction forces between particles
[GlobalParams]
var_name_base = eta
op_num = 2
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 5
nz = 0
xmax = 50
ymax = 25
zmax = 0
elem_type = QUAD4
uniform_refine = 1
[]
[Variables]
[./c]
order = FIRST
family = LAGRANGE
[../]
[./w]
order = FIRST
family = LAGRANGE
[../]
[./PolycrystalVariables]
[../]
[]
[Kernels]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
coupled_variables = 'eta0 eta1'
w = w
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[./motion]
type = MultiGrainRigidBodyMotion
variable = w
c = c
v = 'eta0 eta1'
grain_force = grain_force
grain_tracker_object = grain_center
grain_volumes = grain_volumes
[../]
[./RigidBodyMultiKernel]
# Creates all of the necessary Allen Cahn kernels automatically
c = c
f_name = F
mob_name = M
kappa_name = kappa_eta
grain_force = grain_force
grain_tracker_object = grain_center
grain_volumes = grain_volumes
[../]
[]
[Materials]
[./pfmobility]
type = GenericConstantMaterial
prop_names = 'M kappa_c kappa_eta'
prop_values = '1.0 0.5 0.5'
[../]
[./free_energy]
type = DerivativeParsedMaterial
property_name = F
coupled_variables = 'c eta0 eta1'
constant_names = 'barr_height cv_eq'
constant_expressions = '0.1 1.0e-2'
expression = 16*barr_height*(c-cv_eq)^2*(1-cv_eq-c)^2+eta0*(1-eta0)*c+eta1*(1-eta1)*c
derivative_order = 2
[../]
[./force_density]
type = ForceDensityMaterial
c = c
etas ='eta0 eta1'
[../]
[]
[AuxVariables]
[./bnds]
[../]
[./MultiAuxVariables]
order = CONSTANT
family = MONOMIAL
variable_base = 'df'
data_type = 'RealGradient'
grain_num = 2
[../]
[./vadvx]
order = CONSTANT
family = MONOMIAL
[../]
[./vadvy]
order = CONSTANT
family = MONOMIAL
[../]
[./unique_grains]
order = CONSTANT
family = MONOMIAL
[../]
[./var_indices]
order = CONSTANT
family = MONOMIAL
[../]
[./centroids]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./bnds]
type = BndsCalcAux
variable = bnds
var_name_base = eta
op_num = 2
v = 'eta0 eta1'
[../]
[./MaterialVectorGradAuxKernel]
variable_base = 'df'
grain_num = 2
property = 'force_density'
[../]
[./vadv_x]
type = GrainAdvectionAux
component = x
grain_tracker_object = grain_center
grain_force = grain_force
grain_volumes = grain_volumes
variable = vadvx
[../]
[./vadv_y]
type = GrainAdvectionAux
component = y
grain_tracker_object = grain_center
grain_force = grain_force
grain_volumes = grain_volumes
variable = vadvy
[../]
[./unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_center
field_display = UNIQUE_REGION
execute_on = timestep_begin
[../]
[./var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_center
field_display = VARIABLE_COLORING
execute_on = timestep_begin
[../]
[./centroids]
type = FeatureFloodCountAux
variable = centroids
execute_on = timestep_begin
field_display = CENTROID
flood_counter = grain_center
[../]
[]
[ICs]
[./ic_eta0]
int_width = 1.0
x1 = 20.0
y1 = 0.0
radius = 14.0
outvalue = 0.0
variable = eta0
invalue = 1.0
type = SmoothCircleIC
[../]
[./IC_eta1]
int_width = 1.0
x1 = 30.0
y1 = 25.0
radius = 14.0
outvalue = 0.0
variable = eta1
invalue = 1.0
type = SmoothCircleIC
[../]
[./ic_c]
type = SpecifiedSmoothCircleIC
invalue = 1.0
outvalue = 0.1
int_width = 1.0
x_positions = '20.0 30.0 '
z_positions = '0.0 0.0 '
y_positions = '0.0 25.0 '
radii = '14.0 14.0'
3D_spheres = false
variable = c
block = 0
[../]
[]
[VectorPostprocessors]
[./forces]
type = GrainForcesPostprocessor
grain_force = grain_force
[../]
[./grain_volumes]
type = FeatureVolumeVectorPostprocessor
flood_counter = grain_center
execute_on = 'initial timestep_begin'
[../]
[]
[UserObjects]
[./grain_center]
type = GrainTracker
outputs = none
compute_var_to_feature_map = true
execute_on = 'initial timestep_begin'
[../]
[./grain_force]
type = ComputeGrainForceAndTorque
execute_on = 'initial linear nonlinear'
grain_data = grain_center
force_density = force_density
c = c
etas = 'eta0 eta1'
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly lu 1'
l_max_its = 30
l_tol = 1.0e-4
nl_rel_tol = 1.0e-10
start_time = 0.0
num_steps = 1
dt = 0.1
[]
[Outputs]
exodus = true
csv = true
[]
(modules/phase_field/test/tests/rigidbodymotion/grain_forcedensity.i)
# test file for showing reaction forces between particles
[GlobalParams]
var_name_base = eta
op_num = 2
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 5
nz = 0
xmax = 50
ymax = 25
zmax = 0
elem_type = QUAD4
uniform_refine = 1
[]
[Variables]
[./c]
order = FIRST
family = LAGRANGE
[../]
[./w]
order = FIRST
family = LAGRANGE
[../]
[./eta0]
[../]
[./eta1]
[../]
[]
[Kernels]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
coupled_variables = 'eta0 eta1'
w = w
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[./motion]
type = MultiGrainRigidBodyMotion
variable = w
c = c
v = 'eta0 eta1'
grain_force = grain_force
grain_tracker_object = grain_center
grain_volumes = grain_volumes
[../]
[./eta0_dot]
type = TimeDerivative
variable = eta0
[../]
[./vadv_eta]
type = SingleGrainRigidBodyMotion
variable = eta0
c = c
v = 'eta0 eta1'
grain_force = grain_force
grain_tracker_object = grain_center
grain_volumes = grain_volumes
op_index = 0
[../]
[./acint_eta0]
type = ACInterface
variable = eta0
mob_name = M
#coupled_variables = c
kappa_name = kappa_eta
[../]
[./acbulk_eta0]
type = AllenCahn
variable = eta0
mob_name = M
f_name = F
coupled_variables = 'c eta1'
[../]
[./eta1_dot]
type = TimeDerivative
variable = eta1
[../]
[./vadv_eta1]
type = SingleGrainRigidBodyMotion
variable = eta1
c = c
v = 'eta0 eta1'
op_index = 1
grain_force = grain_force
grain_tracker_object = grain_center
grain_volumes = grain_volumes
[../]
[./acint_eta1]
type = ACInterface
variable = eta1
mob_name = M
#coupled_variables = c
kappa_name = kappa_eta
[../]
[./acbulk_eta1]
type = AllenCahn
variable = eta1
mob_name = M
f_name = F
coupled_variables = 'c eta0'
[../]
[]
[Materials]
[./pfmobility]
type = GenericConstantMaterial
prop_names = 'M kappa_c kappa_eta'
prop_values = '1.0 0.5 0.5'
[../]
[./free_energy]
type = DerivativeParsedMaterial
property_name = F
coupled_variables = 'c eta0 eta1'
constant_names = 'barr_height cv_eq'
constant_expressions = '0.1 1.0e-2'
expression = 16*barr_height*(c-cv_eq)^2*(1-cv_eq-c)^2+eta0*(1-eta0)*c+eta1*(1-eta1)*c
derivative_order = 2
[../]
[./force_density]
type = ForceDensityMaterial
c = c
etas ='eta0 eta1'
[../]
[]
[AuxVariables]
[./bnds]
[../]
[./df00]
order = CONSTANT
family = MONOMIAL
[../]
[./df01]
order = CONSTANT
family = MONOMIAL
[../]
[./df10]
order = CONSTANT
family = MONOMIAL
[../]
[./df11]
order = CONSTANT
family = MONOMIAL
[../]
[./unique_grains]
order = CONSTANT
family = MONOMIAL
[../]
[./var_indices]
order = CONSTANT
family = MONOMIAL
[../]
[./centroids]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./bnds]
type = BndsCalcAux
variable = bnds
var_name_base = eta
op_num = 2
v = 'eta0 eta1'
[../]
[./df01]
type = MaterialStdVectorRealGradientAux
variable = df01
index = 0
component = 1
property = force_density
[../]
[./df11]
type = MaterialStdVectorRealGradientAux
variable = df11
index = 1
component = 1
property = force_density
[../]
[./df00]
type = MaterialStdVectorRealGradientAux
variable = df00
index = 0
component = 0
property = force_density
[../]
[./df10]
type = MaterialStdVectorRealGradientAux
variable = df10
index = 1
component = 0
property = force_density
[../]
[./unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_center
field_display = UNIQUE_REGION
execute_on = timestep_begin
[../]
[./var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_center
field_display = VARIABLE_COLORING
execute_on = timestep_begin
[../]
[./centroids]
type = FeatureFloodCountAux
variable = centroids
execute_on = timestep_begin
field_display = CENTROID
flood_counter = grain_center
[../]
[]
[ICs]
[./ic_eta0]
int_width = 1.0
x1 = 20.0
y1 = 0.0
radius = 14.0
outvalue = 0.0
variable = eta0
invalue = 1.0
type = SmoothCircleIC
[../]
[./IC_eta1]
int_width = 1.0
x1 = 30.0
y1 = 25.0
radius = 14.0
outvalue = 0.0
variable = eta1
invalue = 1.0
type = SmoothCircleIC
[../]
[./ic_c]
type = SpecifiedSmoothCircleIC
invalue = 1.0
outvalue = 0.1
int_width = 1.0
x_positions = '20.0 30.0 '
z_positions = '0.0 0.0 '
y_positions = '0.0 25.0 '
radii = '14.0 14.0'
3D_spheres = false
variable = c
block = 0
[../]
[]
[VectorPostprocessors]
[./forces]
type = GrainForcesPostprocessor
grain_force = grain_force
[../]
[./grain_volumes]
type = FeatureVolumeVectorPostprocessor
flood_counter = grain_center
execute_on = 'initial timestep_begin'
[../]
[]
[UserObjects]
[./grain_center]
type = GrainTracker
outputs = none
compute_var_to_feature_map = true
execute_on = 'initial timestep_begin'
[../]
[./grain_force]
type = ComputeGrainForceAndTorque
execute_on = 'linear nonlinear'
grain_data = grain_center
force_density = force_density
c = c
etas = 'eta0 eta1'
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly lu 1'
l_max_its = 30
l_tol = 1.0e-4
nl_rel_tol = 1.0e-10
start_time = 0.0
num_steps = 1
dt = 0.1
[]
[Outputs]
exodus = true
csv = true
[]
(modules/phase_field/test/tests/free_energy_material/MathEBFreeEnergy_split_name.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 30
ny = 30
xmin = 0.0
xmax = 30.0
ymin = 0.0
ymax = 30.0
elem_type = QUAD4
[]
[Variables]
[d]
[InitialCondition]
type = CrossIC
x1 = 0.0
x2 = 30.0
y1 = 0.0
y2 = 30.0
[]
[]
[w]
[]
[]
[AuxVariables]
[c]
[]
[]
[AuxKernels]
[c]
type = ProjectionAux
variable = c
v = d
execute_on = 'INITIAL TIMESTEP_END FINAL'
[]
[]
[Preconditioning]
active = 'SMP'
[PBP]
type = PBP
solve_order = 'w d'
preconditioner = 'AMG ASM'
off_diag_row = 'd '
off_diag_column = 'w '
[]
[SMP]
type = SMP
off_diag_row = 'w d'
off_diag_column = 'd w'
[]
[]
[Kernels]
[cres]
type = SplitCHParsed
variable = d
kappa_name = kappa_c
w = w
f_name = F
[]
[wres]
type = SplitCHWRes
variable = w
mob_name = M
[]
[time]
type = CoupledTimeDerivative
variable = w
v = d
[]
[]
[BCs]
[Periodic]
[top_bottom]
primary = 0
secondary = 2
translation = '0 30.0 0'
[]
[left_right]
primary = 1
secondary = 3
translation = '-30.0 0 0'
[]
[]
[]
[Materials]
[constant]
type = GenericConstantMaterial
prop_names = 'M kappa_c'
prop_values = '1.0 2.0'
[]
[free_energy]
type = MathEBFreeEnergy
property_name = F
c = d
[]
[]
[Executioner]
type = Transient
scheme = 'BDF2'
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
l_max_its = 30
l_tol = 1.0e-3
nl_max_its = 50
nl_rel_tol = 1.0e-10
dt = 10.0
num_steps = 2
[]
[Outputs]
exodus = true
hide = d
[]
(modules/phase_field/tutorials/spinodal_decomposition/s2_fasttest.i)
#
# Simulation of an iron-chromium alloy using simple code and a test set of
# initial conditions.
#
[Mesh]
# generate a 2D, 25nm x 25nm mesh
type = GeneratedMesh
dim = 2
elem_type = QUAD4
nx = 100
ny = 100
nz = 0
xmin = 0
xmax = 25
ymin = 0
ymax = 25
zmin = 0
zmax = 0
[]
[Variables]
[./c] # Mole fraction of Cr (unitless)
order = FIRST
family = LAGRANGE
[../]
[./w] # Chemical potential (eV/mol)
order = FIRST
family = LAGRANGE
[../]
[]
[ICs]
# Use a bounding box IC at equilibrium concentrations to make sure the
# model behaves as expected.
[./testIC]
type = BoundingBoxIC
variable = c
x1 = 5
x2 = 20
y1 = 5
y2 = 20
inside = 0.823
outside = 0.236
[../]
[]
[BCs]
# periodic BC as is usually done on phase-field models
[./Periodic]
[./c_bcs]
auto_direction = 'x y'
[../]
[../]
[]
[Kernels]
# See wiki page "Developing Phase Field Models" for more information on Split
# Cahn-Hilliard equation kernels.
# http://mooseframework.org/wiki/PhysicsModules/PhaseField/DevelopingModels/
[./w_dot]
variable = w
v = c
type = CoupledTimeDerivative
[../]
[./coupled_res]
variable = w
type = SplitCHWRes
mob_name = M
[../]
[./coupled_parsed]
variable = c
type = SplitCHParsed
f_name = f_loc
kappa_name = kappa_c
w = w
[../]
[]
[Materials]
# d is a scaling factor that makes it easier for the solution to converge
# without changing the results. It is defined in each of the materials and
# must have the same value in each one.
[./constants]
# Define constant values kappa_c and M. Eventually M will be replaced with
# an equation rather than a constant.
type = GenericFunctionMaterial
prop_names = 'kappa_c M'
prop_values = '8.125e-16*6.24150934e+18*1e+09^2*1e-27
2.2841e-26*1e+09^2/6.24150934e+18/1e-27'
# kappa_c*eV_J*nm_m^2*d
# M*nm_m^2/eV_J/d
[../]
[./local_energy]
# Defines the function for the local free energy density as given in the
# problem, then converts units and adds scaling factor.
type = DerivativeParsedMaterial
property_name = f_loc
coupled_variables = c
constant_names = 'A B C D E F G eV_J d'
constant_expressions = '-2.446831e+04 -2.827533e+04 4.167994e+03 7.052907e+03
1.208993e+04 2.568625e+03 -2.354293e+03
6.24150934e+18 1e-27'
expression = 'eV_J*d*(A*c+B*(1-c)+C*c*log(c)+D*(1-c)*log(1-c)+
E*c*(1-c)+F*c*(1-c)*(2*c-1)+G*c*(1-c)*(2*c-1)^2)'
derivative_order = 2
[../]
[]
[Postprocessors]
[./evaluations] # Cumulative residual calculations for simulation
type = NumResidualEvaluations
[../]
[./elapsed]
type = PerfGraphData
section_name = "Root"
data_type = total
[../]
[]
[Preconditioning]
# Preconditioning is required for Newton's method. See wiki page "Solving
# Phase Field Models" for more information.
# http://mooseframework.org/wiki/PhysicsModules/PhaseField/SolvingModels/
[./coupled]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
l_max_its = 30
l_tol = 1e-6
nl_max_its = 50
nl_abs_tol = 1e-9
end_time = 86400 # 1 day. We only need to run this long enough to verify
# the model is working properly.
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type
-sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly
ilu 1'
[./TimeStepper]
# Turn on time stepping
type = IterationAdaptiveDT
dt = 10
cutback_factor = 0.8
growth_factor = 1.5
optimal_iterations = 7
[../]
[]
[Debug]
show_var_residual_norms = true
[]
[Outputs]
exodus = true
console = true
csv = true
[./console]
type = Console
max_rows = 10
[../]
[]
(modules/phase_field/test/tests/PolynomialFreeEnergy/split_order4_test.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 15
xmin = 0
xmax = 125
[]
[GlobalParams]
polynomial_order = 4
[]
[Variables]
[./c]
[../]
[./w]
[../]
[]
[ICs]
[./c_IC]
type = SmoothCircleIC
x1 = 0.0
y1 = 0.0
radius = 60.0
invalue = 1.0
outvalue = 0.1
int_width = 60.0
variable = c
[../]
[]
[Kernels]
[./c_res]
type = SplitCHParsed
variable = c
kappa_name = kappa
w = w
f_name = F
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[]
[Materials]
[./Copper]
type = PFParamsPolyFreeEnergy
c = c
T = 1000 # K
int_width = 30.0
length_scale = 1.0e-9
time_scale = 1.0e-9
D0 = 3.1e-5 # m^2/s, from Brown1980
Em = 0.71 # in eV, from Balluffi1978 Table 2
Ef = 1.28 # in eV, from Balluffi1978 Table 2
surface_energy = 0.7 # Total guess
[../]
[./free_energy]
type = PolynomialFreeEnergy
c = c
derivative_order = 2
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
l_max_its = 30
l_tol = 1.0e-4
nl_rel_tol = 1.0e-8
start_time = 0.0
num_steps = 50
dt = 15
petsc_options_iname = -pc_type
petsc_options_value = lu
[]
[Outputs]
exodus = true
[]
(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/mobility_derivative/mobility_derivative_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 30
ny = 30
xmax = 30.0
ymax = 30.0
elem_type = QUAD4
[]
[Variables]
[./c]
[../]
[./w]
[../]
[]
[ICs]
[./c_IC]
type = CrossIC
x1 = 0.0
x2 = 30.0
y1 = 0.0
y2 = 30.0
variable = c
[../]
[]
[Kernels]
[./cres]
type = SplitCHParsed
variable = c
kappa_name = kappa_c
w = w
f_name = F
[../]
[./wres]
type = SplitCHWRes
variable = w
mob_name = M
coupled_variables = c
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[]
[BCs]
[./Periodic]
[./all]
auto_direction = 'x y'
[../]
[../]
[]
[Materials]
[./kappa]
type = GenericConstantMaterial
prop_names = 'kappa_c'
prop_values = '2.0'
[../]
[./mob]
type = DerivativeParsedMaterial
property_name = M
coupled_variables = c
expression = '1-0.9*c^2'
outputs = exodus
derivative_order = 1
[../]
[./free_energy]
type = MathEBFreeEnergy
property_name = F
c = c
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
off_diag_row = 'w c'
off_diag_column = 'c w'
[../]
[]
[Executioner]
type = Transient
scheme = 'BDF2'
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 lu 1'
l_max_its = 30
l_tol = 1.0e-4
nl_max_its = 50
nl_rel_tol = 1.0e-10
dt = 10.0
num_steps = 2
[]
[Outputs]
exodus = true
[]
(modules/phase_field/test/tests/rigidbodymotion/grain_motion.i)
# test file for applyting advection term and observing rigid body motion of grains
[Mesh]
type = GeneratedMesh
dim = 2
nx = 25
ny = 15
nz = 0
xmax = 50
ymax = 25
zmax = 0
elem_type = QUAD4
[]
[Variables]
[./c]
order = FIRST
family = LAGRANGE
[../]
[./w]
order = FIRST
family = LAGRANGE
[../]
[./eta]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
w = w
coupled_variables = eta
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[./motion]
type = MultiGrainRigidBodyMotion
variable = w
c = c
v = eta
grain_tracker_object = grain_center
grain_force = grain_force
grain_volumes = grain_volumes
[../]
[./eta_dot]
type = TimeDerivative
variable = eta
[../]
[./vadv_eta]
type = SingleGrainRigidBodyMotion
variable = eta
c = c
v = eta
grain_tracker_object = grain_center
grain_force = grain_force
grain_volumes = grain_volumes
[../]
[./acint_eta]
type = ACInterface
variable = eta
mob_name = M
coupled_variables = c
kappa_name = kappa_eta
[../]
[./acbulk_eta]
type = AllenCahn
variable = eta
mob_name = M
f_name = F
coupled_variables = c
[../]
[]
[Materials]
[./pfmobility]
type = GenericConstantMaterial
prop_names = 'M kappa_c kappa_eta'
prop_values = '5.0 2.0 0.1'
[../]
[./free_energy]
type = DerivativeParsedMaterial
coupled_variables = 'c eta'
constant_names = 'barr_height cv_eq'
constant_expressions = '0.1 1.0e-2'
expression = 16*barr_height*(c-cv_eq)^2*(1-cv_eq-c)^2+(c-eta)^2
derivative_order = 2
[../]
[]
[VectorPostprocessors]
[./forces]
type = GrainForcesPostprocessor
grain_force = grain_force
[../]
[./grain_volumes]
type = FeatureVolumeVectorPostprocessor
flood_counter = grain_center
execute_on = 'initial timestep_begin'
[../]
[]
[UserObjects]
[./grain_center]
type = GrainTracker
variable = eta
outputs = none
compute_var_to_feature_map = true
execute_on = 'initial timestep_begin'
[../]
[./grain_force]
type = ConstantGrainForceAndTorque
execute_on = 'linear nonlinear'
force = '0.5 0.0 0.0 '
torque = '0.0 0.0 10.0 '
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
nl_max_its = 30
scheme = bdf2
solve_type = NEWTON
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly lu 1'
l_max_its = 30
l_tol = 1.0e-4
nl_rel_tol = 1.0e-10
start_time = 0.0
dt = 0.2
num_steps = 1
[]
[Outputs]
exodus = true
[]
[ICs]
[./rect_c]
y2 = 20.0
y1 = 5.0
inside = 1.0
x2 = 30.0
variable = c
x1 = 10.0
type = BoundingBoxIC
[../]
[./rect_eta]
y2 = 20.0
y1 = 5.0
inside = 1.0
x2 = 30.0
variable = eta
x1 = 10.0
type = BoundingBoxIC
[../]
[]
(modules/phase_field/test/tests/MultiPhase/switchingfunctionmultiphasematerial.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 30
ny = 30
xmin = 0
xmax = 30
ymin = 0
ymax = 30
[]
[Variables]
[./c]
[../]
[./w]
[../]
[./eta1]
[../]
[./eta2]
[../]
[./eta3]
[../]
[./eta0]
[../]
[]
[ICs]
[./IC_eta2]
x1 = 0
y1 = 15
x2 = 30
y2 = 30
inside = 1.0
outside = 0.0
type = BoundingBoxIC
variable = eta2
int_width = 0
[../]
[./IC_eta3]
x1 = 15
y1 = 0
x2 = 30
y2 = 15
inside = 1.0
outside = 0.0
type = BoundingBoxIC
variable = eta3
int_width = 0
[../]
[./IC_eta4]
x1 = 0
y1 = 0
x2 = 15
y2 = 15
inside = 1.0
outside = 0.0
type = BoundingBoxIC
variable = eta0
int_width = 0
[../]
[./IC_c]
x1 = 15
y1 = 15
radius = 8.0
outvalue = 0.05
variable = c
invalue = 1.0
type = SmoothCircleIC
int_width = 3.0
[../]
[./IC_eta1]
x1 = 15
y1 = 15
radius = 8.0
outvalue = 0.0
variable = eta1
invalue = 1.0
type = SmoothCircleIC
int_width = 3.0
[../]
[]
# Not evalulating time evolution to improve test performance, since we are only testing
# the material property. However, the kernel and free energy are left in place to allow
# this test to be easily turned in to a working example
#[Kernels]
# [./c_dot]
# type = CoupledTimeDerivative
# variable = w
# v = c
# [../]
# [./c_res]
# type = SplitCHParsed
# variable = c
# f_name = F
# kappa_name = kappa_c
# w = w
# coupled_variables = 'eta1 eta2 eta3 eta0'
# [../]
# [./w_res]
# # coupled_variables = 'c'
# type = SplitCHWRes
# variable = w
# mob_name = M
# [../]
# [./AC1_bulk]
# type = AllenCahn
# variable = eta1
# f_name = F
# coupled_variables = 'c eta2 eta3 eta0'
# [../]
# [./AC1_int]
# type = ACInterface
# variable = eta1
# kappa_name = kappa_s
# [../]
# [./e1_dot]
# type = TimeDerivative
# variable = eta1
# [../]
# [./AC2_bulk]
# type = AllenCahn
# variable = eta2
# f_name = F
# coupled_variables = 'c eta1 eta3 eta0'
# [../]
# [./AC2_int]
# type = ACInterface
# variable = eta2
# [../]
# [./e2_dot]
# type = TimeDerivative
# variable = eta2
# [../]
# [./AC3_bulk]
# type = AllenCahn
# variable = eta3
# f_name = F
# coupled_variables = 'c eta2 eta1 eta0'
# [../]
# [./AC3_int]
# type = ACInterface
# variable = eta3
# [../]
# [./e3_dot]
# type = TimeDerivative
# variable = eta3
# [../]
# [./AC4_bulk]
# type = AllenCahn
# variable = eta0
# f_name = F
# coupled_variables = 'c eta2 eta3 eta1'
# [../]
# [./AC4_int]
# type = ACInterface
# variable = eta0
# [../]
# [./e4_dot]
# type = TimeDerivative
# variable = eta0
# [../]
#[]
[Materials]
[./ha_test]
type = SwitchingFunctionMultiPhaseMaterial
h_name = ha
all_etas = 'eta0 eta1 eta2 eta3'
phase_etas = 'eta1'
outputs = exodus
[../]
[./hb_test]
type = SwitchingFunctionMultiPhaseMaterial
h_name = hb
all_etas = 'eta0 eta1 eta2 eta3'
phase_etas = 'eta0 eta2 eta3'
outputs = exodus
[../]
#[./ha]
# type = DerivativeParsedMaterial
# coupled_variables = 'eta1 eta2 eta3 eta0'
# property_name = ha_parsed
# expression = 'eta1^2/(eta1^2+eta2^2+eta3^2+eta0^2)'
# derivative_order = 2
# outputs = exodus
#[../]
#[./hb]
# type = DerivativeParsedMaterial
# coupled_variables = 'eta1 eta2 eta3 eta0'
# property_name = hb_parsed
# expression = '(eta2^2+eta3^2+eta0^2)/(eta1^2+eta2^2+eta3^2+eta0^2)'
# derivative_order = 2
# outputs = exodus
#[../]
#[./FreeEng]
# type = DerivativeParsedMaterial
# coupled_variables = 'c eta1 eta2 eta3 eta0'
# property_name = F
# constant_names = 'c1 c2 s g d e h z'
# constant_expressions = '1.0 0.0 1.5 1.5 1.0 1.0 1 1.0'
# material_property_names = 'ha(eta1,eta2,eta3,eta0) hb(eta1,eta2,eta3,eta0)'
# expression = 'a:=eta1^2/(eta1^2+eta2^2+eta3^2+eta0^2);f1:=ha*(c-c1)^2;b:=(eta2^2+eta3^2+eta0^2)/(eta1^2+eta2^2+eta3^2+eta0^2);f2:=hb*(c-c2)^2
# ;f3:=1/4*eta1^4-1/2*eta1^2+1/4*eta2^4-1/2*eta2^2+1/4*eta3^4-1/2*eta3^2+1/4*eta0^4-1/2*eta0^2
# ;f4:=z*s*(eta1^2*eta2^2+eta1^2*eta3^2+eta1^2*eta0^2)+g*(eta2^2*eta3^2+eta2^2*eta0^2+eta3^2*eta0^2);f:=1/4+e*f1+d*f2+h*(f3+f4);f'
# derivative_order = 2
#[../]
[./const]
type = GenericConstantMaterial
prop_names = 'kappa_c kappa_s kappa_op L M'
prop_values = '0 3 3 1.0 1.0'
outputs = exodus
[../]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Problem]
solve = false
kernel_coverage_check = false
[]
[Outputs]
exodus = true
[]
(modules/phase_field/test/tests/TotalFreeEnergy/TotalFreeEnergy_test.i)
#
# Test the TotalFreeEnergy auxkernel, which outputs both the sum of the bulk and interfacial free energies. This test has only one variable.
#
[Mesh]
type = GeneratedMesh
dim = 2
nx = 30
ny = 30
nz = 0
xmin = 0
xmax = 250
ymin = 0
ymax = 250
zmin = 0
zmax = 0
elem_type = QUAD4
[]
[Variables]
[./c]
[../]
[./w]
[../]
[]
[AuxVariables]
[./local_free_energy]
order = CONSTANT
family = MONOMIAL
[../]
[]
[ICs]
[./cIC]
type = SmoothCircleIC
variable = c
x1 = 125.0
y1 = 125.0
radius = 60.0
invalue = 1.0
outvalue = 0.1
int_width = 30.0
[../]
[]
[Kernels]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
w = w
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[]
[AuxKernels]
[./local_free_energy]
type = TotalFreeEnergy
variable = local_free_energy
kappa_names = kappa_c
interfacial_vars = c
[../]
[]
[Materials]
[./pfmobility]
type = GenericConstantMaterial
prop_names = 'M kappa_c'
prop_values = '1e-3 0.1'
[../]
[./free_energy]
type = DerivativeParsedMaterial
coupled_variables = c
constant_names = 'barr_height cv_eq'
constant_expressions = '0.1 1.0e-2'
expression = 16*barr_height*(c-cv_eq)^2*(1-cv_eq-c)^2
derivative_order = 2
[../]
[]
[Postprocessors]
[./total_free_energy]
type = ElementIntegralVariablePostprocessor
variable = local_free_energy
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
petsc_options_iname = -pc_type
petsc_options_value = lu
l_max_its = 30
l_tol = 1.0e-4
nl_rel_tol = 1.0e-10
start_time = 0.0
num_steps = 6
dt = 200
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(modules/phase_field/test/tests/PolynomialFreeEnergy/split_order8_test.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 15
xmin = 0
xmax = 125
[]
[GlobalParams]
polynomial_order = 8
[]
[Variables]
[./c]
[../]
[./w]
[../]
[]
[ICs]
[./c_IC]
type = SmoothCircleIC
x1 = 0.0
y1 = 0.0
radius = 60.0
invalue = 1.0
outvalue = 0.1
int_width = 60.0
variable = c
[../]
[]
[Kernels]
[./c_res]
type = SplitCHParsed
variable = c
kappa_name = kappa
w = w
f_name = F
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[]
[Materials]
[./Copper]
type = PFParamsPolyFreeEnergy
c = c
T = 1000 # K
int_width = 30.0
length_scale = 1.0e-9
time_scale = 1.0e-9
D0 = 3.1e-5 # m^2/s, from Brown1980
Em = 0.71 # in eV, from Balluffi1978 Table 2
Ef = 1.28 # in eV, from Balluffi1978 Table 2
surface_energy = 0.7 # Total guess
[../]
[./free_energy]
type = PolynomialFreeEnergy
c = c
derivative_order = 2
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
l_max_its = 30
l_tol = 1.0e-4
nl_rel_tol = 1.0e-8
start_time = 0.0
num_steps = 50
dt = 15
petsc_options_iname = -pc_type
petsc_options_value = lu
[]
[Outputs]
exodus = true
[]
(modules/combined/examples/periodic_strain/global_strain_pfm_3D.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 3
nx = 20
ny = 20
nz = 20
xmin = -0.5
xmax = 0.5
ymin = -0.5
ymax = 0.5
zmin = -0.5
zmax = 0.5
[]
[./cnode]
input = gen
type = ExtraNodesetGenerator
coord = '0.0 0.0 0.0'
new_boundary = 100
[../]
[]
[Variables]
[./u_x]
[../]
[./u_y]
[../]
[./u_z]
[../]
[./global_strain]
order = SIXTH
family = SCALAR
[../]
[./c]
[./InitialCondition]
type = FunctionIC
function = 'sin(2*x*pi)*sin(2*y*pi)*sin(2*z*pi)*0.05+0.6'
[../]
[../]
[./w]
[../]
[]
[AuxVariables]
[./local_energy]
order = CONSTANT
family = MONOMIAL
[../]
[./disp_x]
[../]
[./disp_y]
[../]
[./disp_z]
[../]
[./s00]
order = CONSTANT
family = MONOMIAL
[../]
[./s01]
order = CONSTANT
family = MONOMIAL
[../]
[./s10]
order = CONSTANT
family = MONOMIAL
[../]
[./s11]
order = CONSTANT
family = MONOMIAL
[../]
[./e00]
order = CONSTANT
family = MONOMIAL
[../]
[./e01]
order = CONSTANT
family = MONOMIAL
[../]
[./e10]
order = CONSTANT
family = MONOMIAL
[../]
[./e11]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./disp_x]
type = GlobalDisplacementAux
variable = disp_x
scalar_global_strain = global_strain
global_strain_uo = global_strain_uo
component = 0
[../]
[./disp_y]
type = GlobalDisplacementAux
variable = disp_y
scalar_global_strain = global_strain
global_strain_uo = global_strain_uo
component = 1
[../]
[./disp_z]
type = GlobalDisplacementAux
variable = disp_z
scalar_global_strain = global_strain
global_strain_uo = global_strain_uo
component = 2
[../]
[./local_free_energy]
type = TotalFreeEnergy
execute_on = 'initial LINEAR'
variable = local_energy
interfacial_vars = 'c'
kappa_names = 'kappa_c'
[../]
[./s00]
type = RankTwoAux
variable = s00
rank_two_tensor = stress
index_i = 0
index_j = 0
[../]
[./s01]
type = RankTwoAux
variable = s01
rank_two_tensor = stress
index_i = 0
index_j = 1
[../]
[./s10]
type = RankTwoAux
variable = s10
rank_two_tensor = stress
index_i = 1
index_j = 0
[../]
[./s11]
type = RankTwoAux
variable = s11
rank_two_tensor = stress
index_i = 1
index_j = 1
[../]
[./e00]
type = RankTwoAux
variable = e00
rank_two_tensor = total_strain
index_i = 0
index_j = 0
[../]
[./e01]
type = RankTwoAux
variable = e01
rank_two_tensor = total_strain
index_i = 0
index_j = 1
[../]
[./e10]
type = RankTwoAux
variable = e10
rank_two_tensor = total_strain
index_i = 1
index_j = 0
[../]
[./e11]
type = RankTwoAux
variable = e11
rank_two_tensor = total_strain
index_i = 1
index_j = 1
[../]
[]
[GlobalParams]
derivative_order = 2
enable_jit = true
displacements = 'u_x u_y u_z'
block = 0
[]
[Kernels]
[./TensorMechanics]
[../]
# Cahn-Hilliard kernels
[./c_dot]
type = CoupledTimeDerivative
variable = w
v = c
block = 0
[../]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
w = w
block = 0
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
block = 0
[../]
[]
[ScalarKernels]
[./global_strain]
type = GlobalStrain
variable = global_strain
global_strain_uo = global_strain_uo
[../]
[]
[BCs]
[./Periodic]
[./all]
auto_direction = 'x y z'
variable = 'c w u_x u_y u_z'
[../]
[../]
# fix center point location
[./centerfix_x]
type = DirichletBC
boundary = 100
variable = u_x
value = 0
[../]
[./centerfix_y]
type = DirichletBC
boundary = 100
variable = u_y
value = 0
[../]
[./centerfix_z]
type = DirichletBC
boundary = 100
variable = u_z
value = 0
[../]
[]
[Materials]
[./consts]
type = GenericConstantMaterial
prop_names = 'M kappa_c'
prop_values = '0.2 0.01 '
[../]
[./shear1]
type = GenericConstantRankTwoTensor
tensor_values = '0 0 0 0.5 0.5 0.5'
tensor_name = shear1
[../]
[./shear2]
type = GenericConstantRankTwoTensor
tensor_values = '0 0 0 -0.5 -0.5 -0.5'
tensor_name = shear2
[../]
[./expand3]
type = GenericConstantRankTwoTensor
tensor_values = '1 1 1 0 0 0'
tensor_name = expand3
[../]
[./weight1]
type = DerivativeParsedMaterial
expression = '0.3*c^2'
property_name = weight1
coupled_variables = c
[../]
[./weight2]
type = DerivativeParsedMaterial
expression = '0.3*(1-c)^2'
property_name = weight2
coupled_variables = c
[../]
[./weight3]
type = DerivativeParsedMaterial
expression = '4*(0.5-c)^2'
property_name = weight3
coupled_variables = c
[../]
[./elasticity_tensor]
type = ComputeElasticityTensor
C_ijkl = '1 1'
fill_method = symmetric_isotropic
[../]
[./strain]
type = ComputeSmallStrain
global_strain = global_strain
eigenstrain_names = eigenstrain
[../]
[./eigenstrain]
type = CompositeEigenstrain
tensors = 'shear1 shear2 expand3'
weights = 'weight1 weight2 weight3'
args = c
eigenstrain_name = eigenstrain
[../]
[./global_strain]
type = ComputeGlobalStrain
scalar_global_strain = global_strain
global_strain_uo = global_strain_uo
[../]
[./stress]
type = ComputeLinearElasticStress
[../]
# chemical free energies
[./chemical_free_energy]
type = DerivativeParsedMaterial
property_name = Fc
expression = '4*c^2*(1-c)^2'
coupled_variables = 'c'
outputs = exodus
output_properties = Fc
[../]
# elastic free energies
[./elastic_free_energy]
type = ElasticEnergyMaterial
f_name = Fe
args = 'c'
outputs = exodus
output_properties = Fe
[../]
# free energy (chemical + elastic)
[./free_energy]
type = DerivativeSumMaterial
block = 0
property_name = F
sum_materials = 'Fc Fe'
coupled_variables = 'c'
[../]
[]
[UserObjects]
[./global_strain_uo]
type = GlobalStrainUserObject
execute_on = 'Initial Linear Nonlinear'
[../]
[]
[Postprocessors]
[./total_free_energy]
type = ElementIntegralVariablePostprocessor
execute_on = 'initial TIMESTEP_END'
variable = local_energy
[../]
[./total_solute]
type = ElementIntegralVariablePostprocessor
execute_on = 'initial TIMESTEP_END'
variable = c
[../]
[./min]
type = ElementExtremeValue
execute_on = 'initial TIMESTEP_END'
value_type = min
variable = c
[../]
[./max]
type = ElementExtremeValue
execute_on = 'initial TIMESTEP_END'
value_type = max
variable = c
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = 'PJFNK'
line_search = basic
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly lu 1'
l_max_its = 30
nl_max_its = 12
l_tol = 1.0e-4
nl_rel_tol = 1.0e-8
nl_abs_tol = 1.0e-10
start_time = 0.0
end_time = 2.0
[./TimeStepper]
type = IterationAdaptiveDT
dt = 0.01
growth_factor = 1.5
cutback_factor = 0.8
optimal_iterations = 9
iteration_window = 2
[../]
[]
[Outputs]
execute_on = 'timestep_end'
print_linear_residuals = false
exodus = true
[./table]
type = CSV
delimiter = ' '
[../]
[]
(modules/phase_field/test/tests/phase_field_kernels/SimpleSplitCHWRes.i)
#
# Test the split parsed function free enery Cahn-Hilliard Bulk kernel
# The free energy used here has the same functional form as the SplitCHPoly kernel
# If everything works, the output of this test should replicate the output
# of marmot/tests/chpoly_test/CHPoly_Cu_Split_test.i (exodiff match)
#
[Mesh]
type = GeneratedMesh
dim = 2
nx = 15
ny = 15
nz = 0
xmin = 0
xmax = 250
ymin = 0
ymax = 250
zmin = 0
zmax = 0
elem_type = QUAD4
[]
[Variables]
[./c]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = SmoothCircleIC
x1 = 125.0
y1 = 125.0
radius = 60.0
invalue = 1.0
outvalue = 0.1
int_width = 30.0
[../]
[../]
[./w]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
w = w
[../]
[./w_res]
type = SimpleSplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[]
[Materials]
[./pfmobility]
type = GenericConstantMaterial
prop_names = 'M kappa_c'
prop_values = '1e-3 0.1'
[../]
[./free_energy]
type = DerivativeParsedMaterial
property_name = F
coupled_variables = 'c'
constant_names = 'barr_height cv_eq'
constant_expressions = '0.1 1.0e-2'
expression = 16*barr_height*(c-cv_eq)^2*(1-cv_eq-c)^2
derivative_order = 2
[../]
[]
[Preconditioning]
# active = ' '
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = 'NEWTON'
l_max_its = 30
l_tol = 1.0e-4
nl_rel_tol = 1.0e-10
start_time = 0.0
num_steps = 6
dt = 10
[]
[Outputs]
exodus = true
[]
(modules/combined/examples/periodic_strain/global_strain_pfm.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 50
ny = 50
xmin = -0.5
xmax = 0.5
ymin = -0.5
ymax = 0.5
[]
[./cnode]
input = gen
type = ExtraNodesetGenerator
coord = '0.0 0.0'
new_boundary = 100
[../]
[]
[Variables]
[./u_x]
[../]
[./u_y]
[../]
[./global_strain]
order = THIRD
family = SCALAR
[../]
[./c]
[./InitialCondition]
type = FunctionIC
function = 'sin(2*x*pi)*sin(2*y*pi)*0.05+0.6'
[../]
[../]
[./w]
[../]
[]
[AuxVariables]
[./local_energy]
order = CONSTANT
family = MONOMIAL
[../]
[./disp_x]
[../]
[./disp_y]
[../]
[./s00]
order = CONSTANT
family = MONOMIAL
[../]
[./s01]
order = CONSTANT
family = MONOMIAL
[../]
[./s10]
order = CONSTANT
family = MONOMIAL
[../]
[./s11]
order = CONSTANT
family = MONOMIAL
[../]
[./e00]
order = CONSTANT
family = MONOMIAL
[../]
[./e01]
order = CONSTANT
family = MONOMIAL
[../]
[./e10]
order = CONSTANT
family = MONOMIAL
[../]
[./e11]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./disp_x]
type = GlobalDisplacementAux
variable = disp_x
scalar_global_strain = global_strain
global_strain_uo = global_strain_uo
component = 0
[../]
[./disp_y]
type = GlobalDisplacementAux
variable = disp_y
scalar_global_strain = global_strain
global_strain_uo = global_strain_uo
component = 1
[../]
[./local_free_energy]
type = TotalFreeEnergy
execute_on = 'initial LINEAR'
variable = local_energy
interfacial_vars = 'c'
kappa_names = 'kappa_c'
[../]
[./s00]
type = RankTwoAux
variable = s00
rank_two_tensor = stress
index_i = 0
index_j = 0
[../]
[./s01]
type = RankTwoAux
variable = s01
rank_two_tensor = stress
index_i = 0
index_j = 1
[../]
[./s10]
type = RankTwoAux
variable = s10
rank_two_tensor = stress
index_i = 1
index_j = 0
[../]
[./s11]
type = RankTwoAux
variable = s11
rank_two_tensor = stress
index_i = 1
index_j = 1
[../]
[./e00]
type = RankTwoAux
variable = e00
rank_two_tensor = total_strain
index_i = 0
index_j = 0
[../]
[./e01]
type = RankTwoAux
variable = e01
rank_two_tensor = total_strain
index_i = 0
index_j = 1
[../]
[./e10]
type = RankTwoAux
variable = e10
rank_two_tensor = total_strain
index_i = 1
index_j = 0
[../]
[./e11]
type = RankTwoAux
variable = e11
rank_two_tensor = total_strain
index_i = 1
index_j = 1
[../]
[]
[GlobalParams]
derivative_order = 2
enable_jit = true
displacements = 'u_x u_y'
block = 0
[]
[Kernels]
[./TensorMechanics]
[../]
# Cahn-Hilliard kernels
[./c_dot]
type = CoupledTimeDerivative
variable = w
v = c
block = 0
[../]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
w = w
block = 0
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
block = 0
[../]
[]
[ScalarKernels]
[./global_strain]
type = GlobalStrain
variable = global_strain
global_strain_uo = global_strain_uo
[../]
[]
[BCs]
[./Periodic]
[./all]
auto_direction = 'x y'
variable = 'c w u_x u_y'
[../]
[../]
# fix center point location
[./centerfix_x]
type = DirichletBC
boundary = 100
variable = u_x
value = 0
[../]
[./centerfix_y]
type = DirichletBC
boundary = 100
variable = u_y
value = 0
[../]
[]
[Materials]
[./consts]
type = GenericConstantMaterial
prop_names = 'M kappa_c'
prop_values = '0.2 0.01 '
[../]
[./shear1]
type = GenericConstantRankTwoTensor
tensor_values = '0 0 0 0 0 0.5'
tensor_name = shear1
[../]
[./shear2]
type = GenericConstantRankTwoTensor
tensor_values = '0 0 0 0 0 -0.5'
tensor_name = shear2
[../]
[./expand3]
type = GenericConstantRankTwoTensor
tensor_values = '1 1 0 0 0 0'
tensor_name = expand3
[../]
[./weight1]
type = DerivativeParsedMaterial
expression = '0.3*c^2'
property_name = weight1
coupled_variables = c
[../]
[./weight2]
type = DerivativeParsedMaterial
expression = '0.3*(1-c)^2'
property_name = weight2
coupled_variables = c
[../]
[./weight3]
type = DerivativeParsedMaterial
expression = '4*(0.5-c)^2'
property_name = weight3
coupled_variables = c
[../]
[./elasticity_tensor]
type = ComputeElasticityTensor
C_ijkl = '1 1'
fill_method = symmetric_isotropic
[../]
[./strain]
type = ComputeSmallStrain
global_strain = global_strain
eigenstrain_names = eigenstrain
[../]
[./eigenstrain]
type = CompositeEigenstrain
tensors = 'shear1 shear2 expand3'
weights = 'weight1 weight2 weight3'
args = c
eigenstrain_name = eigenstrain
[../]
[./global_strain]
type = ComputeGlobalStrain
scalar_global_strain = global_strain
global_strain_uo = global_strain_uo
[../]
[./stress]
type = ComputeLinearElasticStress
[../]
# chemical free energies
[./chemical_free_energy]
type = DerivativeParsedMaterial
property_name = Fc
expression = '4*c^2*(1-c)^2'
coupled_variables = 'c'
outputs = exodus
output_properties = Fc
[../]
# elastic free energies
[./elastic_free_energy]
type = ElasticEnergyMaterial
f_name = Fe
args = 'c'
outputs = exodus
output_properties = Fe
[../]
# free energy (chemical + elastic)
[./free_energy]
type = DerivativeSumMaterial
block = 0
property_name = F
sum_materials = 'Fc Fe'
coupled_variables = 'c'
[../]
[]
[UserObjects]
[./global_strain_uo]
type = GlobalStrainUserObject
execute_on = 'Initial Linear Nonlinear'
[../]
[]
[Postprocessors]
[./total_free_energy]
type = ElementIntegralVariablePostprocessor
execute_on = 'initial TIMESTEP_END'
variable = local_energy
[../]
[./total_solute]
type = ElementIntegralVariablePostprocessor
execute_on = 'initial TIMESTEP_END'
variable = c
[../]
[./min]
type = ElementExtremeValue
execute_on = 'initial TIMESTEP_END'
value_type = min
variable = c
[../]
[./max]
type = ElementExtremeValue
execute_on = 'initial TIMESTEP_END'
value_type = max
variable = c
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = 'PJFNK'
line_search = basic
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly lu 1'
l_max_its = 30
nl_max_its = 12
l_tol = 1.0e-4
nl_rel_tol = 1.0e-8
nl_abs_tol = 1.0e-10
start_time = 0.0
end_time = 2.0
[./TimeStepper]
type = IterationAdaptiveDT
dt = 0.01
growth_factor = 1.5
cutback_factor = 0.8
optimal_iterations = 9
iteration_window = 2
[../]
[]
[Outputs]
execute_on = 'timestep_end'
print_linear_residuals = false
exodus = true
[./table]
type = CSV
delimiter = ' '
[../]
[]
(modules/phase_field/tutorials/spinodal_decomposition/s5_energycurve.i)
#
# Example simulation of an iron-chromium alloy at 500 C. Equilibrium
# concentrations are at 23.6 and 82.3 mol% Cr. Kappa value, free energy equation,
# and mobility equation were provided by Lars Hoglund. Solved using the split
# form of the Cahn-Hilliard equation.
[Mesh]
type = GeneratedMesh
dim = 2
elem_type = QUAD4
nx = 25
ny = 25
nz = 0
xmin = 0
xmax = 25
ymin = 0
ymax = 25
zmin = 0
zmax = 0
uniform_refine = 2
[]
[Variables]
[./c] # Mole fraction of Cr (unitless)
order = FIRST
family = LAGRANGE
scaling = 1e+04
[../]
[./w] # Chemical potential (eV/mol)
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./f_density] # Local energy density (eV/mol)
order = CONSTANT
family = MONOMIAL
[../]
[]
[ICs]
[./concentrationIC] # 46.774 mol% Cr with variations
type = RandomIC
min = 0.44774
max = 0.48774
seed = 210
variable = c
[../]
[]
[BCs]
[./Periodic]
[./c_bcs]
auto_direction = 'x y'
[../]
[../]
[]
[Kernels]
[./w_dot]
variable = w
v = c
type = CoupledTimeDerivative
[../]
[./coupled_res]
variable = w
type = SplitCHWRes
mob_name = M
[../]
[./coupled_parsed]
variable = c
type = SplitCHParsed
f_name = f_loc
kappa_name = kappa_c
w = w
[../]
[]
[AuxKernels]
# Calculates the energy density by combining the local and gradient energies
[./f_density] # (eV/mol/nm^2)
type = TotalFreeEnergy
variable = f_density
f_name = 'f_loc'
kappa_names = 'kappa_c'
interfacial_vars = c
[../]
[]
[Materials]
# d is a scaling factor that makes it easier for the solution to converge
# without changing the results. It is defined in each of the first three
# materials and must have the same value in each one.
[./kappa] # Gradient energy coefficient (eV nm^2/mol)
type = GenericFunctionMaterial
prop_names = 'kappa_c'
prop_values = '8.125e-16*6.24150934e+18*1e+09^2*1e-27'
# kappa_c *eV_J*nm_m^2* d
[../]
[./mobility] # Mobility (nm^2 mol/eV/s)
# NOTE: This is a fitted equation, so only 'Conv' has units
type = DerivativeParsedMaterial
property_name = M
coupled_variables = c
constant_names = 'Acr Bcr Ccr Dcr
Ecr Fcr Gcr
Afe Bfe Cfe Dfe
Efe Ffe Gfe
nm_m eV_J d'
constant_expressions = '-32.770969 -25.8186669 -3.29612744 17.669757
37.6197853 20.6941796 10.8095813
-31.687117 -26.0291774 0.2286581 24.3633544
44.3334237 8.72990497 20.956768
1e+09 6.24150934e+18 1e-27'
expression = 'nm_m^2/eV_J/d*((1-c)^2*c*10^
(Acr*c+Bcr*(1-c)+Ccr*c*log(c)+Dcr*(1-c)*log(1-c)+
Ecr*c*(1-c)+Fcr*c*(1-c)*(2*c-1)+Gcr*c*(1-c)*(2*c-1)^2)
+c^2*(1-c)*10^
(Afe*c+Bfe*(1-c)+Cfe*c*log(c)+Dfe*(1-c)*log(1-c)+
Efe*c*(1-c)+Ffe*c*(1-c)*(2*c-1)+Gfe*c*(1-c)*(2*c-1)^2))'
derivative_order = 1
outputs = exodus
[../]
[./local_energy] # Local free energy function (eV/mol)
type = DerivativeParsedMaterial
property_name = f_loc
coupled_variables = c
constant_names = 'A B C D E F G eV_J d'
constant_expressions = '-2.446831e+04 -2.827533e+04 4.167994e+03 7.052907e+03
1.208993e+04 2.568625e+03 -2.354293e+03
6.24150934e+18 1e-27'
expression = 'eV_J*d*(A*c+B*(1-c)+C*c*log(c)+D*(1-c)*log(1-c)+
E*c*(1-c)+F*c*(1-c)*(2*c-1)+G*c*(1-c)*(2*c-1)^2)'
derivative_order = 2
[../]
[./precipitate_indicator] # Returns 1/625 if precipitate
type = ParsedMaterial
property_name = prec_indic
coupled_variables = c
expression = if(c>0.6,0.0016,0)
[../]
[]
[Postprocessors]
[./step_size] # Size of the time step
type = TimestepSize
[../]
[./iterations] # Number of iterations needed to converge timestep
type = NumNonlinearIterations
[../]
[./nodes] # Number of nodes in mesh
type = NumNodes
[../]
[./evaluations] # Cumulative residual calculations for simulation
type = NumResidualEvaluations
[../]
[./total_energy] # Total free energy at each timestep
type = ElementIntegralVariablePostprocessor
variable = f_density
execute_on = 'initial timestep_end'
[../]
[./num_features] # Number of precipitates formed
type = FeatureFloodCount
variable = c
threshold = 0.6
[../]
[./precipitate_area] # Fraction of surface devoted to precipitates
type = ElementIntegralMaterialProperty
mat_prop = prec_indic
[../]
[./active_time] # Time computer spent on simulation
type = PerfGraphData
section_name = "Root"
data_type = total
[../]
[]
[Preconditioning]
[./coupled]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
l_max_its = 30
l_tol = 1e-6
nl_max_its = 50
nl_abs_tol = 1e-9
end_time = 604800 # 7 days
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type
-sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly
ilu 1'
[./TimeStepper]
type = IterationAdaptiveDT
dt = 10
cutback_factor = 0.8
growth_factor = 1.5
optimal_iterations = 7
[../]
[./Adaptivity]
coarsen_fraction = 0.1
refine_fraction = 0.7
max_h_level = 2
[../]
[]
[Outputs]
exodus = true
console = true
csv = true
[./console]
type = Console
max_rows = 10
[../]
[]