- variableArray of coupled variables
C++ Type:std::vector<VariableName>
Controllable:No
Description:Array of coupled variables
GrainTracker
The Grain Tracker is a utility that may be used in phase-field simulations to reduce the number of order parameters needed to model a large polycrystal system. The GrainTracker utilizes the FeatureFloodCount object for identifying and extracting individual grains from a solution field. Once the FeatureFloodCount object has identified all grains, the GrainTracker does two things:
Match up grains from the current timestep with grains from the previous timestep.
Remap grains that are "close" to coming into contact.
Grain Tracking
The ability to track features over time is of interest for many simulation types. Here we present an algorithm for tracking arbitrary features on an unstructured mesh over time. The tracking stage is responsible for maintaining consistent and unique identification for an arbitrary number of moving and interacting features over time. The tracking stage is the only stage in the algorithm which requires stateful data between time steps. This is important from an implementation perspective as it can have an affect on the ability of a simulation to checkpoint, terminate, and successfully restart. Restart capabilities are useful for handling hardware faults or spreading out a long running simulation over several execution windows common in high performance computing environments.
During the first invocation of the feature tracking stage there is no previous feature data to compare against so no tracking is performed. Instead a set of IDs must be assigned to each identified feature. These IDs may be supplied externally if desired. In fact there are no restrictions on the IDs if supplied externally. The IDs need not be contiguous nor must they be unique. However, if separate features are assigned duplicate IDs and those features come into contact during a simulation, the data will be coalesced, which may or may not result in a correct simulation. If an external assignment is not desired, the feature tracking algorithm will assign a set of contiguous and unique IDs to each individual feature. This is accomplished by first sorting the identified features by the min element ID stored in each feature's data structure and assigning a number based on the sorted position. This strategy ensures a stable sorting insusceptible to different mesh partitionings.
On subsequent invocations, the feature information from the previous time step is compared against all of the features from the current time step and organized such that the best matches for all features is determined correctly. The comparison criterion is to globally minimize the centroid distances of all features simultaneously. The centroid is calculated by averaging the element centroids making up each feature. As we iterate over the new list of features, we select the feature in the previous list that is closest by centroid distance. This pairing is saved into a "best match" data structure while the remaining features are being processed.
It's possible for features to compete for the same "best match" feature on the previous time step. This indicates that a feature has been absorbed or has otherwise disappeared on the current step and that its corresponding feature from the previous step is incorrectly identifying an unrelated feature as the best match. This case is handled by marking the feature with the greater centroid distance mismatch as inactive.
When all pairs have been compared, all of the features in the best match data structure are marked ("matched") and the IDs from the previous time step are saved into the corresponding matches in the current time step. Unmatched features from both the new list and previous lists are then handled. The features in the previous list that are unmatched are marked as inactive. The unmatched features in the current list are "new", meaning that they haven't been previously identified. The former case occurs when there are exactly zero features in the current list, meaning any feature in the previous list will remain unmatched. The latter case can occur when a feature splits or when a new feature is created.
Grain Remapping
Grain remapping is implemented using a recursive backtracking algorithm capable of performing several variable swaps to transform the improperly colored grain graph into a proper one. This backtracking algorithm runs only on the root process which is the only processor that contains the complete global grain graph. When a pair of grains are located that are in close proximity Figure 1 and Figure 2, one of them is arbitrarily chosen and designated as the "target" grain indicating that we seek to remap its defining variable values to a different solution variable. Depending on the number of neighbors a graph has and the variables representing each of those neighbors, it may or may not be possible to create a valid graph by remapping only the target grain. In this case a depth-limited, depth-first search is performed seeking a series of neighbor swaps to leave the graph in a valid state.
To begin, an array of lists of size is built and populated, where is the number of variables (colors) in use. For each variable the nearest grain represented by that variable (as determined by the bounding box distance) is located and its distance is stored in the list at the corresponding array position along with the grain ID itself. In cases where the nearest bounding boxes for a given variable overlap the target grain, we maintain a negative count representing the total number of overlaps and the ID of each grain which overlaps. Otherwise we store the closest bounding box edge to bounding box edge distance for the given variable. We don't bother to calculate or store any information for grains with matching variable indices, or for grains that live on a reserved order parameter since those variables are ineligible for remapping. If there are any empty order parameters (an order parameter representing zero grains), a distance of infinity () is entered into the corresponding position prioritizing those variables for remapping. This color distance'' array is then sorted in reverse order putting the grains furthest away near the front and leaving those with several overlaps near the back.
Variable | Distance |
---|---|
A | |
B | -2.0 |
C | -1.0 |
D | -3.0 |
A case with all negative distances is illustrated in Table 1. In this example, the target grain is chosen as the large grain labeled , centered on the right side of the image. All of the other colors have at least one bounding box that overlaps the large grain: 2 for , 1 for , and 3 for . The empty list () is used for the variable represented by the target grain to ensure that the same variable is never considered as a possible remapping option.
Variable | Distance |
---|---|
A | 52.6 |
B | 4.2 |
C | |
D | -1.0 |
We iterate over the array of distances looking for available variables suitable for remapping the target grain. If a positive value is encountered, the grain can be immediately remapped and the algorithm returns "success". If however a negative value is encountered, we must first perform a fine-level check on each of the corresponding grain halos to see if these grains actually overlap. If they do not, we can immediately remap the target grain and return "success". If we encounter a case where there is only a single truly overlapping grain (bounding boxes and halos intersect), the algorithm tentatively marks the target grain with the other grain's variable effectively simulating a remapping operation. It then recurses on the other neighboring grain making it the new target. If the algorithm is able to find a successful remap in the recursive call, the returned "success" value indicates to the caller that the tentative mark can be removed. The "success" value can then be propagated on up the call stack. If all items in the "color distance" array are exhausted without finding a successful swap or set of swaps, the algorithm returns "fail". If we are in a recursive call, the tentative mark is removed and the next value in the array is inspected. We find that limiting the depth-first search to a relatively small depth (2 or 3) works reasonably well to fail out of impossibly tightly colored graphs faster. This also helps avoid the huge runtime penalty and exponential growth rate possible with an unlimited backtracking algorithm. Note: Tentative markings are indicated by turning on the DIRTY
status flag in the feature's data structure. The DIRTY
status uses an independent bit so it can exist simultaneously with another status.
3D Halo Images
Description and Syntax
Grain Tracker object for running reduced order parameter simulations without grain coalescence.
Input Parameters
- bound_value0Absolute value of the lower bound for the variable value that represents a region not assigned to the grain. Must be positive, but the actual value used is -bound_value.
Default:0
C++ Type:double
Controllable:No
Description:Absolute value of the lower bound for the variable value that represents a region not assigned to the grain. Must be positive, but the actual value used is -bound_value.
- boundaryThe list of boundaries (ids or names) from the mesh where this object applies
C++ Type:std::vector<BoundaryName>
Controllable:No
Description:The list of boundaries (ids or names) from the mesh where this object applies
- compute_halo_mapsFalseInstruct the Postprocessor to communicate proper halo information to all ranks
Default:False
C++ Type:bool
Controllable:No
Description:Instruct the Postprocessor to communicate proper halo information to all ranks
- compute_var_to_feature_mapFalseInstruct the Postprocessor to compute the active vars to features map
Default:False
C++ Type:bool
Controllable:No
Description:Instruct the Postprocessor to compute the active vars to features map
- connecting_threshold0.09The threshold for which an existing feature may be extended (defaults to "threshold")
Default:0.09
C++ Type:double
Controllable:No
Description:The threshold for which an existing feature may be extended (defaults to "threshold")
- enable_var_coloringTrueInstruct the Postprocessor to populate the variable index map.
Default:True
C++ Type:bool
Controllable:No
Description:Instruct the Postprocessor to populate the variable index map.
- error_on_grain_creationFalseTerminate with an error if a grain is created (does not include initial callback to start simulation)
Default:False
C++ Type:bool
Controllable:No
Description:Terminate with an error if a grain is created (does not include initial callback to start simulation)
- execute_onINITIAL TIMESTEP_ENDThe list of flag(s) indicating when this object should be executed, the available options include FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM.
Default:INITIAL TIMESTEP_END
C++ Type:ExecFlagEnum
Options:FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM, TRANSFER
Controllable:No
Description:The list of flag(s) indicating when this object should be executed, the available options include FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM.
- flood_entity_typeELEMENTALDetermines whether the flood algorithm runs on nodes or elements
Default:ELEMENTAL
C++ Type:MooseEnum
Options:NODAL, ELEMENTAL
Controllable:No
Description:Determines whether the flood algorithm runs on nodes or elements
- halo_level2The thickness of the halo surrounding each feature.
Default:2
C++ Type:unsigned short
Controllable:No
Description:The thickness of the halo surrounding each feature.
- op_numArray of coupled variables (num_name)
C++ Type:unsigned int
Controllable:No
Description:Array of coupled variables (num_name)
- polycrystal_ic_uoOptional: Polycrystal IC object
C++ Type:UserObjectName
Controllable:No
Description:Optional: Polycrystal IC object
- 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.
- remap_grainsTrueIndicates whether remapping should be done or not (default: true)
Default:True
C++ Type:bool
Controllable:No
Description:Indicates whether remapping should be done or not (default: true)
- reserve_op0Indicates the number of reserved ops (variables that cannot be remapped to)
Default:0
C++ Type:unsigned short
Controllable:No
Description:Indicates the number of reserved ops (variables that cannot be remapped to)
- reserve_op_threshold0.95Threshold for locating a new feature on the reserved op variable(s)
Default:0.95
C++ Type:double
Controllable:No
Description:Threshold for locating a new feature on the reserved op variable(s)
- secondary_percolation_boundariesPaired boundaries with "primaryary_percolation_boundaries" parameter
C++ Type:std::vector<BoundaryName>
Controllable:No
Description:Paired boundaries with "primaryary_percolation_boundaries" parameter
- specified_boundariesAn optional list of boundaries; if supplied, each feature is checked to determine whether it intersects any of the specified boundaries in this list.
C++ Type:std::vector<BoundaryName>
Controllable:No
Description:An optional list of boundaries; if supplied, each feature is checked to determine whether it intersects any of the specified boundaries in this list.
- threshold0.1The threshold value for which a new feature may be started
Default:0.1
C++ Type:double
Controllable:No
Description:The threshold value for which a new feature may be started
- tracking_step0The timestep for when we should start tracking grains
Default:0
C++ Type:int
Controllable:No
Description:The timestep for when we should start tracking grains
- 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.
- use_less_than_threshold_comparisonTrueControls whether features are defined to be less than or greater than the threshold value.
Default:True
C++ Type:bool
Controllable:No
Description:Controls whether features are defined to be less than or greater than the threshold value.
- var_name_baseArray of coupled variables (base_name)
C++ Type:std::string
Controllable:No
Description:Array of coupled variables (base_name)
- verbosity_level1Level 0: Silent during normal operation, Level 1: Informational messages but no detailed grain structure printouts, Level 2: Verbose output including data structure dumps, Level 3: Debugging mode.
Default:1
C++ Type:short
Controllable:No
Description:Level 0: Silent during normal operation, Level 1: Informational messages but no detailed grain structure printouts, Level 2: Verbose output including data structure dumps, Level 3: Debugging mode.
Optional Parameters
- allow_duplicate_execution_on_initialFalseIn the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
Default:False
C++ Type:bool
Controllable:No
Description:In the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
- condense_map_infoTrueDetermines whether we condense all the node values when in multimap mode (default: false)
Default:True
C++ Type:bool
Controllable:No
Description:Determines whether we condense all the node values when in multimap mode (default: false)
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- execution_order_group0Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
Default:0
C++ Type:int
Controllable:No
Description:Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
- force_postauxFalseForces the UserObject to be executed in POSTAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in POSTAUX
- force_preauxFalseForces the UserObject to be executed in PREAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREAUX
- force_preicFalseForces the UserObject to be executed in PREIC during initial setup
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREIC during initial setup
- max_remap_recursion_depth6The recursion depth allowed when searching for remapping candidates. Note: Setting this value high may result in very computationally expensive searches with little benefit. (Recommended level: 6)
Default:6
C++ Type:unsigned short
Controllable:No
Description:The recursion depth allowed when searching for remapping candidates. Note: Setting this value high may result in very computationally expensive searches with little benefit. (Recommended level: 6)
- outputsVector of output names where you would like to restrict the output of variables(s) associated with this object
C++ Type:std::vector<OutputName>
Controllable:No
Description:Vector of output names where you would like to restrict the output of variables(s) associated with this object
- primary_percolation_boundariesA list of boundaries used in conjunction with the corresponding "secondary_percolation_boundaries" parameter for determining if a feature creates a path connecting any pair of boundaries
C++ Type:std::vector<BoundaryName>
Controllable:No
Description:A list of boundaries used in conjunction with the corresponding "secondary_percolation_boundaries" parameter for determining if a feature creates a path connecting any pair of boundaries
- tolerate_failureFalseAllow the grain tracker to continue when it fails to find suitable grains for remapping. This will allow the simulation to continue but it will also allow non-physical grain coalescence. DO NOT USE for production results!
Default:False
C++ Type:bool
Controllable:No
Description:Allow the grain tracker to continue when it fails to find suitable grains for remapping. This will allow the simulation to continue but it will also allow non-physical grain coalescence. DO NOT USE for production results!
- 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.
- use_global_numberingTrueDetermine whether or not global numbers are used to label features on multiple maps (default: true)
Default:True
C++ Type:bool
Controllable:No
Description:Determine whether or not global numbers are used to label features on multiple maps (default: true)
- use_single_mapFalseDetermine whether information is tracked per coupled variable or consolidated into one (default: true)
Default:False
C++ Type:bool
Controllable:No
Description:Determine whether information is tracked per coupled variable or consolidated into one (default: true)
Advanced Parameters
Input Files
- (modules/phase_field/examples/rigidbodymotion/grain_motion_GT.i)
- (modules/phase_field/test/tests/rigidbodymotion/update_orientation.i)
- (modules/phase_field/test/tests/grain_tracker_test/grain_halo_over_bc.i)
- (modules/phase_field/test/tests/GBType/GB_Type_Phase1.i)
- (modules/phase_field/test/tests/DeformedGrain/DeformedGrain.i)
- (modules/phase_field/test/tests/reconstruction/1phase_reconstruction.i)
- (modules/phase_field/test/tests/rigidbodymotion/update_orientation_verify.i)
- (modules/phase_field/test/tests/grain_tracker_test/grain_tracker_remapping_linearized_interface_test.i)
- (modules/phase_field/examples/grain_growth/3D_6000_gr.i)
- (modules/phase_field/examples/grain_growth/grain_growth_2D_graintracker.i)
- (modules/phase_field/examples/grain_growth/grain_growth_3D.i)
- (modules/phase_field/test/tests/rigidbodymotion/grain_maskedforce.i)
- (modules/phase_field/examples/rigidbodymotion/grain_forcedensity_ext.i)
- (modules/phase_field/test/tests/grain_tracker_test/grain_tracker_advanced_op.i)
- (modules/phase_field/test/tests/grain_tracker_test/split_grain.i)
- (modules/phase_field/test/tests/reconstruction/2phase_reconstruction4.i)
- (modules/phase_field/test/tests/grain_tracker_test/grain_tracker_reserve.i)
- (modules/phase_field/test/tests/rigidbodymotion/grain_forcesum.i)
- (modules/phase_field/test/tests/initial_conditions/polycrystalcircles_clipped.i)
- (modules/phase_field/test/tests/grain_tracker_test/one_grain.i)
- (modules/phase_field/test/tests/rigidbodymotion/grain_appliedforcedensity.i)
- (modules/phase_field/test/tests/GBType/GB_Type_Phase2.i)
- (modules/phase_field/test/tests/grain_tracker_test/grain_tracker_nodal.i)
- (modules/combined/test/tests/grain_texture/random_grain_orientation.i)
- (modules/phase_field/test/tests/grain_tracker_test/grain_tracker_ebsd.i)
- (modules/phase_field/examples/rigidbodymotion/AC_CH_advection_constforce_rect.i)
- (modules/phase_field/test/tests/reconstruction/euler2rgb_no_grain_region.i)
- (modules/phase_field/test/tests/reconstruction/euler2rgb_non_uniform_orientation.i)
- (modules/phase_field/test/tests/reconstruction/1phase_evolution.i)
- (modules/combined/examples/phase_field-mechanics/grain_texture.i)
- (modules/phase_field/test/tests/grain_tracker_test/distributed_poly_ic.i)
- (modules/phase_field/examples/ebsd_reconstruction/IN100-111grn.i)
- (modules/phase_field/test/tests/grain_tracker_test/grain_tracker_test_elemental.i)
- (modules/phase_field/test/tests/feature_volume_vpp_test/centroid.i)
- (modules/phase_field/test/tests/grain_tracker_test/grain_tracker_volume.i)
- (modules/phase_field/examples/rigidbodymotion/AC_CH_Multigrain.i)
- (modules/phase_field/test/tests/grain_tracker_test/grain_tracker_volume_single.i)
- (modules/phase_field/test/tests/grain_tracker_test/grain_tracker_remapping_test.i)
- (modules/phase_field/test/tests/rigidbodymotion/polycrystal_action.i)
- (modules/phase_field/test/tests/rigidbodymotion/grain_forcedensity.i)
- (modules/phase_field/examples/grain_growth/grain_growth_linearized_interface.i)
- (modules/phase_field/test/tests/grain_tracker_test/grain_tracker_volume_changing.i)
- (modules/phase_field/test/tests/rigidbodymotion/grain_motion.i)
- (modules/phase_field/examples/grain_growth/grain_growth_2D_random.i)
Child Objects
(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/grain_tracker_test/grain_halo_over_bc.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 35
ny = 35
xmax = 1000
ymax = 1000
elem_type = QUAD4
parallel_type = replicated # Periodic BCs
[]
[GlobalParams]
op_num = 8 # Number of order parameters used
var_name_base = 'gr' # Base name of grains
[]
[Variables]
[./PolycrystalVariables]
[../]
[]
[UserObjects]
[./voronoi]
type = PolycrystalVoronoi
rand_seed = 12
grain_num = 15 # Number of grains
coloring_algorithm = bt
[../]
[./grain_tracker]
type = GrainTracker
threshold = 0.2
connecting_threshold = 0.08
flood_entity_type = ELEMENTAL
compute_halo_maps = true # Only necessary for displaying HALOS
[../]
[]
[ICs]
[./PolycrystalICs]
[./PolycrystalColoringIC]
polycrystal_ic_uo = voronoi
[../]
[../]
[]
[AuxVariables]
[./bnds]
[../]
[./unique_grains]
order = CONSTANT
family = MONOMIAL
[../]
[./var_indices]
order = CONSTANT
family = MONOMIAL
[../]
[./ghost_regions]
order = CONSTANT
family = MONOMIAL
[../]
[./halos]
order = CONSTANT
family = MONOMIAL
[../]
[./proc_id]
order = CONSTANT
family = MONOMIAL
[../]
[./halo0]
order = CONSTANT
family = MONOMIAL
[../]
[./halo1]
order = CONSTANT
family = MONOMIAL
[../]
[./halo2]
order = CONSTANT
family = MONOMIAL
[../]
[./halo3]
order = CONSTANT
family = MONOMIAL
[../]
[./halo4]
order = CONSTANT
family = MONOMIAL
[../]
[./halo5]
order = CONSTANT
family = MONOMIAL
[../]
[./halo6]
order = CONSTANT
family = MONOMIAL
[../]
[./halo7]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./PolycrystalKernel]
[../]
[]
[AuxKernels]
[./bnds_aux]
type = BndsCalcAux
variable = bnds
execute_on = 'initial timestep_end'
[../]
[./unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_tracker
field_display = UNIQUE_REGION
execute_on = 'initial timestep_end'
[../]
[./var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
execute_on = 'initial timestep_end'
[../]
[./ghosted_entities]
type = FeatureFloodCountAux
variable = ghost_regions
flood_counter = grain_tracker
field_display = GHOSTED_ENTITIES
execute_on = 'initial timestep_end'
[../]
[./halos]
type = FeatureFloodCountAux
variable = halos
flood_counter = grain_tracker
field_display = HALOS
execute_on = 'initial timestep_end'
[../]
[./proc_id]
type = ProcessorIDAux
variable = proc_id
[../]
[./halo0]
type = FeatureFloodCountAux
variable = halo0
map_index = 0
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo1]
type = FeatureFloodCountAux
variable = halo1
map_index = 1
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo2]
type = FeatureFloodCountAux
variable = halo2
map_index = 2
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo3]
type = FeatureFloodCountAux
variable = halo3
map_index = 3
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo4]
type = FeatureFloodCountAux
variable = halo4
map_index = 4
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo5]
type = FeatureFloodCountAux
variable = halo5
map_index = 5
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo6]
type = FeatureFloodCountAux
variable = halo6
map_index = 6
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo7]
type = FeatureFloodCountAux
variable = halo7
map_index = 7
field_display = HALOS
flood_counter = grain_tracker
[../]
[]
[BCs]
[./Periodic]
[./top_bottom]
auto_direction = 'x y'
[../]
[../]
[]
[Materials]
[./CuGrGr]
type = GBEvolution
T = '450'
wGB = 125
GBmob0 = 2.5e-6
Q = 0.23
GBenergy = 0.708
[../]
[]
[Postprocessors]
[./dt]
type = TimestepSize
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart -mat_mffd_type'
petsc_options_value = 'hypre boomeramg 101 ds'
l_max_its = 30
l_tol = 1e-4
nl_max_its = 40
nl_rel_tol = 1e-11
dt = 25
num_steps = 1
[]
[Outputs]
exodus = true # Exodus file will be outputted
[]
(modules/phase_field/test/tests/GBType/GB_Type_Phase1.i)
# MOOSE input file
# Written by Pierre-Clement Simon - Idaho National Laboratory
#
# Project:
# TRISO fuel fission gas transport: Silver diffusion in silicon carbide
#
# Published with:
# ---
#
# Phase Field Model: Isotropic diffusion equation
# type: Transient
# Grain structure: Single grain
# BCs: Fixed value on the right, flux on the left
#
#
# Info:
# - Input file used to generate polycrystals for SiC
#
# Updates from previous file:
# -
#
# Units
# length: --
# time: --
# energy: --
# quantity: --
# This simulation predicts GB migration of a 2D copper polycrystal with 15 grains
# Mesh adaptivity (new system) and time step adaptivity are used
# An AuxVariable is used to calculate the grain boundary locations
# Postprocessors are used to record time step and the number of grains
# We are not using the GrainTracker in this example so the number
# of order paramaters must match the number of grains.
[Mesh]
[ebsd_mesh]
type = EBSDMeshGenerator
# Two Parallel Grains
filename = 'EBSD_ThreeGrains.txt'
[]
[]
[GlobalParams]
# Parameters used by several kernels that are defined globally to simplify input file
op_num = 6 # Number of grains
var_name_base = gr # Base name of grains
[]
[UserObjects]
[ebsd_reader]
type = EBSDReader
[]
[ebsd]
type = PolycrystalEBSD
coloring_algorithm = bt
ebsd_reader = ebsd_reader
enable_var_coloring = true
# output_adjacency_matrix = true
[]
[grain_tracker]
type = GrainTracker
threshold = 0.001
connecting_threshold = 0.008
compute_var_to_feature_map = true
compute_halo_maps = true # For displaying HALO fields
remap_grains = true
polycrystal_ic_uo = ebsd
[]
[]
[ICs]
[PolycrystalICs]
[PolycrystalColoringIC]
polycrystal_ic_uo = ebsd
[]
[]
[]
[Variables]
# Variable block, where all variables in the simulation are declared
[./PolycrystalVariables]
# Custom action that created all of the grain variables and sets their initial condition
[../]
[]
[AuxVariables]
# Dependent variables
[./bnds]
# Variable used to visualize the grain boundaries in the simulation
[../]
[./unique_grains]
order = CONSTANT
family = MONOMIAL
[../]
[./aphi1]
order = CONSTANT
family = MONOMIAL
[../]
[./bPhi]
order = CONSTANT
family = MONOMIAL
[../]
[./cphi2]
order = CONSTANT
family = MONOMIAL
[../]
[./ebsd_numbers]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
# Kernel block, where the kernels defining the residual equations are set up.
[./PolycrystalKernel]
# Custom action creating all necessary kernels for grain growth. All input parameters are up in GlobalParams
[../]
[]
[AuxKernels]
# AuxKernel block, defining the equations used to calculate the auxvars
[./bnds_aux]
# AuxKernel that calculates the GB term
type = BndsCalcAux
variable = bnds
execute_on = 'initial timestep_end'
[../]
# generate the unique ID from grain_tracker
[./unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
field_display = UNIQUE_REGION
[../]
# The phi will output the Euler angle from EBSD data, and the data structure
# will change with the guide from grain_tracker
[./aphi1]
type = OutputEulerAngles
variable = aphi1
euler_angle_provider = ebsd_reader
grain_tracker = grain_tracker
output_euler_angle = 'phi1'
execute_on = 'INITIAL TIMESTEP_END'
[../]
[./bPhi]
type = OutputEulerAngles
variable = bPhi
euler_angle_provider = ebsd_reader
grain_tracker = grain_tracker
output_euler_angle = 'Phi'
execute_on = 'INITIAL TIMESTEP_END'
[../]
[./cphi2]
type = OutputEulerAngles
variable = cphi2
euler_angle_provider = ebsd_reader
grain_tracker = grain_tracker
output_euler_angle = 'phi2'
execute_on = 'INITIAL TIMESTEP_END'
[../]
# Import the unique grain ID from ebsd data, and the data structure
# will change with the guide from grain_tracker
[ebsd_numbers]
type = EBSDReaderAvgDataAux
data_name = feature_id
ebsd_reader = ebsd_reader
grain_tracker = grain_tracker
variable = ebsd_numbers
execute_on = 'initial timestep_end'
[../]
[]
[BCs]
# Boundary Condition block
[./Periodic]
[./top_bottom]
auto_direction = 'x y' # Makes problem periodic in the x and y directions
[../]
[../]
[]
[Materials]
[./CuGrGr]
# Material properties
type = GBEvolution # Quantitative material properties for copper grain growth. Dimensions are nm and ns
GBmob0 = 2.5e-6 # Mobility prefactor for Cu from schonfelder1997molecular bibtex entry
GBenergy = 0.708 # GB energy for Cu from schonfelder1997molecular bibtex entry
Q = 0.23 # Activation energy for grain growth from Schonfelder 1997
T = 450 # Constant temperature of the simulation (for mobility calculation)
wGB = 6 # Width of the diffuse GB
[../]
[./GB_type]
# The new developed Miso Bnds Aux Kernel
type = ComputeGBMisorientationType
ebsd_reader = ebsd_reader
grain_tracker = grain_tracker
output_properties = 'gb_type'
outputs = exodus
[../]
[]
[Postprocessors]
# Scalar postprocessors
[./dt]
# Outputs the current time step
type = TimestepSize
[../]
[n_elements]
type = NumElems
execute_on = 'initial timestep_end'
[]
[n_nodes]
type = NumNodes
execute_on = 'initial timestep_end'
[]
[DOFs]
type = NumDOFs
[]
[]
[Adaptivity]
initial_steps = 1
max_h_level = 1
marker = combined
[./Indicators]
[./error]
type = GradientJumpIndicator
variable = bnds
[../]
[../]
[./Markers]
[./bound_adapt]
type = ValueThresholdMarker
third_state = DO_NOTHING
coarsen = 0.999 #1.0
refine = 0.95 #0.95
variable = bnds
invert = true
[../]
[./errorfrac]
type = ErrorFractionMarker
coarsen = 0.1
indicator = error
refine = 0.7
[../]
[./combined]
type = ComboMarker
markers = 'bound_adapt errorfrac'
[../]
[../]
[]
[Executioner]
type = Transient # Type of executioner, here it is transient with an adaptive time step
scheme = bdf2 # Type of time integration (2nd order backward euler), defaults to 1st order backward euler
#Preconditioned JFNK (default)
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type -pc_hypre_boomeramg_strong_threshold'
petsc_options_value = ' hypre boomeramg 0.7'
l_max_its = 30 # Max number of linear iterations
l_tol = 1e-4 # Relative tolerance for linear solves
nl_max_its = 40 # Max number of nonlinear iterations
nl_abs_tol = 1e-11 # Relative tolerance for nonlienar solves
nl_rel_tol = 1e-10 # Absolute tolerance for nonlienar solves
[TimeStepper]
type = IterationAdaptiveDT
cutback_factor = 0.9
dt = 1
growth_factor = 1.1
optimal_iterations = 7
[]
start_time = 0.0
num_steps = 2
[]
[Outputs]
perf_graph = true
exodus = true
[./console]
type = Console
max_rows = 10
[../]
[]
(modules/phase_field/test/tests/DeformedGrain/DeformedGrain.i)
# This example tests the implementation of PolycrstalStoredEnergy kernels that assigns excess stored energy to grains with dislocation density
[Mesh]
type = GeneratedMesh
dim = 2
nx = 32
ny = 32
nz = 0
xmin = 0
xmax = 64
ymin = 0
ymax = 64
[]
[GlobalParams]
op_num = 8
deformed_grain_num = 16
var_name_base = gr
grain_num = 18
grain_tracker = grain_tracker
time_scale = 1e-2
length_scale = 1e-8
[]
[Variables]
[./PolycrystalVariables]
[../]
[]
[AuxVariables]
[./bnds]
order = FIRST
family = LAGRANGE
[../]
[]
[UserObjects]
[./voronoi]
type = PolycrystalVoronoi
rand_seed = 81
coloring_algorithm = bt
[../]
[./grain_tracker]
type = GrainTracker
threshold = 0.2
connecting_threshold = 0.08
compute_var_to_feature_map = true
flood_entity_type = elemental
execute_on = ' initial timestep_begin'
outputs = none
[../]
[]
[ICs]
[./PolycrystalICs]
[./PolycrystalColoringIC]
polycrystal_ic_uo = voronoi
[../]
[../]
[]
[BCs]
[./Periodic]
[./all]
auto_direction = 'x y'
[../]
[../]
[]
[Kernels]
[./PolycrystalKernel]
[../]
[./PolycrystalStoredEnergy]
[../]
[]
[AuxKernels]
[./BndsCalc]
type = BndsCalcAux
variable = bnds
execute_on = timestep_end
[../]
[]
[Materials]
[./deformed]
type = DeformedGrainMaterial
int_width = 4.0
outputs = exodus
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
nl_max_its = 15
scheme = bdf2
solve_type = PJFNK
petsc_options_iname = -pc_type
petsc_options_value = asm
l_max_its = 15
l_tol = 1.0e-3
nl_rel_tol = 1.0e-8
start_time = 0.0
num_steps = 1
nl_abs_tol = 1e-8
dt = 0.20
[]
[Outputs]
exodus = true
time_step_interval = 1
show = bnds
perf_graph = true
[]
(modules/phase_field/test/tests/reconstruction/1phase_reconstruction.i)
#
# In this test we set the initial condition of a set of order parameters
# by pulling out the grain data from given EBSD data file ignoring the phase completely.
#
[Problem]
type = FEProblem
solve = false
kernel_coverage_check = false
[]
# The following sections are extracted in the documentation in
# moose/docs/content/modules/phase_field/ICs/EBSD.md
[Mesh]
# Create a mesh representing the EBSD data
[ebsd_mesh]
type = EBSDMeshGenerator
filename = IN100_001_28x28_Marmot.txt
[]
[]
[GlobalParams]
# Define the number and names of the order parameters used to represent the grains
op_num = 4
var_name_base = gr
[]
[UserObjects]
[ebsd_reader]
# Read in the EBSD data. Uses the filename given in the mesh block.
type = EBSDReader
[]
[ebsd]
type = PolycrystalEBSD
coloring_algorithm = bt
ebsd_reader = ebsd_reader
output_adjacency_matrix = true
[]
[grain_tracker]
type = GrainTracker
# For displaying HALO fields
compute_halo_maps = true
# Link in the ebsd userobject here so that grain tracker can extract info from it
polycrystal_ic_uo = ebsd
[]
[]
[Variables]
[PolycrystalVariables]
# Create all the order parameters
order = FIRST
family = LAGRANGE
[]
[]
[ICs]
[PolycrystalICs]
[PolycrystalColoringIC]
# Uses the data from the user object 'ebsd' to initialize the variables for all the order parameters.
polycrystal_ic_uo = ebsd
[]
[]
[]
#ENDDOC - End of the file section that is included in the documentation. Do not change this line!
[GlobalParams]
execute_on = 'initial'
family = MONOMIAL
order = CONSTANT
[]
[AuxVariables]
[PHI1]
[]
[PHI]
[]
[PHI2]
[]
[GRAIN]
[]
[unique_grains]
[]
[var_indices]
[]
[halo0]
[]
[halo1]
[]
[halo2]
[]
[halo3]
[]
[]
[AuxKernels]
[phi1_aux]
type = EBSDReaderPointDataAux
variable = PHI1
ebsd_reader = ebsd_reader
data_name = 'phi1'
[]
[phi_aux]
type = EBSDReaderPointDataAux
variable = PHI
ebsd_reader = ebsd_reader
data_name = 'phi'
[]
[phi2_aux]
type = EBSDReaderPointDataAux
variable = PHI2
ebsd_reader = ebsd_reader
data_name = 'phi2'
[]
[grain_aux]
type = EBSDReaderPointDataAux
variable = GRAIN
ebsd_reader = ebsd_reader
data_name = 'feature_id'
[]
[unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_tracker
field_display = UNIQUE_REGION
[]
[var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
[]
[halo0]
type = FeatureFloodCountAux
variable = halo0
map_index = 0
field_display = HALOS
flood_counter = grain_tracker
[]
[halo1]
type = FeatureFloodCountAux
variable = halo1
map_index = 1
field_display = HALOS
flood_counter = grain_tracker
[]
[halo2]
type = FeatureFloodCountAux
variable = halo2
map_index = 2
field_display = HALOS
flood_counter = grain_tracker
[]
[halo3]
type = FeatureFloodCountAux
variable = halo3
map_index = 3
field_display = HALOS
flood_counter = grain_tracker
[]
[]
[Executioner]
type = Steady
[]
[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/phase_field/test/tests/grain_tracker_test/grain_tracker_remapping_linearized_interface_test.i)
# This simulation predicts GB migration of a 2D copper polycrystal with 100 grains represented with 18 order parameters
# Mesh adaptivity and time step adaptivity are used
# An AuxVariable is used to calculate the grain boundary locations
# Postprocessors are used to record time step and the number of grains
[Mesh]
# Mesh block. Meshes can be read in or automatically generated
type = GeneratedMesh
dim = 2 # Problem dimension
nx = 25 # Number of elements in the x-direction
ny = 25 # Number of elements in the y-direction
xmax = 1000 # maximum x-coordinate of the mesh
ymax = 1000 # maximum y-coordinate of the mesh
[]
[GlobalParams]
# Parameters used by several kernels that are defined globally to simplify input file
op_num = 8 # Number of order parameters used
var_name_base = psi # Base name of grains
bound_value = 5 # +/- bound value
[]
[Modules]
[PhaseField]
[GrainGrowthLinearizedInterface]
op_name_base = gr
mobility = L
kappa = kappa_op
[]
[]
[]
[ICs]
[PolycrystalICs]
[PolycrystalColoringIC]
polycrystal_ic_uo = voronoi
linearized_interface = true
[]
[]
[]
[UserObjects]
[voronoi]
type = PolycrystalVoronoi
grain_num = 10 # Number of grains
rand_seed = 13405
int_width = 100
[]
[grain_tracker]
type = GrainTracker
threshold = -4
[]
[]
[Materials]
[CuGrGr]
# Material properties
type = GBEvolution
T = 450 # Constant temperature of the simulation (for mobility calculation)
wGB = 100 # Width of the diffuse GB
GBmob0 = 2.5e-6 # m^4(Js) for copper from schonfelder1997molecular bibtex entry
Q = 0.23 # eV for copper from schonfelder1997molecular bibtex entry
GBenergy = 0.708 # J/m^2 from schonfelder1997molecular bibtex entry
[]
[]
[Executioner]
# Uses newton iteration to solve the problem.
type = Transient # Type of executioner, here it is transient with an adaptive time step
scheme = bdf2 # Type of time integration (2nd order backward euler), defaults to 1st order backward euler
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type -snes_type'
petsc_options_value = 'hypre boomeramg vinewtonrsls'
l_max_its = 30 # Max number of linear iterations
l_tol = 1e-4 # Relative tolerance for linear solves
nl_max_its = 13 # Max number of nonlinear iterations
num_steps = 7
dt = 100
[]
[Outputs]
csv = true
[]
(modules/phase_field/examples/grain_growth/3D_6000_gr.i)
[Mesh]
type = GeneratedMesh
dim = 3
nx = 180
ny = 180
nz = 180
xmin = 0
xmax = 180
ymin = 0
ymax = 180
zmin = 0
zmax = 180
elem_type = HEX8
[]
[GlobalParams]
op_num = 28
var_name_base = gr
[]
[Variables]
[./PolycrystalVariables]
order = FIRST
family = LAGRANGE
[../]
[]
[UserObjects]
[./voronoi]
type = PolycrystalVoronoi
grain_num = 6000 # Number of grains
rand_seed = 8675 # 301
coloring_algorithm = jp
[../]
[./term]
type = Terminator
expression = 'grain_tracker < 218'
[../]
[]
[ICs]
[./PolycrystalICs]
[./PolycrystalColoringIC]
polycrystal_ic_uo = voronoi
[../]
[../]
[]
[AuxVariables]
[./bnds]
order = FIRST
family = LAGRANGE
[../]
[./unique_grains]
order = CONSTANT
family = MONOMIAL
[../]
[./ghost_elements]
order = CONSTANT
family = MONOMIAL
[../]
[./halos]
order = CONSTANT
family = MONOMIAL
[../]
[./var_indices]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./PolycrystalKernel]
[../]
[]
[AuxKernels]
[./BndsCalc]
type = BndsCalcAux
variable = bnds
execute_on = 'initial timestep_end'
[../]
[./unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
field_display = UNIQUE_REGION
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
[../]
[./ghost_elements]
type = FeatureFloodCountAux
variable = ghost_elements
field_display = GHOSTED_ENTITIES
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
[../]
[./halos]
type = FeatureFloodCountAux
variable = halos
field_display = HALOS
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
[../]
[./var_indices]
type = FeatureFloodCountAux
variable = var_indices
field_display = VARIABLE_COLORING
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
[../]
[]
#[BCs]
# [./Periodic]
# [./All]
# auto_direction = 'x y'
# [../]
# [../]
#[]
[Materials]
[./Copper]
type = GBEvolution
T = 500
wGB = 3 # um
GBmob0 = 2.5e-6 #m^4/(Js) from Schoenfelder 1997
Q = 0.23 #Migration energy in eV
GBenergy = 0.708 #GB energy in J/m^2
molar_volume = 7.11e-6 #Molar volume in m^3/mol
length_scale = 1.0e-6
time_scale = 1.0
[../]
[]
[Postprocessors]
[./dt]
type = TimestepSize
[../]
[./n_elements]
type = NumElems
execute_on = timestep_end
[../]
[./n_nodes]
type = NumNodes
execute_on = timestep_end
[../]
[./DOFs]
type = NumDOFs
[../]
[./grain_tracker]
type = GrainTracker
threshold = 0.1
compute_halo_maps = true
[../]
[]
#[Preconditioning]
# [./SMP]
# type = SMP
# full = true
# [../]
#[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK #Preconditioned JFNK (default)
petsc_options_iname = '-pc_type'
petsc_options_value = 'asm'
l_tol = 1.0e-4
l_max_its = 30
nl_max_its = 20
nl_rel_tol = 1.0e-8
start_time = 0.0
num_steps = 500
dt = 0.0002
[./TimeStepper]
type = IterationAdaptiveDT
cutback_factor = 0.9
dt = 0.0002
growth_factor = 1.1
optimal_iterations = 8
[../]
#[./Adaptivity]
# initial_adaptivity = 4
# refine_fraction = 0.6
# coarsen_fraction = 0.1
# max_h_level = 4
# print_changed_info = true
#[../]
[]
[Outputs]
nemesis = true
checkpoint = true
csv = true
[./console]
type = Console
[../]
[]
(modules/phase_field/examples/grain_growth/grain_growth_2D_graintracker.i)
# This simulation predicts GB migration of a 2D copper polycrystal with 100 grains represented with 8 order parameters
# Mesh adaptivity and time step adaptivity are used
# An AuxVariable is used to calculate the grain boundary locations
# Postprocessors are used to record time step and the number of grains
[Mesh]
# Mesh block. Meshes can be read in or automatically generated
type = GeneratedMesh
dim = 2 # Problem dimension
nx = 44 # Number of elements in the x-direction
ny = 44 # Number of elements in the y-direction
xmax = 1000 # maximum x-coordinate of the mesh
ymax = 1000 # maximum y-coordinate of the mesh
elem_type = QUAD4 # Type of elements used in the mesh
uniform_refine = 2 # Initial uniform refinement of the mesh
[]
[GlobalParams]
# Parameters used by several kernels that are defined globally to simplify input file
op_num = 8 # Number of order parameters used
var_name_base = gr # Base name of grains
[]
[Modules]
[PhaseField]
[GrainGrowth]
[]
[]
[]
[UserObjects]
[voronoi]
type = PolycrystalVoronoi
grain_num = 100 # Number of grains
rand_seed = 10
int_width = 7
[]
[grain_tracker]
type = GrainTracker
[]
[]
[ICs]
[PolycrystalICs]
[PolycrystalColoringIC]
polycrystal_ic_uo = voronoi
[]
[]
[]
[AuxVariables]
# Dependent variables
[unique_grains]
order = CONSTANT
family = MONOMIAL
[]
[var_indices]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
# AuxKernel block, defining the equations used to calculate the auxvars
[bnds_aux]
# AuxKernel that calculates the GB term
type = BndsCalcAux
variable = bnds
execute_on = 'initial timestep_end'
[]
[unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_tracker
field_display = UNIQUE_REGION
execute_on = 'initial timestep_end'
[]
[var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
execute_on = 'initial timestep_end'
[]
[]
[BCs]
# Boundary Condition block
[Periodic]
[All]
auto_direction = 'x y' # Makes problem periodic in the x and y directions
[]
[]
[]
[Materials]
[CuGrGr]
# Material properties
type = GBEvolution
T = 450 # Constant temperature of the simulation (for mobility calculation)
wGB = 14 # Width of the diffuse GB
GBmob0 = 2.5e-6 #m^4(Js) for copper from schonfelder1997molecular bibtex entry
Q = 0.23 #eV for copper from schonfelder1997molecular bibtex entry
GBenergy = 0.708 #J/m^2 from schonfelder1997molecular bibtex entry
[]
[]
[Postprocessors]
# Scalar postprocessors
[dt]
# Outputs the current time step
type = TimestepSize
[]
[]
[Executioner]
type = Transient # Type of executioner, here it is transient with an adaptive time step
scheme = bdf2 # Type of time integration (2nd order backward euler), defaults to 1st order backward euler
#Preconditioned JFNK (default)
solve_type = 'PJFNK'
# Uses newton iteration to solve the problem.
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
l_max_its = 50 # Max number of linear iterations
l_tol = 1e-4 # Relative tolerance for linear solves
nl_max_its = 10 # Max number of nonlinear iterations
end_time = 4000
[TimeStepper]
type = IterationAdaptiveDT
dt = 20 # Initial time step. In this simulation it changes.
optimal_iterations = 6 # Time step will adapt to maintain this number of nonlinear iterations
[]
[Adaptivity]
# Block that turns on mesh adaptivity. Note that mesh will never coarsen beyond initial mesh (before uniform refinement)
initial_adaptivity = 2 # Number of times mesh is adapted to initial condition
refine_fraction = 0.8 # Fraction of high error that will be refined
coarsen_fraction = 0.05 # Fraction of low error that will coarsened
max_h_level = 2 # Max number of refinements used, starting from initial mesh (before uniform refinement)
[]
[]
[Outputs]
exodus = true # Exodus file will be outputted
csv = true
[]
(modules/phase_field/examples/grain_growth/grain_growth_3D.i)
# This simulation predicts GB migration of a 3D copper polycrystal with 25 grains represented with 15 order parameters
# Time step adaptivity are used
# An AuxVariable is used to calculate the grain boundary locations
# Postprocessors are used to record time step and the number of grains
[Mesh]
# Mesh block. Meshes can be read in or automatically generated
type = GeneratedMesh
dim = 3 # Problem dimension
nx = 10 # Number of elements in the x-direction
ny = 10 # Number of elements in the y-direction
nz = 10
xmax = 1000 # maximum x-coordinate of the mesh
ymax = 1000 # maximum y-coordinate of the mesh
zmax = 1000
uniform_refine = 1 # Initial uniform refinement of the mesh
parallel_type = distributed
[]
[GlobalParams]
# Parameters used by several kernels that are defined globally to simplify input file
op_num = 15 # Number of order parameters used
var_name_base = gr # Base name of grains
order = CONSTANT
family = MONOMIAL
[]
[Modules]
[PhaseField]
[GrainGrowth]
family = LAGRANGE
order = FIRST
[]
[]
[]
[UserObjects]
[voronoi]
type = PolycrystalVoronoi
grain_num = 25 # Number of grains
rand_seed = 10
coloring_algorithm = jp
[]
[grain_tracker]
type = GrainTracker
threshold = 0.2
connecting_threshold = 0.08
compute_halo_maps = true # Only necessary for displaying HALOS
polycrystal_ic_uo = voronoi
[]
[]
[ICs]
[PolycrystalICs]
[PolycrystalColoringIC]
polycrystal_ic_uo = voronoi
[]
[]
[]
[AuxVariables]
# Dependent variables
[unique_grains]
[]
[var_indices]
[]
[ghost_regions]
[]
[halos]
[]
[halo0]
[]
[halo1]
[]
[halo2]
[]
[halo3]
[]
[halo4]
[]
[halo5]
[]
[halo6]
[]
[halo7]
[]
[halo8]
[]
[halo9]
[]
[halo10]
[]
[halo11]
[]
[halo12]
[]
[halo13]
[]
[halo14]
[]
[proc]
[]
[]
[AuxKernels]
# AuxKernel block, defining the equations used to calculate the auxvars
[unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_tracker
field_display = UNIQUE_REGION
execute_on = 'initial timestep_end'
[]
[var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
execute_on = 'initial timestep_end'
[]
[ghosted_entities]
type = FeatureFloodCountAux
variable = ghost_regions
flood_counter = grain_tracker
field_display = GHOSTED_ENTITIES
execute_on = 'initial timestep_end'
[]
[halos]
type = FeatureFloodCountAux
variable = halos
flood_counter = voronoi
field_display = HALOS
execute_on = 'initial timestep_end'
[]
[halo0]
type = FeatureFloodCountAux
variable = halo0
map_index = 0
field_display = HALOS
flood_counter = grain_tracker
execute_on = 'initial timestep_end'
[]
[halo1]
type = FeatureFloodCountAux
variable = halo1
map_index = 1
field_display = HALOS
flood_counter = grain_tracker
[]
[halo2]
type = FeatureFloodCountAux
variable = halo2
map_index = 2
field_display = HALOS
flood_counter = grain_tracker
[]
[halo3]
type = FeatureFloodCountAux
variable = halo3
map_index = 3
field_display = HALOS
flood_counter = grain_tracker
[]
[halo4]
type = FeatureFloodCountAux
variable = halo4
map_index = 4
field_display = HALOS
flood_counter = grain_tracker
[]
[halo5]
type = FeatureFloodCountAux
variable = halo5
map_index = 5
field_display = HALOS
flood_counter = grain_tracker
[]
[halo6]
type = FeatureFloodCountAux
variable = halo6
map_index = 6
field_display = HALOS
flood_counter = grain_tracker
[]
[halo7]
type = FeatureFloodCountAux
variable = halo7
map_index = 7
field_display = HALOS
flood_counter = grain_tracker
[]
[halo8]
type = FeatureFloodCountAux
variable = halo8
map_index = 8
field_display = HALOS
flood_counter = grain_tracker
[]
[halo9]
type = FeatureFloodCountAux
variable = halo9
map_index = 9
field_display = HALOS
flood_counter = grain_tracker
[]
[halo10]
type = FeatureFloodCountAux
variable = halo10
map_index = 10
field_display = HALOS
flood_counter = grain_tracker
[]
[halo11]
type = FeatureFloodCountAux
variable = halo11
map_index = 11
field_display = HALOS
flood_counter = grain_tracker
[]
[halo12]
type = FeatureFloodCountAux
variable = halo12
map_index = 12
field_display = HALOS
flood_counter = grain_tracker
[]
[halo13]
type = FeatureFloodCountAux
variable = halo13
map_index = 13
field_display = HALOS
flood_counter = grain_tracker
[]
[halo14]
type = FeatureFloodCountAux
variable = halo14
map_index = 14
field_display = HALOS
flood_counter = grain_tracker
[]
[proc]
type = ProcessorIDAux
variable = proc
execute_on = 'initial timestep_end'
[]
[]
[Materials]
[CuGrGr]
# Material properties
type = GBEvolution
T = 450 # Constant temperature of the simulation (for mobility calculation)
wGB = 125 # Width of the diffuse GB
GBmob0 = 2.5e-6 #m^4(Js) for copper from schonfelder1997molecular bibtex entry
Q = 0.23 #eV for copper from schonfelder1997molecular bibtex entry
GBenergy = 0.708 #J/m^2 from schonfelder1997molecular bibtex entry
[]
[]
[Postprocessors]
# Scalar postprocessors
[dt]
# Outputs the current time step
type = TimestepSize
[]
[]
[Executioner]
type = Transient # Type of executioner, here it is transient with an adaptive time step
scheme = bdf2 # Type of time integration (2nd order backward euler), defaults to 1st order backward euler
#Preconditioned JFNK (default)
solve_type = 'PJFNK'
# Uses newton iteration to solve the problem.
petsc_options_iname = '-pc_type'
petsc_options_value = 'asm'
l_max_its = 30 # Max number of linear iterations
l_tol = 1e-4 # Relative tolerance for linear solves
nl_max_its = 20 # Max number of nonlinear iterations
start_time = 0.0
end_time = 4000
[TimeStepper]
type = IterationAdaptiveDT
dt = 25 # Initial time step. In this simulation it changes.
optimal_iterations = 6 # Time step will adapt to maintain this number of nonlinear iterations
[]
[]
[Outputs]
exodus = true
csv = true
[pg]
type = PerfGraphOutput
execute_on = 'initial final' # Default is "final"
level = 2 # Default is 1
[]
[]
(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/grain_tracker_test/grain_tracker_advanced_op.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 40
ny = 40
nz = 0
xmax = 1000
ymax = 1000
zmax = 0
elem_type = QUAD4
parallel_type = replicated # Periodic BCs
[]
[GlobalParams]
op_num = 8
var_name_base = gr
order = CONSTANT
family = MONOMIAL
[]
[Variables]
[./PolycrystalVariables]
order = FIRST
family = LAGRANGE
[../]
[]
[UserObjects]
[./voronoi]
type = PolycrystalVoronoi
rand_seed = 1
grain_num = 35
coloring_algorithm = bt
output_adjacency_matrix = true
[../]
[./grain_tracker]
type = GrainTracker
threshold = 0.5
connecting_threshold = 0.5
compute_halo_maps = true # For displaying HALO fields
remap_grains = false
[../]
[]
[ICs]
[./PolycrystalICs]
[./PolycrystalColoringIC]
polycrystal_ic_uo = voronoi
[../]
[../]
[]
[AuxVariables]
[./bnds]
order = FIRST
family = LAGRANGE
[../]
[./unique_grains]
[../]
[./var_indices]
[../]
[./halos]
[../]
[./halo0]
[../]
[./halo1]
[../]
[./halo2]
[../]
[./halo3]
[../]
[./halo4]
[../]
[./halo5]
[../]
[./halo6]
[../]
[./halo7]
[../]
[]
[Kernels]
[./PolycrystalKernel]
[../]
[]
[AuxKernels]
[./BndsCalc]
type = BndsCalcAux
variable = bnds
execute_on = 'initial timestep_end'
[../]
[./unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_tracker
field_display = UNIQUE_REGION
[../]
[./var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
[../]
[./halo0]
type = FeatureFloodCountAux
variable = halo0
map_index = 0
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo1]
type = FeatureFloodCountAux
variable = halo1
map_index = 1
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo2]
type = FeatureFloodCountAux
variable = halo2
map_index = 2
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo3]
type = FeatureFloodCountAux
variable = halo3
map_index = 3
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo4]
type = FeatureFloodCountAux
variable = halo4
map_index = 4
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo5]
type = FeatureFloodCountAux
variable = halo5
map_index = 5
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo6]
type = FeatureFloodCountAux
variable = halo6
map_index = 6
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo7]
type = FeatureFloodCountAux
variable = halo7
map_index = 7
field_display = HALOS
flood_counter = grain_tracker
[../]
[]
[BCs]
[./Periodic]
[./all]
auto_direction = 'x y'
[../]
[../]
[]
[Materials]
[./CuGrGr]
type = GBEvolution
T = 500 # K
wGB = 100 # nm
GBmob0 = 2.5e-6
Q = 0.23
GBenergy = 0.708
molar_volume = 7.11e-6
[../]
[]
[Postprocessors]
[./DOFs]
type = NumDOFs
execute_on = 'initial timestep_end'
[../]
[]
[Executioner]
type = Transient
num_steps = 0
dt = 100.0
[]
[Outputs]
csv = true
perf_graph = true
[]
[Problem]
solve = false
[]
(modules/phase_field/test/tests/grain_tracker_test/split_grain.i)
[Mesh]
[ebsd_mesh]
type = EBSDMeshGenerator
filename = EBSD_split_grain.txt
[]
[]
[GlobalParams]
op_num = 4
var_name_base = gr
[]
[UserObjects]
[ebsd_reader]
type = EBSDReader
[]
[ebsd]
type = PolycrystalEBSD
coloring_algorithm = bt
ebsd_reader = ebsd_reader
enable_var_coloring = true
output_adjacency_matrix = true
[]
[grain_tracker]
type = GrainTracker
flood_entity_type = ELEMENTAL
compute_halo_maps = true # For displaying HALO fields
polycrystal_ic_uo = ebsd
[]
[]
[ICs]
[PolycrystalICs]
[PolycrystalColoringIC]
polycrystal_ic_uo = ebsd
[]
[]
[]
[Variables]
[PolycrystalVariables]
[]
[]
[AuxVariables]
[bnds]
[]
[unique_grains]
order = CONSTANT
family = MONOMIAL
[]
[ghost_elements]
order = CONSTANT
family = MONOMIAL
[]
[halos]
order = CONSTANT
family = MONOMIAL
[]
[var_indices]
order = CONSTANT
family = MONOMIAL
[]
[ebsd_grains]
family = MONOMIAL
order = CONSTANT
[]
[]
[Kernels]
[PolycrystalKernel]
[]
[]
[AuxKernels]
[BndsCalc]
type = BndsCalcAux
variable = bnds
execute_on = 'initial timestep_end'
[]
[ghost_elements]
type = FeatureFloodCountAux
variable = ghost_elements
field_display = GHOSTED_ENTITIES
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
[]
[halos]
type = FeatureFloodCountAux
variable = halos
field_display = HALOS
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
[]
[var_indices]
type = FeatureFloodCountAux
variable = var_indices
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
[]
[unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
field_display = UNIQUE_REGION
[]
[grain_aux]
type = EBSDReaderPointDataAux
variable = ebsd_grains
ebsd_reader = ebsd_reader
data_name = 'feature_id'
execute_on = 'initial timestep_end'
[]
[]
[Modules]
[PhaseField]
[EulerAngles2RGB]
crystal_structure = cubic
euler_angle_provider = ebsd_reader
grain_tracker = grain_tracker
[]
[]
[]
[Materials]
[Copper]
# T = 500 # K
type = GBEvolution
T = 500
wGB = 0.6 # um
GBmob0 = 2.5e-6 # m^4/(Js) from Schoenfelder 1997
Q = 0.23 # Migration energy in eV
GBenergy = 0.708 # GB energy in J/m^2
molar_volume = 7.11e-6 # Molar volume in m^3/mol
length_scale = 1.0e-6
time_scale = 1.0e-6
[]
[]
[Postprocessors]
[n_elements]
type = NumElems
execute_on = 'initial timestep_end'
[]
[n_nodes]
type = NumNodes
execute_on = 'initial timestep_end'
[]
[DOFs]
type = NumDOFs
[]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type -pc_hypre_boomeramg_strong_threshold'
petsc_options_value = 'hypre boomeramg 0.7'
l_tol = 1.0e-4
l_max_its = 20
nl_max_its = 20
nl_rel_tol = 1.0e-8
start_time = 0.0
num_steps = 2
[TimeStepper]
type = IterationAdaptiveDT
cutback_factor = 0.9
dt = 10.0
growth_factor = 1.1
optimal_iterations = 7
[]
[]
[Outputs]
exodus = true
csv = true
perf_graph = true
[]
(modules/phase_field/test/tests/reconstruction/2phase_reconstruction4.i)
#
# In this test we set the initial condition of a set of order parameters
# by pulling out the only grains from given EBSD data file that belong to a specified phase
#
[Problem]
type = FEProblem
solve = false
kernel_coverage_check = false
[]
[Mesh]
[ebsd_mesh]
type = EBSDMeshGenerator
filename = ebsd_40x40_2_phase.txt
[]
[]
[GlobalParams]
op_num = 6
var_name_base = gr
[]
[UserObjects]
[ebsd_reader]
type = EBSDReader
[]
[ebsd]
type = PolycrystalEBSD
coloring_algorithm = bt
ebsd_reader = ebsd_reader
phase = 2
output_adjacency_matrix = true
[]
[grain_tracker]
type = GrainTracker
polycrystal_ic_uo = ebsd
remap_grains = false
[]
[]
[AuxVariables]
[var_indices]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
[]
[]
[ICs]
[PolycrystalICs]
[PolycrystalColoringIC]
polycrystal_ic_uo = ebsd
[]
[]
[]
[Variables]
[PolycrystalVariables]
[]
[]
[Executioner]
type = Transient
num_steps = 0
[]
[Outputs]
exodus = true
[]
(modules/phase_field/test/tests/grain_tracker_test/grain_tracker_reserve.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 40
ny = 40
xmin = 0
xmax = 100
ymin = 0
ymax = 100
elem_type = QUAD4
[]
[AuxVariables]
[./c]
[../]
[]
[Variables]
[./gr0]
[../]
[./gr1]
[../]
[]
[ICs]
[./gr0]
type = MultiSmoothCircleIC
variable = gr0
invalue = 1.0
outvalue = 0.0001
bubspac = 20.0
numbub = 2
radius = 10.0
int_width = 12.0
radius_variation = 0.2
radius_variation_type = uniform
[../]
[./c_IC]
type = SmoothCircleIC
int_width = 12.0
x1 = 50
y1 = 50
radius = 10.0
outvalue = 0
variable = c
invalue = 1
[../]
[]
[Kernels]
[./ie_gr0]
type = TimeDerivative
variable = gr0
[../]
[./diff_gr0]
type = Diffusion
variable = gr0
[../]
[./ie_gr1]
type = TimeDerivative
variable = gr1
[../]
[./diff_gr1]
type = Diffusion
variable = gr1
[../]
[./source]
type = MaskedBodyForce
variable = gr1
function = t
mask = mask
[../]
[]
[Materials]
[./mask]
type = ParsedMaterial
expression = 'c'
property_name = mask
coupled_variables = 'c'
[../]
[]
[Postprocessors]
[./grain_tracker]
type = GrainTracker
# Reserve the first "op" variable
reserve_op = 1
threshold = 0.1
connecting_threshold = 0.001
variable = 'gr0 gr1'
execute_on = 'initial timestep_end'
[../]
[]
[Executioner]
type = Transient
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
num_steps = 6
dt = 0.25
[]
[Outputs]
exodus = true
[]
[Problem]
kernel_coverage_check = false
[]
(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/initial_conditions/polycrystalcircles_clipped.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 100
ny = 56
nz = 0
xmin = 80
xmax = 200
ymin = 0
ymax = 112
zmin = 0
zmax = 0
[]
[GlobalParams]
op_num = 6
var_name_base = gr
[]
[Variables]
[./PolycrystalVariables]
[../]
[]
[AuxVariables]
[./unique_grains]
order = CONSTANT
family = MONOMIAL
[../]
[./var_indices]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_tracker
field_display = UNIQUE_REGION
execute_on = 'initial timestep_end'
[../]
[./var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
execute_on = 'initial timestep_end'
[../]
[]
[UserObjects]
[./circle_IC]
type = PolycrystalCircles
file_name = 'circles.txt'
read_from_file = true
execute_on = 'initial'
int_width = 2
[../]
[./grain_tracker]
type = GrainTracker
remap_grains = true
compute_halo_maps = false
polycrystal_ic_uo = circle_IC
[../]
[]
[ICs]
[./PolycrystalICs]
[./PolycrystalColoringIC]
polycrystal_ic_uo = circle_IC
[../]
[../]
[]
[Kernels]
[./dt_gr0]
type = TimeDerivative
variable = gr0
[../]
[./dt_gr1]
type = TimeDerivative
variable = gr1
[../]
[./dt_gr2]
type = TimeDerivative
variable = gr2
[../]
[./dt_gr3]
type = TimeDerivative
variable = gr3
[../]
[./dt_gr4]
type = TimeDerivative
variable = gr4
[../]
[./dt_gr5]
type = TimeDerivative
variable = gr5
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK
num_steps = 0
[]
[Outputs]
exodus = true
csv = false
[]
(modules/phase_field/test/tests/grain_tracker_test/one_grain.i)
[Mesh]
type = GeneratedMesh
dim = 2 # Problem dimension
nx = 4
ny = 4
[]
[Variables]
[u]
order = FIRST
family = LAGRANGE
initial_condition = 1.0
[]
[]
[AuxVariables]
[halos]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[halos]
type = FeatureFloodCountAux
variable = halos
flood_counter = grain_tracker
field_display = HALOS
execute_on = 'initial timestep_end'
[]
[]
[UserObjects]
[grain_tracker]
type = GrainTracker
variable = 'u'
compute_halo_maps = true # For displaying HALO fields
execute_on = 'initial timestep_end'
verbosity_level = 3
[]
[]
[Executioner]
type = Transient
num_steps = 2
[]
[Outputs]
csv = true
[]
[Problem]
solve = false
[]
(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/phase_field/test/tests/GBType/GB_Type_Phase2.i)
# MOOSE input file
# Written by Pierre-Clement Simon - Idaho National Laboratory
#
# Project:
# TRISO fuel fission gas transport: Silver diffusion in silicon carbide
#
# Published with:
# ---
#
# Phase Field Model: Isotropic diffusion equation
# type: Steady-State
# Grain structure: Bicrystal with heterogeneous diffusion (higher in GBs than within grains)
# BCs: Periodic for AEH, flux and fix for direct method
# System: Ag in SiC with bulk and Gb diffusion from LLS
#
#
# Info:
# - Dimentional input file for the diffusion of a solute in a complex
# polycrystal
#
#
# Updates from previous file:
#
#
# Units
# length: nm
# time: s
# energy: --
# quantity: --
[Mesh]
file = 'GB_Type_Phase1_out.e'
[]
[GlobalParams]
op_num = 6
var_name_base = gr
[]
[UserObjects]
[./initial_grains]
type = SolutionUserObject
mesh = 'GB_Type_Phase1_out.e'
timestep = LATEST
[../]
[./grain_tracker]
type = GrainTracker
threshold = 0.2
connecting_threshold = 0.08
compute_var_to_feature_map = true
flood_entity_type = ELEMENTAL
compute_halo_maps = true # For displaying HALO fields
[../]
[]
[Variables]
[./cx_AEH] #composition used for the x-component of the AEH solve
initial_condition = 0.5
[../]
[]
[BCs]
[./Periodic]
[./all]
auto_direction = 'x y'
variable = 'cx_AEH'
[../]
[../]
[]
[AuxVariables]
[./gr0]
order = FIRST
family = LAGRANGE
[../]
[./gr1]
order = FIRST
family = LAGRANGE
[../]
[./gr2]
order = FIRST
family = LAGRANGE
[../]
[./gr3]
order = FIRST
family = LAGRANGE
[../]
[./gr4]
order = FIRST
family = LAGRANGE
[../]
[./gr5]
order = FIRST
family = LAGRANGE
[../]
[./bnds]
order = FIRST
family = LAGRANGE
[../]
[./bnds_LAGB]
order = FIRST
family = LAGRANGE
[../]
[./bnds_HAGB]
order = FIRST
family = LAGRANGE
[../]
[./gb_type]
order = CONSTANT
family = MONOMIAL
[../]
[./EBSD_grain]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./init_grO]
type = SolutionAux
execute_on = INITIAL
variable = gr0
solution = initial_grains
from_variable = gr0
[../]
[./init_gr1]
type = SolutionAux
execute_on = INITIAL
variable = gr1
solution = initial_grains
from_variable = gr1
[../]
[./init_gr2]
type = SolutionAux
execute_on = INITIAL
variable = gr2
solution = initial_grains
from_variable = gr2
[../]
[./init_gr3]
type = SolutionAux
execute_on = INITIAL
variable = gr3
solution = initial_grains
from_variable = gr3
[../]
[./init_gr4]
type = SolutionAux
execute_on = INITIAL
variable = gr4
solution = initial_grains
from_variable = gr4
[../]
[./init_gr5]
type = SolutionAux
execute_on = INITIAL
variable = gr5
solution = initial_grains
from_variable = gr5
[../]
[./init_EBSD_grain]
type = SolutionAux
execute_on = INITIAL
variable = EBSD_grain
solution = initial_grains
from_variable = ebsd_numbers
[../]
[./gb_type]
type = SolutionAux
execute_on = 'INITIAL TIMESTEP_END'
variable = gb_type
solution = initial_grains
from_variable = gb_type
[../]
[./bnds_aux]
# AuxKernel that calculates the GB term
type = BndsCalcAux
variable = bnds
execute_on = 'INITIAL TIMESTEP_END'
[../]
[./bnds_LAGB]
# Calculate the bnds for specific GB type
type = SolutionAuxMisorientationBoundary
variable = bnds_LAGB
gb_type_order = 1
solution = initial_grains
from_variable = gb_type
execute_on = 'INITIAL TIMESTEP_END'
[../]
[./bnds_HAGB]
# Calculate the bnds for specific GB type
type = SolutionAuxMisorientationBoundary
variable = bnds_HAGB
gb_type_order = 2
solution = initial_grains
from_variable = gb_type
execute_on = 'INITIAL TIMESTEP_END'
[../]
[]
[Kernels]
[./Diff_x]
type = MatDiffusion
diffusivity = D_Scaling
variable = cx_AEH
args = 'bnds'
[../]
[]
[Materials]
#=========================================================== Generic Constants
[./consts]
type = GenericConstantMaterial
prop_names = 'R T '
prop_values = '8.3145 1450'
# unit J.mol-1.K-1 K
[../]
[./consts_expected]
type = GenericConstantMaterial
prop_names = 'Db Dgbl Dgbh'
prop_values = '0.007 0.302 821.672'
# unit nm^2/s nm^2/s nm^2/s
outputs = exodus
[../]
#===================================================== Interpolation functions
[./hgb] # equal to 1 in grain boundaries, 0 elsewhere in grains.
type = DerivativeParsedMaterial
coupled_variables = 'bnds'
constant_names = 'bnds_middle width tanh_cst_x2'
constant_expressions = '0.75 0.0596 2.1972245773362196'
expression = '1-0.5*(1.0+tanh(tanh_cst_x2*(bnds-bnds_middle)/width))'
property_name = 'hgb'
outputs = exodus
[../]
[./hgb_lagb] # equal to 1 in grain boundaries, 0 elsewhere in grains.
type = DerivativeParsedMaterial
coupled_variables = 'bnds_LAGB'
constant_names = 'bnds_middle width tanh_cst_x2'
constant_expressions = '0.75 0.0596 2.1972245773362196'
expression = '1-0.5*(1.0+tanh(tanh_cst_x2*(bnds_LAGB-bnds_middle)/width))'
property_name = 'hgb_lagb'
outputs = exodus
[../]
[./hgb_hagb] # equal to 1 in grain boundaries, 0 elsewhere in grains.
type = DerivativeParsedMaterial
coupled_variables = 'bnds_HAGB'
constant_names = 'bnds_middle width tanh_cst_x2'
constant_expressions = '0.75 0.0596 2.1972245773362196'
expression = '1-0.5*(1.0+tanh(tanh_cst_x2*(bnds_HAGB-bnds_middle)/width))'
property_name = 'hgb_hagb'
outputs = exodus
[../]
#====================================================== Diffusion coefficients
#====================== Diffusion coefficients - Basic values and coefficients
[./Grain_boundary_width] # size of grain boundaries in input polycrystal, as well as length scales for domain size
type = GenericConstantMaterial
prop_names = 'wGB_ref wGB L '
prop_values = '1 6 9000'
# unit -- -- -- --
[../]
#============================================ Corrected Diffusion coefficients
#========================================================= Analytical 1 - 1x1y
[./Diffusion_coefficient_D]
type = DerivativeParsedMaterial
property_name = 'D_Scaling'
coupled_variables = 'bnds'
material_property_names = 'Db Dgbh Dgbl hgb_lagb(bnds_LAGB) hgb_hagb(bnds_HAGB) hgb(bnds)'
expression = '(1-hgb)*Db+hgb*hgb_lagb/(hgb_lagb+hgb_hagb)*Dgbl+hgb*hgb_hagb/(hgb_lagb+hgb_hagb)*Dgbh'
outputs = exodus
derivative_order = 2
[../]
[]
# It converges faster if all the residuals are at the same magnitude
[Debug]
show_var_residual_norms = true
[../]
[Preconditioning]
[./SMP]
type = SMP
off_diag_row = 'cx_AEH'
off_diag_column = 'cx_AEH'
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart -pc_hypre_boomeramg_strong_threshold'
petsc_options_value = 'hypre boomeramg 31 0.7'
l_max_its = 50
nl_max_its = 50
l_tol = 1e-04
l_abs_tol = 1e-50
nl_abs_tol = 1e-10
nl_rel_tol = 1e-10
[]
[Outputs]
exodus = true
perf_graph = true
[]
(modules/phase_field/test/tests/grain_tracker_test/grain_tracker_nodal.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 25
ny = 25
nz = 0
xmax = 1000
ymax = 1000
zmax = 0
elem_type = QUAD4
[]
[GlobalParams]
op_num = 10
var_name_base = gr
[]
[Variables]
[./PolycrystalVariables]
[../]
[]
[UserObjects]
[./voronoi]
type = PolycrystalVoronoi
grain_num = 10 # Number of grains
coloring_algorithm = bt # bt will assign one grain to each op if they are the same
rand_seed = 1
[../]
[./grain_tracker]
type = GrainTracker
threshold = 0.5
connecting_threshold = 0.2
# Note: This is here for demonstration purposes
# use elemental for most simulations
flood_entity_type = NODAL
[../]
[]
[ICs]
[./PolycrystalICs]
[./PolycrystalColoringIC]
polycrystal_ic_uo = voronoi
[../]
[../]
[]
[AuxVariables]
[./bnds]
order = FIRST
family = LAGRANGE
[../]
[./unique_grains]
order = FIRST
family = LAGRANGE
[../]
[./var_indices]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./PolycrystalKernel]
[../]
[]
[AuxKernels]
[./BndsCalc]
type = BndsCalcAux
variable = bnds
[../]
[./unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_tracker
field_display = UNIQUE_REGION
[../]
[./var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
[../]
[]
[BCs]
[]
[Materials]
[./CuGrGr]
type = GBEvolution
T = 500 # K
wGB = 100 # nm
GBmob0 = 2.5e-6
Q = 0.23
GBenergy = 0.708
molar_volume = 7.11e-6
[../]
[]
[Postprocessors]
[./DOFs]
type = NumDOFs
execute_on = 'initial timestep_end'
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart'
petsc_options_value = 'hypre boomeramg 31'
l_tol = 1.0e-4
l_max_its = 30
nl_max_its = 20
nl_rel_tol = 1.0e-9
start_time = 0.0
num_steps = 2
dt = 100.0
[]
[Outputs]
exodus = true
[]
(modules/combined/test/tests/grain_texture/random_grain_orientation.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 40
ny = 12
xmax = 1000
ymax = 300
elem_type = QUAD4
[]
[GlobalParams]
op_num = 2
var_name_base = gr
[]
[Variables]
[./PolycrystalVariables]
[../]
[]
[ICs]
[./PolycrystalICs]
[./BicrystalBoundingBoxIC]
x1 = 0
y1 = 0
x2 = 500
y2 = 1000
[../]
[../]
[]
[AuxVariables]
[./bnds]
order = FIRST
family = LAGRANGE
[../]
[./unique_grains]
order = CONSTANT
family = MONOMIAL
[../]
[./var_indices]
order = CONSTANT
family = MONOMIAL
[../]
[./active_bounds_elemental]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./PolycrystalKernel]
[../]
[]
[AuxKernels]
[./bnds_aux]
type = BndsCalcAux
variable = bnds
execute_on = timestep_end
[../]
[./unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_tracker
execute_on = 'initial timestep_begin'
field_display = UNIQUE_REGION
[../]
[./var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_tracker
execute_on = 'initial timestep_begin'
field_display = VARIABLE_COLORING
[../]
[./active_bounds_elemental]
type = FeatureFloodCountAux
variable = active_bounds_elemental
field_display = ACTIVE_BOUNDS
execute_on = 'initial timestep_begin'
flood_counter = grain_tracker
[../]
[]
[Modules]
[./PhaseField]
[./EulerAngles2RGB]
crystal_structure = cubic
euler_angle_provider = euler_angle_file
grain_tracker = grain_tracker
[../]
[../]
[]
[Materials]
[./Copper]
type = GBEvolution
block = 0
T = 500 # K
wGB = 75 # nm
GBmob0 = 2.5e-6 #m^4/(Js) from Schoenfelder 1997
Q = 0.23 #Migration energy in eV
GBenergy = 0.708 #GB energy in J/m^2
time_scale = 1.0e-6
[../]
[]
[UserObjects]
[./grain_tracker]
type = GrainTracker
flood_entity_type = elemental
outputs = none
compute_var_to_feature_map = true
execute_on = 'initial timestep_begin'
[../]
[./euler_angle_file]
type = RandomEulerAngleProvider
grain_tracker_object = grain_tracker
execute_on = 'initial timestep_begin'
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
dt = 0.2
num_steps = 3
[]
[Outputs]
exodus = true
perf_graph = true
[]
(modules/phase_field/test/tests/grain_tracker_test/grain_tracker_ebsd.i)
[Mesh]
[ebsd_mesh]
type = EBSDMeshGenerator
filename = 'ebsd_9.txt'
[]
[]
[GlobalParams]
op_num = 4
var_name_base = gr
[]
[UserObjects]
[ebsd_reader]
type = EBSDReader
[]
[ebsd]
type = PolycrystalEBSD
coloring_algorithm = bt
ebsd_reader = ebsd_reader
output_adjacency_matrix = true
[]
[grain_tracker]
type = GrainTracker
threshold = 0.2
connecting_threshold = 0.08
flood_entity_type = ELEMENTAL
compute_halo_maps = true # For displaying HALO fields
polycrystal_ic_uo = ebsd
execute_on = 'initial timestep_end'
[]
[]
[ICs]
[PolycrystalICs]
[PolycrystalColoringIC]
polycrystal_ic_uo = ebsd
[]
[]
[]
[Variables]
[PolycrystalVariables]
[]
[]
[AuxVariables]
[bnds]
[]
[unique_grains]
family = MONOMIAL
order = CONSTANT
[]
[var_indices]
family = MONOMIAL
order = CONSTANT
[]
[ebsd_grains]
family = MONOMIAL
order = CONSTANT
[]
[phi1]
family = MONOMIAL
order = CONSTANT
[]
[halo0]
order = CONSTANT
family = MONOMIAL
[]
[halo1]
order = CONSTANT
family = MONOMIAL
[]
[halo2]
order = CONSTANT
family = MONOMIAL
[]
[halo3]
order = CONSTANT
family = MONOMIAL
[]
[]
[Kernels]
[PolycrystalKernel]
[]
[]
[AuxKernels]
[BndsCalc]
type = BndsCalcAux
variable = bnds
execute_on = timestep_end
[]
[unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
field_display = UNIQUE_REGION
[]
[var_indices]
type = FeatureFloodCountAux
variable = var_indices
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
[]
[grain_aux]
type = EBSDReaderPointDataAux
variable = ebsd_grains
ebsd_reader = ebsd_reader
data_name = 'feature_id'
execute_on = 'initial timestep_end'
[]
[phi1]
type = OutputEulerAngles
euler_angle_provider = ebsd_reader
output_euler_angle = phi1
grain_tracker = grain_tracker
variable = phi1
[]
[halo0]
type = FeatureFloodCountAux
variable = halo0
map_index = 0
field_display = HALOS
flood_counter = grain_tracker
[]
[halo1]
type = FeatureFloodCountAux
variable = halo1
map_index = 1
field_display = HALOS
flood_counter = grain_tracker
[]
[halo2]
type = FeatureFloodCountAux
variable = halo2
map_index = 2
field_display = HALOS
flood_counter = grain_tracker
[]
[halo3]
type = FeatureFloodCountAux
variable = halo3
map_index = 3
field_display = HALOS
flood_counter = grain_tracker
[]
[]
[Materials]
[CuGrGr]
type = GBEvolution
T = 500 #K
wGB = 0.75 #micron
length_scale = 1.0e-6
time_scale = 1.0e-4
GBmob0 = 2.5e-6
Q = 0.23
GBenergy = 0.708
molar_volume = 7.11e-6
[]
[]
[Postprocessors]
[n_nodes]
type = NumNodes
execute_on = timestep_end
[]
[DOFs]
type = NumDOFs
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
#Preconditioned JFNK (default)
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart '
'-pc_hypre_boomeramg_strong_threshold'
petsc_options_value = 'hypre boomeramg 31 0.7'
l_tol = 1.0e-4
l_max_its = 20
nl_rel_tol = 1.0e-9
nl_max_its = 20
start_time = 0.0
num_steps = 1
dt = 0.05
[]
[Outputs]
execute_on = 'initial'
exodus = true
perf_graph = 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/reconstruction/euler2rgb_no_grain_region.i)
[Mesh]
[ebsd_mesh]
type = EBSDMeshGenerator
filename = ebsd_small.txt
[]
[]
[GlobalParams]
op_num = 8
var_name_base = gr
[]
[UserObjects]
[ebsd_reader]
type = EBSDReader
execute_on = initial
[]
[ebsd]
type = PolycrystalEBSD
coloring_algorithm = bt
ebsd_reader = ebsd_reader
phase = 2
output_adjacency_matrix = true
[]
[grain_tracker]
type = GrainTracker
polycrystal_ic_uo = ebsd
[]
[]
[ICs]
[PolycrystalICs]
[PolycrystalColoringIC]
polycrystal_ic_uo = ebsd
[]
[]
[void_phase]
type = ReconPhaseVarIC
variable = c
ebsd_reader = ebsd_reader
phase = 1
[]
[]
[Variables]
[PolycrystalVariables]
[]
[]
[AuxVariables]
# active = 'c bnds'
[c]
[]
[bnds]
[]
[ebsd_numbers]
family = MONOMIAL
order = CONSTANT
[]
# Note: Not active
[unique_grains]
family = MONOMIAL
order = CONSTANT
[]
[var_indices]
family = MONOMIAL
order = CONSTANT
[]
[]
[Kernels]
[PolycrystalKernel]
c = c
[]
[]
[AuxKernels]
# active = 'BndsCalc'
[BndsCalc]
type = BndsCalcAux
variable = bnds
execute_on = 'initial timestep_end'
[]
[ebsd_numbers]
type = EBSDReaderAvgDataAux
data_name = feature_id
ebsd_reader = ebsd_reader
grain_tracker = grain_tracker
variable = ebsd_numbers
phase = 2
execute_on = 'initial timestep_end'
[]
# Note: Not active
[unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_tracker
field_display = UNIQUE_REGION
execute_on = 'initial timestep_end'
[]
[var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
execute_on = 'initial timestep_end'
[]
[]
[Modules]
[PhaseField]
[EulerAngles2RGB]
crystal_structure = cubic
grain_tracker = grain_tracker
euler_angle_provider = ebsd_reader
no_grain_color = '.1 .1 .1'
phase = 2
[]
[]
[]
[Materials]
[bulk]
type = GBEvolution
block = 0
T = 2273
wGB = 10.0
GBenergy = 1.58
GBmob0 = 9.2124e-9
Q = 2.77
length_scale = 1.0e-6
time_scale = 60.0
[]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK
petsc_options_iname = '-pc_type -sub_pc_type -pc_asm_overlap -ksp_grmres_restart '
petsc_options_value = ' asm lu 1 21'
start_time = 0.0
dt = 0.2
num_steps = 1
[]
[Outputs]
csv = true
exodus = true
execute_on = 'INITIAL TIMESTEP_END'
perf_graph = true
[]
(modules/phase_field/test/tests/reconstruction/euler2rgb_non_uniform_orientation.i)
[Mesh]
[ebsd_mesh]
type = EBSDMeshGenerator
filename = ebsd_scan.txt
[]
[]
[GlobalParams]
op_num = 10
var_name_base = gr
[]
[UserObjects]
[ebsd_reader]
type = EBSDReader
bins = 40
[]
[ebsd]
type = PolycrystalEBSD
coloring_algorithm = jp
ebsd_reader = ebsd_reader
enable_var_coloring = true
[]
[grain_tracker]
type = GrainTracker
flood_entity_type = ELEMENTAL
compute_halo_maps = true # For displaying HALO fields
polycrystal_ic_uo = ebsd
[]
[]
[ICs]
[PolycrystalICs]
[PolycrystalColoringIC]
polycrystal_ic_uo = ebsd
[]
[]
[]
[Variables]
[PolycrystalVariables]
[]
[]
[AuxVariables]
[bnds]
[]
[]
[Kernels]
[PolycrystalKernel]
[]
[]
[AuxKernels]
[BndsCalc]
type = BndsCalcAux
variable = bnds
execute_on = 'initial timestep_end'
[]
[]
[Modules]
[PhaseField]
[EulerAngles2RGB]
crystal_structure = cubic
euler_angle_provider = ebsd_reader
grain_tracker = grain_tracker
[]
[]
[]
[Materials]
[Copper]
# T = 500 # K
type = GBEvolution
T = 500
wGB = 0.6 # um
GBmob0 = 2.5e-6 # m^4/(Js) from Schoenfelder 1997
Q = 0.23 # Migration energy in eV
GBenergy = 0.708 # GB energy in J/m^2
molar_volume = 7.11e-6 # Molar volume in m^3/mol
length_scale = 1.0e-6
time_scale = 1.0e-6
[]
[]
[Postprocessors]
[dt]
type = TimestepSize
[]
[n_elements]
type = NumElems
execute_on = 'initial timestep_end'
[]
[n_nodes]
type = NumNodes
execute_on = 'initial timestep_end'
[]
[DOFs]
type = NumDOFs
[]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = Newton
petsc_options_iname = '-pc_type -pc_hypre_type -pc_hypre_boomeramg_strong_threshold'
petsc_options_value = 'hypre boomeramg 0.7'
l_tol = 1.0e-6
l_max_its = 100
nl_max_its = 20
nl_rel_tol = 1.0e-8
start_time = 0.0
num_steps = 0
[]
[Outputs]
exodus = true
perf_graph = true
[]
(modules/phase_field/test/tests/reconstruction/1phase_evolution.i)
#
# In this test we set the initial condition of a set of order parameters
# by pulling out the grain data from given EBSD data file ignoring the phase completely.
#
[Mesh]
[ebsd_mesh]
type = EBSDMeshGenerator
filename = IN100_001_28x28_Marmot.txt
[]
[]
[GlobalParams]
op_num = 5
var_name_base = gr
[]
[UserObjects]
[ebsd_reader]
type = EBSDReader
[]
[ebsd]
type = PolycrystalEBSD
coloring_algorithm = bt
ebsd_reader = ebsd_reader
output_adjacency_matrix = true
[]
[grain_tracker]
type = GrainTracker
polycrystal_ic_uo = ebsd
[]
[]
[ICs]
[PolycrystalICs]
[PolycrystalColoringIC]
polycrystal_ic_uo = ebsd
[]
[]
[]
[Variables]
[PolycrystalVariables]
[]
[]
[Kernels]
[PolycrystalKernel]
[]
[]
[AuxVariables]
[feature]
family = MONOMIAL
order = CONSTANT
[]
[bnds]
[]
[]
[AuxKernels]
[feature]
type = EBSDReaderAvgDataAux
variable = feature
ebsd_reader = ebsd_reader
grain_tracker = grain_tracker
data_name = feature_id
execute_on = 'initial timestep_end'
[]
[bnds]
type = BndsCalcAux
variable = bnds
execute_on = 'initial timestep_end'
[]
[]
[Materials]
[CuGrGr]
# Material properties
type = GBEvolution # Quantitative material properties for copper grain growth. Dimensions are nm and ns
block = 0 # Block ID (only one block in this problem)
GBmob0 = 2.5e-6 #Mobility prefactor for Cu from schonfelder1997molecular bibtex entry
GBenergy = 0.708 # GB energy in J/m^2
Q = 0.23 #Activation energy for grain growth from Schonfelder 1997
T = 500 # K #Constant temperature of the simulation (for mobility calculation)
wGB = 1 # nm #Width of the diffuse GB
#outputs = exodus
length_scale = 1e-06
time_scale = 1e-6
[]
[]
[Executioner]
type = Transient
num_steps = 2
dt = 10
[]
[Outputs]
exodus = true
[]
(modules/combined/examples/phase_field-mechanics/grain_texture.i)
# This simulation predicts GB migration of 8 grains and outputs grain texture information
# Mesh adaptivity is not used so that the VectorPostprocessor's output will be uniform
# Time step adaptivity is used
# An AuxVariable is used to calculate the grain boundary locations
# Postprocessors are used to record time step
[Mesh]
# Mesh block. Meshes can be read in or automatically generated
type = GeneratedMesh
dim = 2 # Problem dimension
nx = 100 # Number of elements in the x-direction
ny = 100 # Number of elements in the y-direction
xmin = 0 # minimum x-coordinate of the mesh
xmax = 1000 # maximum x-coordinate of the mesh
ymin = 0 # minimum y-coordinate of the mesh
ymax = 1000 # maximum y-coordinate of the mesh
elem_type = QUAD4 # Type of elements used in the mesh
[]
[GlobalParams]
# Parameters used by several kernels that are defined globally to simplify input file
op_num = 8 # Number of order parameters used
var_name_base = gr # Base name of grains
grain_num = 8 #Number of grains
[]
[Variables]
# Variable block, where all variables in the simulation are declared
[./PolycrystalVariables]
[../]
[]
[UserObjects]
[./voronoi]
type = PolycrystalVoronoi
coloring_algorithm = bt
[../]
[./grain_tracker]
type = GrainTracker
threshold = 0.2
connecting_threshold = 0.08
[../]
[]
[ICs]
[./PolycrystalICs]
[./PolycrystalColoringIC]
polycrystal_ic_uo = voronoi
[../]
[../]
[]
[AuxVariables]
# Dependent variables
[./bnds]
# Variable used to visualize the grain boundaries in the simulation
order = FIRST
family = LAGRANGE
[../]
[./unique_grains]
order = CONSTANT
family = MONOMIAL
[../]
[./var_indices]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
# Kernel block, where the kernels defining the residual equations are set up.
[./PolycrystalKernel]
# Custom action creating all necessary kernels for grain growth. All input parameters are up in GlobalParams
[../]
[]
[AuxKernels]
# AuxKernel block, defining the equations used to calculate the auxvars
[./bnds_aux]
# AuxKernel that calculates the GB term
type = BndsCalcAux
variable = bnds
execute_on = timestep_end
[../]
[./unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
execute_on = timestep_end
flood_counter = grain_tracker
field_display = UNIQUE_REGION
[../]
[./var_indices]
type = FeatureFloodCountAux
variable = var_indices
execute_on = timestep_end
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
[../]
[]
[BCs]
# Boundary Condition block
[./Periodic]
[./top_bottom]
auto_direction = 'x y' # Makes problem periodic in the x and y directions
[../]
[../]
[]
[Materials]
[./CuGrGr]
# Material properties
type = GBEvolution # Quantitative material properties for copper grain growth. Dimensions are nm and ns
block = 0 # Block ID (only one block in this problem)
GBmob0 = 2.5e-6 #Mobility prefactor for Cu from Schonfelder1997
GBenergy = 0.708 # GB energy in J/m^2
Q = 0.23 #Activation energy for grain growth from Schonfelder 1997
T = 450 # K #Constant temperature of the simulation (for mobility calculation)
wGB = 14 # nm #Width of the diffuse GB
outputs = exodus
[../]
[]
[UserObjects]
[./euler_angle_file]
type = EulerAngleFileReader
file_name = grn_8_rand_2D.tex
[../]
[]
[VectorPostprocessors]
[./gbInfo]
type = GrainTextureVectorPostprocessor
unique_grains = unique_grains
euler_angle_provider = euler_angle_file
sort_by = id # sort output by elem id
[../]
[]
[Executioner]
type = Transient # Type of executioner, here it is transient with an adaptive time step
scheme = bdf2 # Type of time integration (2nd order backward euler), defaults to 1st order backward euler
#Preconditioned JFNK (default)
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart -mat_mffd_type'
petsc_options_value = 'hypre boomeramg 101 ds'
l_max_its = 30 # Max number of linear iterations
l_tol = 1e-4 # Relative tolerance for linear solves
nl_max_its = 40 # Max number of nonlinear iterations
nl_abs_tol = 1e-11 # Relative tolerance for nonlinear solves
nl_rel_tol = 1e-10 # Absolute tolerance for nonlinear solves
start_time = 0.0
num_steps = 50
[./TimeStepper]
type = IterationAdaptiveDT
dt = 25 # Initial time step. In this simulation it changes.
optimal_iterations = 6 # Time step will adapt to maintain this number of nonlinear iterations
[../]
[]
[Outputs]
execute_on = 'INITIAL TIMESTEP_END'
exodus = true
csv = true
perf_graph = true
[./console]
type = Console
max_rows = 20
[../]
[]
(modules/phase_field/test/tests/grain_tracker_test/distributed_poly_ic.i)
[Mesh]
# Mesh block. Meshes can be read in or automatically generated
type = GeneratedMesh
uniform_refine = 1 # Initial uniform refinement of the mesh
dim = 2 # Problem dimension
nx = 12 # Number of elements in the x-direction
ny = 12 # Number of elements in the y-direction
xmax = 1000 # maximum x-coordinate of the mesh
ymax = 1000 # maximum y-coordinate of the mesh
elem_type = QUAD4 # Type of elements used in the mesh
parallel_type = distributed
[]
[GlobalParams]
# Parameters used by several kernels that are defined globally to simplify input file
op_num = '8' # Number of order parameters used
var_name_base = 'gr' # Base name of grains
order = 'CONSTANT'
family = 'MONOMIAL'
[]
[Variables]
# Variable block, where all variables in the simulation are declared
[PolycrystalVariables]
order = FIRST
family = LAGRANGE
[]
[]
[UserObjects]
[voronoi]
type = PolycrystalVoronoi
grain_num = 12 # Number of grains
coloring_algorithm = jp
rand_seed = 10
[]
[grain_tracker]
type = GrainTracker
threshold = 0.2
verbosity_level = 1
connecting_threshold = 0.08
flood_entity_type = ELEMENTAL
compute_halo_maps = true # For displaying HALO fields
execute_on = 'initial timestep_end'
polycrystal_ic_uo = voronoi
[]
[]
[ICs]
[PolycrystalICs]
[PolycrystalColoringIC]
polycrystal_ic_uo = voronoi
[]
[]
[]
[AuxVariables]
# Dependent variables
[bnds]
# Variable used to visualize the grain boundaries in the simulation
order = FIRST
family = LAGRANGE
[]
[unique_grains]
[]
[var_indices]
[]
[ghost_regions]
[]
[halos]
[]
[halo0]
[]
[halo1]
[]
[halo2]
[]
[halo3]
[]
[halo4]
[]
[halo5]
[]
[halo6]
[]
[halo7]
[]
[centroids]
order = CONSTANT
family = MONOMIAL
[]
[proc_id]
[]
[voronoi_id]
[]
[evaluable_elems]
[]
[]
[Kernels]
# Kernel block, where the kernels defining the residual equations are set up.
[PolycrystalKernel]
# Custom action creating all necessary kernels for grain growth. All input parameters are up in GlobalParams
[]
[]
[AuxKernels]
# AuxKernel block, defining the equations used to calculate the auxvars
[bnds_aux]
# AuxKernel that calculates the GB term
type = BndsCalcAux
variable = bnds
execute_on = 'initial timestep_end'
[]
[unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_tracker
field_display = UNIQUE_REGION
execute_on = 'initial timestep_end'
[]
[var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
execute_on = 'initial timestep_end'
[]
[ghosted_entities]
type = FeatureFloodCountAux
variable = ghost_regions
flood_counter = grain_tracker
field_display = GHOSTED_ENTITIES
execute_on = 'initial timestep_end'
[]
[halos]
type = FeatureFloodCountAux
variable = halos
flood_counter = grain_tracker
field_display = HALOS
execute_on = 'initial timestep_end'
[]
[halo0]
type = FeatureFloodCountAux
variable = halo0
map_index = 0
field_display = HALOS
flood_counter = grain_tracker
[]
[halo1]
type = FeatureFloodCountAux
variable = halo1
map_index = 1
field_display = HALOS
flood_counter = grain_tracker
[]
[halo2]
type = FeatureFloodCountAux
variable = halo2
map_index = 2
field_display = HALOS
flood_counter = grain_tracker
[]
[halo3]
type = FeatureFloodCountAux
variable = halo3
map_index = 3
field_display = HALOS
flood_counter = grain_tracker
[]
[halo4]
type = FeatureFloodCountAux
variable = halo4
map_index = 4
field_display = HALOS
flood_counter = grain_tracker
[]
[halo5]
type = FeatureFloodCountAux
variable = halo5
map_index = 5
field_display = HALOS
flood_counter = grain_tracker
[]
[halo6]
type = FeatureFloodCountAux
variable = halo6
map_index = 6
field_display = HALOS
flood_counter = grain_tracker
[]
[halo7]
type = FeatureFloodCountAux
variable = halo7
map_index = 7
field_display = HALOS
flood_counter = grain_tracker
[]
[centroids]
type = FeatureFloodCountAux
variable = centroids
execute_on = 'timestep_end'
field_display = CENTROID
flood_counter = grain_tracker
[]
[proc_id]
type = ProcessorIDAux
variable = proc_id
execute_on = 'initial'
[]
[voronoi_id]
type = VoronoiICAux
variable = voronoi_id
execute_on = 'initial'
polycrystal_ic_uo = voronoi
[]
[]
[Materials]
[CuGrGr]
# Material properties
type = GBEvolution
T = '450' # Constant temperature of the simulation (for mobility calculation)
wGB = 125 # Width of the diffuse GB
GBmob0 = 2.5e-6 # m^4(Js) for copper from schonfelder1997molecular bibtex entry
Q = 0.23 # eV for copper from schonfelder1997molecular bibtex entry
GBenergy = 0.708 # J/m^2 from schonfelder1997molecular bibtex entry
[]
[]
[Postprocessors]
# Scalar postprocessors
[dt]
# Outputs the current time step
type = TimestepSize
[]
[]
[Executioner]
# Uses newton iteration to solve the problem.
type = Transient # Type of executioner, here it is transient with an adaptive time step
scheme = bdf2 # Type of time integration (2nd order backward euler), defaults to 1st order backward euler
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart -mat_mffd_type'
petsc_options_value = 'hypre boomeramg 101 ds'
l_max_its = 30 # Max number of linear iterations
l_tol = 1e-4 # Relative tolerance for linear solves
nl_max_its = 40 # Max number of nonlinear iterations
nl_rel_tol = 1e-10 # Absolute tolerance for nonlienar solves
start_time = 0.0
num_steps = 2
dt = 300
[]
[Outputs]
csv = true
[]
(modules/phase_field/examples/ebsd_reconstruction/IN100-111grn.i)
[Mesh]
[ebsd_mesh]
type = EBSDMeshGenerator
filename = IN100_120x120.txt
pre_refine = 2
[]
[]
[GlobalParams]
op_num = 8
var_name_base = gr
[]
[UserObjects]
[ebsd_reader]
type = EBSDReader
[]
[ebsd]
type = PolycrystalEBSD
coloring_algorithm = bt
ebsd_reader = ebsd_reader
enable_var_coloring = true
[]
[grain_tracker]
type = GrainTracker
flood_entity_type = ELEMENTAL
compute_halo_maps = true # For displaying HALO fields
polycrystal_ic_uo = ebsd
[]
[]
[ICs]
[PolycrystalICs]
[PolycrystalColoringIC]
polycrystal_ic_uo = ebsd
[]
[]
[]
[Variables]
[PolycrystalVariables]
[]
[]
[AuxVariables]
[bnds]
[]
[unique_grains_ic]
order = CONSTANT
family = MONOMIAL
[]
[unique_grains]
order = CONSTANT
family = MONOMIAL
[]
[ghost_elements]
order = CONSTANT
family = MONOMIAL
[]
[halos]
order = CONSTANT
family = MONOMIAL
[]
[var_indices_ic]
order = CONSTANT
family = MONOMIAL
[]
[var_indices]
order = CONSTANT
family = MONOMIAL
[]
[ebsd_grains]
family = MONOMIAL
order = CONSTANT
[]
[]
[Kernels]
[PolycrystalKernel]
[]
[]
[AuxKernels]
[BndsCalc]
type = BndsCalcAux
variable = bnds
execute_on = 'initial timestep_end'
[]
[ghost_elements]
type = FeatureFloodCountAux
variable = ghost_elements
field_display = GHOSTED_ENTITIES
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
[]
[halos]
type = FeatureFloodCountAux
variable = halos
field_display = HALOS
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
[]
[var_indices_ic]
type = FeatureFloodCountAux
variable = var_indices_ic
execute_on = 'initial'
flood_counter = ebsd
field_display = VARIABLE_COLORING
[]
[unique_grains_ic]
type = FeatureFloodCountAux
variable = unique_grains_ic
execute_on = 'initial'
flood_counter = ebsd
field_display = UNIQUE_REGION
[]
[var_indices]
type = FeatureFloodCountAux
variable = var_indices
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
[]
[unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
field_display = UNIQUE_REGION
[]
[grain_aux]
type = EBSDReaderPointDataAux
variable = ebsd_grains
ebsd_reader = ebsd_reader
data_name = 'feature_id'
execute_on = 'initial timestep_end'
[]
[]
[Modules]
[PhaseField]
[EulerAngles2RGB]
crystal_structure = cubic
euler_angle_provider = ebsd_reader
grain_tracker = grain_tracker
[]
[]
[]
[Materials]
[Copper]
# T = 500 # K
type = GBEvolution
T = 500
wGB = 0.6 # um
GBmob0 = 2.5e-6 # m^4/(Js) from Schoenfelder 1997
Q = 0.23 # Migration energy in eV
GBenergy = 0.708 # GB energy in J/m^2
molar_volume = 7.11e-6 # Molar volume in m^3/mol
length_scale = 1.0e-6
time_scale = 1.0e-6
[]
[]
[Postprocessors]
[dt]
type = TimestepSize
[]
[n_elements]
type = NumElems
execute_on = 'initial timestep_end'
[]
[n_nodes]
type = NumNodes
execute_on = 'initial timestep_end'
[]
[DOFs]
type = NumDOFs
[]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type -pc_hypre_boomeramg_strong_threshold'
petsc_options_value = 'hypre boomeramg 0.7'
l_tol = 1.0e-4
l_max_its = 20
nl_max_its = 20
nl_rel_tol = 1.0e-8
start_time = 0.0
num_steps = 30
[TimeStepper]
type = IterationAdaptiveDT
cutback_factor = 0.9
dt = 10.0
growth_factor = 1.1
optimal_iterations = 7
[]
[Adaptivity]
initial_adaptivity = 2
refine_fraction = 0.7
coarsen_fraction = 0.1
max_h_level = 2
[]
[]
[Outputs]
exodus = true
checkpoint = true
perf_graph = true
[]
(modules/phase_field/test/tests/grain_tracker_test/grain_tracker_test_elemental.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 25
ny = 25
nz = 0
xmax = 1000
ymax = 1000
zmax = 0
elem_type = QUAD4
[]
[GlobalParams]
op_num = 12 # Should match grain_num so we can test with FauxGrainTracker too
var_name_base = gr
[]
[Variables]
[./PolycrystalVariables]
[../]
[]
[UserObjects]
[./voronoi]
type = PolycrystalVoronoi
grain_num = 12 # Number of grains
coloring_algorithm = bt # bt will assign one grain to each op if they are the same
rand_seed = 8675
[../]
[./grain_tracker]
type = GrainTracker
[../]
[]
[ICs]
[./PolycrystalICs]
[./PolycrystalColoringIC]
polycrystal_ic_uo = voronoi
[../]
[../]
[]
[AuxVariables]
[./bnds]
order = FIRST
family = LAGRANGE
[../]
[./unique_grains]
order = CONSTANT
family = MONOMIAL
[../]
[./var_indices]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./PolycrystalKernel]
[../]
[]
[AuxKernels]
[./BndsCalc]
type = BndsCalcAux
variable = bnds
[../]
[./unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_tracker
field_display = UNIQUE_REGION
[../]
[./var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
[../]
[]
[BCs]
[./Periodic]
[./all]
auto_direction = 'x y'
[../]
[../]
[]
[Materials]
[./CuGrGr]
type = GBEvolution
T = 500 # K
wGB = 100 # nm
GBmob0 = 2.5e-6
Q = 0.23
GBenergy = 0.708
molar_volume = 7.11e-6
[../]
[]
[Postprocessors]
[./DOFs]
type = NumDOFs
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart'
petsc_options_value = 'hypre boomeramg 31'
l_tol = 1.0e-4
l_max_its = 30
nl_max_its = 20
nl_rel_tol = 1.0e-9
start_time = 0.0
num_steps = 2
dt = 100.0
[]
[Adaptivity]
marker = error_marker
max_h_level = 1
[./Markers]
active = 'error_marker'
[./bnds_marker]
type = ValueThresholdMarker
invert = true
refine = 0.85
coarsen = 0.975
third_state = DO_NOTHING
variable = bnds
[../]
[./error_marker]
type = ErrorFractionMarker
coarsen = 0.1
indicator = bnds_error
refine = 0.7
[../]
[../]
[./Indicators]
[./bnds_error]
type = GradientJumpIndicator
variable = bnds
[../]
[../]
[]
[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/test/tests/grain_tracker_test/grain_tracker_volume.i)
# This test calculates the volume of a few simple shapes
# Using the FeatureVolumeVectorPostprocessor
[Mesh]
# Required for use with distributed mesh
type = GeneratedMesh
dim = 2
nx = 40
ny = 40
nz = 0
xmin = -2
xmax = 2
ymin = -2
ymax = 2
zmax = 0
elem_type = QUAD4
[]
[Variables]
[./gr0]
[../]
[./gr1]
[../]
[]
[ICs]
[./circle]
type = SmoothCircleIC
x1 = 0
y1 = 0
radius = 1
int_width = 0.01
invalue = 1
outvalue = 0
variable = gr0
[../]
[./boxes]
type = MultiBoundingBoxIC
corners = '-1 -1 0
0 0 0'
opposite_corners = '-0.5 -0.5 0
1 1 0'
inside = 1
outside = 0
variable = gr1
[../]
[]
[Postprocessors]
[./grain_tracker]
type = GrainTracker
variable = 'gr0 gr1'
threshold = 0.1
compute_var_to_feature_map = true
execute_on = 'initial'
[../]
[./avg_feature_vol]
type = AverageGrainVolume
feature_counter = grain_tracker
execute_on = 'initial'
[../]
[]
[VectorPostprocessors]
[./grain_volumes]
type = FeatureVolumeVectorPostprocessor
flood_counter = grain_tracker
execute_on = 'initial'
[../]
[]
[Executioner]
type = Steady
[./Adaptivity]
initial_adaptivity = 3
refine_fraction = 0.7
coarsen_fraction = 0.1
max_h_level = 3
[../]
[]
[Problem]
solve = false
[]
[Outputs]
exodus = true
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/phase_field/test/tests/grain_tracker_test/grain_tracker_volume_single.i)
# This test calculates the volume of a few simple shapes
# Using the FeatureVolumeVectorPostprocessor
[Mesh]
type = GeneratedMesh
dim = 2
nx = 40
ny = 40
nz = 0
xmin = -2
xmax = 2
ymin = -2
ymax = 2
zmax = 0
elem_type = QUAD4
[]
[Variables]
[./gr0]
[../]
[./gr1]
[../]
[]
[ICs]
[./circle]
type = SmoothCircleIC
x1 = 0
y1 = 0
radius = 1
int_width = 0.01
invalue = 1
outvalue = 0
variable = gr0
[../]
[./boxes]
type = MultiBoundingBoxIC
corners = '-1.5 -0.25 0
1 -0.5 0'
opposite_corners = '-1 0.25 0
2 0.5 0'
inside = 1
outside = 0
variable = gr1
[../]
[]
[Postprocessors]
[./grain_tracker]
type = GrainTracker
variable = 'gr0 gr1'
threshold = 0.1
compute_var_to_feature_map = true
execute_on = 'initial'
[../]
[]
[VectorPostprocessors]
[./grain_volumes]
type = FeatureVolumeVectorPostprocessor
flood_counter = grain_tracker
single_feature_per_element = true
execute_on = 'initial'
[../]
[]
[Executioner]
type = Steady
[./Adaptivity]
initial_adaptivity = 3
refine_fraction = 0.7
coarsen_fraction = 0.1
max_h_level = 3
[../]
[]
[Problem]
solve = false
[]
[Outputs]
exodus = true
csv = true
[]
(modules/phase_field/test/tests/grain_tracker_test/grain_tracker_remapping_test.i)
# This simulation predicts GB migration of a 2D copper polycrystal with 100 grains represented with 18 order parameters
# Mesh adaptivity and time step adaptivity are used
# An AuxVariable is used to calculate the grain boundary locations
# Postprocessors are used to record time step and the number of grains
[Mesh]
# Mesh block. Meshes can be read in or automatically generated
type = GeneratedMesh
dim = 2 # Problem dimension
nx = 12 # Number of elements in the x-direction
ny = 12 # Number of elements in the y-direction
xmax = 1000 # maximum x-coordinate of the mesh
ymax = 1000 # maximum y-coordinate of the mesh
elem_type = QUAD4 # Type of elements used in the mesh
uniform_refine = 1 # Initial uniform refinement of the mesh
[]
[GlobalParams]
# Parameters used by several kernels that are defined globally to simplify input file
op_num = 8 # Number of order parameters used
var_name_base = gr # Base name of grains
order = CONSTANT
family = MONOMIAL
[]
[Variables]
# Variable block, where all variables in the simulation are declared
[./PolycrystalVariables]
order = FIRST
family = LAGRANGE
[../]
[]
[UserObjects]
[./voronoi]
type = PolycrystalVoronoi
grain_num = 12 # Number of grains
coloring_algorithm = jp
rand_seed = 10
output_adjacency_matrix = true
[../]
[./grain_tracker]
type = GrainTracker
threshold = 0.2
verbosity_level = 1
connecting_threshold = 0.08
flood_entity_type = ELEMENTAL
compute_halo_maps = true # For displaying HALO fields
polycrystal_ic_uo = voronoi
error_on_grain_creation = true
execute_on = 'initial timestep_end'
[../]
[]
[ICs]
[./PolycrystalICs]
[./PolycrystalColoringIC]
polycrystal_ic_uo = voronoi
[../]
[../]
[]
[AuxVariables]
# Dependent variables
[./bnds]
# Variable used to visualize the grain boundaries in the simulation
order = FIRST
family = LAGRANGE
[../]
[./unique_grains]
[../]
[./var_indices]
[../]
[./ghost_regions]
[../]
[./halos]
[../]
[./halo0]
[../]
[./halo1]
[../]
[./halo2]
[../]
[./halo3]
[../]
[./halo4]
[../]
[./halo5]
[../]
[./halo6]
[../]
[./halo7]
[../]
[./centroids]
order = CONSTANT
family = MONOMIAL
[../]
[./proc_id]
[../]
[]
[Kernels]
# Kernel block, where the kernels defining the residual equations are set up.
[./PolycrystalKernel]
# Custom action creating all necessary kernels for grain growth. All input parameters are up in GlobalParams
[../]
[]
[AuxKernels]
# AuxKernel block, defining the equations used to calculate the auxvars
[./bnds_aux]
# AuxKernel that calculates the GB term
type = BndsCalcAux
variable = bnds
execute_on = 'initial timestep_end'
[../]
[./unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_tracker
field_display = UNIQUE_REGION
execute_on = 'initial timestep_end'
[../]
[./var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
execute_on = 'initial timestep_end'
[../]
[./ghosted_entities]
type = FeatureFloodCountAux
variable = ghost_regions
flood_counter = grain_tracker
field_display = GHOSTED_ENTITIES
execute_on = 'initial timestep_end'
[../]
[./halos]
type = FeatureFloodCountAux
variable = halos
flood_counter = grain_tracker
field_display = HALOS
execute_on = 'initial timestep_end'
[../]
[./halo0]
type = FeatureFloodCountAux
variable = halo0
map_index = 0
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo1]
type = FeatureFloodCountAux
variable = halo1
map_index = 1
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo2]
type = FeatureFloodCountAux
variable = halo2
map_index = 2
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo3]
type = FeatureFloodCountAux
variable = halo3
map_index = 3
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo4]
type = FeatureFloodCountAux
variable = halo4
map_index = 4
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo5]
type = FeatureFloodCountAux
variable = halo5
map_index = 5
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo6]
type = FeatureFloodCountAux
variable = halo6
map_index = 6
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo7]
type = FeatureFloodCountAux
variable = halo7
map_index = 7
field_display = HALOS
flood_counter = grain_tracker
[../]
[./centroids]
type = FeatureFloodCountAux
variable = centroids
execute_on = timestep_end
field_display = CENTROID
flood_counter = grain_tracker
[../]
[./proc_id]
type = ProcessorIDAux
variable = proc_id
execute_on = initial
[../]
[]
[BCs]
# Boundary Condition block
[]
[Materials]
[./CuGrGr]
# Material properties
type = GBEvolution
T = 450 # Constant temperature of the simulation (for mobility calculation)
wGB = 125 # Width of the diffuse GB
GBmob0 = 2.5e-6 # m^4(Js) for copper from schonfelder1997molecular bibtex entry
Q = 0.23 # eV for copper from schonfelder1997molecular bibtex entry
GBenergy = 0.708 # J/m^2 from schonfelder1997molecular bibtex entry
[../]
[]
[Postprocessors]
# Scalar postprocessors
[./dt]
# Outputs the current time step
type = TimestepSize
[../]
[]
[Executioner]
# Uses newton iteration to solve the problem.
type = Transient # Type of executioner, here it is transient with an adaptive time step
scheme = bdf2 # Type of time integration (2nd order backward euler), defaults to 1st order backward euler
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart -mat_mffd_type'
petsc_options_value = 'hypre boomeramg 101 ds'
l_max_its = 30 # Max number of linear iterations
l_tol = 1e-4 # Relative tolerance for linear solves
nl_max_its = 40 # Max number of nonlinear iterations
nl_rel_tol = 1e-10 # Absolute tolerance for nonlienar solves
start_time = 0.0
num_steps = 15
dt = 300
[]
[Problem]
type = FEProblem
[]
[Outputs]
csv = true
exodus = true
[./pg]
type = PerfGraphOutput
level = 2 # Default is 1
[../]
[]
(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/examples/grain_growth/grain_growth_linearized_interface.i)
[GlobalParams]
bound_value = 5.0
op_num = 8
var_name_base = phi
[]
[Mesh]
type = GeneratedMesh
dim = 2
xmax = 1000
ymax = 1000
nx = 100
ny = 100
uniform_refine = 1
[]
[Modules]
[PhaseField]
[GrainGrowthLinearizedInterface]
op_name_base = gr
mobility = L
kappa = kappa_op
[]
[]
[]
[ICs]
[PolycrystalICs]
[PolycrystalColoringIC]
polycrystal_ic_uo = RandomVoronoi
nonlinear_preconditioning = true
[]
[]
[]
[UserObjects]
[RandomVoronoi]
type = PolycrystalVoronoi
grain_num = 60
int_width = 10
rand_seed = 103838
[]
[grain_tracker]
type = GrainTracker
threshold = -4.0
compute_halo_maps = true # Only necessary for displaying HALOS
[]
[]
[AuxVariables]
[unique_grains]
order = CONSTANT
family = MONOMIAL
[]
[var_indices]
order = CONSTANT
family = MONOMIAL
[]
[halos]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_tracker
field_display = UNIQUE_REGION
execute_on = 'initial timestep_end'
[]
[var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
execute_on = 'initial timestep_end'
[]
[halos]
type = FeatureFloodCountAux
variable = halos
flood_counter = grain_tracker
field_display = HALOS
execute_on = 'initial timestep_end'
[]
[]
[Materials]
[properties]
type = GenericConstantMaterial
prop_names = 'gbmob gbenergy gbwidth gamma_asymm'
prop_values = '100 6 10 1.5'
[]
[kappa_op]
type = ParsedMaterial
material_property_names = 'gbenergy gbwidth'
property_name = kappa_op
expression = '3/4*gbenergy*gbwidth'
[]
[L]
type = ParsedMaterial
material_property_names = 'gbmob gbwidth'
property_name = L
expression = '4/3*gbmob/gbwidth'
[]
[mu]
type = ParsedMaterial
material_property_names = 'gbenergy gbwidth'
property_name = mu
expression = '6*gbenergy/gbwidth'
[]
[]
[Postprocessors]
[dt]
type = TimestepSize
execute_on = 'initial TIMESTEP_END'
[]
[]
[BCs]
[Periodic]
[All]
auto_direction = 'x y'
[]
[]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type -snes_type'
petsc_options_value = 'hypre boomeramg vinewtonrsls'
l_tol = 1e-4
nl_max_its = 10
l_max_its = 45
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.02
optimal_iterations = 6
[]
end_time = 30
[]
[Outputs]
exodus = true
perf_graph = true
[]
(modules/phase_field/test/tests/grain_tracker_test/grain_tracker_volume_changing.i)
# This simulation predicts GB migration of a 2D copper polycrystal with 100 grains represented with 18 order parameters
# Mesh adaptivity and time step adaptivity are used
# An AuxVariable is used to calculate the grain boundary locations
# Postprocessors are used to record time step and the number of grains
[Mesh]
# Mesh block. Meshes can be read in or automatically generated
type = GeneratedMesh
dim = 2 # Problem dimension
nx = 12 # Number of elements in the x-direction
ny = 12 # Number of elements in the y-direction
xmax = 1000 # maximum x-coordinate of the mesh
ymax = 1000 # maximum y-coordinate of the mesh
elem_type = QUAD4 # Type of elements used in the mesh
uniform_refine = 1 # Initial uniform refinement of the mesh
[]
[GlobalParams]
# Parameters used by several kernels that are defined globally to simplify input file
op_num = 8 # Number of order parameters used
var_name_base = gr # Base name of grains
order = CONSTANT
family = MONOMIAL
[]
[Variables]
# Variable block, where all variables in the simulation are declared
[./PolycrystalVariables]
order = FIRST
family = LAGRANGE
[../]
[]
[UserObjects]
[./voronoi]
type = PolycrystalVoronoi
grain_num = 12 # Number of grains
coloring_algorithm = jp
rand_seed = 15
output_adjacency_matrix = true
[../]
[./grain_tracker]
type = GrainTracker
threshold = 0.2
verbosity_level = 1
connecting_threshold = 0.08
compute_var_to_feature_map = true
compute_halo_maps = true # For displaying HALO fields
polycrystal_ic_uo = voronoi
execute_on = 'initial timestep_end'
[../]
[]
[ICs]
[./PolycrystalICs]
[./PolycrystalColoringIC]
polycrystal_ic_uo = voronoi
[../]
[../]
[]
[AuxVariables]
# Dependent variables
[./bnds]
# Variable used to visualize the grain boundaries in the simulation
order = FIRST
family = LAGRANGE
[../]
[./unique_grains]
[../]
[./var_indices]
[../]
[./ghost_regions]
[../]
[./halos]
[../]
[./halo0]
[../]
[./halo1]
[../]
[./halo2]
[../]
[./halo3]
[../]
[./halo4]
[../]
[./halo5]
[../]
[./halo6]
[../]
[./halo7]
[../]
[./centroids]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
# Kernel block, where the kernels defining the residual equations are set up.
[./PolycrystalKernel]
# Custom action creating all necessary kernels for grain growth. All input parameters are up in GlobalParams
[../]
[]
[AuxKernels]
# AuxKernel block, defining the equations used to calculate the auxvars
[./bnds_aux]
# AuxKernel that calculates the GB term
type = BndsCalcAux
variable = bnds
execute_on = 'initial timestep_end'
[../]
[./unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_tracker
field_display = UNIQUE_REGION
execute_on = 'initial timestep_end'
[../]
[./var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
execute_on = 'initial timestep_end'
[../]
[./ghosted_entities]
type = FeatureFloodCountAux
variable = ghost_regions
flood_counter = grain_tracker
field_display = GHOSTED_ENTITIES
execute_on = 'initial timestep_end'
[../]
[./halos]
type = FeatureFloodCountAux
variable = halos
flood_counter = grain_tracker
field_display = HALOS
execute_on = 'initial timestep_end'
[../]
[./halo0]
type = FeatureFloodCountAux
variable = halo0
map_index = 0
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo1]
type = FeatureFloodCountAux
variable = halo1
map_index = 1
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo2]
type = FeatureFloodCountAux
variable = halo2
map_index = 2
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo3]
type = FeatureFloodCountAux
variable = halo3
map_index = 3
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo4]
type = FeatureFloodCountAux
variable = halo4
map_index = 4
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo5]
type = FeatureFloodCountAux
variable = halo5
map_index = 5
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo6]
type = FeatureFloodCountAux
variable = halo6
map_index = 6
field_display = HALOS
flood_counter = grain_tracker
[../]
[./halo7]
type = FeatureFloodCountAux
variable = halo7
map_index = 7
field_display = HALOS
flood_counter = grain_tracker
[../]
[./centroids]
type = FeatureFloodCountAux
variable = centroids
execute_on = timestep_end
field_display = CENTROID
flood_counter = grain_tracker
[../]
[]
[BCs]
# Boundary Condition block
[]
[Materials]
[./CuGrGr]
# Material properties
type = GBEvolution
T = 450 # Constant temperature of the simulation (for mobility calculation)
wGB = 125 # Width of the diffuse GB
GBmob0 = 2.5e-6 # m^4(Js) for copper from schonfelder1997molecular bibtex entry
Q = 0.23 # eV for copper from schonfelder1997molecular bibtex entry
GBenergy = 0.708 # J/m^2 from schonfelder1997molecular bibtex entry
[../]
[]
[Postprocessors]
# Scalar postprocessors
[./dt]
# Outputs the current time step
type = TimestepSize
[../]
[./avg_grain_volumes]
type = AverageGrainVolume
feature_counter = grain_tracker
execute_on = 'initial timestep_end'
[../]
[]
[Executioner]
# Uses newton iteration to solve the problem.
type = Transient # Type of executioner, here it is transient with an adaptive time step
scheme = bdf2 # Type of time integration (2nd order backward euler), defaults to 1st order backward euler
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart -mat_mffd_type'
petsc_options_value = 'hypre boomeramg 101 ds'
l_max_its = 30 # Max number of linear iterations
l_tol = 1e-4 # Relative tolerance for linear solves
nl_max_its = 40 # Max number of nonlinear iterations
nl_rel_tol = 1e-10 # Absolute tolerance for nonlienar solves
start_time = 0.0
num_steps = 15
dt = 300
[]
[Problem]
type = FEProblem
[]
[Outputs]
csv = true
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/examples/grain_growth/grain_growth_2D_random.i)
# This initializes a polycrystal from random seeds at each node
# Mesh adaptivity and time step adaptivity are used
# Grain tracker is started once the grain structure is established
[Mesh]
# Mesh block. Meshes can be read in or automatically generated
type = GeneratedMesh
dim = 2 # Problem dimension
nx = 40 # Number of elements in the x-direction
ny = 40 # Number of elements in the y-direction
xmax = 1000 # maximum x-coordinate of the mesh
ymax = 1000 # maximum y-coordinate of the mesh
elem_type = QUAD4 # Type of elements used in the mesh
uniform_refine = 2 # Initial uniform refinement of the mesh
parallel_type = replicated # Periodic BCs
[]
[GlobalParams]
# Parameters used by several kernels that are defined globally to simplify input file
op_num = 10 # Number of grains
var_name_base = gr # Base name of grains
[]
[Modules]
[PhaseField]
[GrainGrowth]
[]
[]
[]
[ICs]
[PolycrystalICs]
[PolycrystalRandomIC]
random_type = discrete
[]
[]
[]
[AuxVariables]
# Dependent variables
[unique_grains]
order = CONSTANT
family = MONOMIAL
[]
[var_indices]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
# AuxKernel block, defining the equations used to calculate the auxvars
[unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_tracker
field_display = UNIQUE_REGION
execute_on = 'initial timestep_end'
[]
[var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
execute_on = 'initial timestep_end'
[]
[]
[BCs]
# Boundary Condition block
[Periodic]
[top_bottom]
auto_direction = 'x y' # Makes problem periodic in the x and y directions
[]
[]
[]
[Materials]
[CuGrGr]
# Material properties
type = GBEvolution # Quantitative material properties for copper grain growth. Dimensions are nm and ns
GBmob0 = 2.5e-6 # Mobility prefactor for Cu from schonfelder1997molecular bibtex entry
GBenergy = 0.708 # GB energy for Cu from schonfelder1997molecular bibtex entry
Q = 0.23 # Activation energy for grain growth from Schonfelder 1997
T = 450 # Constant temperature of the simulation (for mobility calculation)
wGB = 14 # Width of the diffuse GB
[]
[]
[UserObjects]
[grain_tracker]
type = GrainTracker
tracking_step = 20 #Tracking is delayed until the polycrystalline structure is established
[]
[]
[Postprocessors]
# Scalar postprocessors
[dt]
# Outputs the current time step
type = TimestepSize
[]
[num_nodes]
type = NumNodes
[]
[]
[Executioner]
type = Transient # Type of executioner, here it is transient with an adaptive time step
scheme = bdf2 # Type of time integration (2nd order backward euler), defaults to 1st order backward euler
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
l_max_its = 20 # Max number of linear iterations
l_tol = 1e-4 # Relative tolerance for linear solves
start_time = 0.0
end_time = 4000
[TimeStepper]
type = IterationAdaptiveDT
dt = 1 # Initial time step. In this simulation it changes.
optimal_iterations = 6 # Time step will adapt to maintain this number of nonlinear iterations
[]
[Adaptivity]
# Block that turns on mesh adaptivity. Note that mesh will never coarsen beyond initial mesh (before uniform refinement)
refine_fraction = 0.8 # Fraction of high error that will be refined
coarsen_fraction = 0.05 # Fraction of low error that will coarsened
max_h_level = 2 # Max number of refinements used, starting from initial mesh (before uniform refinement)
[]
[]
[Outputs]
exodus = true
csv = true
[]
(modules/phase_field/include/postprocessors/GrainDataTracker.h)
// This file is part of the MOOSE framework
// https://www.mooseframework.org
//
// All rights reserved, see COPYRIGHT for full restrictions
// https://github.com/idaholab/moose/blob/master/COPYRIGHT
//
// Licensed under LGPL 2.1, please see LICENSE for details
// https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "GrainTracker.h"
/**
* GrainTracker derived class template to base objects on which maintain physical
* parameters for individual grains.
*/
template <typename T>
class GrainDataTracker : public GrainTracker
{
public:
GrainDataTracker(const InputParameters & parameters);
/// return data for selected grain
const T & getData(unsigned int grain_id) const;
protected:
/// implement this method to initialize the data for the new grain
virtual T newGrain(unsigned int new_grain_id) = 0;
virtual void newGrainCreated(unsigned int new_grain_id);
/// per grain data
std::vector<T> & _grain_data;
};
template <typename T>
GrainDataTracker<T>::GrainDataTracker(const InputParameters & parameters)
: GrainTracker(parameters), _grain_data(declareRestartableData<std::vector<T>>("grain_data"))
{
}
template <typename T>
const T &
GrainDataTracker<T>::getData(unsigned int grain_id) const
{
mooseAssert(grain_id < _grain_data.size(), "Requested data for invalid grain index.");
return _grain_data[grain_id];
}
template <typename T>
void
GrainDataTracker<T>::newGrainCreated(unsigned int new_grain_id)
{
if (_grain_data.size() <= new_grain_id)
_grain_data.resize(new_grain_id + 1);
_grain_data[new_grain_id] = newGrain(new_grain_id);
}