Custom Phase Field Actions
To simplify the formation of input files that use standard Allen-Cahn and Cahn-Hilliard equations, custom actions have been created that automatically create conserved and nonconserved phase field field variables and all the corresponding kernels. Additional kernels can still be added using standard MOOSE syntax.
The actions are in the phase field block, under the modules block. Nonconserved variables are created using NonconservedAction. For an example, see
[Modules]
[./PhaseField]
[./Nonconserved]
[./eta]
free_energy = F
kappa = 2.0
mobility = 1.0
variable_mobility = false
[../]
[../]
[../]
[]
(modules/phase_field/test/tests/actions/Nonconserved_1var.i)Conserved variables are created using ConservedAction. For an example, See
[Modules]
[./PhaseField]
[./Conserved]
[./cv]
solve_type = REVERSE_SPLIT
free_energy = F
kappa = 2.0
mobility = 1.0
[../]
[../]
[../]
[]
(modules/phase_field/test/tests/actions/conserved_split_1var.i)and
[Modules]
[./PhaseField]
[./Conserved]
[./cv]
solve_type = direct
free_energy = F
kappa = 2.0
mobility = 1.0
[../]
[../]
[../]
[]
(modules/phase_field/test/tests/actions/conserved_direct_1var.i)(modules/phase_field/test/tests/actions/Nonconserved_1var.i)
#
# Test the parsed function free enery Allen-Cahn Bulk kernel
#
[Mesh]
type = GeneratedMesh
dim = 2
nx = 40
ny = 40
xmax = 40
ymax = 40
elem_type = QUAD
[]
[Modules]
[./PhaseField]
[./Nonconserved]
[./eta]
free_energy = F
kappa = 2.0
mobility = 1.0
variable_mobility = false
[../]
[../]
[../]
[]
[ICs]
[./InitialCondition]
type = SmoothCircleIC
variable = eta
x1 = 20.0
y1 = 20.0
radius = 6.0
invalue = 0.9
outvalue = 0.1
int_width = 3.0
[../]
[]
[Materials]
[./free_energy]
type = DerivativeParsedMaterial
property_name = F
coupled_variables = 'eta'
expression = '2 * eta^2 * (1-eta)^2 - 0.2*eta'
derivative_order = 2
[../]
[]
[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
num_steps = 10
dt = 1.0
[]
[Outputs]
exodus = true
[]
(modules/phase_field/test/tests/actions/conserved_split_1var.i)
#
# Test the conserved action with split solve and 1 variable
#
[Mesh]
type = GeneratedMesh
dim = 2
nx = 50
ny = 50
xmax = 50
ymax = 50
elem_type = QUAD
[]
[Modules]
[./PhaseField]
[./Conserved]
[./cv]
solve_type = REVERSE_SPLIT
free_energy = F
kappa = 2.0
mobility = 1.0
[../]
[../]
[../]
[]
[ICs]
[./InitialCondition]
type = CrossIC
x1 = 5.0
y1 = 5.0
x2 = 45.0
y2 = 45.0
variable = cv
[../]
[]
[Materials]
[./free_energy]
type = DerivativeParsedMaterial
property_name = F
coupled_variables = 'cv'
expression = '(1-cv)^2 * (1+cv)^2'
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
solve_type = 'NEWTON'
l_max_its = 30
l_tol = 1.0e-5
nl_max_its = 10
nl_rel_tol = 1.0e-12
start_time = 0.0
num_steps = 5
dt = 0.7
[]
[Outputs]
exodus = true
[]
(modules/phase_field/test/tests/actions/conserved_direct_1var.i)
#
# Test consreved action for direct solve
#
[Mesh]
type = GeneratedMesh
dim = 2
nx = 16
ny = 16
xmax = 50
ymax = 50
elem_type = QUAD
[]
[Modules]
[./PhaseField]
[./Conserved]
[./cv]
solve_type = direct
free_energy = F
kappa = 2.0
mobility = 1.0
[../]
[../]
[../]
[]
[ICs]
[./InitialCondition]
type = CrossIC
x1 = 5.0
y1 = 5.0
x2 = 45.0
y2 = 45.0
variable = cv
[../]
[]
[Materials]
[./free_energy]
type = DerivativeParsedMaterial
property_name = F
coupled_variables = 'cv'
expression = '(1-cv)^2 * (1+cv)^2'
[../]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
solve_type = 'NEWTON'
l_max_its = 30
l_tol = 1.0e-4
nl_max_its = 10
nl_rel_tol = 1.0e-10
start_time = 0.0
num_steps = 5
dt = 0.7
[]
[Outputs]
[./out]
type = Exodus
refinements = 2
[../]
[]