- boundaryThe list of boundary IDs from the mesh where this object applies
C++ Type:std::vector<BoundaryName>
Controllable:No
Description:The list of boundary IDs from the mesh where this object applies
- variableThe name of the variable that this residual object operates on
C++ Type:NonlinearVariableName
Controllable:No
Description:The name of the variable that this residual object operates on
NeumannBC
Imposes the integrated boundary condition , where is a constant, controllable value.
Description
NeumannBC
is the simplest type of IntegratedBC
, and is used for imposing flux boundary conditions on systems of partial differential equations (PDEs). This class is appropriate to use for PDEs of the form where is the domain, and is its boundary. In this case, a NeumannBC
object is used to impose the condition (3) on the subset of the boundary denoted by . The value
parameter corresponds to the constant , and the user must define one or more sidesets corresponding to the boundary subset . The normal derivative notation is , where is the outward unit normal to .
Example Input Syntax
[./right]
type = NeumannBC
variable = u
boundary = right
value = 2
[../]
(test/tests/bcs/1d_neumann/1d_neumann.i)Input Parameters
- displacementsThe displacements
C++ Type:std::vector<VariableName>
Controllable:No
Description:The displacements
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Default:False
C++ Type:bool
Controllable:No
Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
- value0For a Laplacian problem, the value of the gradient dotted with the normals on the boundary.
Default:0
C++ Type:double
Controllable:Yes
Description:For a Laplacian problem, the value of the gradient dotted with the normals on the boundary.
Optional Parameters
- absolute_value_vector_tagsThe tags for the vectors this residual object should fill with the absolute value of the residual contribution
C++ Type:std::vector<TagName>
Controllable:No
Description:The tags for the vectors this residual object should fill with the absolute value of the residual contribution
- extra_matrix_tagsThe extra tags for the matrices this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the matrices this Kernel should fill
- extra_vector_tagsThe extra tags for the vectors this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the vectors this Kernel should fill
- matrix_tagssystemThe tag for the matrices this Kernel should fill
Default:system
C++ Type:MultiMooseEnum
Options:nontime, system
Controllable:No
Description:The tag for the matrices this Kernel should fill
- vector_tagsnontimeThe tag for the vectors this Kernel should fill
Default:nontime
C++ Type:MultiMooseEnum
Options:nontime, time
Controllable:No
Description:The tag for the vectors this Kernel should fill
Tagging Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- diag_save_inThe name of auxiliary variables to save this BC's diagonal jacobian contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
C++ Type:std::vector<AuxVariableName>
Controllable:No
Description:The name of auxiliary variables to save this BC's diagonal jacobian contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- implicitTrueDetermines whether this object is calculated using an implicit or explicit form
Default:True
C++ Type:bool
Controllable:No
Description:Determines whether this object is calculated using an implicit or explicit form
- save_inThe name of auxiliary variables to save this BC's residual contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
C++ Type:std::vector<AuxVariableName>
Controllable:No
Description:The name of auxiliary variables to save this BC's residual contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
- seed0The seed for the master random number generator
Default:0
C++ Type:unsigned int
Controllable:No
Description:The seed for the master random number generator
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Advanced Parameters
Input Files
- (modules/thermal_hydraulics/test/tests/components/hs_boundary_external_app_convection/plate.parent.i)
- (test/tests/bcs/resid_jac_together/diffusion_reaction.i)
- (test/tests/multiapps/relaxation/sub_relaxed_parent.i)
- (test/tests/postprocessors/nodal_extreme_value/block_nodal_pps_test.i)
- (examples/ex08_materials/ex08.i)
- (modules/xfem/test/tests/nucleation_uo/nucleate_edge_crack_2d.i)
- (python/pyhit/tests/input_modified.i)
- (modules/combined/test/tests/optimization/invOpt_nonlinear/adjoint.i)
- (modules/solid_mechanics/test/tests/lagrangian/cartesian/updated/stabilization/cook_large.i)
- (modules/xfem/test/tests/moving_interface/phase_transition_3d.i)
- (modules/stochastic_tools/examples/sobol/diffusion.i)
- (test/tests/functions/default_function/default_function.i)
- (test/tests/time_steppers/iteration_adaptive/adapt_tstep_shrink_init_dt.i)
- (modules/solid_mechanics/test/tests/lagrangian/cartesian/updated/stabilization/cook_small.i)
- (modules/heat_transfer/test/tests/code_verification/spherical_test_no4.i)
- (modules/heat_transfer/test/tests/code_verification/cylindrical_test_no4.i)
- (test/tests/bcs/ad_nodal_bc_nonlocal_dependence/test.i)
- (modules/optimization/test/tests/optimizationreporter/constant_heat_source/forward.i)
- (test/tests/misc/displaced_mesh_coupling/nonad.i)
- (test/tests/restart/restart_transient_from_transient/restart_trans_with_2subs_sub.i)
- (test/tests/interfacekernels/1d_interface/mixed_shapes.i)
- (test/tests/restart/restart_transient_from_transient/pseudo_trans_with_2subs_sub.i)
- (tutorials/tutorial03_verification/app/test/tests/step03_analytical/1d_analytical.i)
- (test/tests/executioners/fixed_point/2d_diffusion_fixed_point.i)
- (test/tests/mesh/side_list_from_node_list/side_list_from_node_list.i)
- (modules/xfem/test/tests/moving_interface/ad_phase_transition_2d.i)
- (modules/optimization/test/tests/executioners/steady_and_adjoint/nonhomogeneous_bc.i)
- (modules/solid_mechanics/examples/wave_propagation/cantilever_sweep.i)
- (test/tests/materials/material/coupled_material_test.i)
- (test/tests/tag/tag_neumann.i)
- (modules/combined/test/tests/poro_mechanics/terzaghi.i)
- (modules/stochastic_tools/test/tests/controls/libtorch_drl_control/libtorch_drl_control.i)
- (modules/solid_mechanics/test/tests/lagrangian/centrosymmetric_spherical/total/analytical/small.i)
- (modules/optimization/test/tests/optimizationreporter/constant_heat_source/adjoint.i)
- (modules/solid_mechanics/test/tests/visco/gen_kv_creep.i)
- (test/tests/time_steppers/iteration_adaptive/adapt_tstep_shrink_init_dt_restart.i)
- (test/tests/time_steppers/iteration_adaptive/piecewise_linear.i)
- (test/tests/time_steppers/iteration_adaptive/multi_piecewise_linear.i)
- (test/tests/userobjects/side_uo_with_lowerd_use/side-uo-with-lower-d-use.i)
- (python/pyhit/tests/input.i)
- (test/tests/executioners/fixed_point/2d_diffusion_fixed_point_toggle.i)
- (modules/optimization/test/tests/outputs/exodus_optimization_steady/adjoint_iteration_output.i)
- (test/tests/bcs/ad_1d_neumann/from_cubit.i)
- (modules/solid_mechanics/test/tests/lagrangian/cartesian/total/stabilization/cook_large.i)
- (test/tests/bcs/1d_neumann/from_cubit.i)
- (test/tests/materials/material/mat_cyclic_coupling.i)
- (modules/optimization/test/tests/optimizationreporter/material/adjoint_explicit.i)
- (test/tests/kernels/vector_fe/coupled_vector_gradient.i)
- (modules/stochastic_tools/examples/parameter_study/diffusion.i)
- (modules/combined/test/tests/optimization/invOpt_mechanics/adjoint.i)
- (tutorials/darcy_thermo_mech/step10_multiapps/tests/auxkernels/corrosion/corrosion.i)
- (test/tests/time_steppers/iteration_adaptive/adapt_tstep_grow_init_dt.i)
- (test/tests/bcs/misc_bcs/vacuum_bc_test.i)
- (modules/combined/test/tests/thermal_conductivity_temperature_function_test/thermal_conductivity_temperature_function_test.i)
- (modules/optimization/test/tests/optimizationreporter/material/adjoint.i)
- (test/tests/time_steppers/iteration_adaptive/adapt_tstep_grow_init_dt_restart.i)
- (test/tests/bcs/sideset_from_nodeset/sideset_from_nodeset_test2.i)
- (modules/combined/examples/effective_properties/effective_th_cond.i)
- (modules/solid_mechanics/test/tests/visco/visco_small_strain.i)
- (modules/combined/test/tests/optimization/invOpt_bc_convective/forward.i)
- (test/tests/kernels/2d_diffusion/matdiffusion.i)
- (test/tests/auxkernels/time_derivative_second_aux/test.i)
- (test/tests/executioners/nl_pingpong/nonlinear_residual_pingpong.i)
- (test/tests/restart/restart_transient_from_steady/steady_with_2subs_sub.i)
- (test/tests/userobjects/element_subdomain_modifier/complement_boundary.i)
- (test/tests/postprocessors/find_value_on_line/findvalueonline.i)
- (modules/optimization/test/tests/outputs/exodus_optimization_steady/forward.i)
- (test/tests/kernels/block_kernel/block_vars.i)
- (modules/stochastic_tools/examples/parameter_study/diffusion_vector.i)
- (modules/stochastic_tools/examples/surrogates/combined/trans_diff_2d/trans_diff_sub.i)
- (test/tests/time_integrators/abort/abort.i)
- (test/tests/time_steppers/iteration_adaptive/adapt_tstep_reject_large_dt.i)
- (test/tests/restart/restart_transient_from_steady/restart_trans_with_2subs_sub.i)
- (tutorials/tutorial03_verification/app/test/tests/step04_mms/2d_main.i)
- (modules/solid_mechanics/test/tests/visco/burgers_creep.i)
- (test/tests/time_steppers/iteration_adaptive/adapt_tstep_multi_pps_lim.i)
- (modules/combined/test/tests/optimization/invOpt_nonlinear/forward.i)
- (modules/solid_mechanics/test/tests/visco/visco_finite_strain.i)
- (test/tests/time_steppers/iteration_adaptive/adapt_tstep_pps_lim.i)
- (modules/combined/examples/optimization/thermomechanical/thermal_sub.i)
- (modules/solid_mechanics/test/tests/lagrangian/axisymmetric_cylindrical/total/analytical/small.i)
- (test/tests/dirackernels/function_dirac_source/function_dirac_source.i)
- (test/tests/misc/check_error/double_restrict_uo.i)
- (modules/phase_field/examples/rigidbodymotion/AC_CH_Multigrain.i)
- (examples/ex21_debugging/ex21.i)
- (modules/xfem/test/tests/diffusion_xfem/diffusion_flux_bc.i)
- (test/tests/controls/libtorch_nn_control/read_control.i)
- (test/tests/auxkernels/time_derivative_aux/test.i)
- (test/tests/misc/save_in/diag_save_in_soln_var_err_test.i)
- (test/tests/outputs/debug/show_execution_nodal_aux_bcs.i)
- (modules/combined/test/tests/optimization/invOpt_nonlinear/homogeneous_forward.i)
- (test/tests/tag/controls-tagging.i)
- (test/tests/materials/has_material/has_block_prop.i)
- (modules/porous_flow/test/tests/poro_elasticity/terzaghi_basicthm.i)
- (test/tests/bounds/constant_bounds_elem.i)
- (modules/solid_mechanics/test/tests/test_jacobian/jacobian_test_planestrain.i)
- (test/tests/bcs/ad_1d_neumann/1d_neumann.i)
- (modules/optimization/test/tests/optimizationreporter/material/forward.i)
- (test/tests/time_integrators/aee/aee.i)
- (test/tests/misc/save_in/save_in_soln_var_err_test.i)
- (test/tests/bcs/1d_neumann/1d_neumann.i)
- (test/tests/outputs/debug/show_top_residuals_debug.i)
- (test/tests/kernels/2d_diffusion/2d_diffusion_neumannbc_test.i)
- (modules/heat_transfer/test/tests/code_verification/cartesian_test_no4.i)
- (modules/solid_mechanics/test/tests/static_deformations/cosserat_shear.i)
- (modules/solid_mechanics/test/tests/test_jacobian/jacobian_test_3D.i)
- (test/tests/fvkernels/fv_anisotropic_diffusion/fv_anisotropic_diffusion.i)
- (modules/combined/test/tests/optimization/compliance_sensitivity/thermal_test.i)
- (modules/porous_flow/test/tests/poro_elasticity/terzaghi_fully_saturated_volume.i)
- (modules/optimization/test/tests/misc/scaling_test/scaling_test.i)
- (modules/optimization/test/tests/optimizationreporter/constant_heat_source/forward_nonLinear.i)
- (tutorials/darcy_thermo_mech/step10_multiapps/problems/step10_micro.i)
- (test/tests/bcs/periodic/periodic_subdomain_restricted_test.i)
- (test/tests/kernels/anisotropic_diffusion/aniso_diffusion.i)
- (test/tests/kernels/ad_2d_diffusion/2d_diffusion_neumannbc_test.i)
- (modules/heat_transfer/test/tests/heat_conduction_ortho/heat_conduction_ortho.i)
- (test/tests/executioners/fixed_point/2d_diffusion_fixed_point_toggle_mat.i)
- (modules/heat_transfer/test/tests/code_verification/cartesian_test_no3.i)
- (modules/porous_flow/test/tests/poro_elasticity/terzaghi.i)
- (modules/fsi/test/tests/fsi_acoustics/3D_struc_acoustic/3D_struc_acoustic.i)
- (modules/fsi/test/tests/fsi_acoustics/1D_struc_acoustic/1D_struc_acoustic.i)
- (modules/optimization/test/tests/optimizationreporter/bc_load_linearFunction/adjoint.i)
- (test/tests/misc/hit_cli/input1.i)
- (test/tests/bcs/sideset_from_nodeset/sideset_from_nodeset_test.i)
- (test/tests/fvkernels/fv_simple_diffusion/neumann.i)
- (modules/stochastic_tools/test/tests/transfers/libtorch_nn_transfer/libtorch_drl_control_sub.i)
- (modules/misc/test/tests/coupled_directional_mesh_height_interpolation/coupled_directional_mesh_height_interpolation.i)
- (test/tests/multiapps/relaxation/picard_relaxed_parent.i)
- (modules/combined/test/tests/optimization/invOpt_nonlinear/simulation.i)
- (test/tests/misc/save_in/save_in_test.i)
- (test/tests/misc/displaced_mesh_coupling/ad.i)
- (test/tests/time_steppers/iteration_adaptive/hit_function_knot.i)
- (test/tests/time_steppers/time_stepper_system/AB2PredictorCorrector.i)
- (modules/combined/test/tests/optimization/invOpt_bc_convective/adjoint.i)
- (modules/porous_flow/test/tests/poro_elasticity/terzaghi_constM.i)
- (modules/optimization/test/tests/optimizationreporter/constant_heat_source/adjoint_nonLinear.i)
- (test/tests/controls/time_periods/bcs/bcs_integrated.i)
- (test/tests/kernels/hfem/neumann.i)
- (modules/stochastic_tools/examples/parameter_study/diffusion_time.i)
- (modules/solid_mechanics/test/tests/static_deformations/cosserat_tension.i)
- (test/tests/multiapps/relaxation/picard_parent.i)
- (modules/xfem/test/tests/moving_interface/phase_transition_2d.i)
- (test/tests/multiapps/relaxation/bad_relax_factor_parent.i)
- (modules/optimization/test/tests/optimizationreporter/nonlinear_material/forward_and_adjoint.i)
- (modules/stochastic_tools/examples/surrogates/pod_rb/2d_multireg/sub.i)
- (test/tests/userobjects/element_subdomain_modifier/amr_bc.i)
- (test/tests/executioners/fixed_point/nonlinear_fixed_point.i)
- (modules/solid_mechanics/test/tests/lagrangian/cartesian/total/stabilization/cook_small.i)
- (modules/stochastic_tools/examples/libtorch_drl_control/libtorch_drl_control_sub.i)
- (test/tests/materials/material/three_coupled_mat_test.i)
Child Objects
(test/tests/bcs/1d_neumann/1d_neumann.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 10
construct_side_list_from_node_list = true
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = NeumannBC
variable = u
boundary = right
value = 2
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
(modules/thermal_hydraulics/test/tests/components/hs_boundary_external_app_convection/plate.parent.i)
# This tests a temperature and heat transfer coefficient using the MultiApp system.
# Simple heat conduction problem with heat source is solved,
# to obtain an analytical solution:
# T(x,t) = 300 + 20t(x-1)^2
# The temperature is picked up by the child
# side of the solve, to use as ambiant temperature in a convective BC.
htc = 100
[Mesh]
type = GeneratedMesh
dim = 1
xmax = 1
nx = 10
[]
[Functions]
[left_bc_fn]
type = PiecewiseLinear
x = '0 10'
y = '300 500'
[]
[]
[Variables]
[T]
[]
[]
[AuxVariables]
[htc_ext]
initial_condition = ${htc}
[]
[]
[Functions]
[source_term]
type = ParsedFunction
expression = '20 * x * x - 40 * x + 20 - 40 * t'
[]
[]
[ICs]
[T_ic]
type = ConstantIC
variable = T
value = 300
[]
[]
[Kernels]
[td]
type = ADTimeDerivative
variable = T
[]
[diff]
type = ADDiffusion
variable = T
[]
[source]
type = BodyForce
function = 'source_term'
variable = T
[]
[]
[BCs]
[left]
type = FunctionDirichletBC
variable = T
boundary = left
function = left_bc_fn
[]
[right]
type = NeumannBC
variable = T
boundary = right
value = 0
[]
[]
[Executioner]
type = Transient
dt = 0.5
end_time = 10
nl_abs_tol = 1e-10
abort_on_solve_fail = true
[]
[MultiApps]
[thm]
type = TransientMultiApp
app_type = ThermalHydraulicsApp
input_files = plate.i
execute_on = TIMESTEP_END
[]
[]
[Transfers]
[T_to_child]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = thm
source_variable = T
variable = T_ext
[]
[htc_to_child]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = thm
source_variable = htc_ext
variable = htc_ext
[]
[]
[Outputs]
exodus = true
[]
(test/tests/bcs/resid_jac_together/diffusion_reaction.i)
[Mesh]
[square]
type = GeneratedMeshGenerator
nx = 2
ny = 2
dim = 2
[]
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[]
[BCs]
[nodal_bc]
type = DirichletBC
variable = u
value = 1.2
boundary = left
[]
[integrated_bc]
type = NeumannBC
variable = u
value = -2
boundary = right
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
residual_and_jacobian_together = true
[]
[Outputs]
exodus = true
[]
(test/tests/multiapps/relaxation/sub_relaxed_parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
parallel_type = replicated
[]
[Variables]
[u]
[]
[]
[AuxVariables]
[v]
initial_condition = 1
[]
[inverse_v]
initial_condition = 1
[]
[]
[Kernels]
[diff]
type = CoefDiffusion
variable = u
coef = 0.1
[]
[time]
type = TimeDerivative
variable = u
[]
[force_u]
type = CoupledForce
variable = u
v = inverse_v
[]
[]
[AuxKernels]
[invert_v]
type = QuotientAux
variable = inverse_v
denominator = v
numerator = 20.0
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[Neumann_right]
type = NeumannBC
variable = u
boundary = right
value = 1
[]
[]
[Postprocessors]
[picard_its]
type = NumFixedPointIterations
execute_on = 'initial timestep_end'
[]
[]
[Executioner]
type = Transient
num_steps = 4
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_abs_tol = 1e-14
[]
[Outputs]
exodus = true
execute_on = 'INITIAL TIMESTEP_END'
[]
[MultiApps]
[sub]
type = TransientMultiApp
app_type = MooseTestApp
execute_on = timestep_begin
positions = '0 0 0'
input_files = sub_relaxed_sub.i
transformed_variables = v
relaxation_factor = 0.94
[]
[]
[Transfers]
[v_from_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = v
variable = v
[]
[u_to_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = u
variable = u
[]
[]
(test/tests/postprocessors/nodal_extreme_value/block_nodal_pps_test.i)
[Mesh]
file = rect-2blk.e
[]
[Variables]
[u]
order = FIRST
family = LAGRANGE
block = 1
[]
[v]
order = FIRST
family = LAGRANGE
[]
[]
[Kernels]
[diff_u]
type = Diffusion
variable = u
[]
[diff_v]
type = Diffusion
variable = v
[]
[]
[BCs]
[left_u]
type = DirichletBC
variable = u
boundary = 6
value = 0
[]
[right_u]
type = NeumannBC
variable = u
boundary = 8
value = 4
[]
[left_v]
type = DirichletBC
variable = v
boundary = 6
value = 1
[]
[right_v]
type = DirichletBC
variable = v
boundary = 3
value = 6
[]
[]
[Postprocessors]
# This test demonstrates that you can have a block restricted NodalPostprocessor
[restricted_max]
type = NodalExtremeValue
variable = v
block = 1 # Block restricted
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
exodus = true
[]
(examples/ex08_materials/ex08.i)
[Mesh]
file = reactor.e
# Let's assign human friendly names to the blocks on the fly
block_id = '1 2'
block_name = 'fuel deflector'
boundary_id = '4 5'
boundary_name = 'bottom top'
[]
[Variables]
[./diffused]
order = FIRST
family = LAGRANGE
initial_condition = 0.5 # shortcut/convenience for setting constant initial condition
[../]
[./convected]
order = FIRST
family = LAGRANGE
initial_condition = 0.0 # shortcut/convenience for setting constant initial condition
[../]
[]
[Kernels]
# This Kernel consumes a real-gradient material property from the active material
[./convection]
type = ExampleConvection
variable = convected
[../]
[./diff_convected]
type = Diffusion
variable = convected
[../]
[./example_diff]
# This Kernel uses "diffusivity" from the active material
type = ExampleDiffusion
variable = diffused
[../]
[./time_deriv_diffused]
type = TimeDerivative
variable = diffused
[../]
[./time_deriv_convected]
type = TimeDerivative
variable = convected
[../]
[]
[BCs]
[./bottom_diffused]
type = DirichletBC
variable = diffused
boundary = 'bottom'
value = 0
[../]
[./top_diffused]
type = DirichletBC
variable = diffused
boundary = 'top'
value = 5
[../]
[./bottom_convected]
type = DirichletBC
variable = convected
boundary = 'bottom'
value = 0
[../]
[./top_convected]
type = NeumannBC
variable = convected
boundary = 'top'
value = 1
[../]
[]
[Materials]
[./example]
type = ExampleMaterial
block = 'fuel'
diffusion_gradient = 'diffused'
# Approximate Parabolic Diffusivity
independent_vals = '0 0.25 0.5 0.75 1.0'
dependent_vals = '1e-2 5e-3 1e-3 5e-3 1e-2'
[../]
[./example1]
type = ExampleMaterial
block = 'deflector'
diffusion_gradient = 'diffused'
# Constant Diffusivity
independent_vals = '0 1.0'
dependent_vals = '1e-1 1e-1'
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
dt = 0.1
num_steps = 10
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(modules/xfem/test/tests/nucleation_uo/nucleate_edge_crack_2d.i)
[GlobalParams]
displacements = 'disp_x disp_y'
volumetric_locking_correction = true
[]
[XFEM]
geometric_cut_userobjects = 'cut_mesh2'
qrule = volfrac
output_cut_plane = true
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 20
ny = 10
xmin = 0
xmax = 2
ymin = 0.0
ymax = 1.0
elem_type = QUAD4
[]
[top_left]
type = BoundingBoxNodeSetGenerator
new_boundary = pull_top_left
bottom_left = '-0.01 0.99 0'
top_right = '0.11 1.01 0'
input = gen
[]
[top_right]
type = BoundingBoxNodeSetGenerator
new_boundary = pull_top_right
bottom_left = '1.89 0.99 0'
top_right = '2.01 1.01 0'
input = top_left
[]
[top_middle_ss]
type = SideSetsFromBoundingBoxGenerator
input = top_right
bottom_left = '0.79 0.89 0'
top_right = '1.21 1.01 0'
block_id = '0'
boundary_new = top_middle_ss
boundaries_old = top
[]
[nucleate]
type = ParsedSubdomainMeshGenerator
input = top_middle_ss
combinatorial_geometry = 'y > 0.39 & y < 0.51'
block_id = 10
[]
[]
[DomainIntegral]
integrals = 'InteractionIntegralKI InteractionIntegralKII'
displacements = 'disp_x disp_y'
crack_front_points_provider = cut_mesh2
2d=true
number_points_from_provider = 0
crack_direction_method = CurvedCrackFront
radius_inner = '0.15'
radius_outer = '0.45'
poissons_ratio = 0.3
youngs_modulus = 207000
block = 0
incremental = true
used_by_xfem_to_grow_crack = true
[]
[UserObjects]
[nucleate]
type = MeshCut2DRankTwoTensorNucleation
tensor = stress
scalar_type = MaxPrincipal
nucleation_threshold = nucleation_threshold
initiate_on_boundary = 'left right'
nucleation_length = .2
[]
[cut_mesh2]
type = MeshCut2DFractureUserObject
mesh_file = make_edge_crack_in.e
k_critical=230
growth_increment = 0.11
nucleate_uo = nucleate
[]
[]
[AuxVariables]
[nucleation_threshold]
order = CONSTANT
family = MONOMIAL
[]
[]
[ICs]
[nucleation_bulk]
type = ConstantIC
value = 10000
variable = nucleation_threshold
block = 0
[]
[nucleation_weak]
type = FunctionIC
function = nucleation_x
variable = nucleation_threshold
block = 10
[]
[]
[Functions]
[nucleation_x]
type = ParsedFunction
expression = '300+x*50'
[]
[]
[Modules/TensorMechanics/Master]
[./all]
strain = FINITE
planar_formulation = plane_strain
add_variables = true
generate_output = 'stress_xx stress_yy vonmises_stress max_principal_stress'
[../]
[]
[Functions]
[bc_pull_top]
type = ParsedFunction
expression = 0.0005*t
[]
[]
[BCs]
[top_edges]
type = FunctionDirichletBC
boundary = 'pull_top_left pull_top_right'
variable = disp_y
function = bc_pull_top
[]
[top_middle]
type = NeumannBC
boundary = top_middle_ss
variable = disp_y
value = -2000
[]
[bottom_x]
type = DirichletBC
boundary = bottom
variable = disp_x
value = 0.0
[]
[bottom_y]
type = DirichletBC
boundary = bottom
variable = disp_y
value = 0.0
[]
[]
[Materials]
[./elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 207000
poissons_ratio = 0.3
[../]
[./stress]
type = ComputeFiniteStrainElasticStress
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
petsc_options_value = '201 hypre boomeramg 8'
line_search = 'none'
[./Predictor]
type = SimplePredictor
scale = 1.0
[../]
# controls for linear iterations
l_max_its = 100
l_tol = 1e-2
# controls for nonlinear iterations
nl_max_its = 15
nl_rel_tol = 1e-8
nl_abs_tol = 1e-9
# time control
start_time = 0.0
dt = 1.0
end_time = 5
max_xfem_update = 100
[]
[Outputs]
csv=true
execute_on = TIMESTEP_END
# [xfemcutter]
# type=XFEMCutMeshOutput
# xfem_cutter_uo=cut_mesh2
# []
# console = false
[./console]
type = Console
output_linear = false
output_nonlinear = false
[../]
[]
(python/pyhit/tests/input_modified.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
xmax = 3
x_max = 4 # Changed from 3 to 4
[]
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[]
[BCs]
[left]
type = ADDirichletBC
variable = u
boundary = left
value = 300
[]
[right]
type = ADNeumannBC
variable = u
boundary = right
value = 100
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
csv = true
[]
(modules/combined/test/tests/optimization/invOpt_nonlinear/adjoint.i)
[Executioner]
type = Steady
solve_type = NEWTON
line_search = none
nl_abs_tol = 1e-12
nl_rel_tol = 1e-12
nl_max_its = 100
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Mesh]
[]
[Variables]
[adjointT]
[]
[]
[AuxVariables]
[forwardT]
[]
[dDdTgradT]
order = CONSTANT
family = MONOMIAL_VEC
[]
[]
[Kernels]
[heat_conduction]
type = ADHeatConduction
thermal_conductivity = 'linearized_conductivity'
variable = adjointT
[]
[advection]
type = LevelSetAdvection
velocity = dDdTgradT
variable = adjointT
[]
[]
[AuxKernels]
[dDdTgradT]
type = ADFunctorElementalGradientAux
functor = forwardT
variable = dDdTgradT
factor_matprop = 'dDdT'
[]
[]
[Materials]
[LinearizedConductivity]
type = ADParsedMaterial
f_name = 'linearized_conductivity'
function = '10+500*forwardT'
args = 'forwardT'
[]
[dDdT]
type = ADParsedMaterial
f_name = 'dDdT'
function = '500'
args = 'forwardT'
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = adjointT
x_coord_name = misfit/measurement_xcoord
y_coord_name = misfit/measurement_ycoord
z_coord_name = misfit/measurement_zcoord
value_name = misfit/misfit_values
[]
[]
[Reporters]
[misfit]
type = OptimizationData
[]
[params]
type = ConstantReporter
real_vector_names = 'heat_source'
real_vector_values = '0' # Dummy
[]
[]
[BCs]
[left]
type = NeumannBC
variable = adjointT
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = adjointT
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = adjointT
boundary = bottom
value = 0
[]
[top]
type = DirichletBC
variable = adjointT
boundary = top
value = 0
[]
[]
[VectorPostprocessors]
[gradient_vpp]
type = ElementOptimizationSourceFunctionInnerProduct
function = volumetric_heat_func
variable = adjointT
[]
[]
[Functions]
[volumetric_heat_func]
type = ParsedOptimizationFunction
expression = q
param_symbol_names = 'q'
param_vector_name = 'params/heat_source'
[]
[]
[Outputs]
console = false
[]
(modules/solid_mechanics/test/tests/lagrangian/cartesian/updated/stabilization/cook_large.i)
[GlobalParams]
displacements = 'disp_x disp_y'
large_kinematics = true
stabilize_strain = true
[]
[Mesh]
type = FileMesh
file = cook_mesh.exo
dim = 2
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[Kernels]
[sdx]
type = UpdatedLagrangianStressDivergence
variable = disp_x
component = 0
use_displaced_mesh = true
[]
[sdy]
type = UpdatedLagrangianStressDivergence
variable = disp_y
component = 1
use_displaced_mesh = true
[]
[]
[AuxVariables]
[strain_xx]
order = CONSTANT
family = MONOMIAL
[]
[strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[strain_zz]
order = CONSTANT
family = MONOMIAL
[]
[strain_xy]
order = CONSTANT
family = MONOMIAL
[]
[strain_xz]
order = CONSTANT
family = MONOMIAL
[]
[strain_yz]
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_xz]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[stress_xx]
type = RankTwoAux
rank_two_tensor = cauchy_stress
variable = stress_xx
index_i = 0
index_j = 0
execute_on = timestep_end
[]
[stress_yy]
type = RankTwoAux
rank_two_tensor = cauchy_stress
variable = stress_yy
index_i = 1
index_j = 1
execute_on = timestep_end
[]
[stress_zz]
type = RankTwoAux
rank_two_tensor = cauchy_stress
variable = stress_zz
index_i = 2
index_j = 2
execute_on = timestep_end
[]
[stress_xy]
type = RankTwoAux
rank_two_tensor = cauchy_stress
variable = stress_xy
index_i = 0
index_j = 1
execute_on = timestep_end
[]
[stress_xz]
type = RankTwoAux
rank_two_tensor = cauchy_stress
variable = stress_xz
index_i = 0
index_j = 2
execute_on = timestep_end
[]
[stress_yz]
type = RankTwoAux
rank_two_tensor = cauchy_stress
variable = stress_yz
index_i = 1
index_j = 2
execute_on = timestep_end
[]
[strain_xx]
type = RankTwoAux
rank_two_tensor = mechanical_strain
variable = strain_xx
index_i = 0
index_j = 0
execute_on = timestep_end
[]
[strain_yy]
type = RankTwoAux
rank_two_tensor = mechanical_strain
variable = strain_yy
index_i = 1
index_j = 1
execute_on = timestep_end
[]
[strain_zz]
type = RankTwoAux
rank_two_tensor = mechanical_strain
variable = strain_zz
index_i = 2
index_j = 2
execute_on = timestep_end
[]
[strain_xy]
type = RankTwoAux
rank_two_tensor = mechanical_strain
variable = strain_xy
index_i = 0
index_j = 1
execute_on = timestep_end
[]
[strain_xz]
type = RankTwoAux
rank_two_tensor = mechanical_strain
variable = strain_xz
index_i = 0
index_j = 2
execute_on = timestep_end
[]
[strain_yz]
type = RankTwoAux
rank_two_tensor = mechanical_strain
variable = strain_yz
index_i = 1
index_j = 2
execute_on = timestep_end
[]
[]
[BCs]
[fixed_x]
type = DirichletBC
preset = true
variable = disp_x
boundary = canti
value = 0.0
[]
[fixed_y]
type = DirichletBC
preset = true
variable = disp_y
boundary = canti
value = 0.0
[]
[pull]
type = NeumannBC
variable = disp_y
boundary = loading
value = 0.1
[]
[]
[Materials]
[compute_stress]
type = ComputeNeoHookeanStress
lambda = 416666611.0991259
mu = 8300.33333888888926
[]
[compute_strain]
type = ComputeLagrangianStrain
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'newton'
line_search = 'none'
petsc_options_iname = -pc_type
petsc_options_value = lu
nl_max_its = 500
nl_abs_tol = 1e-5
nl_rel_tol = 1e-6
[]
[Postprocessors]
[value]
type = PointValue
variable = disp_y
point = '48 60 0'
use_displaced_mesh = false
[]
[]
[Outputs]
exodus = false
csv = true
[]
(modules/xfem/test/tests/moving_interface/phase_transition_3d.i)
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 3
nx = 11
ny = 1
nz = 1
xmin = 0.0
xmax = 20.0
ymin = 0.0
ymax = 5.0
zmin = 0.0
zmax = 5.0
elem_type = HEX8
[]
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[velocity]
type = XFEMPhaseTransitionMovingInterfaceVelocity
diffusivity_at_positive_level_set = 5
diffusivity_at_negative_level_set = 1
equilibrium_concentration_jump = 1
value_at_interface_uo = value_uo
[]
[value_uo]
type = NodeValueAtXFEMInterface
variable = 'u'
interface_mesh_cut_userobject = 'cut_mesh'
execute_on = TIMESTEP_END
level_set_var = ls
[]
[cut_mesh]
type = InterfaceMeshCut3DUserObject
mesh_file = flat_interface_2d.e
interface_velocity_uo = velocity
heal_always = true
[]
[]
[Variables]
[u]
[]
[]
[ICs]
[ic_u]
type = FunctionIC
variable = u
function = 'if(x<5.01, 2, 1)'
[]
[]
[AuxVariables]
[ls]
order = FIRST
family = LAGRANGE
[]
[]
[Constraints]
[u_constraint]
type = XFEMEqualValueAtInterface
geometric_cut_userobject = 'cut_mesh'
use_displaced_mesh = false
variable = u
value = 2
alpha = 1e6
[]
[]
[Kernels]
[diff]
type = MatDiffusion
variable = u
diffusivity = diffusion_coefficient
[]
[time]
type = TimeDerivative
variable = u
[]
[]
[AuxKernels]
[ls]
type = MeshCutLevelSetAux
mesh_cut_user_object = cut_mesh
variable = ls
execute_on = 'TIMESTEP_BEGIN'
[]
[]
[Materials]
[diffusivity_A]
type = GenericConstantMaterial
prop_names = A_diffusion_coefficient
prop_values = 5
[]
[diffusivity_B]
type = GenericConstantMaterial
prop_names = B_diffusion_coefficient
prop_values = 1
[]
[diff_combined]
type = LevelSetBiMaterialReal
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = diffusion_coefficient
[]
[]
[BCs]
# Define boundary conditions
[left_u]
type = DirichletBC
variable = u
value = 2
boundary = left
[]
[right_u]
type = NeumannBC
variable = u
boundary = right
value = 0
[]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
line_search = 'none'
l_tol = 1e-3
nl_max_its = 15
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
start_time = 0.0
dt = 1
num_steps = 5
max_xfem_update = 1
[]
[Outputs]
execute_on = timestep_end
exodus = true
perf_graph = true
[]
(modules/stochastic_tools/examples/sobol/diffusion.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables/T]
initial_condition = 300
[]
[Kernels]
[time]
type = ADTimeDerivative
variable = T
[]
[diff]
type = ADMatDiffusion
variable = T
diffusivity = diffusivity
[]
[source]
type = ADBodyForce
variable = T
value = 100
function = 1
[]
[]
[BCs]
[left]
type = ADDirichletBC
variable = T
boundary = left
value = 300
[]
[right]
type = ADNeumannBC
variable = T
boundary = right
value = -100
[]
[]
[Materials/constant]
type = ADGenericConstantMaterial
prop_names = 'diffusivity'
prop_values = 1
[]
[Executioner]
type = Transient
solve_type = NEWTON
num_steps = 4
dt = 0.25
[]
[Postprocessors]
[T_avg]
type = ElementAverageValue
variable = T
execute_on = 'initial timestep_end'
[]
[q_left]
type = ADSideDiffusiveFluxAverage
variable = T
boundary = left
diffusivity = diffusivity
execute_on = 'initial timestep_end'
[]
[]
[Controls/stochastic]
type = SamplerReceiver
[]
[Outputs]
[]
(test/tests/functions/default_function/default_function.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = FuncCoefDiffusion
variable = u
# No default function supplied
[../]
[./time]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = NeumannBC
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
[]
(test/tests/time_steppers/iteration_adaptive/adapt_tstep_shrink_init_dt.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 50
ny = 2
xmax = 5
[]
[Variables]
[u]
order = FIRST
family = LAGRANGE
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[dt]
type = TimeDerivative
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 10
[]
[right]
type = NeumannBC
variable = u
boundary = right
value = -1
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
start_time = 0.0
dtmin = 1.0
end_time = 10.0
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 1
linear_iteration_ratio = 1
dt = 5.0
[]
[]
[Postprocessors]
[_dt]
type = TimestepSize
[]
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
checkpoint = true
[]
(modules/solid_mechanics/test/tests/lagrangian/cartesian/updated/stabilization/cook_small.i)
[GlobalParams]
displacements = 'disp_x disp_y'
large_kinematics = false
stabilize_strain = true
[]
[Mesh]
type = FileMesh
file = cook_mesh.exo
dim = 2
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[Kernels]
[sdx]
type = UpdatedLagrangianStressDivergence
variable = disp_x
component = 0
[]
[sdy]
type = UpdatedLagrangianStressDivergence
variable = disp_y
component = 1
[]
[]
[AuxVariables]
[strain_xx]
order = CONSTANT
family = MONOMIAL
[]
[strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[strain_zz]
order = CONSTANT
family = MONOMIAL
[]
[strain_xy]
order = CONSTANT
family = MONOMIAL
[]
[strain_xz]
order = CONSTANT
family = MONOMIAL
[]
[strain_yz]
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_xz]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[stress_xx]
type = RankTwoAux
rank_two_tensor = cauchy_stress
variable = stress_xx
index_i = 0
index_j = 0
execute_on = timestep_end
[]
[stress_yy]
type = RankTwoAux
rank_two_tensor = cauchy_stress
variable = stress_yy
index_i = 1
index_j = 1
execute_on = timestep_end
[]
[stress_zz]
type = RankTwoAux
rank_two_tensor = cauchy_stress
variable = stress_zz
index_i = 2
index_j = 2
execute_on = timestep_end
[]
[stress_xy]
type = RankTwoAux
rank_two_tensor = cauchy_stress
variable = stress_xy
index_i = 0
index_j = 1
execute_on = timestep_end
[]
[stress_xz]
type = RankTwoAux
rank_two_tensor = cauchy_stress
variable = stress_xz
index_i = 0
index_j = 2
execute_on = timestep_end
[]
[stress_yz]
type = RankTwoAux
rank_two_tensor = cauchy_stress
variable = stress_yz
index_i = 1
index_j = 2
execute_on = timestep_end
[]
[strain_xx]
type = RankTwoAux
rank_two_tensor = mechanical_strain
variable = strain_xx
index_i = 0
index_j = 0
execute_on = timestep_end
[]
[strain_yy]
type = RankTwoAux
rank_two_tensor = mechanical_strain
variable = strain_yy
index_i = 1
index_j = 1
execute_on = timestep_end
[]
[strain_zz]
type = RankTwoAux
rank_two_tensor = mechanical_strain
variable = strain_zz
index_i = 2
index_j = 2
execute_on = timestep_end
[]
[strain_xy]
type = RankTwoAux
rank_two_tensor = mechanical_strain
variable = strain_xy
index_i = 0
index_j = 1
execute_on = timestep_end
[]
[strain_xz]
type = RankTwoAux
rank_two_tensor = mechanical_strain
variable = strain_xz
index_i = 0
index_j = 2
execute_on = timestep_end
[]
[strain_yz]
type = RankTwoAux
rank_two_tensor = mechanical_strain
variable = strain_yz
index_i = 1
index_j = 2
execute_on = timestep_end
[]
[]
[BCs]
[fixed_x]
type = DirichletBC
preset = true
variable = disp_x
boundary = canti
value = 0.0
[]
[fixed_y]
type = DirichletBC
preset = true
variable = disp_y
boundary = canti
value = 0.0
[]
[pull]
type = NeumannBC
variable = disp_y
boundary = loading
value = 10.0
[]
[]
[Materials]
[elastic_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 250.0
poissons_ratio = 0.4999999
[]
[compute_stress]
type = ComputeLagrangianLinearElasticStress
[]
[compute_strain]
type = ComputeLagrangianStrain
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'newton'
line_search = 'none'
petsc_options_iname = -pc_type
petsc_options_value = lu
nl_abs_tol = 1e-10
nl_rel_tol = 1e-6
l_tol = 1e-10
[]
[Postprocessors]
[value]
type = PointValue
variable = disp_y
point = '48 60 0'
use_displaced_mesh = false
[]
[]
[Outputs]
exodus = false
csv = true
[]
(modules/heat_transfer/test/tests/code_verification/spherical_test_no4.i)
# Problem III.4
#
# A spherical shell has thermal conductivity k and heat generation q.
# It has an inner radius ri and outer radius ro. A constant heat flux is
# applied to the inside surface qin and the outside surface is exposed
# to a fluid temperature uf and heat transfer coefficient h.
#
# REFERENCE:
# A. Toptan, et al. (Mar.2020). Tech. rep. CASL-U-2020-1939-000, SAND2020-3887 R. DOI:10.2172/1614683.
[Mesh]
[./geom]
type = GeneratedMeshGenerator
dim = 1
elem_type = EDGE2
xmin = 0.2
nx = 4
[../]
[]
[Variables]
[./u]
order = FIRST
[../]
[]
[Problem]
coord_type = RSPHERICAL
[]
[Functions]
[./exact]
type = ParsedFunction
symbol_names = 'qin q k ri ro uf h'
symbol_values = '100 1200 1.0 0.2 1 100 10'
expression = 'uf+ (q/(6*k)) * ( ro^2-x^2 + 2*k*(ro^3-ri^3)/(h*ro^2) + 2 * ri^3 * (1/ro-1/x) ) + (1/x-1/ro+k/(h*ro^2)) * qin * ri^2 / k'
[../]
[]
[Kernels]
[./heat]
type = HeatConduction
variable = u
[../]
[./heatsource]
type = HeatSource
function = 1200
variable = u
[../]
[]
[BCs]
[./ui]
type = NeumannBC
boundary = left
variable = u
value = 100
[../]
[./uo]
type = CoupledConvectiveHeatFluxBC
boundary = right
variable = u
htc = 10.0
T_infinity = 100
[../]
[]
[Materials]
[./property]
type = GenericConstantMaterial
prop_names = 'density specific_heat thermal_conductivity'
prop_values = '1.0 1.0 1.0'
[../]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[./error]
type = ElementL2Error
function = exact
variable = u
[../]
[./h]
type = AverageElementSize
[]
[]
[Outputs]
csv = true
[]
(modules/heat_transfer/test/tests/code_verification/cylindrical_test_no4.i)
# Problem II.4
#
# An infinitely long hollow cylinder has thermal conductivity k and internal
# heat generation q. Its inner radius is ri and outer radius is ro.
# A constant heat flux is applied to the inside surface qin and
# the outside surface is exposed to a fluid temperature T and heat transfer
# coefficient h, which results in the convective boundary condition.
#
# REFERENCE:
# A. Toptan, et al. (Mar.2020). Tech. rep. CASL-U-2020-1939-000, SAND2020-3887 R. DOI:10.2172/1614683.
[Mesh]
[./geom]
type = GeneratedMeshGenerator
dim = 1
elem_type = EDGE2
xmin = 0.2
nx = 4
[../]
[]
[Variables]
[./u]
order = FIRST
[../]
[]
[Problem]
coord_type = RZ
[]
[Functions]
[./exact]
type = ParsedFunction
symbol_names = 'qin q k ri ro uf h'
symbol_values = '100 1200 1.0 0.2 1 100 10'
expression = 'uf+ (0.25*q/k) * ( 2*k*(ro^2-ri^2)/(h*ro) + ro^2-x^2 + 2*ri^2*log(x/ro)) + (k/(h*ro) - log(x/ro)) * qin * ri / k'
[../]
[]
[Kernels]
[./heat]
type = HeatConduction
variable = u
[../]
[./heatsource]
type = HeatSource
function = 1200
variable = u
[../]
[]
[BCs]
[./ui]
type = NeumannBC
boundary = left
variable = u
value = 100
[../]
[./uo]
type = CoupledConvectiveHeatFluxBC
boundary = right
variable = u
htc = 10.0
T_infinity = 100
[../]
[]
[Materials]
[./property]
type = GenericConstantMaterial
prop_names = 'density specific_heat thermal_conductivity'
prop_values = '1.0 1.0 1.0'
[../]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[./error]
type = ElementL2Error
function = exact
variable = u
[../]
[./h]
type = AverageElementSize
[]
[]
[Outputs]
csv = true
[]
(test/tests/bcs/ad_nodal_bc_nonlocal_dependence/test.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 20
[]
[pin]
type = ExtraNodesetGenerator
input = gen
new_boundary = 'pin'
nodes = '0'
[]
[]
[Variables]
[u][]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[]
[BCs]
[left_neumann]
type = NeumannBC
boundary = 'left'
value = -1
variable = u
[]
[right_neumann]
type = NeumannBC
boundary = 'right'
value = 1
variable = u
[]
[pin]
type = ADAverageValuePin
variable = u
# This BC constrains a single degree of freedom on the node specified by the boundary name 'pin' but
# since only gradients of 'u' appear in the weak form and we have no other Dirichlet boundary conditions,
# constraining the single degree of freedom will make it appear as if we have constrained all the degrees of
# freedom in the system such that we have an average value of 0.
boundary = 'pin'
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Problem]
# We have to close the matrix before enforcing boundary conditions, which destroys our sparsity pattern
error_on_jacobian_nonzero_reallocation = false
[]
[Outputs]
exodus = true
[]
(modules/optimization/test/tests/optimizationreporter/constant_heat_source/forward.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmax = 2
ymax = 2
[]
[Variables]
[temperature]
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = temperature
diffusivity = thermal_conductivity
[]
[heat_source]
type = BodyForce
function = volumetric_heat_func
variable = temperature
[]
[]
[BCs]
[left]
type = NeumannBC
variable = temperature
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = temperature
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = temperature
boundary = bottom
value = 200
[]
[top]
type = DirichletBC
variable = temperature
boundary = top
value = 100
[]
[]
[Functions]
[volumetric_heat_func]
type = ParsedOptimizationFunction
expression = q
param_symbol_names = 'q'
param_vector_name = 'params/q'
[]
[]
[Materials]
[steel]
type = GenericConstantMaterial
prop_names = thermal_conductivity
prop_values = 5
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
petsc_options_iname = '-ksp_type -pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'preonly lu superlu_dist'
[]
[Reporters]
[measure_data]
type = OptimizationData
variable = temperature
[]
[params]
type = ConstantReporter
real_vector_names = 'q'
real_vector_values = '0' # Dummy value
[]
[]
[Outputs]
console = false
file_base = 'forward'
[]
(test/tests/misc/displaced_mesh_coupling/nonad.i)
[GlobalParams]
displacements = 'u'
[]
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Variables]
[./u]
[../]
[./v]
[../]
[]
[Kernels]
[./u]
type = Diffusion
use_displaced_mesh = true
variable = u
[../]
[./v]
type = Diffusion
use_displaced_mesh = false
variable = v
[../]
[]
[BCs]
[./no_x]
type = NeumannBC
variable = u
boundary = left
value = 1.0e-3
use_displaced_mesh = true
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[./lright]
type = DirichletBC
variable = v
boundary = right
value = 1
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
exodus = true
[]
(test/tests/restart/restart_transient_from_transient/restart_trans_with_2subs_sub.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 3
ny = 3
xmax = 0.3
ymax = 0.3
[]
[AuxVariables]
[power_density]
[]
[]
[Variables]
[temp]
[]
[]
[Kernels]
[heat_conduction]
type = Diffusion
variable = temp
[]
[heat_ie]
type = TimeDerivative
variable = temp
[]
[heat_source_fuel]
type = CoupledForce
variable = temp
v = power_density
[]
[]
[BCs]
[bc]
type = DirichletBC
variable = temp
boundary = '1 3'
value = 100
[]
[bc2]
type = NeumannBC
variable = temp
boundary = '0 2'
value = 10.0
[]
[]
[Executioner]
type = Transient
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart '
petsc_options_value = 'hypre boomeramg 100'
start_time = 0
end_time = 3
dt = 1.0
nl_abs_tol = 1e-7
nl_rel_tol = 1e-7
[]
[Postprocessors]
[temp_fuel_avg]
type = ElementAverageValue
variable = temp
block = '0'
execute_on = 'initial timestep_end'
[]
[pwr_density]
type = ElementIntegralVariablePostprocessor
block = '0'
variable = power_density
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
perf_graph = true
exodus = true
color = true
[]
(test/tests/interfacekernels/1d_interface/mixed_shapes.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 10
xmax = 2
[]
[./subdomain1]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '1.0 0 0'
block_id = 1
top_right = '2.0 1.0 0'
[../]
[./interface]
input = subdomain1
type = SideSetsBetweenSubdomainsGenerator
primary_block = '0'
paired_block = '1'
new_boundary = 'primary0_interface'
[../]
[./interface_again]
input = interface
type = SideSetsBetweenSubdomainsGenerator
primary_block = '1'
paired_block = '0'
new_boundary = 'primary1_interface'
[../]
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
block = '0'
[../]
[./v]
order = FIRST
family = MONOMIAL
block = '1'
[../]
[]
[Kernels]
[./diff_u]
type = CoeffParamDiffusion
variable = u
D = 4
block = 0
[../]
[./diff_v]
type = CoeffParamDiffusion
variable = v
D = 2
block = 1
[../]
[./body_u]
type = BodyForce
variable = u
block = 0
function = 'x^3+x^2+x+1'
[../]
[./body_v]
type = BodyForce
variable = v
block = 1
function = 'x^3+x^2+x+1'
[../]
[]
[DGKernels]
[./dg_diff_v]
type = DGDiffusion
variable = v
block = 1
diff = 2
sigma = 6
epsilon = -1
[../]
[]
[InterfaceKernels]
[./interface]
type = OneSideDiffusion
variable = u
neighbor_var = v
boundary = primary0_interface
D = 4
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = 'left'
value = 1
[../]
# [./right]
# type = DirichletBC
# variable = v
# boundary = 'right'
# value = 0
# [../]
[./right]
type = DGFunctionDiffusionDirichletBC
variable = v
boundary = 'right'
function = 0
epsilon = -1
sigma = 6
[../]
[./middle]
type = NeumannBC
variable = u
boundary = 'primary0_interface'
value = '.5'
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
exodus = true
print_linear_residuals = true
[]
[Debug]
show_var_residual_norms = true
[]
(test/tests/restart/restart_transient_from_transient/pseudo_trans_with_2subs_sub.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 3
ny = 3
xmax = 0.3
ymax = 0.3
[]
[AuxVariables]
[power_density]
[]
[]
[Variables]
[temp]
[]
[]
[Kernels]
[heat_timedt]
type = TimeDerivative
variable = temp
[]
[heat_conduction]
type = Diffusion
variable = temp
[]
[heat_source_fuel]
type = CoupledForce
variable = temp
v = power_density
[]
[]
[BCs]
[bc]
type = DirichletBC
variable = temp
boundary = '1 3'
value = 100
[]
[bc2]
type = NeumannBC
variable = temp
boundary = '0 2'
value = 10.0
[]
[]
[Executioner]
type = Transient
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart '
petsc_options_value = 'hypre boomeramg 100'
nl_abs_tol = 1e-7
nl_rel_tol = 1e-7
end_time = 20
dt = 2.0
[]
[Postprocessors]
[temp_fuel_avg]
type = ElementAverageValue
variable = temp
execute_on = 'initial timestep_end'
[]
[pwr_density]
type = ElementIntegralVariablePostprocessor
variable = power_density
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
perf_graph = true
exodus = true
color = true
[]
(tutorials/tutorial03_verification/app/test/tests/step03_analytical/1d_analytical.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
xmax = 0.03
nx = 200
[]
[]
[Variables]
[T]
[]
[]
[ICs]
[T_O]
type = ConstantIC
variable = T
value = 300
[]
[]
[Kernels]
[T_time]
type = HeatConductionTimeDerivative
variable = T
density_name = 7800
specific_heat = 450
[]
[T_cond]
type = HeatConduction
variable = T
diffusion_coefficient = 80.2
[]
[]
[BCs]
[left]
type = NeumannBC
variable = T
boundary = left
value = 7e5
[]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
dt = 0.01
end_time = 1
[]
[Outputs]
exodus = true
csv = true
[]
[Functions]
[T_exact]
type = ParsedFunction
symbol_names = 'k rho cp T0 qs'
symbol_values = '80.2 7800 450 300 7e5'
expression = 'T0 + '
'qs/k*(2*sqrt(k/(rho*cp)*t/pi)*exp(-x^2/(4*k/(rho*cp)*(t+1e-50))) - '
'x*(1-erf(x/(2*sqrt(k/(rho*cp)*(t+1e-50))))))'
[]
[]
[Postprocessors]
[error]
type = NodalL2Error
variable = T
function = T_exact
[]
[h]
type = AverageElementSize
[]
[]
[VectorPostprocessors]
[T_exact]
type = LineFunctionSampler
functions = T_exact
start_point = '0 0 0'
end_point = '0.03 0 0'
num_points = 200
sort_by = x
execute_on = 'INITIAL TIMESTEP_END'
[]
[T_simulation]
type = LineValueSampler
variable = T
start_point = '0 0 0'
end_point = '0.03 0 0'
num_points = 200
sort_by = x
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
(test/tests/executioners/fixed_point/2d_diffusion_fixed_point.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 4
xmin = -1
xmax = 1
ymin = -1
ymax = 1
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./pseudo_time]
type = CoefReaction
variable = u
coefficient = -0.1
# comment out this will make fixed point iteration converged in one iteration
vector_tags = 'previous'
[../]
[./pseudo_time_compensation]
type = CoefReaction
variable = u
coefficient = 0.1
[../]
[]
[BCs]
[./left]
type = VacuumBC
variable = u
boundary = left
[../]
[./right]
type = NeumannBC
variable = u
boundary = right
value = 1
[../]
[]
[Postprocessors]
[./unorm]
type = ElementL2Norm
variable = u
[../]
[]
[Problem]
type = FixedPointProblem
fp_tag_name = 'previous'
[]
[Executioner]
type = FixedPointSteady
nl_rel_tol = 1e-2
nl_abs_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(test/tests/mesh/side_list_from_node_list/side_list_from_node_list.i)
[Mesh]
type = FileMesh
file = square_nodesets_only.e
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[./right]
type = NeumannBC
variable = u
boundary = 2
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
(modules/xfem/test/tests/moving_interface/ad_phase_transition_2d.i)
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 11
ny = 1
xmin = 0.0
xmax = 20.0
ymin = 0.0
ymax = 5.0
elem_type = QUAD4
[]
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[velocity]
type = XFEMPhaseTransitionMovingInterfaceVelocity
diffusivity_at_positive_level_set = 5
diffusivity_at_negative_level_set = 1
equilibrium_concentration_jump = 1
value_at_interface_uo = value_uo
[]
[value_uo]
type = NodeValueAtXFEMInterface
variable = 'u'
interface_mesh_cut_userobject = 'cut_mesh'
execute_on = TIMESTEP_END
level_set_var = ls
[]
[cut_mesh]
type = InterfaceMeshCut2DUserObject
mesh_file = flat_interface_1d.e
interface_velocity_uo = velocity
heal_always = true
[]
[]
[Variables]
[u]
[]
[]
[ICs]
[ic_u]
type = FunctionIC
variable = u
function = 'if(x<5.01, 2, 1)'
[]
[]
[AuxVariables]
[ls]
order = FIRST
family = LAGRANGE
[]
[]
[Constraints]
[u_constraint]
type = XFEMEqualValueAtInterface
geometric_cut_userobject = 'cut_mesh'
use_displaced_mesh = false
variable = u
value = 2
alpha = 1e6
[]
[]
[Kernels]
[diff]
type = ADMatDiffusion
variable = u
diffusivity = diffusion_coefficient
[]
[time]
type = ADTimeDerivative
variable = u
[]
[]
[AuxKernels]
[ls]
type = MeshCutLevelSetAux
mesh_cut_user_object = cut_mesh
variable = ls
execute_on = 'TIMESTEP_BEGIN'
[]
[]
[Materials]
[diffusivity_A]
type = ADGenericConstantMaterial
prop_names = A_diffusion_coefficient
prop_values = 5
[]
[diffusivity_B]
type = ADGenericConstantMaterial
prop_names = B_diffusion_coefficient
prop_values = 1
[]
[diff_combined]
type = ADLevelSetBiMaterialReal
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = diffusion_coefficient
[]
[]
[BCs]
# Define boundary conditions
[left_u]
type = ADDirichletBC
variable = u
value = 2
boundary = left
[]
[right_u]
type = ADNeumannBC
variable = u
boundary = right
value = 0
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
line_search = 'none'
l_tol = 1e-3
nl_max_its = 15
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
start_time = 0.0
dt = 1
num_steps = 5
max_xfem_update = 1
[]
[Outputs]
file_base = phase_transition_2d_out
execute_on = timestep_end
exodus = true
perf_graph = true
[]
(modules/optimization/test/tests/executioners/steady_and_adjoint/nonhomogeneous_bc.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
xmax = 1
ymax = 1
nx = 10
ny = 10
[]
[]
[Problem]
nl_sys_names = 'nl0 adjoint'
[]
[Variables]
[u]
[]
[u_adjoint]
nl_sys = adjoint
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[src]
type = BodyForce
variable = u
value = 1
[]
[src_adjoint]
type = BodyForce
variable = u_adjoint
value = 10
[]
[]
[BCs]
[dirichlet]
type = DirichletBC
variable = u
boundary = 'top right'
value = 1
[]
[neumann]
type = NeumannBC
variable = u
boundary = 'left bottom'
value = 1
[]
[]
[Executioner]
type = SteadyAndAdjoint
forward_system = nl0
adjoint_system = adjoint
nl_rel_tol = 1e-12
l_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(modules/solid_mechanics/examples/wave_propagation/cantilever_sweep.i)
# Frequency Response function for cantilever beam:
# Analytic results: 509Hz and 763Hz
# Simulation results with coarse mesh: 600Hz and 800Hz
[Mesh]
type = GeneratedMesh
elem_type = HEX8
dim = 3
xmin=0
xmax=1
nx=10
ymin=0
ymax=0.1
ny = 1
zmin=0
zmax=0.15
nz = 2
[]
[GlobalParams]
order = FIRST
family = LAGRANGE
displacements = 'disp_x disp_y disp_z'
[]
[Problem]
type = ReferenceResidualProblem
reference_vector = 'ref'
extra_tag_vectors = 'ref'
group_variables = 'disp_x disp_y disp_z'
[]
[Physics]
[SolidMechanics]
[QuasiStatic]
[all]
strain = SMALL
add_variables = true
new_system = true
formulation = TOTAL
[]
[]
[]
[]
[Kernels]
#reaction terms
[reaction_realx]
type = Reaction
variable = disp_x
rate = 0# filled by controller
extra_vector_tags = 'ref'
[]
[reaction_realy]
type = Reaction
variable = disp_y
rate = 0# filled by controller
extra_vector_tags = 'ref'
[]
[reaction_realz]
type = Reaction
variable = disp_z
rate = 0# filled by controller
extra_vector_tags = 'ref'
[]
[]
[AuxVariables]
[disp_mag]
[]
[]
[AuxKernels]
[disp_mag]
type = ParsedAux
variable = disp_mag
coupled_variables = 'disp_x disp_y disp_z'
expression = 'sqrt(disp_x^2+disp_y^2+disp_z^2)'
[]
[]
[BCs]
#Left
[disp_x_left]
type = DirichletBC
variable = disp_x
boundary = 'left'
value = 0.0
[]
[disp_y_left]
type = DirichletBC
variable = disp_y
boundary = 'left'
value = 0.0
[]
[disp_z_left]
type = DirichletBC
variable = disp_z
boundary = 'left'
value = 0.0
[]
#Right
[BC_right_yreal]
type = NeumannBC
variable = disp_y
boundary = 'right'
value = 1000
[]
[BC_right_zreal]
type = NeumannBC
variable = disp_z
boundary = 'right'
value = 1000
[]
[]
[Materials]
[elastic_tensor_Al]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 68e9
poissons_ratio = 0.36
[]
[compute_stress]
type = ComputeLagrangianLinearElasticStress
[]
[]
[Postprocessors]
[dispMag]
type = NodalExtremeValue
value_type = max
variable = disp_mag
[]
[]
[Functions]
[./freq2]
type = ParsedFunction
symbol_names = density
symbol_values = 2.7e3 #Al kg/m3
expression = '-t*t*density'
[../]
[]
[Controls]
[./func_control]
type = RealFunctionControl
parameter = 'Kernels/*/rate'
function = 'freq2'
execute_on = 'initial timestep_begin'
[../]
[]
[Executioner]
type = Transient
solve_type=LINEAR
petsc_options_iname = ' -pc_type'
petsc_options_value = 'lu'
start_time = 300 #starting frequency
end_time = 1200 #ending frequency
nl_abs_tol = 1e-6
[TimeStepper]
type = ConstantDT
dt = 50 #frequency stepsize
[]
[]
[Outputs]
csv=true
exodus=false
console = false
[]
(test/tests/materials/material/coupled_material_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 10
ny = 10
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = MatDiffusionTest
variable = u
prop_name = mp1
[../]
[./conv]
type = MatConvection
variable = u
x = 1
y = 0
mat_prop = some_prop
[../]
[]
[BCs]
[./right]
type = NeumannBC
variable = u
boundary = 1
value = 1
[../]
[./left]
type = DirichletBC
variable = u
boundary = 3
value = 0
[../]
[]
[Materials]
# order is switched intentionally, so we won't get luck and dep-resolver has to do its job
[./mat2]
type = CoupledMaterial
block = 0
mat_prop = 'some_prop'
coupled_mat_prop = 'mp1'
[../]
[./mat1]
type = GenericConstantMaterial
block = 0
prop_names = 'mp1'
prop_values = '2'
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
file_base = out_coupled
exodus = true
[]
(test/tests/tag/tag_neumann.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 10
construct_side_list_from_node_list = true
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
extra_matrix_tags = 'mat_tag1 mat_tag2'
extra_vector_tags = 'vec_tag1'
[../]
[]
[AuxVariables]
[./tag_variable1]
order = FIRST
family = LAGRANGE
[../]
[./tag_variable2]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxKernels]
[./TagVectorAux1]
type = TagVectorAux
variable = tag_variable1
v = u
vector_tag = vec_tag2
execute_on = timestep_end
[../]
[./TagVectorAux2]
type = TagMatrixAux
variable = tag_variable2
v = u
matrix_tag = mat_tag2
execute_on = timestep_end
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
extra_matrix_tags = 'mat_tag1 mat_tag2'
extra_vector_tags = 'vec_tag1'
[../]
[./right]
type = NeumannBC
variable = u
boundary = right
value = 2
extra_vector_tags = 'vec_tag1 vec_tag2'
[../]
[]
[Problem]
type = TagTestProblem
test_tag_vectors = 'nontime residual vec_tag1 vec_tag2'
test_tag_matrices = 'mat_tag1 mat_tag2'
extra_tag_matrices = 'mat_tag1 mat_tag2'
extra_tag_vectors = 'vec_tag1 vec_tag2'
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
(modules/combined/test/tests/poro_mechanics/terzaghi.i)
# Terzaghi's problem of consolodation of a drained medium
#
# A saturated soil sample sits in a bath of water.
# It is constrained on its sides, and bottom.
# Its sides and bottom are also impermeable.
# Initially it is unstressed.
# A normal stress, q, is applied to the soil's top.
# The soil then slowly compresses as water is squeezed
# out from the sample from its top (the top BC for
# the porepressure is porepressure = 0).
#
# See, for example. Section 2.2 of the online manuscript
# Arnold Verruijt "Theory and Problems of Poroelasticity" Delft University of Technology 2013
# but note that the "sigma" in that paper is the negative
# of the stress in TensorMechanics
#
# Here are the problem's parameters, and their values:
# Soil height. h = 10
# Soil's Lame lambda. la = 2
# Soil's Lame mu, which is also the Soil's shear modulus. mu = 3
# Soil bulk modulus. K = la + 2*mu/3 = 4
# Soil confined compressibility. m = 1/(K + 4mu/3) = 0.125
# Soil bulk compliance. 1/K = 0.25
# Fluid bulk modulus. Kf = 8
# Fluid bulk compliance. 1/Kf = 0.125
# Fluid mobility (soil permeability/fluid viscosity). k = 1.5
# Soil initial porosity. phi0 = 0.1
# Biot coefficient. alpha = 0.6
# Soil initial storativity, which is the reciprocal of the initial Biot modulus. S = phi0/Kf + (alpha - phi0)(1 - alpha)/K = 0.0625
# Consolidation coefficient. c = k/(S + alpha^2 m) = 13.95348837
# Normal stress on top. q = 1
# Initial porepressure, resulting from instantaneous application of q, assuming corresponding instantaneous increase of porepressure (Note that this is calculated by MOOSE: we only need it for the analytical solution). p0 = alpha*m*q/(S + alpha^2 m) = 0.69767442
# Initial vertical displacement (down is positive), resulting from instantaneous application of q (Note this is calculated by MOOSE: we only need it for the analytical solution). uz0 = q*m*h*S/(S + alpha^2 m)
# Final vertical displacement (down in positive) (Note this is calculated by MOOSE: we only need it for the analytical solution). uzinf = q*m*h
#
# The solution for porepressure is
# P = 4*p0/\pi \sum_{k=1}^{\infty} \frac{(-1)^{k-1}}{2k-1} \cos ((2k-1)\pi z/(2h)) \exp(-(2k-1)^2 \pi^2 ct/(4 h^2))
# This series converges very slowly for ct/h^2 small, so in that domain
# P = p0 erf( (1-(z/h))/(2 \sqrt(ct/h^2)) )
#
# The degree of consolidation is defined as
# U = (uz - uz0)/(uzinf - uz0)
# where uz0 and uzinf are defined above, and
# uz = the vertical displacement of the top (down is positive)
# U = 1 - (8/\pi^2)\sum_{k=1}^{\infty} \frac{1}{(2k-1)^2} \exp(-(2k-1)^2 \pi^2 ct/(4 h^2))
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 10
xmin = -1
xmax = 1
ymin = -1
ymax = 1
zmin = 0
zmax = 10
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
porepressure = porepressure
block = 0
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[./disp_z]
[../]
[./porepressure]
[../]
[]
[BCs]
[./confinex]
type = DirichletBC
variable = disp_x
value = 0
boundary = 'left right'
[../]
[./confiney]
type = DirichletBC
variable = disp_y
value = 0
boundary = 'bottom top'
[../]
[./basefixed]
type = DirichletBC
variable = disp_z
value = 0
boundary = back
[../]
[./topdrained]
type = DirichletBC
variable = porepressure
value = 0
boundary = front
[../]
[./topload]
type = NeumannBC
variable = disp_z
value = -1
boundary = front
[../]
[]
[Kernels]
[./grad_stress_x]
type = StressDivergenceTensors
variable = disp_x
component = 0
[../]
[./grad_stress_y]
type = StressDivergenceTensors
variable = disp_y
component = 1
[../]
[./grad_stress_z]
type = StressDivergenceTensors
variable = disp_z
component = 2
[../]
[./poro_x]
type = PoroMechanicsCoupling
variable = disp_x
component = 0
[../]
[./poro_y]
type = PoroMechanicsCoupling
variable = disp_y
component = 1
[../]
[./poro_z]
type = PoroMechanicsCoupling
variable = disp_z
component = 2
[../]
[./poro_timederiv]
type = PoroFullSatTimeDerivative
variable = porepressure
[../]
[./darcy_flow]
type = CoefDiffusion
variable = porepressure
coef = 1.5
[../]
[]
[Materials]
[./elasticity_tensor]
type = ComputeElasticityTensor
C_ijkl = '2 3'
# bulk modulus is lambda + 2*mu/3 = 2 + 2*3/3 = 4
fill_method = symmetric_isotropic
[../]
[./strain]
type = ComputeSmallStrain
displacements = 'disp_x disp_y disp_z'
[../]
[./stress]
type = ComputeLinearElasticStress
[../]
[./poro_material]
type = PoroFullSatMaterial
porosity0 = 0.1
biot_coefficient = 0.6
solid_bulk_compliance = 0.25
fluid_bulk_compliance = 0.125
constant_porosity = true
[../]
[]
[Postprocessors]
[./p0]
type = PointValue
outputs = csv
point = '0 0 0'
variable = porepressure
[../]
[./p1]
type = PointValue
outputs = csv
point = '0 0 1'
variable = porepressure
[../]
[./p2]
type = PointValue
outputs = csv
point = '0 0 2'
variable = porepressure
[../]
[./p3]
type = PointValue
outputs = csv
point = '0 0 3'
variable = porepressure
[../]
[./p4]
type = PointValue
outputs = csv
point = '0 0 4'
variable = porepressure
[../]
[./p5]
type = PointValue
outputs = csv
point = '0 0 5'
variable = porepressure
[../]
[./p6]
type = PointValue
outputs = csv
point = '0 0 6'
variable = porepressure
[../]
[./p7]
type = PointValue
outputs = csv
point = '0 0 7'
variable = porepressure
[../]
[./p8]
type = PointValue
outputs = csv
point = '0 0 8'
variable = porepressure
[../]
[./p9]
type = PointValue
outputs = csv
point = '0 0 9'
variable = porepressure
[../]
[./p99]
type = PointValue
outputs = csv
point = '0 0 10'
variable = porepressure
[../]
[./zdisp]
type = PointValue
outputs = csv
point = '0 0 10'
variable = disp_z
[../]
[./dt]
type = FunctionValuePostprocessor
outputs = console
function = if(0.5*t<0.1,0.5*t,0.1)
[../]
[]
[Preconditioning]
[./andy]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -snes_atol -snes_rtol -snes_max_it'
petsc_options_value = 'bcgs bjacobi 1E-14 1E-10 10000'
[../]
[]
[Executioner]
type = Transient
solve_type = Newton
start_time = 0
end_time = 10
[./TimeStepper]
type = PostprocessorDT
postprocessor = dt
dt = 0.0001
[../]
[]
[Outputs]
execute_on = 'timestep_end'
file_base = terzaghi
[./csv]
type = CSV
[../]
[]
(modules/stochastic_tools/test/tests/controls/libtorch_drl_control/libtorch_drl_control.i)
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
xmin = 0.0
xmax = 7.0
nx = 20
[]
[]
[Variables]
[temp]
initial_condition = 300
[]
[]
[Kernels]
[time]
type = CoefTimeDerivative
variable = temp
Coefficient = '${fparse 1.00630182*1.225}'
[]
[heat_conduc]
type = MatDiffusion
variable = temp
diffusivity = 'k'
[]
[]
[BCs]
[left_flux]
type = NeumannBC
value = 0.0
boundary = 'left'
variable = temp
[]
[dirichlet]
type = FunctionDirichletBC
function = temp_env
variable = temp
boundary = 'right'
[]
[]
[Functions]
[temp_env]
type = ParsedFunction
value = '15.0*sin(t/86400.0 *pi) + 273.0'
[]
[]
[Materials]
[constant]
type = GenericConstantMaterial
prop_names = 'k'
prop_values = 26.53832364
[]
[]
[Postprocessors]
[center_temp]
type = PointValue
variable = temp
point = '3.5 0.0 0.0'
execute_on = 'INITIAL TIMESTEP_BEGIN'
[]
[center_temp_tend]
type = PointValue
variable = temp
point = '3.5 0.0 0.0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[env_temp]
type = FunctionValuePostprocessor
function = temp_env
execute_on = 'INITIAL TIMESTEP_BEGIN'
[]
[left_flux]
type = LibtorchControlValuePostprocessor
control_name = src_control
execute_on = 'INITIAL TIMESTEP_END'
[]
[log_prob_left_flux]
type = LibtorchDRLLogProbabilityPostprocessor
control_name = src_control
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Controls]
inactive = src_control_empty
[src_control]
seed = 11
type = LibtorchDRLControl
parameters = "BCs/left_flux/value"
responses = 'center_temp env_temp'
input_timesteps = 2
response_scaling_factors = '0.03 0.03'
response_shift_factors = '270 270'
action_standard_deviations = '0.1'
action_scaling_factors = 200
filename = 'mynet_control.net'
torch_script_format = false
num_neurons_per_layer = '16 6'
activation_function = 'relu'
execute_on = 'TIMESTEP_BEGIN'
[]
[src_control_empty]
type = LibtorchDRLControl
parameters = "BCs/left_flux/value"
responses = 'center_temp env_temp'
input_timesteps = 2
response_scaling_factors = '0.03 0.03'
response_shift_factors = '270 270'
action_standard_deviations = '0.1'
action_scaling_factors = 100
execute_on = 'TIMESTEP_BEGIN'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
line_search = 'none'
nl_rel_tol = 1e-8
start_time = 0.0
end_time = 18000
dt = 1800.0
[]
[Outputs]
csv = true
[]
(modules/solid_mechanics/test/tests/lagrangian/centrosymmetric_spherical/total/analytical/small.i)
# This test aims to verify the implementation by comparing the numerical solution
# to the analytical solution. The analytical solution for a hollow sphere is used in
# this test. Given inner pressure p = 100, inner radius a = 2, outer radius b = 4,
# the stress and displacements at the middle of the cylinder
# (r = 3) should be
# sigma_rr = -19.57
# sigma_tt = sigma_pp = 31.22
# u_r = 0.08492
# The numerical approximation yields
# sigma_rr = -19.92
# sigma_tt = sigma_pp = 31.39
# u_r = 0.08492
[GlobalParams]
displacements = 'disp_r'
large_kinematics = false
[]
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
xmin = 2
xmax = 4
nx = 100
[]
[]
[Problem]
coord_type = RSPHERICAL
[]
[Variables]
[disp_r]
[]
[]
[Kernels]
[sdr]
type = TotalLagrangianStressDivergenceCentrosymmetricSpherical
variable = disp_r
component = 0
[]
[]
[BCs]
[inner]
type = NeumannBC
variable = disp_r
boundary = left
value = 100
[]
[]
[Materials]
[elastic_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1000.0
poissons_ratio = 0.25
[]
[compute_stress]
type = ComputeLagrangianLinearElasticStress
output_properties = 'cauchy_stress'
outputs = 'exodus'
[]
[compute_strain]
type = ComputeLagrangianStrainCentrosymmetricSpherical
[]
[]
[Postprocessors]
[u_r]
type = PointValue
variable = disp_r
point = '3 0 0'
[]
[sigma_rr]
type = PointValue
variable = cauchy_stress_00
point = '3 0 0'
[]
[sigma_tt]
type = PointValue
variable = cauchy_stress_11
point = '3 0 0'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
automatic_scaling = true
nl_abs_tol = 1e-10
nl_rel_tol = 1e-10
num_steps = 1
[]
[Outputs]
exodus = true
[]
(modules/optimization/test/tests/optimizationreporter/constant_heat_source/adjoint.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmax = 2
ymax = 2
[]
[Variables]
[adjoint_T]
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = adjoint_T
diffusivity = thermal_conductivity
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = adjoint_T
x_coord_name = misfit/measurement_xcoord
y_coord_name = misfit/measurement_ycoord
z_coord_name = misfit/measurement_zcoord
value_name = misfit/misfit_values
[]
[]
[Reporters]
[misfit]
type = OptimizationData
[]
[params]
type = ConstantReporter
real_vector_names = 'q'
real_vector_values = '0' # Dummy value
[]
[]
[BCs]
[left]
type = NeumannBC
variable = adjoint_T
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = adjoint_T
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = adjoint_T
boundary = bottom
value = 0
[]
[top]
type = DirichletBC
variable = adjoint_T
boundary = top
value = 0
[]
[]
[Materials]
[steel]
type = GenericConstantMaterial
prop_names = thermal_conductivity
prop_values = 5
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
nl_abs_tol = 1e-8
nl_rel_tol = 1e-8
petsc_options_iname = '-ksp_type -pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'preonly lu superlu_dist'
[]
[Functions]
[volumetric_heat_func]
type = ParsedOptimizationFunction
expression = q
param_symbol_names = 'q'
param_vector_name = 'params/q'
[]
[]
[VectorPostprocessors]
[gradient_vpp]
type = ElementOptimizationSourceFunctionInnerProduct
variable = adjoint_T
function = volumetric_heat_func
[]
[]
[Outputs]
console = false
file_base = 'adjoint'
[]
(modules/solid_mechanics/test/tests/visco/gen_kv_creep.i)
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 1
elem_type = HEX8
displacements = 'disp_x disp_y disp_z'
[]
[Variables]
[./disp_x]
order = FIRST
family = LAGRANGE
[../]
[./disp_y]
order = FIRST
family = LAGRANGE
[../]
[./disp_z]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./stress_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./creep_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[SolidMechanics]
displacements = 'disp_x disp_y disp_z'
use_displaced_mesh = true
[../]
[]
[AuxKernels]
[./stress_xx]
type = RankTwoAux
variable = stress_xx
rank_two_tensor = stress
index_j = 0
index_i = 0
execute_on = timestep_end
[../]
[./strain_xx]
type = RankTwoAux
variable = strain_xx
rank_two_tensor = total_strain
index_j = 0
index_i = 0
execute_on = timestep_end
[../]
[./creep_strain_xx]
type = RankTwoAux
variable = creep_strain_xx
rank_two_tensor = creep_strain
index_j = 0
index_i = 0
execute_on = timestep_end
[../]
[]
[BCs]
[./symmy]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0
[../]
[./symmx]
type = DirichletBC
variable = disp_x
boundary = left
value = 0
[../]
[./symmz]
type = DirichletBC
variable = disp_z
boundary = back
value = 0
[../]
[./axial_load]
type = NeumannBC
variable = disp_x
boundary = right
value = 10e6
[../]
[]
[Materials]
[./kelvin_voigt]
type = GeneralizedKelvinVoigtModel
creep_modulus = '10e9 10e9'
creep_viscosity = '1 10'
poisson_ratio = 0.2
young_modulus = 10e9
[../]
[./stress]
type = ComputeMultipleInelasticStress
inelastic_models = 'creep'
[../]
[./creep]
type = LinearViscoelasticStressUpdate
[../]
[./strain]
type = ComputeIncrementalSmallStrain
displacements = 'disp_x disp_y disp_z'
[../]
[]
[UserObjects]
[./update]
type = LinearViscoelasticityManager
viscoelastic_model = kelvin_voigt
[../]
[]
[Postprocessors]
[./stress_xx]
type = ElementAverageValue
variable = stress_xx
block = 'ANY_BLOCK_ID 0'
[../]
[./strain_xx]
type = ElementAverageValue
variable = strain_xx
block = 'ANY_BLOCK_ID 0'
[../]
[./creep_strain_xx]
type = ElementAverageValue
variable = creep_strain_xx
block = 'ANY_BLOCK_ID 0'
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
l_max_its = 100
l_tol = 1e-8
nl_max_its = 50
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
dtmin = 0.01
end_time = 100
[./TimeStepper]
type = LogConstantDT
first_dt = 0.1
log_dt = 0.1
[../]
[]
[Outputs]
file_base = gen_kv_creep_out
exodus = true
[]
(test/tests/time_steppers/iteration_adaptive/adapt_tstep_shrink_init_dt_restart.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 50
ny = 2
xmax = 5
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./dt]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 10
[../]
[./right]
type = NeumannBC
variable = u
boundary = right
value = -1
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
dtmin = 1.0
end_time = 25.0
[./TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 1
linear_iteration_ratio = 1
dt = 2.0
[../]
[]
[Postprocessors]
[./_dt]
type = TimestepSize
[../]
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
[Problem]
restart_file_base = adapt_tstep_shrink_init_dt_out_cp/LATEST
[]
(test/tests/time_steppers/iteration_adaptive/piecewise_linear.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 50
ny = 2
xmax = 5
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Functions]
[./temp_spike]
type = PiecewiseLinear
x = '0 1 1.1 1.2 2'
y = '1 1 2 1 1'
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./dt]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = FunctionDirichletBC
variable = u
boundary = left
function = temp_spike
[../]
[./right]
type = NeumannBC
variable = u
boundary = right
value = -1
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
start_time = 0.0
end_time = 2.0
verbose = true
[./TimeStepper]
type = IterationAdaptiveDT
dt = 0.9
optimal_iterations = 10
timestep_limiting_function = temp_spike
max_function_change = 0.5
[../]
[]
[Postprocessors]
[./dt]
type = TimestepSize
[../]
[]
[Outputs]
csv = true
[]
(test/tests/time_steppers/iteration_adaptive/multi_piecewise_linear.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 50
ny = 2
xmax = 5
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Functions]
[./temp_spike1]
type = PiecewiseLinear
x = '1 3 5'
y = '1 4 4'
[../]
[./temp_spike2]
type = PiecewiseLinear
x = '0 2 4'
y = '1 1 2'
[../]
[temp_spike]
type = ParsedFunction
expression = 'temp_spike1 + temp_spike2'
symbol_names = 'temp_spike1 temp_spike2'
symbol_values = 'temp_spike1 temp_spike2'
[]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./dt]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = FunctionDirichletBC
variable = u
boundary = left
function = temp_spike
[../]
[./right]
type = NeumannBC
variable = u
boundary = right
value = -1
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
start_time = 0
end_time = 5
verbose = true
[./TimeStepper]
type = IterationAdaptiveDT
dt = 10
optimal_iterations = 10
timestep_limiting_function = 'temp_spike1 temp_spike2'
[../]
[]
[Postprocessors]
[./dt]
type = TimestepSize
[../]
[]
[Outputs]
csv = true
[]
(test/tests/userobjects/side_uo_with_lowerd_use/side-uo-with-lower-d-use.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 2
ymin = 0
ymax = 2
nx = 2
ny = 2
subdomain_ids = '1 2 3 4'
[]
[1to2]
type = SideSetsBetweenSubdomainsGenerator
input = gmg
primary_block = '1'
paired_block = '2'
new_boundary = 'onetwo'
[]
[2to1]
type = SideSetsBetweenSubdomainsGenerator
input = 1to2
primary_block = '2'
paired_block = '1'
new_boundary = 'twoone'
[]
[1to3]
type = SideSetsBetweenSubdomainsGenerator
input = 2to1
primary_block = '1'
paired_block = '3'
new_boundary = 'onethree'
[]
[3to1]
type = SideSetsBetweenSubdomainsGenerator
input = 1to3
primary_block = '3'
paired_block = '1'
new_boundary = 'threeone'
[]
build_all_side_lowerd_mesh = true
[]
[Variables]
[u]
order = THIRD
family = MONOMIAL
block = '1 2 3 4'
[]
[lambda]
order = CONSTANT
family = MONOMIAL
block = INTERNAL_SIDE_LOWERD_SUBDOMAIN
[]
[]
[Kernels]
[diff]
type = MatDiffusion
variable = u
diffusivity = '1'
block = '1 2 3 4'
[]
[reaction]
type = Reaction
variable = u
rate = '1'
block = '1 2 3 4'
[]
[source]
type = BodyForce
variable = u
value = '1'
block = '1 2 3 4'
[]
[]
[DGKernels]
[surface]
type = HFEMDiffusion
variable = u
lowerd_variable = lambda
[]
[]
[BCs]
[all]
type = NeumannBC
boundary = 'left right top bottom'
variable = u
[]
[]
[UserObjects]
[onetwo_uo]
type = LowerDIntegralSideUserObject
boundary = onetwo
lowerd_variable = lambda
[]
[twoone_uo]
type = LowerDIntegralSideUserObject
boundary = twoone
lowerd_variable = lambda
[]
[onethree_uo]
type = LowerDIntegralSideUserObject
boundary = onethree
lowerd_variable = lambda
[]
[threeone_uo]
type = LowerDIntegralSideUserObject
boundary = threeone
lowerd_variable = lambda
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu basic mumps'
[]
(python/pyhit/tests/input.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
xmax = 3
[]
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[]
[BCs]
[left]
type = ADDirichletBC
variable = u
boundary = left
value = 300
[]
[right]
type = ADNeumannBC
variable = u
boundary = right
value = 100
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
csv = true
[]
(test/tests/executioners/fixed_point/2d_diffusion_fixed_point_toggle.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 4
xmin = -1
xmax = 1
ymin = -1
ymax = 1
[]
[Variables]
[u]
order = FIRST
family = LAGRANGE
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[pseudo_time]
type = CoupledForceLagged
variable = u
coefficient = 0.1
v = u
tag = 'previous'
[]
[pseudo_time_compensation]
type = CoefReaction
variable = u
coefficient = 0.1
[]
[]
[BCs]
[left]
type = VacuumBC
variable = u
boundary = left
[]
[right]
type = NeumannBC
variable = u
boundary = right
value = 1
[]
[]
[Postprocessors]
[unorm]
type = ElementL2Norm
variable = u
[]
[udiff]
type = ElementL2Diff
variable = u
tag = 'previous'
[]
[]
[Problem]
type = FixedPointProblem
fp_tag_name = 'previous'
tagged_vector_for_partial_residual = false
[]
[Executioner]
type = FixedPointSteady
nl_rel_tol = 1e-2
nl_abs_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(modules/optimization/test/tests/outputs/exodus_optimization_steady/adjoint_iteration_output.i)
[Mesh]
[]
[Variables]
[adjointVar]
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = adjointVar
diffusivity = thermal_conductivity
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = adjointVar
x_coord_name = misfit/measurement_xcoord
y_coord_name = misfit/measurement_ycoord
z_coord_name = misfit/measurement_zcoord
value_name = misfit/misfit_values
[]
[]
[Reporters]
[misfit]
type = OptimizationData
[]
[params]
type = ConstantReporter
real_vector_names = 'p1'
real_vector_values = '0' # Dummy value
[]
[]
[AuxVariables]
[temperature_forward]
[]
[]
[BCs]
[left]
type = NeumannBC
variable = adjointVar
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = adjointVar
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = adjointVar
boundary = bottom
value = 0
[]
[top]
type = DirichletBC
variable = adjointVar
boundary = top
value = 0
[]
[]
[Functions]
[thermo_conduct]
type = ParsedOptimizationFunction
expression = 'alpha'
param_symbol_names = 'alpha'
param_vector_name = 'params/p1'
[]
[]
[Materials]
[thermalProp]
type = GenericFunctionMaterial
prop_names = 'thermal_conductivity'
prop_values = 'thermo_conduct'
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
nl_abs_tol = 1e-8
nl_rel_tol = 1e-8
petsc_options_iname = '-ksp_type -pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'preonly lu superlu_dist'
[]
[VectorPostprocessors]
[adjoint_grad]
type = ElementOptimizationDiffusionCoefFunctionInnerProduct
variable = adjointVar
forward_variable = temperature_forward
function = thermo_conduct
[]
[]
[Outputs]
console = false
file_base = 'adjoint'
[exodus]
type = ExodusOptimizationSteady
execute_on = 'TIMESTEP_END'
[]
[]
(test/tests/bcs/ad_1d_neumann/from_cubit.i)
[Mesh]
file = 1d_line.e
construct_side_list_from_node_list = true
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[./right]
type = ADNeumannBC
variable = u
boundary = 2
value = 2
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
(modules/solid_mechanics/test/tests/lagrangian/cartesian/total/stabilization/cook_large.i)
[GlobalParams]
displacements = 'disp_x disp_y'
large_kinematics = true
stabilize_strain = true
[]
[Mesh]
type = FileMesh
file = cook_mesh.exo
dim = 2
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[Kernels]
[sdx]
type = TotalLagrangianStressDivergence
variable = disp_x
component = 0
[]
[sdy]
type = TotalLagrangianStressDivergence
variable = disp_y
component = 1
[]
[]
[AuxVariables]
[strain_xx]
order = CONSTANT
family = MONOMIAL
[]
[strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[strain_zz]
order = CONSTANT
family = MONOMIAL
[]
[strain_xy]
order = CONSTANT
family = MONOMIAL
[]
[strain_xz]
order = CONSTANT
family = MONOMIAL
[]
[strain_yz]
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_xz]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[stress_xx]
type = RankTwoAux
rank_two_tensor = pk1_stress
variable = stress_xx
index_i = 0
index_j = 0
execute_on = timestep_end
[]
[stress_yy]
type = RankTwoAux
rank_two_tensor = pk1_stress
variable = stress_yy
index_i = 1
index_j = 1
execute_on = timestep_end
[]
[stress_zz]
type = RankTwoAux
rank_two_tensor = pk1_stress
variable = stress_zz
index_i = 2
index_j = 2
execute_on = timestep_end
[]
[stress_xy]
type = RankTwoAux
rank_two_tensor = pk1_stress
variable = stress_xy
index_i = 0
index_j = 1
execute_on = timestep_end
[]
[stress_xz]
type = RankTwoAux
rank_two_tensor = pk1_stress
variable = stress_xz
index_i = 0
index_j = 2
execute_on = timestep_end
[]
[stress_yz]
type = RankTwoAux
rank_two_tensor = pk1_stress
variable = stress_yz
index_i = 1
index_j = 2
execute_on = timestep_end
[]
[strain_xx]
type = RankTwoAux
rank_two_tensor = mechanical_strain
variable = strain_xx
index_i = 0
index_j = 0
execute_on = timestep_end
[]
[strain_yy]
type = RankTwoAux
rank_two_tensor = mechanical_strain
variable = strain_yy
index_i = 1
index_j = 1
execute_on = timestep_end
[]
[strain_zz]
type = RankTwoAux
rank_two_tensor = mechanical_strain
variable = strain_zz
index_i = 2
index_j = 2
execute_on = timestep_end
[]
[strain_xy]
type = RankTwoAux
rank_two_tensor = mechanical_strain
variable = strain_xy
index_i = 0
index_j = 1
execute_on = timestep_end
[]
[strain_xz]
type = RankTwoAux
rank_two_tensor = mechanical_strain
variable = strain_xz
index_i = 0
index_j = 2
execute_on = timestep_end
[]
[strain_yz]
type = RankTwoAux
rank_two_tensor = mechanical_strain
variable = strain_yz
index_i = 1
index_j = 2
execute_on = timestep_end
[]
[]
[BCs]
[fixed_x]
type = DirichletBC
preset = true
variable = disp_x
boundary = canti
value = 0.0
[]
[fixed_y]
type = DirichletBC
preset = true
variable = disp_y
boundary = canti
value = 0.0
[]
[pull]
type = NeumannBC
variable = disp_y
boundary = loading
value = 0.1
[]
[]
[Materials]
[compute_stress]
type = ComputeNeoHookeanStress
lambda = 416666611.0991259
mu = 8300.33333888888926
[]
[compute_strain]
type = ComputeLagrangianStrain
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'newton'
line_search = 'none'
petsc_options_iname = -pc_type
petsc_options_value = lu
nl_max_its = 500
nl_abs_tol = 1e-5
nl_rel_tol = 1e-6
[]
[Postprocessors]
[value]
type = PointValue
variable = disp_y
point = '48 60 0'
use_displaced_mesh = false
[]
[]
[Outputs]
exodus = false
csv = true
[]
(test/tests/bcs/1d_neumann/from_cubit.i)
[Mesh]
file = 1d_line.e
construct_side_list_from_node_list = true
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[./right]
type = NeumannBC
variable = u
boundary = 2
value = 2
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
(test/tests/materials/material/mat_cyclic_coupling.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 10
ny = 10
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = MatDiffusionTest
variable = u
prop_name = some_prop
[../]
[./conv]
type = MatConvection
variable = u
x = 1
y = 0
mat_prop = some_other_prop
[../]
[]
[BCs]
[./right]
type = NeumannBC
variable = u
boundary = 1
value = 1
[../]
[./left]
type = DirichletBC
variable = u
boundary = 3
value = 0
[../]
[]
[Materials]
# order is switched intentionally, so we won't get lucky and dep-resolver has to do its job
[./mat2]
type = CoupledMaterial
block = 0
mat_prop = 'some_prop'
coupled_mat_prop = 'some_other_prop'
[../]
[./mat1]
type = CoupledMaterial
block = 0
mat_prop = 'some_other_prop'
coupled_mat_prop = 'some_prop'
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
file_base = out_coupled
exodus = true
[]
(modules/optimization/test/tests/optimizationreporter/material/adjoint_explicit.i)
[Mesh]
[]
[Variables]
[adjoint_var]
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = adjoint_var
diffusivity = thermal_conductivity
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = adjoint_var
x_coord_name = misfit/measurement_xcoord
y_coord_name = misfit/measurement_ycoord
z_coord_name = misfit/measurement_zcoord
value_name = misfit/misfit_values
[]
[]
[Reporters]
[misfit]
type = OptimizationData
[]
[]
[AuxVariables]
[temperature_forward]
[]
[grad_Tx]
order = CONSTANT
family = MONOMIAL
[]
[grad_Ty]
order = CONSTANT
family = MONOMIAL
[]
[grad_Tz]
order = CONSTANT
family = MONOMIAL
[]
[grad_Tfx]
order = CONSTANT
family = MONOMIAL
[]
[grad_Tfy]
order = CONSTANT
family = MONOMIAL
[]
[grad_Tfz]
order = CONSTANT
family = MONOMIAL
[]
[negative_gradient]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[grad_Tx]
type = VariableGradientComponent
component = x
variable = grad_Tx
gradient_variable = adjoint_var
[]
[grad_Ty]
type = VariableGradientComponent
component = y
variable = grad_Ty
gradient_variable = adjoint_var
[]
[grad_Tz]
type = VariableGradientComponent
component = z
variable = grad_Tz
gradient_variable = adjoint_var
[]
[grad_Tfx]
type = VariableGradientComponent
component = x
variable = grad_Tfx
gradient_variable = temperature_forward
[]
[grad_Tfy]
type = VariableGradientComponent
component = y
variable = grad_Tfy
gradient_variable = temperature_forward
[]
[grad_Tfz]
type = VariableGradientComponent
component = z
variable = grad_Tfz
gradient_variable = temperature_forward
[]
[negative_gradient]
type = ParsedAux
variable = negative_gradient
args = 'grad_Tx grad_Ty grad_Tz grad_Tfx grad_Tfy grad_Tfz'
function = '-(grad_Tx*grad_Tfx+grad_Ty*grad_Tfy+grad_Tz*grad_Tfz)'
[]
[]
[BCs]
[left]
type = NeumannBC
variable = adjoint_var
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = adjoint_var
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = adjoint_var
boundary = bottom
value = 0
[]
[top]
type = DirichletBC
variable = adjoint_var
boundary = top
value = 0
[]
[]
[Functions]
[thermo_conduct]
type = ParsedFunction
value = alpha
vars = 'alpha'
vals = 'p1'
[]
[]
[Materials]
[thermalProp]
type = GenericFunctionMaterial
prop_names = 'thermal_conductivity'
prop_values = 'thermo_conduct'
[]
[thermalPropDeriv]
type = GenericFunctionMaterial
prop_names = 'thermal_conductivity_deriv'
prop_values = '1'
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
nl_abs_tol = 1e-8
nl_rel_tol = 1e-8
petsc_options_iname = '-ksp_type -pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'preonly lu superlu_dist'
[]
[Postprocessors]
[pp_adjoint_grad_parsedFunc]
type = ElementIntegralVariablePostprocessor
variable = negative_gradient
execute_on = 'initial linear'
[]
[p1]
type = ConstantValuePostprocessor
value = 10
execute_on = 'initial linear'
[]
[]
[Controls]
[parameterReceiver]
type = ControlsReceiver
[]
[]
[VectorPostprocessors]
[adjoint_grad]
type = VectorOfPostprocessors
postprocessors = 'pp_adjoint_grad_parsedFunc'
[]
[]
[Outputs]
console = false
file_base = 'adjoint'
[]
(test/tests/kernels/vector_fe/coupled_vector_gradient.i)
# This example demonstrates ability to set Dirichlet boundary conditions for LAGRANGE_VEC variables
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
family = LAGRANGE_VEC
order = FIRST
[../]
[./v]
family = LAGRANGE_VEC
order = FIRST
[../]
[./w]
family = LAGRANGE_VEC
order = FIRST
[../]
[./s]
family = LAGRANGE_VEC
order = FIRST
[../]
[./q]
[../]
[]
[Kernels]
[./u_diff]
type = VectorDiffusion
variable = u
[../]
[./v_diff]
type = VectorDiffusion
variable = v
[../]
[./w_diff]
type = VectorDiffusion
variable = w
[../]
[./s_diff]
type = VectorDiffusion
variable = s
[../]
[./v_coupled_diff]
type = CoupledVectorDiffusion
variable = v
v = u
[../]
[./w_coupled_diff]
type = CoupledVectorDiffusion
variable = w
v = u
state = old
[../]
[./s_coupled_diff]
type = CoupledVectorDiffusion
variable = s
v = u
state = older
[../]
[./q_diff]
type = Diffusion
variable = q
[../]
[]
[BCs]
[./left_u]
type = VectorDirichletBC
variable = u
values = '0 0 0'
boundary = 'left'
[../]
[./left_v]
type = VectorDirichletBC
variable = v
values = '0 0 0'
boundary = 'left'
[../]
[./left_w]
type = VectorDirichletBC
variable = w
values = '0 0 0'
boundary = 'left'
[../]
[./left_s]
type = VectorDirichletBC
variable = s
values = '0 0 0'
boundary = 'left'
[../]
[./right_u]
type = VectorFunctionDirichletBC
variable = u
boundary = 'right'
function_x = 'x_exact'
function_y = 'y_exact'
[../]
[./right_v]
type = VectorFunctionDirichletBC
variable = v
boundary = 'right'
function_x = 'x_exact'
function_y = 'y_exact'
[../]
[./right_w]
type = VectorFunctionDirichletBC
variable = w
boundary = 'right'
function_x = 'x_exact_old'
function_y = 'y_exact_old'
[../]
[./right_s]
type = VectorFunctionDirichletBC
variable = s
boundary = 'right'
function_x = 'x_exact_older'
function_y = 'y_exact_older'
[../]
[./left_q]
type = DirichletBC
variable = q
boundary = 'left'
value = 1
[../]
[./right_q]
type = NeumannBC
variable = q
boundary = 'right'
value = 1
[../]
[]
[Functions]
[./x_exact]
type = ParsedFunction
expression = 't'
[../]
[./y_exact]
type = ParsedFunction
expression = 't'
[../]
[./x_exact_old]
type = ParsedFunction
expression = 'if(t < 1, 0, t - 1)'
[../]
[./y_exact_old]
type = ParsedFunction
expression = 'if(t < 1, 0, t - 1)'
[../]
[./x_exact_older]
type = ParsedFunction
expression = 'if(t < 2, 0, t - 2)'
[../]
[./y_exact_older]
type = ParsedFunction
expression = 'if(t < 2, 0, t - 2)'
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
dt = 1
num_steps = 3
solve_type = 'NEWTON'
petsc_options = '-ksp_converged_reason -snes_converged_reason'
petsc_options_iname = '-ksp_gmres_restart'
petsc_options_value = '100'
nl_max_its = 3
l_max_its = 100
dtmin = 1
[]
[Outputs]
exodus = true
[]
(modules/stochastic_tools/examples/parameter_study/diffusion.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables/T]
initial_condition = 300
[]
[Kernels]
[time]
type = ADTimeDerivative
variable = T
[]
[diff]
type = ADMatDiffusion
variable = T
diffusivity = diffusivity
[]
[source]
type = ADBodyForce
variable = T
value = 100
function = 1
[]
[]
[BCs]
[left]
type = ADDirichletBC
variable = T
boundary = left
value = 300
[]
[right]
type = ADNeumannBC
variable = T
boundary = right
value = -100
[]
[]
[Materials/constant]
type = ADGenericConstantMaterial
prop_names = 'diffusivity'
prop_values = 1
[]
[Executioner]
type = Transient
num_steps = 4
dt = 0.25
[]
[Postprocessors]
[T_avg]
type = ElementAverageValue
variable = T
execute_on = 'initial timestep_end'
[]
[q_left]
type = ADSideDiffusiveFluxAverage
variable = T
boundary = left
diffusivity = diffusivity
execute_on = 'initial timestep_end'
[]
[]
[Controls/stochastic]
type = SamplerReceiver
[]
[Outputs]
[]
(modules/combined/test/tests/optimization/invOpt_mechanics/adjoint.i)
[Mesh]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[Kernels]
[TensorMechanics]
use_displaced_mesh = false
displacements ='disp_x disp_y'
[]
[]
#-----adjoint problem information------------------
[DiracKernels]
[pt]
type = ReporterPointSource
variable = disp_y
x_coord_name = misfit/measurement_xcoord
y_coord_name = misfit/measurement_ycoord
z_coord_name = misfit/measurement_zcoord
value_name = misfit/misfit_values
[]
[]
[Reporters]
[misfit]
type=OptimizationData
[]
[params]
type = ConstantReporter
real_vector_names = 'right_fy_value'
real_vector_values = '0' # Dummy value
[]
[]
[Functions]
[right_fy_func]
type = ParsedOptimizationFunction
expression = 'val'
param_symbol_names = 'val'
param_vector_name = 'params/right_fy_value'
[]
[]
[VectorPostprocessors]
[adjoint_pt]
type = SideOptimizationNeumannFunctionInnerProduct
variable = disp_y
function = right_fy_func
boundary = right
[]
[]
#---------------------------------------------------
[BCs]
[left_ux]
type = DirichletBC
variable = disp_x
boundary = left
value = 0
[]
[left_uy]
type = DirichletBC
variable = disp_y
boundary = left
value = 0
[]
[right_fy]
type = NeumannBC
variable = disp_y
boundary = right
value = 0 #2000
[]
[]
[Materials]
[elasticity]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 10e3
poissons_ratio = 0.3
[]
[strain]
type = ComputeSmallStrain
displacements = 'disp_x disp_y'
[]
[stress]
type = ComputeLinearElasticStress
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
nl_abs_tol = 1e-6
nl_rel_tol = 1e-8
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
csv = false
console = false
exodus = false
file_base = 'adjoint'
[]
(tutorials/darcy_thermo_mech/step10_multiapps/tests/auxkernels/corrosion/corrosion.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
ymax = 0.1
xmax = 0.1
[]
uniform_refine = 0
[]
[Adaptivity]
max_h_level = 3
initial_steps = 5
cycles_per_step = 2
initial_marker = error_marker
marker = error_marker
[Indicators]
[phi_jump]
type = GradientJumpIndicator
variable = phi
[]
[]
[Markers]
[error_marker]
type = ErrorFractionMarker
indicator = phi_jump
refine = 0.9
[]
[]
[]
[Variables]
[temperature]
initial_condition = 300
[]
[]
[AuxVariables]
[phi]
[]
[]
[AuxKernels]
[corrosion]
type = RandomCorrosion
execute_on = 'timestep_end'
variable = phi
reference_temperature = 300
temperature = 301
[]
[]
[Kernels]
[heat_conduction]
type = ADHeatConduction
variable = temperature
[]
[]
[BCs]
[left]
type = PostprocessorDirichletBC
variable = temperature
boundary = left
postprocessor = 301
[]
[right]
type = NeumannBC
variable = temperature
boundary = right
value = 100 # prescribed flux
[]
[]
[Materials]
[column]
type = PackedColumn
temperature = temperature
radius = 1 # mm
phase = phi
outputs = exodus
output_properties = porosity
[]
[]
[Problem]
type = FEProblem
[]
[Postprocessors]
[k_eff]
type = ThermalConductivity
variable = temperature
T_hot = 301
flux = 100
dx = 0.1
boundary = right
length_scale = 1
[]
[]
[Executioner]
type = Transient
num_steps = 5
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
execute_on = 'initial timestep_end'
exodus = true
[console]
type = Console
execute_postprocessors_on = 'timestep_begin timestep_end'
[]
[]
[ICs]
[close_pack]
radius = 0.01
outvalue = 0 # water
variable = phi
invalue = 1 #steel
type = ClosePackIC
[]
[]
(test/tests/time_steppers/iteration_adaptive/adapt_tstep_grow_init_dt.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 50
ny = 2
xmax = 5
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./dt]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 10
[../]
[./right]
type = NeumannBC
variable = u
boundary = right
value = -1
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
start_time = 0.0
end_time = 20.0
n_startup_steps = 2
dtmax = 6.0
[./TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 10
dt = 1.0
[../]
[]
[Postprocessors]
[./_dt]
type = TimestepSize
[../]
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
checkpoint = true
[]
(test/tests/bcs/misc_bcs/vacuum_bc_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
nz = 0
zmin = 0
zmax = 0
elem_type = QUAD4
[]
[Variables]
active = 'u'
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
active = 'diff'
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
active = 'left right top'
[./left]
type = DirichletBC
variable = u
boundary = 3
value = 0.0
[../]
[./right]
type = NeumannBC
variable = u
boundary = 1
value = 2.0
[../]
[./top]
type = VacuumBC
variable = u
boundary = 2
alpha = 5.0
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
exodus = true
[]
(modules/combined/test/tests/thermal_conductivity_temperature_function_test/thermal_conductivity_temperature_function_test.i)
#
# This test evaluates the capability of HeatConductionMaterial to define
# thermal conductivity as a function of temperature. The test uses the patch test
# cube mesh with a flux bc on one side and a temperature bc on the opposite side.
# The temperature bc changes as a function of time from 100 to 200. The thermal
# conductivity is a function of temperature, with k = 1 for temps = 100-199, k = 2
# for temps _>_ 200. The flux, q = 10 is constant. The Transient Executioner is used here
# although the interial kernel is omitted, so this is really a series of two steady-state
# solutions.
#
# ---------------
# | |
# | |
# q -> | k | T2
# | |
# T1 = ? | |
# ---------------
# dx = 1
#
#
# q = -k dT/dx
#
# q = -k (T1 - T2)/dx
#
# T1 = (q/-k)*dx + T2
#
# for: T2 = 100, k = 1, q = -10
#
# T1 = 110
# --------
#
# for: T2 = 200, k = 2, q = -10
#
# T1 = 205
# --------
#
[Mesh]#Comment
file = fe_patch.e
[] # Mesh
[Functions]
[./k_func]
type = PiecewiseLinear
x = '100 199 200'
y = '1 1 2'
[../]
[./c_func]
type = PiecewiseLinear
x = '100 200'
y = '0.116 0.116'
[../]
[./t_func]
type = PiecewiseLinear
x = '0 1 2'
y = '100 100 200'
[../]
[] # Functions
[Variables]
[./temp]
order = FIRST
family = LAGRANGE
initial_condition = 100
[../]
[] # Variables
[Kernels]
[./heat_r]
type = HeatConduction
variable = temp
[../]
[] # Kernels
[BCs]
[./temps_function]
type = FunctionDirichletBC
variable = temp
boundary = 1000
function = t_func
[../]
[./flux_in]
type = NeumannBC
variable = temp
boundary = 100
value = 10
[../]
[] # BCs
[Materials]
[./heat]
type = HeatConductionMaterial
block = 1
temp = temp
thermal_conductivity_temperature_function = k_func
specific_heat_temperature_function = c_func
[../]
[./density]
type = Density
block = 1
density = 0.283
[../]
[] # Materials
[Executioner]
type = Transient
#Preconditioned JFNK (default)
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -ksp_gmres_restart'
petsc_options_value = 'lu 101'
line_search = 'none'
l_max_its = 100
l_tol = 8e-3
nl_max_its = 15
nl_rel_tol = 1e-4
nl_abs_tol = 1e-10
start_time = 0.0
dt = 1
end_time = 2
num_steps = 2
[] # Executioner
[Outputs]
file_base = out
exodus = true
[] # Outputs
(modules/optimization/test/tests/optimizationreporter/material/adjoint.i)
[Mesh]
[]
[Variables]
[adjointVar]
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = adjointVar
diffusivity = thermal_conductivity
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = adjointVar
x_coord_name = misfit/measurement_xcoord
y_coord_name = misfit/measurement_ycoord
z_coord_name = misfit/measurement_zcoord
value_name = misfit/misfit_values
[]
[]
[Reporters]
[misfit]
type = OptimizationData
[]
[params]
type = ConstantReporter
real_vector_names = 'p1'
real_vector_values = '0' # Dummy value
[]
[]
[AuxVariables]
[temperature_forward]
[]
[]
[BCs]
[left]
type = NeumannBC
variable = adjointVar
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = adjointVar
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = adjointVar
boundary = bottom
value = 0
[]
[top]
type = DirichletBC
variable = adjointVar
boundary = top
value = 0
[]
[]
[Functions]
[thermo_conduct]
type = ParsedOptimizationFunction
expression = 'alpha'
param_symbol_names = 'alpha'
param_vector_name = 'params/p1'
[]
[]
[Materials]
[thermalProp]
type = GenericFunctionMaterial
prop_names = 'thermal_conductivity'
prop_values = 'thermo_conduct'
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
nl_abs_tol = 1e-8
nl_rel_tol = 1e-8
petsc_options_iname = '-ksp_type -pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'preonly lu superlu_dist'
[]
[VectorPostprocessors]
[adjoint_grad]
type = ElementOptimizationDiffusionCoefFunctionInnerProduct
variable = adjointVar
forward_variable = temperature_forward
function = thermo_conduct
[]
[]
[Outputs]
console = false
file_base = 'adjoint'
[]
(test/tests/time_steppers/iteration_adaptive/adapt_tstep_grow_init_dt_restart.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 50
ny = 2
xmax = 5
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./dt]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 10
[../]
[./right]
type = NeumannBC
variable = u
boundary = right
value = -1
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 50.0
n_startup_steps = 2
dtmax = 6.0
[./TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 10
dt = 1.0
[../]
[]
[Postprocessors]
[./_dt]
type = TimestepSize
[../]
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
[Problem]
restart_file_base = adapt_tstep_grow_init_dt_out_cp/LATEST
[]
(test/tests/bcs/sideset_from_nodeset/sideset_from_nodeset_test2.i)
[Mesh]
file = cube_no_sidesets2.e
construct_side_list_from_node_list = true
[]
[Variables]
active = 'u'
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
active = 'diff'
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
active = 'left right'
[./left]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[./right]
type = NeumannBC
variable = u
boundary = 3
value = 3
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
file_base = cube_tet_out
exodus = true
[]
(modules/combined/examples/effective_properties/effective_th_cond.i)
# This example calculates the effective thermal conductivity across a microstructure
# with circular second phase precipitates. Two methods are used to calculate the effective thermal conductivity,
# the direct method that applies a temperature to one side and a heat flux to the other,
# and the AEH method.
[Mesh] #Sets mesh size to 10 microns by 10 microns
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 100
ny = 100
xmax = 10
ymax = 10
[]
[new_nodeset]
input = gen
type = ExtraNodesetGenerator
coord = '5 5'
new_boundary = 100
[]
[]
[Variables] #Adds variables needed for two ways of calculating effective thermal cond.
[T] #Temperature used for the direct calculation
initial_condition = 800
[]
[Tx_AEH] #Temperature used for the x-component of the AEH solve
initial_condition = 800
scaling = 1.0e4 #Scales residual to improve convergence
[]
[Ty_AEH] #Temperature used for the y-component of the AEH solve
initial_condition = 800
scaling = 1.0e4 #Scales residual to improve convergence
[]
[]
[AuxVariables] #Creates second constant phase
[phase2]
[]
[]
[ICs] #Sets the IC for the second constant phase
[phase2_IC] #Creates circles with smooth interfaces at random locations
variable = phase2
type = MultiSmoothCircleIC
int_width = 0.3
numbub = 20
bubspac = 1.5
radius = 0.5
outvalue = 0
invalue = 1
block = 0
[]
[]
[Kernels]
[HtCond] #Kernel for direct calculation of thermal cond
type = HeatConduction
variable = T
[]
[heat_x] #All other kernels are for AEH approach to calculate thermal cond.
type = HeatConduction
variable = Tx_AEH
[]
[heat_rhs_x]
type = HomogenizedHeatConduction
variable = Tx_AEH
component = 0
[]
[heat_y]
type = HeatConduction
variable = Ty_AEH
[]
[heat_rhs_y]
type = HomogenizedHeatConduction
variable = Ty_AEH
component = 1
[]
[]
[BCs]
[Periodic]
[all]
auto_direction = 'x y'
variable = 'Tx_AEH Ty_AEH'
[]
[]
[left_T] #Fix temperature on the left side
type = DirichletBC
variable = T
boundary = left
value = 800
[]
[right_flux] #Set heat flux on the right side
type = NeumannBC
variable = T
boundary = right
value = 5e-6
[]
[fix_x] #Fix Tx_AEH at a single point
type = DirichletBC
variable = Tx_AEH
value = 800
boundary = 100
[]
[fix_y] #Fix Ty_AEH at a single point
type = DirichletBC
variable = Ty_AEH
value = 800
boundary = 100
[]
[]
[Materials]
[thcond] #The equation defining the thermal conductivity is defined here, using two ifs
# The k in the bulk is k_b, in the precipitate k_p2, and across the interaface k_int
type = ParsedMaterial
block = 0
constant_names = 'length_scale k_b k_p2 k_int'
constant_expressions = '1e-6 5 1 0.1'
expression = 'sk_b:= length_scale*k_b; sk_p2:= length_scale*k_p2; sk_int:= k_int*length_scale; if(phase2>0.1,if(phase2>0.95,sk_p2,sk_int),sk_b)'
outputs = exodus
f_name = thermal_conductivity
coupled_variables = phase2
[]
[]
[Postprocessors]
[right_T]
type = SideAverageValue
variable = T
boundary = right
[]
[k_x_direct] #Effective thermal conductivity from direct method
# This value is lower than the AEH value because it is impacted by second phase
# on the right boundary
type = ThermalConductivity
variable = T
flux = 5e-6
length_scale = 1e-06
T_hot = 800
dx = 10
boundary = right
[]
[k_x_AEH] #Effective thermal conductivity in x-direction from AEH
type = HomogenizedThermalConductivity
chi = 'Tx_AEH Ty_AEH'
row = 0
col = 0
scale_factor = 1e6 #Scale due to length scale of problem
[]
[k_y_AEH] #Effective thermal conductivity in x-direction from AEH
type = HomogenizedThermalConductivity
chi = 'Tx_AEH Ty_AEH'
row = 1
col = 1
scale_factor = 1e6 #Scale due to length scale of problem
[]
[]
[Preconditioning]
[SMP]
type = SMP
off_diag_row = 'Tx_AEH Ty_AEH'
off_diag_column = 'Ty_AEH Tx_AEH'
[]
[]
[Executioner]
type = Steady
l_max_its = 15
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_tol = 1e-04
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
csv = true
[]
(modules/solid_mechanics/test/tests/visco/visco_small_strain.i)
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 1
elem_type = HEX8
displacements = 'disp_x disp_y disp_z'
[]
[Variables]
[./disp_x]
order = FIRST
family = LAGRANGE
[../]
[./disp_y]
order = FIRST
family = LAGRANGE
[../]
[./disp_z]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./stress_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./creep_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[SolidMechanics]
displacements = 'disp_x disp_y disp_z'
use_displaced_mesh = true
[../]
[]
[AuxKernels]
[./stress_xx]
type = RankTwoAux
variable = stress_xx
rank_two_tensor = stress
index_j = 0
index_i = 0
execute_on = timestep_end
[../]
[./strain_xx]
type = RankTwoAux
variable = strain_xx
rank_two_tensor = total_strain
index_j = 0
index_i = 0
execute_on = timestep_end
[../]
[./creep_strain_xx]
type = RankTwoAux
variable = creep_strain_xx
rank_two_tensor = creep_strain
index_j = 0
index_i = 0
execute_on = timestep_end
[../]
[]
[BCs]
[./symmy]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0
[../]
[./symmx]
type = DirichletBC
variable = disp_x
boundary = left
value = 0
[../]
[./symmz]
type = DirichletBC
variable = disp_z
boundary = back
value = 0
[../]
[./axial_load]
type = NeumannBC
variable = disp_x
boundary = right
value = 10e6
[../]
[]
[Materials]
[./kelvin_voigt]
type = GeneralizedKelvinVoigtModel
creep_modulus = '10e9 10e9'
creep_viscosity = '1 10'
poisson_ratio = 0.2
young_modulus = 10e9
[../]
[./stress]
type = ComputeLinearViscoelasticStress
[../]
[./strain]
type = ComputeSmallStrain
displacements = 'disp_x disp_y disp_z'
[../]
[]
[UserObjects]
[./update]
type = LinearViscoelasticityManager
viscoelastic_model = kelvin_voigt
[../]
[]
[Postprocessors]
[./stress_xx]
type = ElementAverageValue
variable = stress_xx
block = 'ANY_BLOCK_ID 0'
[../]
[./strain_xx]
type = ElementAverageValue
variable = strain_xx
block = 'ANY_BLOCK_ID 0'
[../]
[./creep_strain_xx]
type = ElementAverageValue
variable = creep_strain_xx
block = 'ANY_BLOCK_ID 0'
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
l_max_its = 100
l_tol = 1e-8
nl_max_its = 50
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
dtmin = 0.01
end_time = 100
[./TimeStepper]
type = LogConstantDT
first_dt = 0.1
log_dt = 0.1
[../]
[]
[Outputs]
file_base = visco_small_strain_out
exodus = true
[]
(modules/combined/test/tests/optimization/invOpt_bc_convective/forward.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 20
xmax = 1
ymax = 2
[]
[]
[Variables]
[temperature]
[]
[]
[Kernels]
[heat_conduction]
type = ADHeatConduction
variable = temperature
[]
[]
[BCs]
[left]
type = ConvectiveFluxFunction
variable = temperature
boundary = 'left'
T_infinity = 100.0
coefficient = function1
[]
[right]
type = NeumannBC
variable = temperature
boundary = right
value = -100
[]
[bottom]
type = DirichletBC
variable = temperature
boundary = bottom
value = 500
[]
[top]
type = DirichletBC
variable = temperature
boundary = top
value = 600
[]
[]
[Materials]
[steel]
type = ADGenericConstantMaterial
prop_names = thermal_conductivity
prop_values = 5
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
nl_abs_tol = 1e-6
nl_rel_tol = 1e-8
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Functions]
[function1]
type = ParsedOptimizationFunction
expression = 'a'
param_symbol_names = 'a'
param_vector_name = 'params/vals'
[]
[]
[VectorPostprocessors]
[vertical]
type = LineValueSampler
variable = 'temperature'
start_point = '0.1 0.0 0.0'
end_point = '0.1 2.0 0.0'
num_points = 21
sort_by = id
[]
[]
[Reporters]
[measure_data]
type = OptimizationData
variable = temperature
[]
[params]
type = ConstantReporter
real_vector_names = 'vals'
real_vector_values = '0' # Dummy value
[]
[]
[Outputs]
csv = true
exodus = false
console = false
file_base = 'forward'
[]
(test/tests/kernels/2d_diffusion/matdiffusion.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
xmax = 1.0
ymax = 1.0
elem_type = QUAD4
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./cres]
type = MatDiffusion
variable = u
diffusivity = Du
[../]
[./ctime]
type = TimeDerivative
variable = u
[../]
[]
[Materials]
[./Dc]
type = DerivativeParsedMaterial
property_name = Du
expression = '0.01+u^2'
coupled_variables = 'u'
derivative_order = 1
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[./right]
type = NeumannBC
variable = u
boundary = 2
value = 1
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
scheme = 'BDF2'
dt = 1
num_steps = 2
[]
[Outputs]
exodus = true
[]
(test/tests/auxkernels/time_derivative_second_aux/test.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 3
ny = 2
[]
[Variables]
[u]
[]
[]
[Kernels]
[time]
type = TimeDerivative
variable = u
[]
[reaction]
type = Reaction
variable = u
[]
[diffusion]
type = Diffusion
variable = u
[]
[]
[BCs]
[left]
type = NeumannBC
variable = u
value = 5
boundary = 'left'
[]
[]
[AuxVariables]
[variable_derivative]
family = MONOMIAL
order = CONSTANT
[]
inactive = 'variable_derivative_fv'
[variable_derivative_fv]
family = MONOMIAL
order = CONSTANT
fv = true
[]
[]
[AuxKernels]
# Time derivative of a nonlinear variable
[var_derivative]
type = SecondTimeDerivativeAux
variable = variable_derivative
v = u
factor = 10
execute_on = 'TIMESTEP_END'
[]
# this places the derivative of a FE variable in a FV one
# let's output a warning
inactive = 'var_derivative_to_fv'
[var_derivative_to_fv]
type = SecondTimeDerivativeAux
variable = variable_derivative_fv
v = u
[]
[]
[Executioner]
type = Transient
dt = 0.1
num_steps = 2
l_tol = 1e-10
[TimeIntegrator]
type = CentralDifference
[]
[]
[Outputs]
exodus = true
[]
(test/tests/executioners/nl_pingpong/nonlinear_residual_pingpong.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 4
xmin = -1
xmax = 1
ymin = -1
ymax = 1
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
initial_condition = 0.1
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./power]
type = PReaction
variable = u
coefficient = 0.2
power = -5
# Comment out this will make fixed point iteration converged in one iteration.
# However, this makes the solving diverge and require a proper initial condition (>1.00625).
vector_tags = 'previous'
[../]
[]
[BCs]
[./left]
type = VacuumBC
variable = u
boundary = left
[../]
[./right]
type = NeumannBC
variable = u
boundary = right
value = 10
[../]
[]
[Postprocessors]
[./unorm]
type = ElementL2Norm
variable = u
[../]
[]
[Problem]
type = FixedPointProblem
fp_tag_name = 'previous'
[]
[Executioner]
type = FixedPointSteady
nl_rel_tol = 1e-50
line_search = none
n_max_nonlinear_pingpong = 2
[]
(test/tests/restart/restart_transient_from_steady/steady_with_2subs_sub.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 3
ny = 3
xmax = 0.3
ymax = 0.3
[]
[AuxVariables]
[power_density]
[]
[]
[Variables]
[temp]
[]
[]
[Kernels]
[heat_conduction]
type = Diffusion
variable = temp
[]
[heat_source_fuel]
type = CoupledForce
variable = temp
v = power_density
[]
[]
[BCs]
[bc]
type = DirichletBC
variable = temp
boundary = '1 3'
value = 100
[]
[bc2]
type = NeumannBC
variable = temp
boundary = '0 2'
value = 10.0
[]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart '
petsc_options_value = 'hypre boomeramg 100'
nl_abs_tol = 1e-7
nl_rel_tol = 1e-7
[]
[Postprocessors]
[temp_fuel_avg]
type = ElementAverageValue
variable = temp
execute_on = 'initial timestep_end'
[]
[pwr_density]
type = ElementIntegralVariablePostprocessor
variable = power_density
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
perf_graph = true
exodus = true
color = true
[]
(test/tests/userobjects/element_subdomain_modifier/complement_boundary.i)
[Mesh]
[right_block]
type = GeneratedMeshGenerator
dim = 2
ymin = -1
ny = 2
boundary_name_prefix = '1'
[]
[right_block_sidesets]
type = RenameBoundaryGenerator
input = right_block
old_boundary = '0 1 2 3'
new_boundary = '10 11 12 13'
[]
[right_block_id]
type = SubdomainIDGenerator
input = right_block_sidesets
subdomain_id = 1
[]
[left_block]
type = GeneratedMeshGenerator
dim = 2
xmin = -1.0
xmax = -0.5
boundary_name_prefix = '2'
[]
[left_block_sidesets]
type = RenameBoundaryGenerator
input = left_block
old_boundary = '0 1 2 3'
new_boundary = '20 21 22 23'
[]
[left_block_id]
type = SubdomainIDGenerator
input = left_block_sidesets
subdomain_id = 2
[]
[combined_mesh]
type = MeshCollectionGenerator
inputs = 'right_block_id left_block_id'
[]
[]
[Variables]
[temperature]
initial_condition = 298
[]
[]
[Kernels]
[Tdot]
type = TimeDerivative
variable = temperature
[]
[heat_conduction]
type = Diffusion
variable = temperature
[]
[]
[UserObjects]
[w_complement_mvg_bnd]
type = CoupledVarThresholdElementSubdomainModifier
coupled_var = 'temperature'
block = '1'
criterion_type = ABOVE
threshold = 400
subdomain_id = 2
complement_moving_boundary_name = 10
execute_on = 'TIMESTEP_BEGIN'
[]
[]
[BCs]
[tempBC]
type = DirichletBC
variable = temperature
boundary = '12'
value = 300
[]
[fluxBC]
type = NeumannBC
variable = temperature
boundary = '10'
value = '100'
[]
[]
[Postprocessors]
[temp_top_element]
type = PointValue
variable = temperature
point = '0 0.5 0'
[]
[]
[Executioner]
type = Transient
end_time = 5
dtmin = 1
solve_type = 'PJFNK'
petsc_options = '-snes_ksp_ew -snes_converged_reason'
petsc_options_iname = '-pc_type -pc_f./moactor_mat_solver_package -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu superlu_dist NONZERO 1000'
line_search = none
[]
[Outputs]
exodus = true
[]
(test/tests/postprocessors/find_value_on_line/findvalueonline.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 20
xmin = 0
xmax = 10
[]
[Variables]
[./phi]
[./InitialCondition]
type = FunctionIC
function = if(x<1,1-x,0)
[../]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = phi
[../]
[./dt]
type = TimeDerivative
variable = phi
[../]
[]
[BCs]
[./influx]
type = NeumannBC
boundary = left
variable = phi
value = 1
[../]
[./fix]
type = DirichletBC
boundary = right
variable = phi
value = 0
[../]
[]
[Postprocessors]
[./pos]
type = FindValueOnLine
target = 0.5
v = phi
start_point = '0 0 0'
end_point = '10 0 0'
execute_on = 'initial timestep_end'
[../]
[]
[Executioner]
type = Transient
num_steps = 5
dt = 2.5
[]
[Outputs]
csv = true
[]
(modules/optimization/test/tests/outputs/exodus_optimization_steady/forward.i)
[Mesh]
[]
[Variables]
[temperature]
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = temperature
diffusivity = thermal_conductivity
[]
[heat_source]
type = BodyForce
value = 1000
variable = temperature
[]
[]
[BCs]
[left]
type = NeumannBC
variable = temperature
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = temperature
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = temperature
boundary = bottom
value = 200
[]
[top]
type = DirichletBC
variable = temperature
boundary = top
value = 100
[]
[]
[Functions]
[thermo_conduct]
type = ParsedOptimizationFunction
expression = 'alpha'
param_symbol_names = 'alpha'
param_vector_name = 'params/p1'
[]
[]
[Materials]
[steel]
type = GenericFunctionMaterial
prop_names = 'thermal_conductivity'
prop_values = 'thermo_conduct'
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
nl_abs_tol = 1e-8
nl_rel_tol = 1e-8
petsc_options_iname = '-ksp_type -pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'preonly lu superlu_dist'
[]
[Reporters]
[measure_data]
type = OptimizationData
variable = temperature
[]
[params]
type = ConstantReporter
real_vector_names = 'p1'
real_vector_values = '0' # Dummy value
[]
[]
[Outputs]
console = false
file_base = 'forward'
[exo]
type = ExodusOptimizationSteady
execute_on = 'TIMESTEP_END'
[]
[]
(test/tests/kernels/block_kernel/block_vars.i)
[Mesh]
file = rect-2blk.e
[]
[Variables]
active = 'u v'
[./u]
order = FIRST
family = LAGRANGE
block = 1
[../]
[./v]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
active = 'diff_u diff_v'
[./diff_u]
type = Diffusion
variable = u
[../]
[./diff_v]
type = Diffusion
variable = v
[../]
[]
[BCs]
active = 'left_u right_u left_v right_v'
[./left_u]
type = DirichletBC
variable = u
boundary = 6
value = 0
[../]
[./right_u]
type = NeumannBC
variable = u
boundary = 8
value = 4
[../]
[./left_v]
type = DirichletBC
variable = v
boundary = 6
value = 1
[../]
[./right_v]
type = DirichletBC
variable = v
boundary = 3
value = 6
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
execute_on = 'timestep_end'
file_base = out_vars
exodus = true
[]
(modules/stochastic_tools/examples/parameter_study/diffusion_vector.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables/T]
initial_condition = 300
[]
[Kernels]
[time]
type = ADTimeDerivative
variable = T
[]
[diff]
type = ADMatDiffusion
variable = T
diffusivity = diffusivity
[]
[source]
type = ADBodyForce
variable = T
value = 100
function = 1
[]
[]
[BCs]
[left]
type = ADDirichletBC
variable = T
boundary = left
value = 300
[]
[right]
type = ADNeumannBC
variable = T
boundary = right
value = -100
[]
[]
[Materials/constant]
type = ADGenericConstantMaterial
prop_names = 'diffusivity'
prop_values = 1
[]
[Executioner]
type = Transient
num_steps = 4
dt = 0.25
[]
[Postprocessors]
[T_avg]
type = ElementAverageValue
variable = T
execute_on = 'initial timestep_end'
[]
[q_left]
type = ADSideDiffusiveFluxAverage
variable = T
boundary = left
diffusivity = diffusivity
execute_on = 'initial timestep_end'
[]
[]
[Reporters]
[acc]
type = AccumulateReporter
reporters = 'T_avg/value q_left/value'
[]
[]
[Controls/stochastic]
type = SamplerReceiver
[]
[Outputs]
[]
(modules/stochastic_tools/examples/surrogates/combined/trans_diff_2d/trans_diff_sub.i)
[Functions]
[src_func]
type = ParsedFunction
expression = "1000*sin(f*t)"
symbol_names = 'f'
symbol_values = '20'
[]
[]
[Mesh]
[msh]
type = GeneratedMeshGenerator
dim = 2
nx = 100
xmin = -0.5
xmax = 0.5
ny = 100
ymin = -0.5
ymax = 0.5
[]
[source_domain]
type = ParsedSubdomainMeshGenerator
input = msh
combinatorial_geometry = '(x<0.1 & x>-0.1) & (y<0.1 & y>-0.1)'
block_id=1
[]
[]
[Variables]
[T]
initial_condition = 300
[]
[]
[Kernels]
[diffusion]
type = MatDiffusion
variable = T
diffusivity = diff_coeff
[]
[source]
type = BodyForce
variable = T
function = src_func
block = 1
[]
[time_deriv]
type = TimeDerivative
variable = T
[]
[]
[Materials]
[diff_coeff]
type = ParsedMaterial
property_name = diff_coeff
coupled_variables = 'T'
constant_names = 'C'
constant_expressions = 0.02
expression = 'C * pow(300/T, 2)'
[]
[]
[BCs]
[neumann_all]
type = NeumannBC
variable = T
boundary = 'left right top bottom'
value = 0
[]
[]
[Executioner]
type = Transient
num_steps = 100
dt = 0.01
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
nl_rel_tol = 1e-6
l_abs_tol = 1e-6
timestep_tolerance = 1e-6
[]
[Postprocessors]
[max]
type = NodalExtremeValue
variable = T
[]
[min]
type = NodalExtremeValue
variable = T
value_type = min
[]
[time_max]
type = TimeExtremeValue
postprocessor = max
[]
[time_min]
type = TimeExtremeValue
postprocessor = min
value_type = min
[]
[]
(test/tests/time_integrators/abort/abort.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 10
xmin = 0.0
xmax = 1.0
[]
#still need BC for Energy, IC's for both.
[Variables]
active = 'Time'
[./Time]
order = FIRST
family = LAGRANGE
initial_condition = 0.0
[../]
[]
[Functions]
active = 'func'
[./func]
type = ParsedFunction
expression = 2.0*t
[../]
[]
[Kernels]
active = 't_time func_time'
[./t_time]
type = TimeDerivative
variable = Time
[../]
[./func_time]
type = BodyForce
variable = Time
function = func
[../]
[]
[BCs]
active = 'Top_Temperature'
[./Top_Temperature]
type = NeumannBC
variable = Time
boundary = 'left right'
[../]
[]
[Executioner]
type = Transient
#scheme = 'BDF2'
#scheme = 'crank-nicolson'
start_time = 0
num_steps = 4
dt = 1000000000
[./Predictor]
type = SimplePredictor
scale = 1.0
[../]
steady_state_tolerance = .00000000000000001
steady_state_detection = true
nl_abs_tol = 1e-15
petsc_options = '-snes_converged_reason'
abort_on_solve_fail = true
[]
[Outputs]
file_base = out
exodus = true
[]
(test/tests/time_steppers/iteration_adaptive/adapt_tstep_reject_large_dt.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 50
ny = 2
xmax = 5
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Functions]
[./timestep_fn]
type = PiecewiseConstant
x = '0. 10.0'
y = '10.0 1.0'
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./dt]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 10
[../]
[./right]
type = NeumannBC
variable = u
boundary = right
value = -1
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
start_time = 0.0
end_time = 12.0
dtmax = 10.0
dtmin = 0.1
[./TimeStepper]
type = IterationAdaptiveDT
timestep_limiting_postprocessor = timestep_pp
reject_large_step = true
reject_large_step_threshold = 0.5
dt = 3.0
growth_factor = 1.0
[../]
[]
[Postprocessors]
[./_dt]
type = TimestepSize
[../]
# Just use a simple postprocessor to test capability to limit the time step length to the postprocessor value
[./timestep_pp]
type = FunctionValuePostprocessor
function = timestep_fn
[../]
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
checkpoint = true
[]
(test/tests/restart/restart_transient_from_steady/restart_trans_with_2subs_sub.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 3
ny = 3
xmax = 0.3
ymax = 0.3
[]
[AuxVariables]
[power_density]
[]
[]
[Variables]
[temp]
[]
[]
[Kernels]
[heat_conduction]
type = Diffusion
variable = temp
[]
[heat_ie]
type = TimeDerivative
variable = temp
[]
[heat_source_fuel]
type = CoupledForce
variable = temp
v = power_density
[]
[]
[BCs]
[bc]
type = DirichletBC
variable = temp
boundary = '1 3'
value = 100
[]
[bc2]
type = NeumannBC
variable = temp
boundary = '0 2'
value = 10.0
[]
[]
[Executioner]
type = Transient
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart '
petsc_options_value = 'hypre boomeramg 100'
start_time = 0
end_time = 3
dt = 1.0
nl_abs_tol = 1e-7
nl_rel_tol = 1e-7
[]
[Postprocessors]
[temp_fuel_avg]
type = ElementAverageValue
variable = temp
block = '0'
execute_on = 'initial timestep_end'
[]
[pwr_density]
type = ElementIntegralVariablePostprocessor
block = '0'
variable = power_density
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
perf_graph = true
exodus = true
color = true
[]
(tutorials/tutorial03_verification/app/test/tests/step04_mms/2d_main.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
ymax = 0
ymin = -0.2
nx = 20
ny = 4
[]
[]
[Variables]
[T]
[]
[]
[ICs]
[T_O]
type = ConstantIC
variable = T
value = 263.15
[]
[]
[Functions]
[source]
type = ParsedFunction
symbol_names = 'hours shortwave kappa'
symbol_values = '9 650 40'
expression = 'shortwave*sin(0.5*x*pi)*exp(kappa*y)*sin(1/(hours*3600)*pi*t)'
[]
[]
[Kernels]
[T_time]
type = HeatConductionTimeDerivative
variable = T
density_name = 150
specific_heat = 2000
[]
[T_cond]
type = HeatConduction
variable = T
diffusion_coefficient = 0.01
[]
[T_source]
type = HeatSource
variable = T
function = source
[]
[]
[BCs]
[top]
type = NeumannBC
boundary = top
variable = T
value = -5
[]
[bottom]
type = DirichletBC
boundary = bottom
variable = T
value = 263.15
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
dt = 600 # 10 min
end_time = 32400 # 9 hour
[]
[Outputs]
exodus = true
[]
(modules/solid_mechanics/test/tests/visco/burgers_creep.i)
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 1
elem_type = HEX8
displacements = 'disp_x disp_y disp_z'
[]
[Variables]
[./disp_x]
order = FIRST
family = LAGRANGE
[../]
[./disp_y]
order = FIRST
family = LAGRANGE
[../]
[./disp_z]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./stress_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./creep_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[SolidMechanics]
displacements = 'disp_x disp_y disp_z'
use_displaced_mesh = true
[../]
[]
[AuxKernels]
[./stress_xx]
type = RankTwoAux
variable = stress_xx
rank_two_tensor = stress
index_j = 0
index_i = 0
execute_on = timestep_end
[../]
[./strain_xx]
type = RankTwoAux
variable = strain_xx
rank_two_tensor = total_strain
index_j = 0
index_i = 0
execute_on = timestep_end
[../]
[./creep_strain_xx]
type = RankTwoAux
variable = creep_strain_xx
rank_two_tensor = creep_strain
index_j = 0
index_i = 0
execute_on = timestep_end
[../]
[]
[BCs]
[./symmy]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0
[../]
[./symmx]
type = DirichletBC
variable = disp_x
boundary = left
value = 0
[../]
[./symmz]
type = DirichletBC
variable = disp_z
boundary = back
value = 0
[../]
[./axial_load]
type = NeumannBC
variable = disp_x
boundary = right
value = 10e6
[../]
[]
[Materials]
[./burgers]
type = GeneralizedKelvinVoigtModel
creep_modulus = '10e9'
creep_viscosity = '1 10'
poisson_ratio = 0.2
young_modulus = 10e9
[../]
[./stress]
type = ComputeMultipleInelasticStress
inelastic_models = 'creep'
[../]
[./creep]
type = LinearViscoelasticStressUpdate
[../]
[./strain]
type = ComputeIncrementalSmallStrain
displacements = 'disp_x disp_y disp_z'
[../]
[]
[UserObjects]
[./update]
type = LinearViscoelasticityManager
viscoelastic_model = burgers
[../]
[]
[Postprocessors]
[./stress_xx]
type = ElementAverageValue
variable = stress_xx
block = 'ANY_BLOCK_ID 0'
[../]
[./strain_xx]
type = ElementAverageValue
variable = strain_xx
block = 'ANY_BLOCK_ID 0'
[../]
[./creep_strain_xx]
type = ElementAverageValue
variable = creep_strain_xx
block = 'ANY_BLOCK_ID 0'
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
l_max_its = 50
l_tol = 1e-10
nl_max_its = 20
nl_rel_tol = 1e-10
nl_abs_tol = 1e-10
dtmin = 0.01
end_time = 100
[./TimeStepper]
type = LogConstantDT
first_dt = 0.1
log_dt = 0.1
[../]
[]
[Outputs]
file_base = burgers_creep_out
exodus = true
[]
(test/tests/time_steppers/iteration_adaptive/adapt_tstep_multi_pps_lim.i)
[Mesh]
[generated_mesh]
type = GeneratedMeshGenerator
dim = 2
nx = 50
ny = 2
xmax = 5
[]
[]
[Variables]
[u]
order = FIRST
family = LAGRANGE
[]
[]
[Functions]
[timestep_fn1]
type = PiecewiseLinear
x = '0 40'
y = '10 1'
[]
[timestep_fn2]
type = PiecewiseLinear
x = '0 40'
y = '2 5'
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[dt]
type = TimeDerivative
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 10
[]
[right]
type = NeumannBC
variable = u
boundary = right
value = -1
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
start_time = 0.0
end_time = 40.0
dtmax = 6.0
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 10
timestep_limiting_postprocessor = 'timestep_pp1 timestep_pp2'
dt = 1.0
[]
[]
[Postprocessors]
[_dt]
type = TimestepSize
[]
[timestep_pp1]
type = FunctionValuePostprocessor
function = timestep_fn1
[]
[timestep_pp2]
type = FunctionValuePostprocessor
function = timestep_fn2
[]
[]
[Outputs]
csv = true
[]
(modules/combined/test/tests/optimization/invOpt_nonlinear/forward.i)
[Executioner]
type = Steady
solve_type = NEWTON
line_search = none
nl_abs_tol = 1e-12
nl_rel_tol = 1e-12
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Mesh]
[]
[Variables]
[forwardT]
[]
[]
[Kernels]
[heat_conduction]
type = ADHeatConduction
thermal_conductivity = 'conductivity'
variable = forwardT
[]
[heat_source]
type = ADMatHeatSource
material_property = 'volumetric_heat'
variable = forwardT
[]
[]
[Materials]
[NonlinearConductivity]
type = ADParsedMaterial
f_name = 'conductivity'
function = '10+500*forwardT'
args = 'forwardT'
[]
[volumetric_heat]
type = ADGenericFunctionMaterial
prop_names = 'volumetric_heat'
prop_values = 'volumetric_heat_func'
[]
[]
[Functions]
[volumetric_heat_func]
type = ParsedOptimizationFunction
expression = q
param_symbol_names = 'q'
param_vector_name = 'params/heat_source'
[]
[]
[BCs]
[left]
type = NeumannBC
variable = forwardT
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = forwardT
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = forwardT
boundary = bottom
value = 2
[]
[top]
type = DirichletBC
variable = forwardT
boundary = top
value = 1
[]
[]
[Reporters]
[measurement_locations]
type = OptimizationData
variable = forwardT
[]
[params]
type = ConstantReporter
real_vector_names = 'heat_source'
real_vector_values = '0' # Dummy
[]
[]
[Outputs]
console = false
[]
(modules/solid_mechanics/test/tests/visco/visco_finite_strain.i)
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 1
elem_type = HEX8
displacements = 'disp_x disp_y disp_z'
[]
[Variables]
[./disp_x]
order = FIRST
family = LAGRANGE
[../]
[./disp_y]
order = FIRST
family = LAGRANGE
[../]
[./disp_z]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./stress_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./creep_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[SolidMechanics]
displacements = 'disp_x disp_y disp_z'
use_displaced_mesh = true
[../]
[]
[AuxKernels]
[./stress_xx]
type = RankTwoAux
variable = stress_xx
rank_two_tensor = stress
index_j = 0
index_i = 0
execute_on = timestep_end
[../]
[./strain_xx]
type = RankTwoAux
variable = strain_xx
rank_two_tensor = total_strain
index_j = 0
index_i = 0
execute_on = timestep_end
[../]
[./creep_strain_xx]
type = RankTwoAux
variable = creep_strain_xx
rank_two_tensor = creep_strain
index_j = 0
index_i = 0
execute_on = timestep_end
[../]
[]
[BCs]
[./symmy]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0
[../]
[./symmx]
type = DirichletBC
variable = disp_x
boundary = left
value = 0
[../]
[./symmz]
type = DirichletBC
variable = disp_z
boundary = back
value = 0
[../]
[./axial_load]
type = NeumannBC
variable = disp_x
boundary = right
value = 10e6
[../]
[]
[Materials]
[./kelvin_voigt]
type = GeneralizedKelvinVoigtModel
creep_modulus = '10e9 10e9'
creep_viscosity = '1 10'
poisson_ratio = 0.2
young_modulus = 10e9
[../]
[./stress]
type = ComputeMultipleInelasticStress
inelastic_models = 'creep'
[../]
[./creep]
type = LinearViscoelasticStressUpdate
[../]
[./strain]
type = ComputeFiniteStrain
displacements = 'disp_x disp_y disp_z'
[../]
[]
[UserObjects]
[./update]
type = LinearViscoelasticityManager
viscoelastic_model = kelvin_voigt
[../]
[]
[Postprocessors]
[./stress_xx]
type = ElementAverageValue
variable = stress_xx
block = 'ANY_BLOCK_ID 0'
[../]
[./strain_xx]
type = ElementAverageValue
variable = strain_xx
block = 'ANY_BLOCK_ID 0'
[../]
[./creep_strain_xx]
type = ElementAverageValue
variable = creep_strain_xx
block = 'ANY_BLOCK_ID 0'
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
l_max_its = 100
l_tol = 1e-8
nl_max_its = 50
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
dtmin = 0.01
end_time = 100
[./TimeStepper]
type = LogConstantDT
first_dt = 0.1
log_dt = 0.1
[../]
[]
[Outputs]
file_base = visco_finite_strain_out
exodus = true
[]
(test/tests/time_steppers/iteration_adaptive/adapt_tstep_pps_lim.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 50
ny = 2
xmax = 5
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Functions]
[./timestep_fn]
type = PiecewiseLinear
x = '0. 40.'
y = '10. 1. '
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./dt]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 10
[../]
[./right]
type = NeumannBC
variable = u
boundary = right
value = -1
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
start_time = 0.0
end_time = 40.0
n_startup_steps = 2
dtmax = 6.0
[./TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 10
timestep_limiting_postprocessor = timestep_pp
dt = 1.0
[../]
[]
[Postprocessors]
[./_dt]
type = TimestepSize
[../]
# Just use a simple postprocessor to test capability to limit the time step length to the postprocessor value
[./timestep_pp]
type = FunctionValuePostprocessor
function = timestep_fn
[../]
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
checkpoint = true
[]
(modules/combined/examples/optimization/thermomechanical/thermal_sub.i)
vol_frac = 0.4
power = 2.0
E0 = 1.0e-6
E1 = 1.0
rho0 = 0.0
rho1 = 1.0
C0 = 1.0e-6
C1 = 1.0
TC0 = 1.0e-16
TC1 = 1.0
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[MeshGenerator]
type = GeneratedMeshGenerator
dim = 2
nx = 40
ny = 40
xmin = 0
xmax = 40
ymin = 0
ymax = 40
[]
[node]
type = ExtraNodesetGenerator
input = MeshGenerator
new_boundary = hold
nodes = 0
[]
[push_left]
type = ExtraNodesetGenerator
input = node
new_boundary = push_left
coord = '16 0 0'
[]
[push_center]
type = ExtraNodesetGenerator
input = push_left
new_boundary = push_center
coord = '24 0 0'
[]
[extra]
type = SideSetsFromBoundingBoxGenerator
input = push_center
bottom_left = '-0.01 17.999 0'
top_right = '5 22.001 0'
boundary_new = n1
boundaries_old = left
[]
[dirichlet_bc]
type = SideSetsFromNodeSetsGenerator
input = extra
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[temp]
initial_condition = 100.0
[]
[]
[AuxVariables]
[Dc]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[Cc]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[Tc]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[Cost]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[mat_den]
family = MONOMIAL
order = FIRST
initial_condition = ${vol_frac}
[]
[]
[AuxKernels]
[Cost]
type = MaterialRealAux
variable = Cost
property = Cost_mat
[]
[]
[Kernels]
[heat_conduction]
type = HeatConduction
variable = temp
diffusion_coefficient = thermal_cond
[]
[heat_source]
type = HeatSource
value = 1e-2 # W/m^3
variable = temp
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = hold
value = 0.0
[]
[no_x_symm]
type = DirichletBC
variable = disp_x
boundary = right
value = 0.0
[]
[left_n1]
type = DirichletBC
variable = temp
boundary = n1
value = 0.0
[]
[top]
type = NeumannBC
variable = temp
boundary = top
value = 0
[]
[bottom]
type = NeumannBC
variable = temp
boundary = bottom
value = 0
[]
[right]
type = NeumannBC
variable = temp
boundary = right
value = 0
[]
[left]
type = NeumannBC
variable = temp
boundary = left
value = 0
[]
[]
[NodalKernels]
[push_left]
type = NodalGravity
variable = disp_y
boundary = push_left
gravity_value = 0.0 # -1e-8
mass = 1
[]
[push_center]
type = NodalGravity
variable = disp_y
boundary = push_center
gravity_value = 0.0 # -1e-8
mass = 1
[]
[]
[Materials]
[thermal_cond]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${TC0}-${TC1})/(${rho0}^${power}-${rho1}^${power}); "
"B1:=${TC0}-A1*${rho0}^${power}; TC1:=A1*mat_den^${power}+B1; TC1"
coupled_variables = 'mat_den'
property_name = thermal_cond
outputs = 'exodus'
[]
[thermal_compliance]
type = ThermalCompliance
temperature = temp
thermal_conductivity = thermal_cond
outputs = 'exodus'
[]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'mat_den'
[]
[E_phys]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${E0}-${E1})/(${rho0}^${power}-${rho1}^${power}); "
"B1:=${E0}-A1*${rho0}^${power}; E1:=A1*mat_den^${power}+B1; E1"
coupled_variables = 'mat_den'
property_name = E_phys
[]
[Cost_mat]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${C0}-${C1})/(${rho0}^(1/${power})-${rho1}^(1/${power})); "
"B1:=${C0}-A1*${rho0}^(1/${power}); C1:=A1*mat_den^(1/${power})+B1; C1"
coupled_variables = 'mat_den'
property_name = Cost_mat
[]
[CostDensity]
type = ParsedMaterial
property_name = CostDensity
coupled_variables = 'mat_den Cost'
expression = 'mat_den*Cost'
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys
[]
[cc]
type = CostSensitivity
design_density = mat_den
cost = Cost_mat
outputs = 'exodus'
[]
[tc]
type = ThermalSensitivity
design_density = mat_den
thermal_conductivity = thermal_cond
temperature = temp
outputs = 'exodus'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[rad_avg]
type = RadialAverage
radius = 0.1
weights = linear
prop_name = sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[rad_avg_cost]
type = RadialAverage
radius = 0.1
weights = linear
prop_name = cost_sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[rad_avg_thermal]
type = RadialAverage
radius = 0.1
weights = linear
prop_name = thermal_sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
# Provides Dc
[calc_sense]
type = SensitivityFilter
density_sensitivity = Dc
design_density = mat_den
filter_UO = rad_avg
execute_on = TIMESTEP_END
force_postaux = true
[]
# Provides Cc
[calc_sense_cost]
type = SensitivityFilter
density_sensitivity = Cc
design_density = mat_den
filter_UO = rad_avg_cost
execute_on = TIMESTEP_END
force_postaux = true
[]
# Provides Tc
[calc_sense_thermal]
type = SensitivityFilter
density_sensitivity = Tc
design_density = mat_den
filter_UO = rad_avg_thermal
execute_on = TIMESTEP_END
force_postaux = true
[]
[]
[Executioner]
type = Transient
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-12
dt = 1.0
num_steps = 500
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[right_flux]
type = SideDiffusiveFluxAverage
variable = temp
boundary = right
diffusivity = 10
[]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
function = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = sensitivity
[]
[cost_sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = cost_sensitivity
[]
[cost]
type = ElementIntegralMaterialProperty
mat_prop = CostDensity
[]
[cost_frac]
type = ParsedPostprocessor
function = 'cost / mesh_volume'
pp_names = 'cost mesh_volume'
[]
[objective]
type = ElementIntegralMaterialProperty
mat_prop = strain_energy_density
execute_on = 'INITIAL TIMESTEP_END'
[]
[objective_thermal]
type = ElementIntegralMaterialProperty
mat_prop = thermal_compliance
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
(modules/solid_mechanics/test/tests/lagrangian/axisymmetric_cylindrical/total/analytical/small.i)
# This test aims to verify the implementation by comparing the numerical solution
# to the analytical solution. The Lame solution for a hollow cylinder is used in
# this test. Given inner pressure p = 100, outer pressure q = 200, inner radius
# a = 2, outer radius b = 4, the stress and displacements at the middle of the cylinder
# (r = 3, z = 0) should be
# sigma_rr = -174.074
# sigma_tt = -292.593
# u_r = -0.65972
# The numerical approximation yields
# sigma_rr = -172.051
# sigma_tt = -294.613
# u_r = -0.65964
[GlobalParams]
displacements = 'disp_r disp_z'
large_kinematics = false
[]
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
xmin = 2
xmax = 4
ymin = 0
ymax = 10
nx = 20
ny = 100
[]
[]
[Problem]
coord_type = RZ
[]
[Variables]
[disp_r]
[]
[disp_z]
[]
[]
[Kernels]
[sdr]
type = TotalLagrangianStressDivergenceAxisymmetricCylindrical
variable = disp_r
component = 0
[]
[sdz]
type = TotalLagrangianStressDivergenceAxisymmetricCylindrical
variable = disp_z
component = 1
[]
[]
[BCs]
[bottom]
type = DirichletBC
variable = disp_z
boundary = 'top bottom'
value = 0.0
preset = false
[]
[inner]
type = NeumannBC
variable = disp_r
boundary = left
value = 100
[]
[outer]
type = NeumannBC
variable = disp_r
boundary = right
value = -200
[]
[]
[Materials]
[elastic_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1000.0
poissons_ratio = 0.25
[]
[compute_stress]
type = ComputeLagrangianLinearElasticStress
output_properties = 'cauchy_stress'
outputs = 'exodus'
[]
[compute_strain]
type = ComputeLagrangianStrainAxisymmetricCylindrical
[]
[]
[Postprocessors]
[u_r]
type = PointValue
variable = disp_r
point = '3 0 0'
[]
[sigma_rr]
type = PointValue
variable = cauchy_stress_00
point = '3 0 0'
[]
[sigma_tt]
type = PointValue
variable = cauchy_stress_22
point = '3 0 0'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
automatic_scaling = true
nl_abs_tol = 1e-10
nl_rel_tol = 1e-10
num_steps = 1
[]
[Outputs]
exodus = true
[]
(test/tests/dirackernels/function_dirac_source/function_dirac_source.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 5
ny = 5
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./time]
type = TimeDerivative
variable = u
[../]
[./diff]
type = Diffusion
variable = u
[../]
[]
[DiracKernels]
[./point_source]
type = FunctionDiracSource
variable = u
function = switch_off
point = '0.1 0.2 0.0'
[../]
[]
[Functions]
[./switch_off]
type = ParsedFunction
expression = 'if(t < 1.0001, 1, 0)'
[../]
[]
[BCs]
[./external]
type = NeumannBC
variable = u
boundary = '0 1 2 3'
value = 0
[../]
[]
[Postprocessors]
[./total_internal_energy]
type = ElementIntegralVariablePostprocessor
variable = u
[../]
[]
[Executioner]
type = Transient
num_steps = 5
dt = 1
l_tol = 1e-03
[]
[Outputs]
exodus = true
[]
(test/tests/misc/check_error/double_restrict_uo.i)
[Mesh]
file = sq-2blk.e
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
block = 1
[../]
[./v]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff_u]
type = Diffusion
variable = u
[../]
[./diff_v]
type = Diffusion
variable = v
[../]
[]
[BCs]
[./left_u]
type = DirichletBC
variable = u
boundary = 6
value = 0
[../]
[./right_u]
type = NeumannBC
variable = u
boundary = 8
value = 4
[../]
[./left_v]
type = DirichletBC
variable = v
boundary = 6
value = 1
[../]
[./right_v]
type = DirichletBC
variable = v
boundary = 3
value = 6
[../]
[]
[Postprocessors]
# This test demonstrates that you can have a block restricted NodalPostprocessor
[./restricted_max]
type = NodalExtremeValue
variable = v
block = 1 # Block restricted
boundary = 1 # Boundary restricted
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
(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
[../]
[]
(examples/ex21_debugging/ex21.i)
[Mesh]
file = reactor.e
#Let's assign human friendly names to the blocks on the fly
block_id = '1 2'
block_name = 'fuel deflector'
boundary_id = '4 5'
boundary_name = 'bottom top'
[]
[Variables]
#Use active lists to help debug problems. Switching on and off
#different Kernels or Variables is extremely useful!
active = 'diffused convected'
[diffused]
order = FIRST
family = LAGRANGE
initial_condition = 0.5
[]
[convected]
order = FIRST
family = LAGRANGE
initial_condition = 0.0
[]
[]
[Kernels]
#This Kernel consumes a real-gradient material property from the active material
active = 'convection diff_convected example_diff time_deriv_diffused time_deriv_convected'
[convection]
type = ExampleConvection
variable = convected
[]
[diff_convected]
type = Diffusion
variable = convected
[]
[example_diff]
type = ExampleDiffusion
variable = diffused
coupled_coef = convected
[]
[time_deriv_diffused]
type = TimeDerivative
variable = diffused
[]
[time_deriv_convected]
type = TimeDerivative
variable = convected
[]
[]
[BCs]
[bottom_diffused]
type = DirichletBC
variable = diffused
boundary = 'bottom'
value = 0
[]
[top_diffused]
type = DirichletBC
variable = diffused
boundary = 'top'
value = 5
[]
[bottom_convected]
type = DirichletBC
variable = convected
boundary = 'bottom'
value = 0
[]
[top_convected]
type = NeumannBC
variable = convected
boundary = 'top'
value = 1
[]
[]
[Materials]
[example]
type = ExampleMaterial
block = 'fuel'
diffusion_gradient = 'diffused'
#Approximate Parabolic Diffusivity
independent_vals = '0 0.25 0.5 0.75 1.0'
dependent_vals = '1e-2 5e-3 1e-3 5e-3 1e-2'
[]
[example1]
type = ExampleMaterial
block = 'deflector'
diffusion_gradient = 'diffused'
# Constant Diffusivity
independent_vals = '0 1.0'
dependent_vals = '1e-1 1e-1'
[]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
dt = 0.1
num_steps = 10
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(modules/xfem/test/tests/diffusion_xfem/diffusion_flux_bc.i)
# The Neumann BC is applied on the cutted boundary.
# The solution is not correct because so far integration along the cutted element faces is not right.
# To correct this, we need to re-calcuate the weights based on area/volume fraction. This will be implemented soon.
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 6
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
elem_type = QUAD4
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./line_seg_cut_uo]
type = LineSegmentCutUserObject
cut_data = '0.5 1.0 0.5 0.5'
time_start_cut = 0.0
time_end_cut = 0.0
[../]
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
# Define boundary conditions
[./top_u]
type = NeumannBC
variable = u
boundary = 2
value = -1.0
[../]
[./bottom]
type = DirichletBC
variable = u
boundary = 0
value = 0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
line_search = 'none'
l_tol = 1e-3
nl_max_its = 15
nl_rel_tol = 1e-10
nl_abs_tol = 1e-10
start_time = 0.0
dt = 1.0
end_time = 1.0
[]
[Outputs]
time_step_interval = 1
execute_on = timestep_end
exodus = true
[./console]
type = Console
output_linear = true
[../]
[]
(test/tests/controls/libtorch_nn_control/read_control.i)
pi = 3.14159265359
period = 0.25
diff_coeff = 0.5
cp = 1.0
[Functions]
[src_func]
type = ParsedFunction
value = "sin(${pi}/${period}*t)"
[]
[]
[Mesh]
[msh]
type = GeneratedMeshGenerator
dim = 2
nx = 20
xmin = -0.5
xmax = 0.5
ny = 20
ymin = -0.5
ymax = 0.5
[]
[source_domain]
type = ParsedSubdomainMeshGenerator
input = msh
combinatorial_geometry = '(x<0.2 & x>-0.2) & (y<0.2 & y>-0.2)'
block_id = 1
[]
[]
[Variables]
[T]
initial_condition = 1
[]
[]
[Kernels]
[diffusion]
type = CoefDiffusion
variable = T
coef = ${diff_coeff}
[]
[source]
type = BodyForce
variable = T
function = src_func
block = 1
[]
[anti_source]
type = BodyForce
variable = T
value = 0
block = 1
[]
[time_deriv]
type = CoefTimeDerivative
Coefficient = ${cp}
variable = T
[]
[]
[BCs]
[neumann_rest]
type = NeumannBC
variable = T
boundary = 'left right top bottom'
value = 0
[]
[]
[Executioner]
type = Transient
num_steps = 25
dt = 0.1
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_abs_tol = 1e-12
line_search = 'none'
[]
[Postprocessors]
[T_max]
type = NodalExtremeValue
variable = T
execute_on = 'INITIAL TIMESTEP_END'
[]
[control_value]
type = LibtorchControlValuePostprocessor
control_name = src_control
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Controls]
[src_control]
type = LibtorchNeuralNetControl
parameters = "Kernels/anti_source/value"
responses = 'T_max'
[]
[]
[Reporters]
inactive = 'nn_parameters'
[T_reporter]
type = AccumulateReporter
reporters = 'T_max/value control_value/value'
outputs = csv_out
[]
[nn_parameters]
type = LibtorchArtificialNeuralNetParameters
control_name = src_control
execute_on = FINAL
outputs = json_out
[]
[]
[Outputs]
[csv_out]
type = CSV
execute_on = FINAL
[]
[json_out]
type = JSON
execute_on = FINAL
execute_system_information_on = NONE
[]
[]
(test/tests/auxkernels/time_derivative_aux/test.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 3
ny = 2
[]
[Functions]
# These functions have implemented time derivatives
[some_function]
type = ParsedFunction
expression = t*(x+y)
[]
[some_other_function]
type = PiecewiseLinear
x = '0 0.05 0.15 0.25'
y = '1 2 3 4'
[]
[]
[Variables]
[u]
[]
[]
[Kernels]
[time]
type = TimeDerivative
variable = u
[]
[reaction]
type = Reaction
variable = u
[]
[diffusion]
type = Diffusion
variable = u
[]
[]
[BCs]
[left]
type = NeumannBC
variable = u
value = 5
boundary = 'left'
[]
[]
[Materials]
[material]
type = GenericFunctorMaterial
prop_names = 'some_matprop'
prop_values = 'some_function'
[]
[]
[AuxVariables]
[variable_derivative]
family = MONOMIAL
order = CONSTANT
[]
inactive = 'variable_derivative_fv'
[variable_derivative_fv]
family = MONOMIAL
order = CONSTANT
fv = true
[]
[function_derivative_qp]
family = MONOMIAL
order = FIRST
[]
[function_derivative_elem]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
# Time derivative of a nonlinear variable
[var_derivative]
type = TimeDerivativeAux
variable = variable_derivative
functor = u
factor = 10
execute_on = 'TIMESTEP_END'
[]
# this places the derivative of a FE variable in a FV one
# let's output a warning
inactive = 'var_derivative_to_fv'
[var_derivative_to_fv]
type = TimeDerivativeAux
variable = variable_derivative_fv
functor = u
[]
# Time derivative of a function: using the functor system
# Time derivative of a functor material property is not currently supported
[function_derivative_quadrature_point]
type = TimeDerivativeAux
variable = function_derivative_qp
functor = 'some_function'
factor = 2
execute_on = 'INITIAL TIMESTEP_END'
[]
[function_derivative_element]
type = TimeDerivativeAux
variable = function_derivative_elem
functor = 'some_other_function'
factor = 2
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
dt = 0.1
num_steps = 2
nl_abs_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(test/tests/misc/save_in/diag_save_in_soln_var_err_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./saved]
[../]
[./bc_saved]
[../]
[./accumulated]
[../]
[./diag_saved]
[../]
[./bc_diag_saved]
[../]
[./saved_dirichlet]
[../]
[./diag_saved_dirichlet]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
save_in = 'saved accumulated saved_dirichlet'
diag_save_in = 'u diag_saved diag_saved_dirichlet'
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
save_in = saved_dirichlet
diag_save_in = diag_saved_dirichlet
[../]
[./nbc]
type = NeumannBC
variable = u
boundary = right
value = 1
save_in = 'bc_saved accumulated'
diag_save_in = bc_diag_saved
[../]
[]
[Postprocessors]
[./left_flux]
type = NodalSum
variable = saved
boundary = 1
[../]
[./saved_norm]
type = NodalL2Norm
variable = saved
execute_on = timestep_end
block = 0
[../]
[./saved_dirichlet_norm]
type = NodalL2Norm
variable = saved_dirichlet
execute_on = timestep_end
block = 0
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
file_base = out
exodus = true
[]
(test/tests/outputs/debug/show_execution_nodal_aux_bcs.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
[]
[sub]
type = SubdomainBoundingBoxGenerator
bottom_left = '0.5 0 0'
top_right = '1 1 0'
input = 'gen'
block_id = '1'
[]
[]
[Debug]
show_execution_order = ALWAYS
[]
[Variables]
[u]
block = '0 1'
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[rxn]
type = Reaction
variable = u
[]
[]
[AuxVariables]
[v]
[]
[]
[BCs]
[setting]
type = NeumannBC
variable = u
boundary = 'top'
value = '4'
[]
[]
[Executioner]
type = Steady
[]
[Dampers]
inactive = 'limit_u'
[limit_u]
type = BoundingValueNodalDamper
variable = u
max_value = 1.5
min_value = -20
[]
[]
(modules/combined/test/tests/optimization/invOpt_nonlinear/homogeneous_forward.i)
[Executioner]
type = Steady
solve_type = NEWTON
line_search = none
#nl_forced_its = 1
nl_abs_tol = 1e-12
nl_rel_tol = 1e-12
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Mesh]
[]
[Variables]
[T]
[]
[]
[AuxVariables]
[forwardT]
[]
[_dDdTgradT]
order = CONSTANT
family = MONOMIAL_VEC
[]
[]
[Kernels]
[heat_conduction]
type = ADHeatConduction
thermal_conductivity = 'linearized_conductivity'
variable = T
[]
[heat_source]
type = ADMatHeatSource
material_property = 'volumetric_heat'
variable = T
[]
[advection]
type = ConservativeAdvection
velocity = _dDdTgradT
variable = T
upwinding_type = full #Full upwinding gives somewhat better results
[]
[]
[AuxKernels]
[_dDdTgradT]
type = ADFunctorElementalGradientAux
functor = forwardT
variable = _dDdTgradT
factor_matprop = '_dDdT'
[]
[]
[Materials]
[LinearizedConductivity]
type = ADParsedMaterial
f_name = 'linearized_conductivity'
function = '10+500*forwardT'
args = 'forwardT'
[]
[_dDdT]
type = ADParsedMaterial
f_name = '_dDdT' # "_" represents negation
function = '-500'
args = 'forwardT'
[]
[volumetric_heat]
type = ADGenericFunctionMaterial
prop_names = 'volumetric_heat'
prop_values = 'volumetric_heat_func'
[]
[]
[Functions]
[volumetric_heat_func]
type = ParsedOptimizationFunction
expression = q
param_symbol_names = 'q'
param_vector_name = 'params/heat_source'
[]
[]
[BCs]
[left]
type = NeumannBC
variable = T
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = T
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = T
boundary = bottom
value = 0
[]
[top]
type = DirichletBC
variable = T
boundary = top
value = 0
[]
[]
[Reporters]
[measurement_locations]
type = OptimizationData
variable = T
[]
[params]
type = ConstantReporter
real_vector_names = 'heat_source'
real_vector_values = '0' # Dummy
[]
[]
[Outputs]
console = false
[]
(test/tests/tag/controls-tagging.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 5
ny = 5
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./time]
type = TimeDerivative
variable = u
[../]
[./diff]
type = Diffusion
variable = u
[../]
[]
[Controls]
[doff]
type = TimePeriod
enable_objects = 'DiracKernel::point_source'
disable_objects = 'DiracKernel::point_source2'
start_time = 0
end_time = 2
[]
[]
[DiracKernels]
[./point_source]
type = FunctionDiracSource
variable = u
function = 1
point = '0.3 0.3 0.0'
[../]
[./point_source2]
type = FunctionDiracSource
variable = u
function = 1
point = '-0.3 -0.3 0.0'
[../]
[]
[BCs]
[./external]
type = NeumannBC
variable = u
boundary = '0 1 2 3'
value = 0
[../]
[]
[Executioner]
type = Transient
num_steps = 5
dt = 1
l_tol = 1e-03
[]
[Outputs]
exodus = true
[]
(test/tests/materials/has_material/has_block_prop.i)
[Mesh]
type = FileMesh
file = rectangle.e
[]
[Variables]
[./u]
[../]
[]
[Kernels]
active = 'u_diff'
[./u_diff]
type = MatCoefDiffusion
variable = u
block = '1 2'
conductivity = k
[../]
[]
[BCs]
[./left]
type = NeumannBC
variable = u
boundary = 1
value = 1
[../]
[./right]
type = DirichletBC
variable = u
boundary = 2
value = 0
[../]
[]
[Materials]
[./right]
type = GenericConstantMaterial
block = 2
prop_names = 'k k_right'
prop_values = '1 2'
[../]
[./left]
type = GenericConstantMaterial
block = 1
prop_names = 'k'
prop_values = '0.1'
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(modules/porous_flow/test/tests/poro_elasticity/terzaghi_basicthm.i)
# Using a BasicTHM action
# Terzaghi's problem of consolodation of a drained medium
# The FullySaturated Kernels are used, with multiply_by_density = false
# so that this becomes a linear problem with constant Biot Modulus
#
# A saturated soil sample sits in a bath of water.
# It is constrained on its sides, and bottom.
# Its sides and bottom are also impermeable.
# Initially it is unstressed.
# A normal stress, q, is applied to the soil's top.
# The soil then slowly compresses as water is squeezed
# out from the sample from its top (the top BC for
# the porepressure is porepressure = 0).
#
# See, for example. Section 2.2 of the online manuscript
# Arnold Verruijt "Theory and Problems of Poroelasticity" Delft University of Technology 2013
# but note that the "sigma" in that paper is the negative
# of the stress in TensorMechanics
#
# Here are the problem's parameters, and their values:
# Soil height. h = 10
# Soil's Lame lambda. la = 2
# Soil's Lame mu, which is also the Soil's shear modulus. mu = 3
# Soil bulk modulus. K = la + 2*mu/3 = 4
# Soil confined compressibility. m = 1/(K + 4mu/3) = 0.125
# Soil bulk compliance. 1/K = 0.25
# Fluid bulk modulus. Kf = 8
# Fluid bulk compliance. 1/Kf = 0.125
# Fluid mobility (soil permeability/fluid viscosity). k = 1.5
# Soil initial porosity. phi0 = 0.1
# Biot coefficient. alpha = 0.6
# Soil initial storativity, which is the reciprocal of the initial Biot modulus. S = phi0/Kf + (alpha - phi0)(1 - alpha)/K = 0.0625
# Consolidation coefficient. c = k/(S + alpha^2 m) = 13.95348837
# Normal stress on top. q = 1
# Initial porepressure, resulting from instantaneous application of q, assuming corresponding instantaneous increase of porepressure (Note that this is calculated by MOOSE: we only need it for the analytical solution). p0 = alpha*m*q/(S + alpha^2 m) = 0.69767442
# Initial vertical displacement (down is positive), resulting from instantaneous application of q (Note this is calculated by MOOSE: we only need it for the analytical solution). uz0 = q*m*h*S/(S + alpha^2 m)
# Final vertical displacement (down in positive) (Note this is calculated by MOOSE: we only need it for the analytical solution). uzinf = q*m*h
#
# The solution for porepressure is
# P = 4*p0/\pi \sum_{k=1}^{\infty} \frac{(-1)^{k-1}}{2k-1} \cos ((2k-1)\pi z/(2h)) \exp(-(2k-1)^2 \pi^2 ct/(4 h^2))
# This series converges very slowly for ct/h^2 small, so in that domain
# P = p0 erf( (1-(z/h))/(2 \sqrt(ct/h^2)) )
#
# The degree of consolidation is defined as
# U = (uz - uz0)/(uzinf - uz0)
# where uz0 and uzinf are defined above, and
# uz = the vertical displacement of the top (down is positive)
# U = 1 - (8/\pi^2)\sum_{k=1}^{\infty} \frac{1}{(2k-1)^2} \exp(-(2k-1)^2 \pi^2 ct/(4 h^2))
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 10
xmin = -1
xmax = 1
ymin = -1
ymax = 1
zmin = 0
zmax = 10
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
PorousFlowDictator = dictator
block = 0
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[porepressure]
[]
[]
[BCs]
[confinex]
type = DirichletBC
variable = disp_x
value = 0
boundary = 'left right'
[]
[confiney]
type = DirichletBC
variable = disp_y
value = 0
boundary = 'bottom top'
[]
[basefixed]
type = DirichletBC
variable = disp_z
value = 0
boundary = back
[]
[topdrained]
type = DirichletBC
variable = porepressure
value = 0
boundary = front
[]
[topload]
type = NeumannBC
variable = disp_z
value = -1
boundary = front
[]
[]
[FluidProperties]
[the_simple_fluid]
type = SimpleFluidProperties
thermal_expansion = 0.0
bulk_modulus = 8.0
viscosity = 0.96
density0 = 1.0
[]
[]
[PorousFlowBasicTHM]
coupling_type = HydroMechanical
displacements = 'disp_x disp_y disp_z'
multiply_by_density = false
porepressure = porepressure
biot_coefficient = 0.6
gravity = '0 0 0'
fp = the_simple_fluid
[]
[Materials]
[elasticity_tensor]
type = ComputeElasticityTensor
C_ijkl = '2 3'
# bulk modulus is lambda + 2*mu/3 = 2 + 2*3/3 = 4
fill_method = symmetric_isotropic
[]
[strain]
type = ComputeSmallStrain
[]
[stress]
type = ComputeLinearElasticStress
[]
[porosity]
type = PorousFlowPorosityConst # only the initial value of this is used
porosity = 0.1
[]
[biot_modulus]
type = PorousFlowConstantBiotModulus
biot_coefficient = 0.6
fluid_bulk_modulus = 8
solid_bulk_compliance = 0.25
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1.5 0 0 0 1.5 0 0 0 1.5'
[]
[]
[Postprocessors]
[p0]
type = PointValue
outputs = csv
point = '0 0 0'
variable = porepressure
use_displaced_mesh = false
[]
[p1]
type = PointValue
outputs = csv
point = '0 0 1'
variable = porepressure
use_displaced_mesh = false
[]
[p2]
type = PointValue
outputs = csv
point = '0 0 2'
variable = porepressure
use_displaced_mesh = false
[]
[p3]
type = PointValue
outputs = csv
point = '0 0 3'
variable = porepressure
use_displaced_mesh = false
[]
[p4]
type = PointValue
outputs = csv
point = '0 0 4'
variable = porepressure
use_displaced_mesh = false
[]
[p5]
type = PointValue
outputs = csv
point = '0 0 5'
variable = porepressure
use_displaced_mesh = false
[]
[p6]
type = PointValue
outputs = csv
point = '0 0 6'
variable = porepressure
use_displaced_mesh = false
[]
[p7]
type = PointValue
outputs = csv
point = '0 0 7'
variable = porepressure
use_displaced_mesh = false
[]
[p8]
type = PointValue
outputs = csv
point = '0 0 8'
variable = porepressure
use_displaced_mesh = false
[]
[p9]
type = PointValue
outputs = csv
point = '0 0 9'
variable = porepressure
use_displaced_mesh = false
[]
[p99]
type = PointValue
outputs = csv
point = '0 0 10'
variable = porepressure
use_displaced_mesh = false
[]
[zdisp]
type = PointValue
outputs = csv
point = '0 0 10'
variable = disp_z
use_displaced_mesh = false
[]
[dt]
type = FunctionValuePostprocessor
outputs = console
function = if(0.5*t<0.1,0.5*t,0.1)
[]
[]
[Preconditioning]
[andy]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
start_time = 0
end_time = 10
[TimeStepper]
type = PostprocessorDT
postprocessor = dt
dt = 0.0001
[]
[]
[Outputs]
execute_on = 'timestep_end'
file_base = terzaghi_basicthm
[csv]
type = CSV
[]
[]
(test/tests/bounds/constant_bounds_elem.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = 1
nx = 10
[]
[Variables]
[u]
order = CONSTANT
family = MONOMIAL
[]
[v]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxVariables]
[bounds_dummy]
order = CONSTANT
family = MONOMIAL
[]
[]
[Kernels]
[diff_u]
type = Diffusion
variable = u
[]
[reaction_u]
type = Reaction
variable = u
[]
[diff_v]
type = Diffusion
variable = v
[]
[reaction_v]
type = Reaction
variable = v
[]
[]
[DGKernels]
[dg_diff_u]
type = ADDGDiffusion
variable = u
epsilon = -1
sigma = 6
diff = 3
[]
[dg_diff_v]
type = ADDGDiffusion
variable = v
epsilon = -1
sigma = 6
diff = 4
[]
[]
[BCs]
[left_u]
type = DGFunctionDiffusionDirichletBC
variable = u
boundary = '0'
function = -0.5
epsilon = -1
sigma = 6
[]
[right_u]
type = NeumannBC
variable = u
boundary = 1
value = 30
[]
[left_v]
type = DGFunctionDiffusionDirichletBC
variable = v
boundary = '0'
function = 4
epsilon = -1
sigma = 6
[]
[right_v]
type = NeumannBC
variable = v
boundary = 1
value = -40
[]
[]
[Bounds]
[u_upper_bound]
type = ConstantBounds
variable = bounds_dummy
bounded_variable = u
bound_type = upper
bound_value = 1
[]
[u_lower_bound]
type = ConstantBounds
variable = bounds_dummy
bounded_variable = u
bound_type = lower
bound_value = 0
[]
[v_upper_bound]
type = ConstantBounds
variable = bounds_dummy
bounded_variable = v
bound_type = upper
bound_value = 3
[]
[v_lower_bound]
type = ConstantBounds
variable = bounds_dummy
bounded_variable = v
bound_type = lower
bound_value = -1
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-snes_type'
petsc_options_value = 'vinewtonrsls'
[]
[Outputs]
exodus = true
[]
(modules/solid_mechanics/test/tests/test_jacobian/jacobian_test_planestrain.i)
# This test is designed to test the jacobian for a single
# element with/without volumetric locking correction.
# The mesh contains one element whose y displacement is zero at
# the bottom surface (y=0) and -1.0 at the top surface (y=1).
# Result: The hand coded jacobian matches well with the finite
# difference jacobian with an error norm in the order of 1e-15
# for total and incremental small strain formulations and with
# an error in the order of 1e-8 for finite strain formulations.
[Mesh]
type = GeneratedMesh
dim = 2
nx = 1
ny = 1
[]
[Variables]
[./disp_x]
order = FIRST
family = LAGRANGE
[../]
[./disp_y]
order = FIRST
family = LAGRANGE
[../]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Kernels]
[SolidMechanics]
[../]
[]
[BCs]
[./y_force]
type = NeumannBC
variable = disp_y
boundary = top
value = -1.0
[../]
[./bottom]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[../]
[]
[Materials]
[./elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1e6
poissons_ratio = 0.3
block = 0
[../]
[./strain]
block = 0
[../]
[./stress]
block = 0
[../]
[]
[Preconditioning]
active = 'smp'
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient #Transient
solve_type = NEWTON
petsc_options = '-snes_check_jacobian -snes_check_jacobian_view'
l_max_its = 100
nl_abs_tol = 1e-4
start_time = 0.0
num_steps = 1
dt = 0.005
dtmin = 0.005
end_time = 0.005
[]
(test/tests/bcs/ad_1d_neumann/1d_neumann.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 10
construct_side_list_from_node_list = true
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = ADNeumannBC
variable = u
boundary = right
value = 2
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
(modules/optimization/test/tests/optimizationreporter/material/forward.i)
[Mesh]
[]
[Variables]
[temperature]
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = temperature
diffusivity = thermal_conductivity
[]
[heat_source]
type = BodyForce
value = 1000
variable = temperature
[]
[]
[BCs]
[left]
type = NeumannBC
variable = temperature
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = temperature
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = temperature
boundary = bottom
value = 200
[]
[top]
type = DirichletBC
variable = temperature
boundary = top
value = 100
[]
[]
[Functions]
[thermo_conduct]
type = ParsedOptimizationFunction
expression = 'alpha'
param_symbol_names = 'alpha'
param_vector_name = 'params/p1'
[]
[]
[Materials]
[steel]
type = GenericFunctionMaterial
prop_names = 'thermal_conductivity'
prop_values = 'thermo_conduct'
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
nl_abs_tol = 1e-8
nl_rel_tol = 1e-8
petsc_options_iname = '-ksp_type -pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'preonly lu superlu_dist'
[]
[Reporters]
[measure_data]
type = OptimizationData
variable = temperature
[]
[params]
type = ConstantReporter
real_vector_names = 'p1'
real_vector_values = '0' # Dummy value
[]
[]
[Outputs]
console = false
file_base = 'forward'
[]
(test/tests/time_integrators/aee/aee.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 10
xmin = 0.0
xmax = 1.0
[]
#still need BC for Energy, IC's for both.
[Variables]
active = 'Time'
[./Time]
order = FIRST
family = LAGRANGE
initial_condition = 0.0
[../]
[]
[Functions]
active = 'func'
[./func]
type = ParsedFunction
expression = 2.0*t
[../]
[]
[Kernels]
active = 't_time func_time'
[./t_time]
type = TimeDerivative
variable = Time
[../]
[./func_time]
type = BodyForce
variable = Time
function = func
[../]
[]
[BCs]
active = 'Top_Temperature'
[./Top_Temperature]
type = NeumannBC
variable = Time
boundary = 'left right'
[../]
[]
[Executioner]
type = Transient
scheme = 'BDF2'
#scheme = 'crank-nicolson'
start_time = 0
num_steps = 4
nl_abs_tol = 1e-15
petsc_options = '-snes_converged_reason'
abort_on_solve_fail = true
[./TimeStepper]
type = AB2PredictorCorrector
dt = .01
e_max = 10
e_tol = 1
[../]
[]
[Outputs]
exodus = true
[]
(test/tests/misc/save_in/save_in_soln_var_err_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./saved]
[../]
[./bc_saved]
[../]
[./accumulated]
[../]
[./diag_saved]
[../]
[./bc_diag_saved]
[../]
[./saved_dirichlet]
[../]
[./diag_saved_dirichlet]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
save_in = 'u saved accumulated saved_dirichlet'
diag_save_in = 'diag_saved diag_saved_dirichlet'
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
save_in = saved_dirichlet
diag_save_in = diag_saved_dirichlet
[../]
[./nbc]
type = NeumannBC
variable = u
boundary = right
value = 1
save_in = 'bc_saved accumulated'
diag_save_in = bc_diag_saved
[../]
[]
[Postprocessors]
[./left_flux]
type = NodalSum
variable = saved
boundary = 1
[../]
[./saved_norm]
type = NodalL2Norm
variable = saved
execute_on = timestep_end
block = 0
[../]
[./saved_dirichlet_norm]
type = NodalL2Norm
variable = saved_dirichlet
execute_on = timestep_end
block = 0
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
file_base = out
exodus = true
[]
(test/tests/bcs/1d_neumann/1d_neumann.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 10
construct_side_list_from_node_list = true
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = NeumannBC
variable = u
boundary = right
value = 2
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
(test/tests/outputs/debug/show_top_residuals_debug.i)
[Mesh]
block_id = '0 1'
block_name = 'block_zero block_one'
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
[]
[./subdomain_id]
input = gen
type = SubdomainIDGenerator
subdomain_id = 1
[../]
[]
[Variables]
[./u]
family = LAGRANGE
order = FIRST
[../]
[./v]
family = MONOMIAL
order = CONSTANT
[../]
[./w]
family = SCALAR
order = FIRST
[../]
[]
[Kernels]
[./u_kernel]
type = Diffusion
variable = u
[../]
[./v_kernel]
type = Diffusion
variable = v
[../]
[]
[BCs]
[./u_bc]
type = DirichletBC
variable = u
value = 100
boundary = left
[../]
[./v_bc]
type = NeumannBC
variable = v
value = 100
boundary = left
[../]
[]
[ScalarKernels]
[./w_kernel]
type = AlphaCED
variable = w
value = 100
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
# For this test, we don't actually want the solution to converge because we
# want nonzero nonlinear residual entries at the end of the time step.
nl_abs_tol = 0.999
nl_rel_tol = 0.999
l_max_its = 1
petsc_options_iname = '-pc_type'
petsc_options_value = 'none'
[]
[Debug]
show_top_residuals = 10
[]
(test/tests/kernels/2d_diffusion/2d_diffusion_neumannbc_test.i)
[Mesh]
[square]
type = GeneratedMeshGenerator
nx = 2
ny = 2
dim = 2
[]
[]
[Variables]
active = 'u'
[u]
order = FIRST
family = LAGRANGE
[]
[]
[Kernels]
active = 'diff'
[diff]
type = Diffusion
variable = u
[]
[]
[BCs]
active = 'left right'
[left]
type = DirichletBC
variable = u
boundary = 3
value = 0
[]
[right]
type = NeumannBC
variable = u
boundary = 1
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
file_base = neumannbc_out
exodus = true
[]
(modules/heat_transfer/test/tests/code_verification/cartesian_test_no4.i)
# Problem I.4
#
# An infinite plate with constant thermal conductivity k and internal
# heat generation q. The left boundary is exposed to a constant heat flux q0.
# The right boundary is exposed to a fluid with constant temperature uf and
# heat transfer coefficient h, which results in the convective boundary condition.
#
# REFERENCE:
# A. Toptan, et al. (Mar.2020). Tech. rep. CASL-U-2020-1939-000, SAND2020-3887 R. DOI:10.2172/1614683.
[Mesh]
[./geom]
type = GeneratedMeshGenerator
dim = 1
elem_type = EDGE2
nx = 1
[../]
[]
[Variables]
[./u]
order = FIRST
[../]
[]
[Functions]
[./exact]
type = ParsedFunction
symbol_names = 'q q0 k L uf h'
symbol_values = '1200 200 1 1 100 10.0'
expression = 'uf + (q0 + L * q)/h + 0.5 * ( 2 * q0 + q * (L + x)) * (L-x) / k'
[../]
[]
[Kernels]
[./heat]
type = HeatConduction
variable = u
[../]
[./heatsource]
type = HeatSource
function = 1200
variable = u
[../]
[]
[BCs]
[./ui]
type = NeumannBC
boundary = left
variable = u
value = 200
[../]
[./uo]
type = CoupledConvectiveHeatFluxBC
boundary = right
variable = u
htc = 10.0
T_infinity = 100
[../]
[]
[Materials]
[./property]
type = GenericConstantMaterial
prop_names = 'density specific_heat thermal_conductivity'
prop_values = '1.0 1.0 1.0'
[../]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[./error]
type = ElementL2Error
function = exact
variable = u
[../]
[./h]
type = AverageElementSize
[]
[]
[Outputs]
csv = true
[]
(modules/solid_mechanics/test/tests/static_deformations/cosserat_shear.i)
[Mesh]
type = GeneratedMesh
dim = 3
nx = 6
ny = 6
ymin = 0
ymax = 10
nz = 1
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
Cosserat_rotations = 'wc_x wc_y wc_z'
[]
[Postprocessors]
[./disp_y_top]
type = PointValue
point = '0.5 1 0.1'
variable = disp_y
[../]
[./disp_x_top]
type = PointValue
point = '0.5 1 0.1'
variable = disp_x
[../]
[./wc_z_top]
type = PointValue
point = '0.5 1 0.1'
variable = wc_z
[../]
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[./disp_z]
[../]
[./wc_x]
[../]
[./wc_y]
[../]
[./wc_z]
[../]
[]
[Kernels]
[./cx_elastic]
type = CosseratStressDivergenceTensors
variable = disp_x
displacements = 'disp_x disp_y disp_z'
component = 0
[../]
[./cy_elastic]
type = CosseratStressDivergenceTensors
variable = disp_y
displacements = 'disp_x disp_y disp_z'
component = 1
[../]
[./cz_elastic]
type = CosseratStressDivergenceTensors
variable = disp_z
component = 2
displacements = 'disp_x disp_y disp_z'
[../]
[./x_couple]
type = StressDivergenceTensors
variable = wc_x
displacements = 'wc_x wc_y wc_z'
component = 0
base_name = couple
[../]
[./y_couple]
type = StressDivergenceTensors
variable = wc_y
component = 1
displacements = 'wc_x wc_y wc_z'
base_name = couple
[../]
[./z_couple]
type = StressDivergenceTensors
variable = wc_z
component = 2
displacements = 'wc_x wc_y wc_z'
base_name = couple
[../]
[./x_moment]
type = MomentBalancing
variable = wc_x
component = 0
[../]
[./y_moment]
type = MomentBalancing
variable = wc_y
component = 1
[../]
[./z_moment]
type = MomentBalancing
variable = wc_z
component = 2
[../]
[]
[BCs]
[./Periodic]
[./xperiodic]
auto_direction = x
variable = 'disp_x disp_y disp_z wc_x wc_y wc_z'
[../]
[./zperiodic]
auto_direction = z
variable = 'disp_x disp_y disp_z wc_x wc_y wc_z'
[../]
[../]
[./ux_equals_zero_on_top]
type = DirichletBC
variable = disp_x
boundary = top
value = 0
[../]
[./wcx_equals_zero_on_top]
type = DirichletBC
variable = wc_x
boundary = top
value = 0
[../]
[./wcy_equals_zero_on_top]
type = DirichletBC
variable = wc_y
boundary = top
value = 0
[../]
[./wcz_equals_zero_on_top]
type = DirichletBC
variable = wc_z
boundary = top
value = 0
[../]
# following is natural BC
[./top_cauchy_zero]
type = NeumannBC
variable = disp_x
boundary = top
value = 0
[../]
[./ux_bottom]
type = DirichletBC
variable = disp_x
boundary = bottom
value = 1.0
[../]
[./uy_bottom]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[../]
[./uz_bottom]
type = DirichletBC
variable = disp_z
boundary = bottom
value = 0.0
[../]
[./wc_x_bottom]
type = DirichletBC
variable = wc_x
boundary = bottom
value = 0.0
[../]
[./wc_y_bottom]
type = DirichletBC
variable = wc_y
boundary = bottom
value = 0.0
[../]
[./wc_z_bottom]
type = DirichletBC
variable = wc_z
boundary = bottom
value = 0.17
[../]
[]
[Materials]
[./elasticity_tensor]
type = ComputeCosseratElasticityTensor
B_ijkl = 40
E_ijkl = '5 10 5'
fill_method = 'general_isotropic'
[../]
[./strain]
type = ComputeCosseratSmallStrain
[../]
[./stress]
type = ComputeCosseratLinearElasticStress
[../]
[]
[Preconditioning]
[./andy]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -snes_atol -snes_rtol -snes_max_it -ksp_atol -ksp_rtol'
petsc_options_value = 'gmres bjacobi 1E-10 1E-10 10 1E-15 1E-10'
[../]
[]
[Executioner]
type = Transient
solve_type = Newton
num_steps = 1
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(modules/solid_mechanics/test/tests/test_jacobian/jacobian_test_3D.i)
# This test is designed to test the jacobian for a single
# element with/without volumetric locking correction.
# The mesh contains one element whose y displacement is zero at
# the bottom surface (y=0) and -1.0 at the top surface (y=1).
# Result: The hand coded jacobian matches well with the finite
# difference jacobian with an error norm in the order of 1e-15
# for total and incremental small strain cases and with an error
# norm in the order of 1e-8 for finite strain cases.
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 1
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[./disp_z]
[../]
[]
[Physics/SolidMechanics/QuasiStatic]
[./all]
[../]
[]
[BCs]
[./y_force]
type = NeumannBC
variable = disp_y
boundary = top
value = -1.0
[../]
[./bottom]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[../]
[]
[Materials]
[./elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1e6
poissons_ratio = 0.3
block = 0
[../]
[./stress]
block = 0
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options = '-snes_check_jacobian -snes_check_jacobian_view'
l_max_its = 100
nl_abs_tol = 1e-4
start_time = 0.0
num_steps = 1
dt = 0.005
dtmin = 0.005
end_time = 0.005
[]
(test/tests/fvkernels/fv_anisotropic_diffusion/fv_anisotropic_diffusion.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '10 10'
ix = '2 2'
dy = '20'
iy = '4'
subdomain_id = '1 2'
[]
[]
[Variables]
[v]
family = MONOMIAL
order = CONSTANT
fv = true
[]
[u]
order = FIRST
family = LAGRANGE
[]
[]
[Kernels]
[fem_diff1]
type = AnisotropicDiffusion
variable = u
tensor_coeff = '1 0 0
0 10 0
0 0 0'
block = 1
[]
[fem_diff2]
type = AnisotropicDiffusion
variable = u
tensor_coeff = '10 0 0
0 10 0
0 0 0'
block = 2
[]
[]
[BCs]
[fem_left_bottom]
type = NeumannBC
variable = u
boundary = 'left bottom'
value = 1
[]
[fem_top_right]
type = DirichletBC
variable = u
boundary = 'right top'
value = 0
[]
[]
[FVKernels]
[diff]
type = FVAnisotropicDiffusion
variable = v
coeff = coeff
[]
[]
[FVBCs]
[left_bottom]
type = FVNeumannBC
variable = v
boundary = 'left bottom'
value = 1
[]
[top_right]
type = FVDirichletBC
variable = v
boundary = 'right top'
value = 0
[]
[]
[Materials]
[diff1]
type = ADGenericVectorFunctorMaterial
prop_names = 'coeff'
prop_values = '1 10 1'
block = 1
[]
[diff2]
type = ADGenericVectorFunctorMaterial
prop_names = 'coeff'
prop_values = '10 10 1'
block = 2
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
(modules/combined/test/tests/optimization/compliance_sensitivity/thermal_test.i)
vol_frac = 0.4
cost_frac = 10.0
power = 2.0
E0 = 1.0e-6
E1 = 1.0
rho0 = 0.0
rho1 = 1.0
C0 = 1.0e-6
C1 = 1.0
TC0 = 1.0e-16
TC1 = 1.0
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[MeshGenerator]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmin = 0
xmax = 40
ymin = 0
ymax = 40
[]
[node]
type = ExtraNodesetGenerator
input = MeshGenerator
new_boundary = hold
nodes = 0
[]
[push_left]
type = ExtraNodesetGenerator
input = node
new_boundary = push_left
coord = '16 0 0'
[]
[push_center]
type = ExtraNodesetGenerator
input = push_left
new_boundary = push_center
coord = '24 0 0'
[]
[extra]
type = SideSetsFromBoundingBoxGenerator
input = push_center
bottom_left = '-0.01 17.999 0'
top_right = '5 22.001 0'
boundary_new = n1
included_boundaries = left
[]
[dirichlet_bc]
type = SideSetsFromNodeSetsGenerator
input = extra
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[temp]
initial_condition = 100.0
[]
[]
[AuxVariables]
[Dc]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[Cc]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[Tc]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[Cost]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[mat_den]
family = MONOMIAL
order = FIRST
initial_condition = ${vol_frac}
[]
[]
[AuxKernels]
[Cost]
type = MaterialRealAux
variable = Cost
property = Cost_mat
[]
[]
[Kernels]
[heat_conduction]
type = HeatConduction
variable = temp
diffusion_coefficient = thermal_cond
[]
[heat_source]
type = HeatSource
value = 1e-2 # W/m^3
variable = temp
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = hold
value = 0.0
[]
[no_x_symm]
type = DirichletBC
variable = disp_x
boundary = right
value = 0.0
[]
[left_n1]
type = DirichletBC
variable = temp
boundary = n1
value = 0.0
[]
[top]
type = NeumannBC
variable = temp
boundary = top
value = 0
[]
[bottom]
type = NeumannBC
variable = temp
boundary = bottom
value = 0
[]
[right]
type = NeumannBC
variable = temp
boundary = right
value = 0
[]
[left]
type = NeumannBC
variable = temp
boundary = left
value = 0
[]
[]
[NodalKernels]
[push_left]
type = NodalGravity
variable = disp_y
boundary = push_left
gravity_value = 0.0 # -1e-8
mass = 1
[]
[push_center]
type = NodalGravity
variable = disp_y
boundary = push_center
gravity_value = 0.0 # -1e-8
mass = 1
[]
[]
[Materials]
[thermal_cond]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${TC0}-${TC1})/(${rho0}^${power}-${rho1}^${power}); "
"B1:=${TC0}-A1*${rho0}^${power}; TC1:=A1*mat_den^${power}+B1; TC1"
coupled_variables = 'mat_den'
property_name = thermal_cond
outputs = 'exodus'
[]
[thermal_compliance]
type = ThermalCompliance
temperature = temp
thermal_conductivity = thermal_cond
outputs = 'exodus'
[]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'mat_den'
[]
[E_phys]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${E0}-${E1})/(${rho0}^${power}-${rho1}^${power}); "
"B1:=${E0}-A1*${rho0}^${power}; E1:=A1*mat_den^${power}+B1; E1"
coupled_variables = 'mat_den'
property_name = E_phys
[]
[Cost_mat]
type = DerivativeParsedMaterial
# ordered multimaterial simp
expression = "A1:=(${C0}-${C1})/(${rho0}^(1/${power})-${rho1}^(1/${power})); "
"B1:=${C0}-A1*${rho0}^(1/${power}); C1:=A1*mat_den^(1/${power})+B1; C1"
coupled_variables = 'mat_den'
property_name = Cost_mat
[]
[CostDensity]
type = ParsedMaterial
property_name = CostDensity
coupled_variables = 'mat_den Cost'
expression = 'mat_den*Cost'
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys
[]
[cc]
type = CostSensitivity
design_density = mat_den
cost = Cost_mat
outputs = 'exodus'
[]
[tc]
type = ThermalSensitivity
design_density = mat_den
thermal_conductivity = thermal_cond
temperature = temp
outputs = 'exodus'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[rad_avg]
type = RadialAverage
radius = 0.1
weights = linear
prop_name = sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[rad_avg_cost]
type = RadialAverage
radius = 0.1
weights = linear
prop_name = cost_sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[rad_avg_thermal]
type = RadialAverage
radius = 0.1
weights = linear
prop_name = thermal_sensitivity
execute_on = TIMESTEP_END
force_preaux = true
[]
[update]
type = DensityUpdateTwoConstraints
density_sensitivity = Dc
cost_density_sensitivity = Cc
cost = Cost
cost_fraction = ${cost_frac}
design_density = mat_den
volume_fraction = ${vol_frac}
bisection_lower_bound = 0
bisection_upper_bound = 1.0e12 # 100
use_thermal_compliance = true
thermal_sensitivity = Tc
weight_mechanical_thermal = '0 1'
relative_tolerance = 1.0e-12
bisection_move = 0.015
adaptive_move = false
execute_on = TIMESTEP_BEGIN
[]
# Provides Dc
[calc_sense]
type = SensitivityFilter
density_sensitivity = Dc
design_density = mat_den
filter_UO = rad_avg
execute_on = TIMESTEP_END
force_postaux = true
[]
# Provides Cc
[calc_sense_cost]
type = SensitivityFilter
density_sensitivity = Cc
design_density = mat_den
filter_UO = rad_avg_cost
execute_on = TIMESTEP_END
force_postaux = true
[]
# Provides Tc
[calc_sense_thermal]
type = SensitivityFilter
density_sensitivity = Tc
design_density = mat_den
filter_UO = rad_avg_thermal
execute_on = TIMESTEP_END
force_postaux = true
[]
[]
[Executioner]
type = Transient
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-12
dt = 1.0
num_steps = 5
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[right_flux]
type = SideDiffusiveFluxAverage
variable = temp
boundary = right
diffusivity = 10
[]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
function = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = sensitivity
[]
[cost_sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = cost_sensitivity
[]
[cost]
type = ElementIntegralMaterialProperty
mat_prop = CostDensity
[]
[cost_frac]
type = ParsedPostprocessor
function = 'cost / mesh_volume'
pp_names = 'cost mesh_volume'
[]
[objective]
type = ElementIntegralMaterialProperty
mat_prop = strain_energy_density
execute_on = 'INITIAL TIMESTEP_END'
[]
[objective_thermal]
type = ElementIntegralMaterialProperty
mat_prop = thermal_compliance
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
(modules/porous_flow/test/tests/poro_elasticity/terzaghi_fully_saturated_volume.i)
# Terzaghi's problem of consolodation of a drained medium
# The FullySaturated Kernels are used, with multiply_by_density = false
# so that this becomes a linear problem with constant Biot Modulus
#
# A saturated soil sample sits in a bath of water.
# It is constrained on its sides, and bottom.
# Its sides and bottom are also impermeable.
# Initially it is unstressed.
# A normal stress, q, is applied to the soil's top.
# The soil then slowly compresses as water is squeezed
# out from the sample from its top (the top BC for
# the porepressure is porepressure = 0).
#
# See, for example. Section 2.2 of the online manuscript
# Arnold Verruijt "Theory and Problems of Poroelasticity" Delft University of Technology 2013
# but note that the "sigma" in that paper is the negative
# of the stress in TensorMechanics
#
# Here are the problem's parameters, and their values:
# Soil height. h = 10
# Soil's Lame lambda. la = 2
# Soil's Lame mu, which is also the Soil's shear modulus. mu = 3
# Soil bulk modulus. K = la + 2*mu/3 = 4
# Soil confined compressibility. m = 1/(K + 4mu/3) = 0.125
# Soil bulk compliance. 1/K = 0.25
# Fluid bulk modulus. Kf = 8
# Fluid bulk compliance. 1/Kf = 0.125
# Fluid mobility (soil permeability/fluid viscosity). k = 1.5
# Soil initial porosity. phi0 = 0.1
# Biot coefficient. alpha = 0.6
# Soil initial storativity, which is the reciprocal of the initial Biot modulus. S = phi0/Kf + (alpha - phi0)(1 - alpha)/K = 0.0625
# Consolidation coefficient. c = k/(S + alpha^2 m) = 13.95348837
# Normal stress on top. q = 1
# Initial porepressure, resulting from instantaneous application of q, assuming corresponding instantaneous increase of porepressure (Note that this is calculated by MOOSE: we only need it for the analytical solution). p0 = alpha*m*q/(S + alpha^2 m) = 0.69767442
# Initial vertical displacement (down is positive), resulting from instantaneous application of q (Note this is calculated by MOOSE: we only need it for the analytical solution). uz0 = q*m*h*S/(S + alpha^2 m)
# Final vertical displacement (down in positive) (Note this is calculated by MOOSE: we only need it for the analytical solution). uzinf = q*m*h
#
# The solution for porepressure is
# P = 4*p0/\pi \sum_{k=1}^{\infty} \frac{(-1)^{k-1}}{2k-1} \cos ((2k-1)\pi z/(2h)) \exp(-(2k-1)^2 \pi^2 ct/(4 h^2))
# This series converges very slowly for ct/h^2 small, so in that domain
# P = p0 erf( (1-(z/h))/(2 \sqrt(ct/h^2)) )
#
# The degree of consolidation is defined as
# U = (uz - uz0)/(uzinf - uz0)
# where uz0 and uzinf are defined above, and
# uz = the vertical displacement of the top (down is positive)
# U = 1 - (8/\pi^2)\sum_{k=1}^{\infty} \frac{1}{(2k-1)^2} \exp(-(2k-1)^2 \pi^2 ct/(4 h^2))
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 10
xmin = -1
xmax = 1
ymin = -1
ymax = 1
zmin = 0
zmax = 10
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
PorousFlowDictator = dictator
block = 0
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'porepressure disp_x disp_y disp_z'
number_fluid_phases = 1
number_fluid_components = 1
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[porepressure]
[]
[]
[BCs]
[confinex]
type = DirichletBC
variable = disp_x
value = 0
boundary = 'left right'
[]
[confiney]
type = DirichletBC
variable = disp_y
value = 0
boundary = 'bottom top'
[]
[basefixed]
type = DirichletBC
variable = disp_z
value = 0
boundary = back
[]
[topdrained]
type = DirichletBC
variable = porepressure
value = 0
boundary = front
[]
[topload]
type = NeumannBC
variable = disp_z
value = -1
boundary = front
[]
[]
[Kernels]
[grad_stress_x]
type = StressDivergenceTensors
variable = disp_x
component = 0
[]
[grad_stress_y]
type = StressDivergenceTensors
variable = disp_y
component = 1
[]
[grad_stress_z]
type = StressDivergenceTensors
variable = disp_z
component = 2
[]
[poro_x]
type = PorousFlowEffectiveStressCoupling
biot_coefficient = 0.6
variable = disp_x
component = 0
[]
[poro_y]
type = PorousFlowEffectiveStressCoupling
biot_coefficient = 0.6
variable = disp_y
component = 1
[]
[poro_z]
type = PorousFlowEffectiveStressCoupling
biot_coefficient = 0.6
component = 2
variable = disp_z
[]
[mass0]
type = PorousFlowFullySaturatedMassTimeDerivative
coupling_type = HydroMechanical
biot_coefficient = 0.6
multiply_by_density = false
variable = porepressure
[]
[flux]
type = PorousFlowFullySaturatedDarcyBase
multiply_by_density = false
variable = porepressure
gravity = '0 0 0'
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 8
density0 = 1
thermal_expansion = 0
viscosity = 0.96
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
[]
[elasticity_tensor]
type = ComputeElasticityTensor
C_ijkl = '2 3'
# bulk modulus is lambda + 2*mu/3 = 2 + 2*3/3 = 4
fill_method = symmetric_isotropic
[]
[strain]
type = ComputeSmallStrain
[]
[stress]
type = ComputeLinearElasticStress
[]
[eff_fluid_pressure_qp]
type = PorousFlowEffectiveFluidPressure
[]
[vol_strain]
type = PorousFlowVolumetricStrain
[]
[ppss]
type = PorousFlow1PhaseFullySaturated
porepressure = porepressure
[]
[massfrac]
type = PorousFlowMassFraction
[]
[simple_fluid_qp]
type = PorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[porosity]
type = PorousFlowPorosityConst # only the initial value of this is used
porosity = 0.1
[]
[biot_modulus]
type = PorousFlowConstantBiotModulus
biot_coefficient = 0.6
fluid_bulk_modulus = 8
solid_bulk_compliance = 0.25
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1.5 0 0 0 1.5 0 0 0 1.5'
[]
[]
[Postprocessors]
[p0]
type = PointValue
outputs = csv
point = '0 0 0'
variable = porepressure
use_displaced_mesh = false
[]
[p1]
type = PointValue
outputs = csv
point = '0 0 1'
variable = porepressure
use_displaced_mesh = false
[]
[p2]
type = PointValue
outputs = csv
point = '0 0 2'
variable = porepressure
use_displaced_mesh = false
[]
[p3]
type = PointValue
outputs = csv
point = '0 0 3'
variable = porepressure
use_displaced_mesh = false
[]
[p4]
type = PointValue
outputs = csv
point = '0 0 4'
variable = porepressure
use_displaced_mesh = false
[]
[p5]
type = PointValue
outputs = csv
point = '0 0 5'
variable = porepressure
use_displaced_mesh = false
[]
[p6]
type = PointValue
outputs = csv
point = '0 0 6'
variable = porepressure
use_displaced_mesh = false
[]
[p7]
type = PointValue
outputs = csv
point = '0 0 7'
variable = porepressure
use_displaced_mesh = false
[]
[p8]
type = PointValue
outputs = csv
point = '0 0 8'
variable = porepressure
use_displaced_mesh = false
[]
[p9]
type = PointValue
outputs = csv
point = '0 0 9'
variable = porepressure
use_displaced_mesh = false
[]
[p99]
type = PointValue
outputs = csv
point = '0 0 10'
variable = porepressure
use_displaced_mesh = false
[]
[zdisp]
type = PointValue
outputs = csv
point = '0 0 10'
variable = disp_z
use_displaced_mesh = false
[]
[dt]
type = FunctionValuePostprocessor
outputs = console
function = if(0.5*t<0.1,0.5*t,0.1)
[]
[]
[Preconditioning]
[andy]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
start_time = 0
end_time = 10
[TimeStepper]
type = PostprocessorDT
postprocessor = dt
dt = 0.0001
[]
[]
[Outputs]
execute_on = 'timestep_end'
file_base = terzaghi_fully_saturated_volume
[csv]
type = CSV
[]
[]
(modules/optimization/test/tests/misc/scaling_test/scaling_test.i)
[Problem]
nl_sys_names = 'nl0 adjoint'
kernel_coverage_check = false
[]
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 4
ny = 2
nz = 1
xmin = 9.4615
xmax = 92.0115
ymin = 3.175
ymax = 22.225
zmin = 0.489
zmax = 0.755
[]
[]
[Variables]
[T]
scaling = 10
[]
[lam_T]
nl_sys = adjoint
scaling = 1e3
[]
[]
[Kernels]
[heat_conduction]
type = ADMatDiffusion
variable = T
diffusivity = thermal_conductivity
[]
[heat_source]
type = ADBodyForce
function = src_fuel_function
variable = T
[]
[]
[BCs]
[dir_BC_front]
type = NeumannBC
variable = T
boundary = front
value = 2
[]
[dir_BC_back]
type = DirichletBC
variable = T
boundary = back
value = 300
[]
[]
[Materials]
# fuel properties
[fuel_thermal]
type = ADGenericConstantMaterial
prop_names = thermal_conductivity
prop_values = 17.6e3
[]
[]
[Executioner]
type = SteadyAndAdjoint
forward_system = nl0
adjoint_system = adjoint
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu mumps'
line_search = 'none'
nl_rel_tol = 1e-6
nl_abs_tol = 1e-30
nl_max_its = 10
l_max_its = 10
[]
##---------Forward Optimization stuff------------------#
[Reporters]
[measure_data]
type = ConstantReporter
real_vector_names = 'x y z u weight'
real_vector_values = '0.2 0.2 0.0; 0.3 0.8 0.0; 0 0 0; 5 5 5; 1 1 1'
[]
[params_fuel]
type = ConstantReporter
real_vector_names = 'source'
real_vector_values = '5e7' # Dummy
[]
[]
[Functions]
[src_fuel_function]
type = ParsedOptimizationFunction
expression = q
param_symbol_names = 'q'
param_vector_name = 'params_fuel/source'
[]
[]
##---------Adjoint Optimization stuff------------------#
[DiracKernels]
[adjointLoad_T]
type = ReporterPointSource
variable = lam_T
x_coord_name = measure_data/x
y_coord_name = measure_data/y
z_coord_name = measure_data/z
value_name = measure_data/u
[]
[]
##--------- Outputs ------------------#
[Debug]
show_var_residual_norms = true
[]
(modules/optimization/test/tests/optimizationreporter/constant_heat_source/forward_nonLinear.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmax = 2
ymax = 2
[]
[Variables]
[T]
initial_condition = 100
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = T
diffusivity = thermal_conductivity
[]
[heat_source]
type = BodyForce
function = volumetric_heat_func
variable = T
[]
[]
[BCs]
[left]
type = NeumannBC
variable = T
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = T
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = T
boundary = bottom
value = 200
[]
[top]
type = DirichletBC
variable = T
boundary = top
value = 100
[]
[]
[Functions]
[volumetric_heat_func]
type = ParsedOptimizationFunction
expression = q
param_symbol_names = 'q'
param_vector_name = 'params/q'
[]
[]
[Materials]
[steel]
type = ParsedMaterial
f_name = 'thermal_conductivity'
function = '.01*T'
args = 'T'
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
nl_abs_tol = 1e-8
nl_rel_tol = 1e-8
petsc_options_iname = '-ksp_type -pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'preonly lu superlu_dist'
[]
[Reporters]
[measure_data]
type = OptimizationData
variable = T
[]
[params]
type = ConstantReporter
real_vector_names = 'q'
real_vector_values = '0' # Dummy value
[]
[]
[Outputs]
console = false
file_base = 'forward_nl'
[]
(tutorials/darcy_thermo_mech/step10_multiapps/problems/step10_micro.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
ymax = 0.1
xmax = 0.1
[]
uniform_refine = 0
[]
[Adaptivity]
max_h_level = 4
initial_steps = 6
initial_marker = error_marker
cycles_per_step = 2
marker = error_marker
[Indicators]
[phi_jump]
type = GradientJumpIndicator
variable = phi
[]
[]
[Markers]
[error_marker]
type = ErrorFractionMarker
indicator = phi_jump
refine = 0.8
coarsen = 0.1
[]
[]
[]
[Variables]
[temperature]
initial_condition = 300
[]
[]
[AuxVariables]
[phi]
[]
[]
[AuxKernels]
[corrosion]
type = RandomCorrosion
variable = phi
reference_temperature = 300
temperature = temperature_in
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Kernels]
[heat_conduction]
type = ADHeatConduction
variable = temperature
[]
[]
[BCs]
[left]
type = PostprocessorDirichletBC
variable = temperature
boundary = left
postprocessor = temperature_in
[]
[right]
type = NeumannBC
variable = temperature
boundary = right
value = 100 # prescribed flux
[]
[]
[Materials]
[column]
type = PackedColumn
temperature = temperature
radius = 1 # mm
phase = phi
[]
[]
[Postprocessors]
[temperature_in]
type = Receiver
default = 301
[]
[k_eff]
type = ThermalConductivity
variable = temperature
T_hot = temperature_in
flux = 100
dx = 0.1
boundary = right
length_scale = 1
k0 = 12.05
execute_on = 'INITIAL TIMESTEP_END'
[]
[average_porosity]
type = ADElementAverageMaterialProperty
mat_prop = porosity
execute_on = 'INITIAL TIMESTEP_END'
[]
[t_right]
type = SideAverageValue
boundary = right
variable = temperature
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
end_time = 1000
dt = 1
steady_state_tolerance = 1e-9
steady_state_detection = true
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
automatic_scaling = true
[]
[Outputs]
execute_on = 'initial timestep_end'
exodus = true
[]
[ICs]
[close_pack]
radius = 0.01 # meter
outvalue = 0 # water
variable = phi
invalue = 1 # steel
type = ClosePackIC
[]
[]
(test/tests/bcs/periodic/periodic_subdomain_restricted_test.i)
[Mesh]
file = rect-2blk.e
[]
[Variables]
active = 'u v'
[./u]
order = FIRST
family = LAGRANGE
block = 1
[../]
[./v]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
active = 'diff_u diff_v'
[./diff_u]
type = Diffusion
variable = u
block = 1
[../]
[./diff_v]
type = Diffusion
variable = v
[../]
[]
[BCs]
active = 'Periodic left_u right_u left_v right_v'
[./Periodic]
[./u]
variable = u
primary = 1
secondary = 5
translation = '0 1 0'
[../]
[./v1]
variable = v
primary = 1
secondary = 5
translation = '0 1 0'
[../]
[./v2]
variable = v
primary = 2
secondary = 4
translation = '0 1 0'
[../]
[../]
[./left_u]
type = DirichletBC
variable = u
boundary = 6
value = 0
[../]
[./right_u]
type = NeumannBC
variable = u
boundary = 8
value = 4
[../]
[./left_v]
type = DirichletBC
variable = v
boundary = 6
value = 1
[../]
[./right_v]
type = DirichletBC
variable = v
boundary = 3
value = 6
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
execute_on = 'timestep_end'
file_base = out_restrict
exodus = true
[]
(test/tests/kernels/anisotropic_diffusion/aniso_diffusion.i)
[Mesh]
file = mixed_block.e
uniform_refine=3
[]
[Functions]
[./top_bc]
type = ParsedFunction
expression = 'x'
[../]
[]
[Variables]
active = 'u'
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = AnisotropicDiffusion
variable = u
tensor_coeff = '2 0 0
0 4 0
0 0 0'
[../]
[]
[BCs]
active = 'lower_left top'
[./lower_left]
type = DirichletBC
variable = u
boundary = '1 4'
value = 1
[../]
[./top]
type = FunctionNeumannBC
variable = u
boundary = 3
function = top_bc
[../]
[./right]
type = NeumannBC
variable = u
boundary = 2
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
exodus = true
[]
(test/tests/kernels/ad_2d_diffusion/2d_diffusion_neumannbc_test.i)
[Mesh]
[./square]
type = GeneratedMeshGenerator
nx = 2
ny = 2
dim = 2
[../]
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = ADDiffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = 3
value = 0
[../]
[./right]
type = ADNeumannBC
variable = u
boundary = 1
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
file_base = neumannbc_out
exodus = true
[]
(modules/heat_transfer/test/tests/heat_conduction_ortho/heat_conduction_ortho.i)
#
# Three independent cubes are thermally loaded, one in x, one in y, and one in z.
# Each direction has a different thermal conductivity, resulting in a different
# temperature at the side with the Neumann bc.
#
# For x: 100/1000 = 1e-1
# For y: 100/100 = 1e+0
# for z: 100/10 = 1e+1
#
[Mesh]
file = heat_conduction_ortho.e
[]
[Variables]
[./temperature]
[../]
[]
[Kernels]
[./heat]
type = AnisoHeatConduction
variable = temperature
[../]
[]
[BCs]
[./temperatures]
type = DirichletBC
variable = temperature
boundary = 1
value = 0
[../]
[./neum]
type = NeumannBC
variable = temperature
boundary = 2
value = 100
[../]
[]
[Materials]
[./heat]
type = AnisoHeatConductionMaterial
block = 1
specific_heat = 0.116
thermal_conductivity = '10.0 0 0 0 10.0 0 0 0 10.0'
temperature = temperature
[../]
[./density]
type = GenericConstantMaterial
block = 1
prop_names = 'density'
prop_values = 0.283
[../]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -ksp_gmres_restart'
petsc_options_value = 'lu 101'
line_search = 'none'
nl_abs_tol = 1e-11
nl_rel_tol = 1e-10
l_max_its = 20
[]
[Outputs]
exodus = true
hide = 'tcx tcy tcz'
[]
[Postprocessors]
[./tcx]
type = FunctionValuePostprocessor
function = 1000
outputs = none
execute_on = 'initial timestep_end'
[../]
[./tcy]
type = FunctionValuePostprocessor
function = 100
outputs = none
execute_on = 'initial timestep_end'
[../]
[./tcz]
type = FunctionValuePostprocessor
function = 10
outputs = none
execute_on = 'initial timestep_end'
[../]
[]
(test/tests/executioners/fixed_point/2d_diffusion_fixed_point_toggle_mat.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 4
xmin = -1
xmax = 1
ymin = -1
ymax = 1
[]
[Variables]
[u]
order = FIRST
family = LAGRANGE
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[pseudo_time]
type = MatKernel
variable = u
# material property name is hardcoded in VarCouplingMaterial
mat_prop = 'diffusion'
[]
[pseudo_time_compensation]
type = CoefReaction
variable = u
coefficient = 0.1
[]
[]
[Materials]
[umat]
type = VarCouplingMaterial
var = u
tag = 'previous'
coef = -0.1
[]
[]
[BCs]
[left]
type = VacuumBC
variable = u
boundary = left
[]
[right]
type = NeumannBC
variable = u
boundary = right
value = 1
[]
[]
[Postprocessors]
[unorm]
type = ElementL2Norm
variable = u
[]
[udiff]
type = ElementL2Diff
variable = u
tag = 'previous'
[]
[]
[Problem]
type = FixedPointProblem
fp_tag_name = 'previous'
tagged_vector_for_partial_residual = false
[]
[Executioner]
type = FixedPointSteady
nl_rel_tol = 1e-2
nl_abs_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(modules/heat_transfer/test/tests/code_verification/cartesian_test_no3.i)
# Problem I.3
#
# The thermal conductivity of an infinite plate varies linearly with
# temperature: k = ko(1+beta*u). It has a constant internal heat generation q,
# and has the boundary conditions du/dx = 0 at x= L and u(L) = uo.
#
# REFERENCE:
# A. Toptan, et al. (Mar.2020). Tech. rep. CASL-U-2020-1939-000, SAND2020-3887 R. DOI:10.2172/1614683.
[Mesh]
[./geom]
type = GeneratedMeshGenerator
dim = 1
elem_type = EDGE2
nx = 4
[../]
[]
[Variables]
[./u]
order = FIRST
[../]
[]
[Functions]
[./exact]
type = ParsedFunction
symbol_names = 'q L beta uo ko'
symbol_values = '1200 1 1e-3 0 1'
expression = 'uo+(1/beta)*( ( 1 + (1-(x/L)^2) * (beta*q*L^2) / ko )^0.5 - 1)'
[../]
[]
[Kernels]
[./heat]
type = HeatConduction
variable = u
[../]
[./heatsource]
type = HeatSource
function = 1200
variable = u
[../]
[]
[BCs]
[./ui]
type = NeumannBC
boundary = left
variable = u
value = 0
[../]
[./uo]
type = DirichletBC
boundary = right
variable = u
value = 0
[../]
[]
[Materials]
[./property]
type = GenericConstantMaterial
prop_names = 'density specific_heat'
prop_values = '1.0 1.0'
[../]
[./thermal_conductivity]
type = ParsedMaterial
property_name = 'thermal_conductivity'
coupled_variables = u
expression = '1 * (1 + 1e-3*u)'
[../]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[./error]
type = ElementL2Error
function = exact
variable = u
[../]
[./h]
type = AverageElementSize
[]
[]
[Outputs]
csv = true
[]
(modules/porous_flow/test/tests/poro_elasticity/terzaghi.i)
# Terzaghi's problem of consolodation of a drained medium
#
# A saturated soil sample sits in a bath of water.
# It is constrained on its sides, and bottom.
# Its sides and bottom are also impermeable.
# Initially it is unstressed.
# A normal stress, q, is applied to the soil's top.
# The soil then slowly compresses as water is squeezed
# out from the sample from its top (the top BC for
# the porepressure is porepressure = 0).
#
# See, for example. Section 2.2 of the online manuscript
# Arnold Verruijt "Theory and Problems of Poroelasticity" Delft University of Technology 2013
# but note that the "sigma" in that paper is the negative
# of the stress in TensorMechanics
#
# Here are the problem's parameters, and their values:
# Soil height. h = 10
# Soil's Lame lambda. la = 2
# Soil's Lame mu, which is also the Soil's shear modulus. mu = 3
# Soil bulk modulus. K = la + 2*mu/3 = 4
# Soil confined compressibility. m = 1/(K + 4mu/3) = 0.125
# Soil bulk compliance. 1/K = 0.25
# Fluid bulk modulus. Kf = 8
# Fluid bulk compliance. 1/Kf = 0.125
# Fluid mobility (soil permeability/fluid viscosity). k = 1.5
# Soil initial porosity. phi0 = 0.1
# Biot coefficient. alpha = 0.6
# Soil initial storativity, which is the reciprocal of the initial Biot modulus. S = phi0/Kf + (alpha - phi0)(1 - alpha)/K = 0.0625
# Consolidation coefficient. c = k/(S + alpha^2 m) = 13.95348837
# Normal stress on top. q = 1
# Initial porepressure, resulting from instantaneous application of q, assuming corresponding instantaneous increase of porepressure (Note that this is calculated by MOOSE: we only need it for the analytical solution). p0 = alpha*m*q/(S + alpha^2 m) = 0.69767442
# Initial vertical displacement (down is positive), resulting from instantaneous application of q (Note this is calculated by MOOSE: we only need it for the analytical solution). uz0 = q*m*h*S/(S + alpha^2 m)
# Final vertical displacement (down in positive) (Note this is calculated by MOOSE: we only need it for the analytical solution). uzinf = q*m*h
#
# The solution for porepressure is
# P = 4*p0/\pi \sum_{k=1}^{\infty} \frac{(-1)^{k-1}}{2k-1} \cos ((2k-1)\pi z/(2h)) \exp(-(2k-1)^2 \pi^2 ct/(4 h^2))
# This series converges very slowly for ct/h^2 small, so in that domain
# P = p0 erf( (1-(z/h))/(2 \sqrt(ct/h^2)) )
#
# The degree of consolidation is defined as
# U = (uz - uz0)/(uzinf - uz0)
# where uz0 and uzinf are defined above, and
# uz = the vertical displacement of the top (down is positive)
# U = 1 - (8/\pi^2)\sum_{k=1}^{\infty} \frac{1}{(2k-1)^2} \exp(-(2k-1)^2 \pi^2 ct/(4 h^2))
#
# FINAL NOTE: The above solution assumes constant Biot Modulus.
# In porous_flow this is not true. Therefore the solution is
# a little different than in the paper. This test was therefore
# validated against MOOSE's poromechanics, which can choose either
# a constant Biot Modulus (which has been shown to agree with
# the analytic solution), or a non-constant Biot Modulus (which
# gives the same results as porous_flow).
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 10
xmin = -1
xmax = 1
ymin = -1
ymax = 1
zmin = 0
zmax = 10
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
PorousFlowDictator = dictator
block = 0
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'porepressure disp_x disp_y disp_z'
number_fluid_phases = 1
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureVG
m = 0.8
alpha = 1
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[porepressure]
[]
[]
[BCs]
[confinex]
type = DirichletBC
variable = disp_x
value = 0
boundary = 'left right'
[]
[confiney]
type = DirichletBC
variable = disp_y
value = 0
boundary = 'bottom top'
[]
[basefixed]
type = DirichletBC
variable = disp_z
value = 0
boundary = back
[]
[topdrained]
type = DirichletBC
variable = porepressure
value = 0
boundary = front
[]
[topload]
type = NeumannBC
variable = disp_z
value = -1
boundary = front
[]
[]
[Kernels]
[grad_stress_x]
type = StressDivergenceTensors
variable = disp_x
component = 0
[]
[grad_stress_y]
type = StressDivergenceTensors
variable = disp_y
component = 1
[]
[grad_stress_z]
type = StressDivergenceTensors
variable = disp_z
component = 2
[]
[poro_x]
type = PorousFlowEffectiveStressCoupling
biot_coefficient = 0.6
variable = disp_x
component = 0
[]
[poro_y]
type = PorousFlowEffectiveStressCoupling
biot_coefficient = 0.6
variable = disp_y
component = 1
[]
[poro_z]
type = PorousFlowEffectiveStressCoupling
biot_coefficient = 0.6
component = 2
variable = disp_z
[]
[poro_vol_exp]
type = PorousFlowMassVolumetricExpansion
variable = porepressure
fluid_component = 0
[]
[mass0]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = porepressure
[]
[flux]
type = PorousFlowAdvectiveFlux
variable = porepressure
gravity = '0 0 0'
fluid_component = 0
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 8
density0 = 1
thermal_expansion = 0
viscosity = 0.96
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
[]
[elasticity_tensor]
type = ComputeElasticityTensor
C_ijkl = '2 3'
# bulk modulus is lambda + 2*mu/3 = 2 + 2*3/3 = 4
fill_method = symmetric_isotropic
[]
[strain]
type = ComputeSmallStrain
[]
[stress]
type = ComputeLinearElasticStress
[]
[eff_fluid_pressure_qp]
type = PorousFlowEffectiveFluidPressure
[]
[vol_strain]
type = PorousFlowVolumetricStrain
[]
[ppss]
type = PorousFlow1PhaseP
porepressure = porepressure
capillary_pressure = pc
[]
[massfrac]
type = PorousFlowMassFraction
[]
[simple_fluid]
type = PorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[porosity]
type = PorousFlowPorosity
fluid = true
mechanical = true
ensure_positive = false
porosity_zero = 0.1
biot_coefficient = 0.6
solid_bulk = 4
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1.5 0 0 0 1.5 0 0 0 1.5'
[]
[relperm]
type = PorousFlowRelativePermeabilityCorey
n = 0 # unimportant in this fully-saturated situation
phase = 0
[]
[]
[Postprocessors]
[p0]
type = PointValue
outputs = csv
point = '0 0 0'
variable = porepressure
use_displaced_mesh = false
[]
[p1]
type = PointValue
outputs = csv
point = '0 0 1'
variable = porepressure
use_displaced_mesh = false
[]
[p2]
type = PointValue
outputs = csv
point = '0 0 2'
variable = porepressure
use_displaced_mesh = false
[]
[p3]
type = PointValue
outputs = csv
point = '0 0 3'
variable = porepressure
use_displaced_mesh = false
[]
[p4]
type = PointValue
outputs = csv
point = '0 0 4'
variable = porepressure
use_displaced_mesh = false
[]
[p5]
type = PointValue
outputs = csv
point = '0 0 5'
variable = porepressure
use_displaced_mesh = false
[]
[p6]
type = PointValue
outputs = csv
point = '0 0 6'
variable = porepressure
use_displaced_mesh = false
[]
[p7]
type = PointValue
outputs = csv
point = '0 0 7'
variable = porepressure
use_displaced_mesh = false
[]
[p8]
type = PointValue
outputs = csv
point = '0 0 8'
variable = porepressure
use_displaced_mesh = false
[]
[p9]
type = PointValue
outputs = csv
point = '0 0 9'
variable = porepressure
use_displaced_mesh = false
[]
[p99]
type = PointValue
outputs = csv
point = '0 0 10'
variable = porepressure
use_displaced_mesh = false
[]
[zdisp]
type = PointValue
outputs = csv
point = '0 0 10'
variable = disp_z
use_displaced_mesh = false
[]
[dt]
type = FunctionValuePostprocessor
outputs = console
function = if(0.5*t<0.1,0.5*t,0.1)
[]
[]
[Preconditioning]
[andy]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
start_time = 0
end_time = 10
[TimeStepper]
type = PostprocessorDT
postprocessor = dt
dt = 0.0001
[]
[]
[Outputs]
execute_on = 'timestep_end'
file_base = terzaghi
[csv]
type = CSV
[]
[]
(modules/fsi/test/tests/fsi_acoustics/3D_struc_acoustic/3D_struc_acoustic.i)
# Test for `StructureAcousticInterface` interface kernel. The domain is 3D with lengths
# 10 X 0.1 X 0.1 meters. The fluid domain is on the right and the structural domain
# is on the left. Fluid end is subjected to a 250Hz sine wave with a single peak.
# Structural domain has the same material properties as the fluid. Interface between
# structure and fluid is located at 5.0m in the x-direction. Fluid pressure is recorded
# at (5, 0.05, 0.05). Structural stress is also recorded at the same location. Fluid
# pressure and structural stress should be almost equal and opposite to each other.
#
# Input parameters:
# Dimensions = 3
# Lengths = 10 X 0.1 X 0.1 meters
# Fluid speed of sound = 1500 m/s
# Fluid density = 1e-6 Giga kg/m^3
# Structural bulk modulus = 2.25 GPa
# Structural shear modulus = 0 GPa
# Structural density = 1e-6 Giga kg/m^3
# Fluid domain = true
# Fluid BC = single peak sine wave applied as a pressure on the fluid end
# Structural domain = true
# Structural BC = Neumann BC with value zero applied on the structural end.
# Fluid-structure interface location = 5.0m along the x-direction
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 3
nx = 100
ny = 1
nz = 1
xmax = 10
ymax = 0.1
zmax = 0.1
[]
[./subdomain1]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '5.0 0.0 0.0'
block_id = 1
top_right = '10.0 0.1 0.1'
[../]
[./interface1]
type = SideSetsBetweenSubdomainsGenerator
input = subdomain1
primary_block = 1
paired_block = 0
new_boundary = 'interface1'
[../]
[]
[GlobalParams]
[]
[Variables]
[./p]
block = 1
[../]
[./disp_x]
block = 0
[../]
[./disp_y]
block = 0
[../]
[./disp_z]
block = 0
[../]
[]
[AuxVariables]
[./vel_x]
order = FIRST
family = LAGRANGE
block = 0
[../]
[./accel_x]
order = FIRST
family = LAGRANGE
block = 0
[../]
[./vel_y]
order = FIRST
family = LAGRANGE
block = 0
[../]
[./accel_y]
order = FIRST
family = LAGRANGE
block = 0
[../]
[./vel_z]
order = FIRST
family = LAGRANGE
block = 0
[../]
[./accel_z]
order = FIRST
family = LAGRANGE
block = 0
[../]
[./stress_xx]
order = CONSTANT
family = MONOMIAL
block = 0
[../]
[./stress_yy]
order = CONSTANT
family = MONOMIAL
block = 0
[../]
[./stress_zz]
order = CONSTANT
family = MONOMIAL
block = 0
[../]
[./stress_xy]
order = CONSTANT
family = MONOMIAL
block = 0
[../]
[./stress_xz]
order = CONSTANT
family = MONOMIAL
block = 0
[../]
[./stress_yz]
order = CONSTANT
family = MONOMIAL
block = 0
[../]
[]
[Kernels]
[./diffusion]
type = Diffusion
variable = 'p'
block = 1
[../]
[./inertia]
type = AcousticInertia
variable = p
block = 1
[../]
[./DynamicTensorMechanics]
displacements = 'disp_x disp_y disp_z'
block = 0
[../]
[./inertia_x]
type = InertialForce
variable = disp_x
block = 0
[../]
[./inertia_y]
type = InertialForce
variable = disp_y
block = 0
[../]
[./inertia_z]
type = InertialForce
variable = disp_z
block = 0
[../]
[]
[AuxKernels]
[./accel_x]
type = TestNewmarkTI
displacement = disp_x
variable = accel_x
first = false
block = 0
[../]
[./vel_x]
type = TestNewmarkTI
displacement = disp_x
variable = vel_x
block = 0
[../]
[./accel_y]
type = TestNewmarkTI
displacement = disp_y
variable = accel_y
first = false
block = 0
[../]
[./vel_y]
type = TestNewmarkTI
displacement = disp_y
variable = vel_y
block = 0
[../]
[./accel_z]
type = TestNewmarkTI
displacement = disp_z
variable = accel_z
first = false
block = 0
[../]
[./vel_z]
type = TestNewmarkTI
displacement = disp_z
variable = vel_z
block = 0
[../]
[./stress_xx]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_xx
index_i = 0
index_j = 0
block = 0
[../]
[./stress_yy]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_yy
index_i = 1
index_j = 1
block = 0
[../]
[./stress_zz]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_zz
index_i = 2
index_j = 2
block = 0
[../]
[./stress_xy]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_xy
index_i = 0
index_j = 1
block = 0
[../]
[./stress_xz]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_xz
index_i = 0
index_j = 2
block = 0
[../]
[./stress_yz]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_yz
index_i = 1
index_j = 2
block = 0
[../]
[]
[InterfaceKernels]
[./interface1]
type = StructureAcousticInterface
variable = p
neighbor_var = disp_x
boundary = 'interface1'
D = 1e-6
component = 0
[../]
[./interface2]
type = StructureAcousticInterface
variable = p
neighbor_var = disp_y
boundary = 'interface1'
D = 1e-6
component = 1
[../]
[./interface3]
type = StructureAcousticInterface
variable = p
neighbor_var = disp_z
boundary = 'interface1'
D = 1e-6
component = 2
[../]
[]
[BCs]
[./bottom_accel]
type = FunctionDirichletBC
variable = p
boundary = 'right'
function = accel_bottom
[../]
[./disp_x1]
type = NeumannBC
boundary = 'left'
variable = disp_x
value = 0.0
[../]
[./disp_y1]
type = NeumannBC
boundary = 'left'
variable = disp_y
value = 0.0
[../]
[./disp_z1]
type = NeumannBC
boundary = 'left'
variable = disp_z
value = 0.0
[../]
[]
[Functions]
[./accel_bottom]
type = PiecewiseLinear
data_file = ../1D_struc_acoustic/Input_1Peak_highF.csv
scale_factor = 1e-2
format = 'columns'
[../]
[]
[Materials]
[./co_sq]
type = GenericConstantMaterial
prop_names = inv_co_sq
prop_values = 4.44e-7
block = '1'
[../]
[./density0]
type = GenericConstantMaterial
block = 0
prop_names = density
prop_values = 1e-6
[../]
[./elasticity_base]
type = ComputeIsotropicElasticityTensor
bulk_modulus = 2.25
shear_modulus = 0.0
block = 0
[../]
[./strain]
type = ComputeFiniteStrain
block = 0
displacements = 'disp_x disp_y disp_z'
[../]
[./stress]
type = ComputeFiniteStrainElasticStress
block = 0
[../]
[]
[Preconditioning]
[./andy]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
start_time = 0.0
end_time = 0.005
dt = 0.0001
dtmin = 0.00001
nl_abs_tol = 1e-8
nl_rel_tol = 1e-8
l_tol = 1e-8
l_max_its = 25
timestep_tolerance = 1e-8
automatic_scaling = true
[TimeIntegrator]
type = NewmarkBeta
[]
[]
[Postprocessors]
[./p1]
type = PointValue
point = '5.0 0.05 0.05'
variable = p
[../]
[./stress_xx]
type = PointValue
point = '5.0 0.05 0.05'
variable = stress_xx
[../]
[]
[Outputs]
csv = true
perf_graph = true
print_linear_residuals = true
[]
(modules/fsi/test/tests/fsi_acoustics/1D_struc_acoustic/1D_struc_acoustic.i)
# Test for `StructureAcousticInterface` interface kernel. The domain is 1D with 20m
# length. The fluid domain is on the right and the structural domain is on the left.
# Fluid end is subjected to a 250Hz sine wave with a single peak of amplitude unity.
# Structural domain is 4 times as dense as the fluid domain with all other material
# properties being the same. Fluid pressure is recorded at the midpoint in the fluid
# domain (i.e., at 15m). Structural stress is recorded at the midpoint in the structural
# domain (i.e., at 5m). The recorded pressure and stress amplitudes should match
# with theoretical values.
#
# Input parameters:
# Dimensions = 1
# Length = 20 meters
# Fluid speed of sound = 1500 m/s
# Fluid density = 1e-6 Giga kg/m^3
# Structural bulk modulus = 2.25 GPa
# Structural shear modulus = 0 GPa
# Structural density = 4e-6 Giga kg/m^3
# Fluid domain = true
# Fluid BC = single peak sine wave applied as a pressure on the fluid end
# Structural domain = true
# Structural BC = Neumann BC with value zero applied on the structural end.
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 50
xmax = 20
[]
[./subdomain1]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '10.0 0 0'
block_id = 1
top_right = '20.0 0.0 0'
[../]
[./interface1]
type = SideSetsBetweenSubdomainsGenerator
input = subdomain1
primary_block = '1'
paired_block = 0
new_boundary = 'interface1'
[../]
[]
[GlobalParams]
[]
[Variables]
[./p]
block = 1
[../]
[./disp_x]
block = 0
[../]
[]
[AuxVariables]
[./vel_x]
order = FIRST
family = LAGRANGE
block = 0
[../]
[./accel_x]
order = FIRST
family = LAGRANGE
block = 0
[../]
[./stress_xx]
order = CONSTANT
family = MONOMIAL
block = 0
[../]
[]
[Kernels]
[./diffusion]
type = Diffusion
variable = 'p'
block = 1
[../]
[./inertia]
type = AcousticInertia
variable = p
block = 1
[../]
[./DynamicTensorMechanics]
displacements = 'disp_x'
block = 0
[../]
[./inertia_x1]
type = InertialForce
variable = disp_x
block = 0
[../]
[]
[AuxKernels]
[./accel_x]
type = TestNewmarkTI
displacement = disp_x
variable = accel_x
first = false
block = 0
[../]
[./vel_x]
type = TestNewmarkTI
displacement = disp_x
variable = vel_x
block = 0
[../]
[./stress_xx]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_xx
index_i = 0
index_j = 0
block = 0
[../]
[]
[InterfaceKernels]
[./interface1]
type = StructureAcousticInterface
variable = p
neighbor_var = disp_x
boundary = 'interface1'
D = 1e-6
component = 0
[../]
[]
[BCs]
[./bottom_accel]
type = FunctionDirichletBC
variable = p
boundary = 'right'
function = accel_bottom
[../]
[./disp_x1]
type = NeumannBC
boundary = 'left'
variable = disp_x
value = 0.0
[../]
[]
[Functions]
[./accel_bottom]
type = PiecewiseLinear
data_file = Input_1Peak_highF.csv
scale_factor = 1e-2
format = 'columns'
[../]
[]
[Materials]
[./co_sq]
type = GenericConstantMaterial
prop_names = inv_co_sq
prop_values = 4.44e-7
block = '1'
[../]
[./density0]
type = GenericConstantMaterial
block = 0
prop_names = density
prop_values = 4e-6
[../]
[./elasticity_base]
type = ComputeIsotropicElasticityTensor
bulk_modulus = 2.25
shear_modulus = 0.0
block = 0
[../]
[./strain]
type = ComputeFiniteStrain
block = 0
displacements = 'disp_x'
[../]
[./stress]
type = ComputeFiniteStrainElasticStress
block = 0
[../]
[]
[Preconditioning]
[./andy]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
start_time = 0.0
end_time = 0.01
dt = 0.0001
dtmin = 0.00001
nl_abs_tol = 1e-12
nl_rel_tol = 1e-12
l_tol = 1e-12
l_max_its = 25
timestep_tolerance = 1e-8
automatic_scaling = true
[TimeIntegrator]
type = NewmarkBeta
[]
[]
[Postprocessors]
[./p1]
type = PointValue
point = '10.0 0.0 0.0'
variable = p
[../]
[./stress1]
type = PointValue
point = '10.0 0.0 0.0'
variable = stress_xx
[../]
[]
[Outputs]
csv = true
perf_graph = true
print_linear_residuals = true
[]
(modules/optimization/test/tests/optimizationreporter/bc_load_linearFunction/adjoint.i)
[Mesh]
[]
[Variables]
[adjoint_T]
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = adjoint_T
diffusivity = thermal_conductivity
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = adjoint_T
x_coord_name = misfit/measurement_xcoord
y_coord_name = misfit/measurement_ycoord
z_coord_name = misfit/measurement_zcoord
value_name = misfit/misfit_values
weight_name = misfit/weight
[]
[]
[Reporters]
[misfit]
type = OptimizationData
variable_weight_names = 'weight'
[]
[params_left]
type = ConstantReporter
real_vector_names = 'vals'
real_vector_values = '0 0' # Dummy
[]
[params_right]
type = ConstantReporter
real_vector_names = 'vals'
real_vector_values = '0' # Dummy
[]
[]
[BCs]
[left]
type = NeumannBC
variable = adjoint_T
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = adjoint_T
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = adjoint_T
boundary = bottom
value = 0
[]
[top]
type = DirichletBC
variable = adjoint_T
boundary = top
value = 0
[]
[]
[Materials]
[steel]
type = GenericConstantMaterial
prop_names = thermal_conductivity
prop_values = 5
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
line_search = none
nl_abs_tol = 1e-8
nl_rel_tol = 1e-8
petsc_options_iname = '-ksp_type -pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'preonly lu superlu_dist'
[]
[Functions]
[left_function]
type = ParsedOptimizationFunction
expression = 'a + b*y'
param_symbol_names = 'a b'
param_vector_name = 'params_left/vals'
[]
[right_function]
type = ParsedOptimizationFunction
expression = 'a'
param_symbol_names = 'a'
param_vector_name = 'params_right/vals'
[]
[]
[VectorPostprocessors]
[grad_bc_left]
type = SideOptimizationNeumannFunctionInnerProduct
variable = adjoint_T
function = left_function
boundary = left
[]
[grad_bc_right]
type = SideOptimizationNeumannFunctionInnerProduct
variable = adjoint_T
function = right_function
boundary = right
[]
[]
[Outputs]
console = false
exodus = false
file_base = 'adjoint'
[]
(test/tests/misc/hit_cli/input1.i)
#
# This is not a valid MOOSE input, it is only used for testing the HIT command
# line utility.
#
[Kernels]
[diff_u]
type = Diffusion
variable = u
[]
[diff_v]
type = Diffusion
variable = v
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
value = 0
[]
[right]
type = NeumannBC
variable = v
value = 0
[]
[]
[PostProcessor]
[min2]
type = Calculation
mode = MIN
value = 0
[]
[]
(test/tests/bcs/sideset_from_nodeset/sideset_from_nodeset_test.i)
[Mesh]
file = cube_no_sidesets.e
construct_side_list_from_node_list = true
[]
[Variables]
active = 'u'
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
active = 'diff'
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
active = 'left right'
[./left]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[./right]
type = NeumannBC
variable = u
boundary = 3
value = 3
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
file_base = cube_hex_out
exodus = true
[]
(test/tests/fvkernels/fv_simple_diffusion/neumann.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[u]
[]
[v]
family = MONOMIAL
order = CONSTANT
fv = true
[]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = v
coeff = coeff
[]
[]
[FVBCs]
[left]
type = FVNeumannBC
variable = v
boundary = left
value = 5
[]
[right]
type = FVDirichletBC
variable = v
boundary = right
value = 42
[]
[]
[Materials]
[diff]
type = ADGenericFunctorMaterial
prop_names = 'coeff'
prop_values = '1'
[]
[]
[BCs]
[left]
type = ADNeumannBC
variable = u
boundary = left
value = 5
[]
[right]
type = ADDirichletBC
variable = u
boundary = right
value = 42
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
(modules/stochastic_tools/test/tests/transfers/libtorch_nn_transfer/libtorch_drl_control_sub.i)
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
xmin = 0.0
xmax = 7.0
nx = 3
[]
[]
[Variables]
[temp]
initial_condition = 300
[]
[]
[Kernels]
[time]
type = CoefTimeDerivative
variable = temp
Coefficient = '${fparse 1.00630182*1.225}'
[]
[heat_conduc]
type = MatDiffusion
variable = temp
diffusivity = 'k'
[]
[]
[BCs]
[left_flux]
type = NeumannBC
value = 0.0
boundary = 'left'
variable = temp
[]
[dirichlet]
type = FunctionDirichletBC
function = temp_env
variable = temp
boundary = 'right'
[]
[]
[Functions]
[temp_env]
type = ParsedFunction
value = '15.0*sin(t/86400.0 *pi) + 273.0'
[]
[design_function]
type = ParsedFunction
value = '297'
[]
[reward_function]
type = ScaledAbsDifferenceDRLRewardFunction
design_function = design_function
observed_value = center_temp_tend
c1 = 1
c2 = 10
[]
[]
[Materials]
[constant]
type = GenericConstantMaterial
prop_names = 'k'
prop_values = 26.53832364
[]
[]
[Postprocessors]
[center_temp]
type = PointValue
variable = temp
point = '3.5 0.0 0.0'
execute_on = 'INITIAL TIMESTEP_BEGIN'
[]
[center_temp_tend]
type = PointValue
variable = temp
point = '3.5 0.0 0.0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[env_temp]
type = FunctionValuePostprocessor
function = temp_env
execute_on = 'INITIAL TIMESTEP_BEGIN'
[]
[reward]
type = FunctionValuePostprocessor
function = reward_function
execute_on = 'INITIAL TIMESTEP_END'
indirect_dependencies = 'center_temp_tend env_temp'
[]
[left_flux]
type = LibtorchControlValuePostprocessor
control_name = src_control
execute_on = 'INITIAL TIMESTEP_END'
[]
[log_prob_left_flux]
type = LibtorchDRLLogProbabilityPostprocessor
control_name = src_control
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Reporters]
[T_reporter]
type = AccumulateReporter
reporters = 'center_temp_tend/value env_temp/value reward/value left_flux/value log_prob_left_flux/value'
outputs = 'csv_out'
[]
[nn_parameters]
type = LibtorchArtificialNeuralNetParameters
control_name = src_control
outputs = json_out
[]
[]
[Controls]
[src_control]
type = LibtorchDRLControl
parameters = "BCs/left_flux/value"
responses = 'center_temp env_temp'
# keep consistent with LibtorchDRLControlTrainer
input_timesteps = 2
response_scaling_factors = '0.03 0.03'
response_shift_factors = '270 270'
action_standard_deviations = '0.1'
action_scaling_factors = 100
execute_on = 'TIMESTEP_BEGIN'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
line_search = 'none'
nl_rel_tol = 1e-8
start_time = 0.0
end_time = 86400
dt = 14400.0
[]
[Outputs]
[json_out]
type = JSON
execute_on = FINAL
execute_system_information_on = NONE
[]
[]
(modules/misc/test/tests/coupled_directional_mesh_height_interpolation/coupled_directional_mesh_height_interpolation.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmin = 1
xmax = 2
displacements = 'disp_x disp_y'
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./disp_x]
[../]
[./disp_y]
[../]
[./stretch]
[../]
[]
[Functions]
[./stretch_func]
type = ParsedFunction
expression = t
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
use_displaced_mesh = true
[../]
[]
[AuxKernels]
[./interpolation]
type = CoupledDirectionalMeshHeightInterpolation
variable = disp_x
direction = x
execute_on = timestep_begin
coupled_var = stretch
[../]
[./stretch_aux]
type = FunctionAux
variable = stretch
function = stretch_func
execute_on = timestep_begin
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
use_displaced_mesh = true
[../]
[./right]
type = NeumannBC
variable = u
boundary = right
value = 1
use_displaced_mesh = true
[../]
[]
[Executioner]
type = Transient
num_steps = 5
dt = 1
#Preconditioned JFNK (default)
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
(test/tests/multiapps/relaxation/picard_relaxed_parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
parallel_type = replicated
[]
[Variables]
[u]
[]
[]
[AuxVariables]
[v]
initial_condition = 1
[]
[inverse_v]
initial_condition = 1
[]
[]
[Kernels]
[diff]
type = CoefDiffusion
variable = u
coef = 0.1
[]
[time]
type = TimeDerivative
variable = u
[]
[force_u]
type = CoupledForce
variable = u
v = inverse_v
[]
[]
[AuxKernels]
[invert_v]
type = QuotientAux
variable = inverse_v
denominator = v
numerator = 20.0
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[Neumann_right]
type = NeumannBC
variable = u
boundary = right
value = 1
[]
[]
[Postprocessors]
[picard_its]
type = NumFixedPointIterations
execute_on = 'initial timestep_end'
[]
[]
[Executioner]
type = Transient
num_steps = 4
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_abs_tol = 1e-14
relaxation_factor = 0.95
transformed_variables = u
[]
[Outputs]
exodus = true
execute_on = 'INITIAL TIMESTEP_END'
[]
[MultiApps]
[sub]
type = TransientMultiApp
app_type = MooseTestApp
execute_on = timestep_begin
positions = '0 0 0'
input_files = picard_relaxed_sub.i
[]
[]
[Transfers]
[v_from_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = v
variable = v
[]
[u_to_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = u
variable = u
[]
[]
(modules/combined/test/tests/optimization/invOpt_nonlinear/simulation.i)
[Executioner]
type = Steady
solve_type = NEWTON
line_search = none
nl_abs_tol = 1e-12
nl_rel_tol = 1e-12
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmax = 2
ymax = 2
[]
[Variables]
[forwardT]
[]
[]
[Kernels]
[heat_conduction]
type = ADHeatConduction
thermal_conductivity = 'conductivity'
variable = forwardT
[]
[heat_source]
type = ADMatHeatSource
material_property = 'volumetric_heat'
variable = forwardT
[]
[]
[Materials]
[NonlinearConductivity]
type = ADParsedMaterial
f_name = 'conductivity'
function = '10+500*forwardT'
args = 'forwardT'
[]
[volumetric_heat]
type = ADGenericFunctionMaterial
prop_names = 'volumetric_heat'
prop_values = 'volumetric_heat_func'
[]
[]
[Functions]
[volumetric_heat_func]
type = ParsedFunction
value = q
vars = 'q'
vals = 'heat_source_pp'
[]
[]
[Postprocessors]
[heat_source_pp]
type = ConstantValuePostprocessor
value = 333
execute_on = 'LINEAR'
[]
[]
[BCs]
[left]
type = NeumannBC
variable = forwardT
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = forwardT
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = forwardT
boundary = bottom
value = 2
[]
[top]
type = DirichletBC
variable = forwardT
boundary = top
value = 1
[]
[]
[Reporters]
[measurement_locations]
type = OptimizationData
[]
[]
[Controls]
[parameterReceiver]
type = ControlsReceiver
[]
[]
[VectorPostprocessors]
[data_pt]
type = PointValueSampler
variable = forwardT
points = '0.2 0.2 0
0.8 0.6 0
0.2 1.4 0
0.8 1.8 0'
sort_by = id
[]
[]
[Outputs]
csv = true
[]
(test/tests/misc/save_in/save_in_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./saved]
[../]
[./bc_saved]
[../]
[./accumulated]
[../]
[./diag_saved]
[../]
[./bc_diag_saved]
[../]
[./saved_dirichlet]
[../]
[./diag_saved_dirichlet]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
save_in = 'saved accumulated saved_dirichlet'
diag_save_in = 'diag_saved diag_saved_dirichlet'
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
save_in = saved_dirichlet
diag_save_in = diag_saved_dirichlet
[../]
[./nbc]
type = NeumannBC
variable = u
boundary = right
value = 1
save_in = 'bc_saved accumulated'
diag_save_in = bc_diag_saved
[../]
[]
[Postprocessors]
[./left_flux]
type = NodalSum
variable = saved
boundary = 1
[../]
[./saved_norm]
type = NodalL2Norm
variable = saved
execute_on = timestep_end
block = 0
[../]
[./saved_dirichlet_norm]
type = NodalL2Norm
variable = saved_dirichlet
execute_on = timestep_end
block = 0
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
file_base = out
exodus = true
[]
(test/tests/misc/displaced_mesh_coupling/ad.i)
[GlobalParams]
displacements = 'u'
[]
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Variables]
[./u]
[../]
[./v]
[../]
[]
[Kernels]
[./u]
type = ADDiffusion
use_displaced_mesh = true
variable = u
[../]
[./v]
type = ADDiffusion
use_displaced_mesh = false
variable = v
[../]
[]
[BCs]
[./no_x]
type = ADNeumannBC
variable = u
boundary = left
value = 1.0e-3
use_displaced_mesh = true
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[./lright]
type = DirichletBC
variable = v
boundary = right
value = 1
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
exodus = true
[]
(test/tests/time_steppers/iteration_adaptive/hit_function_knot.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 50
ny = 2
xmax = 5
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Functions]
[./knot]
type = PiecewiseLinear
x = '0 1 2'
y = '0 0 0'
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./dt]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 10
[../]
[./right]
type = NeumannBC
variable = u
boundary = right
value = -1
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
start_time = 0.0
end_time = 2.0
timestep_tolerance = 0.3
verbose = true
[./TimeStepper]
type = IterationAdaptiveDT
dt = 0.9
optimal_iterations = 10
[../]
[]
[Postprocessors]
[./_dt]
type = TimestepSize
[../]
[]
[Outputs]
exodus = true
[]
(test/tests/time_steppers/time_stepper_system/AB2PredictorCorrector.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 10
xmin = 0.0
xmax = 1.0
[]
#still need BC for Energy, IC's for both.
[Variables]
active = 'Time'
[./Time]
order = FIRST
family = LAGRANGE
initial_condition = 0.0
[../]
[]
[Functions]
active = 'func'
[./func]
type = ParsedFunction
expression = 2.0*t
[../]
[]
[Kernels]
active = 't_time func_time'
[./t_time]
type = TimeDerivative
variable = Time
[../]
[./func_time]
type = BodyForce
variable = Time
function = func
[../]
[]
[BCs]
active = 'Top_Temperature'
[./Top_Temperature]
type = NeumannBC
variable = Time
boundary = 'left right'
[../]
[]
[Executioner]
type = Transient
scheme = 'BDF2'
start_time = 0
num_steps = 4
nl_abs_tol = 1e-15
petsc_options = '-snes_converged_reason'
abort_on_solve_fail = true
# Use the same test case as AB2PredictorCorrector test, add one more time stepper
# to test if AB2PredictorCorrector works correctly with time stepper composition
[TimeSteppers]
[AB2]
type = AB2PredictorCorrector
dt = .01
e_max = 10
e_tol = 1
[]
[IterationAdapDT]
type = IterationAdaptiveDT
dt = 100
[]
[]
[]
[Outputs]
exodus = true
file_base='aee_out'
[]
(modules/combined/test/tests/optimization/invOpt_bc_convective/adjoint.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 20
xmax = 1
ymax = 2
[]
[]
[AuxVariables]
[temperature_forward]
[]
[T2]
[]
[]
[AuxKernels]
[TT]
type = ParsedAux
args = 'temperature temperature_forward'
variable = T2
function = 'temperature*(100-temperature_forward)'
[]
[]
[Variables]
[temperature]
[]
[]
[Kernels]
[heat_conduction]
type = ADHeatConduction
variable = temperature
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = temperature
x_coord_name = misfit/measurement_xcoord
y_coord_name = misfit/measurement_ycoord
z_coord_name = misfit/measurement_zcoord
value_name = misfit/misfit_values
[]
[]
[Reporters]
[misfit]
type = OptimizationData
[]
[params]
type = ConstantReporter
real_vector_names = 'vals'
real_vector_values = '0' # Dummy value
[]
[]
[BCs]
[left]
type = ConvectiveFluxFunction
variable = temperature
boundary = 'left'
T_infinity = 0.0
coefficient = function1
[]
[right]
type = NeumannBC
variable = temperature
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = temperature
boundary = bottom
value = 0
[]
[top]
type = DirichletBC
variable = temperature
boundary = top
value = 0
[]
[]
[Materials]
[steel]
type = ADGenericConstantMaterial
prop_names = thermal_conductivity
prop_values = 5
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
nl_abs_tol = 1e-6
nl_rel_tol = 1e-8
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Functions]
[function1]
type = ParsedOptimizationFunction
expression = 'a'
param_symbol_names = 'a'
param_vector_name = 'params/vals'
[]
[]
[VectorPostprocessors]
[adjoint_pt]
type = SideOptimizationNeumannFunctionInnerProduct
variable = T2
function = function1
boundary = left
[]
[]
[Outputs]
console = false
exodus = false
file_base = 'adjoint'
[]
(modules/porous_flow/test/tests/poro_elasticity/terzaghi_constM.i)
# Terzaghi's problem of consolodation of a drained medium
#
# A saturated soil sample sits in a bath of water.
# It is constrained on its sides, and bottom.
# Its sides and bottom are also impermeable.
# Initially it is unstressed.
# A normal stress, q, is applied to the soil's top.
# The soil then slowly compresses as water is squeezed
# out from the sample from its top (the top BC for
# the porepressure is porepressure = 0).
#
# See, for example. Section 2.2 of the online manuscript
# Arnold Verruijt "Theory and Problems of Poroelasticity" Delft University of Technology 2013
# but note that the "sigma" in that paper is the negative
# of the stress in TensorMechanics
#
# Here are the problem's parameters, and their values:
# Soil height. h = 10
# Soil's Lame lambda. la = 2
# Soil's Lame mu, which is also the Soil's shear modulus. mu = 3
# Soil bulk modulus. K = la + 2*mu/3 = 4
# Soil confined compressibility. m = 1/(K + 4mu/3) = 0.125
# Soil bulk compliance. 1/K = 0.25
# Fluid bulk modulus. Kf = 8
# Fluid bulk compliance. 1/Kf = 0.125
# Fluid mobility (soil permeability/fluid viscosity). k = 1.5
# Soil initial porosity. phi0 = 0.1
# Biot coefficient. alpha = 0.6
# Soil initial storativity, which is the reciprocal of the initial Biot modulus. S = phi0/Kf + (alpha - phi0)(1 - alpha)/K = 0.0625
# Consolidation coefficient. c = k/(S + alpha^2 m) = 13.95348837
# Normal stress on top. q = 1
# Initial porepressure, resulting from instantaneous application of q, assuming corresponding instantaneous increase of porepressure (Note that this is calculated by MOOSE: we only need it for the analytical solution). p0 = alpha*m*q/(S + alpha^2 m) = 0.69767442
# Initial vertical displacement (down is positive), resulting from instantaneous application of q (Note this is calculated by MOOSE: we only need it for the analytical solution). uz0 = q*m*h*S/(S + alpha^2 m)
# Final vertical displacement (down in positive) (Note this is calculated by MOOSE: we only need it for the analytical solution). uzinf = q*m*h
#
# The solution for porepressure is
# P = 4*p0/\pi \sum_{k=1}^{\infty} \frac{(-1)^{k-1}}{2k-1} \cos ((2k-1)\pi z/(2h)) \exp(-(2k-1)^2 \pi^2 ct/(4 h^2))
# This series converges very slowly for ct/h^2 small, so in that domain
# P = p0 erf( (1-(z/h))/(2 \sqrt(ct/h^2)) )
#
# The degree of consolidation is defined as
# U = (uz - uz0)/(uzinf - uz0)
# where uz0 and uzinf are defined above, and
# uz = the vertical displacement of the top (down is positive)
# U = 1 - (8/\pi^2)\sum_{k=1}^{\infty} \frac{1}{(2k-1)^2} \exp(-(2k-1)^2 \pi^2 ct/(4 h^2))
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 10
xmin = -1
xmax = 1
ymin = -1
ymax = 1
zmin = 0
zmax = 10
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
PorousFlowDictator = dictator
block = 0
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'porepressure disp_x disp_y disp_z'
number_fluid_phases = 1
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureVG
m = 0.8
alpha = 1
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[porepressure]
[]
[]
[BCs]
[confinex]
type = DirichletBC
variable = disp_x
value = 0
boundary = 'left right'
[]
[confiney]
type = DirichletBC
variable = disp_y
value = 0
boundary = 'bottom top'
[]
[basefixed]
type = DirichletBC
variable = disp_z
value = 0
boundary = back
[]
[topdrained]
type = DirichletBC
variable = porepressure
value = 0
boundary = front
[]
[topload]
type = NeumannBC
variable = disp_z
value = -1
boundary = front
[]
[]
[Kernels]
[grad_stress_x]
type = StressDivergenceTensors
variable = disp_x
component = 0
[]
[grad_stress_y]
type = StressDivergenceTensors
variable = disp_y
component = 1
[]
[grad_stress_z]
type = StressDivergenceTensors
variable = disp_z
component = 2
[]
[poro_x]
type = PorousFlowEffectiveStressCoupling
biot_coefficient = 0.6
variable = disp_x
component = 0
[]
[poro_y]
type = PorousFlowEffectiveStressCoupling
biot_coefficient = 0.6
variable = disp_y
component = 1
[]
[poro_z]
type = PorousFlowEffectiveStressCoupling
biot_coefficient = 0.6
component = 2
variable = disp_z
[]
[poro_vol_exp]
type = PorousFlowMassVolumetricExpansion
variable = porepressure
fluid_component = 0
[]
[mass0]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = porepressure
[]
[flux]
type = PorousFlowAdvectiveFlux
variable = porepressure
gravity = '0 0 0'
fluid_component = 0
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 8
density0 = 1
thermal_expansion = 0
viscosity = 0.96
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
[]
[elasticity_tensor]
type = ComputeElasticityTensor
C_ijkl = '2 3'
# bulk modulus is lambda + 2*mu/3 = 2 + 2*3/3 = 4
fill_method = symmetric_isotropic
[]
[strain]
type = ComputeSmallStrain
[]
[stress]
type = ComputeLinearElasticStress
[]
[eff_fluid_pressure]
type = PorousFlowEffectiveFluidPressure
[]
[vol_strain]
type = PorousFlowVolumetricStrain
[]
[ppss]
type = PorousFlow1PhaseP
porepressure = porepressure
capillary_pressure = pc
[]
[massfrac]
type = PorousFlowMassFraction
[]
[simple_fluid]
type = PorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[porosity]
type = PorousFlowPorosityHMBiotModulus
porosity_zero = 0.1
biot_coefficient = 0.6
solid_bulk = 4
constant_fluid_bulk_modulus = 8
constant_biot_modulus = 16
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1.5 0 0 0 1.5 0 0 0 1.5'
[]
[relperm]
type = PorousFlowRelativePermeabilityCorey
n = 0 # unimportant in this fully-saturated situation
phase = 0
[]
[]
[Postprocessors]
[p0]
type = PointValue
outputs = csv
point = '0 0 0'
variable = porepressure
use_displaced_mesh = false
[]
[p1]
type = PointValue
outputs = csv
point = '0 0 1'
variable = porepressure
use_displaced_mesh = false
[]
[p2]
type = PointValue
outputs = csv
point = '0 0 2'
variable = porepressure
use_displaced_mesh = false
[]
[p3]
type = PointValue
outputs = csv
point = '0 0 3'
variable = porepressure
use_displaced_mesh = false
[]
[p4]
type = PointValue
outputs = csv
point = '0 0 4'
variable = porepressure
use_displaced_mesh = false
[]
[p5]
type = PointValue
outputs = csv
point = '0 0 5'
variable = porepressure
use_displaced_mesh = false
[]
[p6]
type = PointValue
outputs = csv
point = '0 0 6'
variable = porepressure
use_displaced_mesh = false
[]
[p7]
type = PointValue
outputs = csv
point = '0 0 7'
variable = porepressure
use_displaced_mesh = false
[]
[p8]
type = PointValue
outputs = csv
point = '0 0 8'
variable = porepressure
use_displaced_mesh = false
[]
[p9]
type = PointValue
outputs = csv
point = '0 0 9'
variable = porepressure
use_displaced_mesh = false
[]
[p99]
type = PointValue
outputs = csv
point = '0 0 10'
variable = porepressure
use_displaced_mesh = false
[]
[zdisp]
type = PointValue
outputs = csv
point = '0 0 10'
variable = disp_z
use_displaced_mesh = false
[]
[dt]
type = FunctionValuePostprocessor
outputs = console
function = if(0.5*t<0.1,0.5*t,0.1)
[]
[]
[Preconditioning]
[andy]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
start_time = 0
end_time = 10
[TimeStepper]
type = PostprocessorDT
postprocessor = dt
dt = 0.0001
[]
[]
[Outputs]
execute_on = 'timestep_end'
file_base = terzaghi_constM
[csv]
type = CSV
[]
[]
(modules/optimization/test/tests/optimizationreporter/constant_heat_source/adjoint_nonLinear.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmax = 2
ymax = 2
[]
[Variables]
[adjoint_T]
[]
[]
[AuxVariables]
[T]
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = adjoint_T
diffusivity = thermal_conductivity
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = adjoint_T
x_coord_name = misfit/measurement_xcoord
y_coord_name = misfit/measurement_ycoord
z_coord_name = misfit/measurement_zcoord
value_name = misfit/misfit_values
[]
[]
[Reporters]
[misfit]
type = OptimizationData
[]
[params]
type = ConstantReporter
real_vector_names = 'q'
real_vector_values = '0' # Dummy value
[]
[]
[BCs]
[left]
type = NeumannBC
variable = adjoint_T
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = adjoint_T
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = adjoint_T
boundary = bottom
value = 0
[]
[top]
type = DirichletBC
variable = adjoint_T
boundary = top
value = 0
[]
[]
[Materials]
[steel]
type = ParsedMaterial
f_name = 'thermal_conductivity'
function = '.01*T'
args = 'T'
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
nl_abs_tol = 1e-8
nl_rel_tol = 1e-8
petsc_options_iname = '-ksp_type -pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'preonly lu superlu_dist'
[]
[Functions]
[volumetric_heat_func]
type = ParsedOptimizationFunction
expression = q
param_symbol_names = 'q'
param_vector_name = 'params/q'
[]
[]
[VectorPostprocessors]
[gradient_vpp]
type = ElementOptimizationSourceFunctionInnerProduct
variable = adjoint_T
function = volumetric_heat_func
[]
[]
[Outputs]
console = false
file_base = 'adjoint_nl'
[]
(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/kernels/hfem/neumann.i)
[Mesh]
[square]
type = GeneratedMeshGenerator
nx = 3
ny = 3
dim = 2
[]
build_all_side_lowerd_mesh = true
[]
[Variables]
[u]
order = THIRD
family = MONOMIAL
block = 0
[]
[lambda]
order = CONSTANT
family = MONOMIAL
block = INTERNAL_SIDE_LOWERD_SUBDOMAIN
[]
[]
[Kernels]
[diff]
type = MatDiffusion
variable = u
diffusivity = '1'
block = 0
[]
[reaction]
type = Reaction
variable = u
rate = '1'
block = 0
[]
[source]
type = BodyForce
variable = u
value = '1'
block = 0
[]
[]
[DGKernels]
[surface]
type = HFEMDiffusion
variable = u
lowerd_variable = lambda
[]
[]
[BCs]
[all]
type = NeumannBC
boundary = 'left right top bottom'
variable = u
[]
[]
[Postprocessors]
[intu]
type = ElementIntegralVariablePostprocessor
variable = u
block = 0
[]
[lambdanorm]
type = ElementL2Norm
variable = lambda
block = INTERNAL_SIDE_LOWERD_SUBDOMAIN
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu basic mumps'
[]
[Outputs]
[out]
# we hide lambda because it may flip sign due to element
# renumbering with distributed mesh
type = Exodus
hide = lambda
[]
[]
(modules/stochastic_tools/examples/parameter_study/diffusion_time.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables/T]
initial_condition = 300
[]
[Kernels]
[time]
type = ADTimeDerivative
variable = T
[]
[diff]
type = ADMatDiffusion
variable = T
diffusivity = diffusivity
[]
[source]
type = ADBodyForce
variable = T
value = 100
function = 1
[]
[]
[BCs]
[left]
type = ADDirichletBC
variable = T
boundary = left
value = 300
[]
[right]
type = ADNeumannBC
variable = T
boundary = right
value = -100
[]
[]
[Materials/constant]
type = ADGenericConstantMaterial
prop_names = 'diffusivity'
prop_values = 1
[]
[Executioner]
type = Transient
num_steps = 4
dt = 0.25
[]
[Postprocessors]
[T_avg]
type = ElementAverageValue
variable = T
execute_on = 'initial timestep_end'
[]
[q_left]
type = ADSideDiffusiveFluxAverage
variable = T
boundary = left
diffusivity = diffusivity
execute_on = 'initial timestep_end'
[]
[]
[VectorPostprocessors]
[T_vec]
type = LineValueSampler
variable = T
start_point = '0 0.5 0'
end_point = '1 0.5 0'
num_points = 11
sort_by = x
execute_on = 'initial timestep_end'
[]
[]
[Controls/stochastic]
type = SamplerReceiver
[]
[Outputs]
[]
(modules/solid_mechanics/test/tests/static_deformations/cosserat_tension.i)
[Mesh]
[generated_mesh]
type = GeneratedMeshGenerator
dim = 3
nx = 2
ny = 2
nz = 2
zmax = 0.2
[]
[bottom_xline1]
type = ExtraNodesetGenerator
new_boundary = 101
coord = '0 0 0'
input = generated_mesh
[]
[bottom_xline2]
type = ExtraNodesetGenerator
new_boundary = 101
coord = '0.5 0 0'
input = bottom_xline1
[]
[bottom_xline3]
type = ExtraNodesetGenerator
new_boundary = 101
coord = '1 0 0'
input = bottom_xline2
[]
[bottom_zline1]
type = ExtraNodesetGenerator
new_boundary = 102
coord = '0 0 0.0'
input = bottom_xline3
[]
[bottom_zline2]
type = ExtraNodesetGenerator
new_boundary = 102
coord = '0 0 0.1'
input = bottom_zline1
[]
[bottom_zline3]
type = ExtraNodesetGenerator
new_boundary = 102
coord = '0 0 0.2'
input = bottom_zline2
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
Cosserat_rotations = 'wc_x wc_y wc_z'
[]
[Postprocessors]
[./disp_y_top]
type = PointValue
point = '0.5 1 0.1'
variable = disp_y
[../]
[./wc_z_top]
type = PointValue
point = '0.5 1 0.1'
variable = wc_z
[../]
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[./disp_z]
[../]
[./wc_x]
[../]
[./wc_y]
[../]
[./wc_z]
[../]
[]
[Kernels]
[./cx_elastic]
type = CosseratStressDivergenceTensors
variable = disp_x
component = 0
[../]
[./cy_elastic]
type = CosseratStressDivergenceTensors
variable = disp_y
component = 1
[../]
[./cz_elastic]
type = CosseratStressDivergenceTensors
variable = disp_z
component = 2
[../]
[./x_couple]
type = StressDivergenceTensors
variable = wc_x
displacements = 'wc_x wc_y wc_z'
component = 0
base_name = couple
[../]
[./y_couple]
type = StressDivergenceTensors
variable = wc_y
displacements = 'wc_x wc_y wc_z'
component = 1
base_name = couple
[../]
[./z_couple]
type = StressDivergenceTensors
variable = wc_z
displacements = 'wc_x wc_y wc_z'
component = 2
base_name = couple
[../]
[./x_moment]
type = MomentBalancing
variable = wc_x
component = 0
[../]
[./y_moment]
type = MomentBalancing
variable = wc_y
component = 1
[../]
[./z_moment]
type = MomentBalancing
variable = wc_z
component = 2
[../]
[]
[BCs]
[./y_bottom]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0
[../]
[./x_line]
type = DirichletBC
variable = disp_z
boundary = 101
value = 0
[../]
[./z_line]
type = DirichletBC
variable = disp_x
boundary = 102
value = 0
[../]
[./wc_x_bottom]
type = DirichletBC
variable = wc_x
boundary = bottom
value = 0
[../]
[./wc_y_bottom]
type = DirichletBC
variable = wc_y
boundary = bottom
value = 0
[../]
[./wc_z_bottom]
type = DirichletBC
variable = wc_z
boundary = bottom
value = 0
[../]
[./top_force]
type = NeumannBC
variable = disp_y
boundary = top
value = 1
[../]
[]
[Materials]
[./elasticity_tensor]
type = ComputeCosseratElasticityTensor
B_ijkl = 0.5
E_ijkl = '1 2 1.3333'
fill_method = 'general_isotropic'
[../]
[./strain]
type = ComputeCosseratSmallStrain
[../]
[./stress]
type = ComputeCosseratLinearElasticStress
[../]
[]
[Preconditioning]
[./andy]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -snes_atol -snes_rtol -snes_max_it -ksp_atol -ksp_rtol'
petsc_options_value = 'gmres bjacobi 1E-10 1E-10 10 1E-15 1E-10'
[../]
[]
[Executioner]
type = Transient
solve_type = Newton
num_steps = 1
[]
[Outputs]
execute_on = 'timestep_end'
file_base = cosserat_tension_out
exodus = true
[]
(test/tests/multiapps/relaxation/picard_parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
parallel_type = replicated
[]
[Variables]
[u]
[]
[]
[AuxVariables]
[v]
initial_condition = 1
[]
[inverse_v]
initial_condition = 1
[]
[]
[Kernels]
[diff]
type = CoefDiffusion
variable = u
coef = 0.1
[]
[time]
type = TimeDerivative
variable = u
[]
[force_u]
type = CoupledForce
variable = u
v = inverse_v
[]
[]
[AuxKernels]
[invert_v]
type = QuotientAux
variable = inverse_v
denominator = v
numerator = 20.0
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[Neumann_right]
type = NeumannBC
variable = u
boundary = right
value = 1
[]
[]
[Postprocessors]
[picard_its]
type = NumFixedPointIterations
execute_on = 'initial timestep_end'
[]
[]
[Executioner]
type = Transient
num_steps = 4
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_abs_tol = 1e-14
[]
[Outputs]
exodus = true
execute_on = 'INITIAL TIMESTEP_END'
[]
[MultiApps]
[sub]
type = TransientMultiApp
app_type = MooseTestApp
execute_on = timestep_begin
positions = '0 0 0'
input_files = picard_relaxed_sub.i
[]
[]
[Transfers]
[v_from_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = v
variable = v
[]
[u_to_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = u
variable = u
[]
[]
(modules/xfem/test/tests/moving_interface/phase_transition_2d.i)
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 11
ny = 1
xmin = 0.0
xmax = 20.0
ymin = 0.0
ymax = 5.0
elem_type = QUAD4
[]
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[velocity]
type = XFEMPhaseTransitionMovingInterfaceVelocity
diffusivity_at_positive_level_set = 5
diffusivity_at_negative_level_set = 1
equilibrium_concentration_jump = 1
value_at_interface_uo = value_uo
[]
[value_uo]
type = NodeValueAtXFEMInterface
variable = 'u'
interface_mesh_cut_userobject = 'cut_mesh'
execute_on = TIMESTEP_END
level_set_var = ls
[]
[cut_mesh]
type = InterfaceMeshCut2DUserObject
mesh_file = flat_interface_1d.e
interface_velocity_uo = velocity
heal_always = true
[]
[]
[Variables]
[u]
[]
[]
[ICs]
[ic_u]
type = FunctionIC
variable = u
function = 'if(x<5.01, 2, 1)'
[]
[]
[AuxVariables]
[ls]
order = FIRST
family = LAGRANGE
[]
[]
[Constraints]
[u_constraint]
type = XFEMEqualValueAtInterface
geometric_cut_userobject = 'cut_mesh'
use_displaced_mesh = false
variable = u
value = 2
alpha = 1e6
[]
[]
[Kernels]
[diff]
type = MatDiffusion
variable = u
diffusivity = diffusion_coefficient
[]
[time]
type = TimeDerivative
variable = u
[]
[]
[AuxKernels]
[ls]
type = MeshCutLevelSetAux
mesh_cut_user_object = cut_mesh
variable = ls
execute_on = 'TIMESTEP_BEGIN'
[]
[]
[Materials]
[diffusivity_A]
type = GenericConstantMaterial
prop_names = A_diffusion_coefficient
prop_values = 5
[]
[diffusivity_B]
type = GenericConstantMaterial
prop_names = B_diffusion_coefficient
prop_values = 1
[]
[diff_combined]
type = LevelSetBiMaterialReal
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = diffusion_coefficient
[]
[]
[BCs]
# Define boundary conditions
[left_u]
type = DirichletBC
variable = u
value = 2
boundary = left
[]
[right_u]
type = NeumannBC
variable = u
boundary = right
value = 0
[]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
line_search = 'none'
l_tol = 1e-3
nl_max_its = 15
nl_rel_tol = 1e-9
nl_abs_tol = 1e-9
start_time = 0.0
dt = 1
num_steps = 5
max_xfem_update = 1
[]
[Outputs]
execute_on = timestep_end
exodus = true
perf_graph = true
[]
(test/tests/multiapps/relaxation/bad_relax_factor_parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
parallel_type = replicated
[]
[Variables]
[u]
[]
[]
[AuxVariables]
[v]
initial_condition = 1
[]
[inverse_v]
initial_condition = 1
[]
[]
[Kernels]
[diff]
type = CoefDiffusion
variable = u
coef = 0.1
[]
[time]
type = TimeDerivative
variable = u
[]
[force_u]
type = CoupledForce
variable = u
v = inverse_v
[]
[]
[AuxKernels]
[invert_v]
type = QuotientAux
variable = inverse_v
denominator = v
numerator = 20.0
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[Neumann_right]
type = NeumannBC
variable = u
boundary = right
value = 1
[]
[]
[Postprocessors]
[picard_its]
type = NumFixedPointIterations
execute_on = 'initial timestep_end'
[]
[]
[Executioner]
type = Transient
num_steps = 4
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_abs_tol = 1e-14
relaxation_factor = 2.0
transformed_variables = u
[]
[Outputs]
exodus = true
execute_on = 'INITIAL TIMESTEP_END'
[]
[MultiApps]
[sub]
type = TransientMultiApp
app_type = MooseTestApp
execute_on = timestep_begin
positions = '0 0 0'
input_files = picard_relaxed_sub.i
[]
[]
[Transfers]
[v_from_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
from_multi_app = sub
source_variable = v
variable = v
[]
[u_to_sub]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = sub
source_variable = u
variable = u
[]
[]
(modules/optimization/test/tests/optimizationreporter/nonlinear_material/forward_and_adjoint.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmax = 2
ymax = 2
[]
[]
[Problem]
nl_sys_names = 'nl0 adjoint'
kernel_coverage_check = false
[]
[Variables]
[forwardT]
[]
[adjointT]
nl_sys = adjoint
[]
[]
[Kernels]
[heat_conduction]
type = ADMatDiffusion
variable = forwardT
diffusivity = 'conductivity'
[]
[heat_source]
type = ADBodyForce
function = volumetric_heat_func
variable = forwardT
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = adjointT
x_coord_name = measurement_locations/measurement_xcoord
y_coord_name = measurement_locations/measurement_ycoord
z_coord_name = measurement_locations/measurement_zcoord
value_name = measurement_locations/misfit_values
[]
[]
[Materials]
[NonlinearConductivity]
type = ADParsedMaterial
property_name = conductivity
expression = '10+500*forwardT'
coupled_variables = 'forwardT'
[]
[]
[Functions]
[volumetric_heat_func]
type = ParsedOptimizationFunction
expression = q
param_symbol_names = 'q'
param_vector_name = 'params/heat_source'
[]
[]
[BCs]
[left]
type = NeumannBC
variable = forwardT
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = forwardT
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = forwardT
boundary = bottom
value = 2
[]
[top]
type = DirichletBC
variable = forwardT
boundary = top
value = 1
[]
[]
[Reporters]
[measurement_locations]
type = OptimizationData
variable = forwardT
[]
[params]
type = ConstantReporter
real_vector_names = 'heat_source'
real_vector_values = '0' # Dummy
[]
[]
[VectorPostprocessors]
[gradient_vpp]
type = ElementOptimizationSourceFunctionInnerProduct
function = volumetric_heat_func
variable = adjointT
execute_on = ADJOINT_TIMESTEP_END
[]
[]
[Executioner]
type = SteadyAndAdjoint
forward_system = nl0
adjoint_system = adjoint
line_search = none
nl_abs_tol = 1e-12
nl_rel_tol = 1e-12
l_tol = 1e-12
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
console = false
[]
(modules/stochastic_tools/examples/surrogates/pod_rb/2d_multireg/sub.i)
halfa = 10
fulla = 20
[Problem]
type = FEProblem
extra_tag_vectors = 'diff0 diff1 diff2 diff3 abs0 abs1 abs2 abs3 src0 src1 src2'
[]
[Mesh]
[msh]
type = CartesianMeshGenerator
dim = 2
dx = '10 20 20 20 20 20 20 20 20'
dy = '10 20 20 20 20 20 20 20 20'
ix = '${halfa} ${fulla} ${fulla} ${fulla} ${fulla} ${fulla} ${fulla} ${fulla} ${fulla}'
iy = '${halfa} ${fulla} ${fulla} ${fulla} ${fulla} ${fulla} ${fulla} ${fulla} ${fulla}'
subdomain_id = '1 0 0 0 1 0 0 2 3
0 0 0 0 0 0 0 2 3
0 0 1 0 0 0 2 2 3
0 0 0 0 0 0 2 3 3
1 0 0 0 1 2 2 3 3
0 0 0 0 2 2 3 3 3
0 0 2 2 2 3 3 3 3
2 2 2 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3'
[]
[]
[Variables]
[psi]
[]
[]
[Kernels]
[diff0]
type = MatDiffusion
variable = psi
diffusivity = D0
extra_vector_tags = 'diff0'
block = 0
[]
[diff1]
type = MatDiffusion
variable = psi
diffusivity = D1
extra_vector_tags = 'diff1'
block = 1
[]
[diff2]
type = MatDiffusion
variable = psi
diffusivity = D2
extra_vector_tags = 'diff2'
block = 2
[]
[diff3]
type = MatDiffusion
variable = psi
diffusivity = D3
extra_vector_tags = 'diff3'
block = 3
[]
[abs0]
type = MaterialReaction
variable = psi
coefficient = absxs0
extra_vector_tags = 'abs0'
block = 0
[]
[abs1]
type = MaterialReaction
variable = psi
coefficient = absxs1
extra_vector_tags = 'abs1'
block = 1
[]
[abs2]
type = MaterialReaction
variable = psi
coefficient = absxs2
extra_vector_tags = 'abs2'
block = 2
[]
[abs3]
type = MaterialReaction
variable = psi
coefficient = absxs3
extra_vector_tags = 'abs3'
block = 3
[]
[src0]
type = BodyForce
variable = psi
value = 1
extra_vector_tags = 'src0'
block = 0
[]
[src1]
type = BodyForce
variable = psi
value = 1
extra_vector_tags = 'src1'
block = 1
[]
[src2]
type = BodyForce
variable = psi
value = 1
extra_vector_tags = 'src2'
block = 2
[]
[]
[Materials]
[D0]
type = GenericConstantMaterial
prop_names = D0
prop_values = 1
block = 0
[]
[D1]
type = GenericConstantMaterial
prop_names = D1
prop_values = 1
block = 1
[]
[D2]
type = GenericConstantMaterial
prop_names = D2
prop_values = 1
block = 2
[]
[D3]
type = GenericConstantMaterial
prop_names = D3
prop_values = 1
block = 3
[]
[absxs0]
type = GenericConstantMaterial
prop_names = absxs0
prop_values = 1
block = 0
[]
[absxs1]
type = GenericConstantMaterial
prop_names = absxs1
prop_values = 1
block = 1
[]
[absxs2]
type = GenericConstantMaterial
prop_names = absxs2
prop_values = 1
block = 2
[]
[absxs3]
type = GenericConstantMaterial
prop_names = absxs3
prop_values = 1
block = 3
[]
[]
[BCs]
[left]
type = NeumannBC
variable = psi
boundary = left
value = 0
[]
[bottom]
type = NeumannBC
variable = psi
boundary = bottom
value = 0
[]
[top]
type = DirichletBC
variable = psi
boundary = top
value = 0
[]
[right]
type = DirichletBC
variable = psi
boundary = right
value = 0
[]
[]
[Executioner]
type = Steady
solve_type = linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Controls]
[stochastic]
type = SamplerReceiver
[]
[]
[Postprocessors]
[nodal_l2]
type = NodalL2Norm
variable = psi
[]
[]
[Outputs]
[]
(test/tests/userobjects/element_subdomain_modifier/amr_bc.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 16
ny = 16
[]
[left]
type = SubdomainBoundingBoxGenerator
input = 'gen'
block_id = 1
bottom_left = '-1 -1 0'
top_right = '0 1 1'
[]
[right]
type = SubdomainBoundingBoxGenerator
input = 'left'
block_id = 2
bottom_left = '0 -1 0'
top_right = '1 1 1'
[]
[moving_boundary]
type = SideSetsAroundSubdomainGenerator
input = 'right'
block = 1
new_boundary = 'moving_boundary'
normal = '1 0 0'
[]
[]
[UserObjects]
[moving_circle]
type = CoupledVarThresholdElementSubdomainModifier
coupled_var = 'phi'
block = 2
criterion_type = ABOVE
threshold = 0.5
subdomain_id = 1
moving_boundary_name = moving_boundary
execute_on = 'TIMESTEP_BEGIN'
[]
[]
[Functions]
[moving_gauss]
type = ParsedFunction
value = 'exp(-((x+0.5-t)^2+(y)^2)/0.25)'
[]
[]
[AuxVariables]
[phi]
[]
[]
[AuxKernels]
[phi]
type = FunctionAux
variable = phi
function = moving_gauss
execute_on = 'INITIAL TIMESTEP_BEGIN TIMESTEP_END'
[]
[]
[Adaptivity]
steps = 1
marker = marker
initial_marker = marker
max_h_level = 1
[Indicators/indicator]
type = GradientJumpIndicator
variable = phi
[]
[Markers]
[efm]
type = ErrorFractionMarker
indicator = indicator
coarsen = 0.2
refine = 0.5
[]
[marker]
type = BoundaryPreservedMarker
preserved_boundary = moving_boundary
marker = 'efm'
[]
[]
[]
[Variables]
[u][]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[]
[BCs]
active = 'mbc leftright'
[mbc]
type = DirichletBC
variable = u
boundary = moving_boundary
value = 1
[]
[nbc]
type = NeumannBC
variable = u
boundary = moving_boundary
value = 10
[]
[leftright]
type = DirichletBC
variable = u
boundary = 'left right'
value = 0
[]
[]
[Executioner]
type = Transient
dt = 0.1
num_steps = 5
[]
[Outputs]
exodus = true
[]
(test/tests/executioners/fixed_point/nonlinear_fixed_point.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 4
xmin = -1
xmax = 1
ymin = -1
ymax = 1
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
initial_condition = 0.1
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./power]
type = PReaction
variable = u
coefficient = 0.2
power = -5
# Comment out this will make fixed point iteration converged in one iteration.
# However, this makes the solving diverge and require a proper initial condition (>1.00625).
vector_tags = 'previous'
[../]
[]
[BCs]
[./left]
type = VacuumBC
variable = u
boundary = left
[../]
[./right]
type = NeumannBC
variable = u
boundary = right
value = 10
[../]
[]
[Postprocessors]
[./unorm]
type = ElementL2Norm
variable = u
[../]
[]
[Problem]
type = FixedPointProblem
fp_tag_name = 'previous'
[]
[Executioner]
type = FixedPointSteady
nl_rel_tol = 1e-2
nl_abs_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(modules/solid_mechanics/test/tests/lagrangian/cartesian/total/stabilization/cook_small.i)
[GlobalParams]
displacements = 'disp_x disp_y'
large_kinematics = false
stabilize_strain = true
[]
[Mesh]
type = FileMesh
file = cook_mesh.exo
dim = 2
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[Kernels]
[sdx]
type = TotalLagrangianStressDivergence
variable = disp_x
component = 0
[]
[sdy]
type = TotalLagrangianStressDivergence
variable = disp_y
component = 1
[]
[]
[AuxVariables]
[strain_xx]
order = CONSTANT
family = MONOMIAL
[]
[strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[strain_zz]
order = CONSTANT
family = MONOMIAL
[]
[strain_xy]
order = CONSTANT
family = MONOMIAL
[]
[strain_xz]
order = CONSTANT
family = MONOMIAL
[]
[strain_yz]
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_xz]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[stress_xx]
type = RankTwoAux
rank_two_tensor = pk1_stress
variable = stress_xx
index_i = 0
index_j = 0
execute_on = timestep_end
[]
[stress_yy]
type = RankTwoAux
rank_two_tensor = pk1_stress
variable = stress_yy
index_i = 1
index_j = 1
execute_on = timestep_end
[]
[stress_zz]
type = RankTwoAux
rank_two_tensor = pk1_stress
variable = stress_zz
index_i = 2
index_j = 2
execute_on = timestep_end
[]
[stress_xy]
type = RankTwoAux
rank_two_tensor = pk1_stress
variable = stress_xy
index_i = 0
index_j = 1
execute_on = timestep_end
[]
[stress_xz]
type = RankTwoAux
rank_two_tensor = pk1_stress
variable = stress_xz
index_i = 0
index_j = 2
execute_on = timestep_end
[]
[stress_yz]
type = RankTwoAux
rank_two_tensor = pk1_stress
variable = stress_yz
index_i = 1
index_j = 2
execute_on = timestep_end
[]
[strain_xx]
type = RankTwoAux
rank_two_tensor = mechanical_strain
variable = strain_xx
index_i = 0
index_j = 0
execute_on = timestep_end
[]
[strain_yy]
type = RankTwoAux
rank_two_tensor = mechanical_strain
variable = strain_yy
index_i = 1
index_j = 1
execute_on = timestep_end
[]
[strain_zz]
type = RankTwoAux
rank_two_tensor = mechanical_strain
variable = strain_zz
index_i = 2
index_j = 2
execute_on = timestep_end
[]
[strain_xy]
type = RankTwoAux
rank_two_tensor = mechanical_strain
variable = strain_xy
index_i = 0
index_j = 1
execute_on = timestep_end
[]
[strain_xz]
type = RankTwoAux
rank_two_tensor = mechanical_strain
variable = strain_xz
index_i = 0
index_j = 2
execute_on = timestep_end
[]
[strain_yz]
type = RankTwoAux
rank_two_tensor = mechanical_strain
variable = strain_yz
index_i = 1
index_j = 2
execute_on = timestep_end
[]
[]
[BCs]
[fixed_x]
type = DirichletBC
preset = true
variable = disp_x
boundary = canti
value = 0.0
[]
[fixed_y]
type = DirichletBC
preset = true
variable = disp_y
boundary = canti
value = 0.0
[]
[pull]
type = NeumannBC
variable = disp_y
boundary = loading
value = 10.0
[]
[]
[Materials]
[elastic_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 250.0
poissons_ratio = 0.4999999
[]
[compute_stress]
type = ComputeLagrangianLinearElasticStress
[]
[compute_strain]
type = ComputeLagrangianStrain
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = 'newton'
line_search = 'none'
petsc_options_iname = -pc_type
petsc_options_value = lu
nl_abs_tol = 1e-10
nl_rel_tol = 1e-6
l_tol = 1e-10
[]
[Postprocessors]
[value]
type = PointValue
variable = disp_y
point = '48 60 0'
use_displaced_mesh = false
[]
[]
[Outputs]
exodus = false
csv = true
[]
(modules/stochastic_tools/examples/libtorch_drl_control/libtorch_drl_control_sub.i)
air_density = 1.184 # kg/m3
air_cp = 1000 # J/(kg K)
air_effective_k = 0.5 # W/(m K)
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.0
xmax = 7.0
ymin = 0.0
ymax = 5.0
nx = 35
ny = 25
[]
[]
[Variables]
[T]
initial_condition = 297
[]
[]
[Kernels]
[time_derivative]
type = CoefTimeDerivative
variable = T
Coefficient = '${fparse air_density*air_cp}'
[]
[heat_conduction]
type = MatDiffusion
variable = T
diffusivity = 'k'
[]
[]
[BCs]
[top_flux]
type = NeumannBC
value = 0.0
boundary = 'top'
variable = T
[]
[dirichlet]
type = FunctionDirichletBC
function = temp_env
variable = T
boundary = 'left right'
[]
[]
[Functions]
[temp_env]
type = ParsedFunction
value = '15.0*sin(t/86400.0*pi) + 273.0'
[]
[design_function]
type = ParsedFunction
value = '297'
[]
[reward_function]
type = ScaledAbsDifferenceDRLRewardFunction
design_function = design_function
observed_value = center_temp_tend
c1 = 1
c2 = 10
[]
[]
[Materials]
[constant]
type = GenericConstantMaterial
prop_names = 'k'
prop_values = ${air_effective_k}
[]
[]
[Postprocessors]
[center_temp]
type = PointValue
variable = T
point = '3.5 2.5 0.0'
execute_on = 'INITIAL TIMESTEP_BEGIN'
[]
[center_temp_tend]
type = PointValue
variable = T
point = '3.5 2.5 0.0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[env_temp]
type = FunctionValuePostprocessor
function = temp_env
execute_on = 'INITIAL TIMESTEP_BEGIN'
[]
[reward]
type = FunctionValuePostprocessor
function = reward_function
execute_on = 'INITIAL TIMESTEP_END'
indirect_dependencies = 'center_temp_tend env_temp'
[]
[top_flux]
type = LibtorchControlValuePostprocessor
control_name = src_control
[]
[log_prob_top_flux]
type = LibtorchDRLLogProbabilityPostprocessor
control_name = src_control
[]
[]
[Reporters]
[T_reporter]
type = AccumulateReporter
reporters = 'center_temp_tend/value env_temp/value reward/value top_flux/value log_prob_top_flux/value'
[]
[]
[Controls]
inactive = 'src_control_final'
[src_control]
type = LibtorchDRLControl
parameters = "BCs/top_flux/value"
responses = 'center_temp_tend env_temp'
# keep consistent with LibtorchDRLControlTrainer
input_timesteps = 2
response_scaling_factors = '0.03 0.03'
response_shift_factors = '290 290'
action_standard_deviations = '0.02'
action_scaling_factors = 200
execute_on = 'TIMESTEP_BEGIN'
[]
[src_control_final]
type = LibtorchNeuralNetControl
filename = 'mynet_control.net'
num_neurons_per_layer = '16 6'
activation_function = 'relu'
parameters = "BCs/top_flux/value"
responses = 'center_temp_tend env_temp'
# keep consistent with LibtorchDRLControlTrainer
input_timesteps = 2
response_scaling_factors = '0.03 0.03'
response_shift_factors = '290 290'
action_standard_deviations = '0.02'
action_scaling_factors = 200
execute_on = 'TIMESTEP_BEGIN'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
line_search = 'none'
nl_rel_tol = 1e-7
start_time = 0.0
end_time = 86400
dt = 900.0
[]
[Outputs]
console = false
[c]
type = CSV
execute_on = FINAL
[]
[]
(test/tests/materials/material/three_coupled_mat_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 10
ny = 10
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = MatDiffusionTest
variable = u
prop_name = a
[../]
[./conv]
type = MatConvection
variable = u
x = 1
y = 0
mat_prop = b
[../]
[]
[BCs]
[./right]
type = NeumannBC
variable = u
boundary = 1
value = 1
[../]
[./left]
type = DirichletBC
variable = u
boundary = 3
value = 0
[../]
[]
[Materials]
[./matA]
type = CoupledMaterial
block = 0
mat_prop = 'a'
coupled_mat_prop = 'b'
[../]
[./matB]
type = CoupledMaterial
block = 0
mat_prop = 'b'
coupled_mat_prop = 'c'
[../]
[./matC]
type = CoupledMaterial
block = 0
mat_prop = 'c'
coupled_mat_prop = 'd'
[../]
[./matD]
type = GenericConstantMaterial
block = 0
prop_names = 'd'
prop_values = '2'
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
file_base = out_three
exodus = true
[]
(test/include/bcs/MatTestNeumannBC.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 "NeumannBC.h"
/**
* Neumann boundary condition for testing BoundaryRestrictable class
*/
class MatTestNeumannBC : public NeumannBC
{
public:
static InputParameters validParams();
MatTestNeumannBC(const InputParameters & parameters);
protected:
virtual Real computeQpResidual();
const std::string _prop_name;
const MaterialProperty<Real> * _value;
};
(test/include/bcs/OnOffNeumannBC.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 "NeumannBC.h"
/**
* NeumanBC with ability to turn on and off
*/
class OnOffNeumannBC : public NeumannBC
{
public:
static InputParameters validParams();
OnOffNeumannBC(const InputParameters & parameters);
virtual bool shouldApply();
protected:
};