- depends_onThe Controls that this control relies upon (i.e. must execute before this one)
C++ Type:std::vector
Description:The Controls that this control relies upon (i.e. must execute before this one)
- disable_objectsA list of object tags to disable.
C++ Type:std::vector
Description:A list of object tags to disable.
- enable_objectsA list of object tags to enable.
C++ Type:std::vector
Description:A list of object tags to enable.
- end_timeThe time at which the objects are to be enable/disabled.
C++ Type:std::vector
Description:The time at which the objects are to be enable/disabled.
- execute_onINITIAL TIMESTEP_ENDThe list of flag(s) indicating when this object should be executed, the available options include NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, FINAL, CUSTOM.
Default:INITIAL TIMESTEP_END
C++ Type:ExecFlagEnum
Description:The list of flag(s) indicating when this object should be executed, the available options include NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, FINAL, CUSTOM.
- reverse_on_falseTrueWhen true, the disable/enable lists are set to opposite values when the specified condition is false.
Default:True
C++ Type:bool
Description:When true, the disable/enable lists are set to opposite values when the specified condition is false.
- set_sync_timesFalseSet the start and end time as execute sync times.
Default:False
C++ Type:bool
Description:Set the start and end time as execute sync times.
- start_timeThe time at which the objects are to be enabled/disabled.
C++ Type:std::vector
Description:The time at which the objects are to be enabled/disabled.
TimePeriod
The TimePeriod
class derives from ConditionalEnableControl.
TimePeriod
objects are designed to control the active state of a MOOSE object, based on whether the time value is in some range.
For example, consider a simulation that contains two Kernels "diff0" and "diff1". Initially, "diff0" is active and after time 0.49 "diff1" becomes active and "diff0" is disabled. The following code snippet demonstrates how this switching of kernels is achieved with the TimePeriod
object.
[Controls]
[./diff]
type = TimePeriod
enable_objects = 'Kernel::diff0'
disable_objects = '*::diff1'
start_time = '0'
end_time = '0.49'
[../]
[]
(test/tests/controls/time_periods/kernels/kernels.i)/opt/civet/build_0/moose/test/tests/controls/time_periods/kernels/kernels.i
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff0]
type = CoefDiffusion
variable = u
coef = 0.05
[../]
[./diff1]
type = CoefDiffusion
variable = u
coef = 0.5
[../]
[./time]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
[Controls]
[./diff]
type = TimePeriod
enable_objects = 'Kernel::diff0'
disable_objects = '*::diff1'
start_time = '0'
end_time = '0.49'
[../]
[]
Input Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector
Options:
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Options:
Description:Set the enabled status of the MooseObject.
- implicitTrueDetermines whether this object is calculated using an implicit or explicit form
Default:True
C++ Type:bool
Options:
Description:Determines whether this object is calculated using an implicit or explicit form
Advanced Parameters
Input Files
- test/tests/controls/time_periods/error/steady_error.i
- test/tests/controls/time_periods/multiapps/master.i
- test/tests/controls/time_periods/bcs/bcs.i
- test/tests/controls/time_periods/dgkernels/dgkernels.i
- test/tests/controls/time_periods/dampers/control.i
- test/tests/controls/time_periods/constraints/constraints.i
- test/tests/controls/time_periods/transfers/master.i
- modules/tensor_mechanics/test/tests/smeared_cracking/cracking_rotation.i
- test/tests/executioners/time_period/time_period_test.i
- test/tests/controls/time_periods/error/control.i
- test/tests/controls/time_periods/user_objects/user_object.i
- test/tests/controls/time_periods/scalarkernels/scalarkernels.i
- test/tests/controls/time_periods/nodalkernels/nodal.i
- test/tests/multiapps/initial_intactive/master.i
- modules/tensor_mechanics/test/tests/smeared_cracking/cracking_xyz.i
- tutorials/darcy_thermo_mech/step10_multiapps/problems/step10.i
- modules/solid_mechanics/test/tests/cracking/cracking_xyz.i
- test/tests/controls/time_periods/aux_scalar_kernels/control_different.i
- test/tests/controls/time_periods/bcs/bcs_enable_disable.i
- test/tests/controls/time_periods/aux_kernels/control.i
- modules/tensor_mechanics/test/tests/dynamics/prescribed_displacement/3D_QStatic_1_Ramped_Displacement_with_gravity.i
- test/tests/controls/time_periods/kernels/kernels.i
- test/tests/controls/time_periods/aux_scalar_kernels/control.i
- test/tests/controls/time_periods/bcs/bcs_integrated.i
- test/tests/controls/time_periods/dirackernels/dirac.i
test/tests/controls/time_periods/error/steady_error.i
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
# The TimeDerivative existing in a Steady calculation will trigger an error itself!
# [./time]
# type = TimeDerivative
# variable = u
# [../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Dampers]
[./const_damp]
type = ConstantDamper
damping = 0.9
[../]
[]
[Outputs]
exodus = true
[]
[Controls]
[./damping_control]
type = TimePeriod
disable_objects = 'const_damp'
start_time = 0.25
execute_on = 'initial timestep_begin'
[../]
[]
test/tests/controls/time_periods/multiapps/master.i
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
[./time]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
[MultiApps]
[./sub]
type = TransientMultiApp
app_type = MooseTestApp
positions = '1. 0. 0.'
input_files = sub.i
execute_on = 'initial timestep_end'
output_in_position = true
[../]
[]
[Controls]
[./multiapp]
type = TimePeriod
disable_objects = 'MultiApps::sub'
start_time = '0'
end_time = '0.25'
execute_on = 'initial timestep_begin'
[../]
[]
test/tests/controls/time_periods/bcs/bcs.i
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
[./time]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[./right2]
type = FunctionDirichletBC
variable = u
boundary = right
function = (y*(t-1))+1
[../]
[]
[Executioner]
type = Transient
num_steps = 20
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
[Controls]
[./period0]
type = TimePeriod
disable_objects = 'BCs::right2'
start_time = '0'
end_time = '0.95'
execute_on = 'initial timestep_begin'
[../]
[./period2]
type = TimePeriod
disable_objects = 'BCs::right'
start_time = '1'
execute_on = 'initial timestep_begin'
[../]
[]
test/tests/controls/time_periods/dgkernels/dgkernels.i
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
[]
[Adaptivity]
marker = uniform_marker
[./Markers]
[./uniform_marker]
type = UniformMarker
mark = REFINE
[../]
[../]
[]
[Variables]
[./u]
order = FIRST
family = MONOMIAL
initial_condition = 1
[../]
[]
[Functions]
[./forcing_fn]
type = ParsedFunction
value = 2*pow(e,-x-(y*y))*(1-2*y*y)
[../]
[./exact_fn]
type = ParsedGradFunction
value = pow(e,-x-(y*y))
grad_x = -pow(e,-x-(y*y))
grad_y = -2*y*pow(e,-x-(y*y))
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./abs] # u * v
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[DGKernels]
[./dg_diff]
type = DGDiffusion
variable = u
epsilon = -1
sigma = 6
[../]
[./dg_diff2]
type = DGDiffusion
variable = u
epsilon = -1
sigma = 4
[../]
[]
[BCs]
[./all]
type = DGFunctionDiffusionDirichletBC
variable = u
boundary = '0 1 2 3'
function = exact_fn
epsilon = -1
sigma = 6
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
# petsc_options_iname = '-pc_type -pc_hypre_type'
# petsc_options_value = 'hypre boomeramg'
num_steps = 4
dt = 1
nl_rel_tol = 1e-10
[]
[Outputs]
exodus = true
[]
[Controls]
[./dg_problem]
type = TimePeriod
enable_objects = 'DGKernels/dg_diff2'
disable_objects = 'DGKernel::dg_diff'
start_time = '2'
execute_on = 'initial timestep_begin'
[../]
[]
test/tests/controls/time_periods/dampers/control.i
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
[./time]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 5
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
nl_rel_tol = 0.95e-8
[]
[Postprocessors]
[./nlin]
type = NumNonlinearIterations
[../]
[]
[Dampers]
[./const_damp]
type = ConstantDamper
damping = 0.9
[../]
[]
[Outputs]
csv = true
[]
[Controls]
[./damping_control]
type = TimePeriod
disable_objects = '*::const_damp'
start_time = 0.25
execute_on = 'initial timestep_begin'
[../]
[]
test/tests/controls/time_periods/constraints/constraints.i
[Mesh]
type = FileMesh
file = constraints.e
# NearestNodeLocator, which is needed by TiedValueConstraint,
# only works with ReplicatedMesh currently
parallel_type = replicated
[../]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
[./time]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = 4
value = 1
[../]
[]
[Constraints]
[./complete]
type = TiedValueConstraint
variable = u
slave = 2
master = 3
master_variable = u
[../]
[./lower]
type = TiedValueConstraint
variable = u
slave = inside_right_lower
master = inside_left_lower
master_variable = u
[../]
[]
[Executioner]
type = Transient
num_steps = 40
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
[Controls]
[./constraints]
type = TimePeriod
disable_objects = 'Constraints/lower Constraint::complete'
start_time = '0.0 2.0'
end_time = '2.0 4.0'
execute_on = 'initial timestep_begin'
[../]
[]
test/tests/controls/time_periods/transfers/master.i
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.01
[../]
[./td]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Postprocessors]
[./average]
type = ElementAverageValue
variable = u
[../]
[]
[Executioner]
type = Transient
num_steps = 5
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
[]
[MultiApps]
[./pp_sub]
app_type = MooseTestApp
positions = '0.5 0.5 0 0.7 0.7 0'
execute_on = timestep_end
type = TransientMultiApp
input_files = sub.i
[../]
[]
[Transfers]
[./pp_transfer]
type = MultiAppPostprocessorToAuxScalarTransfer
direction = to_multiapp
multi_app = pp_sub
from_postprocessor = average
to_aux_scalar = from_master_app
[../]
[]
[Controls]
[./transfers]
type = TimePeriod
enable_objects = Transfer::pp_transfer
start_time = 2
execute_on = 'initial timestep_begin'
[../]
[]
modules/tensor_mechanics/test/tests/smeared_cracking/cracking_rotation.i
# This test is to ensure that the smeared cracking model correctly handles finite
# rotation of cracked elements.
# This consists of a single element that is first subjected to tensile loading
# in the y-direction via a prescribed displacement. This loading is sufficiently
# high to crack the material in that direction, but not completely unload. The
# prescribed displacement is then reversed so that the element is returned to its
# original configuration.
# In the next phase of the analysis, this element is then rotated 90 degrees by
# prescribing the displacement of the bottom of the element. The prescribed
# displacement BC used to crack the element in the first phase is deactivated.
# Once the element is fully rotated, a new BC is activated on what was originally
# the top surface (but is now the surface on the right hand side) to pull in
# the x-direction.
# If everything is working correctly, the model should re-load on the original
# crack (which should be rotated along with the elemnent) up to the peak stress
# in the first phase of the analysis, and then continue the unloading process
# as the crack strains continue to increase. Throughout this analysis, there should
# only be a single crack, as manifested in the crack_flags variables.
[Mesh]
file = cracking_test.e
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Modules/TensorMechanics/Master]
[./all]
strain = FINITE
add_variables = true
generate_output = 'stress_xx stress_yy stress_zz stress_xy stress_yz stress_zx'
[../]
[]
[AuxVariables]
[./crack_flags1]
order = CONSTANT
family = MONOMIAL
[../]
[./crack_flags2]
order = CONSTANT
family = MONOMIAL
[../]
[./crack_flags3]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./crack_flags1]
type = MaterialRealVectorValueAux
property = crack_flags
variable = crack_flags1
component = 0
[../]
[./crack_flags2]
type = MaterialRealVectorValueAux
property = crack_flags
variable = crack_flags2
component = 1
[../]
[./crack_flags3]
type = MaterialRealVectorValueAux
property = crack_flags
variable = crack_flags3
component = 2
[../]
[]
[BCs]
[./x_pin]
type = DirichletBC
variable = disp_x
boundary = '15 16'
value = 0.0
[../]
[./y_pin]
type = DirichletBC
variable = disp_y
boundary = '15 16'
value = 0.0
[../]
[./z_all]
type = DirichletBC
variable = disp_z
boundary = '11 12 13 14 15 16 17 18'
value = 0.0
[../]
[./x_lb]
type = FunctionDirichletBC
variable = disp_x
boundary = '11 12'
function = 'if(t<10,0,if(t>=100,1,1-cos((t-10)*pi/180)))'
[../]
[./y_lb]
type = FunctionDirichletBC
variable = disp_y
boundary = '11 12'
function = 'if(t<10,0,if(t>=100,1,sin((t-10)*pi/180)))'
[../]
[./x_lt]
type = FunctionDirichletBC
variable = disp_x
boundary = '13 14'
function = '2+(t-100)*0.01'
[../]
[./x_rt]
type = FunctionDirichletBC
variable = disp_x
boundary = '17 18'
function = '1+(t-100)*0.01'
[../]
[./top_pull]
type = FunctionDirichletBC
variable = disp_y
boundary = '13 14 17 18'
function = 'if(t<5,t*0.01,0.05-(t-5)*0.01)'
[../]
[]
[Materials]
[./elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 100.e9
poissons_ratio = 0.
[../]
[./cracking_stress]
type = ComputeSmearedCrackingStress
shear_retention_factor = 0.1
cracking_stress = 3.e9
softening_models = exponential_softening
[../]
[./exponential_softening]
type = ExponentialSoftening
[../]
[]
[Executioner]
type = Transient
petsc_options_iname = '-ksp_gmres_restart -pc_type'
petsc_options_value = '101 lu'
line_search = 'none'
l_max_its = 100
l_tol = 1e-5
nl_max_its = 100
nl_abs_tol = 1e-5
nl_rel_tol = 1e-12
start_time = 0
end_time = 110
dt = 1
[]
[Controls]
[./p1]
type = TimePeriod
start_time = 0.0
end_time = 10.0
disable_objects = 'BCs/x_lt BCs/x_rt'
enable_objects = 'BCs/top_pull'
reverse_on_false = false
execute_on = 'initial timestep_begin'
[../]
[./p2]
type = TimePeriod
start_time = 10.0
end_time = 101.0
disable_objects = 'BCs/x_lt BCs/x_rt BCs/top_pull'
reverse_on_false = false
execute_on = 'initial timestep_begin'
[../]
[./p3]
type = TimePeriod
start_time = 101.0
end_time = 110.0
enable_objects = 'BCs/x_lt BCs/x_rt'
disable_objects = 'BCs/top_pull'
reverse_on_false = false
execute_on = 'initial timestep_begin'
[../]
[]
[Outputs]
exodus = true
[]
test/tests/executioners/time_period/time_period_test.i
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 10
ny = 10
elem_type = QUAD4
[]
[Functions]
[./exact_p1]
type = ParsedFunction
value = t*((x*x)+(y*y))
[../]
[./ffn_p1]
type = ParsedFunction
value = (x*x+y*y)-4*t
[../]
[./exact_p2]
type = ParsedFunction
value = t*((x*x*x)+(y*y*y))
[../]
[./ffn_p2]
type = ParsedFunction
value = (x*x*x+y*y*y)-6*t*(x+y)
[../]
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./td]
type = TimeDerivative
variable = u
[../]
[./diff]
type = Diffusion
variable = u
[../]
[./ffn1]
type = BodyForce
variable = u
function = ffn_p1
[../]
[./ffn2]
type = BodyForce
variable = u
function = ffn_p2
[../]
[]
[BCs]
[./all1]
type = FunctionDirichletBC
variable = u
boundary = '0 1 2 3'
function = exact_p1
[../]
[./all2]
type = FunctionDirichletBC
variable = u
boundary = '0 1 2 3'
function = exact_p2
[../]
[]
[Executioner]
type = Transient
start_time = 0
dt = 0.1
num_steps = 10
[]
[Controls]
[./first_period]
type = TimePeriod
start_time = 0.0
end_time = 0.45
enable_objects = '*/ffn1 */all1'
disable_objects = '*/ffn2 */all2'
execute_on = 'initial timestep_begin'
set_sync_times = true
[../]
[]
[Outputs]
exodus = true
[]
test/tests/controls/time_periods/error/control.i
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
[./time]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Dampers]
[./const_damp]
type = ConstantDamper
damping = 0.9
[../]
[]
[Outputs]
[]
[Controls]
[./damping_control]
type = TimePeriod
disable_objects = 'const_damp'
# Note: These numbers are quoted to get around an issue when
# overriding numeric types with vectors of numeric types
# on the CLI. They are still interpreted as numbers.
start_time = '0.25'
end_time = '0.55'
execute_on = 'initial timestep_begin'
[../]
[]
test/tests/controls/time_periods/user_objects/user_object.i
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
initial_condition = 0.01
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./time]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Postprocessors]
[./nodal]
type = AverageNodalVariableValue
variable = u
execute_on = 'TIMESTEP_END'
[../]
[./elemental]
type = ElementAverageValue
variable = u
execute_on = 'TIMESTEP_END'
[../]
[./general]
type = PointValue
point = '0.5 0.5 0'
variable = u
execute_on = 'TIMESTEP_END'
[../]
[./internal_side]
type = NumInternalSides
[../]
[./side]
type = SideAverageValue
boundary = right
variable = u
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
csv = true
[]
[Controls]
[./pp_control]
type = TimePeriod
enable_objects = '*/nodal */elemental */general */internal_side */side'
start_time = 0.5
end_time = 1
execute_on = 'INITIAL TIMESTEP_END'
[../]
[]
test/tests/controls/time_periods/scalarkernels/scalarkernels.i
# This tests controllability of the enable parameter of scalar kernels.
#
# There are 2 scalar variables, {u, v}, with the ODEs:
# du/dt = 1 u(0) = 0
# v = u v(0) = -10
# A control switches the ODE 'v = u' to the following ODE when t >= 2:
# dv/dt = 2
#
# 5 time steps (of size dt = 1) will be taken, and the predicted values are as follows:
# t u v
# ------------------
# 0 0 -10
# 1 1 1
# 2 2 2
# 3 3 4
# 4 4 6
# 5 5 8
u_initial = 0
u_growth = 1
v_initial = -10
v_growth = 2
t_transition = 2
[Mesh]
type = GeneratedMesh
dim = 1
nx = 10
[]
[Variables]
[./u]
family = SCALAR
order = FIRST
[../]
[./v]
family = SCALAR
order = FIRST
[../]
[]
[ICs]
[./u_ic]
type = ScalarConstantIC
variable = u
value = ${u_initial}
[../]
[./v_ic]
type = ScalarConstantIC
variable = v
value = ${v_initial}
[../]
[]
[ScalarKernels]
[./u_time]
type = ODETimeDerivative
variable = u
[../]
[./u_src]
type = ParsedODEKernel
variable = u
function = '-${u_growth}'
[../]
[./v_time]
type = ODETimeDerivative
variable = v
enable = false
[../]
[./v_src]
type = ParsedODEKernel
variable = v
function = '-${v_growth}'
enable = false
[../]
[./v_constraint]
type = ParsedODEKernel
variable = v
args = 'u'
function = 'v - u'
[../]
[]
[Controls]
[./time_period_control]
type = TimePeriod
end_time = ${t_transition}
enable_objects = 'ScalarKernel::v_constraint'
disable_objects = 'ScalarKernel::v_time ScalarKernel::v_src'
execute_on = 'INITIAL TIMESTEP_END'
[../]
[]
[Executioner]
type = Transient
scheme = implicit-euler
dt = 1
num_steps = 5
abort_on_solve_fail = true
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
[]
[Outputs]
csv = true
[]
test/tests/controls/time_periods/nodalkernels/nodal.i
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[./nodal_ode]
[../]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
[./time]
type = TimeDerivative
variable = u
[../]
[]
[NodalKernels]
[./td]
type = TimeDerivativeNodalKernel
variable = nodal_ode
[../]
[./constant_rate]
type = ConstantRate
variable = nodal_ode
rate = 1.0
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.1
[]
[Controls]
[./time_period]
type = TimePeriod
enable_objects = '*::constant_rate'
start_time = 0.5
end_time = 1
[../]
[]
[Outputs]
exodus = true
[]
test/tests/multiapps/initial_intactive/master.i
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./td]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.2
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
[MultiApps]
[./sub]
positions = '0 0 0'
type = TransientMultiApp
input_files = 'sub.i'
app_type = MooseTestApp
enable = false # Start with a multiapp that's disabled up front
sub_cycling = true
[../]
[]
[Controls]
[./multiapp_enable]
type = TimePeriod
disable_objects = 'MultiApps::sub'
start_time = 0
end_time = 1.3
execute_on = 'timestep_begin'
reverse_on_false = true
[../]
[]
modules/tensor_mechanics/test/tests/smeared_cracking/cracking_xyz.i
#
[Mesh]
file = cracking_test.e
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Functions]
[./displx]
type = PiecewiseLinear
x = '0 1'
y = '0 0.00175'
[../]
[./velocity_y]
type = ParsedFunction
value = 'if(t < 2, 0.00175, 0)'
[../]
[./velocity_z]
type = ParsedFunction
value = 0.00175
[../]
[]
[Modules/TensorMechanics/Master]
[./all]
strain = FINITE
add_variables = true
generate_output = 'stress_xx stress_yy stress_zz stress_xy stress_yz stress_zx'
[../]
[]
[BCs]
[./fix_x]
type = DirichletBC
variable = disp_x
boundary = 1
value = 0.0
[../]
[./move_x]
type = FunctionDirichletBC
variable = disp_x
boundary = 4
function = displx
[../]
[./fix_y]
type = DirichletBC
variable = disp_y
boundary = 2
value = 0.0
[../]
[./move_y]
type = PresetVelocity
variable = disp_y
boundary = 5
function = velocity_y
# time_periods = 'p2 p3'
[../]
[./fix_z]
type = DirichletBC
variable = disp_z
boundary = 3
value = 0.0
[../]
[./move_z]
type = PresetVelocity
variable = disp_z
boundary = 6
function = velocity_z
# time_periods = 'p3'
[../]
[]
[Materials]
[./elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 186.5e9
poissons_ratio = .316
[../]
[./elastic_stress]
type = ComputeSmearedCrackingStress
cracking_stress = 119.3e6
softening_models = exponential_softening
[../]
[./exponential_softening]
type = ExponentialSoftening
[../]
[]
[Executioner]
type = Transient
petsc_options_iname = '-ksp_gmres_restart -pc_type'
petsc_options_value = '101 lu'
line_search = 'none'
l_max_its = 100
l_tol = 1e-5
nl_max_its = 100
nl_abs_tol = 1e-4
#nl_rel_tol = 1e-4
nl_rel_tol = 1e-6
start_time = 0.0
end_time = 3.0
dt = 0.01
[]
[Controls]
[./p1]
type = TimePeriod
start_time = 0.0
end_time = 1.0
disable_objects = 'BCs/move_y BCs/move_z'
reverse_on_false = false
execute_on = 'initial timestep_begin'
[../]
[./p2]
type = TimePeriod
start_time = 1.0
end_time = 2.0
disable_objects = 'BCs/move_z'
enable_objects = 'BCs/move_y'
reverse_on_false = false
execute_on = 'initial timestep_begin'
[../]
[./p3]
type = TimePeriod
start_time = 2.0
end_time = 3.0
enable_objects = 'BCs/move_y BCs/move_z'
reverse_on_false = false
execute_on = 'initial timestep_begin'
set_sync_times = true
[../]
[]
[Outputs]
exodus = true
[]
tutorials/darcy_thermo_mech/step10_multiapps/problems/step10.i
[GlobalParams]
displacements = 'disp_r disp_z'
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 100
ymax = 0.304 # Length of test chamber
xmax = 0.0257 # Test chamber radius
[]
[Variables]
[pressure]
[]
[temperature]
initial_condition = 300 # Start at room temperature
[]
[]
[AuxVariables]
[k_eff]
initial_condition = 15.0 # water at 20C
[]
[velocity]
order = CONSTANT
family = MONOMIAL_VEC
[]
[]
[Modules/TensorMechanics/Master]
[all]
# This block adds all of the proper Kernels, strain calculators, and Variables
# for TensorMechanics in the correct coordinate system (autodetected)
add_variables = true
strain = FINITE
eigenstrain_names = eigenstrain
use_automatic_differentiation = true
generate_output = 'vonmises_stress elastic_strain_xx elastic_strain_yy strain_xx strain_yy'
[]
[]
[Kernels]
[darcy_pressure]
type = DarcyPressure
variable = pressure
[]
[heat_conduction]
type = ADHeatConduction
variable = temperature
[]
[heat_conduction_time_derivative]
type = ADHeatConductionTimeDerivative
variable = temperature
[]
[heat_convection]
type = DarcyAdvection
variable = temperature
pressure = pressure
[]
[]
[AuxKernels]
[velocity]
type = DarcyVelocity
variable = velocity
execute_on = timestep_end
pressure = pressure
[]
[]
[BCs]
[inlet]
type = DirichletBC
variable = pressure
boundary = bottom
value = 4000 # (Pa) From Figure 2 from paper. First data point for 1mm spheres.
[]
[outlet]
type = DirichletBC
variable = pressure
boundary = top
value = 0 # (Pa) Gives the correct pressure drop from Figure 2 for 1mm spheres
[]
[inlet_temperature]
type = FunctionDirichletBC
variable = temperature
boundary = bottom
function = 'if(t<0,350+50*t,350)'
[]
[outlet_temperature]
type = HeatConductionOutflow
variable = temperature
boundary = top
[]
[hold_inlet]
type = DirichletBC
variable = disp_z
boundary = bottom
value = 0
[]
[hold_center]
type = DirichletBC
variable = disp_r
boundary = left
value = 0
[]
[hold_outside]
type = DirichletBC
variable = disp_r
boundary = right
value = 0
[]
[]
[Materials]
viscosity_file = data/water_viscosity.csv
density_file = data/water_density.csv
specific_heat_file = data/water_specific_heat.csv
thermal_expansion_file = data/water_thermal_expansion.csv
[column]
type = PackedColumn
temperature = temperature
radius = 1
thermal_conductivity = k_eff # Use the AuxVariable instead of calculating
fluid_viscosity_file = ${viscosity_file}
fluid_density_file = ${density_file}
fluid_specific_heat_file = ${specific_heat_file}
fluid_thermal_expansion_file = ${thermal_expansion_file}
[]
[elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 200e9 # (Pa) from wikipedia
poissons_ratio = .3 # from wikipedia
[]
[elastic_stress]
type = ADComputeFiniteStrainElasticStress
[]
[thermal_strain]
type = ADComputeThermalExpansionEigenstrain
stress_free_temperature = 300
thermal_expansion_coeff = 1e-6
eigenstrain_name = eigenstrain
temperature = temperature
[]
[]
[Postprocessors]
[average_temperature]
type = ElementAverageValue
variable = temperature
[]
[]
[Executioner]
type = Transient
start_time = -1
end_time = 200
steady_state_tolerance = 1e-7
steady_state_detection = true
dt = 0.25
solve_type = PJFNK
automatic_scaling = true
compute_scaling_once = false
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart'
petsc_options_value = 'hypre boomeramg 500'
line_search = none
[TimeStepper]
type = FunctionDT
function = 'if(t<0,0.1,0.25)'
[]
[]
[MultiApps]
[micro]
type = TransientMultiApp
app_type = DarcyThermoMechApp
positions = '0.01285 0.0 0
0.01285 0.0608 0
0.01285 0.1216 0
0.01285 0.1824 0
0.01285 0.2432 0
0.01285 0.304 0'
input_files = step10_micro.i
execute_on = 'timestep_end'
[]
[]
[Transfers]
[keff_from_sub]
type = MultiAppPostprocessorInterpolationTransfer
direction = from_multiapp
multi_app = micro
variable = k_eff
power = 1
postprocessor = k_eff
execute_on = 'timestep_end'
[]
[temperature_to_sub]
type = MultiAppVariableValueSamplePostprocessorTransfer
direction = to_multiapp
multi_app = micro
source_variable = temperature
postprocessor = temperature_in
execute_on = 'timestep_end'
[]
[]
[Controls]
[multiapp]
type = TimePeriod
disable_objects = 'MultiApps::micro Transfers::keff_from_sub Transfers::temperature_to_sub'
start_time = '0'
execute_on = 'initial'
[]
[]
[Outputs]
[out]
type = Exodus
elemental_as_nodal = true
[]
[]
modules/solid_mechanics/test/tests/cracking/cracking_xyz.i
#
# Test to exercise the exponential stress release
#
# First x, then y, then z directions crack
#
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Mesh]
file = cracking_test.e
displacements = 'disp_x disp_y disp_z'
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[./disp_z]
[../]
[]
[AuxVariables]
[./crack_1]
order = CONSTANT
family = MONOMIAL
[../]
[./crack_2]
order = CONSTANT
family = MONOMIAL
[../]
[./crack_3]
order = CONSTANT
family = MONOMIAL
[../]
[./strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./strain_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./strain_zz]
order = CONSTANT
family = MONOMIAL
[../]
[./stress_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./stress_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./stress_zz]
order = CONSTANT
family = MONOMIAL
[../]
[./stress_xy]
order = CONSTANT
family = MONOMIAL
[../]
[./stress_yz]
order = CONSTANT
family = MONOMIAL
[../]
[./stress_zx]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Functions]
[./displx]
type = PiecewiseLinear
# x = '0 1'
# y = '0 .0035'
x = '0 1'
y = '0 0.00175'
[../]
[./velocity_y]
type = ParsedFunction
value = 'if(t < 2, 0.00175, 0)'
[../]
[./velocity_z]
type = ParsedFunction
value = 0.00175
[../]
[]
[SolidMechanics]
[./solid]
disp_x = disp_x
disp_y = disp_y
disp_z = disp_z
[../]
[]
[AuxKernels]
[./crack_1]
type = MaterialRealVectorValueAux
variable = crack_1
property = crack_flags
component = 0
[../]
[./crack_2]
type = MaterialRealVectorValueAux
variable = crack_2
property = crack_flags
component = 1
[../]
[./crack_3]
type = MaterialRealVectorValueAux
variable = crack_3
property = crack_flags
component = 2
[../]
[./strain_xx]
type = MaterialTensorAux
variable = strain_xx
tensor = total_strain
index = 0
[../]
[./strain_yy]
type = MaterialTensorAux
variable = strain_yy
tensor = total_strain
index = 1
[../]
[./strain_zz]
type = MaterialTensorAux
variable = strain_zz
tensor = total_strain
index = 2
[../]
[./stress_xx]
type = MaterialTensorAux
variable = stress_xx
tensor = stress
index = 0
[../]
[./stress_yy]
type = MaterialTensorAux
variable = stress_yy
tensor = stress
index = 1
[../]
[./stress_zz]
type = MaterialTensorAux
variable = stress_zz
tensor = stress
index = 2
[../]
[./stress_xy]
type = MaterialTensorAux
variable = stress_xy
tensor = stress
index = 3
[../]
[./stress_yz]
type = MaterialTensorAux
variable = stress_yz
tensor = stress
index = 4
[../]
[./stress_zx]
type = MaterialTensorAux
variable = stress_zx
tensor = stress
index = 5
[../]
[]
[BCs]
[./fix_x]
type = DirichletBC
variable = disp_x
boundary = 1
value = 0.0
[../]
[./move_x]
type = FunctionDirichletBC
variable = disp_x
boundary = 4
function = displx
[../]
[./fix_y]
type = DirichletBC
variable = disp_y
boundary = 2
value = 0.0
[../]
[./move_y]
type = PresetVelocity
variable = disp_y
boundary = 5
function = velocity_y
# time_periods = 'p2 p3'
[../]
[./fix_z]
type = DirichletBC
variable = disp_z
boundary = 3
value = 0.0
[../]
[./move_z]
type = PresetVelocity
variable = disp_z
boundary = 6
function = velocity_z
# time_periods = 'p3'
[../]
[]
[Materials]
[./fred]
type = Elastic
block = 1
youngs_modulus = 186.5e9
poissons_ratio = .316
cracking_stress = 119.3e6
cracking_release = exponential
disp_x = disp_x
disp_y = disp_y
disp_z = disp_z
formulation = linear
[../]
[]
#[Preconditioning]
# [./SMP]
# type = SMP
# full = true
# []
#[]
[Executioner]
type = Transient
#Preconditioned JFNK (default)
solve_type = 'PJFNK'
petsc_options_iname = '-ksp_gmres_restart -pc_type'
petsc_options_value = '101 lu'
line_search = 'none'
l_max_its = 100
l_tol = 1e-6
nl_max_its = 100
nl_abs_tol = 4e-8
#nl_rel_tol = 1e-3
nl_rel_tol = 1e-6
start_time = 0.0
end_time = 3.0
# dt = 0.005
dt = 0.01
[]
[Controls]
[./p1]
type = TimePeriod
start_time = 0.0
end_time = 1.0
disable_objects = 'BCs/move_y BCs/move_z'
reverse_on_false = false
execute_on = 'initial timestep_begin'
[../]
[./p2]
type = TimePeriod
start_time = 1.0
end_time = 2.0
disable_objects = 'BCs/move_z'
enable_objects = 'BCs/move_y'
reverse_on_false = false
execute_on = 'initial timestep_begin'
[../]
[./p3]
type = TimePeriod
start_time = 2.0
end_time = 3.0
enable_objects = 'BCs/move_y BCs/move_z'
reverse_on_false = false
execute_on = 'initial timestep_begin'
set_sync_times = true
[../]
[]
[Outputs]
exodus = true
[]
test/tests/controls/time_periods/aux_scalar_kernels/control_different.i
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./aux0]
family = SCALAR
[../]
[./aux1]
family = SCALAR
[../]
[]
[Functions]
[./func]
type = ParsedFunction
value = t
[../]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
[./time]
type = TimeDerivative
variable = u
[../]
[]
[AuxScalarKernels]
[./scalar_aux0]
type = FunctionScalarAux
variable = aux0
function = func
[../]
[./scalar_aux1]
type = FunctionScalarAux
variable = aux1
function = func
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
csv = true
[]
[Controls]
[./damping_control]
type = TimePeriod
disable_objects = 'AuxScalarKernels/scalar_aux0 */scalar_aux1'
start_time = '0.25 0.45'
end_time = '0.55 0.75'
execute_on = 'initial timestep_begin'
[../]
[]
test/tests/controls/time_periods/bcs/bcs_enable_disable.i
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
[./time]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[./right2]
type = FunctionDirichletBC
variable = u
boundary = right
function = (y*(t-1))+1
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
[Controls]
[./period0]
type = TimePeriod
enable_objects = 'BCs::right'
disable_objects = 'BCs::right2'
start_time = '0'
end_time = '0.5'
execute_on = 'initial timestep_begin'
[../]
[]
test/tests/controls/time_periods/aux_kernels/control.i
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./aux0]
[../]
[./aux1]
[../]
[]
[Functions]
[./func]
type = ParsedFunction
value = t*x*y
[../]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
[./time]
type = TimeDerivative
variable = u
[../]
[]
[AuxKernels]
[./aux0]
type = FunctionAux
variable = aux0
function = func
[../]
[./aux1]
type = FunctionAux
variable = aux1
function = func
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
[Controls]
[./damping_control]
type = TimePeriod
disable_objects = 'AuxKernels::aux0 AuxKernels::aux1'
start_time = '0.25 0.55'
end_time = '0.65 0.75'
execute_on = 'initial timestep_begin'
[../]
[]
modules/tensor_mechanics/test/tests/dynamics/prescribed_displacement/3D_QStatic_1_Ramped_Displacement_with_gravity.i
# One 3D element under ramped displacement loading.
#
# loading in z direction:
# time : 0.0 0.1 0.2 0.3
# disp : 0.0 0.0 -0.01 -0.01
# Gravity is applied in y direction. To equilibrate the system
# under gravity, a static analysis is run in the first time step
# by turning off the inertial terms. (see controls block and
# DynamicTensorMechanics block).
# Result: The displacement at the top node in the z direction should match
# the prescribed displacement. Also, the z acceleration should
# be two triangular pulses, one peaking at 0.1 and another peaking at
# 0.2.
# The y displacement would be offset by the gravity displacement.
# Also the y acceleration and velocity should be zero until the loading in
# the z direction starts (i.e, until 0.1s)
# Note: The time step used in the displacement data file should match
# the simulation time step (dt and dtmin in the Executioner block).
[Mesh]
type = GeneratedMesh
dim = 3 # Dimension of the mesh
nx = 1 # Number of elements in the x direction
ny = 1 # Number of elements in the y direction
nz = 1 # Number of elements in the z direction
xmin = 0.0
xmax = 1
ymin = 0.0
ymax = 1
zmin = 0.0
zmax = 1
allow_renumbering = false # So NodalVariableValue can index by id
[]
[Variables] # variables that are solved
[./disp_x]
[../]
[./disp_y]
[../]
[./disp_z]
[../]
[]
[AuxVariables] # variables that are calculated for output
[./accel_x]
[../]
[./vel_x]
[../]
[./accel_y]
[../]
[./vel_y]
[../]
[./accel_z]
[../]
[./vel_z]
[../]
[./stress_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./stress_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./strain_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./stress_zz]
order = CONSTANT
family = MONOMIAL
[../]
[./strain_zz]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./DynamicTensorMechanics] # zeta*K*vel + K * disp
displacements = 'disp_x disp_y disp_z'
zeta = 0.000025
static_initialization = true #turns off rayliegh damping for the first time step to stabilize system under gravity
[../]
[./inertia_x] # M*accel + eta*M*vel
type = InertialForce
variable = disp_x
velocity = vel_x
acceleration = accel_x
beta = 0.25 # Newmark time integration
gamma = 0.5 # Newmark time integration
eta = 19.63
[../]
[./inertia_y]
type = InertialForce
variable = disp_y
velocity = vel_y
acceleration = accel_y
beta = 0.25
gamma = 0.5
eta = 19.63
[../]
[./inertia_z]
type = InertialForce
variable = disp_z
velocity = vel_z
acceleration = accel_z
beta = 0.25
gamma = 0.5
eta = 19.63
[../]
[./gravity]
type = Gravity
variable = disp_y
value = -9.81
[../]
[]
[AuxKernels]
[./accel_x] # Calculates and stores acceleration at the end of time step
type = NewmarkAccelAux
variable = accel_x
displacement = disp_x
velocity = vel_x
beta = 0.25
execute_on = timestep_end
[../]
[./vel_x] # Calculates and stores velocity at the end of the time step
type = NewmarkVelAux
variable = vel_x
acceleration = accel_x
gamma = 0.5
execute_on = timestep_end
[../]
[./accel_y]
type = NewmarkAccelAux
variable = accel_y
displacement = disp_y
velocity = vel_y
beta = 0.25
execute_on = timestep_end
[../]
[./vel_y]
type = NewmarkVelAux
variable = vel_y
acceleration = accel_y
gamma = 0.5
execute_on = timestep_end
[../]
[./accel_z]
type = NewmarkAccelAux
variable = accel_z
displacement = disp_z
velocity = vel_z
beta = 0.25
execute_on = timestep_end
[../]
[./vel_z]
type = NewmarkVelAux
variable = vel_z
acceleration = accel_z
gamma = 0.5
execute_on = timestep_end
[../]
[./stress_xx]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_xx
index_i = 0
index_j = 0
[../]
[./strain_xx]
type = RankTwoAux
rank_two_tensor = total_strain
variable = strain_xx
index_i = 0
index_j = 0
[../]
[./stress_yy]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_yy
index_i = 1
index_j = 1
[../]
[./strain_yy]
type = RankTwoAux
rank_two_tensor = total_strain
variable = strain_yy
index_i = 1
index_j = 1
[../]
[./stress_zz]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_zz
index_i = 2
index_j = 2
[../]
[./strain_zz]
type = RankTwoAux
rank_two_tensor = total_strain
variable = strain_zz
index_i = 2
index_j = 2
[../]
[]
[Functions]
[./displacement_front]
type = PiecewiseLinear
data_file = 'displacement.csv'
format = columns
[../]
[]
[BCs]
[./prescribed_displacement]
type = PresetDisplacement
variable = disp_z
velocity = vel_z
acceleration = accel_z
beta = 0.25
boundary = front
function = displacement_front
[../]
[./anchor_x]
type = DirichletBC
variable = disp_x
boundary = left
value = 0.0
[../]
[./anchor_y]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[../]
[./anchor_z]
type = DirichletBC
variable = disp_z
boundary = back
value = 0.0
[../]
[]
[Materials]
[./elasticity_tensor]
youngs_modulus = 325e6 #Pa
poissons_ratio = 0.3
type = ComputeIsotropicElasticityTensor
block = 0
[../]
[./strain]
#Computes the strain, assuming small strains
type = ComputeSmallStrain
block = 0
displacements = 'disp_x disp_y disp_z'
[../]
[./stress]
#Computes the stress, using linear elasticity
type = ComputeLinearElasticStress
block = 0
[../]
[./density]
type = GenericConstantMaterial
block = 0
prop_names = density
prop_values = 2000 #kg/m3
[../]
[]
[Controls] # turns off inertial terms for the first time step
[./period0]
type = TimePeriod
disable_objects = '*/vel_x */vel_y */vel_z */accel_x */accel_y */accel_z */inertia_x */inertia_y */inertia_z'
start_time = 0.0
end_time = 0.1 # dt used in the simulation
[../]
[../]
[Executioner]
type = Transient
start_time = 0
end_time = 3.0
l_tol = 1e-6
nl_rel_tol = 1e-6
nl_abs_tol = 1e-6
dt = 0.1
timestep_tolerance = 1e-6
[]
[Postprocessors] # These quantites are printed to a csv file at every time step
[./_dt]
type = TimestepSize
[../]
[./accel_6x]
type = NodalVariableValue
nodeid = 6
variable = accel_x
[../]
[./accel_6y]
type = NodalVariableValue
nodeid = 6
variable = accel_y
[../]
[./accel_6z]
type = NodalVariableValue
nodeid = 6
variable = accel_z
[../]
[./vel_6x]
type = NodalVariableValue
nodeid = 6
variable = vel_x
[../]
[./vel_6y]
type = NodalVariableValue
nodeid = 6
variable = vel_y
[../]
[./vel_6z]
type = NodalVariableValue
nodeid = 6
variable = vel_z
[../]
[./disp_6x]
type = NodalVariableValue
nodeid = 6
variable = disp_x
[../]
[./disp_6y]
type = NodalVariableValue
nodeid = 6
variable = disp_y
[../]
[./disp_6z]
type = NodalVariableValue
nodeid = 6
variable = disp_z
[../]
[]
[Outputs]
exodus = true
csv = true
perf_graph = true
[]
test/tests/controls/time_periods/kernels/kernels.i
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff0]
type = CoefDiffusion
variable = u
coef = 0.05
[../]
[./diff1]
type = CoefDiffusion
variable = u
coef = 0.5
[../]
[./time]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
[Controls]
[./diff]
type = TimePeriod
enable_objects = 'Kernel::diff0'
disable_objects = '*::diff1'
start_time = '0'
end_time = '0.49'
[../]
[]
test/tests/controls/time_periods/aux_scalar_kernels/control.i
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./aux0]
family = SCALAR
[../]
[./aux1]
family = SCALAR
[../]
[]
[Functions]
[./func]
type = ParsedFunction
value = t
[../]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
[./time]
type = TimeDerivative
variable = u
[../]
[]
[AuxScalarKernels]
[./scalar_aux0]
type = FunctionScalarAux
variable = aux0
function = func
[../]
[./scalar_aux1]
type = FunctionScalarAux
variable = aux1
function = func
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
csv = true
[]
[Controls]
[./damping_control]
type = TimePeriod
disable_objects = '*/scalar_aux0 */scalar_aux1'
start_time = 0.25
end_time = 0.75
execute_on = 'initial timestep_begin'
[../]
[]
test/tests/controls/time_periods/bcs/bcs_integrated.i
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
[./time]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = NeumannBC
variable = u
boundary = right
value = 1
[../]
[./right2]
type = FunctionNeumannBC
variable = u
boundary = right
function = (y*(t-1))+1
[../]
[]
[Executioner]
type = Transient
num_steps = 20
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
[Controls]
[./period0]
type = TimePeriod
disable_objects = 'BCs::right2'
start_time = '0'
end_time = '0.95'
execute_on = 'initial timestep_begin'
[../]
[./period2]
type = TimePeriod
disable_objects = 'BCs::right'
start_time = '1'
execute_on = 'initial timestep_begin'
[../]
[]
test/tests/controls/time_periods/dirackernels/dirac.i
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
uniform_refine = 2
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.5
[../]
[./time]
type = TimeDerivative
variable = u
[../]
[]
[DiracKernels]
[./point_source]
type = ConstantPointSource
variable = u
value = 1
point = '0.25 0.25'
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
[Controls]
[./point_source]
type = TimePeriod
disable_objects = 'DiracKernel::point_source'
start_time = '0.15'
end_time = '0.35'
execute_on = 'initial timestep_begin'
[../]
[]