- dtThe default timestep size between solves
C++ Type:double
Controllable:No
Description:The default timestep size between solves
IterationAdaptiveDT
Adjust the timestep based on the number of iterations
Description
The IterationAdaptiveDT
Time Stepper provides a means to adapt the time step size based on the difficulty of the solution.
IterationAdaptiveDT
grows or shrinks the time step based on the number of iterations taken to obtain a converged solution in the last converged step. The required optimal_iterations
parameter controls the number of nonlinear iterations per time step that provides optimal solution efficiency. If more iterations than that are required to obtain a converged solution, the time step may be too large, resulting in undue solution difficulty, while if fewer iterations are required, it may be possible to take larger time steps to obtain a solution more quickly.
A second parameter, iteration_window
, is used to control the size of the region in which the time step is held constant. As shown in Figure 1, if the number of nonlinear iterations for convergence is lower than (optimal_iterations-iteration_window
), the time step is increased, while if more than (optimal_iterations+iteration_window
), iterations are required, the time step is decreased. The iteration_window
parameter is optional. If it is not specified, it defaults to 1/5 the value specified for optimal_iterations
.
The decision on whether to grow or shrink the time step is based both on the number of nonlinear iterations and the number of linear iterations. The parameters mentioned above are used to control the optimal iterations and window for nonlinear iterations. The same criterion is applied to the linear iterations. Another parameter, linear_iteration
ratio, which defaults to 25, is used to control the optimal iterations and window for the linear iterations. These are calculated by multiplying linear_iteration_ratio
by optimal iterations and iteration window, respectively.
To grow the time step, the growth criterion must be met for both the linear iterations and nonlinear iterations. If the time step shrinkage criterion is reached for either the linear or nonlinear iterations, the time step is decreased. To control the time step size only based on the number of nonlinear iterations, set linear_iteration_ratio
to a large number.
If the time step is to be increased or decreased, that is done using the factors specified with the growth_factor
and cutback_factor
, respectively. If a solution fails to converge when adaptive time stepping is active, a new attempt is made using a smaller time step in the same manner as with the fixed time step methods. The maximum and minimum time steps can be optionally specified in the Executioner
block using the dtmax
and dtmin
parameters, respectively.
In addition to controlling the time step based on the iteration count, IterationAdaptiveDT
also has an option to limit the time step based on the behavior of a time-dependent function, optionally specified by providing the function name in timestep_limiting_function
. This is typically a function that is used to drive boundary conditions of the model. The step is cut back if the change in the function from the previous step exceeds the value specified in max_function_change
. This allows the step size to be changed to limit the change in the boundary conditions applied to the model over a step. In addition to that limit, the boolean parameter force_step_every_function_point
can be set to true
to force a time step at every point in a Piecewise
function. The time step size post function sync can be reset via the "post_function_sync_dt" input parameter as well.
The IterationAdaptiveDT
is often simply used to have an exponentially growing time step. For this purpose, the iteration related parameters are not required.
Example Input Syntax
[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
[]
[]
(test/tests/time_steppers/iteration_adaptive/adapt_tstep_shrink_init_dt.i)Input Parameters
- cutback_factor0.5Factor to apply to timestep if difficult convergence occurs (if 'optimal_iterations' is specified). For failed solves, use cutback_factor_at_failure
Default:0.5
C++ Type:double
Controllable:Yes
Description:Factor to apply to timestep if difficult convergence occurs (if 'optimal_iterations' is specified). For failed solves, use cutback_factor_at_failure
- cutback_factor_at_failure0.5Factor to apply to timestep if a time step fails to converge.
Default:0.5
C++ Type:double
Controllable:No
Description:Factor to apply to timestep if a time step fails to converge.
- force_step_every_function_pointFalseForces the timestepper to take a step that is consistent with points defined in the function
Default:False
C++ Type:bool
Controllable:No
Description:Forces the timestepper to take a step that is consistent with points defined in the function
- growth_factor2Factor to apply to timestep if easy convergence (if 'optimal_iterations' is specified) or if recovering from failed solve
Default:2
C++ Type:double
Controllable:Yes
Description:Factor to apply to timestep if easy convergence (if 'optimal_iterations' is specified) or if recovering from failed solve
- iteration_windowAttempt to grow/shrink timestep if the iteration count is below/above 'optimal_iterations plus/minus iteration_window' (default = optimal_iterations/5).
C++ Type:int
Controllable:No
Description:Attempt to grow/shrink timestep if the iteration count is below/above 'optimal_iterations plus/minus iteration_window' (default = optimal_iterations/5).
- linear_iteration_ratioThe ratio of linear to nonlinear iterations to determine target linear iterations and window for adaptive timestepping (default = 25)
C++ Type:unsigned int
Controllable:No
Description:The ratio of linear to nonlinear iterations to determine target linear iterations and window for adaptive timestepping (default = 25)
- max_function_changeThe absolute value of the maximum change in timestep_limiting_function over a timestep
C++ Type:double
Controllable:No
Description:The absolute value of the maximum change in timestep_limiting_function over a timestep
- optimal_iterationsThe target number of nonlinear iterations for adaptive timestepping
C++ Type:int
Controllable:No
Description:The target number of nonlinear iterations for adaptive timestepping
- post_function_sync_dtTimestep to apply after time sync with function point. To be used in conjunction with 'force_step_every_function_point'.
C++ Type:double
Controllable:No
Description:Timestep to apply after time sync with function point. To be used in conjunction with 'force_step_every_function_point'.
- reject_large_stepFalseIf 'true', time steps that are too large compared to the ideal time step will be rejected and repeated
Default:False
C++ Type:bool
Controllable:No
Description:If 'true', time steps that are too large compared to the ideal time step will be rejected and repeated
- reject_large_step_threshold0.1Ratio between the the ideal time step size and the current time step size below which a time step will be rejected if 'reject_large_step' is 'true'
Default:0.1
C++ Type:double
Controllable:No
Description:Ratio between the the ideal time step size and the current time step size below which a time step will be rejected if 'reject_large_step' is 'true'
- reset_dtFalseUse when restarting a calculation to force a change in dt.
Default:False
C++ Type:bool
Controllable:No
Description:Use when restarting a calculation to force a change in dt.
- time_dtThe values of dt
C++ Type:std::vector<double>
Controllable:No
Description:The values of dt
- time_tThe values of t
C++ Type:std::vector<double>
Controllable:No
Description:The values of t
- timestep_limiting_functionA list of 'PiecewiseBase' type functions used to control the timestep by limiting the change in the function over a timestep
C++ Type:std::vector<FunctionName>
Controllable:No
Description:A list of 'PiecewiseBase' type functions used to control the timestep by limiting the change in the function over a timestep
- timestep_limiting_postprocessorIf specified, a list of postprocessor values used as an upper limit for the current time step length
C++ Type:std::vector<PostprocessorName>
Controllable:No
Description:If specified, a list of postprocessor values used as an upper limit for the current time step length
Optional 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.
- enableTruewhether or not to enable the time stepper
Default:True
C++ Type:bool
Controllable:Yes
Description:whether or not to enable the time stepper
Advanced Parameters
Input Files
- (modules/solid_mechanics/test/tests/anisotropic_elastoplasticity/ad_aniso_plasticity_x_one_ref.i)
- (modules/navier_stokes/examples/laser-welding/3d.i)
- (modules/combined/test/tests/adaptive_timestepping/adapt_tstep_function_force_step.i)
- (modules/phase_field/test/tests/grain_tracker_test/split_grain.i)
- (modules/solid_mechanics/test/tests/ad_anisotropic_creep/ad_aniso_creep_integration_error.i)
- (modules/thermal_hydraulics/tutorials/single_phase_flow/05_secondary_side.i)
- (modules/phase_field/examples/grain_growth/grain_growth_2D_random.i)
- (modules/combined/examples/phase_field-mechanics/hex_grain_growth_2D_eldrforce.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/channel-flow/2d-transient-action.i)
- (modules/phase_field/examples/grain_growth/grain_growth_linearized_interface.i)
- (modules/porous_flow/test/tests/gravity/grav02g.i)
- (modules/combined/test/tests/adaptive_timestepping/adapt_tstep_function_change.i)
- (modules/phase_field/test/tests/GrandPotentialPFM/GrandPotentialAnisotropyAntitrap.i)
- (test/tests/time_steppers/iteration_adaptive/multi_piecewise_sync_dt.i)
- (modules/combined/examples/publications/rapid_dev/fig7b.i)
- (modules/combined/examples/publications/rapid_dev/fig7a.i)
- (test/tests/time_steppers/iteration_adaptive/adapt_tstep_shrink_init_dt.i)
- (modules/combined/examples/phase_field-mechanics/SimplePhaseTrans.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/dc.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_direct.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/natural_convection/fuel_cavity.i)
- (modules/level_set/test/tests/reinitialization/reinit_modified.i)
- (modules/porous_flow/test/tests/gravity/grav02e.i)
- (modules/porous_flow/test/tests/dirackernels/theis3.i)
- (modules/navier_stokes/examples/laser-welding/2d.i)
- (modules/solid_mechanics/test/tests/rom_stress_update/creep_ramp_sub_false.i)
- (modules/phase_field/tutorials/spinodal_decomposition/s2_fasttest.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_reversal.i)
- (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/lid-driven-two-phase.i)
- (modules/solid_mechanics/test/tests/material_limit_time_step/damage/scalar_material_damage_timestep_limit.i)
- (modules/porous_flow/examples/restart/gas_injection_new_mesh.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/dirichlet_bcs_mdot.i)
- (modules/solid_mechanics/test/tests/ad_anisotropic_creep/anis_mech_hill_tensor_creep_small_tiny_step_ts_limit_test.i)
- (modules/thermal_hydraulics/test/tests/postprocessors/flow_junction_flux_1phase/flow_junction_flux_1phase.i)
- (modules/porous_flow/test/tests/gravity/grav02f.i)
- (modules/thermal_hydraulics/test/tests/postprocessors/specific_impulse_1phase/Isp_1ph.i)
- (modules/porous_flow/examples/restart/gas_injection.i)
- (modules/thermal_hydraulics/tutorials/single_phase_flow/02_core.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/channel-flow/2d-transient.i)
- (test/tests/time_steppers/iteration_adaptive/adapt_tstep_grow_dtfunc.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/multiapps/picard/picard_adaptive_parent.i)
- (modules/phase_field/examples/anisotropic_interfaces/GrandPotentialTwophaseAnisotropy.i)
- (test/tests/time_steppers/iteration_adaptive/multi_piecewise_linear.i)
- (modules/solid_mechanics/test/tests/rom_stress_update/creep_ramp_sub_false_more_steps.i)
- (modules/solid_mechanics/test/tests/ad_2D_geometries/2D-RZ_test.i)
- (modules/porous_flow/examples/thm_example/2D.i)
- (modules/porous_flow/examples/tutorial/11_2D.i)
- (modules/solid_mechanics/test/tests/anisotropic_elastoplasticity/hoop_strain_comparison_coarse_xaxis.i)
- (modules/porous_flow/test/tests/fluidstate/theis_tabulated.i)
- (modules/porous_flow/examples/tutorial/11.i)
- (modules/solid_mechanics/test/tests/anisotropic_elastoplasticity/hoop_strain_comparison_coarse_yaxis.i)
- (modules/combined/examples/publications/rapid_dev/fig6.i)
- (modules/phase_field/examples/slkks/CrFe.i)
- (modules/phase_field/test/tests/electrochem_sintering/ElectrochemicalSintering_test.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/boussinesq/transient-wcnsfv.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/natural_convection/natural_circulation_pipe.i)
- (modules/combined/examples/publications/rapid_dev/fig3.i)
- (test/tests/time_steppers/iteration_adaptive/adapt_tstep_grow_init_dt.i)
- (modules/porous_flow/test/tests/dispersion/disp01.i)
- (modules/phase_field/examples/ebsd_reconstruction/IN100-111grn.i)
- (modules/navier_stokes/test/tests/finite_element/pins/expansion-channel/expansion-channel-slip-wall.i)
- (test/tests/time_steppers/iteration_adaptive/adapt_tstep_grow_init_dt_restart.i)
- (modules/combined/examples/phase_field-mechanics/LandauPhaseTrans.i)
- (modules/navier_stokes/examples/flow-over-circle/executioner_postprocessor.i)
- (modules/phase_field/examples/grain_growth/grain_growth_2D_voronoi.i)
- (modules/solid_mechanics/test/tests/anisotropic_plasticity/ad_aniso_plasticity_x_rotate.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/neighbor-connected-boundary/test.i)
- (test/tests/multiapps/sub_cycling/sub_iteration_adaptive.i)
- (modules/solid_mechanics/test/tests/material_limit_time_step/damage/elements_changed_timestep_limit.i)
- (modules/combined/examples/publications/rapid_dev/fig8.i)
- (modules/solid_mechanics/test/tests/anisotropic_elastoplasticity/ad_uniaxial_y.i)
- (modules/porous_flow/examples/multiapp_fracture_flow/3dFracture/fracture_only_aperture_changing.i)
- (modules/navier_stokes/examples/solidification/galium_melting.i)
- (modules/navier_stokes/test/tests/finite_element/ins/mms/supg/supg_adv_dominated_mms.i)
- (modules/porous_flow/examples/co2_intercomparison/1Dradial/1Dradial.i)
- (modules/phase_field/examples/anisotropic_interfaces/snow.i)
- (modules/porous_flow/examples/lava_lamp/1phase_convection.i)
- (modules/porous_flow/test/tests/fluidstate/theis_brineco2_nonisothermal.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/materials/2d-transient.i)
- (modules/phase_field/examples/grain_growth/grain_growth_3D.i)
- (test/tests/time_steppers/iteration_adaptive/adapt_tstep_reject_large_dt.i)
- (modules/porous_flow/test/tests/fluidstate/coldwater_injection.i)
- (modules/porous_flow/examples/tutorial/13.i)
- (modules/porous_flow/test/tests/dispersion/disp01_fv.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_mdot.i)
- (test/tests/time_steppers/iteration_adaptive/adapt_tstep_multi_pps_lim.i)
- (modules/phase_field/tutorials/spinodal_decomposition/s4_mobility.i)
- (modules/porous_flow/examples/solute_tracer_transport/solute_tracer_transport_2D.i)
- (modules/thermal_hydraulics/tutorials/single_phase_flow/04_loop.i)
- (modules/navier_stokes/test/tests/finite_volume/materials/ergun/ergun.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/wall_distance_capped_mixing_length_aux/capped_mixing_length.i)
- (test/tests/time_steppers/iteration_adaptive/adapt_tstep_pps_lim.i)
- (test/tests/multiapps/picard/picard_adaptive_sub.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/mixing_length_total_viscosity_material/mixing_length_total_viscosity.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/mixing_length_eddy_viscosity_aux/mixing_length_eddy_viscosity.i)
- (modules/porous_flow/test/tests/fluidstate/coldwater_injection_radial.i)
- (modules/thermal_hydraulics/test/tests/problems/area_constriction/area_constriction_junction.i)
- (test/tests/time_steppers/iteration_adaptive/adapt_tstep_grow_dtfunc_restart.i)
- (modules/porous_flow/test/tests/sinks/injection_production_eg.i)
- (modules/solid_mechanics/test/tests/anisotropic_elastoplasticity/ad_uniaxial_x.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/rotated-2d-bkt-function-porosity.i)
- (modules/porous_flow/test/tests/sinks/injection_production_eg_outflowBC.i)
- (modules/heat_transfer/test/tests/recover/ad_recover.i)
- (modules/thermal_hydraulics/test/tests/problems/area_constriction/area_constriction.i)
- (modules/solid_mechanics/test/tests/ad_isotropic_elasticity_tensor/2D-axisymmetric_rz_test.i)
- (modules/phase_field/examples/nucleation/cahn_hilliard.i)
- (modules/solid_mechanics/test/tests/anisotropic_elastoplasticity/hoop_strain_comparison_coarse_zaxis.i)
- (modules/phase_field/tutorials/spinodal_decomposition/s3_decomp.i)
- (modules/porous_flow/examples/solute_tracer_transport/solute_tracer_transport.i)
- (modules/solid_mechanics/test/tests/material_limit_time_step/creep/nafems_test5a_lim.i)
- (modules/combined/examples/periodic_strain/global_strain_pfm.i)
- (modules/phase_field/test/tests/MultiPhase/mixedswitchingfunctionmaterial.i)
- (test/tests/time_steppers/iteration_adaptive/piecewise_constant.i)
- (modules/level_set/test/tests/reinitialization/reinit.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/rotated-2d-bkt-function-porosity-mixed.i)
- (modules/thermal_hydraulics/test/tests/components/volume_junction_1phase/junction_with_calorifically_imperfect_gas.i)
- (modules/navier_stokes/test/tests/finite_volume/pwcns/boundary_conditions/flux_bcs_mdot-action.i)
- (modules/navier_stokes/test/tests/finite_element/ins/lid_driven/transient_fsp.i)
- (modules/thermal_hydraulics/test/tests/problems/brayton_cycle/recuperated_brayton_cycle.i)
- (modules/porous_flow/examples/multiapp_fracture_flow/3dFracture/matrix_app.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_velocity-action.i)
- (modules/combined/examples/phase_field-mechanics/grain_texture.i)
- (modules/solid_mechanics/test/tests/umat/time_step/elastic_timestep.i)
- (modules/combined/examples/phase_field-mechanics/poly_grain_growth_2D_eldrforce.i)
- (modules/porous_flow/examples/natural_convection/natural_convection.i)
- (modules/porous_flow/examples/lava_lamp/2phase_convection.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_mdot-action.i)
- (modules/porous_flow/examples/restart/gravityeq.i)
- (test/tests/mesh/preparedness/test.i)
- (modules/navier_stokes/test/tests/finite_element/ins/scalar_adr/supg/2d_advection_error_testing.i)
- (modules/phase_field/examples/anisotropic_interfaces/GrandPotentialSolidification.i)
- (modules/phase_field/test/tests/slkks/full_solve.i)
- (modules/porous_flow/test/tests/gravity/grav02e_fv.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/implicit-euler-basic-kt-primitive.i)
- (modules/solid_mechanics/test/tests/isotropic_elasticity_tensor/2D-axisymmetric_rz_test.i)
- (modules/porous_flow/test/tests/dispersion/disp01_heavy.i)
- (modules/combined/test/tests/adaptive_timestepping/adapt_tstep_function_change_restart2.i)
- (modules/phase_field/examples/nucleation/refine.i)
- (modules/porous_flow/examples/thm_example/2D_c.i)
- (modules/solid_mechanics/test/tests/anisotropic_elastoplasticity/ad_aniso_plasticity_x_one.i)
- (modules/heat_transfer/test/tests/recover/recover.i)
- (modules/solid_mechanics/test/tests/ad_anisotropic_creep/aniso_creep_integration_error.i)
- (modules/navier_stokes/test/tests/finite_element/ins/mms/supg/supg_pspg_adv_dominated_mms.i)
- (test/tests/time_steppers/time_stepper_system/multiple_timesteppers.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/pressure_outlet/subsonic_nozzle_fixed_inflow_hllc.i)
- (modules/porous_flow/examples/ates/ates.i)
- (modules/thermal_hydraulics/test/tests/components/junction_parallel_channels_1phase/junction_with_calorifically_imperfect_gas.i)
- (modules/phase_field/examples/grain_growth/3D_6000_gr.i)
- (modules/combined/examples/periodic_strain/global_strain_pfm_3D.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/dirichlet_bcs_velocity.i)
- (modules/fsi/test/tests/2d-finite-strain-steady/thermal-me.i)
- (modules/porous_flow/test/tests/fluidstate/theis_brineco2.i)
- (modules/navier_stokes/examples/laser-welding/2d-fv.i)
- (modules/phase_field/test/tests/GBType/GB_Type_Phase1.i)
- (test/tests/time_steppers/iteration_adaptive/hit_function_knot.i)
- (modules/combined/examples/phase_field-mechanics/EBSD_reconstruction_grain_growth_mech.i)
- (test/tests/time_steppers/time_stepper_system/AB2PredictorCorrector.i)
- (modules/phase_field/examples/anisotropic_interfaces/GrandPotentialPlanarGrowth.i)
- (modules/navier_stokes/test/tests/finite_volume/cns/heated-channel/transient-porous-kt-primitive.i)
- (test/tests/multiapps/sub_cycling/sub_negative.i)
- (modules/solid_mechanics/test/tests/rom_stress_update/creep_ramp_sub_true.i)
- (modules/porous_flow/examples/reservoir_model/regular_grid.i)
- (test/tests/time_steppers/iteration_adaptive/multi_piecewise.i)
- (modules/phase_field/tutorials/spinodal_decomposition/s5_energycurve.i)
- (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/rayleigh-bernard-two-phase.i)
- (modules/phase_field/test/tests/Nucleation/timestep.i)
- (modules/solid_mechanics/test/tests/anisotropic_plasticity/ad_aniso_plasticity_y.i)
- (modules/solid_mechanics/test/tests/anisotropic_elastoplasticity/hoop_strain_comparison.i)
- (modules/combined/test/tests/adaptive_timestepping/adapt_tstep_function_change_restart1.i)
- (modules/phase_field/examples/grain_growth/grain_growth_2D_graintracker.i)
- (modules/solid_mechanics/test/tests/material_limit_time_step/elas_plas/nafems_nl1_lim.i)
- (modules/porous_flow/test/tests/fluidstate/theis_nonisothermal.i)
- (modules/phase_field/examples/anisotropic_interfaces/ad_snow.i)
- (modules/solid_mechanics/test/tests/material_limit_time_step/mult_inelastic/no_inelastic_model_timestep_limit.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_velocity.i)
- (modules/thermal_hydraulics/tutorials/single_phase_flow/06_custom_closures.i)
- (modules/solid_mechanics/test/tests/anisotropic_elastoplasticity/ad_uniaxial_x_non_linear.i)
- (test/tests/multiapps/loose_couple_time_adapt/adaptiveDT.i)
- (test/tests/userobjects/Terminator/terminator_pass.i)
- (modules/solid_mechanics/test/tests/2D_geometries/2D-RZ_test.i)
- (test/tests/fvkernels/fv_simple_diffusion/grad-adaptive.i)
- (modules/thermal_hydraulics/tutorials/single_phase_flow/03_upper_loop.i)
- (modules/porous_flow/test/tests/fluidstate/theis.i)
- (modules/porous_flow/test/tests/fluidstate/water_vapor_phasechange.i)
- (modules/solid_mechanics/test/tests/anisotropic_plasticity/ad_aniso_plasticity_x.i)
post_function_sync_dt
C++ Type:double
Controllable:No
Description:Timestep to apply after time sync with function point. To be used in conjunction with 'force_step_every_function_point'.
(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/anisotropic_elastoplasticity/ad_aniso_plasticity_x_one_ref.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 3
nx = 10
ny = 2
nz = 2
xmin = 0.0
ymin = 0.0
zmin = 0.0
xmax = 10.0
ymax = 1.0
zmax = 1.0
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
volumetric_locking_correction = true
[]
[AuxVariables]
[hydrostatic_stress]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_xx]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_xy]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[hydrostatic_stress]
type = ADRankTwoScalarAux
variable = hydrostatic_stress
rank_two_tensor = stress
scalar_type = Hydrostatic
[]
[plasticity_strain_xx]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_xx
index_i = 0
index_j = 0
[]
[plasticity_strain_xy]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_xy
index_i = 0
index_j = 1
[]
[plasticity_strain_yy]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_yy
index_i = 1
index_j = 1
[]
[sigma_xx]
type = ADRankTwoAux
rank_two_tensor = stress
variable = stress_xx
index_i = 1
index_j = 1
[]
[]
[Functions]
[pull]
type = PiecewiseLinear
x = '0 1e1 1e8'
y = '0 -4e2 -4e2'
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = FINITE
generate_output = 'elastic_strain_xx stress_xx'
use_automatic_differentiation = true
add_variables = true
[]
[]
[Materials]
[elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 70000
poissons_ratio = 0.25
[]
[elastic_strain]
type = ADComputeMultipleInelasticStress
inelastic_models = "trial_plasticity"
max_iterations = 50
absolute_tolerance = 1e-16
[]
[hill_tensor]
type = ADHillConstants
# F G H L M N
hill_constants = "0.5829856 0.364424 0.6342174 2.0691375 2.3492325 1.814589"
[]
[trial_plasticity]
type = ADHillPlasticityStressUpdate
hardening_constant = 2000.0
yield_stress = 0.001 # was 200 for verification
absolute_tolerance = 1e-15
relative_tolerance = 1e-13
# internal_solve_full_iteration_history = true
max_inelastic_increment = 2.0e-6
# internal_solve_output_on = on_error
[]
[]
[BCs]
[no_disp_x]
type = ADDirichletBC
variable = disp_x
boundary = left
value = 0.0
[]
[no_disp_y]
type = ADDirichletBC
variable = disp_y
boundary = left
value = 0.0
[]
[no_disp_z]
type = ADDirichletBC
variable = disp_z
boundary = left
value = 0.0
[]
[Pressure]
[Side1]
boundary = right
function = pull
[]
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_rel_tol = 1e-12
nl_abs_tol = 1.0e-14
l_max_its = 90
num_steps = 25
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 30
iteration_window = 9
growth_factor = 1.05
cutback_factor = 0.5
timestep_limiting_postprocessor = matl_ts_min
dt = 1.0e-5
time_t = '0 3.4e-5 10'
time_dt = '1.0e-5 1.0e-7 1.0e-7'
[]
start_time = 0
automatic_scaling = true
[]
[Postprocessors]
[matl_ts_min]
type = MaterialTimeStepPostprocessor
[]
[max_disp_x]
type = ElementExtremeValue
variable = disp_x
[]
[max_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
[]
[dt]
type = TimestepSize
[]
[plasticity_strain_xx]
type = ElementalVariableValue
variable = plastic_strain_xx
execute_on = 'TIMESTEP_END'
elementid = 0
[]
[elastic_strain_xx]
type = ElementalVariableValue
variable = elastic_strain_xx
execute_on = 'TIMESTEP_END'
elementid = 0
[]
[sigma_xx]
type = ElementalVariableValue
variable = stress_xx
execute_on = 'TIMESTEP_END'
elementid = 0
[]
[]
[Outputs]
csv = true
perf_graph = true
[]
(modules/navier_stokes/examples/laser-welding/3d.i)
period=1.25e-3
endtime=${period}
timestep=1.25e-5
surfacetemp=300
sb=5.67e-8
[GlobalParams]
temperature = T
[]
[Mesh]
type = GeneratedMesh
dim = 3
xmin = -.35e-3
xmax = 0.35e-3
ymin = -.35e-3
ymax = .35e-3
zmin = -.7e-3
zmax = 0
nx = 2
ny = 2
nz = 2
displacements = 'disp_x disp_y disp_z'
uniform_refine = 2
[]
[Variables]
[vel]
family = LAGRANGE_VEC
[]
[T]
[]
[p]
[]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[]
[ICs]
[T]
type = FunctionIC
variable = T
function = '(${surfacetemp} - 300) / .7e-3 * z + ${surfacetemp}'
[]
[]
[Kernels]
[disp_x]
type = Diffusion
variable = disp_x
[]
[disp_y]
type = Diffusion
variable = disp_y
[]
[disp_z]
type = Diffusion
variable = disp_z
[]
[mass]
type = INSADMass
variable = p
use_displaced_mesh = true
[]
[mass_pspg]
type = INSADMassPSPG
variable = p
use_displaced_mesh = true
[]
[momentum_time]
type = INSADMomentumTimeDerivative
variable = vel
use_displaced_mesh = true
[]
[momentum_advection]
type = INSADMomentumAdvection
variable = vel
use_displaced_mesh = true
[]
[momentum_mesh_advection]
type = INSADMomentumMeshAdvection
variable = vel
disp_x = disp_x
disp_y = disp_y
disp_z = disp_z
use_displaced_mesh = true
[]
[momentum_viscous]
type = INSADMomentumViscous
variable = vel
use_displaced_mesh = true
[]
[momentum_pressure]
type = INSADMomentumPressure
variable = vel
pressure = p
integrate_p_by_parts = true
use_displaced_mesh = true
[]
[momentum_supg]
type = INSADMomentumSUPG
variable = vel
material_velocity = relative_velocity
use_displaced_mesh = true
[]
[temperature_time]
type = INSADHeatConductionTimeDerivative
variable = T
use_displaced_mesh = true
[]
[temperature_advection]
type = INSADEnergyAdvection
variable = T
use_displaced_mesh = true
[]
[temperature_mesh_advection]
type = INSADEnergyMeshAdvection
variable = T
disp_x = disp_x
disp_y = disp_y
disp_z = disp_z
use_displaced_mesh = true
[]
[temperature_conduction]
type = ADHeatConduction
variable = T
thermal_conductivity = 'k'
use_displaced_mesh = true
[]
[temperature_supg]
type = INSADEnergySUPG
variable = T
velocity = vel
use_displaced_mesh = true
[]
[]
[BCs]
[x_no_disp]
type = DirichletBC
variable = disp_x
boundary = 'back'
value = 0
[]
[y_no_disp]
type = DirichletBC
variable = disp_y
boundary = 'back'
value = 0
[]
[z_no_disp]
type = DirichletBC
variable = disp_z
boundary = 'back'
value = 0
[]
[no_slip]
type = ADVectorFunctionDirichletBC
variable = vel
boundary = 'bottom right left top back'
[]
[T_cold]
type = DirichletBC
variable = T
boundary = 'back'
value = 300
[]
[radiation_flux]
type = FunctionRadiativeBC
variable = T
boundary = 'front'
emissivity_function = '1'
Tinfinity = 300
stefan_boltzmann_constant = ${sb}
use_displaced_mesh = true
[]
[weld_flux]
type = GaussianEnergyFluxBC
variable = T
boundary = 'front'
P0 = 159.96989792079225
R = 1.8257418583505537e-4
x_beam_coord = '2e-4 * cos(t * 2 * pi / ${period})'
y_beam_coord = '2e-4 * sin(t * 2 * pi / ${period})'
z_beam_coord = 0
use_displaced_mesh = true
[]
[vapor_recoil]
type = INSADVaporRecoilPressureMomentumFluxBC
variable = vel
boundary = 'front'
use_displaced_mesh = true
[]
[displace_x_top]
type = INSADDisplaceBoundaryBC
boundary = 'front'
variable = 'disp_x'
velocity = 'vel'
component = 0
associated_subdomain = 0
[]
[displace_y_top]
type = INSADDisplaceBoundaryBC
boundary = 'front'
variable = 'disp_y'
velocity = 'vel'
component = 1
associated_subdomain = 0
[]
[displace_z_top]
type = INSADDisplaceBoundaryBC
boundary = 'front'
variable = 'disp_z'
velocity = 'vel'
component = 2
associated_subdomain = 0
[]
[displace_x_top_dummy]
type = INSADDummyDisplaceBoundaryIntegratedBC
boundary = 'front'
variable = 'disp_x'
velocity = 'vel'
component = 0
[]
[displace_y_top_dummy]
type = INSADDummyDisplaceBoundaryIntegratedBC
boundary = 'front'
variable = 'disp_y'
velocity = 'vel'
component = 1
[]
[displace_z_top_dummy]
type = INSADDummyDisplaceBoundaryIntegratedBC
boundary = 'front'
variable = 'disp_z'
velocity = 'vel'
component = 2
[]
[]
[Materials]
[ins_mat]
type = INSADStabilized3Eqn
velocity = vel
pressure = p
temperature = T
use_displaced_mesh = true
[]
[steel]
type = AriaLaserWeld304LStainlessSteel
temperature = T
beta = 1e7
use_displaced_mesh = true
[]
[steel_boundary]
type = AriaLaserWeld304LStainlessSteelBoundary
boundary = 'front'
temperature = T
use_displaced_mesh = true
[]
[const]
type = GenericConstantMaterial
prop_names = 'abs sb_constant'
prop_values = '1 ${sb}'
use_displaced_mesh = true
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu NONZERO strumpack'
[]
[]
[Executioner]
type = Transient
end_time = ${endtime}
dtmin = 1e-8
dtmax = ${timestep}
petsc_options = '-snes_converged_reason -ksp_converged_reason -options_left'
solve_type = 'NEWTON'
line_search = 'none'
nl_max_its = 12
l_max_its = 100
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 7
dt = ${timestep}
linear_iteration_ratio = 1e6
growth_factor = 1.5
[]
[]
[Outputs]
[exodus]
type = Exodus
output_material_properties = true
show_material_properties = 'mu'
[]
checkpoint = true
perf_graph = true
[]
[Debug]
show_var_residual_norms = true
[]
[Adaptivity]
marker = combo
max_h_level = 4
[Indicators]
[error_T]
type = GradientJumpIndicator
variable = T
[]
[error_dispz]
type = GradientJumpIndicator
variable = disp_z
[]
[]
[Markers]
[errorfrac_T]
type = ErrorFractionMarker
refine = 0.4
coarsen = 0.2
indicator = error_T
[]
[errorfrac_dispz]
type = ErrorFractionMarker
refine = 0.4
coarsen = 0.2
indicator = error_dispz
[]
[combo]
type = ComboMarker
markers = 'errorfrac_T errorfrac_dispz'
[]
[]
[]
[Postprocessors]
[num_dofs]
type = NumDOFs
system = 'NL'
[]
[nl]
type = NumNonlinearIterations
[]
[tot_nl]
type = CumulativeValuePostprocessor
postprocessor = 'nl'
[]
[]
(modules/combined/test/tests/adaptive_timestepping/adapt_tstep_function_force_step.i)
# This is a test designed to evaluate the cabability of the
# IterationAdaptiveDT TimeStepper to adjust time step size according to
# a function. For example, if the power input function for a BISON
# simulation rapidly increases or decreases, the IterationAdaptiveDT
# TimeStepper should take time steps small enough to capture the
# oscillation.
[GlobalParams]
order = FIRST
family = LAGRANGE
block = 1
volumetric_locking_correction = true
displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
file = 1hex8_10mm_cube.e
[]
[Functions]
[./Fiss_Function]
type = PiecewiseLinear
data_file = blip.csv
format = columns
[../]
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[./disp_z]
[../]
[./temp]
initial_condition = 300.0
[../]
[]
[Modules/TensorMechanics/Master]
[./all]
strain = FINITE
incremental = true
eigenstrain_names = thermal_expansion
add_variables = true
generate_output = 'vonmises_stress'
temperature = temp
[../]
[]
[Kernels]
[./heat]
type = HeatConduction
variable = temp
[../]
[./heat_ie]
type = HeatConductionTimeDerivative
variable = temp
[../]
[./heat_source]
type = HeatSource
variable = temp
value = 1.0
function = Fiss_Function
[../]
[]
[BCs]
[./bottom_temp]
type = DirichletBC
variable = temp
boundary = 1
value = 300
[../]
[./top_bottom_disp_x]
type = DirichletBC
variable = disp_x
boundary = '1'
value = 0
[../]
[./top_bottom_disp_y]
type = DirichletBC
variable = disp_y
boundary = '1'
value = 0
[../]
[./top_bottom_disp_z]
type = DirichletBC
variable = disp_z
boundary = '1'
value = 0
[../]
[]
[Materials]
[./thermal]
type = HeatConductionMaterial
temp = temp
specific_heat = 1.0
thermal_conductivity = 1.0
[../]
[./elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 300e6
poissons_ratio = .3
[../]
[./stress]
type = ComputeFiniteStrainElasticStress
[../]
[./thermal_expansion]
type = ComputeThermalExpansionEigenstrain
thermal_expansion_coeff = 5e-6
stress_free_temperature = 300.0
temperature = temp
eigenstrain_name = thermal_expansion
[../]
[./density]
type = Density
density = 10963.0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
verbose = true
nl_abs_tol = 1e-10
start_time = 0.0
num_steps = 50000
end_time = 5.1e3
[./TimeStepper]
type = IterationAdaptiveDT
timestep_limiting_function = Fiss_Function
max_function_change = 3e20
force_step_every_function_point = true
dt = 1e2
[../]
[]
[Postprocessors]
[./Temperature_of_Block]
type = ElementAverageValue
variable = temp
execute_on = 'initial timestep_end'
[../]
[./vonMises]
type = ElementAverageValue
variable = vonmises_stress
execute_on = 'initial timestep_end'
[../]
[]
[Outputs]
[./out]
type = Exodus
elemental_as_nodal = true
[../]
[./console]
type = Console
max_rows = 10
[../]
[]
(modules/phase_field/test/tests/grain_tracker_test/split_grain.i)
[Mesh]
[ebsd_mesh]
type = EBSDMeshGenerator
filename = EBSD_split_grain.txt
[]
[]
[GlobalParams]
op_num = 4
var_name_base = gr
[]
[UserObjects]
[ebsd_reader]
type = EBSDReader
[]
[ebsd]
type = PolycrystalEBSD
coloring_algorithm = bt
ebsd_reader = ebsd_reader
enable_var_coloring = true
output_adjacency_matrix = true
[]
[grain_tracker]
type = GrainTracker
flood_entity_type = ELEMENTAL
compute_halo_maps = true # For displaying HALO fields
polycrystal_ic_uo = ebsd
[]
[]
[ICs]
[PolycrystalICs]
[PolycrystalColoringIC]
polycrystal_ic_uo = ebsd
[]
[]
[]
[Variables]
[PolycrystalVariables]
[]
[]
[AuxVariables]
[bnds]
[]
[unique_grains]
order = CONSTANT
family = MONOMIAL
[]
[ghost_elements]
order = CONSTANT
family = MONOMIAL
[]
[halos]
order = CONSTANT
family = MONOMIAL
[]
[var_indices]
order = CONSTANT
family = MONOMIAL
[]
[ebsd_grains]
family = MONOMIAL
order = CONSTANT
[]
[]
[Kernels]
[PolycrystalKernel]
[]
[]
[AuxKernels]
[BndsCalc]
type = BndsCalcAux
variable = bnds
execute_on = 'initial timestep_end'
[]
[ghost_elements]
type = FeatureFloodCountAux
variable = ghost_elements
field_display = GHOSTED_ENTITIES
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
[]
[halos]
type = FeatureFloodCountAux
variable = halos
field_display = HALOS
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
[]
[var_indices]
type = FeatureFloodCountAux
variable = var_indices
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
[]
[unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
field_display = UNIQUE_REGION
[]
[grain_aux]
type = EBSDReaderPointDataAux
variable = ebsd_grains
ebsd_reader = ebsd_reader
data_name = 'feature_id'
execute_on = 'initial timestep_end'
[]
[]
[Modules]
[PhaseField]
[EulerAngles2RGB]
crystal_structure = cubic
euler_angle_provider = ebsd_reader
grain_tracker = grain_tracker
[]
[]
[]
[Materials]
[Copper]
# T = 500 # K
type = GBEvolution
T = 500
wGB = 0.6 # um
GBmob0 = 2.5e-6 # m^4/(Js) from Schoenfelder 1997
Q = 0.23 # Migration energy in eV
GBenergy = 0.708 # GB energy in J/m^2
molar_volume = 7.11e-6 # Molar volume in m^3/mol
length_scale = 1.0e-6
time_scale = 1.0e-6
[]
[]
[Postprocessors]
[n_elements]
type = NumElems
execute_on = 'initial timestep_end'
[]
[n_nodes]
type = NumNodes
execute_on = 'initial timestep_end'
[]
[DOFs]
type = NumDOFs
[]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type -pc_hypre_boomeramg_strong_threshold'
petsc_options_value = 'hypre boomeramg 0.7'
l_tol = 1.0e-4
l_max_its = 20
nl_max_its = 20
nl_rel_tol = 1.0e-8
start_time = 0.0
num_steps = 2
[TimeStepper]
type = IterationAdaptiveDT
cutback_factor = 0.9
dt = 10.0
growth_factor = 1.1
optimal_iterations = 7
[]
[]
[Outputs]
exodus = true
csv = true
perf_graph = true
[]
(modules/solid_mechanics/test/tests/ad_anisotropic_creep/ad_aniso_creep_integration_error.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 3
nx = 10
ny = 2
nz = 2
xmin = 0.0
ymin = 0.0
zmin = 0.0
xmax = 10.0
ymax = 1.0
zmax = 1.0
[]
[corner_node]
type = ExtraNodesetGenerator
new_boundary = '100'
nodes = '3 69'
input = gen
[]
[corner_node_2]
type = ExtraNodesetGenerator
new_boundary = '101'
nodes = '4 47'
input = corner_node
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
volumetric_locking_correction = true
[]
[AuxVariables]
[hydrostatic_stress]
order = CONSTANT
family = MONOMIAL
[]
[creep_strain_xx]
order = CONSTANT
family = MONOMIAL
[]
[creep_strain_xy]
order = CONSTANT
family = MONOMIAL
[]
[creep_strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[hydrostatic_stress]
type = ADRankTwoScalarAux
variable = hydrostatic_stress
rank_two_tensor = stress
scalar_type = Hydrostatic
[]
[creep_strain_xx]
type = ADRankTwoAux
rank_two_tensor = creep_strain
variable = creep_strain_xx
index_i = 0
index_j = 0
[]
[creep_strain_xy]
type = ADRankTwoAux
rank_two_tensor = creep_strain
variable = creep_strain_xy
index_i = 0
index_j = 1
[]
[creep_strain_yy]
type = ADRankTwoAux
rank_two_tensor = creep_strain
variable = creep_strain_yy
index_i = 1
index_j = 1
[]
[sigma_xx]
type = ADRankTwoAux
rank_two_tensor = stress
variable = stress_xx
index_i = 1
index_j = 1
[]
[]
[Functions]
[pull]
type = PiecewiseLinear
x = '0 1.0'
y = '0 -4e1'
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = FINITE
generate_output = 'elastic_strain_xx stress_xx'
use_automatic_differentiation = true
add_variables = true
[]
[]
[Materials]
[elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 7000
poissons_ratio = 0.0
[]
[elastic_strain]
type = ADComputeMultipleInelasticStress
inelastic_models = "trial_creep_two"
max_iterations = 50
absolute_tolerance = 1e-16
[]
[hill_tensor]
type = ADHillConstants
# F G H L M N
hill_constants = "0.5 0.25 0.3866 1.6413 1.6413 1.2731"
[]
[trial_creep_two]
type = ADHillCreepStressUpdate
coefficient = 1e-16
n_exponent = 9
m_exponent = 0
activation_energy = 0
max_inelastic_increment = 1.0e-4
absolute_tolerance = 1e-20
relative_tolerance = 1e-20
max_integration_error = 1.0e-5
[]
[]
[BCs]
[no_disp_x]
type = ADDirichletBC
variable = disp_x
boundary = left
value = 0.0
[]
[no_disp_y]
type = ADDirichletBC
variable = disp_y
boundary = 100
value = 0.0
[]
[no_disp_z]
type = ADDirichletBC
variable = disp_z
boundary = 101
value = 0.0
[]
[Pressure]
[Side1]
boundary = right
function = pull
[]
[]
[]
[UserObjects]
[terminator_creep]
type = Terminator
expression = 'time_step_size > matl_ts_min'
fail_mode = SOFT
execute_on = TIMESTEP_END
[]
[]
[Executioner]
type = Transient
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_rel_tol = 1.0e-13
nl_abs_tol = 1.0e-13
l_max_its = 10
end_time = 1.65e-1
dt = 2.5e-2
start_time = 0
automatic_scaling = true
[./TimeStepper]
type = IterationAdaptiveDT
dt = 2.5e-2
time_t = '0.0 10.0'
time_dt = '2.5e-2 2.5e-2 '
optimal_iterations = 30
iteration_window = 9
growth_factor = 1.5
cutback_factor = 0.5
timestep_limiting_postprocessor = matl_ts_min
[../]
[]
[Postprocessors]
[time_step_size]
type = TimestepSize
[]
[matl_ts_min]
type = MaterialTimeStepPostprocessor
[]
[max_disp_x]
type = ElementExtremeValue
variable = disp_x
[]
[max_disp_y]
type = ElementExtremeValue
variable = disp_y
[]
[max_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
[]
[dt]
type = TimestepSize
[]
[num_lin]
type = NumLinearIterations
outputs = console
[]
[num_nonlin]
type = NumNonlinearIterations
outputs = console
[]
[creep_strain_xx]
type = ElementalVariableValue
variable = creep_strain_xx
execute_on = 'TIMESTEP_END'
elementid = 39
[]
[elastic_strain_xx]
type = ElementalVariableValue
variable = elastic_strain_xx
execute_on = 'TIMESTEP_END'
elementid = 39
[]
[sigma_xx]
type = ElementalVariableValue
variable = stress_xx
execute_on = 'TIMESTEP_END'
elementid = 39
[]
[]
[Outputs]
csv = true
exodus = true
perf_graph = true
[]
(modules/thermal_hydraulics/tutorials/single_phase_flow/05_secondary_side.i)
T_in = 300. # K
m_dot_in = 1e-2 # kg/s
press = 10e5 # Pa
# core parameters
core_length = 1. # m
core_n_elems = 25
core_dia = '${units 2. cm -> m}'
core_pitch = '${units 8.7 cm -> m}'
A_core = '${fparse core_pitch^2 - 0.25 *pi * core_dia^2}'
P_wet_core = '${fparse 4*core_pitch + pi * core_dia}'
Dh_core = '${fparse 4 * A_core / P_wet_core}'
# pipe parameters
pipe_dia = '${units 10. cm -> m}'
A_pipe = '${fparse 0.25 * pi * pipe_dia^2}'
tot_power = 2000 # W
# heat exchanger parameters
hx_dia_inner = '${units 12. cm -> m}'
hx_wall_thickness = '${units 5. mm -> m}'
hx_dia_outer = '${units 50. cm -> m}'
hx_radius_wall = '${fparse hx_dia_inner / 2. + hx_wall_thickness}'
hx_length = 1.5 # m
hx_n_elems = 25
m_dot_sec_in = 1. # kg/s
[GlobalParams]
initial_p = ${press}
initial_vel = 0.0001
initial_T = ${T_in}
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
gravity_vector = '0 0 0'
rdg_slope_reconstruction = minmod
scaling_factor_1phase = '1 1e-2 1e-4'
scaling_factor_rhoV = 1
scaling_factor_rhouV = 1e-2
scaling_factor_rhovV = 1e-2
scaling_factor_rhowV = 1e-2
scaling_factor_rhoEV = 1e-4
closures = thm_closures
fp = he
[]
[Functions]
[m_dot_sec_fn]
type = PiecewiseLinear
xy_data = '
0 0
10 ${m_dot_sec_in}'
[]
[]
[FluidProperties]
[he]
type = IdealGasFluidProperties
molar_mass = 4e-3
gamma = 1.67
k = 0.2556
mu = 3.22639e-5
[]
[water]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[thm_closures]
type = Closures1PhaseTHM
[]
[]
[SolidProperties]
[steel]
type = ThermalFunctionSolidProperties
rho = 8050
k = 45
cp = 466
[]
[]
[Components]
[total_power]
type = TotalPower
power = ${tot_power}
[]
[up_pipe_1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 1'
length = 0.5
n_elems = 15
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct1]
type = JunctionParallelChannels1Phase
position = '0 0 0.5'
connections = 'up_pipe_1:out core_chan:in'
volume = 1e-5
[]
[core_chan]
type = FlowChannel1Phase
position = '0 0 0.5'
orientation = '0 0 1'
length = ${core_length}
n_elems = ${core_n_elems}
roughness = .0001
A = ${A_core}
D_h = ${Dh_core}
[]
[core_hs]
type = HeatStructureCylindrical
position = '0 0 0.5'
orientation = '0 0 1'
length = ${core_length}
n_elems = ${core_n_elems}
names = 'block'
widths = '${fparse core_dia / 2.}'
solid_properties = 'steel'
solid_properties_T_ref = '300'
n_part_elems = 3
[]
[core_heating]
type = HeatSourceFromTotalPower
hs = core_hs
regions = block
power = total_power
[]
[core_ht]
type = HeatTransferFromHeatStructure1Phase
flow_channel = core_chan
hs = core_hs
hs_side = outer
P_hf = '${fparse pi * core_dia}'
[]
[jct2]
type = JunctionParallelChannels1Phase
position = '0 0 1.5'
connections = 'core_chan:out up_pipe_2:in'
volume = 1e-5
[]
[up_pipe_2]
type = FlowChannel1Phase
position = '0 0 1.5'
orientation = '0 0 1'
length = 0.5
n_elems = 10
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct3]
type = JunctionOneToOne1Phase
connections = 'up_pipe_2:out top_pipe_1:in'
[]
[top_pipe_1]
type = FlowChannel1Phase
position = '0 0 2'
orientation = '1 0 0'
length = 0.5
n_elems = 10
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[top_pipe_2]
type = FlowChannel1Phase
position = '0.5 0 2'
orientation = '1 0 0'
length = 0.5
n_elems = 10
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct4]
type = VolumeJunction1Phase
position = '0.5 0 2'
volume = 1e-5
connections = 'top_pipe_1:out top_pipe_2:in press_pipe:in'
[]
[press_pipe]
type = FlowChannel1Phase
position = '0.5 0 2'
orientation = '0 1 0'
length = 0.2
n_elems = 5
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[pressurizer]
type = InletStagnationPressureTemperature1Phase
p0 = ${press}
T0 = ${T_in}
input = press_pipe:out
[]
[jct5]
type = JunctionOneToOne1Phase
connections = 'top_pipe_2:out down_pipe_1:in'
[]
[down_pipe_1]
type = FlowChannel1Phase
position = '1 0 2'
orientation = '0 0 -1'
length = 0.25
A = ${A_pipe}
n_elems = 5
[]
[jct6]
type = JunctionParallelChannels1Phase
position = '1 0 1.75'
connections = 'down_pipe_1:out hx/pri:in'
volume = 1e-5
[]
[hx]
[pri]
type = FlowChannel1Phase
position = '1 0 1.75'
orientation = '0 0 -1'
length = ${hx_length}
n_elems = ${hx_n_elems}
roughness = 1e-5
A = '${fparse pi * hx_dia_inner * hx_dia_inner / 4.}'
D_h = ${hx_dia_inner}
[]
[ht_pri]
type = HeatTransferFromHeatStructure1Phase
hs = hx/wall
hs_side = inner
flow_channel = hx/pri
P_hf = '${fparse pi * hx_dia_inner}'
[]
[wall]
type = HeatStructureCylindrical
position = '1 0 1.75'
orientation = '0 0 -1'
length = ${hx_length}
n_elems = ${hx_n_elems}
widths = '${hx_wall_thickness}'
n_part_elems = '3'
solid_properties = 'steel'
solid_properties_T_ref = '300'
names = '0'
inner_radius = '${fparse hx_dia_inner / 2.}'
[]
[ht_sec]
type = HeatTransferFromHeatStructure1Phase
hs = hx/wall
hs_side = outer
flow_channel = hx/sec
P_hf = '${fparse 2 * pi * hx_radius_wall}'
[]
[sec]
type = FlowChannel1Phase
position = '${fparse 1 + hx_wall_thickness} 0 0.25'
orientation = '0 0 1'
length = ${hx_length}
n_elems = ${hx_n_elems}
A = '${fparse pi * (hx_dia_outer * hx_dia_outer / 4. - hx_radius_wall * hx_radius_wall)}'
D_h = '${fparse hx_dia_outer - (2 * hx_radius_wall)}'
fp = water
initial_T = 300
[]
[]
[jct7]
type = JunctionParallelChannels1Phase
position = '1 0 0.5'
connections = 'hx/pri:out down_pipe_2:in'
volume = 1e-5
[]
[down_pipe_2]
type = FlowChannel1Phase
position = '1 0 0.25'
orientation = '0 0 -1'
length = 0.25
n_elems = 10
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct8]
type = JunctionOneToOne1Phase
connections = 'down_pipe_2:out bottom_1:in'
[]
[bottom_1]
type = FlowChannel1Phase
position = '1 0 0'
orientation = '-1 0 0'
length = 0.5
n_elems = 5
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[pump]
type = Pump1Phase
position = '0.5 0 0'
connections = 'bottom_1:out bottom_2:in'
volume = 1e-4
A_ref = ${A_pipe}
head = 0
[]
[bottom_2]
type = FlowChannel1Phase
position = '0.5 0 0'
orientation = '-1 0 0'
length = 0.5
n_elems = 5
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct9]
type = JunctionOneToOne1Phase
connections = 'bottom_2:out up_pipe_1:in'
[]
[inlet_sec]
type = InletMassFlowRateTemperature1Phase
input = 'hx/sec:in'
m_dot = 0
T = 300
[]
[outlet_sec]
type = Outlet1Phase
input = 'hx/sec:out'
p = 1e5
[]
[]
[ControlLogic]
[set_point]
type = GetFunctionValueControl
function = ${m_dot_in}
[]
[pid]
type = PIDControl
initial_value = 0.0
set_point = set_point:value
input = m_dot_pump
K_p = 1.
K_i = 4.
K_d = 0
[]
[set_pump_head]
type = SetComponentRealValueControl
component = pump
parameter = head
value = pid:output
[]
[m_dot_sec_inlet_ctrl]
type = GetFunctionValueControl
function = m_dot_sec_fn
[]
[set_m_dot_sec_ctrl]
type = SetComponentRealValueControl
component = inlet_sec
parameter = m_dot
value = m_dot_sec_inlet_ctrl:value
[]
[]
[Postprocessors]
[power_to_coolant]
type = ADHeatRateConvection1Phase
block = core_chan
P_hf = '${fparse pi *core_dia}'
[]
[m_dot_pump]
type = ADFlowJunctionFlux1Phase
boundary = core_chan:in
connection_index = 1
equation = mass
junction = jct7
[]
[core_T_out]
type = SideAverageValue
boundary = core_chan:out
variable = T
[]
[core_p_in]
type = SideAverageValue
boundary = core_chan:in
variable = p
[]
[core_p_out]
type = SideAverageValue
boundary = core_chan:out
variable = p
[]
[core_delta_p]
type = ParsedPostprocessor
pp_names = 'core_p_in core_p_out'
function = 'core_p_in - core_p_out'
[]
[hx_pri_T_out]
type = SideAverageValue
boundary = hx/pri:out
variable = T
[]
[hx_sec_T_in]
type = SideAverageValue
boundary = inlet_sec
variable = T
[]
[hx_sec_T_out]
type = SideAverageValue
boundary = outlet_sec
variable = T
[]
[m_dot_sec]
type = ADFlowBoundaryFlux1Phase
boundary = inlet_sec
equation = mass
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
start_time = 0
[TimeStepper]
type = IterationAdaptiveDT
dt = 1
[]
dtmax = 5
end_time = 500
line_search = basic
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
nl_max_its = 25
[]
[Outputs]
exodus = true
[console]
type = Console
max_rows = 1
outlier_variable_norms = false
[]
print_linear_residuals = false
[]
(modules/phase_field/examples/grain_growth/grain_growth_2D_random.i)
# This initializes a polycrystal from random seeds at each node
# Mesh adaptivity and time step adaptivity are used
# Grain tracker is started once the grain structure is established
[Mesh]
# Mesh block. Meshes can be read in or automatically generated
type = GeneratedMesh
dim = 2 # Problem dimension
nx = 40 # Number of elements in the x-direction
ny = 40 # Number of elements in the y-direction
xmax = 1000 # maximum x-coordinate of the mesh
ymax = 1000 # maximum y-coordinate of the mesh
elem_type = QUAD4 # Type of elements used in the mesh
uniform_refine = 2 # Initial uniform refinement of the mesh
parallel_type = replicated # Periodic BCs
[]
[GlobalParams]
# Parameters used by several kernels that are defined globally to simplify input file
op_num = 10 # Number of grains
var_name_base = gr # Base name of grains
[]
[Modules]
[PhaseField]
[GrainGrowth]
[]
[]
[]
[ICs]
[PolycrystalICs]
[PolycrystalRandomIC]
random_type = discrete
[]
[]
[]
[AuxVariables]
# Dependent variables
[unique_grains]
order = CONSTANT
family = MONOMIAL
[]
[var_indices]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
# AuxKernel block, defining the equations used to calculate the auxvars
[unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_tracker
field_display = UNIQUE_REGION
execute_on = 'initial timestep_end'
[]
[var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
execute_on = 'initial timestep_end'
[]
[]
[BCs]
# Boundary Condition block
[Periodic]
[top_bottom]
auto_direction = 'x y' # Makes problem periodic in the x and y directions
[]
[]
[]
[Materials]
[CuGrGr]
# Material properties
type = GBEvolution # Quantitative material properties for copper grain growth. Dimensions are nm and ns
GBmob0 = 2.5e-6 # Mobility prefactor for Cu from schonfelder1997molecular bibtex entry
GBenergy = 0.708 # GB energy for Cu from schonfelder1997molecular bibtex entry
Q = 0.23 # Activation energy for grain growth from Schonfelder 1997
T = 450 # Constant temperature of the simulation (for mobility calculation)
wGB = 14 # Width of the diffuse GB
[]
[]
[UserObjects]
[grain_tracker]
type = GrainTracker
tracking_step = 20 #Tracking is delayed until the polycrystalline structure is established
[]
[]
[Postprocessors]
# Scalar postprocessors
[dt]
# Outputs the current time step
type = TimestepSize
[]
[num_nodes]
type = NumNodes
[]
[]
[Executioner]
type = Transient # Type of executioner, here it is transient with an adaptive time step
scheme = bdf2 # Type of time integration (2nd order backward euler), defaults to 1st order backward euler
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
l_max_its = 20 # Max number of linear iterations
l_tol = 1e-4 # Relative tolerance for linear solves
start_time = 0.0
end_time = 4000
[TimeStepper]
type = IterationAdaptiveDT
dt = 1 # Initial time step. In this simulation it changes.
optimal_iterations = 6 # Time step will adapt to maintain this number of nonlinear iterations
[]
[Adaptivity]
# Block that turns on mesh adaptivity. Note that mesh will never coarsen beyond initial mesh (before uniform refinement)
refine_fraction = 0.8 # Fraction of high error that will be refined
coarsen_fraction = 0.05 # Fraction of low error that will coarsened
max_h_level = 2 # Max number of refinements used, starting from initial mesh (before uniform refinement)
[]
[]
[Outputs]
exodus = true
csv = true
[]
(modules/combined/examples/phase_field-mechanics/hex_grain_growth_2D_eldrforce.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 17
nz = 0
xmax = 1000
ymax = 866
zmax = 0
elem_type = QUAD4
uniform_refine = 2
[]
[GlobalParams]
op_num = 3
var_name_base = gr
[]
[Variables]
[./PolycrystalVariables]
[../]
[./disp_x]
order = FIRST
family = LAGRANGE
[../]
[./disp_y]
order = FIRST
family = LAGRANGE
[../]
[]
[UserObjects]
[./hex_ic]
type = PolycrystalHex
coloring_algorithm = bt
grain_num = 36
x_offset = 0.0
output_adjacency_matrix = true
[../]
[./euler_angle_file]
type = EulerAngleFileReader
file_name = grn_36_test2_2D.tex
[../]
[./grain_tracker]
type = GrainTrackerElasticity
threshold = 0.2
compute_var_to_feature_map = true
execute_on = 'initial timestep_begin'
flood_entity_type = ELEMENTAL
fill_method = symmetric9
C_ijkl = '1.27e5 0.708e5 0.708e5 1.27e5 0.708e5 1.27e5 0.7355e5 0.7355e5 0.7355e5'
euler_angle_provider = euler_angle_file
[../]
[]
[ICs]
[./PolycrystalICs]
[./PolycrystalColoringIC]
polycrystal_ic_uo = hex_ic
[../]
[../]
[]
[AuxVariables]
[./bnds]
order = FIRST
family = LAGRANGE
[../]
[./elastic_strain11]
order = CONSTANT
family = MONOMIAL
[../]
[./elastic_strain22]
order = CONSTANT
family = MONOMIAL
[../]
[./elastic_strain12]
order = CONSTANT
family = MONOMIAL
[../]
[./unique_grains]
order = CONSTANT
family = MONOMIAL
[../]
[./var_indices]
order = CONSTANT
family = MONOMIAL
[../]
[./C1111]
order = CONSTANT
family = MONOMIAL
[../]
[./vonmises_stress]
order = CONSTANT
family = MONOMIAL
[../]
[./euler_angle]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./PolycrystalKernel]
[../]
[./PolycrystalElasticDrivingForce]
[../]
[./TensorMechanics]
displacements = 'disp_x disp_y'
[../]
[]
[AuxKernels]
[./BndsCalc]
type = BndsCalcAux
variable = bnds
execute_on = 'initial timestep_end'
[../]
[./elastic_strain11]
type = RankTwoAux
variable = elastic_strain11
rank_two_tensor = elastic_strain
index_i = 0
index_j = 0
execute_on = timestep_end
[../]
[./elastic_strain22]
type = RankTwoAux
variable = elastic_strain22
rank_two_tensor = elastic_strain
index_i = 1
index_j = 1
execute_on = timestep_end
[../]
[./elastic_strain12]
type = RankTwoAux
variable = elastic_strain12
rank_two_tensor = elastic_strain
index_i = 0
index_j = 1
execute_on = timestep_end
[../]
[./unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
execute_on = timestep_end
flood_counter = grain_tracker
field_display = UNIQUE_REGION
[../]
[./var_indices]
type = FeatureFloodCountAux
variable = var_indices
execute_on = timestep_end
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
[../]
[./C1111]
type = RankFourAux
variable = C1111
rank_four_tensor = elasticity_tensor
index_l = 0
index_j = 0
index_k = 0
index_i = 0
execute_on = timestep_end
[../]
[./vonmises_stress]
type = RankTwoScalarAux
variable = vonmises_stress
rank_two_tensor = stress
scalar_type = VonMisesStress
[../]
[./euler_angle]
type = OutputEulerAngles
variable = euler_angle
euler_angle_provider = euler_angle_file
grain_tracker = grain_tracker
output_euler_angle = 'phi1'
[../]
[]
[BCs]
[./Periodic]
[./All]
auto_direction = 'x y'
variable = 'gr0 gr1 gr2'
[../]
[../]
[./top_displacement]
type = DirichletBC
variable = disp_y
boundary = top
value = -50.0
[../]
[./x_anchor]
type = DirichletBC
variable = disp_x
boundary = 'left right'
value = 0.0
[../]
[./y_anchor]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[../]
[]
[Materials]
[./Copper]
type = GBEvolution
block = 0
T = 500 # K
wGB = 15 # nm
GBmob0 = 2.5e-6 # m^4/(Js) from Schoenfelder 1997
Q = 0.23 # Migration energy in eV
GBenergy = 0.708 # GB energy in J/m^2
[../]
[./ElasticityTensor]
type = ComputePolycrystalElasticityTensor
block = 0
grain_tracker = grain_tracker
[../]
[./strain]
type = ComputeSmallStrain
block = 0
displacements = 'disp_x disp_y'
[../]
[./stress]
type = ComputeLinearElasticStress
block = 0
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
[../]
[./dt]
type = TimestepSize
[../]
[./run_time]
type = PerfGraphData
section_name = "Root"
data_type = total
[../]
[./bnd_length]
type = GrainBoundaryArea
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
off_diag_row = 'disp_x disp_y'
off_diag_column = 'disp_y disp_x'
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart -pc_hypre_boomeramg_strong_threshold'
petsc_options_value = 'hypre boomeramg 31 0.7'
l_tol = 1.0e-4
l_max_its = 30
nl_max_its = 40
nl_rel_tol = 1.0e-7
start_time = 0.0
num_steps = 50
[./TimeStepper]
type = IterationAdaptiveDT
dt = 1.5
growth_factor = 1.2
cutback_factor = 0.8
optimal_iterations = 8
[../]
[./Adaptivity]
initial_adaptivity = 2
refine_fraction = 0.8
coarsen_fraction = 0.05
max_h_level = 3
[../]
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/channel-flow/2d-transient-action.i)
l = 10
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_v = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 20
ny = 10
[]
[]
[Modules]
[NavierStokesFV]
compressibility = 'weakly-compressible'
add_energy_equation = true
density = 'rho'
dynamic_viscosity = 'mu'
thermal_conductivity = 'k'
specific_heat = 'cp'
initial_velocity = '${inlet_v} 1e-15 0'
initial_temperature = '${inlet_temp}'
initial_pressure = '${outlet_pressure}'
inlet_boundaries = 'left'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_function = '${inlet_v} 0'
energy_inlet_types = 'fixed-temperature'
energy_inlet_function = '${inlet_temp}'
wall_boundaries = 'top bottom'
momentum_wall_types = 'noslip noslip'
energy_wall_types = 'heatflux heatflux'
energy_wall_function = '0 0'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '${outlet_pressure}'
external_heat_source = 'power_density'
mass_advection_interpolation = 'average'
momentum_advection_interpolation = 'average'
energy_advection_interpolation = 'average'
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k mu'
prop_values = '${cp} ${k} ${mu}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T_fluid
pressure = pressure
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-3
optimal_iterations = 6
[]
end_time = 15
nl_abs_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
off_diagonals_in_auto_scaling = true
compute_scaling_once = false
[]
[Outputs]
exodus = true
[]
(modules/phase_field/examples/grain_growth/grain_growth_linearized_interface.i)
[GlobalParams]
bound_value = 5.0
op_num = 8
var_name_base = phi
[]
[Mesh]
type = GeneratedMesh
dim = 2
xmax = 1000
ymax = 1000
nx = 100
ny = 100
uniform_refine = 1
[]
[Modules]
[PhaseField]
[GrainGrowthLinearizedInterface]
op_name_base = gr
mobility = L
kappa = kappa_op
[]
[]
[]
[ICs]
[PolycrystalICs]
[PolycrystalColoringIC]
polycrystal_ic_uo = RandomVoronoi
nonlinear_preconditioning = true
[]
[]
[]
[UserObjects]
[RandomVoronoi]
type = PolycrystalVoronoi
grain_num = 60
int_width = 10
rand_seed = 103838
[]
[grain_tracker]
type = GrainTracker
threshold = -4.0
compute_halo_maps = true # Only necessary for displaying HALOS
[]
[]
[AuxVariables]
[unique_grains]
order = CONSTANT
family = MONOMIAL
[]
[var_indices]
order = CONSTANT
family = MONOMIAL
[]
[halos]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_tracker
field_display = UNIQUE_REGION
execute_on = 'initial timestep_end'
[]
[var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
execute_on = 'initial timestep_end'
[]
[halos]
type = FeatureFloodCountAux
variable = halos
flood_counter = grain_tracker
field_display = HALOS
execute_on = 'initial timestep_end'
[]
[]
[Materials]
[properties]
type = GenericConstantMaterial
prop_names = 'gbmob gbenergy gbwidth gamma_asymm'
prop_values = '100 6 10 1.5'
[]
[kappa_op]
type = ParsedMaterial
material_property_names = 'gbenergy gbwidth'
property_name = kappa_op
expression = '3/4*gbenergy*gbwidth'
[]
[L]
type = ParsedMaterial
material_property_names = 'gbmob gbwidth'
property_name = L
expression = '4/3*gbmob/gbwidth'
[]
[mu]
type = ParsedMaterial
material_property_names = 'gbenergy gbwidth'
property_name = mu
expression = '6*gbenergy/gbwidth'
[]
[]
[Postprocessors]
[dt]
type = TimestepSize
execute_on = 'initial TIMESTEP_END'
[]
[]
[BCs]
[Periodic]
[All]
auto_direction = 'x y'
[]
[]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type -snes_type'
petsc_options_value = 'hypre boomeramg vinewtonrsls'
l_tol = 1e-4
nl_max_its = 10
l_max_its = 45
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.02
optimal_iterations = 6
[]
end_time = 30
[]
[Outputs]
exodus = true
perf_graph = true
[]
(modules/porous_flow/test/tests/gravity/grav02g.i)
# Checking that gravity head is established in the transient situation when 0<=saturation<=1 (note the less-than-or-equal-to).
# 2phase (PS), 2components, Brooks-Corey capillary pressure, constant fluid bulk-moduli for each phase, constant viscosity,
# constant permeability, Brooks-Corey relative permeabilities with residual saturation
[Mesh]
type = GeneratedMesh
dim = 2
ny = 10
ymax = 100
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 -10 0'
[]
[Variables]
[ppwater]
initial_condition = 1.5e6
[]
[sgas]
initial_condition = 0.3
[]
[]
[AuxVariables]
[massfrac_ph0_sp0]
initial_condition = 1
[]
[massfrac_ph1_sp0]
initial_condition = 0
[]
[ppgas]
family = MONOMIAL
order = CONSTANT
[]
[swater]
family = MONOMIAL
order = CONSTANT
[]
[relpermwater]
family = MONOMIAL
order = CONSTANT
[]
[relpermgas]
family = MONOMIAL
order = CONSTANT
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = ppwater
[]
[flux0]
type = PorousFlowAdvectiveFlux
fluid_component = 0
variable = ppwater
[]
[mass1]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = sgas
[]
[flux1]
type = PorousFlowAdvectiveFlux
fluid_component = 1
variable = sgas
[]
[]
[AuxKernels]
[ppgas]
type = PorousFlowPropertyAux
property = pressure
phase = 1
variable = ppgas
[]
[swater]
type = PorousFlowPropertyAux
property = saturation
phase = 0
variable = swater
[]
[relpermwater]
type = MaterialStdVectorAux
property = PorousFlow_relative_permeability_qp
index = 0
variable = relpermwater
[]
[relpermgas]
type = PorousFlowPropertyAux
property = relperm
phase = 1
variable = relpermgas
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'ppwater sgas'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureBC
lambda = 2
pe = 1e4
[]
[]
[FluidProperties]
[simple_fluid0]
type = SimpleFluidProperties
bulk_modulus = 2e9
density0 = 1000
viscosity = 1e-3
thermal_expansion = 0
[]
[simple_fluid1]
type = SimpleFluidProperties
bulk_modulus = 2e9
density0 = 10
viscosity = 1e-5
thermal_expansion = 0
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
[]
[ppss]
type = PorousFlow2PhasePS
phase0_porepressure = ppwater
phase1_saturation = sgas
capillary_pressure = pc
[]
[massfrac]
type = PorousFlowMassFraction
mass_fraction_vars = 'massfrac_ph0_sp0 massfrac_ph1_sp0'
[]
[simple_fluid0]
type = PorousFlowSingleComponentFluid
fp = simple_fluid0
phase = 0
[]
[simple_fluid1]
type = PorousFlowSingleComponentFluid
fp = simple_fluid1
phase = 1
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.1
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-11 0 0 0 1e-11 0 0 0 1e-11'
[]
[relperm_water]
type = PorousFlowRelativePermeabilityBC
lambda = 2
phase = 0
s_res = 0.25
sum_s_res = 0.35
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityBC
lambda = 2
phase = 1
s_res = 0.1
sum_s_res = 0.35
nw_phase = true
[]
[]
[Postprocessors]
[mass_ph0]
type = PorousFlowFluidMass
fluid_component = 0
execute_on = 'initial timestep_end'
[]
[mass_ph1]
type = PorousFlowFluidMass
fluid_component = 1
execute_on = 'initial timestep_end'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -snes_stol -snes_max_it'
petsc_options_value = 'bcgs bjacobi 1E-13 15'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 1e5
[TimeStepper]
type = IterationAdaptiveDT
dt = 5e3
[]
[]
[Outputs]
execute_on = 'initial timestep_end'
file_base = grav02g
exodus = true
perf_graph = true
csv = false
[]
(modules/combined/test/tests/adaptive_timestepping/adapt_tstep_function_change.i)
# This is a test designed to evaluate the cabability of the
# IterationAdaptiveDT TimeStepper to adjust time step size according to
# a function. For example, if the power input function for a BISON
# simulation rapidly increases or decreases, the IterationAdaptiveDT
# TimeStepper should take time steps small enough to capture the
# oscillation.
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
order = FIRST
family = LAGRANGE
block = 1
[]
[Mesh]
file = 1hex8_10mm_cube.e
[]
[Functions]
[./Fiss_Function]
type = PiecewiseLinear
x = '0 1e6 2e6 2.001e6 2.002e6'
y = '0 3e8 3e8 12e8 0'
[../]
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[./disp_z]
[../]
[./temp]
initial_condition = 300.0
[../]
[]
[Modules/TensorMechanics/Master]
[./all]
strain = FINITE
volumetric_locking_correction = true
incremental = true
eigenstrain_names = thermal_expansion
decomposition_method = EigenSolution
add_variables = true
generate_output = 'vonmises_stress'
temperature = temp
[../]
[]
[Kernels]
[./heat]
type = HeatConduction
variable = temp
[../]
[./heat_ie]
type = HeatConductionTimeDerivative
variable = temp
[../]
[./heat_source]
type = HeatSource
variable = temp
value = 1.0
function = Fiss_Function
[../]
[]
[BCs]
[./bottom_temp]
type = DirichletBC
variable = temp
boundary = 1
value = 300
[../]
[./top_bottom_disp_x]
type = DirichletBC
variable = disp_x
boundary = '1'
value = 0
[../]
[./top_bottom_disp_y]
type = DirichletBC
variable = disp_y
boundary = '1'
value = 0
[../]
[./top_bottom_disp_z]
type = DirichletBC
variable = disp_z
boundary = '1'
value = 0
[../]
[]
[Materials]
[./thermal]
type = HeatConductionMaterial
temp = temp
specific_heat = 1.0
thermal_conductivity = 1.0
[../]
[./elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 300e6
poissons_ratio = .3
[../]
[./stress]
type = ComputeFiniteStrainElasticStress
[../]
[./thermal_expansion]
type = ComputeThermalExpansionEigenstrain
thermal_expansion_coeff = 5e-6
stress_free_temperature = 300.0
temperature = temp
eigenstrain_name = thermal_expansion
[../]
[./density]
type = Density
density = 10963.0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
verbose = true
nl_abs_tol = 1e-10
start_time = 0.0
num_steps = 50000
end_time = 2.002e6
[./TimeStepper]
type = IterationAdaptiveDT
timestep_limiting_function = Fiss_Function
max_function_change = 3e7
dt = 1e6
[../]
[]
[Postprocessors]
[./Temperature_of_Block]
type = ElementAverageValue
variable = temp
execute_on = 'initial timestep_end'
[../]
[./vonMises]
type = ElementAverageValue
variable = vonmises_stress
execute_on = 'initial timestep_end'
[../]
[]
[Outputs]
[./out]
type = Exodus
elemental_as_nodal = true
[../]
[./console]
type = Console
max_rows = 10
[../]
[]
(modules/phase_field/test/tests/GrandPotentialPFM/GrandPotentialAnisotropyAntitrap.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 15
ny = 15
xmin = -2
xmax = 2
ymin = -2
ymax = 2
[]
[GlobalParams]
radius = 1.0
int_width = 0.8
x1 = 0
y1 = 0
enable_jit = true
derivative_order = 2
[]
[Variables]
[./w]
[../]
[./etaa0]
[../]
[./etab0]
[../]
[]
[AuxVariables]
[./bnds]
[../]
[]
[AuxKernels]
[./bnds]
type = BndsCalcAux
variable = bnds
v = 'etaa0 etab0'
[../]
[]
[ICs]
[./w]
type = SmoothCircleIC
variable = w
outvalue = -4.0
invalue = 0.0
[../]
[./etaa0]
type = SmoothCircleIC
variable = etaa0
#Solid phase
outvalue = 0.0
invalue = 1.0
[../]
[./etab0]
type = SmoothCircleIC
variable = etab0
#Liquid phase
outvalue = 1.0
invalue = 0.0
[../]
[]
[Kernels]
# Order parameter eta_alpha0
[./ACa0_bulk]
type = ACGrGrMulti
variable = etaa0
v = 'etab0'
gamma_names = 'gab'
[../]
[./ACa0_sw]
type = ACSwitching
variable = etaa0
Fj_names = 'omegaa omegab'
hj_names = 'ha hb'
coupled_variables = 'etab0 w'
[../]
[./ACa0_int1]
type = ACInterface2DMultiPhase1
variable = etaa0
etas = 'etab0'
kappa_name = kappaa
dkappadgrad_etaa_name = dkappadgrad_etaa
d2kappadgrad_etaa_name = d2kappadgrad_etaa
[../]
[./ACa0_int2]
type = ACInterface2DMultiPhase2
variable = etaa0
kappa_name = kappaa
dkappadgrad_etaa_name = dkappadgrad_etaa
[../]
[./ea0_dot]
type = TimeDerivative
variable = etaa0
[../]
# Order parameter eta_beta0
[./ACb0_bulk]
type = ACGrGrMulti
variable = etab0
v = 'etaa0'
gamma_names = 'gab'
[../]
[./ACb0_sw]
type = ACSwitching
variable = etab0
Fj_names = 'omegaa omegab'
hj_names = 'ha hb'
coupled_variables = 'etaa0 w'
[../]
[./ACb0_int1]
type = ACInterface2DMultiPhase1
variable = etab0
etas = 'etaa0'
kappa_name = kappab
dkappadgrad_etaa_name = dkappadgrad_etab
d2kappadgrad_etaa_name = d2kappadgrad_etab
[../]
[./ACb0_int2]
type = ACInterface2DMultiPhase2
variable = etab0
kappa_name = kappab
dkappadgrad_etaa_name = dkappadgrad_etab
[../]
[./eb0_dot]
type = TimeDerivative
variable = etab0
[../]
#Chemical potential
[./w_dot]
type = SusceptibilityTimeDerivative
variable = w
f_name = chi
coupled_variables = '' # in this case chi (the susceptibility) is simply a constant
[../]
[./Diffusion]
type = MatDiffusion
variable = w
diffusivity = Dchi
args = ''
[../]
[./coupled_etaa0dot]
type = CoupledSwitchingTimeDerivative
variable = w
v = etaa0
Fj_names = 'rhoa rhob'
hj_names = 'ha hb'
coupled_variables = 'etaa0 etab0'
[../]
[./coupled_etab0dot]
type = CoupledSwitchingTimeDerivative
variable = w
v = etab0
Fj_names = 'rhoa rhob'
hj_names = 'ha hb'
coupled_variables = 'etaa0 etab0'
[../]
[./coupled_etaa0dot_int]
type = AntitrappingCurrent
variable = w
v = etaa0
f_name = rhodiff
[../]
[./coupled_etab0dot_int]
type = AntitrappingCurrent
variable = w
v = etab0
f_name = rhodiff
[../]
[]
[Materials]
[./ha]
type = SwitchingFunctionMultiPhaseMaterial
h_name = ha
all_etas = 'etaa0 etab0'
phase_etas = 'etaa0'
[../]
[./hb]
type = SwitchingFunctionMultiPhaseMaterial
h_name = hb
all_etas = 'etaa0 etab0'
phase_etas = 'etab0'
[../]
[./omegaa]
type = DerivativeParsedMaterial
coupled_variables = 'w'
property_name = omegaa
material_property_names = 'Vm ka caeq'
expression = '-0.5*w^2/Vm^2/ka-w/Vm*caeq'
[../]
[./omegab]
type = DerivativeParsedMaterial
coupled_variables = 'w'
property_name = omegab
material_property_names = 'Vm kb cbeq'
expression = '-0.5*w^2/Vm^2/kb-w/Vm*cbeq'
[../]
[./rhoa]
type = DerivativeParsedMaterial
coupled_variables = 'w'
property_name = rhoa
material_property_names = 'Vm ka caeq'
expression = 'w/Vm^2/ka + caeq/Vm'
[../]
[./rhob]
type = DerivativeParsedMaterial
coupled_variables = 'w'
property_name = rhob
material_property_names = 'Vm kb cbeq'
expression = 'w/Vm^2/kb + cbeq/Vm'
[../]
[./int]
type = DerivativeParsedMaterial
coupled_variables = 'w'
property_name = rhodiff
material_property_names = 'rhoa rhob'
constant_names = 'int_width'
constant_expressions = '0.8'
expression = 'int_width*(rhob-rhoa)'
[../]
[./kappaa]
type = InterfaceOrientationMultiphaseMaterial
kappa_name = kappaa
dkappadgrad_etaa_name = dkappadgrad_etaa
d2kappadgrad_etaa_name = d2kappadgrad_etaa
etaa = etaa0
etab = etab0
[../]
[./kappab]
type = InterfaceOrientationMultiphaseMaterial
kappa_name = kappab
dkappadgrad_etaa_name = dkappadgrad_etab
d2kappadgrad_etaa_name = d2kappadgrad_etab
etaa = etab0
etab = etaa0
[../]
[./const]
type = GenericConstantMaterial
prop_names = 'L D chi Vm ka caeq kb cbeq gab mu'
prop_values = '1.0 1.0 0.1 1.0 10.0 0.1 10.0 0.9 4.5 10.0'
[../]
[./Mobility]
type = ParsedMaterial
property_name = Dchi
material_property_names = 'D chi'
expression = 'D*chi'
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 lu 1'
l_tol = 1.0e-3
nl_rel_tol = 1.0e-8
nl_abs_tol = 1e-8
num_steps = 3
[./TimeStepper]
type = IterationAdaptiveDT
dt = 0.001
[../]
[]
[Outputs]
exodus = true
[]
(test/tests/time_steppers/iteration_adaptive/multi_piecewise_sync_dt.i)
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Problem]
solve = false
[]
[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_spike3]
type = PiecewiseConstant
x = '1 6 8'
y = '1 4 4'
[../]
[./temp_spike4]
type = PiecewiseConstant
x = '0 7 9'
y = '1 1 2'
[../]
[]
[Executioner]
type = Transient
end_time = 10
verbose = true
[./TimeStepper]
type = IterationAdaptiveDT
dt = 10
timestep_limiting_function = 'temp_spike1 temp_spike2 temp_spike3 temp_spike4'
force_step_every_function_point = true
post_function_sync_dt = .1
[../]
[]
[Postprocessors]
[./dt]
type = TimestepSize
[../]
[]
[Outputs]
csv = true
[]
(modules/combined/examples/publications/rapid_dev/fig7b.i)
#
# Fig. 7 input for 10.1016/j.commatsci.2017.02.017
# D. Schwen et al./Computational Materials Science 132 (2017) 36-45
# Dashed black curve (2)
# Eigenstrain is globally applied. Single global elastic free energies.
# Supply the RADIUS parameter (10-35) on the command line to generate data
# for all curves in the plot.
#
[Mesh]
type = GeneratedMesh
dim = 1
nx = 32
xmin = 0
xmax = 100
second_order = true
[]
[Problem]
coord_type = RSPHERICAL
[]
[GlobalParams]
displacements = 'disp_r'
[]
[Functions]
[./diff]
type = ParsedFunction
expression = '${RADIUS}-pos_c'
symbol_names = pos_c
symbol_values = pos_c
[../]
[]
# AuxVars to compute the free energy density for outputting
[AuxVariables]
[./local_energy]
order = CONSTANT
family = MONOMIAL
[../]
[./cross_energy]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./local_free_energy]
type = TotalFreeEnergy
variable = local_energy
interfacial_vars = 'c'
kappa_names = 'kappa_c'
execute_on = 'INITIAL TIMESTEP_END'
[../]
[]
[Variables]
# Solute concentration variable
[./c]
[./InitialCondition]
type = SmoothCircleIC
invalue = 1
outvalue = 0
x1 = 0
y1 = 0
radius = ${RADIUS}
int_width = 3
[../]
[../]
[./w]
[../]
# Phase order parameter
[./eta]
[./InitialCondition]
type = SmoothCircleIC
invalue = 1
outvalue = 0
x1 = 0
y1 = 0
radius = ${RADIUS}
int_width = 3
[../]
[../]
[./Fe_fit]
order = SECOND
[../]
[]
[Modules/TensorMechanics/Master/all]
add_variables = true
eigenstrain_names = eigenstrain
[]
[Kernels]
# Split Cahn-Hilliard kernels
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
args = 'eta'
kappa_name = kappa_c
w = w
[../]
[./wres]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
# Allen-Cahn and Lagrange-multiplier constraint kernels for order parameter 1
[./detadt]
type = TimeDerivative
variable = eta
[../]
[./ACBulk1]
type = AllenCahn
variable = eta
args = 'c'
mob_name = L
f_name = F
[../]
[./ACInterface]
type = ACInterface
variable = eta
mob_name = L
kappa_name = kappa_eta
[../]
[./Fe]
type = MaterialPropertyValue
prop_name = Fe
variable = Fe_fit
[../]
[./autoadjust]
type = MaskedBodyForce
variable = w
function = diff
mask = mask
[../]
[]
[Materials]
# declare a few constants, such as mobilities (L,M) and interface gradient prefactors (kappa*)
[./consts]
type = GenericConstantMaterial
prop_names = 'M L kappa_c kappa_eta'
prop_values = '1.0 1.0 0.5 1'
[../]
# forcing function mask
[./mask]
type = ParsedMaterial
property_name = mask
expression = grad/dt
material_property_names = 'grad dt'
[../]
[./grad]
type = VariableGradientMaterial
variable = c
prop = grad
[../]
[./time]
type = TimeStepMaterial
[../]
# global mechanical properties
[./elasticity_tensor]
type = ComputeElasticityTensor
C_ijkl = '1 1'
fill_method = symmetric_isotropic
[../]
[./stress]
type = ComputeLinearElasticStress
[../]
# eigenstrain as a function of phase
[./eigenstrain]
type = ComputeVariableEigenstrain
eigen_base = '0.05 0.05 0.05 0 0 0'
prefactor = h
args = eta
eigenstrain_name = eigenstrain
[../]
# switching functions
[./switching]
type = SwitchingFunctionMaterial
function_name = h
eta = eta
h_order = SIMPLE
[../]
[./barrier]
type = BarrierFunctionMaterial
eta = eta
[../]
# chemical free energies
[./chemical_free_energy_1]
type = DerivativeParsedMaterial
property_name = Fc1
expression = 'c^2'
coupled_variables = 'c'
derivative_order = 2
[../]
[./chemical_free_energy_2]
type = DerivativeParsedMaterial
property_name = Fc2
expression = '(1-c)^2'
coupled_variables = 'c'
derivative_order = 2
[../]
# global chemical free energy
[./chemical_free_energy]
type = DerivativeTwoPhaseMaterial
f_name = Fc
fa_name = Fc1
fb_name = Fc2
eta = eta
args = 'c'
W = 4
[../]
# global elastic free energy
[./elastic_free_energy]
type = ElasticEnergyMaterial
f_name = Fe
args = 'eta'
output_properties = Fe
derivative_order = 2
[../]
# free energy
[./free_energy]
type = DerivativeSumMaterial
property_name = F
sum_materials = 'Fc Fe'
coupled_variables = 'c eta'
derivative_order = 2
[../]
[]
[BCs]
[./left_r]
type = DirichletBC
variable = disp_r
boundary = 'left'
value = 0
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
# We monitor the total free energy and the total solute concentration (should be constant)
[Postprocessors]
[./total_free_energy]
type = ElementIntegralVariablePostprocessor
variable = local_energy
execute_on = 'INITIAL TIMESTEP_END'
outputs = 'table console'
[../]
[./total_solute]
type = ElementIntegralVariablePostprocessor
variable = c
execute_on = 'INITIAL TIMESTEP_END'
outputs = 'table console'
[../]
[./pos_c]
type = FindValueOnLine
start_point = '0 0 0'
end_point = '100 0 0'
v = c
target = 0.582
tol = 1e-8
execute_on = 'INITIAL TIMESTEP_END'
outputs = 'table console'
[../]
[./pos_eta]
type = FindValueOnLine
start_point = '0 0 0'
end_point = '100 0 0'
v = eta
target = 0.5
tol = 1e-8
execute_on = 'INITIAL TIMESTEP_END'
outputs = 'table console'
[../]
[./c_min]
type = ElementExtremeValue
value_type = min
variable = c
execute_on = 'INITIAL TIMESTEP_END'
outputs = 'table console'
[../]
[]
[VectorPostprocessors]
[./line]
type = LineValueSampler
variable = 'Fe_fit c w'
start_point = '0 0 0'
end_point = '100 0 0'
num_points = 5000
sort_by = x
outputs = vpp
execute_on = 'INITIAL TIMESTEP_END'
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -sub_pc_type'
petsc_options_value = 'asm lu'
l_max_its = 30
nl_max_its = 15
l_tol = 1.0e-4
nl_rel_tol = 1.0e-8
nl_abs_tol = 2.0e-9
start_time = 0.0
end_time = 100000.0
[./TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 8
iteration_window = 1
dt = 1
[../]
[./Adaptivity]
initial_adaptivity = 5
interval = 10
max_h_level = 5
refine_fraction = 0.9
coarsen_fraction = 0.1
[../]
[]
[Outputs]
print_linear_residuals = false
perf_graph = true
execute_on = 'INITIAL TIMESTEP_END'
[./table]
type = CSV
delimiter = ' '
file_base = radius_${RADIUS}/eigenstrain_pp
[../]
[./vpp]
type = CSV
delimiter = ' '
sync_times = '10 50 100 500 1000 5000 10000 50000 100000'
sync_only = true
time_data = true
file_base = radius_${RADIUS}/eigenstrain_vpp
[../]
[]
(modules/combined/examples/publications/rapid_dev/fig7a.i)
#
# Fig. 7 input for 10.1016/j.commatsci.2017.02.017
# D. Schwen et al./Computational Materials Science 132 (2017) 36-45
# Solid gray curve (1)
# Eigenstrain and elastic energies ar computed per phase and then interpolated.
# Supply the RADIUS parameter (10-35) on the command line to generate data
# for all curves in the plot.
#
[Mesh]
type = GeneratedMesh
dim = 1
nx = 32
xmin = 0
xmax = 100
second_order = true
[]
[Problem]
coord_type = RSPHERICAL
[]
[GlobalParams]
displacements = 'disp_r'
[]
[Functions]
[./diff]
type = ParsedFunction
expression = '${RADIUS}-pos_c'
symbol_names = pos_c
symbol_values = pos_c
[../]
[]
# AuxVars to compute the free energy density for outputting
[AuxVariables]
[./local_energy]
order = CONSTANT
family = MONOMIAL
[../]
[./cross_energy]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./local_free_energy]
type = TotalFreeEnergy
variable = local_energy
interfacial_vars = 'c'
kappa_names = 'kappa_c'
execute_on = 'INITIAL TIMESTEP_END'
[../]
[]
[Variables]
# Solute concentration variable
[./c]
[./InitialCondition]
type = SmoothCircleIC
invalue = 1
outvalue = 0
x1 = 0
y1 = 0
radius = ${RADIUS}
int_width = 3
[../]
[../]
[./w]
[../]
# Phase order parameter
[./eta]
[./InitialCondition]
type = SmoothCircleIC
invalue = 1
outvalue = 0
x1 = 0
y1 = 0
radius = ${RADIUS}
int_width = 3
[../]
[../]
# Mesh displacement
[./disp_r]
order = SECOND
[../]
[./Fe_fit]
order = SECOND
[../]
[]
[Kernels]
# Set up stress divergence kernels
[./TensorMechanics]
[../]
# Split Cahn-Hilliard kernels
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
args = 'eta'
kappa_name = kappa_c
w = w
[../]
[./wres]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
# Allen-Cahn and Lagrange-multiplier constraint kernels for order parameter 1
[./detadt]
type = TimeDerivative
variable = eta
[../]
[./ACBulk1]
type = AllenCahn
variable = eta
args = 'c'
mob_name = L
f_name = F
[../]
[./ACInterface]
type = ACInterface
variable = eta
mob_name = L
kappa_name = kappa_eta
[../]
[./Fe]
type = MaterialPropertyValue
prop_name = Fe
variable = Fe_fit
[../]
[./autoadjust]
type = MaskedBodyForce
variable = w
function = diff
mask = mask
[../]
[]
[Materials]
# declare a few constants, such as mobilities (L,M) and interface gradient prefactors (kappa*)
[./consts]
type = GenericConstantMaterial
prop_names = 'M L kappa_c kappa_eta'
prop_values = '1.0 1.0 0.5 1'
[../]
# forcing function mask
[./mask]
type = ParsedMaterial
property_name = mask
expression = grad/dt
material_property_names = 'grad dt'
[../]
[./grad]
type = VariableGradientMaterial
variable = c
prop = grad
[../]
[./time]
type = TimeStepMaterial
[../]
# global mechanical properties
[./elasticity_tensor_1]
type = ComputeElasticityTensor
C_ijkl = '1 1'
base_name = phase1
fill_method = symmetric_isotropic
[../]
[./elasticity_tensor_2]
type = ComputeElasticityTensor
C_ijkl = '1 1'
base_name = phase2
fill_method = symmetric_isotropic
[../]
[./strain_1]
type = ComputeRSphericalSmallStrain
base_name = phase1
[../]
[./strain_2]
type = ComputeRSphericalSmallStrain
base_name = phase2
eigenstrain_names = eigenstrain
[../]
[./stress_1]
type = ComputeLinearElasticStress
base_name = phase1
[../]
[./stress_2]
type = ComputeLinearElasticStress
base_name = phase2
[../]
# eigenstrain per phase
[./eigenstrain2]
type = ComputeEigenstrain
eigen_base = '0.05 0.05 0.05 0 0 0'
base_name = phase2
eigenstrain_name = eigenstrain
[../]
# switching functions
[./switching]
type = SwitchingFunctionMaterial
function_name = h
eta = eta
h_order = SIMPLE
[../]
[./barrier]
type = BarrierFunctionMaterial
eta = eta
[../]
# chemical free energies
[./chemical_free_energy_1]
type = DerivativeParsedMaterial
property_name = Fc1
expression = 'c^2'
coupled_variables = 'c'
derivative_order = 2
[../]
[./chemical_free_energy_2]
type = DerivativeParsedMaterial
property_name = Fc2
expression = '(1-c)^2'
coupled_variables = 'c'
derivative_order = 2
[../]
# elastic free energies
[./elastic_free_energy_1]
type = ElasticEnergyMaterial
f_name = Fe1
args = ''
base_name = phase1
derivative_order = 2
[../]
[./elastic_free_energy_2]
type = ElasticEnergyMaterial
f_name = Fe2
args = ''
base_name = phase2
derivative_order = 2
[../]
# per phase free energies
[./free_energy_1]
type = DerivativeSumMaterial
property_name = F1
sum_materials = 'Fc1 Fe1'
coupled_variables = 'c'
derivative_order = 2
[../]
[./free_energy_2]
type = DerivativeSumMaterial
property_name = F2
sum_materials = 'Fc2 Fe2'
coupled_variables = 'c'
derivative_order = 2
[../]
# global chemical free energy
[./global_free_energy]
type = DerivativeTwoPhaseMaterial
f_name = F
fa_name = F1
fb_name = F2
eta = eta
args = 'c'
W = 4
[../]
# global stress
[./global_stress]
type = TwoPhaseStressMaterial
base_A = phase1
base_B = phase2
[../]
[./elastic_free_energy]
type = DerivativeTwoPhaseMaterial
f_name = Fe
fa_name = Fe1
fb_name = Fe2
eta = eta
args = 'c'
W = 0
[../]
[]
[BCs]
[./left_r]
type = DirichletBC
variable = disp_r
boundary = 'left'
value = 0
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
# We monitor the total free energy and the total solute concentration (should be constant)
[Postprocessors]
[./total_free_energy]
type = ElementIntegralVariablePostprocessor
variable = local_energy
execute_on = 'INITIAL TIMESTEP_END'
outputs = 'table console'
[../]
[./total_solute]
type = ElementIntegralVariablePostprocessor
variable = c
execute_on = 'INITIAL TIMESTEP_END'
outputs = 'table console'
[../]
[./pos_c]
type = FindValueOnLine
start_point = '0 0 0'
end_point = '100 0 0'
v = c
target = 0.582
tol = 1e-8
execute_on = 'INITIAL TIMESTEP_END'
outputs = 'table console'
[../]
[./pos_eta]
type = FindValueOnLine
start_point = '0 0 0'
end_point = '100 0 0'
v = eta
target = 0.5
tol = 1e-8
execute_on = 'INITIAL TIMESTEP_END'
outputs = 'table console'
[../]
[./c_min]
type = ElementExtremeValue
value_type = min
variable = c
execute_on = 'INITIAL TIMESTEP_END'
outputs = 'table console'
[../]
[]
[VectorPostprocessors]
[./line]
type = LineValueSampler
variable = 'Fe_fit c w'
start_point = '0 0 0'
end_point = '100 0 0'
num_points = 5000
sort_by = x
outputs = vpp
execute_on = 'INITIAL TIMESTEP_END'
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -sub_pc_type'
petsc_options_value = 'asm lu'
l_max_its = 30
nl_max_its = 15
l_tol = 1.0e-4
nl_rel_tol = 1.0e-8
nl_abs_tol = 2.0e-9
start_time = 0.0
end_time = 100000.0
[./TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 7
iteration_window = 1
dt = 1
[../]
[./Adaptivity]
initial_adaptivity = 5
interval = 10
max_h_level = 5
refine_fraction = 0.9
coarsen_fraction = 0.1
[../]
[]
[Outputs]
print_linear_residuals = false
perf_graph = true
execute_on = 'INITIAL TIMESTEP_END'
[./table]
type = CSV
delimiter = ' '
file_base = radius_${RADIUS}/energy_pp
[../]
[./vpp]
type = CSV
delimiter = ' '
sync_times = '10 50 100 500 1000 5000 10000 50000 100000'
sync_only = true
time_data = true
file_base = radius_${RADIUS}/energy_vpp
[../]
[]
(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/combined/examples/phase_field-mechanics/SimplePhaseTrans.i)
#
# Martensitic transformation
# One structural order parameter (SOP) governed by AllenCahn Eqn.
# Chemical driving force described by Landau Polynomial
# Coupled with elasticity (Mechanics)
# Eigenstrain as a function of SOP
#
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 100
ny = 100
xmin = 0
xmax = 100
ymin = 0
ymax = 100
elem_type = QUAD4
[]
[Variables]
[./eta]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = SmoothCircleIC
x1 = 50
y1 = 50
radius = 10.0
invalue = 1.0
outvalue = 0.0
int_width = 5.0
[../]
[../]
[]
[Modules/TensorMechanics/Master]
[./all]
add_variables = true
generate_output = 'stress_xx stress_yy'
eigenstrain_names = 'eigenstrain'
[../]
[]
[Kernels]
[./eta_bulk]
type = AllenCahn
variable = eta
f_name = F
[../]
[./eta_interface]
type = ACInterface
variable = eta
kappa_name = kappa_eta
[../]
[./time]
type = TimeDerivative
variable = eta
[../]
[]
[Materials]
[./consts]
type = GenericConstantMaterial
prop_names = 'L kappa_eta'
prop_values = '1 1'
[../]
[./chemical_free_energy]
type = DerivativeParsedMaterial
property_name = Fc
coupled_variables = 'eta'
constant_names = 'A2 A3 A4'
constant_expressions = '0.2 -12.6 12.4'
expression = A2/2*eta^2+A3/3*eta^3+A4/4*eta^4
enable_jit = true
derivative_order = 2
[../]
[./elasticity_tensor]
type = ComputeElasticityTensor
C_ijkl = '70 30 30 70 30 70 30 30 30'
fill_method = symmetric9
[../]
[./stress]
type = ComputeLinearElasticStress
[../]
[./var_dependence]
type = DerivativeParsedMaterial
expression = eta
coupled_variables = 'eta'
property_name = var_dep
enable_jit = true
derivative_order = 2
[../]
[./eigenstrain]
type = ComputeVariableEigenstrain
eigen_base = '0.1 0.1 0 0 0 0'
prefactor = var_dep
#outputs = exodus
args = 'eta'
eigenstrain_name = eigenstrain
[../]
[./elastic_free_energy]
type = ElasticEnergyMaterial
f_name = Fe
args = 'eta'
derivative_order = 2
[../]
[./free_energy]
type = DerivativeSumMaterial
property_name = F
sum_materials = 'Fc Fe'
coupled_variables = 'eta'
derivative_order = 2
[../]
[]
[BCs]
[./all_y]
type = DirichletBC
variable = disp_y
boundary = 'top bottom left right'
value = 0
[../]
[./all_x]
type = DirichletBC
variable = disp_x
boundary = 'top bottom left right'
value = 0
[../]
[]
[Preconditioning]
# active = ' '
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
# this gives best performance on 4 cores
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -sub_pc_type '
petsc_options_value = 'asm lu'
l_max_its = 30
nl_max_its = 10
l_tol = 1.0e-4
nl_rel_tol = 1.0e-8
nl_abs_tol = 1.0e-10
start_time = 0.0
num_steps = 10
[./TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 9
iteration_window = 2
growth_factor = 1.1
cutback_factor = 0.75
dt = 0.3
[../]
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/dc.i)
p_initial=1.01e5
T=273.15
# u refers to the superficial velocity
u_in=1
rho_in=1.30524
sup_mom_y_in=${fparse u_in * rho_in}
user_limiter='min_mod'
friction_coeff=10
[GlobalParams]
fp = fp
two_term_boundary_expansion = true
limiter = ${user_limiter}
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1
nx = 3
ymin = 0
ymax = 18
ny = 90
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[pressure]
type = MooseVariableFVReal
initial_condition = ${p_initial}
[]
[sup_mom_x]
type = MooseVariableFVReal
initial_condition = 1e-15
[]
[sup_mom_y]
type = MooseVariableFVReal
initial_condition = 1e-15
[]
[T_fluid]
type = MooseVariableFVReal
initial_condition = ${T}
[]
[]
[AuxVariables]
[vel_y]
type = MooseVariableFVReal
[]
[rho]
type = MooseVariableFVReal
[]
[eps]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[vel_y]
type = ADMaterialRealAux
variable = vel_y
property = vel_y
execute_on = 'timestep_end'
[]
[rho]
type = ADMaterialRealAux
variable = rho
property = rho
execute_on = 'timestep_end'
[]
[eps]
type = MaterialRealAux
variable = eps
property = porosity
execute_on = 'timestep_end'
[]
[]
[FVKernels]
[mass_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_dt'
variable = pressure
[]
[mass_advection]
type = PCNSFVKTDC
variable = pressure
eqn = "mass"
[]
[momentum_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rhou_dt'
variable = sup_mom_x
[]
[momentum_advection]
type = PCNSFVKTDC
variable = sup_mom_x
eqn = "momentum"
momentum_component = 'x'
[]
[eps_grad]
type = PNSFVPGradEpsilon
variable = sup_mom_x
momentum_component = 'x'
epsilon_function = 'eps'
[]
[drag]
type = PCNSFVMomentumFriction
variable = sup_mom_x
momentum_component = 'x'
Darcy_name = 'cl'
momentum_name = superficial_rhou
[]
[momentum_time_y]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rhov_dt'
variable = sup_mom_y
[]
[momentum_advection_y]
type = PCNSFVKTDC
variable = sup_mom_y
eqn = "momentum"
momentum_component = 'y'
[]
[eps_grad_y]
type = PNSFVPGradEpsilon
variable = sup_mom_y
momentum_component = 'y'
epsilon_function = 'eps'
[]
[drag_y]
type = PCNSFVMomentumFriction
variable = sup_mom_y
momentum_component = 'y'
Darcy_name = 'cl'
momentum_name = superficial_rhov
[]
[energy_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_et_dt'
variable = T_fluid
[]
[energy_advection]
type = PCNSFVKTDC
variable = T_fluid
eqn = "energy"
[]
[]
[FVBCs]
[rho_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = pressure
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'mass'
velocity_function_includes_rho = true
[]
[rhou_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = sup_mom_x
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'x'
velocity_function_includes_rho = true
[]
[rhov_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = sup_mom_y
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'y'
velocity_function_includes_rho = true
[]
[rho_et_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = T_fluid
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'energy'
velocity_function_includes_rho = true
[]
[rho_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = pressure
pressure = ${p_initial}
eqn = 'mass'
[]
[rhou_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = sup_mom_x
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'x'
[]
[rhov_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = sup_mom_y
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'y'
[]
[rho_et_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = T_fluid
pressure = ${p_initial}
eqn = 'energy'
[]
[wall_pressure_x]
type = PCNSFVImplicitMomentumPressureBC
momentum_component = 'x'
boundary = 'left right'
variable = sup_mom_x
[]
[wall_pressure_y]
type = PCNSFVImplicitMomentumPressureBC
momentum_component = 'y'
boundary = 'left right'
variable = sup_mom_y
[]
# Use these to help create more accurate cell centered gradients for cells adjacent to boundaries
[T_bottom]
type = FVDirichletBC
variable = T_fluid
value = ${T}
boundary = 'bottom'
[]
[sup_mom_x_bottom_and_walls]
type = FVDirichletBC
variable = sup_mom_x
value = 0
boundary = 'bottom left right'
[]
[sup_mom_y_walls]
type = FVDirichletBC
variable = sup_mom_y
value = 0
boundary = 'left right'
[]
[sup_mom_y_bottom]
type = FVDirichletBC
variable = sup_mom_y
value = ${sup_mom_y_in}
boundary = 'bottom'
[]
[p_top]
type = FVDirichletBC
variable = pressure
value = ${p_initial}
boundary = 'top'
[]
[]
[Functions]
[ud_in]
type = ParsedVectorFunction
expression_x = '0'
expression_y = '${sup_mom_y_in}'
[]
[eps]
type = ParsedFunction
expression = 'if(y < 2.8, 1,
if(y < 3.2, 1 - .5 / .4 * (y - 2.8),
if(y < 6.8, .5,
if(y < 7.2, .5 - .25 / .4 * (y - 6.8),
if(y < 10.8, .25,
if(y < 11.2, .25 + .25 / .4 * (y - 10.8),
if(y < 14.8, .5,
if(y < 15.2, .5 + .5 / .4 * (y - 14.8),
1))))))))'
[]
[]
[Materials]
[var_mat]
type = PorousMixedVarMaterial
pressure = pressure
T_fluid = T_fluid
superficial_rhou = sup_mom_x
superficial_rhov = sup_mom_y
porosity = porosity
[]
[porosity]
type = GenericFunctionMaterial
prop_names = 'porosity'
prop_values = 'eps'
[]
[ad_generic]
type = ADGenericConstantVectorMaterial
prop_names = 'cl'
prop_values = '${friction_coeff} ${friction_coeff} ${friction_coeff}'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
solve_type = NEWTON
line_search = 'bt'
type = Transient
nl_max_its = 20
[TimeStepper]
type = IterationAdaptiveDT
dt = 5e-5
optimal_iterations = 6
growth_factor = 1.2
[]
num_steps = 10
nl_abs_tol = 1e-8
automatic_scaling = true
compute_scaling_once = false
resid_vs_jac_scaling_param = 0.5
verbose = true
steady_state_detection = true
steady_state_tolerance = 1e-8
normalize_solution_diff_norm_by_dt = false
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
[out]
type = Exodus
[]
[]
[Debug]
show_var_residual_norms = true
[]
[Postprocessors]
active = ''
[num_nl]
type = NumNonlinearIterations
[]
[total_nl]
type = CumulativeValuePostprocessor
postprocessor = num_nl
[]
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_direct.i)
rho = 'rho'
l = 10
inlet_area = 1
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 10
ny = 5
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = ${inlet_velocity}
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[scalar]
type = MooseVariableFVReal
initial_condition = 0.1
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FVKernels]
[mass_time]
type = WCNSFVMassTimeDerivative
variable = pressure
drho_dt = drho_dt
[]
[mass]
type = WCNSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = u
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = v
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T
rho = rho
drho_dt = drho_dt
h = h
dh_dt = dh_dt
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T
v = power_density
[]
# Scalar concentration equation
[scalar_time]
type = FVFunctorTimeKernel
variable = scalar
[]
[scalar_advection]
type = INSFVScalarFieldAdvection
variable = scalar
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[scalar_diffusion]
type = FVDiffusion
variable = scalar
coeff = 1.1
[]
[scalar_source]
type = FVBodyForce
variable = scalar
function = 2.1
[]
[]
[FVBCs]
# Inlet
[inlet_mass]
type = WCNSFVMassFluxBC
variable = pressure
boundary = 'left'
mdot_pp = 'inlet_mdot'
area_pp = 'surface_inlet'
vel_x = u
vel_y = v
rho = 'rho'
[]
[inlet_u]
type = WCNSFVMomentumFluxBC
variable = u
boundary = 'left'
mdot_pp = 'inlet_mdot'
area_pp = 'surface_inlet'
rho = 'rho'
momentum_component = 'x'
vel_x = u
vel_y = v
[]
[inlet_v]
type = WCNSFVMomentumFluxBC
variable = v
boundary = 'left'
mdot_pp = 0
area_pp = 'surface_inlet'
rho = 'rho'
momentum_component = 'y'
vel_x = u
vel_y = v
[]
[inlet_T]
type = WCNSFVEnergyFluxBC
variable = T
T_fluid = T
boundary = 'left'
energy_pp = 'inlet_Edot'
area_pp = 'surface_inlet'
vel_x = u
vel_y = v
rho = 'rho'
cp = cp
[]
[inlet_scalar]
type = WCNSFVScalarFluxBC
variable = scalar
boundary = 'left'
scalar_flux_pp = 'inlet_scalar_flux'
area_pp = 'surface_inlet'
vel_x = u
vel_y = v
rho = 'rho'
passive_scalar = scalar
[]
[outlet_p]
type = INSFVOutletPressureBC
variable = pressure
boundary = 'right'
function = ${outlet_pressure}
[]
# Walls
[no_slip_x]
type = INSFVNoSlipWallBC
variable = u
boundary = 'top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = v
boundary = 'top bottom'
function = 0
[]
[]
# used for the boundary conditions in this example
[Postprocessors]
[inlet_mdot]
type = Receiver
default = ${fparse 1980 * inlet_velocity * inlet_area}
[]
[surface_inlet]
type = AreaPostprocessor
boundary = 'left'
execute_on = 'INITIAL'
[]
[inlet_Edot]
type = Receiver
default = ${fparse 1980 * inlet_velocity * 2530 * inlet_temp * inlet_area}
[]
[inlet_scalar_flux]
type = Receiver
default = ${fparse inlet_velocity * 0.2 * inlet_area}
[]
[]
[FluidProperties]
[fp]
type = SimpleFluidProperties
density0 = 1980
cp = 2530
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T'
rho = ${rho}
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-2
optimal_iterations = 6
[]
end_time = 1
nl_abs_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
exodus = true
execute_on = FINAL
[]
(modules/navier_stokes/test/tests/finite_volume/ins/natural_convection/fuel_cavity.i)
# ========================================================================
# The purpose of this MOOSE scripts is to solve a 2-D axisymmetric
# problem with the following details:
# ------------------------------------------------------------------
# Physics: natural convection through a fluid and heat conduction
# in a solid and there is convective heat transfer from the
# solid to the liquid.
# ------------------------------------------------------------------
# Materials: the fluid is water and the solid is not specified.
# ------------------------------------------------------------------
# BCS: Inlet and outlet pressure with value of 0
# noslip conditions on the walls.
# Heat flux on the left wall with value of 40000 W/m^2
# ========================================================================
# ========================================================================
# Dimensions & Physical properties
# ========================================================================
Domain_length = 121.92e-2 # m
Solid_width = 0.7112e-3 # m
Liquid_width = 0.56261e-2 # m
mu = 0.00053157
rho = 987.27
k = 0.64247
k_solid = 15.0
cp = 4181.8
alpha_b = 210e-6
T_init = 300.0
input_heat_flux = 40000.0
# ========================================================================
# The main body of the script
# ========================================================================
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 2
#dx = '0.7032625e-4 0.7112e-5'
dx = '${Liquid_width} ${Solid_width}'
ix = '10 3'
dy = '${fparse 1./5.*Domain_length} ${fparse 4./5.*Domain_length}'
iy = '30 10'
subdomain_id = '0 1
0 1'
[]
[interface]
type = SideSetsBetweenSubdomainsGenerator
input = 'cmg'
primary_block = 0
paired_block = 1
new_boundary = 'interface'
[]
[fluid_side]
type = BreakBoundaryOnSubdomainGenerator
input = 'interface'
boundaries = 'top bottom'
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
block = 0
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
block = 0
initial_condition = 1e-6
[]
[vel_y]
type = INSFVVelocityVariable
block = 0
initial_condition = 1e-6
[]
[pressure]
type = INSFVPressureVariable
block = 0
[]
[T]
type = INSFVEnergyVariable
block = 0
initial_condition = ${T_init}
scaling = 1e-5
[]
[Ts]
type = INSFVEnergyVariable
block = 1
initial_condition = ${T_init}
scaling = 1e-3
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = ${rho}
[]
[u_time]
type = INSFVMomentumTimeDerivative
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[u_buoyancy]
type = INSFVMomentumBoussinesq
variable = vel_x
T_fluid = T
gravity = '0 -9.81 0'
rho = ${rho}
ref_temperature = ${T_init}
momentum_component = 'x'
#alpha_name = ${alpha_b}
[]
[v_time]
type = INSFVMomentumTimeDerivative
variable = vel_y
rho = ${rho}
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = ${rho}
momentum_component = 'y'
#alpha_name = ${alpha_b}
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[v_buoyancy]
type = INSFVMomentumBoussinesq
variable = vel_y
T_fluid = T
gravity = '0 -9.81 0'
rho = ${rho}
ref_temperature = ${T_init}
momentum_component = 'y'
[]
[temp_time]
type = INSFVEnergyTimeDerivative
variable = T
rho = '${rho}'
dh_dt = dh_dt
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T
[]
[Ts_time]
type = INSFVEnergyTimeDerivative
variable = Ts
rho = '${rho}'
dh_dt = dh_solid_dt
[]
[solid_temp_conduction]
type = FVDiffusion
coeff = 'k_solid'
variable = Ts
[]
[]
[FVInterfaceKernels]
[convection]
type = FVConvectionCorrelationInterface
variable1 = T
variable2 = Ts
boundary = 'interface'
h = htc
T_solid = Ts
T_fluid = T
subdomain1 = 0
subdomain2 = 1
wall_cell_is_bulk = true
[]
[]
[FVBCs]
[walls_u]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'interface left bottom_to_0'
function = 0
[]
[walls_v]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'interface left bottom_to_0'
function = 0
[]
[outlet]
type = INSFVOutletPressureBC
variable = pressure
boundary = 'top_to_0'
function = 0.0
[]
[outlet_T]
type = NSFVOutflowTemperatureBC
variable = T
boundary = 'top_to_0'
u = vel_x
v = vel_y
rho = ${rho}
cp = '${cp}'
backflow_T = ${T_init}
[]
[Insulator]
type = FVNeumannBC
variable = 'T'
boundary = 'left'
value = 0.0
[]
[heater]
type = FVNeumannBC
variable = 'Ts'
boundary = 'right'
value = '${fparse input_heat_flux}'
[]
[Insulator_solid]
type = FVNeumannBC
variable = 'Ts'
boundary = 'top_to_1'
value = 0.0
[]
[inlet_T_1]
type = FVDirichletBC
variable = Ts
boundary = 'bottom_to_1'
value = ${T_init}
[]
[]
[AuxVariables]
[Ra]
type = INSFVScalarFieldVariable
initial_condition = 1000.0
[]
[htc]
type = INSFVScalarFieldVariable
initial_condition = 0.0
[]
[]
[AuxKernels]
[compute_Ra]
type = ParsedAux
variable = Ra
coupled_variables = 'T'
constant_names = 'g beta T_init width nu alpha'
constant_expressions = '9.81 ${alpha_b} ${T_init} ${Liquid_width} ${fparse mu/rho} ${fparse k/(rho*cp)}'
expression = 'g * beta * (T - T_init) * pow(width, 3) / (nu*alpha) + 1.0'
block = 0
[]
[htc]
type = ParsedAux
variable = htc
coupled_variables = 'Ra'
constant_names = 'Pr'
constant_expressions = '${fparse cp*mu/k}'
expression = '${k}* (0.68 + 0.67 * pow(Ra, 0.25)/pow(1 + pow(0.437/Pr, 9/16) ,4/9) )/ ${Liquid_width} '
block = 0
[]
[]
[FunctorMaterials]
[functor_constants]
type = ADGenericFunctorMaterial
prop_names = 'cp k k_solid'
prop_values = '${cp} ${k} ${k_solid}'
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T'
rho = ${rho}
block = 0
[]
[ins_fv_solid]
type = INSFVEnthalpyFunctorMaterial
temperature = 'Ts'
rho = ${rho}
cp = ${cp}
h = h_solid
rho_h = rho_h_solid
block = 1
[]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'alpha_b'
prop_values = '${alpha_b}'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -sub_pc_factor_shift_type -ksp_gmres_restart'
petsc_options_value = ' lu NONZERO 200'
line_search = 'none'
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.01
optimal_iterations = 20
iteration_window = 2
[]
nl_max_its = 30
nl_abs_tol = 1e-10
steady_state_detection = true
steady_state_tolerance = 1e-09
[]
[Postprocessors]
[max_T]
type = ADElementExtremeFunctorValue
functor = T
block = 0
[]
[max_Ts]
type = ADElementExtremeFunctorValue
functor = Ts
block = 1
[]
[]
[Outputs]
exodus = false
csv = true
[]
(modules/level_set/test/tests/reinitialization/reinit_modified.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 8
ny = 8
uniform_refine = 3
[]
[Variables]
[./phi]
[../]
[]
[AuxVariables]
[./phi_0]
[../]
[]
[BCs]
[./Periodic]
[./all]
variable = phi
auto_direction = 'x y'
[../]
[../]
[]
[Kernels]
[./time]
type = TimeDerivative
variable = phi
[../]
[./reinit]
type = LevelSetOlssonReinitialization
variable = phi
phi_0 = phi_0
epsilon = 0.05
use_modified_reinitilization_formulation = true
[../]
[]
[Problem]
type = LevelSetReinitializationProblem
[]
[UserObjects]
[./arnold]
type = LevelSetOlssonTerminator
tol = 1
[../]
[]
[Executioner]
type = Transient
solve_type = PJFNK
start_time = 0
num_steps = 100
nl_rel_tol = 1e-8
nl_abs_tol = 1e-10
scheme = crank-nicolson
petsc_options_iname = '-pc_type -pc_sub_type -ksp_gmres_restart'
petsc_options_value = 'hypre boomeramg 300'
[./TimeStepper]
type = IterationAdaptiveDT
dt = 0.001
optimal_iterations = 5
growth_factor = 5
[../]
[]
(modules/porous_flow/test/tests/gravity/grav02e.i)
# Checking that gravity head is established in the transient situation when 0<=saturation<=1 (note the less-than-or-equal-to).
# 2phase (PS), 2components, constant capillary pressure, constant fluid bulk-moduli for each phase, constant viscosity,
# constant permeability, Corey relative permeabilities with no residual saturation
[Mesh]
type = GeneratedMesh
dim = 2
ny = 10
ymax = 100
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 -10 0'
[]
[Variables]
[ppwater]
initial_condition = 1.5e6
[]
[sgas]
initial_condition = 0.3
[]
[]
[AuxVariables]
[massfrac_ph0_sp0]
initial_condition = 1
[]
[massfrac_ph1_sp0]
initial_condition = 0
[]
[ppgas]
family = MONOMIAL
order = FIRST
[]
[swater]
family = MONOMIAL
order = FIRST
[]
[relpermwater]
family = MONOMIAL
order = FIRST
[]
[relpermgas]
family = MONOMIAL
order = FIRST
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = ppwater
[]
[flux0]
type = PorousFlowAdvectiveFlux
fluid_component = 0
variable = ppwater
[]
[mass1]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = sgas
[]
[flux1]
type = PorousFlowAdvectiveFlux
fluid_component = 1
variable = sgas
[]
[]
[AuxKernels]
[ppgas]
type = PorousFlowPropertyAux
property = pressure
phase = 1
variable = ppgas
[]
[swater]
type = PorousFlowPropertyAux
property = saturation
phase = 0
variable = swater
[]
[relpermwater]
type = PorousFlowPropertyAux
property = relperm
phase = 0
variable = relpermwater
[]
[relpermgas]
type = PorousFlowPropertyAux
property = relperm
phase = 1
variable = relpermgas
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'ppwater sgas'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureConst
pc = 1e5
[]
[]
[FluidProperties]
[simple_fluid0]
type = SimpleFluidProperties
bulk_modulus = 2e9
density0 = 1000
viscosity = 1e-3
thermal_expansion = 0
[]
[simple_fluid1]
type = SimpleFluidProperties
bulk_modulus = 2e9
density0 = 10
viscosity = 1e-5
thermal_expansion = 0
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
[]
[ppss]
type = PorousFlow2PhasePS
phase0_porepressure = ppwater
phase1_saturation = sgas
capillary_pressure = pc
[]
[massfrac]
type = PorousFlowMassFraction
mass_fraction_vars = 'massfrac_ph0_sp0 massfrac_ph1_sp0'
[]
[simple_fluid0]
type = PorousFlowSingleComponentFluid
fp = simple_fluid0
phase = 0
[]
[simple_fluid1]
type = PorousFlowSingleComponentFluid
fp = simple_fluid1
phase = 1
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.1
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-11 0 0 0 1e-11 0 0 0 1e-11'
[]
[relperm_water]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 1
[]
[]
[Postprocessors]
[mass_ph0]
type = PorousFlowFluidMass
fluid_component = 0
execute_on = 'initial timestep_end'
[]
[mass_ph1]
type = PorousFlowFluidMass
fluid_component = 1
execute_on = 'initial timestep_end'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -snes_atol -snes_rtol'
petsc_options_value = 'bcgs bjacobi 1E-12 1E-10'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 1e5
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e4
[]
[]
[Outputs]
execute_on = 'initial timestep_end'
file_base = grav02e
exodus = true
perf_graph = true
csv = false
[]
(modules/porous_flow/test/tests/dirackernels/theis3.i)
# Two phase Theis problem: Flow from single source
# Constant rate injection 0.5 kg/s
# 1D cylindrical mesh
[Mesh]
type = GeneratedMesh
dim = 1
nx = 100
xmax = 2000
bias_x = 1.05
coord_type = RZ
rz_coord_axis = Y
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[Variables]
[ppwater]
initial_condition = 20e6
[]
[sgas]
initial_condition = 0
[]
[]
[AuxVariables]
[massfrac_ph0_sp0]
initial_condition = 1
[]
[massfrac_ph1_sp0]
initial_condition = 0
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = ppwater
[]
[flux0]
type = PorousFlowAdvectiveFlux
fluid_component = 0
variable = ppwater
[]
[mass1]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = sgas
[]
[flux1]
type = PorousFlowAdvectiveFlux
fluid_component = 1
variable = sgas
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'ppwater sgas'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureConst
pc = 1e5
[]
[]
[FluidProperties]
[simple_fluid0]
type = SimpleFluidProperties
bulk_modulus = 2e9
density0 = 1000
viscosity = 1e-3
thermal_expansion = 0
[]
[simple_fluid1]
type = SimpleFluidProperties
bulk_modulus = 2e9
density0 = 10
viscosity = 1e-4
thermal_expansion = 0
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
[]
[ppss]
type = PorousFlow2PhasePS
phase0_porepressure = ppwater
phase1_saturation = sgas
capillary_pressure = pc
[]
[massfrac]
type = PorousFlowMassFraction
mass_fraction_vars = 'massfrac_ph0_sp0 massfrac_ph1_sp0'
[]
[simple_fluid0]
type = PorousFlowSingleComponentFluid
fp = simple_fluid0
phase = 0
compute_enthalpy = false
compute_internal_energy = false
[]
[simple_fluid1]
type = PorousFlowSingleComponentFluid
fp = simple_fluid1
phase = 1
compute_enthalpy = false
compute_internal_energy = false
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.2
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-12 0 0 0 1e-12 0 0 0 1e-12'
[]
[relperm_water]
type = PorousFlowRelativePermeabilityCorey
n = 1
phase = 0
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityCorey
n = 1
phase = 1
[]
[]
[BCs]
[rightwater]
type = DirichletBC
boundary = right
value = 20e6
variable = ppwater
[]
[]
[DiracKernels]
[source]
type = PorousFlowSquarePulsePointSource
point = '0 0 0'
mass_flux = 0.5
variable = sgas
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options = '-snes_converged_reason -ksp_diagonal_scale -ksp_diagonal_scale_fix -ksp_gmres_modifiedgramschmidt -snes_linesearch_monitor'
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap -snes_atol -snes_rtol -snes_max_it'
petsc_options_value = 'gmres asm lu NONZERO 2 1E-8 1E-10 20'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 1e4
[TimeStepper]
type = IterationAdaptiveDT
dt = 10
growth_factor = 2
[]
[]
[VectorPostprocessors]
[line]
type = NodalValueSampler
sort_by = x
variable = 'ppwater sgas'
execute_on = 'timestep_end'
[]
[]
[Postprocessors]
[ppwater]
type = PointValue
point = '4 0 0'
variable = ppwater
[]
[sgas]
type = PointValue
point = '4 0 0'
variable = sgas
[]
[massgas]
type = PorousFlowFluidMass
fluid_component = 1
[]
[]
[Outputs]
file_base = theis3
print_linear_residuals = false
perf_graph = true
[csv]
type = CSV
execute_on = timestep_end
execute_vector_postprocessors_on = final
[]
[]
(modules/navier_stokes/examples/laser-welding/2d.i)
endtime=5e-4 # s
timestep=${fparse endtime/100} # s
surfacetemp=300 # K
power=190 # W
R=1.8257418583505537e-4 # m
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -.45e-3 # m
xmax = 0.45e-3 # m
ymin = -.9e-4 # m
ymax = 0
nx = 25
ny = 5
displacements = 'disp_x disp_y'
[]
[GlobalParams]
temperature = T
[]
[Variables]
[vel]
family = LAGRANGE_VEC
[]
[T]
[]
[p]
[]
[disp_x]
[]
[disp_y]
[]
[]
[AuxVariables]
[vel_x_aux]
[InitialCondition]
type = ConstantIC
value = 1e-15
[]
[]
[vel_y_aux]
[InitialCondition]
type = ConstantIC
value = 1e-15
[]
[]
[]
[AuxKernels]
[vel_x_value]
type = VectorVariableComponentAux
variable = vel_x_aux
vector_variable = vel
component = x
[]
[vel_y_value]
type = VectorVariableComponentAux
variable = vel_y_aux
vector_variable = vel
component = y
[]
[]
[ICs]
[T]
type = FunctionIC
variable = T
function = '(${surfacetemp} - 300) / .7e-3 * y + ${surfacetemp}'
[]
[]
[Kernels]
[disp_x]
type = Diffusion
variable = disp_x
[]
[disp_y]
type = Diffusion
variable = disp_y
[]
[mass]
type = INSADMass
variable = p
use_displaced_mesh = true
[]
[mass_pspg]
type = INSADMassPSPG
variable = p
use_displaced_mesh = true
[]
[momentum_time]
type = INSADMomentumTimeDerivative
variable = vel
use_displaced_mesh = true
[]
[momentum_advection]
type = INSADMomentumAdvection
variable = vel
use_displaced_mesh = true
[]
[momentum_mesh_advection]
type = INSADMomentumMeshAdvection
variable = vel
disp_x = disp_x
disp_y = disp_y
use_displaced_mesh = true
[]
[momentum_viscous]
type = INSADMomentumViscous
variable = vel
use_displaced_mesh = true
[]
[momentum_pressure]
type = INSADMomentumPressure
variable = vel
pressure = p
integrate_p_by_parts = true
use_displaced_mesh = true
[]
[momentum_supg]
type = INSADMomentumSUPG
variable = vel
material_velocity = relative_velocity
use_displaced_mesh = true
[]
[temperature_time]
type = INSADHeatConductionTimeDerivative
variable = T
use_displaced_mesh = true
[]
[temperature_advection]
type = INSADEnergyAdvection
variable = T
use_displaced_mesh = true
[]
[temperature_mesh_advection]
type = INSADEnergyMeshAdvection
variable = T
disp_x = disp_x
disp_y = disp_y
use_displaced_mesh = true
[]
[temperature_conduction]
type = ADHeatConduction
variable = T
thermal_conductivity = 'k'
use_displaced_mesh = true
[]
[temperature_supg]
type = INSADEnergySUPG
variable = T
velocity = vel
use_displaced_mesh = true
[]
[]
[BCs]
[x_no_disp]
type = DirichletBC
variable = disp_x
boundary = 'bottom'
value = 0
[]
[y_no_disp]
type = DirichletBC
variable = disp_y
boundary = 'bottom'
value = 0
[]
[no_slip]
type = ADVectorFunctionDirichletBC
variable = vel
boundary = 'bottom right left'
[]
[T_cold]
type = DirichletBC
variable = T
boundary = 'bottom'
value = 300
[]
[radiation_flux]
type = FunctionRadiativeBC
variable = T
boundary = 'top'
emissivity_function = '1'
Tinfinity = 300
stefan_boltzmann_constant = 5.67e-8
use_displaced_mesh = true
[]
[weld_flux]
type = GaussianEnergyFluxBC
variable = T
boundary = 'top'
P0 = ${power}
R = ${R}
x_beam_coord = '-0.35e-3 +0.7e-3*t/${endtime}'
y_beam_coord = '0'
use_displaced_mesh = true
[]
[vapor_recoil]
type = INSADVaporRecoilPressureMomentumFluxBC
variable = vel
boundary = 'top'
use_displaced_mesh = true
[]
[displace_x_top]
type = INSADDisplaceBoundaryBC
boundary = 'top'
variable = 'disp_x'
velocity = 'vel'
component = 0
associated_subdomain = 0
[]
[displace_y_top]
type = INSADDisplaceBoundaryBC
boundary = 'top'
variable = 'disp_y'
velocity = 'vel'
component = 1
associated_subdomain = 0
[]
[displace_x_top_dummy]
type = INSADDummyDisplaceBoundaryIntegratedBC
boundary = 'top'
variable = 'disp_x'
velocity = 'vel'
component = 0
[]
[displace_y_top_dummy]
type = INSADDummyDisplaceBoundaryIntegratedBC
boundary = 'top'
variable = 'disp_y'
velocity = 'vel'
component = 1
[]
[]
[Materials]
[ins_mat]
type = INSADStabilized3Eqn
velocity = vel
pressure = p
temperature = T
use_displaced_mesh = true
[]
[steel]
type = AriaLaserWeld304LStainlessSteel
temperature = T
beta = 1e7
use_displaced_mesh = true
[]
[steel_boundary]
type = AriaLaserWeld304LStainlessSteelBoundary
boundary = 'top'
temperature = T
use_displaced_mesh = true
[]
[const]
type = GenericConstantMaterial
prop_names = 'abs sb_constant'
prop_values = '1 5.67e-8'
use_displaced_mesh = true
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu NONZERO strumpack'
[]
[]
[Executioner]
type = Transient
end_time = ${endtime}
dtmin = 1e-8
dtmax = ${timestep}
petsc_options = '-snes_converged_reason -ksp_converged_reason -options_left'
solve_type = 'NEWTON'
line_search = 'none'
nl_max_its = 12
l_max_its = 100
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 7
dt = ${timestep}
linear_iteration_ratio = 1e6
growth_factor = 1.5
[]
[]
[Outputs]
[exodus]
type = Exodus
output_material_properties = true
show_material_properties = 'mu'
[]
checkpoint = true
perf_graph = true
[]
[Debug]
show_var_residual_norms = true
[]
[Adaptivity]
marker = combo
max_h_level = 4
[Indicators]
[error_T]
type = GradientJumpIndicator
variable = T
[]
[error_dispz]
type = GradientJumpIndicator
variable = disp_y
[]
[]
[Markers]
[errorfrac_T]
type = ErrorFractionMarker
refine = 0.4
coarsen = 0.2
indicator = error_T
[]
[errorfrac_dispz]
type = ErrorFractionMarker
refine = 0.4
coarsen = 0.2
indicator = error_dispz
[]
[combo]
type = ComboMarker
markers = 'errorfrac_T errorfrac_dispz'
[]
[]
[]
[Postprocessors]
[num_dofs]
type = NumDOFs
system = 'NL'
[]
[nl]
type = NumNonlinearIterations
[]
[tot_nl]
type = CumulativeValuePostprocessor
postprocessor = 'nl'
[]
[]
(modules/solid_mechanics/test/tests/rom_stress_update/creep_ramp_sub_false.i)
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 1
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[AuxVariables]
[temperature]
initial_condition = 889
[]
[effective_inelastic_strain]
order = FIRST
family = MONOMIAL
[]
[cell_dislocations]
order = FIRST
family = MONOMIAL
[]
[wall_dislocations]
order = FIRST
family = MONOMIAL
[]
[number_of_substeps]
order = FIRST
family = MONOMIAL
[]
[]
[AuxKernels]
[effective_inelastic_strain]
type = MaterialRealAux
variable = effective_inelastic_strain
property = effective_creep_strain
[]
[cell_dislocations]
type = MaterialRealAux
variable = cell_dislocations
property = cell_dislocations
[]
[wall_dislocations]
type = MaterialRealAux
variable = wall_dislocations
property = wall_dislocations
[]
[number_of_substeps]
type = MaterialRealAux
variable = number_of_substeps
property = number_of_substeps
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = FINITE
add_variables = true
generate_output = 'vonmises_stress'
[]
[]
[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
[]
[pressure_x]
type = Pressure
variable = disp_x
boundary = right
factor = -0.5
function = shear_function
[]
[pressure_y]
type = Pressure
variable = disp_y
boundary = top
factor = -0.5
function = shear_function
[]
[pressure_z]
type = Pressure
variable = disp_z
boundary = front
factor = 0.5
function = shear_function
[]
[]
[Functions]
[shear_function]
type = ParsedFunction
expression = 'timeToDoubleInHours := 10;
if(t<=28*60*60, 15.0e6, 15.0e6*(t-28*3600)/3600/timeToDoubleInHours+15.0e6)'
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1.68e11
poissons_ratio = 0.31
[]
[stress]
type = ComputeMultipleInelasticStress
inelastic_models = rom_stress_prediction
[]
[mx_phase_fraction]
type = GenericConstantMaterial
prop_names = mx_phase_fraction
prop_values = 5.13e-2 #precipitation bounds: 6e-3, 1e-1
outputs = all
[]
[rom_stress_prediction]
type = SS316HLAROMANCEStressUpdateTest
temperature = temperature
initial_cell_dislocation_density = 6.0e12
initial_wall_dislocation_density = 4.4e11
use_substepping = NONE
max_inelastic_increment = 0.0001
stress_input_window_low_failure = WARN
stress_input_window_high_failure = ERROR
cell_input_window_high_failure = ERROR
cell_input_window_low_failure = ERROR
wall_input_window_low_failure = ERROR
wall_input_window_high_failure = ERROR
temperature_input_window_high_failure = ERROR
temperature_input_window_low_failure = ERROR
environment_input_window_high_failure = ERROR
environment_input_window_low_failure = ERROR
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
nl_abs_tol = 1e-12
nl_rel_tol = 1e-4
automatic_scaling = true
compute_scaling_once = false
dtmin = 0.1
dtmax = 1e5
end_time = 136800
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.1 ## This model requires a tiny timestep at the onset for the first 10s
iteration_window = 4
optimal_iterations = 12
time_t = '100800'
time_dt = '1e5'
[]
[]
[Postprocessors]
[effective_strain_avg]
type = ElementAverageValue
variable = effective_inelastic_strain
[]
[temperature]
type = ElementAverageValue
variable = temperature
[]
[cell_dislocations]
type = ElementAverageValue
variable = cell_dislocations
[]
[wall_disloactions]
type = ElementAverageValue
variable = wall_dislocations
[]
[max_vonmises_stress]
type = ElementExtremeValue
variable = vonmises_stress
value_type = max
[]
[number_of_substeps]
type = ElementAverageValue
variable = number_of_substeps
[]
[]
[Outputs]
csv = true
[]
(modules/phase_field/tutorials/spinodal_decomposition/s2_fasttest.i)
#
# Simulation of an iron-chromium alloy using simple code and a test set of
# initial conditions.
#
[Mesh]
# generate a 2D, 25nm x 25nm mesh
type = GeneratedMesh
dim = 2
elem_type = QUAD4
nx = 100
ny = 100
nz = 0
xmin = 0
xmax = 25
ymin = 0
ymax = 25
zmin = 0
zmax = 0
[]
[Variables]
[./c] # Mole fraction of Cr (unitless)
order = FIRST
family = LAGRANGE
[../]
[./w] # Chemical potential (eV/mol)
order = FIRST
family = LAGRANGE
[../]
[]
[ICs]
# Use a bounding box IC at equilibrium concentrations to make sure the
# model behaves as expected.
[./testIC]
type = BoundingBoxIC
variable = c
x1 = 5
x2 = 20
y1 = 5
y2 = 20
inside = 0.823
outside = 0.236
[../]
[]
[BCs]
# periodic BC as is usually done on phase-field models
[./Periodic]
[./c_bcs]
auto_direction = 'x y'
[../]
[../]
[]
[Kernels]
# See wiki page "Developing Phase Field Models" for more information on Split
# Cahn-Hilliard equation kernels.
# http://mooseframework.org/wiki/PhysicsModules/PhaseField/DevelopingModels/
[./w_dot]
variable = w
v = c
type = CoupledTimeDerivative
[../]
[./coupled_res]
variable = w
type = SplitCHWRes
mob_name = M
[../]
[./coupled_parsed]
variable = c
type = SplitCHParsed
f_name = f_loc
kappa_name = kappa_c
w = w
[../]
[]
[Materials]
# d is a scaling factor that makes it easier for the solution to converge
# without changing the results. It is defined in each of the materials and
# must have the same value in each one.
[./constants]
# Define constant values kappa_c and M. Eventually M will be replaced with
# an equation rather than a constant.
type = GenericFunctionMaterial
prop_names = 'kappa_c M'
prop_values = '8.125e-16*6.24150934e+18*1e+09^2*1e-27
2.2841e-26*1e+09^2/6.24150934e+18/1e-27'
# kappa_c*eV_J*nm_m^2*d
# M*nm_m^2/eV_J/d
[../]
[./local_energy]
# Defines the function for the local free energy density as given in the
# problem, then converts units and adds scaling factor.
type = DerivativeParsedMaterial
property_name = f_loc
coupled_variables = c
constant_names = 'A B C D E F G eV_J d'
constant_expressions = '-2.446831e+04 -2.827533e+04 4.167994e+03 7.052907e+03
1.208993e+04 2.568625e+03 -2.354293e+03
6.24150934e+18 1e-27'
expression = 'eV_J*d*(A*c+B*(1-c)+C*c*log(c)+D*(1-c)*log(1-c)+
E*c*(1-c)+F*c*(1-c)*(2*c-1)+G*c*(1-c)*(2*c-1)^2)'
derivative_order = 2
[../]
[]
[Postprocessors]
[./evaluations] # Cumulative residual calculations for simulation
type = NumResidualEvaluations
[../]
[./elapsed]
type = PerfGraphData
section_name = "Root"
data_type = total
[../]
[]
[Preconditioning]
# Preconditioning is required for Newton's method. See wiki page "Solving
# Phase Field Models" for more information.
# http://mooseframework.org/wiki/PhysicsModules/PhaseField/SolvingModels/
[./coupled]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
l_max_its = 30
l_tol = 1e-6
nl_max_its = 50
nl_abs_tol = 1e-9
end_time = 86400 # 1 day. We only need to run this long enough to verify
# the model is working properly.
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type
-sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly
ilu 1'
[./TimeStepper]
# Turn on time stepping
type = IterationAdaptiveDT
dt = 10
cutback_factor = 0.8
growth_factor = 1.5
optimal_iterations = 7
[../]
[]
[Debug]
show_var_residual_norms = true
[]
[Outputs]
exodus = true
console = true
csv = true
[./console]
type = Console
max_rows = 10
[../]
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_reversal.i)
rho = 'rho'
l = 10
inlet_area = 1
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.1
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 6
ny = 3
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = ${inlet_velocity}
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T_fluid]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[scalar]
type = MooseVariableFVReal
initial_condition = 0.1
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e6
[]
[]
[FVKernels]
# Mass equation
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[mean_zero_pressure]
type = FVIntegralValueConstraint
variable = pressure
lambda = lambda
phi0 = 0.0
[]
# X component momentum equation
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = vel_x
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
# Y component momentum equation
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = vel_y
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
# Energy equation
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T_fluid
rho = rho
drho_dt = drho_dt
dh_dt = dh_dt
h = h
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T_fluid
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T_fluid
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T_fluid
v = power_density
[]
# Scalar concentration equation
[scalar_time]
type = FVFunctorTimeKernel
variable = scalar
[]
[scalar_advection]
type = INSFVScalarFieldAdvection
variable = scalar
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[scalar_diffusion]
type = FVDiffusion
variable = scalar
coeff = 1.1
[]
[scalar_source]
type = FVBodyForce
variable = scalar
function = 2.1
[]
[]
[FVBCs]
# Inlet
[inlet_mass]
type = WCNSFVMassFluxBC
variable = pressure
boundary = 'left'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_u]
type = WCNSFVMomentumFluxBC
variable = vel_x
boundary = 'left'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
momentum_component = 'x'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_v]
type = WCNSFVMomentumFluxBC
variable = vel_y
boundary = 'left'
mdot_pp = 0
area_pp = 'area_pp_left'
rho = 'rho'
momentum_component = 'y'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_T]
type = WCNSFVEnergyFluxBC
variable = T_fluid
T_fluid = T_fluid
boundary = 'left'
temperature_pp = 'inlet_T'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
cp = 'cp'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_scalar]
type = WCNSFVScalarFluxBC
variable = scalar
boundary = 'left'
scalar_value_pp = 'inlet_scalar_value'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
passive_scalar = scalar
[]
[outlet_mass]
type = WCNSFVMassFluxBC
variable = pressure
boundary = 'right'
mdot_pp = 'outlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
[]
[outlet_u]
type = WCNSFVMomentumFluxBC
variable = vel_x
boundary = 'right'
mdot_pp = 'outlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
momentum_component = 'x'
vel_x = vel_x
vel_y = vel_y
[]
[outlet_v]
type = WCNSFVMomentumFluxBC
variable = vel_y
boundary = 'right'
mdot_pp = 0
area_pp = 'area_pp_left'
rho = 'rho'
momentum_component = 'y'
vel_x = vel_x
vel_y = vel_y
[]
[outlet_T]
type = WCNSFVEnergyFluxBC
variable = T_fluid
T_fluid = T_fluid
boundary = 'right'
temperature_pp = 'inlet_T'
mdot_pp = 'outlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
cp = 'cp'
vel_x = vel_x
vel_y = vel_y
[]
[outlet_scalar]
type = WCNSFVScalarFluxBC
variable = scalar
boundary = 'right'
scalar_value_pp = 'inlet_scalar_value'
mdot_pp = 'outlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
passive_scalar = scalar
[]
# Walls
[no_slip_x]
type = INSFVNaturalFreeSlipBC
variable = vel_x
momentum_component = x
boundary = 'top bottom'
[]
[no_slip_y]
type = INSFVNaturalFreeSlipBC
variable = vel_y
momentum_component = y
boundary = 'top bottom'
[]
[]
# used for the boundary conditions in this example
[Postprocessors]
[inlet_mdot]
type = Receiver
default = ${fparse 1980 * inlet_velocity * inlet_area}
#outputs = none
[]
[outlet_mdot]
type = Receiver
default = ${fparse -1980 * inlet_velocity * inlet_area}
outputs = none
[]
[area_pp_left]
type = AreaPostprocessor
boundary = 'left'
execute_on = 'INITIAL'
outputs = none
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
outputs = none
[]
[inlet_scalar_value]
type = Receiver
default = 0.2
outputs = none
[]
[left_mdot]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
advected_quantity = rho
boundary = left
#advected_interp_method = ${advected_interp_method}
[]
[right_mdot]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
advected_quantity = rho
boundary = right
advected_interp_method = upwind #${advected_interp_method}
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k rho'
prop_values = '${cp} ${k} 1980'
[]
#[rho]
# type = RhoFromPTFunctorMaterial
# fp = fp
# temperature = T_fluid
# pressure = pressure
#[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T_fluid'
rho = ${rho}
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-1
optimal_iterations = 6
growth_factor = 4
[]
end_time = 500000
nl_abs_tol = 1e-7
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
exodus = true
execute_on = FINAL
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/lid-driven-two-phase.i)
mu = 1.0
rho = 1.0e3
mu_d = 0.3
rho_d = 1.0
dp = 0.01
U_lid = 0.1
g = -9.81
[GlobalParams]
velocity_interp_method = 'rc'
advected_interp_method = 'upwind'
rhie_chow_user_object = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = .1
ymin = 0
ymax = .1
nx = 10
ny = 10
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
[]
[vel_y]
type = INSFVVelocityVariable
[]
[pressure]
type = INSFVPressureVariable
[]
[phase_2]
type = INSFVScalarFieldVariable
[]
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[pin_pressure]
type = NSPressurePin
variable = pressure
pin_type = point-value
point = '0 0 0'
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = 'rho_mixture'
[]
[u_time]
type = INSFVMomentumTimeDerivative
variable = vel_x
rho = 'rho_mixture'
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = 'rho_mixture'
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_mixture'
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[u_buoyant]
type = INSFVMomentumGravity
variable = vel_x
rho = 'rho_mixture'
momentum_component = 'x'
gravity = '0 ${g} 0'
[]
[v_time]
type = INSFVMomentumTimeDerivative
variable = vel_y
rho = 'rho_mixture'
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = 'rho_mixture'
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_mixture'
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[v_buoyant]
type = INSFVMomentumGravity
variable = vel_y
rho = 'rho_mixture'
momentum_component = 'y'
gravity = '0 ${g} 0'
[]
[phase_2_time]
type = FVFunctorTimeKernel
variable = phase_2
[]
[phase_2_advection]
type = INSFVScalarFieldAdvection
variable = phase_2
u_slip = 'vel_slip_x'
v_slip = 'vel_slip_y'
[]
[phase_2_diffusion]
type = FVDiffusion
variable = phase_2
coeff = 1e-3
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${U_lid}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[bottom_phase_2]
type = FVDirichletBC
variable = phase_2
boundary = 'bottom'
value = 1.0
[]
[top_phase_2]
type = FVDirichletBC
variable = phase_2
boundary = 'top'
value = 0.0
[]
[]
[AuxVariables]
[U]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[drag_coefficient]
type = MooseVariableFVReal
[]
[rho_mixture_var]
type = MooseVariableFVReal
[]
[mu_mixture_var]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[mag]
type = VectorMagnitudeAux
variable = U
x = vel_x
y = vel_y
[]
[populate_cd]
type = FunctorAux
variable = drag_coefficient
functor = 'Darcy_coefficient'
[]
[populate_rho_mixture_var]
type = FunctorAux
variable = rho_mixture_var
functor = 'rho_mixture'
[]
[populate_mu_mixture_var]
type = FunctorAux
variable = mu_mixture_var
functor = 'mu_mixture'
[]
[]
[FunctorMaterials]
[populate_u_slip]
type = WCNSFV2PSlipVelocityFunctorMaterial
slip_velocity_name = 'vel_slip_x'
momentum_component = 'x'
u = 'vel_x'
v = 'vel_y'
rho = ${rho}
mu = 'mu_mixture'
rho_d = ${rho_d}
particle_diameter = ${dp}
linear_coef_name = 'Darcy_coefficient'
[]
[populate_v_slip]
type = WCNSFV2PSlipVelocityFunctorMaterial
slip_velocity_name = 'vel_slip_y'
momentum_component = 'y'
u = 'vel_x'
v = 'vel_y'
rho = ${rho}
mu = 'mu_mixture'
rho_d = ${rho_d}
particle_diameter = ${dp}
linear_coef_name = 'Darcy_coefficient'
[]
[compute_phase_1]
type = ADParsedFunctorMaterial
property_name = phase_1
functor_names = 'phase_2'
expression = '1 - phase_2'
[]
[CD]
type = NSFVDispersePhaseDragFunctorMaterial
rho = 'rho_mixture'
mu = mu_mixture
u = 'vel_x'
v = 'vel_y'
particle_diameter = ${dp}
[]
[mixing_material]
type = NSFVMixtureFunctorMaterial
phase_1_names = '${rho_d} ${mu_d}'
phase_2_names = '${rho} ${mu}'
prop_names = 'rho_mixture mu_mixture'
phase_1_fraction = 'phase_2'
[]
[]
[Postprocessors]
[average_void]
type = ElementAverageValue
variable = 'phase_2'
[]
[max_y_velocity]
type = ElementExtremeValue
variable = 'vel_y'
value_type = max
[]
[min_y_velocity]
type = ElementExtremeValue
variable = 'vel_y'
value_type = min
[]
[max_x_velocity]
type = ElementExtremeValue
variable = 'vel_x'
value_type = max
[]
[min_x_velocity]
type = ElementExtremeValue
variable = 'vel_x'
value_type = min
[]
[max_x_slip_velocity]
type = ElementExtremeFunctorValue
functor = 'vel_slip_x'
value_type = max
[]
[max_y_slip_velocity]
type = ElementExtremeFunctorValue
functor = 'vel_slip_y'
value_type = max
[]
[max_drag_coefficient]
type = ElementExtremeFunctorValue
functor = 'drag_coefficient'
value_type = max
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 7
iteration_window = 2
growth_factor = 2.0
cutback_factor = 0.5
dt = 1e-3
[]
nl_max_its = 10
nl_rel_tol = 1e-03
nl_abs_tol = 1e-9
l_max_its = 5
end_time = 1e8
[]
[Outputs]
exodus = false
[CSV]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/solid_mechanics/test/tests/material_limit_time_step/damage/scalar_material_damage_timestep_limit.i)
# This is a basic test of the system for continuum damage mechanics
# materials. It uses ScalarMaterialDamage for the damage model,
# which simply gets its damage index from another material. In this
# case, we prescribe the evolution of the damage index using a
# function. A single element has a fixed prescribed displacement
# on one side that puts the element in tension, and then the
# damage index evolves from 0 to 1 over time, and this verifies
# that the stress correspondingly drops to 0.
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 1
elem_type = HEX8
[]
[AuxVariables]
[damage_index]
order = CONSTANT
family = MONOMIAL
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = SMALL
incremental = true
add_variables = true
generate_output = 'stress_xx strain_xx'
[]
[]
[AuxKernels]
[damage_index]
type = MaterialRealAux
variable = damage_index
property = damage_index_prop
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 = DirichletBC
variable = disp_x
boundary = right
value = 0.01
[]
[]
[Functions]
[damage_evolution]
type = PiecewiseLinear
xy_data = '0.0 0.0
0.1 0.0
2.1 2.0'
[]
[]
[Materials]
[damage_index]
type = GenericFunctionMaterial
prop_names = damage_index_prop
prop_values = damage_evolution
[]
[damage]
type = ScalarMaterialDamage
damage_index = damage_index_prop
[]
[stress]
type = ComputeDamageStress
damage_model = damage
[]
[elasticity]
type = ComputeIsotropicElasticityTensor
poissons_ratio = 0.2
youngs_modulus = 10e9
[]
[]
[Postprocessors]
[stress_xx]
type = ElementAverageValue
variable = stress_xx
[]
[strain_xx]
type = ElementAverageValue
variable = strain_xx
[]
[damage_index]
type = ElementAverageValue
variable = damage_index
[]
[time_step_limit]
type = MaterialTimeStepPostprocessor
[]
[]
[Executioner]
type = Transient
l_max_its = 50
l_tol = 1e-8
nl_max_its = 20
nl_rel_tol = 1e-12
nl_abs_tol = 1e-8
dt = 0.1
dtmin = 0.001
end_time = 1.1
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.1
growth_factor = 2.0
cutback_factor = 0.5
timestep_limiting_postprocessor = time_step_limit
[]
[]
[Outputs]
csv=true
[]
(modules/porous_flow/examples/restart/gas_injection_new_mesh.i)
# Using the results from the equilibrium run to provide the initial condition for
# porepressure, we now inject a gas phase into the brine-saturated reservoir. In this
# example, the mesh is not identical to the mesh used in gravityeq.i. Rather, it is
# generated so that it is more refined near the injection boundary and at the top of
# the model, as that is where the gas plume will be present.
#
# To use the hydrostatic pressure calculated using the gravity equilibrium run as the initial
# condition for the pressure, a SolutionUserObject is used, along with a SolutionFunction to
# interpolate the pressure from the gravity equilibrium run to the initial condition for liqiud
# porepressure in this example.
#
# Even though the gravity equilibrium is established using a 2D mesh, in this example,
# we use a mesh shifted 0.1 m to the right and rotate it about the Y axis to make a 2D radial
# model.
#
# Methane injection takes place over the surface of the hole created by rotating the mesh,
# and hence the injection area is 2 pi r h. We can calculate this using an AreaPostprocessor,
# and then use this in a ParsedFunction to calculate the injection rate so that 10 kg/s of
# methane is injected.
#
# Note: as this example uses the results from a previous simulation, gravityeq.i MUST be
# run before running this input file.
[Mesh]
type = GeneratedMesh
dim = 2
ny = 25
nx = 50
ymax = 100
xmin = 0.1
xmax = 5000
bias_x = 1.05
bias_y = 0.95
coord_type = RZ
rz_coord_axis = Y
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 -9.81 0'
temperature_unit = Celsius
[]
[Variables]
[pp_liq]
[]
[sat_gas]
initial_condition = 0
[]
[]
[ICs]
[ppliq_ic]
type = FunctionIC
variable = pp_liq
function = ppliq_ic
[]
[]
[AuxVariables]
[temperature]
initial_condition = 50
[]
[xnacl]
initial_condition = 0.1
[]
[brine_density]
family = MONOMIAL
order = CONSTANT
[]
[methane_density]
family = MONOMIAL
order = CONSTANT
[]
[massfrac_ph0_sp0]
initial_condition = 1
[]
[massfrac_ph1_sp0]
initial_condition = 0
[]
[pp_gas]
family = MONOMIAL
order = CONSTANT
[]
[sat_liq]
family = MONOMIAL
order = CONSTANT
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
variable = pp_liq
[]
[flux0]
type = PorousFlowAdvectiveFlux
variable = pp_liq
[]
[mass1]
type = PorousFlowMassTimeDerivative
variable = sat_gas
fluid_component = 1
[]
[flux1]
type = PorousFlowAdvectiveFlux
variable = sat_gas
fluid_component = 1
[]
[]
[AuxKernels]
[brine_density]
type = PorousFlowPropertyAux
property = density
variable = brine_density
execute_on = 'initial timestep_end'
[]
[methane_density]
type = PorousFlowPropertyAux
property = density
variable = methane_density
phase = 1
execute_on = 'initial timestep_end'
[]
[pp_gas]
type = PorousFlowPropertyAux
property = pressure
phase = 1
variable = pp_gas
execute_on = 'initial timestep_end'
[]
[sat_liq]
type = PorousFlowPropertyAux
property = saturation
variable = sat_liq
execute_on = 'initial timestep_end'
[]
[]
[BCs]
[gas_injection]
type = PorousFlowSink
boundary = left
variable = sat_gas
flux_function = injection_rate
fluid_phase = 1
[]
[brine_out]
type = PorousFlowPiecewiseLinearSink
boundary = right
variable = pp_liq
multipliers = '0 1e9'
pt_vals = '0 1e9'
fluid_phase = 0
flux_function = 1e-6
use_mobility = true
use_relperm = true
mass_fraction_component = 0
[]
[]
[Functions]
[injection_rate]
type = ParsedFunction
symbol_values = injection_area
symbol_names = area
expression = '-1/area'
[]
[ppliq_ic]
type = SolutionFunction
solution = soln
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pp_liq sat_gas'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureVG
alpha = 1e-5
m = 0.5
sat_lr = 0.2
pc_max = 1e7
[]
[soln]
type = SolutionUserObject
mesh = gravityeq_out.e
system_variables = porepressure
[]
[]
[FluidProperties]
[brine]
type = BrineFluidProperties
[]
[methane]
type = MethaneFluidProperties
[]
[methane_tab]
type = TabulatedBicubicFluidProperties
fp = methane
save_file = false
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = temperature
[]
[ps]
type = PorousFlow2PhasePS
phase0_porepressure = pp_liq
phase1_saturation = sat_gas
capillary_pressure = pc
[]
[massfrac]
type = PorousFlowMassFraction
mass_fraction_vars = 'massfrac_ph0_sp0 massfrac_ph1_sp0'
[]
[brine]
type = PorousFlowBrine
compute_enthalpy = false
compute_internal_energy = false
xnacl = xnacl
phase = 0
[]
[methane]
type = PorousFlowSingleComponentFluid
compute_enthalpy = false
compute_internal_energy = false
fp = methane_tab
phase = 1
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.1
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-13 0 0 0 5e-14 0 0 0 1e-13'
[]
[relperm_liq]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
s_res = 0.2
sum_s_res = 0.3
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 1
s_res = 0.1
sum_s_res = 0.3
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = ' asm lu NONZERO'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 1e8
nl_abs_tol = 1e-12
nl_rel_tol = 1e-06
nl_max_its = 20
dtmax = 1e6
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e1
growth_factor = 1.5
[]
[]
[Postprocessors]
[mass_ph0]
type = PorousFlowFluidMass
fluid_component = 0
execute_on = 'initial timestep_end'
[]
[mass_ph1]
type = PorousFlowFluidMass
fluid_component = 1
execute_on = 'initial timestep_end'
[]
[injection_area]
type = AreaPostprocessor
boundary = left
execute_on = initial
[]
[]
[Outputs]
execute_on = 'initial timestep_end'
exodus = true
perf_graph = true
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/dirichlet_bcs_mdot.i)
rho = 'rho'
l = 10
inlet_area = 1
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 10
ny = 5
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = ${inlet_velocity}
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FVKernels]
[mass_time]
type = WCNSFVMassTimeDerivative
variable = pressure
drho_dt = drho_dt
[]
[mass]
type = WCNSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = u
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = v
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T
rho = rho
drho_dt = drho_dt
h = h
dh_dt = dh_dt
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T
v = power_density
[]
[]
[FVBCs]
# Inlet
[inlet_u]
type = WCNSFVInletVelocityBC
variable = u
boundary = 'left'
mdot_pp = 'inlet_mdot'
area_pp = 'surface_inlet'
rho = 'rho'
[]
[inlet_v]
type = WCNSFVInletVelocityBC
variable = v
boundary = 'left'
mdot_pp = 0
area_pp = 'surface_inlet'
rho = 'rho'
[]
[inlet_T]
type = WCNSFVInletTemperatureBC
variable = T
boundary = 'left'
temperature_pp = 'inlet_T'
[]
[outlet_p]
type = INSFVOutletPressureBC
variable = pressure
boundary = 'right'
function = ${outlet_pressure}
[]
# Walls
[no_slip_x]
type = INSFVNoSlipWallBC
variable = u
boundary = 'top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = v
boundary = 'top bottom'
function = 0
[]
[]
# used for the boundary conditions in this example
[Postprocessors]
[inlet_mdot]
type = Receiver
default = ${fparse 1980 * inlet_velocity * inlet_area}
[]
[surface_inlet]
type = AreaPostprocessor
boundary = 'left'
execute_on = 'INITIAL'
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T'
rho = ${rho}
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-2
optimal_iterations = 6
[]
end_time = 1
nl_abs_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
exodus = true
execute_on = 'FINAL'
[]
(modules/solid_mechanics/test/tests/ad_anisotropic_creep/anis_mech_hill_tensor_creep_small_tiny_step_ts_limit_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
second_order = true
[]
[GlobalParams]
displacements = 'disp_x disp_y'
volumetric_locking_correction = false
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = FINITE
add_variables = true
incremental = true
generate_output = 'elastic_strain_xx elastic_strain_yy elastic_strain_xy stress_xx stress_xy '
'stress_yy'
use_automatic_differentiation = true
[]
[]
[AuxVariables]
[hydrostatic_stress]
order = CONSTANT
family = MONOMIAL
[]
[creep_strain_xx]
order = CONSTANT
family = MONOMIAL
[]
[creep_strain_xy]
order = CONSTANT
family = MONOMIAL
[]
[creep_strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[]
[Variables]
[disp_x]
order = SECOND
[]
[disp_y]
order = SECOND
[]
[]
[AuxKernels]
[hydrostatic_stress]
type = ADRankTwoScalarAux
variable = hydrostatic_stress
rank_two_tensor = stress
scalar_type = Hydrostatic
[]
[creep_strain_xx]
type = ADRankTwoAux
rank_two_tensor = trial_creep_creep_strain
variable = creep_strain_xx
index_i = 0
index_j = 0
[]
[creep_strain_xy]
type = ADRankTwoAux
rank_two_tensor = trial_creep_creep_strain
variable = creep_strain_xy
index_i = 0
index_j = 1
[]
[creep_strain_yy]
type = ADRankTwoAux
rank_two_tensor = trial_creep_creep_strain
variable = creep_strain_yy
index_i = 1
index_j = 1
[]
[]
[Functions]
[pull]
type = PiecewiseLinear
x = '0 1e3 1e8'
y = '0 1e2 1e2'
[]
[]
[Materials]
[elasticity_tensor]
type = ADComputeElasticityTensor
fill_method = orthotropic
C_ijkl = '2.0e3 2.0e5 2.0e3 0.71428571e3 0.71428571e3 0.71428571e3 0.4 0.2 0.004 0.004 0.2 0.4'
[]
[elastic_strain]
type = ADComputeMultipleInelasticStress
inelastic_models = "trial_creep trial_creep_two"
max_iterations = 5
absolute_tolerance = 1e-05
[]
[hill_tensor]
type = ADHillConstants
# F G H L M N
hill_constants = "0.5 0.5 0.3866 1.6413 1.6413 1.2731"
base_name = trial_creep
[]
[trial_creep]
type = ADHillCreepStressUpdate
coefficient = 3e-18
n_exponent = 5
m_exponent = 0
activation_energy = 0
max_inelastic_increment = 1.0e-5
base_name = trial_creep
# Force it to not use integration error
max_integration_error = 1.0
[]
[hill_tensor_two]
type = ADHillConstants
# F G H L M N
hill_constants = "0.5 0.5 0.3866 1.6413 1.6413 1.2731"
base_name = trial_creep_two
[]
[trial_creep_two]
type = ADHillCreepStressUpdate
coefficient = 3e-18
n_exponent = 5
m_exponent = 0
activation_energy = 0
max_inelastic_increment = 1.0e-5
base_name = trial_creep_two
# Force it to not use integration error
max_integration_error = 1.0
[]
[]
[BCs]
[no_disp_x]
type = ADDirichletBC
variable = disp_x
boundary = bottom
value = 0.0
[]
[no_disp_y]
type = ADDirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[]
[Pressure]
[Side1]
boundary = top
function = pull
[]
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-ksp_gmres_restart -pc_type -sub_pc_type'
petsc_options_value = '101 asm lu'
line_search = 'none'
nl_rel_tol = 1e-10
nl_abs_tol = 1.0e-14
l_max_its = 90
num_steps = 7
start_time = 0
automatic_scaling = true
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 30
iteration_window = 9
growth_factor = 2.0
cutback_factor = 0.5
timestep_limiting_postprocessor = matl_ts_min
dt = 5.0e1
[]
[]
[Postprocessors]
[matl_ts_min]
type = MaterialTimeStepPostprocessor
[]
[max_disp_x]
type = ElementExtremeValue
variable = disp_x
[]
[max_disp_y]
type = ElementExtremeValue
variable = disp_y
[]
[max_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
[]
[dt]
type = TimestepSize
[]
[num_lin]
type = NumLinearIterations
outputs = console
[]
[num_nonlin]
type = NumNonlinearIterations
outputs = console
[]
[]
[Outputs]
csv = true
exodus = true
perf_graph = true
[]
(modules/thermal_hydraulics/test/tests/postprocessors/flow_junction_flux_1phase/flow_junction_flux_1phase.i)
# This input file tests mass conservation at steady-state by looking at the
# net mass flux into the domain.
T_in = 523.0
m_dot = 100
p_out = 7e6
[GlobalParams]
initial_p = ${p_out}
initial_vel = 1
initial_T = ${T_in}
gravity_vector = '0 0 0'
closures = simple_closures
n_elems = 3
f = 0
scaling_factor_1phase = '1 1 1e-5'
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[inlet_bc]
type = InletMassFlowRateTemperature1Phase
input = 'inlet:in'
m_dot = ${m_dot}
T = ${T_in}
[]
[inlet]
type = FlowChannel1Phase
fp = fp
position = '0 0 11'
orientation = '0 0 -1'
length = 1
A = 3
[]
[inlet_plenum]
type = VolumeJunction1Phase
position = '0 0 10'
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 1
connections = 'inlet:out channel1:in channel2:in'
volume = 1
scaling_factor_rhoEV = '1e-5'
[]
[channel1]
type = FlowChannel1Phase
fp = fp
position = '0 0 10'
orientation = '0 0 -1'
length = 10
A = 4
D_h = 1
[]
[K_bypass]
type = FormLossFromFunction1Phase
K_prime = 500
flow_channel = channel1
[]
[channel2]
type = FlowChannel1Phase
fp = fp
position = '0 0 10'
orientation = '0 0 -1'
length = 10
A = 1
D_h = 1
[]
[outlet_plenum]
type = VolumeJunction1Phase
position = '0 0 0'
initial_vel_x = 1
initial_vel_y = 0
initial_vel_z = 1
connections = 'channel1:out channel2:out outlet:in'
volume = 1
scaling_factor_rhoEV = '1e-5'
[]
[outlet]
type = FlowChannel1Phase
fp = fp
position = '0 0 0'
orientation = '0 0 -1'
length = 1
A = 1
[]
[outlet_bc]
type = Outlet1Phase
p = ${p_out}
input = 'outlet:out'
[]
[]
[Postprocessors]
[inlet_in_m_dot]
type = ADFlowBoundaryFlux1Phase
boundary = 'inlet_bc'
equation = mass
[]
[inlet_out_m_dot]
type = ADFlowJunctionFlux1Phase
boundary = 'inlet:out'
connection_index = 0
junction = inlet_plenum
equation = mass
[]
[channel1_in_m_dot]
type = ADFlowJunctionFlux1Phase
boundary = 'channel1:in'
connection_index = 1
junction = inlet_plenum
equation = mass
[]
[channel1_out_m_dot]
type = ADFlowJunctionFlux1Phase
boundary = 'channel1:out'
connection_index = 0
junction = outlet_plenum
equation = mass
[]
[channel2_in_m_dot]
type = ADFlowJunctionFlux1Phase
boundary = 'channel2:in'
connection_index = 2
junction = inlet_plenum
equation = mass
[]
[channel2_out_m_dot]
type = ADFlowJunctionFlux1Phase
boundary = 'channel2:out'
connection_index = 1
junction = outlet_plenum
equation = mass
[]
[outlet_in_m_dot]
type = ADFlowJunctionFlux1Phase
boundary = 'outlet:in'
connection_index = 2
junction = outlet_plenum
equation = mass
[]
[outlet_out_m_dot]
type = ADFlowBoundaryFlux1Phase
boundary = 'outlet_bc'
equation = mass
[]
[net_mass_flow_rate_domain]
type = LinearCombinationPostprocessor
pp_names = 'inlet_in_m_dot outlet_out_m_dot'
pp_coefs = '1 -1'
[]
[net_mass_flow_rate_volume_junction]
type = LinearCombinationPostprocessor
pp_names = 'inlet_out_m_dot channel1_in_m_dot channel2_in_m_dot'
pp_coefs = '1 -1 -1'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
start_time = 0
end_time = 10000
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.01
optimal_iterations = 8
iteration_window = 2
[]
timestep_tolerance = 1e-6
abort_on_solve_fail = true
line_search = none
nl_rel_tol = 1e-8
nl_abs_tol = 2e-8
nl_max_its = 25
l_tol = 1e-3
l_max_its = 5
petsc_options = '-snes_converged_reason'
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu '
[]
[Outputs]
[out]
type = CSV
execute_on = 'FINAL'
show = 'net_mass_flow_rate_domain net_mass_flow_rate_volume_junction'
[]
[]
(modules/porous_flow/test/tests/gravity/grav02f.i)
# Checking that gravity head is established in the transient situation when 0<=saturation<=1 (note the less-than-or-equal-to).
# 2phase (PS), 2components, van Genuchten capillary pressure, constant fluid bulk-moduli for each phase, constant viscosity,
# constant permeability, Corey relative permeabilities with residual saturation
[Mesh]
type = GeneratedMesh
dim = 2
ny = 10
ymax = 100
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 -10 0'
[]
[Variables]
[ppwater]
initial_condition = 1.5e6
[]
[sgas]
initial_condition = 0.3
[]
[]
[AuxVariables]
[massfrac_ph0_sp0]
initial_condition = 1
[]
[massfrac_ph1_sp0]
initial_condition = 0
[]
[ppgas]
family = MONOMIAL
order = CONSTANT
[]
[swater]
family = MONOMIAL
order = CONSTANT
[]
[relpermwater]
family = MONOMIAL
order = CONSTANT
[]
[relpermgas]
family = MONOMIAL
order = CONSTANT
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = ppwater
[]
[flux0]
type = PorousFlowAdvectiveFlux
fluid_component = 0
variable = ppwater
[]
[mass1]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = sgas
[]
[flux1]
type = PorousFlowAdvectiveFlux
fluid_component = 1
variable = sgas
[]
[]
[AuxKernels]
[ppgas]
type = PorousFlowPropertyAux
property = pressure
phase = 1
variable = ppgas
[]
[swater]
type = PorousFlowPropertyAux
property = saturation
phase = 0
variable = swater
[]
[relpermwater]
type = MaterialStdVectorAux
property = PorousFlow_relative_permeability_qp
index = 0
variable = relpermwater
[]
[relpermgas]
type = PorousFlowPropertyAux
property = relperm
phase = 1
variable = relpermgas
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'ppwater sgas'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureVG
m = 0.5
alpha = 1e-4
pc_max = 2e5
[]
[]
[FluidProperties]
[simple_fluid0]
type = SimpleFluidProperties
bulk_modulus = 2e9
density0 = 1000
viscosity = 1e-3
thermal_expansion = 0
[]
[simple_fluid1]
type = SimpleFluidProperties
bulk_modulus = 2e9
density0 = 10
viscosity = 1e-5
thermal_expansion = 0
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
[]
[ppss]
type = PorousFlow2PhasePS
phase0_porepressure = ppwater
phase1_saturation = sgas
capillary_pressure = pc
[]
[massfrac]
type = PorousFlowMassFraction
mass_fraction_vars = 'massfrac_ph0_sp0 massfrac_ph1_sp0'
[]
[simple_fluid0]
type = PorousFlowSingleComponentFluid
fp = simple_fluid0
phase = 0
[]
[simple_fluid1]
type = PorousFlowSingleComponentFluid
fp = simple_fluid1
phase = 1
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.1
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-11 0 0 0 1e-11 0 0 0 1e-11'
[]
[relperm_water]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
s_res = 0.25
sum_s_res = 0.35
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 1
s_res = 0.1
sum_s_res = 0.35
[]
[]
[Postprocessors]
[mass_ph0]
type = PorousFlowFluidMass
fluid_component = 0
execute_on = 'initial timestep_end'
[]
[mass_ph1]
type = PorousFlowFluidMass
fluid_component = 1
execute_on = 'initial timestep_end'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -snes_stol -snes_max_it'
petsc_options_value = 'bcgs bjacobi 1E-13 15'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 1e5
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e4
[]
[]
[Outputs]
execute_on = 'initial timestep_end'
file_base = grav02f
exodus = true
perf_graph = true
csv = false
[]
(modules/thermal_hydraulics/test/tests/postprocessors/specific_impulse_1phase/Isp_1ph.i)
[GlobalParams]
gravity_vector = '0 0 0'
initial_p = 6e6
initial_T = 600
initial_vel = 0
scaling_factor_1phase = '1 1 1e-5'
closures = simple_closures
[]
[FluidProperties]
[eos]
type = IdealGasFluidProperties
gamma = 1.3066
molar_mass = 2.016e-3
k = 0.437
mu = 3e-5
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[pipe1]
type = FlowChannel1Phase
fp = eos
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 10
A = 0.1
f = 0.
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
m_dot = 0.1
T = 800
input = 'pipe1:in'
[]
[outlet]
type = Outlet1Phase
input = 'pipe1:out'
p = 6e6
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.01
growth_factor = 1.4
optimal_iterations = 6
iteration_window = 2
[]
start_time = 0.0
end_time = 100
abort_on_solve_fail = true
solve_type = 'NEWTON'
line_search = 'basic'
nl_rel_tol = 1e-6
nl_abs_tol = 1e-6
nl_max_its = 10
l_tol = 1e-3
l_max_its = 10
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Postprocessors]
# hand calcs show that Isp should start at 274.3 at 600 K
# and rise to 316.7 at 800 K.
[Isp]
type = ADSpecificImpulse1Phase
p_exit = 1e6
fp = eos
boundary = outlet
[]
[Isp_inst]
type = ADSpecificImpulse1Phase
p_exit = 1e6
fp = eos
cumulative = false
boundary = outlet
[]
[outletT]
type = SideAverageValue
variable = T
boundary = pipe1:out
[]
[]
[Outputs]
[out]
type = CSV
show = 'Isp Isp_inst'
execute_on = 'INITIAL FINAL'
[]
[]
(modules/porous_flow/examples/restart/gas_injection.i)
# Using the results from the equilibrium run to provide the initial condition for
# porepressure, we now inject a gas phase into the brine-saturated reservoir. In this
# example, where the mesh used is identical to the mesh used in gravityeq.i, we can use
# the basic restart capability by simply setting the initial condition for porepressure
# using the results from gravityeq.i.
#
# Even though the gravity equilibrium is established using a 2D mesh, in this example,
# we shift the mesh 0.1 m to the right and rotate it about the Y axis to make a 2D radial
# model.
#
# Methane injection takes place over the surface of the hole created by rotating the mesh,
# and hence the injection area is 2 pi r h. We can calculate this using an AreaPostprocessor,
# and then use this in a ParsedFunction to calculate the injection rate so that 10 kg/s of
# methane is injected.
#
# Results can be improved by uniformly refining the initial mesh.
#
# Note: as this example uses the results from a previous simulation, gravityeq.i MUST be
# run before running this input file.
[Mesh]
uniform_refine = 1
[file]
type = FileMeshGenerator
file = gravityeq_out.e
[]
[translate]
type = TransformGenerator
transform = TRANSLATE
vector_value = '0.1 0 0'
input = file
[]
coord_type = RZ
rz_coord_axis = Y
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 -9.81 0'
temperature_unit = Celsius
[]
[Variables]
[pp_liq]
initial_from_file_var = porepressure
[]
[sat_gas]
initial_condition = 0
[]
[]
[AuxVariables]
[temperature]
initial_condition = 50
[]
[xnacl]
initial_condition = 0.1
[]
[brine_density]
family = MONOMIAL
order = CONSTANT
[]
[methane_density]
family = MONOMIAL
order = CONSTANT
[]
[massfrac_ph0_sp0]
initial_condition = 1
[]
[massfrac_ph1_sp0]
initial_condition = 0
[]
[pp_gas]
family = MONOMIAL
order = CONSTANT
[]
[sat_liq]
family = MONOMIAL
order = CONSTANT
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
variable = pp_liq
[]
[flux0]
type = PorousFlowAdvectiveFlux
variable = pp_liq
[]
[mass1]
type = PorousFlowMassTimeDerivative
variable = sat_gas
fluid_component = 1
[]
[flux1]
type = PorousFlowAdvectiveFlux
variable = sat_gas
fluid_component = 1
[]
[]
[AuxKernels]
[brine_density]
type = PorousFlowPropertyAux
property = density
variable = brine_density
execute_on = 'initial timestep_end'
[]
[methane_density]
type = PorousFlowPropertyAux
property = density
variable = methane_density
phase = 1
execute_on = 'initial timestep_end'
[]
[pp_gas]
type = PorousFlowPropertyAux
property = pressure
phase = 1
variable = pp_gas
execute_on = 'initial timestep_end'
[]
[sat_liq]
type = PorousFlowPropertyAux
property = saturation
variable = sat_liq
execute_on = 'initial timestep_end'
[]
[]
[BCs]
[gas_injection]
type = PorousFlowSink
boundary = left
variable = sat_gas
flux_function = injection_rate
fluid_phase = 1
[]
[brine_out]
type = PorousFlowPiecewiseLinearSink
boundary = right
variable = pp_liq
multipliers = '0 1e9'
pt_vals = '0 1e9'
fluid_phase = 0
flux_function = 1e-6
use_mobility = true
[]
[]
[Functions]
[injection_rate]
type = ParsedFunction
symbol_values = injection_area
symbol_names = area
expression = '-10/area'
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pp_liq sat_gas'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureVG
alpha = 1e-5
m = 0.5
sat_lr = 0.2
[]
[]
[FluidProperties]
[brine]
type = BrineFluidProperties
[]
[methane]
type = MethaneFluidProperties
[]
[methane_tab]
type = TabulatedBicubicFluidProperties
fp = methane
save_file = false
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = temperature
[]
[ps]
type = PorousFlow2PhasePS
phase0_porepressure = pp_liq
phase1_saturation = sat_gas
capillary_pressure = pc
[]
[massfrac]
type = PorousFlowMassFraction
mass_fraction_vars = 'massfrac_ph0_sp0 massfrac_ph1_sp0'
[]
[brine]
type = PorousFlowBrine
compute_enthalpy = false
compute_internal_energy = false
xnacl = xnacl
phase = 0
[]
[methane]
type = PorousFlowSingleComponentFluid
compute_enthalpy = false
compute_internal_energy = false
fp = methane_tab
phase = 1
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.1
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-13 0 0 0 1e-13 0 0 0 1e-13'
[]
[relperm_liq]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
s_res = 0.2
sum_s_res = 0.3
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 1
s_res = 0.1
sum_s_res = 0.3
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = ' asm lu NONZERO'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 1e8
nl_abs_tol = 1e-12
nl_rel_tol = 1e-06
nl_max_its = 20
dtmax = 1e6
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e1
[]
[]
[Postprocessors]
[mass_ph0]
type = PorousFlowFluidMass
fluid_component = 0
execute_on = 'initial timestep_end'
[]
[mass_ph1]
type = PorousFlowFluidMass
fluid_component = 1
execute_on = 'initial timestep_end'
[]
[injection_area]
type = AreaPostprocessor
boundary = left
execute_on = initial
[]
[]
[Outputs]
execute_on = 'initial timestep_end'
exodus = true
perf_graph = true
checkpoint = true
[]
(modules/thermal_hydraulics/tutorials/single_phase_flow/02_core.i)
T_in = 300. # K
m_dot_in = 1e-2 # kg/s
press = 10e5 # Pa
# core parameters
core_length = 1. # m
core_n_elems = 25
core_dia = '${units 2. cm -> m}'
core_pitch = '${units 8.7 cm -> m}'
A_core = '${fparse core_pitch^2 - 0.25 *pi * core_dia^2}'
P_wet_core = '${fparse 4*core_pitch + pi * core_dia}'
Dh_core = '${fparse 4 * A_core / P_wet_core}'
tot_power = 2000 # W
[GlobalParams]
initial_p = ${press}
initial_vel = 0.0001
initial_T = ${T_in}
gravity_vector = '0 0 0'
rdg_slope_reconstruction = minmod
scaling_factor_1phase = '1 1e-2 1e-4'
closures = thm_closures
fp = he
[]
[FluidProperties]
[he]
type = IdealGasFluidProperties
molar_mass = 4e-3
gamma = 1.67
k = 0.2556
mu = 3.22639e-5
[]
[]
[Closures]
[thm_closures]
type = Closures1PhaseTHM
[]
[]
[SolidProperties]
[steel]
type = ThermalFunctionSolidProperties
rho = 8050
k = 45
cp = 466
[]
[]
[Components]
[total_power]
type = TotalPower
power = ${tot_power}
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'core_chan:in'
m_dot = ${m_dot_in}
T = ${T_in}
[]
[core_chan]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 1'
length = ${core_length}
n_elems = ${core_n_elems}
roughness = .0001
A = '${A_core}'
D_h = ${Dh_core}
[]
[core_hs]
type = HeatStructureCylindrical
position = '0 0 0'
orientation = '0 0 1'
length = ${core_length}
n_elems = ${core_n_elems}
names = 'block'
widths = '${fparse core_dia / 2.}'
solid_properties = 'steel'
solid_properties_T_ref = '300'
n_part_elems = 3
[]
[core_heating]
type = HeatSourceFromTotalPower
hs = core_hs
regions = block
power = total_power
[]
[core_ht]
type = HeatTransferFromHeatStructure1Phase
flow_channel = core_chan
hs = core_hs
hs_side = outer
P_hf = '${fparse pi * core_dia}'
[]
[outlet]
type = Outlet1Phase
input = 'core_chan:out'
p = ${press}
[]
[]
[Postprocessors]
[power_to_coolant]
type = ADHeatRateConvection1Phase
block = core_chan
P_hf = '${fparse pi *core_dia}'
[]
[core_T_out]
type = SideAverageValue
boundary = core_chan:out
variable = T
[]
[core_p_in]
type = SideAverageValue
boundary = core_chan:in
variable = p
[]
[core_p_out]
type = SideAverageValue
boundary = core_chan:out
variable = p
[]
[core_delta_p]
type = ParsedPostprocessor
pp_names = 'core_p_in core_p_out'
function = 'core_p_in - core_p_out'
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
start_time = 0
[TimeStepper]
type = IterationAdaptiveDT
dt = 10
[]
end_time = 5000
line_search = basic
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
nl_max_its = 25
[]
[Outputs]
exodus = true
[console]
type = Console
max_rows = 1
outlier_variable_norms = false
[]
print_linear_residuals = false
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/channel-flow/2d-transient.i)
rho = 'rho'
l = 10
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_v = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 20
ny = 10
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = ${inlet_v}
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T_fluid]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[]
[AuxVariables]
[mixing_length]
type = MooseVariableFVReal
[]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FVKernels]
inactive = 'u_turb v_turb temp_turb'
[mass_time]
type = WCNSFVMassTimeDerivative
variable = pressure
drho_dt = drho_dt
[]
[mass]
type = WCNSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = vel_x
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[u_turb]
type = INSFVMixingLengthReynoldsStress
variable = vel_x
rho = ${rho}
mixing_length = 'mixing_length'
momentum_component = 'x'
u = vel_x
v = vel_y
[]
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = vel_y
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
momentum_component = 'y'
mu = ${mu}
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[v_turb]
type = INSFVMixingLengthReynoldsStress
variable = vel_y
rho = ${rho}
mixing_length = 'mixing_length'
momentum_component = 'y'
u = vel_x
v = vel_y
[]
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T_fluid
rho = rho
drho_dt = drho_dt
h = h
dh_dt = dh_dt
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T_fluid
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T_fluid
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T_fluid
v = power_density
[]
[temp_turb]
type = WCNSFVMixingLengthEnergyDiffusion
variable = T_fluid
rho = rho
cp = cp
mixing_length = 'mixing_length'
schmidt_number = 1
u = vel_x
v = vel_y
[]
[]
[FVBCs]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'top bottom'
function = 0
[]
# Inlet
[inlet_u]
type = INSFVInletVelocityBC
variable = vel_x
boundary = 'left'
function = ${inlet_v}
[]
[inlet_v]
type = INSFVInletVelocityBC
variable = vel_y
boundary = 'left'
function = 0
[]
[inlet_T]
type = FVDirichletBC
variable = T_fluid
boundary = 'left'
value = ${inlet_temp}
[]
[outlet_p]
type = INSFVOutletPressureBC
variable = pressure
boundary = 'right'
function = ${outlet_pressure}
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T_fluid
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T_fluid'
rho = ${rho}
[]
[]
[AuxKernels]
inactive = 'mixing_len'
[mixing_len]
type = WallDistanceMixingLengthAux
walls = 'top'
variable = mixing_length
execute_on = 'initial'
delta = 0.5
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-3
optimal_iterations = 6
[]
end_time = 15
nl_abs_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
off_diagonals_in_auto_scaling = true
compute_scaling_once = false
[]
[Outputs]
exodus = true
[]
(test/tests/time_steppers/iteration_adaptive/adapt_tstep_grow_dtfunc.i)
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Variables]
[u]
[]
[]
[Kernels]
[dt]
type = TimeDerivative
variable = u
[]
[]
[Executioner]
type = Transient
end_time = 20.0
verbose = true
[TimeStepper]
type = IterationAdaptiveDT
dt = 1.0
optimal_iterations = 10
time_t = '0.0 5.0'
time_dt = '1.0 5.0'
[]
[]
[Postprocessors]
[_dt]
type = TimestepSize
[]
[]
[Outputs]
csv = true
[ckp]
type = Checkpoint
num_files = 3
[]
[]
(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/multiapps/picard/picard_adaptive_parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
parallel_type = replicated
[]
[Variables]
[u]
[]
[]
[AuxVariables]
[v]
[]
[]
[Kernels]
[diff]
type = CoefDiffusion
variable = u
coef = 0.1
[]
[time]
type = TimeDerivative
variable = u
[]
[force_u]
type = CoupledForce
variable = u
v = v
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Postprocessors]
[picard_its]
type = NumFixedPointIterations
execute_on = 'initial timestep_end'
[]
[]
[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'
fixed_point_max_its = 30
nl_abs_tol = 1e-14
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.1
# cutback_factor, growth_factor, optimal_iterations, time_dt and time_t added through CLI args
[]
[]
[Outputs]
exodus = true
[]
[MultiApps]
[sub]
type = TransientMultiApp
app_type = MooseTestApp
positions = '0 0 0'
input_files = picard_adaptive_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/phase_field/examples/anisotropic_interfaces/GrandPotentialTwophaseAnisotropy.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmin = -4
xmax = 4
ymin = -4
ymax = 4
uniform_refine = 2
[]
[GlobalParams]
radius = 0.5
int_width = 0.3
x1 = 0
y1 = 0
derivative_order = 2
[]
[Variables]
[./w]
[../]
[./etaa0]
[../]
[./etab0]
[../]
[]
[AuxVariables]
[./bnds]
[../]
[]
[AuxKernels]
[./bnds]
type = BndsCalcAux
variable = bnds
v = 'etaa0 etab0'
[../]
[]
[ICs]
[./w]
type = SmoothCircleIC
variable = w
# note w = A*(c-cleq), A = 1.0, cleq = 0.0 ,i.e., w = c (in the matrix/liquid phase)
outvalue = -4.0
invalue = 0.0
[../]
[./etaa0]
type = SmoothCircleIC
variable = etaa0
#Solid phase
outvalue = 0.0
invalue = 1.0
[../]
[./etab0]
type = SmoothCircleIC
variable = etab0
#Liquid phase
outvalue = 1.0
invalue = 0.0
[../]
[]
[BCs]
[./Periodic]
[./w]
variable = w
auto_direction = 'x y'
[../]
[./etaa0]
variable = etaa0
auto_direction = 'x y'
[../]
[./etab0]
variable = etab0
auto_direction = 'x y'
[../]
[../]
[]
[Kernels]
# Order parameter eta_alpha0
[./ACa0_bulk]
type = ACGrGrMulti
variable = etaa0
v = 'etab0'
gamma_names = 'gab'
[../]
[./ACa0_sw]
type = ACSwitching
variable = etaa0
Fj_names = 'omegaa omegab'
hj_names = 'ha hb'
coupled_variables = 'etab0 w'
[../]
[./ACa0_int1]
type = ACInterface2DMultiPhase1
variable = etaa0
etas = 'etab0'
kappa_name = kappaa
dkappadgrad_etaa_name = dkappadgrad_etaa
d2kappadgrad_etaa_name = d2kappadgrad_etaa
[../]
[./ACa0_int2]
type = ACInterface2DMultiPhase2
variable = etaa0
kappa_name = kappaa
dkappadgrad_etaa_name = dkappadgrad_etaa
[../]
[./ea0_dot]
type = TimeDerivative
variable = etaa0
[../]
# Order parameter eta_beta0
[./ACb0_bulk]
type = ACGrGrMulti
variable = etab0
v = 'etaa0'
gamma_names = 'gab'
[../]
[./ACb0_sw]
type = ACSwitching
variable = etab0
Fj_names = 'omegaa omegab'
hj_names = 'ha hb'
coupled_variables = 'etaa0 w'
[../]
[./ACb0_int1]
type = ACInterface2DMultiPhase1
variable = etab0
etas = 'etaa0'
kappa_name = kappab
dkappadgrad_etaa_name = dkappadgrad_etab
d2kappadgrad_etaa_name = d2kappadgrad_etab
[../]
[./ACb0_int2]
type = ACInterface2DMultiPhase2
variable = etab0
kappa_name = kappab
dkappadgrad_etaa_name = dkappadgrad_etab
[../]
[./eb0_dot]
type = TimeDerivative
variable = etab0
[../]
#Chemical potential
[./w_dot]
type = SusceptibilityTimeDerivative
variable = w
f_name = chi
[../]
[./Diffusion]
type = MatDiffusion
variable = w
diffusivity = Dchi
[../]
[./coupled_etaa0dot]
type = CoupledSwitchingTimeDerivative
variable = w
v = etaa0
Fj_names = 'rhoa rhob'
hj_names = 'ha hb'
coupled_variables = 'etaa0 etab0'
[../]
[./coupled_etab0dot]
type = CoupledSwitchingTimeDerivative
variable = w
v = etab0
Fj_names = 'rhoa rhob'
hj_names = 'ha hb'
coupled_variables = 'etaa0 etab0'
[../]
[]
[Materials]
[./ha]
type = SwitchingFunctionMultiPhaseMaterial
h_name = ha
all_etas = 'etaa0 etab0'
phase_etas = 'etaa0'
[../]
[./hb]
type = SwitchingFunctionMultiPhaseMaterial
h_name = hb
all_etas = 'etaa0 etab0'
phase_etas = 'etab0'
[../]
[./omegaa]
type = DerivativeParsedMaterial
coupled_variables = 'w'
property_name = omegaa
material_property_names = 'Vm ka caeq'
expression = '-0.5*w^2/Vm^2/ka-w/Vm*caeq'
[../]
[./omegab]
type = DerivativeParsedMaterial
coupled_variables = 'w'
property_name = omegab
material_property_names = 'Vm kb cbeq'
expression = '-0.5*w^2/Vm^2/kb-w/Vm*cbeq'
[../]
[./rhoa]
type = DerivativeParsedMaterial
coupled_variables = 'w'
property_name = rhoa
material_property_names = 'Vm ka caeq'
expression = 'w/Vm^2/ka + caeq/Vm'
[../]
[./rhob]
type = DerivativeParsedMaterial
coupled_variables = 'w'
property_name = rhob
material_property_names = 'Vm kb cbeq'
expression = 'w/Vm^2/kb + cbeq/Vm'
[../]
[./kappaa]
type = InterfaceOrientationMultiphaseMaterial
kappa_name = kappaa
dkappadgrad_etaa_name = dkappadgrad_etaa
d2kappadgrad_etaa_name = d2kappadgrad_etaa
etaa = etaa0
etab = etab0
outputs = exodus
output_properties = 'kappaa'
[../]
[./kappab]
type = InterfaceOrientationMultiphaseMaterial
kappa_name = kappab
dkappadgrad_etaa_name = dkappadgrad_etab
d2kappadgrad_etaa_name = d2kappadgrad_etab
etaa = etab0
etab = etaa0
outputs = exodus
output_properties = 'kappab'
[../]
[./const]
type = GenericConstantMaterial
prop_names = 'L D chi Vm ka caeq kb cbeq gab mu'
prop_values = '1.0 1.0 0.1 1.0 10.0 0.1 10.0 0.9 4.5 10.0'
[../]
[./Mobility]
type = ParsedMaterial
property_name = Dchi
material_property_names = 'D chi'
expression = 'D*chi'
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart'
petsc_options_value = 'hypre boomeramg 31'
l_tol = 1.0e-3
l_max_its = 30
nl_max_its = 15
nl_rel_tol = 1.0e-8
nl_abs_tol = 1e-8
end_time = 10.0
[./TimeStepper]
type = IterationAdaptiveDT
dt = 0.0005
cutback_factor = 0.7
growth_factor = 1.2
[../]
[]
[Adaptivity]
initial_steps = 5
max_h_level = 3
initial_marker = err_eta
marker = err_bnds
[./Markers]
[./err_eta]
type = ErrorFractionMarker
coarsen = 0.3
refine = 0.95
indicator = ind_eta
[../]
[./err_bnds]
type = ErrorFractionMarker
coarsen = 0.3
refine = 0.95
indicator = ind_bnds
[../]
[../]
[./Indicators]
[./ind_eta]
type = GradientJumpIndicator
variable = etaa0
[../]
[./ind_bnds]
type = GradientJumpIndicator
variable = bnds
[../]
[../]
[]
[Outputs]
time_step_interval = 10
exodus = 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
[]
(modules/solid_mechanics/test/tests/rom_stress_update/creep_ramp_sub_false_more_steps.i)
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 1
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[AuxVariables]
[temperature]
initial_condition = 889
[]
[effective_inelastic_strain]
order = FIRST
family = MONOMIAL
[]
[cell_dislocations]
order = FIRST
family = MONOMIAL
[]
[wall_dislocations]
order = FIRST
family = MONOMIAL
[]
[number_of_substeps]
order = FIRST
family = MONOMIAL
[]
[]
[AuxKernels]
[effective_inelastic_strain]
type = MaterialRealAux
variable = effective_inelastic_strain
property = effective_creep_strain
[]
[cell_dislocations]
type = MaterialRealAux
variable = cell_dislocations
property = cell_dislocations
[]
[wall_dislocations]
type = MaterialRealAux
variable = wall_dislocations
property = wall_dislocations
[]
[number_of_substeps]
type = MaterialRealAux
variable = number_of_substeps
property = number_of_substeps
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = FINITE
add_variables = true
generate_output = 'vonmises_stress'
[]
[]
[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
[]
[pressure_x]
type = Pressure
variable = disp_x
boundary = right
factor = -0.5
function = shear_function
[]
[pressure_y]
type = Pressure
variable = disp_y
boundary = top
factor = -0.5
function = shear_function
[]
[pressure_z]
type = Pressure
variable = disp_z
boundary = front
factor = 0.5
function = shear_function
[]
[]
[Functions]
[shear_function]
type = ParsedFunction
expression = 'timeToDoubleInHours := 10;
if(t<=28*60*60, 15.0e6, 15.0e6*(t-28*3600)/3600/timeToDoubleInHours+15.0e6)'
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1.68e11
poissons_ratio = 0.31
[]
[stress]
type = ComputeMultipleInelasticStress
inelastic_models = rom_stress_prediction
[]
[mx_phase_fraction]
type = GenericConstantMaterial
prop_names = mx_phase_fraction
prop_values = 5.13e-2 #precipitation bounds: 6e-3, 1e-1
outputs = all
[]
[rom_stress_prediction]
type = SS316HLAROMANCEStressUpdateTest
temperature = temperature
initial_cell_dislocation_density = 6.0e12
initial_wall_dislocation_density = 4.4e11
use_substepping = NONE
max_inelastic_increment = 0.0001
stress_input_window_low_failure = WARN
stress_input_window_high_failure = ERROR
cell_input_window_high_failure = ERROR
cell_input_window_low_failure = ERROR
wall_input_window_low_failure = ERROR
wall_input_window_high_failure = ERROR
temperature_input_window_high_failure = ERROR
temperature_input_window_low_failure = ERROR
environment_input_window_high_failure = ERROR
environment_input_window_low_failure = ERROR
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
nl_abs_tol = 1e-12
nl_rel_tol = 1e-4
automatic_scaling = true
compute_scaling_once = false
dtmin = 0.1
dtmax = 1e3
end_time = 136800
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.1 ## This model requires a tiny timestep at the onset for the first 10s
iteration_window = 4
optimal_iterations = 12
time_t = '100800'
time_dt = '1e3'
[]
[]
[Postprocessors]
[effective_strain_avg]
type = ElementAverageValue
variable = effective_inelastic_strain
[]
[temperature]
type = ElementAverageValue
variable = temperature
[]
[cell_dislocations]
type = ElementAverageValue
variable = cell_dislocations
[]
[wall_disloactions]
type = ElementAverageValue
variable = wall_dislocations
[]
[max_vonmises_stress]
type = ElementExtremeValue
variable = vonmises_stress
value_type = max
[]
[number_of_substeps]
type = ElementAverageValue
variable = number_of_substeps
[]
[]
[Outputs]
csv = true
[]
(modules/solid_mechanics/test/tests/ad_2D_geometries/2D-RZ_test.i)
# Considers the mechanics solution for a thick spherical shell that is uniformly
# pressurized on the inner and outer surfaces, using 2D axisymmetric geometry.
# This test uses the strain calculators ComputeAxisymmetricRZSmallStrain
# and ComputeAxisymmetricRZIncrementalStrain which are generated by the
# SolidMechanics QuasiStatic Physics depending on the cli_args given in the tests file.
#
# From Roark (Formulas for Stress and Strain, McGraw-Hill, 1975), the radially-dependent
# circumferential stress in a uniformly pressurized thick spherical shell is given by:
#
# S(r) = [ Pi[ri^3(2r^3+ro^3)] - Po[ro^3(2r^3+ri^3)] ] / [2r^3(ro^3-ri^3)]
#
# where:
# Pi = inner pressure
# Po = outer pressure
# ri = inner radius
# ro = outer radius
#
# The tests assume an inner and outer radii of 5 and 10, with internal and external
# pressures of 100000 and 200000, respectively. The resulting compressive tangential
# stress is largest at the inner wall and, from the above equation, has a value
# of -271429.
[Mesh]
file = 2D-RZ_mesh.e
[]
[GlobalParams]
displacements = 'disp_r disp_z'
[]
[Problem]
coord_type = RZ
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = SMALL
add_variables = true
generate_output = 'stress_zz'
use_automatic_differentiation = true
[]
[]
[Materials]
[elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 1e10
poissons_ratio = 0.345
[]
[stress]
[]
[]
[BCs]
# pin particle along symmetry planes
[no_disp_r]
type = DirichletBC
variable = disp_r
boundary = xzero
value = 0.0
[]
[no_disp_z]
type = DirichletBC
variable = disp_z
boundary = yzero
value = 0.0
[]
# exterior and internal pressures
[exterior_pressure_r]
type = ADPressure
variable = disp_r
boundary = outer
factor = 200000
[]
[exterior_pressure_z]
type = ADPressure
variable = disp_z
boundary = outer
factor = 200000
[]
[interior_pressure_r]
type = ADPressure
variable = disp_r
boundary = inner
factor = 100000
[]
[interior_pressure_z]
type = ADPressure
variable = disp_z
boundary = inner
factor = 100000
[]
[]
[Debug]
show_var_residual_norms = true
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
petsc_options_value = ' 201 hypre boomeramg 10'
line_search = 'none'
#Preconditioned JFNK (default)
solve_type = 'PJFNK'
nl_rel_tol = 5e-9
nl_abs_tol = 1e-10
nl_max_its = 15
l_tol = 1e-3
l_max_its = 50
start_time = 0.0
end_time = 1
# num_steps = 1000
dtmax = 5e6
dtmin = 1
[TimeStepper]
type = IterationAdaptiveDT
dt = 1
optimal_iterations = 6
iteration_window = 0
linear_iteration_ratio = 100
[]
[Predictor]
type = SimplePredictor
scale = 1.0
[]
[]
[Postprocessors]
[dt]
type = TimestepSize
[]
[]
[Outputs]
exodus = true
[]
(modules/porous_flow/examples/thm_example/2D.i)
# Two phase, temperature-dependent, with mechanics, radial with fine mesh, constant injection of cold co2 into a overburden-reservoir-underburden containing mostly water
# species=0 is water
# species=1 is co2
# phase=0 is liquid, and since massfrac_ph0_sp0 = 1, this is all water
# phase=1 is gas, and since massfrac_ph1_sp0 = 0, this is all co2
#
# The mesh used below has very high resolution, so the simulation takes a long time to complete.
# Some suggested meshes of different resolution:
# nx=50, bias_x=1.2
# nx=100, bias_x=1.1
# nx=200, bias_x=1.05
# nx=400, bias_x=1.02
# nx=1000, bias_x=1.01
# nx=2000, bias_x=1.003
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2000
bias_x = 1.003
xmin = 0.1
xmax = 5000
ny = 1
ymin = 0
ymax = 11
[]
[Problem]
coord_type = RZ
[]
[GlobalParams]
displacements = 'disp_r disp_z'
PorousFlowDictator = dictator
gravity = '0 0 0'
biot_coefficient = 1.0
[]
[Variables]
[pwater]
initial_condition = 18.3e6
[]
[sgas]
initial_condition = 0.0
[]
[temp]
initial_condition = 358
[]
[disp_r]
[]
[]
[AuxVariables]
[rate]
[]
[disp_z]
[]
[massfrac_ph0_sp0]
initial_condition = 1 # all H20 in phase=0
[]
[massfrac_ph1_sp0]
initial_condition = 0 # no H2O in phase=1
[]
[pgas]
family = MONOMIAL
order = FIRST
[]
[swater]
family = MONOMIAL
order = FIRST
[]
[stress_rr]
order = CONSTANT
family = MONOMIAL
[]
[stress_tt]
order = CONSTANT
family = MONOMIAL
[]
[stress_zz]
order = CONSTANT
family = MONOMIAL
[]
[]
[Kernels]
[mass_water_dot]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = pwater
[]
[flux_water]
type = PorousFlowAdvectiveFlux
fluid_component = 0
use_displaced_mesh = false
variable = pwater
[]
[mass_co2_dot]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = sgas
[]
[flux_co2]
type = PorousFlowAdvectiveFlux
fluid_component = 1
use_displaced_mesh = false
variable = sgas
[]
[energy_dot]
type = PorousFlowEnergyTimeDerivative
variable = temp
[]
[advection]
type = PorousFlowHeatAdvection
use_displaced_mesh = false
variable = temp
[]
[conduction]
type = PorousFlowExponentialDecay
use_displaced_mesh = false
variable = temp
reference = 358
rate = rate
[]
[grad_stress_r]
type = StressDivergenceRZTensors
temperature = temp
eigenstrain_names = thermal_contribution
variable = disp_r
use_displaced_mesh = false
component = 0
[]
[poro_r]
type = PorousFlowEffectiveStressCoupling
variable = disp_r
use_displaced_mesh = false
component = 0
[]
[]
[AuxKernels]
[rate]
type = FunctionAux
variable = rate
execute_on = timestep_begin
function = decay_rate
[]
[pgas]
type = PorousFlowPropertyAux
property = pressure
phase = 1
variable = pgas
[]
[swater]
type = PorousFlowPropertyAux
property = saturation
phase = 0
variable = swater
[]
[stress_rr]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_rr
index_i = 0
index_j = 0
[]
[stress_tt]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_tt
index_i = 2
index_j = 2
[]
[stress_zz]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_zz
index_i = 1
index_j = 1
[]
[]
[Functions]
[decay_rate]
# Eqn(26) of the first paper of LaForce et al.
# Ka * (rho C)_a = 10056886.914
# h = 11
type = ParsedFunction
expression = 'sqrt(10056886.914/t)/11.0'
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'temp pwater sgas disp_r'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureConst
pc = 0
[]
[]
[FluidProperties]
[water]
type = SimpleFluidProperties
bulk_modulus = 2.27e14
density0 = 970.0
viscosity = 0.3394e-3
cv = 4149.0
cp = 4149.0
porepressure_coefficient = 0.0
thermal_expansion = 0
[]
[co2]
type = SimpleFluidProperties
bulk_modulus = 2.27e14
density0 = 516.48
viscosity = 0.0393e-3
cv = 2920.5
cp = 2920.5
porepressure_coefficient = 0.0
thermal_expansion = 0
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = temp
[]
[ppss]
type = PorousFlow2PhasePS
phase0_porepressure = pwater
phase1_saturation = sgas
capillary_pressure = pc
[]
[massfrac]
type = PorousFlowMassFraction
mass_fraction_vars = 'massfrac_ph0_sp0 massfrac_ph1_sp0'
[]
[water]
type = PorousFlowSingleComponentFluid
fp = water
phase = 0
[]
[gas]
type = PorousFlowSingleComponentFluid
fp = co2
phase = 1
[]
[porosity_reservoir]
type = PorousFlowPorosityConst
porosity = 0.2
[]
[permeability_reservoir]
type = PorousFlowPermeabilityConst
permeability = '2e-12 0 0 0 0 0 0 0 0'
[]
[relperm_liquid]
type = PorousFlowRelativePermeabilityCorey
n = 4
phase = 0
s_res = 0.200
sum_s_res = 0.405
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityBC
phase = 1
s_res = 0.205
sum_s_res = 0.405
nw_phase = true
lambda = 2
[]
[thermal_conductivity_reservoir]
type = PorousFlowThermalConductivityIdeal
dry_thermal_conductivity = '0 0 0 0 1.320 0 0 0 0'
wet_thermal_conductivity = '0 0 0 0 3.083 0 0 0 0'
[]
[internal_energy_reservoir]
type = PorousFlowMatrixInternalEnergy
specific_heat_capacity = 1100
density = 2350.0
[]
[elasticity_tensor]
type = ComputeIsotropicElasticityTensor
shear_modulus = 6.0E9
poissons_ratio = 0.2
[]
[strain]
type = ComputeAxisymmetricRZSmallStrain
eigenstrain_names = 'thermal_contribution ini_stress'
[]
[ini_strain]
type = ComputeEigenstrainFromInitialStress
initial_stress = '-12.8E6 0 0 0 -51.3E6 0 0 0 -12.8E6'
eigenstrain_name = ini_stress
[]
[thermal_contribution]
type = ComputeThermalExpansionEigenstrain
temperature = temp
stress_free_temperature = 358
thermal_expansion_coeff = 5E-6
eigenstrain_name = thermal_contribution
[]
[stress]
type = ComputeLinearElasticStress
[]
[eff_fluid_pressure]
type = PorousFlowEffectiveFluidPressure
[]
[vol_strain]
type = PorousFlowVolumetricStrain
[]
[]
[BCs]
[outer_pressure_fixed]
type = DirichletBC
boundary = right
value = 18.3e6
variable = pwater
[]
[outer_saturation_fixed]
type = DirichletBC
boundary = right
value = 0.0
variable = sgas
[]
[outer_temp_fixed]
type = DirichletBC
boundary = right
value = 358
variable = temp
[]
[fixed_outer_r]
type = DirichletBC
variable = disp_r
value = 0
boundary = right
[]
[co2_injection]
type = PorousFlowSink
boundary = left
variable = sgas
use_mobility = false
use_relperm = false
fluid_phase = 1
flux_function = 'min(t/100.0,1)*(-2.294001475)' # 5.0E5 T/year = 15.855 kg/s, over area of 2Pi*0.1*11
[]
[cold_co2]
type = DirichletBC
boundary = left
variable = temp
value = 294
[]
[cavity_pressure_x]
type = Pressure
boundary = left
variable = disp_r
component = 0
postprocessor = p_bh # note, this lags
use_displaced_mesh = false
[]
[]
[Postprocessors]
[p_bh]
type = PointValue
variable = pwater
point = '0.1 0 0'
execute_on = timestep_begin
use_displaced_mesh = false
[]
[]
[VectorPostprocessors]
[ptsuss]
type = LineValueSampler
use_displaced_mesh = false
start_point = '0.1 0 0'
end_point = '5000 0 0'
sort_by = x
num_points = 50000
outputs = csv
variable = 'pwater temp sgas disp_r stress_rr stress_tt'
[]
[]
[Preconditioning]
active = 'smp'
[smp]
type = SMP
full = true
#petsc_options = '-snes_converged_reason -ksp_diagonal_scale -ksp_diagonal_scale_fix -ksp_gmres_modifiedgramschmidt -snes_linesearch_monitor'
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap -snes_atol -snes_rtol -snes_max_it'
petsc_options_value = 'gmres asm lu NONZERO 2 1E2 1E-5 500'
[]
[mumps]
type = SMP
full = true
petsc_options = '-snes_converged_reason -ksp_diagonal_scale -ksp_diagonal_scale_fix -ksp_gmres_modifiedgramschmidt -snes_linesearch_monitor'
petsc_options_iname = '-ksp_type -pc_type -pc_factor_mat_solver_package -pc_factor_shift_type -snes_rtol -snes_atol -snes_max_it'
petsc_options_value = 'gmres lu mumps NONZERO 1E-5 1E2 50'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 1.5768e8
#dtmax = 1e6
[TimeStepper]
type = IterationAdaptiveDT
dt = 1
growth_factor = 1.1
[]
[]
[Outputs]
print_linear_residuals = false
sync_times = '3600 86400 2.592E6 1.5768E8'
perf_graph = true
exodus = true
[csv]
type = CSV
sync_only = true
[]
[]
(modules/porous_flow/examples/tutorial/11_2D.i)
# Two-phase borehole injection problem in RZ coordinates
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 10
xmin = 1.0
xmax = 10
bias_x = 1.4
ny = 3
ymin = -6
ymax = 6
[]
[aquifer]
input = gen
type = SubdomainBoundingBoxGenerator
block_id = 1
bottom_left = '0 -2 0'
top_right = '10 2 0'
[]
[injection_area]
type = ParsedGenerateSideset
combinatorial_geometry = 'x<1.0001'
included_subdomains = 1
new_sideset_name = 'injection_area'
input = 'aquifer'
[]
[rename]
type = RenameBlockGenerator
old_block = '0 1'
new_block = 'caps aquifer'
input = 'injection_area'
[]
coord_type = RZ
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pwater pgas T disp_r'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureVG
alpha = 1E-6
m = 0.6
[]
[]
[GlobalParams]
displacements = 'disp_r disp_z'
gravity = '0 0 0'
biot_coefficient = 1.0
PorousFlowDictator = dictator
[]
[Variables]
[pwater]
initial_condition = 20E6
[]
[pgas]
initial_condition = 20.1E6
[]
[T]
initial_condition = 330
scaling = 1E-5
[]
[disp_r]
scaling = 1E-5
[]
[]
[Kernels]
[mass_water_dot]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = pwater
[]
[flux_water]
type = PorousFlowAdvectiveFlux
fluid_component = 0
use_displaced_mesh = false
variable = pwater
[]
[vol_strain_rate_water]
type = PorousFlowMassVolumetricExpansion
fluid_component = 0
variable = pwater
[]
[mass_co2_dot]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = pgas
[]
[flux_co2]
type = PorousFlowAdvectiveFlux
fluid_component = 1
use_displaced_mesh = false
variable = pgas
[]
[vol_strain_rate_co2]
type = PorousFlowMassVolumetricExpansion
fluid_component = 1
variable = pgas
[]
[energy_dot]
type = PorousFlowEnergyTimeDerivative
variable = T
[]
[advection]
type = PorousFlowHeatAdvection
use_displaced_mesh = false
variable = T
[]
[conduction]
type = PorousFlowHeatConduction
use_displaced_mesh = false
variable = T
[]
[vol_strain_rate_heat]
type = PorousFlowHeatVolumetricExpansion
variable = T
[]
[grad_stress_r]
type = StressDivergenceRZTensors
temperature = T
variable = disp_r
eigenstrain_names = thermal_contribution
use_displaced_mesh = false
component = 0
[]
[poro_r]
type = PorousFlowEffectiveStressCoupling
variable = disp_r
use_displaced_mesh = false
component = 0
[]
[]
[AuxVariables]
[disp_z]
[]
[effective_fluid_pressure]
family = MONOMIAL
order = CONSTANT
[]
[mass_frac_phase0_species0]
initial_condition = 1 # all water in phase=0
[]
[mass_frac_phase1_species0]
initial_condition = 0 # no water in phase=1
[]
[sgas]
family = MONOMIAL
order = CONSTANT
[]
[swater]
family = MONOMIAL
order = CONSTANT
[]
[stress_rr]
family = MONOMIAL
order = CONSTANT
[]
[stress_tt]
family = MONOMIAL
order = CONSTANT
[]
[stress_zz]
family = MONOMIAL
order = CONSTANT
[]
[porosity]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[effective_fluid_pressure]
type = ParsedAux
coupled_variables = 'pwater pgas swater sgas'
expression = 'pwater * swater + pgas * sgas'
variable = effective_fluid_pressure
[]
[swater]
type = PorousFlowPropertyAux
variable = swater
property = saturation
phase = 0
execute_on = timestep_end
[]
[sgas]
type = PorousFlowPropertyAux
variable = sgas
property = saturation
phase = 1
execute_on = timestep_end
[]
[stress_rr_aux]
type = RankTwoAux
variable = stress_rr
rank_two_tensor = stress
index_i = 0
index_j = 0
[]
[stress_tt]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_tt
index_i = 2
index_j = 2
[]
[stress_zz]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_zz
index_i = 1
index_j = 1
[]
[porosity]
type = PorousFlowPropertyAux
variable = porosity
property = porosity
execute_on = timestep_end
[]
[]
[BCs]
[pinned_top_bottom_r]
type = DirichletBC
variable = disp_r
value = 0
boundary = 'top bottom'
[]
[cavity_pressure_r]
type = Pressure
boundary = injection_area
variable = disp_r
postprocessor = constrained_effective_fluid_pressure_at_wellbore
use_displaced_mesh = false
[]
[cold_co2]
type = DirichletBC
boundary = injection_area
variable = T
value = 290 # injection temperature
use_displaced_mesh = false
[]
[constant_co2_injection]
type = PorousFlowSink
boundary = injection_area
variable = pgas
fluid_phase = 1
flux_function = -1E-4
use_displaced_mesh = false
[]
[outer_water_removal]
type = PorousFlowPiecewiseLinearSink
boundary = right
variable = pwater
fluid_phase = 0
pt_vals = '0 1E9'
multipliers = '0 1E8'
PT_shift = 20E6
use_mobility = true
use_relperm = true
use_displaced_mesh = false
[]
[outer_co2_removal]
type = PorousFlowPiecewiseLinearSink
boundary = right
variable = pgas
fluid_phase = 1
pt_vals = '0 1E9'
multipliers = '0 1E8'
PT_shift = 20.1E6
use_mobility = true
use_relperm = true
use_displaced_mesh = false
[]
[]
[FluidProperties]
[true_water]
type = Water97FluidProperties
[]
[tabulated_water]
type = TabulatedBicubicFluidProperties
fp = true_water
temperature_min = 275
pressure_max = 1E8
fluid_property_file = water97_tabulated_11.csv
[]
[true_co2]
type = CO2FluidProperties
[]
[tabulated_co2]
type = TabulatedBicubicFluidProperties
fp = true_co2
temperature_min = 275
pressure_max = 1E8
fluid_property_file = co2_tabulated_11.csv
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = T
[]
[saturation_calculator]
type = PorousFlow2PhasePP
phase0_porepressure = pwater
phase1_porepressure = pgas
capillary_pressure = pc
[]
[massfrac]
type = PorousFlowMassFraction
mass_fraction_vars = 'mass_frac_phase0_species0 mass_frac_phase1_species0'
[]
[water]
type = PorousFlowSingleComponentFluid
fp = tabulated_water
phase = 0
[]
[co2]
type = PorousFlowSingleComponentFluid
fp = tabulated_co2
phase = 1
[]
[relperm_water]
type = PorousFlowRelativePermeabilityCorey
n = 4
s_res = 0.1
sum_s_res = 0.2
phase = 0
[]
[relperm_co2]
type = PorousFlowRelativePermeabilityBC
nw_phase = true
lambda = 2
s_res = 0.1
sum_s_res = 0.2
phase = 1
[]
[porosity]
type = PorousFlowPorosity
fluid = true
mechanical = true
thermal = true
porosity_zero = 0.1
reference_temperature = 330
reference_porepressure = 20E6
thermal_expansion_coeff = 15E-6 # volumetric
solid_bulk = 8E9 # unimportant since biot = 1
[]
[permeability_aquifer]
type = PorousFlowPermeabilityKozenyCarman
block = aquifer
poroperm_function = kozeny_carman_phi0
phi0 = 0.1
n = 2
m = 2
k0 = 1E-12
[]
[permeability_caps]
type = PorousFlowPermeabilityKozenyCarman
block = caps
poroperm_function = kozeny_carman_phi0
phi0 = 0.1
n = 2
m = 2
k0 = 1E-15
k_anisotropy = '1 0 0 0 1 0 0 0 0.1'
[]
[rock_thermal_conductivity]
type = PorousFlowThermalConductivityIdeal
dry_thermal_conductivity = '2 0 0 0 2 0 0 0 2'
[]
[rock_internal_energy]
type = PorousFlowMatrixInternalEnergy
specific_heat_capacity = 1100
density = 2300
[]
[elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 5E9
poissons_ratio = 0.0
[]
[strain]
type = ComputeAxisymmetricRZSmallStrain
eigenstrain_names = 'thermal_contribution initial_stress'
[]
[thermal_contribution]
type = ComputeThermalExpansionEigenstrain
temperature = T
thermal_expansion_coeff = 5E-6 # this is the linear thermal expansion coefficient
eigenstrain_name = thermal_contribution
stress_free_temperature = 330
[]
[initial_strain]
type = ComputeEigenstrainFromInitialStress
initial_stress = '20E6 0 0 0 20E6 0 0 0 20E6'
eigenstrain_name = initial_stress
[]
[stress]
type = ComputeLinearElasticStress
[]
[effective_fluid_pressure]
type = PorousFlowEffectiveFluidPressure
[]
[volumetric_strain]
type = PorousFlowVolumetricStrain
[]
[]
[Postprocessors]
[effective_fluid_pressure_at_wellbore]
type = PointValue
variable = effective_fluid_pressure
point = '1 0 0'
execute_on = timestep_begin
use_displaced_mesh = false
[]
[constrained_effective_fluid_pressure_at_wellbore]
type = FunctionValuePostprocessor
function = constrain_effective_fluid_pressure
execute_on = timestep_begin
[]
[]
[Functions]
[constrain_effective_fluid_pressure]
type = ParsedFunction
symbol_names = effective_fluid_pressure_at_wellbore
symbol_values = effective_fluid_pressure_at_wellbore
expression = 'max(effective_fluid_pressure_at_wellbore, 20E6)'
[]
[]
[Preconditioning]
active = basic
[basic]
type = SMP
full = true
petsc_options = '-ksp_diagonal_scale -ksp_diagonal_scale_fix'
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
petsc_options_value = ' asm lu NONZERO 2'
[]
[preferred_but_might_not_be_installed]
type = SMP
full = true
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = ' lu mumps'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 1E3
[TimeStepper]
type = IterationAdaptiveDT
dt = 1E3
growth_factor = 1.2
optimal_iterations = 10
[]
nl_abs_tol = 1E-7
[]
[Outputs]
exodus = true
[]
(modules/solid_mechanics/test/tests/anisotropic_elastoplasticity/hoop_strain_comparison_coarse_xaxis.i)
# This test compares the hoop strain at two different elements in an internally
# pressurized cylinder with anisotropic plasticity: different yield condition
# for hoop and axial directions. The elements are located circumferentially
# apart but at same axial position. It is expected that due to pressurization
# hoop strains will develop with uniform magnitude along hoop direction. The
# test verifies that the plastic hoop strain is uniform in hoop direction.
# For 3D simulations with material properties oriented along the curved
# geometry such as cylinder or sphere, the stresses and strains are rotated to
# the local coordinate system from the global coordinate system. The plastic
# strain is calculated in the local coordinate system and then transformed to
# the global coordinate system. This test involves a 3D cylindrical geometry,
# and helps in indirectly verifying that this transformation of stresses and
# strains back and forth between the local and global coordinate system is
# correctly implemented.
[Mesh]
file = quarter_cylinder_coarse_xaxis.e
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
volumetric_locking_correction = true
[]
[AuxVariables]
[hydrostatic_stress]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_xx]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_xy]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_zz]
order = CONSTANT
family = MONOMIAL
[]
[stress_zz]
order = CONSTANT
family = MONOMIAL
[]
[stress_xx]
order = CONSTANT
family = MONOMIAL
[]
[stress_yy]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[hydrostatic_stress]
type = ADRankTwoScalarAux
variable = hydrostatic_stress
rank_two_tensor = stress
scalar_type = Hydrostatic
[]
[plasticity_strain_xx]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_xx
index_i = 0
index_j = 0
[]
[plasticity_strain_xy]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_xy
index_i = 0
index_j = 1
[]
[plasticity_strain_yy]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_yy
index_i = 1
index_j = 1
[]
[plasticity_strain_zz]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_zz
index_i = 2
index_j = 2
[]
[stress_zz]
type = ADRankTwoAux
rank_two_tensor = stress
variable = stress_zz
index_i = 2
index_j = 2
[]
[stress_xx]
type = ADRankTwoAux
rank_two_tensor = stress
variable = stress_xx
index_i = 0
index_j = 0
[]
[stress_yy]
type = ADRankTwoAux
rank_two_tensor = stress
variable = stress_yy
index_i = 1
index_j = 1
[]
[]
[Functions]
[push]
type = PiecewiseLinear
x = '0 1e2'
y = '0 200e6'
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = FINITE
generate_output = 'elastic_strain_zz elastic_strain_xx elastic_strain_yy stress_xx stress_yy stress_zz strain_zz plastic_strain_zz plastic_strain_xx plastic_strain_yy hoop_stress hoop_strain'
use_automatic_differentiation = true
add_variables = true
cylindrical_axis_point1 = '0 0 0'
cylindrical_axis_point2 = '1 0 0'
[]
[]
[Constraints]
[mid_section_plane]
type = EqualValueBoundaryConstraint
variable = disp_x
secondary = top # boundary
penalty = 1.0e+10
[]
[]
[Materials]
[elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 200.0e9
poissons_ratio = 0.2
[]
[elastic_strain]
type = ADComputeMultipleInelasticStress
inelastic_models = "plasticity"
max_iterations = 50
absolute_tolerance = 1e-30 #1e-16
[]
[hill_tensor]
type = ADHillConstants
# F G H L M N
# hill_constants = "0.5 0.5 0.5 1.5 1.5 1.5"
hill_constants = "0.25 0.5 0.5 1.5 1.5 1.5"
[]
[plasticity]
type = ADHillElastoPlasticityStressUpdate
hardening_constant = 1.5e10
hardening_exponent = 1.0
yield_stress = 0.0 # 60e6
local_cylindrical_csys = true
axis = x
absolute_tolerance = 1e-15 # 1e-8
relative_tolerance = 1e-13 # 1e-15
internal_solve_full_iteration_history = true
max_inelastic_increment = 2.0e-6
internal_solve_output_on = on_error
[]
[]
[BCs]
[no_disp_x]
type = ADDirichletBC
variable = disp_x
boundary = bottom
value = 0.0
[]
[no_disp_z]
type = ADDirichletBC
variable = disp_z
boundary = z_face
value = 0.0
[]
[no_disp_y]
type = ADDirichletBC
variable = disp_y
boundary = y_face
value = 0.0
[]
[Pressure]
[Side1]
boundary = inner
function = push
[]
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_rel_tol = 1e-12
nl_abs_tol = 1e-14
# nl_abs_tol = 1e-10
l_max_its = 90
nl_max_its = 30
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 30
iteration_window = 9
growth_factor = 1.05
cutback_factor = 0.5
timestep_limiting_postprocessor = matl_ts_min
dt = 0.1e-4
time_t = '0 6.23 10'
time_dt = '0.1 1.0e-2 1.0e-2'
[]
num_steps = 1
start_time = 0
end_time = 200.0
automatic_scaling = true
dtmax = 0.1e-4
[]
[Postprocessors]
[matl_ts_min]
type = MaterialTimeStepPostprocessor
[]
[hoop_strain_elementA]
type = ElementalVariableValue
elementid = 10
variable = hoop_strain
[]
[hoop_strain_elementB]
type = ElementalVariableValue
elementid = 4
variable = hoop_strain
[]
[hoop_strain_diff]
type = DifferencePostprocessor
value1 = hoop_strain_elementA
value2 = hoop_strain_elementB
[]
[]
[Outputs]
csv = true
exodus = false
perf_graph = true
[]
(modules/porous_flow/test/tests/fluidstate/theis_tabulated.i)
# Two phase Theis problem: Flow from single source using WaterNCG fluidstate.
# Constant rate injection 2 kg/s
# 1D cylindrical mesh
# Initially, system has only a liquid phase, until enough gas is injected
# to form a gas phase, in which case the system becomes two phase.
# Note: this test is the same as theis.i, but uses the tabulated version of the CO2FluidProperties
[Mesh]
type = GeneratedMesh
dim = 1
nx = 80
xmax = 200
bias_x = 1.05
coord_type = RZ
rz_coord_axis = Y
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[AuxVariables]
[saturation_gas]
order = CONSTANT
family = MONOMIAL
[]
[x1]
order = CONSTANT
family = MONOMIAL
[]
[y0]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[saturation_gas]
type = PorousFlowPropertyAux
variable = saturation_gas
property = saturation
phase = 1
execute_on = timestep_end
[]
[x1]
type = PorousFlowPropertyAux
variable = x1
property = mass_fraction
phase = 0
fluid_component = 1
execute_on = timestep_end
[]
[y0]
type = PorousFlowPropertyAux
variable = y0
property = mass_fraction
phase = 1
fluid_component = 0
execute_on = timestep_end
[]
[]
[Variables]
[pgas]
initial_condition = 20e6
[]
[zi]
initial_condition = 0
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = pgas
[]
[flux0]
type = PorousFlowAdvectiveFlux
fluid_component = 0
variable = pgas
[]
[mass1]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = zi
[]
[flux1]
type = PorousFlowAdvectiveFlux
fluid_component = 1
variable = zi
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pgas zi'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureConst
pc = 0
[]
[fs]
type = PorousFlowWaterNCG
water_fp = water
gas_fp = tabulated
capillary_pressure = pc
[]
[]
[FluidProperties]
[co2]
type = CO2FluidProperties
[]
[tabulated]
type = TabulatedBicubicFluidProperties
fp = co2
fluid_property_file = fluid_properties.csv
[]
[water]
type = Water97FluidProperties
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = 20
[]
[waterncg]
type = PorousFlowFluidState
gas_porepressure = pgas
z = zi
temperature_unit = Celsius
capillary_pressure = pc
fluid_state = fs
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.2
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-12 0 0 0 1e-12 0 0 0 1e-12'
[]
[relperm_water]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
s_res = 0.1
sum_s_res = 0.1
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 1
[]
[]
[BCs]
[rightwater]
type = DirichletBC
boundary = right
value = 20e6
variable = pgas
[]
[]
[DiracKernels]
[source]
type = PorousFlowSquarePulsePointSource
point = '0 0 0'
mass_flux = 2
variable = zi
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options = '-snes_converged_reason -ksp_diagonal_scale -ksp_diagonal_scale_fix -ksp_gmres_modifiedgramschmidt -snes_linesearch_monitor'
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap -snes_atol -snes_rtol -snes_max_it'
petsc_options_value = 'gmres asm lu NONZERO 2 1E-8 1E-10 20'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 8e2
[TimeStepper]
type = IterationAdaptiveDT
dt = 2
growth_factor = 2
[]
[]
[VectorPostprocessors]
[line]
type = LineValueSampler
warn_discontinuous_face_values = false
sort_by = x
start_point = '0 0 0'
end_point = '200 0 0'
num_points = 1000
variable = 'pgas zi x1 saturation_gas'
execute_on = 'timestep_end'
[]
[]
[Postprocessors]
[pgas]
type = PointValue
point = '1 0 0'
variable = pgas
[]
[sgas]
type = PointValue
point = '1 0 0'
variable = saturation_gas
[]
[zi]
type = PointValue
point = '1 0 0'
variable = zi
[]
[massgas]
type = PorousFlowFluidMass
fluid_component = 1
[]
[x1]
type = PointValue
point = '1 0 0'
variable = x1
[]
[y0]
type = PointValue
point = '1 0 0'
variable = y0
[]
[]
[Outputs]
print_linear_residuals = false
perf_graph = true
[csvout]
type = CSV
file_base = theis_tabulated_csvout
execute_on = timestep_end
execute_vector_postprocessors_on = final
[]
[]
(modules/porous_flow/examples/tutorial/11.i)
# Two-phase borehole injection problem
[Mesh]
[annular]
type = AnnularMeshGenerator
nr = 10
rmin = 1.0
rmax = 10
growth_r = 1.4
nt = 4
dmin = 0
dmax = 90
[]
[make3D]
input = annular
type = MeshExtruderGenerator
extrusion_vector = '0 0 12'
num_layers = 3
bottom_sideset = 'bottom'
top_sideset = 'top'
[]
[shift_down]
type = TransformGenerator
transform = TRANSLATE
vector_value = '0 0 -6'
input = make3D
[]
[aquifer]
type = SubdomainBoundingBoxGenerator
block_id = 1
bottom_left = '0 0 -2'
top_right = '10 10 2'
input = shift_down
[]
[injection_area]
type = ParsedGenerateSideset
combinatorial_geometry = 'x*x+y*y<1.01'
included_subdomains = 1
new_sideset_name = 'injection_area'
input = 'aquifer'
[]
[rename]
type = RenameBlockGenerator
old_block = '0 1'
new_block = 'caps aquifer'
input = 'injection_area'
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pwater pgas T disp_x disp_y'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureVG
alpha = 1E-6
m = 0.6
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
gravity = '0 0 0'
biot_coefficient = 1.0
PorousFlowDictator = dictator
[]
[Variables]
[pwater]
initial_condition = 20E6
[]
[pgas]
initial_condition = 20.1E6
[]
[T]
initial_condition = 330
scaling = 1E-5
[]
[disp_x]
scaling = 1E-5
[]
[disp_y]
scaling = 1E-5
[]
[]
[Kernels]
[mass_water_dot]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = pwater
[]
[flux_water]
type = PorousFlowAdvectiveFlux
fluid_component = 0
use_displaced_mesh = false
variable = pwater
[]
[vol_strain_rate_water]
type = PorousFlowMassVolumetricExpansion
fluid_component = 0
variable = pwater
[]
[mass_co2_dot]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = pgas
[]
[flux_co2]
type = PorousFlowAdvectiveFlux
fluid_component = 1
use_displaced_mesh = false
variable = pgas
[]
[vol_strain_rate_co2]
type = PorousFlowMassVolumetricExpansion
fluid_component = 1
variable = pgas
[]
[energy_dot]
type = PorousFlowEnergyTimeDerivative
variable = T
[]
[advection]
type = PorousFlowHeatAdvection
use_displaced_mesh = false
variable = T
[]
[conduction]
type = PorousFlowHeatConduction
use_displaced_mesh = false
variable = T
[]
[vol_strain_rate_heat]
type = PorousFlowHeatVolumetricExpansion
variable = T
[]
[grad_stress_x]
type = StressDivergenceTensors
temperature = T
variable = disp_x
eigenstrain_names = thermal_contribution
use_displaced_mesh = false
component = 0
[]
[poro_x]
type = PorousFlowEffectiveStressCoupling
variable = disp_x
use_displaced_mesh = false
component = 0
[]
[grad_stress_y]
type = StressDivergenceTensors
temperature = T
variable = disp_y
eigenstrain_names = thermal_contribution
use_displaced_mesh = false
component = 1
[]
[poro_y]
type = PorousFlowEffectiveStressCoupling
variable = disp_y
use_displaced_mesh = false
component = 1
[]
[]
[AuxVariables]
[disp_z]
[]
[effective_fluid_pressure]
family = MONOMIAL
order = CONSTANT
[]
[mass_frac_phase0_species0]
initial_condition = 1 # all water in phase=0
[]
[mass_frac_phase1_species0]
initial_condition = 0 # no water in phase=1
[]
[sgas]
family = MONOMIAL
order = CONSTANT
[]
[swater]
family = MONOMIAL
order = CONSTANT
[]
[stress_rr]
family = MONOMIAL
order = CONSTANT
[]
[stress_tt]
family = MONOMIAL
order = CONSTANT
[]
[stress_zz]
family = MONOMIAL
order = CONSTANT
[]
[porosity]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[effective_fluid_pressure]
type = ParsedAux
coupled_variables = 'pwater pgas swater sgas'
expression = 'pwater * swater + pgas * sgas'
variable = effective_fluid_pressure
[]
[swater]
type = PorousFlowPropertyAux
variable = swater
property = saturation
phase = 0
execute_on = timestep_end
[]
[sgas]
type = PorousFlowPropertyAux
variable = sgas
property = saturation
phase = 1
execute_on = timestep_end
[]
[stress_rr]
type = RankTwoScalarAux
variable = stress_rr
rank_two_tensor = stress
scalar_type = RadialStress
point1 = '0 0 0'
point2 = '0 0 1'
execute_on = timestep_end
[]
[stress_tt]
type = RankTwoScalarAux
variable = stress_tt
rank_two_tensor = stress
scalar_type = HoopStress
point1 = '0 0 0'
point2 = '0 0 1'
execute_on = timestep_end
[]
[stress_zz]
type = RankTwoAux
variable = stress_zz
rank_two_tensor = stress
index_i = 2
index_j = 2
execute_on = timestep_end
[]
[porosity]
type = PorousFlowPropertyAux
variable = porosity
property = porosity
execute_on = timestep_end
[]
[]
[BCs]
[roller_tmax]
type = DirichletBC
variable = disp_x
value = 0
boundary = dmax
[]
[roller_tmin]
type = DirichletBC
variable = disp_y
value = 0
boundary = dmin
[]
[pinned_top_bottom_x]
type = DirichletBC
variable = disp_x
value = 0
boundary = 'top bottom'
[]
[pinned_top_bottom_y]
type = DirichletBC
variable = disp_y
value = 0
boundary = 'top bottom'
[]
[cavity_pressure_x]
type = Pressure
boundary = injection_area
variable = disp_x
component = 0
postprocessor = constrained_effective_fluid_pressure_at_wellbore
use_displaced_mesh = false
[]
[cavity_pressure_y]
type = Pressure
boundary = injection_area
variable = disp_y
component = 1
postprocessor = constrained_effective_fluid_pressure_at_wellbore
use_displaced_mesh = false
[]
[cold_co2]
type = DirichletBC
boundary = injection_area
variable = T
value = 290 # injection temperature
use_displaced_mesh = false
[]
[constant_co2_injection]
type = PorousFlowSink
boundary = injection_area
variable = pgas
fluid_phase = 1
flux_function = -1E-4
use_displaced_mesh = false
[]
[outer_water_removal]
type = PorousFlowPiecewiseLinearSink
boundary = rmax
variable = pwater
fluid_phase = 0
pt_vals = '0 1E9'
multipliers = '0 1E8'
PT_shift = 20E6
use_mobility = true
use_relperm = true
use_displaced_mesh = false
[]
[outer_co2_removal]
type = PorousFlowPiecewiseLinearSink
boundary = rmax
variable = pgas
fluid_phase = 1
pt_vals = '0 1E9'
multipliers = '0 1E8'
PT_shift = 20.1E6
use_mobility = true
use_relperm = true
use_displaced_mesh = false
[]
[]
[FluidProperties]
[true_water]
type = Water97FluidProperties
[]
[tabulated_water]
type = TabulatedFluidProperties
fp = true_water
temperature_min = 275
pressure_max = 1E8
interpolated_properties = 'density viscosity enthalpy internal_energy'
fluid_property_file = water97_tabulated_11.csv
[]
[true_co2]
type = CO2FluidProperties
[]
[tabulated_co2]
type = TabulatedFluidProperties
fp = true_co2
temperature_min = 275
pressure_max = 1E8
interpolated_properties = 'density viscosity enthalpy internal_energy'
fluid_property_file = co2_tabulated_11.csv
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = T
[]
[saturation_calculator]
type = PorousFlow2PhasePP
phase0_porepressure = pwater
phase1_porepressure = pgas
capillary_pressure = pc
[]
[massfrac]
type = PorousFlowMassFraction
mass_fraction_vars = 'mass_frac_phase0_species0 mass_frac_phase1_species0'
[]
[water]
type = PorousFlowSingleComponentFluid
fp = tabulated_water
phase = 0
[]
[co2]
type = PorousFlowSingleComponentFluid
fp = tabulated_co2
phase = 1
[]
[relperm_water]
type = PorousFlowRelativePermeabilityCorey
n = 4
s_res = 0.1
sum_s_res = 0.2
phase = 0
[]
[relperm_co2]
type = PorousFlowRelativePermeabilityBC
nw_phase = true
lambda = 2
s_res = 0.1
sum_s_res = 0.2
phase = 1
[]
[porosity_mat]
type = PorousFlowPorosity
fluid = true
mechanical = true
thermal = true
porosity_zero = 0.1
reference_temperature = 330
reference_porepressure = 20E6
thermal_expansion_coeff = 15E-6 # volumetric
solid_bulk = 8E9 # unimportant since biot = 1
[]
[permeability_aquifer]
type = PorousFlowPermeabilityKozenyCarman
block = aquifer
poroperm_function = kozeny_carman_phi0
phi0 = 0.1
n = 2
m = 2
k0 = 1E-12
[]
[permeability_caps]
type = PorousFlowPermeabilityKozenyCarman
block = caps
poroperm_function = kozeny_carman_phi0
phi0 = 0.1
n = 2
m = 2
k0 = 1E-15
k_anisotropy = '1 0 0 0 1 0 0 0 0.1'
[]
[rock_thermal_conductivity]
type = PorousFlowThermalConductivityIdeal
dry_thermal_conductivity = '2 0 0 0 2 0 0 0 2'
[]
[rock_internal_energy]
type = PorousFlowMatrixInternalEnergy
specific_heat_capacity = 1100
density = 2300
[]
[elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 5E9
poissons_ratio = 0.0
[]
[strain]
type = ComputeSmallStrain
eigenstrain_names = 'thermal_contribution initial_stress'
[]
[thermal_contribution]
type = ComputeThermalExpansionEigenstrain
temperature = T
thermal_expansion_coeff = 5E-6 # this is the linear thermal expansion coefficient
eigenstrain_name = thermal_contribution
stress_free_temperature = 330
[]
[initial_strain]
type = ComputeEigenstrainFromInitialStress
initial_stress = '20E6 0 0 0 20E6 0 0 0 20E6'
eigenstrain_name = initial_stress
[]
[stress]
type = ComputeLinearElasticStress
[]
[effective_fluid_pressure_mat]
type = PorousFlowEffectiveFluidPressure
[]
[volumetric_strain]
type = PorousFlowVolumetricStrain
[]
[]
[Postprocessors]
[effective_fluid_pressure_at_wellbore]
type = PointValue
variable = effective_fluid_pressure
point = '1 0 0'
execute_on = timestep_begin
use_displaced_mesh = false
[]
[constrained_effective_fluid_pressure_at_wellbore]
type = FunctionValuePostprocessor
function = constrain_effective_fluid_pressure
execute_on = timestep_begin
[]
[]
[Functions]
[constrain_effective_fluid_pressure]
type = ParsedFunction
symbol_names = effective_fluid_pressure_at_wellbore
symbol_values = effective_fluid_pressure_at_wellbore
expression = 'max(effective_fluid_pressure_at_wellbore, 20E6)'
[]
[]
[Preconditioning]
active = basic
[basic]
type = SMP
full = true
petsc_options = '-ksp_diagonal_scale -ksp_diagonal_scale_fix'
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
petsc_options_value = ' asm lu NONZERO 2'
[]
[preferred_but_might_not_be_installed]
type = SMP
full = true
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = ' lu mumps'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 1E3
[TimeStepper]
type = IterationAdaptiveDT
dt = 1E3
growth_factor = 1.2
optimal_iterations = 10
[]
nl_abs_tol = 1E-7
[]
[Outputs]
exodus = true
[]
(modules/solid_mechanics/test/tests/anisotropic_elastoplasticity/hoop_strain_comparison_coarse_yaxis.i)
# This test compares the hoop strain at two different elements in an internally
# pressurized cylinder with anisotropic plasticity: different yield condition
# for hoop and axial directions. The elements are located circumferentially
# apart but at same axial position. It is expected that due to pressurization
# hoop strains will develop with uniform magnitude along hoop direction. The
# test verifies that the plastic hoop strain is uniform in hoop direction.
# For 3D simulations with material properties oriented along the curved
# geometry such as cylinder or sphere, the stresses and strains are rotated to
# the local coordinate system from the global coordinate system. The plastic
# strain is calculated in the local coordinate system and then transformed to
# the global coordinate system. This test involves a 3D cylindrical geometry,
# and helps in indirectly verifying that this transformation of stresses and
# strains back and forth between the local and global coordinate system is
# correctly implemented.
[Mesh]
file = quarter_cylinder_coarse_yaxis.e
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
volumetric_locking_correction = true
[]
[AuxVariables]
[hydrostatic_stress]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_xx]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_xy]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_zz]
order = CONSTANT
family = MONOMIAL
[]
[stress_zz]
order = CONSTANT
family = MONOMIAL
[]
[stress_xx]
order = CONSTANT
family = MONOMIAL
[]
[stress_yy]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[hydrostatic_stress]
type = ADRankTwoScalarAux
variable = hydrostatic_stress
rank_two_tensor = stress
scalar_type = Hydrostatic
[]
[plasticity_strain_xx]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_xx
index_i = 0
index_j = 0
[]
[plasticity_strain_xy]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_xy
index_i = 0
index_j = 1
[]
[plasticity_strain_yy]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_yy
index_i = 1
index_j = 1
[]
[plasticity_strain_zz]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_zz
index_i = 2
index_j = 2
[]
[stress_zz]
type = ADRankTwoAux
rank_two_tensor = stress
variable = stress_zz
index_i = 2
index_j = 2
[]
[stress_xx]
type = ADRankTwoAux
rank_two_tensor = stress
variable = stress_xx
index_i = 0
index_j = 0
[]
[stress_yy]
type = ADRankTwoAux
rank_two_tensor = stress
variable = stress_yy
index_i = 1
index_j = 1
[]
[]
[Functions]
[push]
type = PiecewiseLinear
x = '0 1e2'
y = '0 200e6'
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = FINITE
generate_output = 'elastic_strain_zz elastic_strain_xx elastic_strain_yy stress_xx stress_yy stress_zz strain_zz plastic_strain_zz plastic_strain_xx plastic_strain_yy hoop_stress hoop_strain'
use_automatic_differentiation = true
add_variables = true
cylindrical_axis_point1 = '0 0 0'
cylindrical_axis_point2 = '0 1 0'
[]
[]
[Constraints]
[mid_section_plane]
type = EqualValueBoundaryConstraint
variable = disp_y
secondary = top # boundary
penalty = 1.0e+10
[]
[]
[Materials]
[elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 200.0e9
poissons_ratio = 0.2
[]
[elastic_strain]
type = ADComputeMultipleInelasticStress
inelastic_models = "plasticity"
max_iterations = 50
absolute_tolerance = 1e-30 #1e-16
[]
[hill_tensor]
type = ADHillConstants
# F G H L M N
# hill_constants = "0.5 0.5 0.5 1.5 1.5 1.5"
hill_constants = "0.5 0.25 0.5 1.5 1.5 1.5"
[]
[plasticity]
type = ADHillElastoPlasticityStressUpdate
hardening_constant = 1.5e10
hardening_exponent = 1.0
yield_stress = 0.0 # 60e6
local_cylindrical_csys = true
axis = y
absolute_tolerance = 1e-15 # 1e-8
relative_tolerance = 1e-13 # 1e-15
internal_solve_full_iteration_history = true
max_inelastic_increment = 2.0e-6
internal_solve_output_on = on_error
[]
[]
[BCs]
[no_disp_x]
type = ADDirichletBC
variable = disp_x
boundary = x_face
value = 0.0
[]
[no_disp_y]
type = ADDirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[]
[no_disp_z]
type = ADDirichletBC
variable = disp_z
boundary = z_face
value = 0.0
[]
[Pressure]
[Side1]
boundary = inner
function = push
[]
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_rel_tol = 1e-12
nl_abs_tol = 1e-14
# nl_abs_tol = 1e-10
l_max_its = 90
nl_max_its = 30
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 30
iteration_window = 9
growth_factor = 1.05
cutback_factor = 0.5
timestep_limiting_postprocessor = matl_ts_min
dt = 0.1e-4
time_t = '0 6.23 10'
time_dt = '0.1 1.0e-2 1.0e-2'
[]
num_steps = 1
start_time = 0
end_time = 200.0
automatic_scaling = true
dtmax = 0.1e-4
[]
[Postprocessors]
[matl_ts_min]
type = MaterialTimeStepPostprocessor
[]
[hoop_strain_elementA]
type = ElementalVariableValue
elementid = 10
variable = hoop_strain
[]
[hoop_strain_elementB]
type = ElementalVariableValue
elementid = 4
variable = hoop_strain
[]
[hoop_strain_diff]
type = DifferencePostprocessor
value1 = hoop_strain_elementA
value2 = hoop_strain_elementB
[]
[]
[Outputs]
csv = true
exodus = false
perf_graph = true
[]
(modules/combined/examples/publications/rapid_dev/fig6.i)
#
# Fig. 6 input for 10.1016/j.commatsci.2017.02.017
# D. Schwen et al./Computational Materials Science 132 (2017) 36-45
# Three phase interface simulation demonstrating the interfacial stability
# w.r.t. formation of a tspurious third phase
#
[Mesh]
type = GeneratedMesh
dim = 2
nx = 120
ny = 120
nz = 0
xmin = 0
xmax = 40
ymin = 0
ymax = 40
zmin = 0
zmax = 0
elem_type = QUAD4
[]
[Variables]
# concentration
[./c]
[../]
# order parameter 1
[./eta1]
[../]
# order parameter 2
[./eta2]
[../]
# order parameter 3
[./eta3]
[../]
# phase concentration 1
[./c1]
initial_condition = 0.4
[../]
# phase concentration 2
[./c2]
initial_condition = 0.5
[../]
# phase concentration 3
[./c3]
initial_condition = 0.8
[../]
# Lagrange multiplier
[./lambda]
initial_condition = 0.0
[../]
[]
[AuxVariables]
[./T]
[./InitialCondition]
type = FunctionIC
function = 'x-10'
[../]
[../]
[]
[Functions]
[./ic_func_eta1]
type = ParsedFunction
expression = '0.5*(1.0+tanh((x-10)/sqrt(2.0))) * 0.5*(1.0+tanh((y-10)/sqrt(2.0)))'
[../]
[./ic_func_eta2]
type = ParsedFunction
expression = '0.5*(1.0-tanh((x-10)/sqrt(2.0)))'
[../]
[./ic_func_eta3]
type = ParsedFunction
expression = '1 - 0.5*(1.0-tanh((x-10)/sqrt(2.0)))
- 0.5*(1.0+tanh((x-10)/sqrt(2.0))) * 0.5*(1.0+tanh((y-10)/sqrt(2.0)))'
[../]
[./ic_func_c]
type = ParsedFunction
expression = '0.5 * 0.5*(1.0-tanh((x-10)/sqrt(2.0)))
+ 0.4 * 0.5*(1.0+tanh((x-10)/sqrt(2.0))) * 0.5*(1.0+tanh((y-10)/sqrt(2.0)))
+ 0.8 * (1 - 0.5*(1.0-tanh((x-10)/sqrt(2.0)))
- 0.5*(1.0+tanh((x-10)/sqrt(2.0))) * 0.5*(1.0+tanh((y-10)/sqrt(2.0))))'
[../]
[]
[ICs]
[./eta1]
variable = eta1
type = FunctionIC
function = ic_func_eta1
[../]
[./eta2]
variable = eta2
type = FunctionIC
function = ic_func_eta2
[../]
[./eta3]
variable = eta3
type = FunctionIC
function = ic_func_eta3
[../]
[./c]
variable = c
type = FunctionIC
function = ic_func_c
[../]
[]
[Materials]
# simple toy free energies
[./f1]
type = DerivativeParsedMaterial
property_name = F1
coupled_variables = 'c1'
expression = '20*(c1-0.4)^2'
[../]
[./f2]
type = DerivativeParsedMaterial
property_name = F2
coupled_variables = 'c2 T'
expression = '20*(c2-0.5)^2 + 0.01*T'
[../]
[./f3]
type = DerivativeParsedMaterial
property_name = F3
coupled_variables = 'c3'
expression = '20*(c3-0.8)^2'
[../]
# Switching functions for each phase
# h1(eta1, eta2, eta3)
[./h1]
type = SwitchingFunction3PhaseMaterial
eta_i = eta1
eta_j = eta2
eta_k = eta3
f_name = h1
[../]
# h2(eta1, eta2, eta3)
[./h2]
type = SwitchingFunction3PhaseMaterial
eta_i = eta2
eta_j = eta3
eta_k = eta1
f_name = h2
[../]
# h3(eta1, eta2, eta3)
[./h3]
type = SwitchingFunction3PhaseMaterial
eta_i = eta3
eta_j = eta1
eta_k = eta2
f_name = h3
[../]
# Coefficients for diffusion equation
[./Dh1]
type = DerivativeParsedMaterial
material_property_names = 'D h1'
expression = D*h1
property_name = Dh1
[../]
[./Dh2]
type = DerivativeParsedMaterial
material_property_names = 'D h2'
expression = D*h2
property_name = Dh2
[../]
[./Dh3]
type = DerivativeParsedMaterial
material_property_names = 'D h3'
expression = D*h3
property_name = Dh3
[../]
# Barrier functions for each phase
[./g1]
type = BarrierFunctionMaterial
g_order = SIMPLE
eta = eta1
function_name = g1
[../]
[./g2]
type = BarrierFunctionMaterial
g_order = SIMPLE
eta = eta2
function_name = g2
[../]
[./g3]
type = BarrierFunctionMaterial
g_order = SIMPLE
eta = eta3
function_name = g3
[../]
# constant properties
[./constants]
type = GenericConstantMaterial
prop_names = 'L kappa D'
prop_values = '1.0 1.0 1'
[../]
[]
[Kernels]
#Kernels for diffusion equation
[./diff_time]
type = TimeDerivative
variable = c
[../]
[./diff_c1]
type = MatDiffusion
variable = c
diffusivity = Dh1
v = c1
[../]
[./diff_c2]
type = MatDiffusion
variable = c
diffusivity = Dh2
v = c2
[../]
[./diff_c3]
type = MatDiffusion
variable = c
diffusivity = Dh3
v = c3
[../]
# Kernels for Allen-Cahn equation for eta1
[./deta1dt]
type = TimeDerivative
variable = eta1
[../]
[./ACBulkF1]
type = KKSMultiACBulkF
variable = eta1
Fj_names = 'F1 F2 F3'
hj_names = 'h1 h2 h3'
gi_name = g1
eta_i = eta1
wi = 1.0
args = 'c1 c2 c3 eta2 eta3'
[../]
[./ACBulkC1]
type = KKSMultiACBulkC
variable = eta1
Fj_names = 'F1 F2 F3'
hj_names = 'h1 h2 h3'
cj_names = 'c1 c2 c3'
eta_i = eta1
args = 'eta2 eta3'
[../]
[./ACInterface1]
type = ACInterface
variable = eta1
kappa_name = kappa
[../]
[./multipler1]
type = MatReaction
variable = eta1
v = lambda
mob_name = L
[../]
# Kernels for Allen-Cahn equation for eta2
[./deta2dt]
type = TimeDerivative
variable = eta2
[../]
[./ACBulkF2]
type = KKSMultiACBulkF
variable = eta2
Fj_names = 'F1 F2 F3'
hj_names = 'h1 h2 h3'
gi_name = g2
eta_i = eta2
wi = 1.0
args = 'c1 c2 c3 eta1 eta3'
[../]
[./ACBulkC2]
type = KKSMultiACBulkC
variable = eta2
Fj_names = 'F1 F2 F3'
hj_names = 'h1 h2 h3'
cj_names = 'c1 c2 c3'
eta_i = eta2
args = 'eta1 eta3'
[../]
[./ACInterface2]
type = ACInterface
variable = eta2
kappa_name = kappa
[../]
[./multipler2]
type = MatReaction
variable = eta2
v = lambda
mob_name = L
[../]
# Kernels for the Lagrange multiplier equation
[./mult_lambda]
type = MatReaction
variable = lambda
mob_name = 3
[../]
[./mult_ACBulkF_1]
type = KKSMultiACBulkF
variable = lambda
Fj_names = 'F1 F2 F3'
hj_names = 'h1 h2 h3'
gi_name = g1
eta_i = eta1
wi = 1.0
mob_name = 1
args = 'c1 c2 c3 eta2 eta3'
[../]
[./mult_ACBulkC_1]
type = KKSMultiACBulkC
variable = lambda
Fj_names = 'F1 F2 F3'
hj_names = 'h1 h2 h3'
cj_names = 'c1 c2 c3'
eta_i = eta1
args = 'eta2 eta3'
mob_name = 1
[../]
[./mult_CoupledACint_1]
type = SimpleCoupledACInterface
variable = lambda
v = eta1
kappa_name = kappa
mob_name = 1
[../]
[./mult_ACBulkF_2]
type = KKSMultiACBulkF
variable = lambda
Fj_names = 'F1 F2 F3'
hj_names = 'h1 h2 h3'
gi_name = g2
eta_i = eta2
wi = 1.0
mob_name = 1
args = 'c1 c2 c3 eta1 eta3'
[../]
[./mult_ACBulkC_2]
type = KKSMultiACBulkC
variable = lambda
Fj_names = 'F1 F2 F3'
hj_names = 'h1 h2 h3'
cj_names = 'c1 c2 c3'
eta_i = eta2
args = 'eta1 eta3'
mob_name = 1
[../]
[./mult_CoupledACint_2]
type = SimpleCoupledACInterface
variable = lambda
v = eta2
kappa_name = kappa
mob_name = 1
[../]
[./mult_ACBulkF_3]
type = KKSMultiACBulkF
variable = lambda
Fj_names = 'F1 F2 F3'
hj_names = 'h1 h2 h3'
gi_name = g3
eta_i = eta3
wi = 1.0
mob_name = 1
args = 'c1 c2 c3 eta1 eta2'
[../]
[./mult_ACBulkC_3]
type = KKSMultiACBulkC
variable = lambda
Fj_names = 'F1 F2 F3'
hj_names = 'h1 h2 h3'
cj_names = 'c1 c2 c3'
eta_i = eta3
args = 'eta1 eta2'
mob_name = 1
[../]
[./mult_CoupledACint_3]
type = SimpleCoupledACInterface
variable = lambda
v = eta3
kappa_name = kappa
mob_name = 1
[../]
# Kernels for constraint equation eta1 + eta2 + eta3 = 1
# eta3 is the nonlinear variable for the constraint equation
[./eta3reaction]
type = MatReaction
variable = eta3
mob_name = 1
[../]
[./eta1reaction]
type = MatReaction
variable = eta3
v = eta1
mob_name = 1
[../]
[./eta2reaction]
type = MatReaction
variable = eta3
v = eta2
mob_name = 1
[../]
[./one]
type = BodyForce
variable = eta3
value = -1.0
[../]
# Phase concentration constraints
[./chempot12]
type = KKSPhaseChemicalPotential
variable = c1
cb = c2
fa_name = F1
fb_name = F2
[../]
[./chempot23]
type = KKSPhaseChemicalPotential
variable = c2
cb = c3
fa_name = F2
fb_name = F3
[../]
[./phaseconcentration]
type = KKSMultiPhaseConcentration
variable = c3
cj = 'c1 c2 c3'
hj_names = 'h1 h2 h3'
etas = 'eta1 eta2 eta3'
c = c
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'asm ilu nonzero'
l_max_its = 30
nl_max_its = 10
l_tol = 1.0e-4
nl_rel_tol = 1.0e-10
nl_abs_tol = 1.0e-11
num_steps = 1000
[./TimeStepper]
type = IterationAdaptiveDT
dt = 0.2
optimal_iterations = 10
iteration_window = 2
[../]
[]
[Preconditioning]
active = 'full'
[./full]
type = SMP
full = true
[../]
[./mydebug]
type = FDP
full = true
[../]
[]
[Outputs]
exodus = true
checkpoint = true
print_linear_residuals = false
[./csv]
type = CSV
execute_on = 'final'
[../]
[]
#[VectorPostprocessors]
# [./c]
# type = LineValueSampler
# start_point = '-25 0 0'
# end_point = '25 0 0'
# variable = c
# num_points = 151
# sort_by = id
# execute_on = timestep_end
# [../]
# [./eta1]
# type = LineValueSampler
# start_point = '-25 0 0'
# end_point = '25 0 0'
# variable = eta1
# num_points = 151
# sort_by = id
# execute_on = timestep_end
# [../]
# [./eta2]
# type = LineValueSampler
# start_point = '-25 0 0'
# end_point = '25 0 0'
# variable = eta2
# num_points = 151
# sort_by = id
# execute_on = timestep_end
# [../]
# [./eta3]
# type = LineValueSampler
# start_point = '-25 0 0'
# end_point = '25 0 0'
# variable = eta3
# num_points = 151
# sort_by = id
# execute_on = timestep_end
# [../]
#[]
(modules/phase_field/examples/slkks/CrFe.i)
#
# SLKKS two phase example for the BCC and SIGMA phases. The sigma phase contains
# multiple sublattices. Free energy from
# Jacob, Aurelie, Erwin Povoden-Karadeniz, and Ernst Kozeschnik. "Revised thermodynamic
# description of the Fe-Cr system based on an improved sublattice model of the sigma phase."
# Calphad 60 (2018): 16-28.
#
# In this simulation we consider diffusion (Cahn-Hilliard) and phase transformation.
#
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 160
ny = 1
nz = 0
xmin = -25
xmax = 25
ymin = -2.5
ymax = 2.5
elem_type = QUAD4
[]
[]
[AuxVariables]
[Fglobal]
order = CONSTANT
family = MONOMIAL
[]
[]
[Functions]
[sigma_cr0]
type = PiecewiseLinear
data_file = CrFe_sigma_out_var_0001.csv
format = columns
x_index_in_file = 5
y_index_in_file = 2
xy_in_file_only = false
[]
[sigma_cr1]
type = PiecewiseLinear
data_file = CrFe_sigma_out_var_0001.csv
format = columns
x_index_in_file = 5
y_index_in_file = 3
xy_in_file_only = false
[]
[sigma_cr2]
type = PiecewiseLinear
data_file = CrFe_sigma_out_var_0001.csv
format = columns
x_index_in_file = 5
y_index_in_file = 4
xy_in_file_only = false
[]
[]
[Variables]
# order parameters
[eta1]
order = FIRST
family = LAGRANGE
initial_condition = 0.5
[]
[eta2]
order = FIRST
family = LAGRANGE
initial_condition = 0.5
[]
# solute concentration
[cCr]
order = FIRST
family = LAGRANGE
[InitialCondition]
type = FunctionIC
function = '(x+25)/50*0.5+0.1'
[]
[]
# sublattice concentrations
[BCC_CR]
initial_condition = 0.45
[]
[SIGMA_0CR]
[InitialCondition]
type = CoupledValueFunctionIC
function = sigma_cr0
v = cCr
variable = SIGMA_0CR
[]
[]
[SIGMA_1CR]
[InitialCondition]
type = CoupledValueFunctionIC
function = sigma_cr1
v = cCr
variable = SIGMA_1CR
[]
[]
[SIGMA_2CR]
[InitialCondition]
type = CoupledValueFunctionIC
function = sigma_cr2
v = cCr
variable = SIGMA_2CR
[]
[]
# Lagrange multiplier
[lambda]
[]
[]
[Materials]
# CALPHAD free energies
[F_BCC_A2]
type = DerivativeParsedMaterial
property_name = F_BCC_A2
outputs = exodus
output_properties = F_BCC_A2
expression = 'BCC_FE:=1-BCC_CR; G := 8.3145*T*(1.0*if(BCC_CR > 1.0e-15,BCC_CR*log(BCC_CR),0) + '
'1.0*if(BCC_FE > 1.0e-15,BCC_FE*plog(BCC_FE,eps),0) + 3.0*if(BCC_VA > '
'1.0e-15,BCC_VA*log(BCC_VA),0))/(BCC_CR + BCC_FE) + 8.3145*T*if(T < '
'548.2*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) - 932.5*BCC_CR*BCC_FE*BCC_VA + '
'311.5*BCC_CR*BCC_VA - '
'1043.0*BCC_FE*BCC_VA,-8.13674105561218e-49*T^15/(0.525599232981783*BCC_CR*BCC_FE*BCC_'
'VA*(BCC_CR - BCC_FE) - 0.894055608820709*BCC_CR*BCC_FE*BCC_VA + '
'0.298657718120805*BCC_CR*BCC_VA - BCC_FE*BCC_VA + 9.58772770853308e-13)^15 - '
'4.65558036243985e-30*T^9/(0.525599232981783*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) - '
'0.894055608820709*BCC_CR*BCC_FE*BCC_VA + 0.298657718120805*BCC_CR*BCC_VA - '
'BCC_FE*BCC_VA + 9.58772770853308e-13)^9 - '
'1.3485349181899e-10*T^3/(0.525599232981783*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) - '
'0.894055608820709*BCC_CR*BCC_FE*BCC_VA + 0.298657718120805*BCC_CR*BCC_VA - '
'BCC_FE*BCC_VA + 9.58772770853308e-13)^3 + 1 - '
'0.905299382744392*(548.2*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) - '
'932.5*BCC_CR*BCC_FE*BCC_VA + 311.5*BCC_CR*BCC_VA - 1043.0*BCC_FE*BCC_VA + '
'1.0e-9)/T,if(T < -548.2*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) + '
'932.5*BCC_CR*BCC_FE*BCC_VA - 311.5*BCC_CR*BCC_VA + '
'1043.0*BCC_FE*BCC_VA,-8.13674105561218e-49*T^15/(-0.525599232981783*BCC_CR*BCC_FE*BCC'
'_VA*(BCC_CR - BCC_FE) + 0.894055608820709*BCC_CR*BCC_FE*BCC_VA - '
'0.298657718120805*BCC_CR*BCC_VA + BCC_FE*BCC_VA + 9.58772770853308e-13)^15 - '
'4.65558036243985e-30*T^9/(-0.525599232981783*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) '
'+ 0.894055608820709*BCC_CR*BCC_FE*BCC_VA - 0.298657718120805*BCC_CR*BCC_VA + '
'BCC_FE*BCC_VA + 9.58772770853308e-13)^9 - '
'1.3485349181899e-10*T^3/(-0.525599232981783*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) + '
'0.894055608820709*BCC_CR*BCC_FE*BCC_VA - 0.298657718120805*BCC_CR*BCC_VA + '
'BCC_FE*BCC_VA + 9.58772770853308e-13)^3 + 1 - '
'0.905299382744392*(-548.2*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) + '
'932.5*BCC_CR*BCC_FE*BCC_VA - 311.5*BCC_CR*BCC_VA + 1043.0*BCC_FE*BCC_VA + '
'1.0e-9)/T,if(T > -548.2*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) + '
'932.5*BCC_CR*BCC_FE*BCC_VA - 311.5*BCC_CR*BCC_VA + 1043.0*BCC_FE*BCC_VA & '
'548.2*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) - 932.5*BCC_CR*BCC_FE*BCC_VA + '
'311.5*BCC_CR*BCC_VA - 1043.0*BCC_FE*BCC_VA < '
'0,-79209031311018.7*(-0.525599232981783*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) + '
'0.894055608820709*BCC_CR*BCC_FE*BCC_VA - 0.298657718120805*BCC_CR*BCC_VA + '
'BCC_FE*BCC_VA + 9.58772770853308e-13)^5/T^5 - '
'3.83095660520737e+42*(-0.525599232981783*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) + '
'0.894055608820709*BCC_CR*BCC_FE*BCC_VA - 0.298657718120805*BCC_CR*BCC_VA + '
'BCC_FE*BCC_VA + 9.58772770853308e-13)^15/T^15 - '
'1.22565886734485e+72*(-0.525599232981783*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) + '
'0.894055608820709*BCC_CR*BCC_FE*BCC_VA - 0.298657718120805*BCC_CR*BCC_VA + '
'BCC_FE*BCC_VA + 9.58772770853308e-13)^25/T^25,if(T > '
'548.2*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) - 932.5*BCC_CR*BCC_FE*BCC_VA + '
'311.5*BCC_CR*BCC_VA - 1043.0*BCC_FE*BCC_VA & 548.2*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - '
'BCC_FE) - 932.5*BCC_CR*BCC_FE*BCC_VA + 311.5*BCC_CR*BCC_VA - 1043.0*BCC_FE*BCC_VA > '
'0,-79209031311018.7*(0.525599232981783*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) - '
'0.894055608820709*BCC_CR*BCC_FE*BCC_VA + 0.298657718120805*BCC_CR*BCC_VA - '
'BCC_FE*BCC_VA + 9.58772770853308e-13)^5/T^5 - '
'3.83095660520737e+42*(0.525599232981783*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) - '
'0.894055608820709*BCC_CR*BCC_FE*BCC_VA + 0.298657718120805*BCC_CR*BCC_VA - '
'BCC_FE*BCC_VA + 9.58772770853308e-13)^15/T^15 - '
'1.22565886734485e+72*(0.525599232981783*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) - '
'0.894055608820709*BCC_CR*BCC_FE*BCC_VA + 0.298657718120805*BCC_CR*BCC_VA - '
'BCC_FE*BCC_VA + 9.58772770853308e-13)^25/T^25,0))))*log((2.15*BCC_CR*BCC_FE*BCC_VA - '
'0.008*BCC_CR*BCC_VA + 2.22*BCC_FE*BCC_VA)*if(2.15*BCC_CR*BCC_FE*BCC_VA - '
'0.008*BCC_CR*BCC_VA + 2.22*BCC_FE*BCC_VA <= 0,-1.0,1.0) + 1)/(BCC_CR + BCC_FE) + '
'1.0*(BCC_CR*BCC_VA*if(T >= 298.15 & T < 2180.0,139250.0*1/T - 26.908*T*log(T) + '
'157.48*T + 0.00189435*T^2.0 - 1.47721e-6*T^3.0 - 8856.94,if(T >= 2180.0 & T < '
'6000.0,-2.88526e+32*T^(-9.0) - 50.0*T*log(T) + 344.18*T - 34869.344,0)) + '
'BCC_FE*BCC_VA*if(T >= 298.15 & T < 1811.0,77358.5*1/T - 23.5143*T*log(T) + 124.134*T '
'- 0.00439752*T^2.0 - 5.89269e-8*T^3.0 + 1225.7,if(T >= 1811.0 & T < '
'6000.0,2.2960305e+31*T^(-9.0) - 46.0*T*log(T) + 299.31255*T - 25383.581,0)))/(BCC_CR '
'+ BCC_FE) + 1.0*(BCC_CR*BCC_FE*BCC_VA*(500.0 - 1.5*T)*(BCC_CR - BCC_FE) + '
'BCC_CR*BCC_FE*BCC_VA*(24600.0 - 14.98*T) + BCC_CR*BCC_FE*BCC_VA*(9.15*T - '
'14000.0)*(BCC_CR - BCC_FE)^2)/(BCC_CR + BCC_FE); G/100000'
coupled_variables = 'BCC_CR'
constant_names = 'BCC_VA T eps'
constant_expressions = '1 1000 0.01'
[]
[F_SIGMA]
type = DerivativeParsedMaterial
property_name = F_SIGMA
outputs = exodus
output_properties = F_SIGMA
expression = 'SIGMA_0FE := 1-SIGMA_0CR; SIGMA_1FE := 1-SIGMA_1CR; SIGMA_2FE := 1-SIGMA_2CR; G := '
'8.3145*T*(10.0*if(SIGMA_0CR > 1.0e-15,SIGMA_0CR*plog(SIGMA_0CR,eps),0) + '
'10.0*if(SIGMA_0FE > 1.0e-15,SIGMA_0FE*plog(SIGMA_0FE,eps),0) + 4.0*if(SIGMA_1CR > '
'1.0e-15,SIGMA_1CR*plog(SIGMA_1CR,eps),0) + 4.0*if(SIGMA_1FE > '
'1.0e-15,SIGMA_1FE*plog(SIGMA_1FE,eps),0) + 16.0*if(SIGMA_2CR > '
'1.0e-15,SIGMA_2CR*plog(SIGMA_2CR,eps),0) + 16.0*if(SIGMA_2FE > '
'1.0e-15,SIGMA_2FE*plog(SIGMA_2FE,eps),0))/(10.0*SIGMA_0CR + 10.0*SIGMA_0FE + '
'4.0*SIGMA_1CR + 4.0*SIGMA_1FE + 16.0*SIGMA_2CR + 16.0*SIGMA_2FE) + '
'(SIGMA_0FE*SIGMA_1CR*SIGMA_2CR*SIGMA_2FE*(-70.0*T - 170400.0) + '
'SIGMA_0FE*SIGMA_1FE*SIGMA_2CR*SIGMA_2FE*(-10.0*T - 330839.0))/(10.0*SIGMA_0CR + '
'10.0*SIGMA_0FE + 4.0*SIGMA_1CR + 4.0*SIGMA_1FE + 16.0*SIGMA_2CR + 16.0*SIGMA_2FE) + '
'(SIGMA_0CR*SIGMA_1CR*SIGMA_2CR*(30.0*if(T >= 298.15 & T < 2180.0,139250.0*1/T - '
'26.908*T*log(T) + 157.48*T + 0.00189435*T^2.0 - 1.47721e-6*T^3.0 - 8856.94,if(T >= '
'2180.0 & T < 6000.0,-2.88526e+32*T^(-9.0) - 50.0*T*log(T) + 344.18*T - 34869.344,0)) '
'+ 132000.0) + SIGMA_0CR*SIGMA_1CR*SIGMA_2FE*(-110.0*T + 16.0*if(T >= 298.15 & T < '
'1811.0,77358.5*1/T - 23.5143*T*log(T) + 124.134*T - 0.00439752*T^2.0 - '
'5.89269e-8*T^3.0 + 1225.7,if(T >= 1811.0 & T < 6000.0,2.2960305e+31*T^(-9.0) - '
'46.0*T*log(T) + 299.31255*T - 25383.581,0)) + 14.0*if(T >= 298.15 & T < '
'2180.0,139250.0*1/T - 26.908*T*log(T) + 157.48*T + 0.00189435*T^2.0 - '
'1.47721e-6*T^3.0 - 8856.94,if(T >= 2180.0 & T < 6000.0,-2.88526e+32*T^(-9.0) - '
'50.0*T*log(T) + 344.18*T - 34869.344,0)) + 123500.0) + '
'SIGMA_0CR*SIGMA_1FE*SIGMA_2CR*(4.0*if(T >= 298.15 & T < 1811.0,77358.5*1/T - '
'23.5143*T*log(T) + 124.134*T - 0.00439752*T^2.0 - 5.89269e-8*T^3.0 + 1225.7,if(T >= '
'1811.0 & T < 6000.0,2.2960305e+31*T^(-9.0) - 46.0*T*log(T) + 299.31255*T - '
'25383.581,0)) + 26.0*if(T >= 298.15 & T < 2180.0,139250.0*1/T - 26.908*T*log(T) + '
'157.48*T + 0.00189435*T^2.0 - 1.47721e-6*T^3.0 - 8856.94,if(T >= 2180.0 & T < '
'6000.0,-2.88526e+32*T^(-9.0) - 50.0*T*log(T) + 344.18*T - 34869.344,0)) + 140486.0) '
'+ SIGMA_0CR*SIGMA_1FE*SIGMA_2FE*(20.0*if(T >= 298.15 & T < 1811.0,77358.5*1/T - '
'23.5143*T*log(T) + 124.134*T - 0.00439752*T^2.0 - 5.89269e-8*T^3.0 + 1225.7,if(T >= '
'1811.0 & T < 6000.0,2.2960305e+31*T^(-9.0) - 46.0*T*log(T) + 299.31255*T - '
'25383.581,0)) + 10.0*if(T >= 298.15 & T < 2180.0,139250.0*1/T - 26.908*T*log(T) + '
'157.48*T + 0.00189435*T^2.0 - 1.47721e-6*T^3.0 - 8856.94,if(T >= 2180.0 & T < '
'6000.0,-2.88526e+32*T^(-9.0) - 50.0*T*log(T) + 344.18*T - 34869.344,0)) + 148800.0) '
'+ SIGMA_0FE*SIGMA_1CR*SIGMA_2CR*(10.0*if(T >= 298.15 & T < 1811.0,77358.5*1/T - '
'23.5143*T*log(T) + 124.134*T - 0.00439752*T^2.0 - 5.89269e-8*T^3.0 + 1225.7,if(T >= '
'1811.0 & T < 6000.0,2.2960305e+31*T^(-9.0) - 46.0*T*log(T) + 299.31255*T - '
'25383.581,0)) + 20.0*if(T >= 298.15 & T < 2180.0,139250.0*1/T - 26.908*T*log(T) + '
'157.48*T + 0.00189435*T^2.0 - 1.47721e-6*T^3.0 - 8856.94,if(T >= 2180.0 & T < '
'6000.0,-2.88526e+32*T^(-9.0) - 50.0*T*log(T) + 344.18*T - 34869.344,0)) + 56200.0) + '
'SIGMA_0FE*SIGMA_1CR*SIGMA_2FE*(26.0*if(T >= 298.15 & T < 1811.0,77358.5*1/T - '
'23.5143*T*log(T) + 124.134*T - 0.00439752*T^2.0 - 5.89269e-8*T^3.0 + 1225.7,if(T >= '
'1811.0 & T < 6000.0,2.2960305e+31*T^(-9.0) - 46.0*T*log(T) + 299.31255*T - '
'25383.581,0)) + 4.0*if(T >= 298.15 & T < 2180.0,139250.0*1/T - 26.908*T*log(T) + '
'157.48*T + 0.00189435*T^2.0 - 1.47721e-6*T^3.0 - 8856.94,if(T >= 2180.0 & T < '
'6000.0,-2.88526e+32*T^(-9.0) - 50.0*T*log(T) + 344.18*T - 34869.344,0)) + 152700.0) '
'+ SIGMA_0FE*SIGMA_1FE*SIGMA_2CR*(14.0*if(T >= 298.15 & T < 1811.0,77358.5*1/T - '
'23.5143*T*log(T) + 124.134*T - 0.00439752*T^2.0 - 5.89269e-8*T^3.0 + 1225.7,if(T >= '
'1811.0 & T < 6000.0,2.2960305e+31*T^(-9.0) - 46.0*T*log(T) + 299.31255*T - '
'25383.581,0)) + 16.0*if(T >= 298.15 & T < 2180.0,139250.0*1/T - 26.908*T*log(T) + '
'157.48*T + 0.00189435*T^2.0 - 1.47721e-6*T^3.0 - 8856.94,if(T >= 2180.0 & T < '
'6000.0,-2.88526e+32*T^(-9.0) - 50.0*T*log(T) + 344.18*T - 34869.344,0)) + 46200.0) + '
'SIGMA_0FE*SIGMA_1FE*SIGMA_2FE*(30.0*if(T >= 298.15 & T < 1811.0,77358.5*1/T - '
'23.5143*T*log(T) + 124.134*T - 0.00439752*T^2.0 - 5.89269e-8*T^3.0 + 1225.7,if(T >= '
'1811.0 & T < 6000.0,2.2960305e+31*T^(-9.0) - 46.0*T*log(T) + 299.31255*T - '
'25383.581,0)) + 173333.0))/(10.0*SIGMA_0CR + 10.0*SIGMA_0FE + 4.0*SIGMA_1CR + '
'4.0*SIGMA_1FE + 16.0*SIGMA_2CR + 16.0*SIGMA_2FE); G/100000'
coupled_variables = 'SIGMA_0CR SIGMA_1CR SIGMA_2CR'
constant_names = 'T eps'
constant_expressions = '1000 0.01'
[]
# h(eta)
[h1]
type = SwitchingFunctionMaterial
function_name = h1
h_order = HIGH
eta = eta1
[]
[h2]
type = SwitchingFunctionMaterial
function_name = h2
h_order = HIGH
eta = eta2
[]
# g(eta)
[g1]
type = BarrierFunctionMaterial
function_name = g1
g_order = SIMPLE
eta = eta1
[]
[g2]
type = BarrierFunctionMaterial
function_name = g2
g_order = SIMPLE
eta = eta2
[]
# constant properties
[constants]
type = GenericConstantMaterial
prop_names = 'D L kappa'
prop_values = '10 1 0.1 '
[]
# Coefficients for diffusion equation
[Dh1]
type = DerivativeParsedMaterial
material_property_names = 'D h1(eta1)'
expression = D*h1
property_name = Dh1
coupled_variables = eta1
derivative_order = 1
[]
[Dh2a]
type = DerivativeParsedMaterial
material_property_names = 'D h2(eta2)'
expression = D*h2*10/30
property_name = Dh2a
coupled_variables = eta2
derivative_order = 1
[]
[Dh2b]
type = DerivativeParsedMaterial
material_property_names = 'D h2(eta2)'
expression = D*h2*4/30
property_name = Dh2b
coupled_variables = eta2
derivative_order = 1
[]
[Dh2c]
type = DerivativeParsedMaterial
material_property_names = 'D h2(eta2)'
expression = D*h2*16/30
property_name = Dh2c
coupled_variables = eta2
derivative_order = 1
[]
[]
[Kernels]
#Kernels for diffusion equation
[diff_time]
type = TimeDerivative
variable = cCr
[]
[diff_c1]
type = MatDiffusion
variable = cCr
diffusivity = Dh1
v = BCC_CR
coupled_variables = eta1
[]
[diff_c2a]
type = MatDiffusion
variable = cCr
diffusivity = Dh2a
v = SIGMA_0CR
coupled_variables = eta2
[]
[diff_c2b]
type = MatDiffusion
variable = cCr
diffusivity = Dh2b
v = SIGMA_1CR
coupled_variables = eta2
[]
[diff_c2c]
type = MatDiffusion
variable = cCr
diffusivity = Dh2c
v = SIGMA_2CR
coupled_variables = eta2
[]
# enforce pointwise equality of chemical potentials
[chempot1a2a]
# The BCC phase has only one sublattice
# we tie it to the first sublattice with site fraction 10/(10+4+16) in the sigma phase
type = KKSPhaseChemicalPotential
variable = BCC_CR
cb = SIGMA_0CR
kb = '${fparse 10/30}'
fa_name = F_BCC_A2
fb_name = F_SIGMA
args_b = 'SIGMA_1CR SIGMA_2CR'
[]
[chempot2a2b]
# This kernel ties the first two sublattices in the sigma phase together
type = SLKKSChemicalPotential
variable = SIGMA_0CR
a = 10
cs = SIGMA_1CR
as = 4
F = F_SIGMA
coupled_variables = 'SIGMA_2CR'
[]
[chempot2b2c]
# This kernel ties the remaining two sublattices in the sigma phase together
type = SLKKSChemicalPotential
variable = SIGMA_1CR
a = 4
cs = SIGMA_2CR
as = 16
F = F_SIGMA
coupled_variables = 'SIGMA_0CR'
[]
[phaseconcentration]
# This kernel ties the sum of the sublattice concentrations to the global concentration cCr
type = SLKKSMultiPhaseConcentration
variable = SIGMA_2CR
c = cCr
ns = '1 3'
as = '1 10 4 16'
cs = 'BCC_CR SIGMA_0CR SIGMA_1CR SIGMA_2CR'
h_names = 'h1 h2'
eta = 'eta1 eta2'
[]
# Kernels for Allen-Cahn equation for eta1
[deta1dt]
type = TimeDerivative
variable = eta1
[]
[ACBulkF1]
type = KKSMultiACBulkF
variable = eta1
Fj_names = 'F_BCC_A2 F_SIGMA'
hj_names = 'h1 h2'
gi_name = g1
eta_i = eta1
wi = 0.1
coupled_variables = 'BCC_CR SIGMA_0CR SIGMA_1CR SIGMA_2CR eta2'
[]
[ACBulkC1]
type = SLKKSMultiACBulkC
variable = eta1
F = F_BCC_A2
c = BCC_CR
ns = '1 3'
as = '1 10 4 16'
cs = 'BCC_CR SIGMA_0CR SIGMA_1CR SIGMA_2CR'
h_names = 'h1 h2'
eta = 'eta1 eta2'
[]
[ACInterface1]
type = ACInterface
variable = eta1
kappa_name = kappa
[]
[lagrange1]
type = SwitchingFunctionConstraintEta
variable = eta1
h_name = h1
lambda = lambda
coupled_variables = 'eta2'
[]
# Kernels for Allen-Cahn equation for eta1
[deta2dt]
type = TimeDerivative
variable = eta2
[]
[ACBulkF2]
type = KKSMultiACBulkF
variable = eta2
Fj_names = 'F_BCC_A2 F_SIGMA'
hj_names = 'h1 h2'
gi_name = g2
eta_i = eta2
wi = 0.1
coupled_variables = 'BCC_CR SIGMA_0CR SIGMA_1CR SIGMA_2CR eta1'
[]
[ACBulkC2]
type = SLKKSMultiACBulkC
variable = eta2
F = F_BCC_A2
c = BCC_CR
ns = '1 3'
as = '1 10 4 16'
cs = 'BCC_CR SIGMA_0CR SIGMA_1CR SIGMA_2CR'
h_names = 'h1 h2'
eta = 'eta1 eta2'
[]
[ACInterface2]
type = ACInterface
variable = eta2
kappa_name = kappa
[]
[lagrange2]
type = SwitchingFunctionConstraintEta
variable = eta2
h_name = h2
lambda = lambda
coupled_variables = 'eta1'
[]
# Lagrange-multiplier constraint kernel for lambda
[lagrange]
type = SwitchingFunctionConstraintLagrange
variable = lambda
h_names = 'h1 h2'
etas = 'eta1 eta2'
epsilon = 1e-6
[]
[]
[AuxKernels]
[GlobalFreeEnergy]
type = KKSMultiFreeEnergy
variable = Fglobal
Fj_names = 'F_BCC_A2 F_SIGMA'
hj_names = 'h1 h2'
gj_names = 'g1 g2'
interfacial_vars = 'eta1 eta2'
kappa_names = 'kappa kappa'
w = 0.1
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
line_search = none
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type -ksp_gmres_restart'
petsc_options_value = 'asm lu nonzero 30'
l_max_its = 100
nl_max_its = 20
nl_abs_tol = 1e-10
end_time = 10000
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 12
iteration_window = 2
growth_factor = 1.5
cutback_factor = 0.7
dt = 0.1
[]
[]
[VectorPostprocessors]
[var]
type = LineValueSampler
start_point = '-25 0 0'
end_point = '25 0 0'
variable = 'cCr eta1 eta2 SIGMA_0CR SIGMA_1CR SIGMA_2CR'
num_points = 151
sort_by = id
execute_on = 'initial timestep_end'
[]
[mat]
type = LineMaterialRealSampler
start = '-25 0 0'
end = '25 0 0'
property = 'F_BCC_A2 F_SIGMA'
sort_by = id
execute_on = 'initial timestep_end'
[]
[]
[Postprocessors]
[F]
type = ElementIntegralVariablePostprocessor
variable = Fglobal
execute_on = 'initial timestep_end'
[]
[cmin]
type = NodalExtremeValue
value_type = min
variable = cCr
execute_on = 'initial timestep_end'
[]
[cmax]
type = NodalExtremeValue
value_type = max
variable = cCr
execute_on = 'initial timestep_end'
[]
[ctotal]
type = ElementIntegralVariablePostprocessor
variable = cCr
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
exodus = true
print_linear_residuals = false
csv = true
perf_graph = true
[]
(modules/phase_field/test/tests/electrochem_sintering/ElectrochemicalSintering_test.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 800
xmin = 0
xmax = 80
[]
[GlobalParams]
op_num = 2
var_name_base = gr
int_width = 4
[]
[Variables]
[wvy]
[]
[wvo]
[]
[phi]
[]
[PolycrystalVariables]
[]
[V]
[]
[]
[AuxVariables]
[bnds]
[]
[negative_V]
[]
[E_x]
order = CONSTANT
family = MONOMIAL
[]
[E_y]
order = CONSTANT
family = MONOMIAL
[]
[ns_cat_aux]
order = CONSTANT
family = MONOMIAL
[]
[ns_an_aux]
order = CONSTANT
family = MONOMIAL
[]
[T]
[]
[]
[Functions]
[ic_func_gr0]
type = ParsedFunction
expression = '0.5*(1.0-tanh((x)/sqrt(2.0*2.0)))'
[]
[ic_func_gr1]
type = ParsedFunction
expression = '0.5*(1.0+tanh((x)/sqrt(2.0*2.0)))'
[]
[]
[ICs]
[gr0_IC]
type = FunctionIC
variable = gr0
function = ic_func_gr0
[]
[gr1_IC]
type = FunctionIC
variable = gr1
function = ic_func_gr1
[]
[wvy_IC]
type = ConstantIC
variable = wvy
value = 2.7827
[]
[wvo_IC]
type = ConstantIC
variable = wvo
value = 2.7827
[]
[T_IC]
type = ConstantIC
variable = T
value = 1600
[]
[]
[BCs]
[v_left]
type = DirichletBC
preset = true
variable = V
boundary = left
value = 1e-2
[]
[v_right]
type = DirichletBC
preset = true
variable = V
boundary = right
value = 0
[]
[gr0_left]
type = DirichletBC
preset = true
variable = gr0
boundary = left
value = 0.5 #Grain boundary at left hand side of domain
[]
[gr1_left]
type = DirichletBC
preset = true
variable = gr1
boundary = left
value = 0.5 #Grain boundary at left hand side of domain
[]
[wvo_right]
type = DirichletBC
preset = true
variable = wvo
boundary = right
value = 2.7827
[]
[wvy_right]
type = DirichletBC
preset = true
variable = wvy
boundary = right
value = 2.7827
[]
[]
[Materials]
# Free energy coefficients for parabolic curves
[ks_cat]
type = ParsedMaterial
property_name = ks_cat
coupled_variables = 'T'
constant_names = 'a b Va'
constant_expressions = '-0.0017 140.44 0.03726'
expression = '(a*T + b) * Va^2'
[]
[ks_an]
type = ParsedMaterial
property_name = ks_an
coupled_variables = 'T'
constant_names = 'a b Va'
constant_expressions = '-0.0017 140.44 0.03726'
expression = '(a*T + b) * Va^2'
[]
[kv_cat]
type = ParsedMaterial
property_name = kv_cat
material_property_names = 'ks_cat'
expression = '10*ks_cat'
[]
[kv_an]
type = ParsedMaterial
property_name = kv_an
material_property_names = 'ks_cat'
expression = '10*ks_cat'
[]
# Diffusivity and mobilities
[chiDy]
type = GrandPotentialTensorMaterial
f_name = chiDy
diffusivity_name = Dvy
solid_mobility = L
void_mobility = Lv
chi = chi_cat
surface_energy = 6.24
c = phi
T = T
D0 = 5.9e11
GBmob0 = 1.60e12
Q = 4.14
Em = 4.25
bulkindex = 1
gbindex = 1
surfindex = 1
[]
[chiDo]
type = GrandPotentialTensorMaterial
f_name = chiDo
diffusivity_name = Dvo
solid_mobility = Lo
void_mobility = Lvo
chi = chi_an
surface_energy = 6.24
c = phi
T = T
D0 = 5.9e11
GBmob0 = 1.60e12
Q = 4.14
Em = 4.25
bulkindex = 1
gbindex = 1
surfindex = 1
[]
# Everything else
[ns_y_min]
type = DerivativeParsedMaterial
property_name = ns_y_min
coupled_variables = 'gr0 gr1 T'
constant_names = 'Ef_B Ef_GB kB Va_Y'
constant_expressions = '4.37 4.37 8.617343e-5 0.03726'
derivative_order = 2
expression = 'bnds:=gr0^2 + gr1^2; Ef:=Ef_B + 4.0 * (Ef_GB - Ef_B) * (1.0 - bnds)^2;
'
' exp(-Ef/kB/T) / Va_Y'
[]
[ns_o_min]
type = DerivativeParsedMaterial
property_name = ns_o_min
coupled_variables = 'gr0 gr1 T'
constant_names = 'Ef_B Ef_GB kB Va_O'
constant_expressions = '4.37 4.37 8.617343e-5 0.02484'
derivative_order = 2
expression = 'bnds:=gr0^2 + gr1^2; Ef:=Ef_B + 4.0 * (Ef_GB - Ef_B) * (1.0 - bnds)^2;
'
' exp(-Ef/kB/T) / Va_O'
[]
[sintering]
type = ElectrochemicalSinteringMaterial
chemical_potentials = 'wvy wvo'
electric_potential = V
void_op = phi
Temperature = T
surface_energy = 6.24
grainboundary_energy = 5.18
solid_energy_coefficients = 'kv_cat kv_cat'
void_energy_coefficients = 'kv_cat kv_an'
min_vacancy_concentrations_solid = 'ns_y_min ns_o_min'
min_vacancy_concentrations_void = '26.837 40.256'
defect_charges = '-3 2'
solid_relative_permittivity = 30
solid_energy_model = DILUTE
[]
[density_chi_y]
type = ElectrochemicalDefectMaterial
chemical_potential = wvy
void_op = phi
Temperature = T
electric_potential = V
void_density_name = nv_cat
solid_density_name = ns_cat
chi_name = chi_cat
void_energy_coefficient = kv_cat
min_vacancy_concentration_solid = ns_y_min
min_vacancy_concentration_void = 26.837
solid_energy_model = DILUTE
defect_charge = -3
solid_relative_permittivity = 30
[]
[density_chi_o]
type = ElectrochemicalDefectMaterial
chemical_potential = wvo
void_op = phi
Temperature = T
electric_potential = V
void_density_name = nv_an
solid_density_name = ns_an
chi_name = chi_an
void_energy_coefficient = kv_an
min_vacancy_concentration_solid = ns_o_min
min_vacancy_concentration_void = 40.256
solid_energy_model = DILUTE
defect_charge = 2
solid_relative_permittivity = 30
[]
[permittivity]
type = DerivativeParsedMaterial
property_name = permittivity
coupled_variables = 'phi'
material_property_names = 'hs hv'
constant_names = 'eps_rel_solid eps_void_over_e'
constant_expressions = '30 5.52e-2' #eps_void_over_e in 1/V/nm
derivative_order = 2
expression = '-hs * eps_rel_solid * eps_void_over_e - hv * eps_void_over_e'
[]
[void_pre]
type = DerivativeParsedMaterial
property_name = void_pre
material_property_names = 'hv'
constant_names = 'Z_cat Z_an nv_y_min nv_o_min'
constant_expressions = '-3 2 26.837 40.256'
derivative_order = 2
expression = '-hv * (Z_cat * nv_y_min + Z_an * nv_o_min)'
[]
[cat_mu_pre]
type = DerivativeParsedMaterial
property_name = cat_mu_pre
material_property_names = 'hv kv_cat'
constant_names = 'Z_cat'
constant_expressions = '-3'
derivative_order = 2
expression = '-hv * Z_cat / kv_cat'
[]
[an_mu_pre]
type = DerivativeParsedMaterial
property_name = an_mu_pre
material_property_names = 'hv kv_an'
constant_names = 'Z_an'
constant_expressions = '2'
derivative_order = 2
expression = '-hv * Z_an / kv_an'
[]
[cat_V_pre]
type = DerivativeParsedMaterial
property_name = cat_V_pre
material_property_names = 'hv kv_cat'
constant_names = 'Z_cat v_scale e '
constant_expressions = '-3 1 1'
derivative_order = 2
expression = 'hv * Z_cat^2 * e * v_scale / kv_cat'
[]
[an_V_pre]
type = DerivativeParsedMaterial
property_name = an_V_pre
material_property_names = 'hv kv_an'
constant_names = 'Z_an v_scale e '
constant_expressions = '2 1 1'
derivative_order = 2
expression = 'hv * Z_an^2 * e * v_scale / kv_an'
[]
[]
#This action adds most kernels needed for grand potential model
[Modules]
[PhaseField]
[GrandPotential]
switching_function_names = 'hv hs'
anisotropic = 'true true'
chemical_potentials = 'wvy wvo'
mobilities = 'chiDy chiDo'
susceptibilities = 'chi_cat chi_an'
free_energies_w = 'nv_cat ns_cat nv_an ns_an'
gamma_gr = gamma
mobility_name_gr = L
kappa_gr = kappa
free_energies_gr = 'omegav omegas'
additional_ops = 'phi'
gamma_grxop = gamma
mobility_name_op = Lv
kappa_op = kappa
free_energies_op = 'omegav omegas'
[]
[]
[]
[Kernels]
[barrier_phi]
type = ACBarrierFunction
variable = phi
v = 'gr0 gr1'
gamma = gamma
mob_name = Lv
[]
[kappa_phi]
type = ACKappaFunction
variable = phi
mob_name = Lv
kappa_name = kappa
[]
[Laplace]
type = MatDiffusion
variable = V
diffusivity = permittivity
args = 'phi'
[]
[potential_void_constants]
type = MaskedBodyForce
variable = V
coupled_variables = 'phi'
mask = void_pre
[]
[potential_cat_mu]
type = MatReaction
variable = V
v = wvy
mob_name = cat_mu_pre
[]
[potential_an_mu]
type = MatReaction
variable = V
v = wvo
mob_name = an_mu_pre
[]
[potential_cat_V]
type = MatReaction
variable = V
mob_name = cat_V_pre
[]
[potential_an_V]
type = MatReaction
variable = V
mob_name = an_V_pre
[]
[potential_solid_cat]
type = MaskedExponential
variable = V
w = wvy
T = T
coupled_variables = 'phi gr0 gr1'
mask = hs
species_charge = -3
n_eq = ns_y_min
[]
[potential_solid_an]
type = MaskedExponential
variable = V
w = wvo
T = T
coupled_variables = 'phi gr0 gr1'
mask = hs
species_charge = 2
n_eq = ns_o_min
[]
[]
[AuxKernels]
[bnds_aux]
type = BndsCalcAux
variable = bnds
execute_on = 'initial timestep_end'
[]
[negative_V]
type = ParsedAux
variable = negative_V
coupled_variables = V
expression = '-V'
[]
[E_x]
type = VariableGradientComponent
variable = E_x
gradient_variable = negative_V
component = x
[]
[E_y]
type = VariableGradientComponent
variable = E_y
gradient_variable = negative_V
component = y
[]
[ns_cat_aux]
type = MaterialRealAux
variable = ns_cat_aux
property = ns_cat
[]
[ns_an_aux]
type = MaterialRealAux
variable = ns_an_aux
property = ns_an
[]
[]
[Postprocessors]
[ns_cat_total]
type = ElementIntegralMaterialProperty
mat_prop = ns_cat
[]
[ns_an_total]
type = ElementIntegralMaterialProperty
mat_prop = ns_an
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK
petsc_options_iname = '-pc_type -sub_pc_type -pc_asm_overlap -ksp_gmres_restart -sub_ksp_type'
petsc_options_value = ' asm lu 1 31 preonly'
nl_max_its = 40
l_max_its = 30
l_tol = 1e-4
nl_rel_tol = 1e-8
nl_abs_tol = 1e-13
start_time = 0
num_steps = 2
automatic_scaling = true
[TimeStepper]
type = IterationAdaptiveDT
dt = 1
optimal_iterations = 8
iteration_window = 2
[]
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/boussinesq/transient-wcnsfv.i)
mu = 1
rho = 'rho'
k = 1
cp = 1
l = 10
velocity_interp_method = 'rc'
advected_interp_method = 'average'
cold_temp=300
hot_temp=310
[GlobalParams]
two_term_boundary_expansion = true
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = ${l}
nx = 16
ny = 16
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = 1e5
[]
[T]
type = INSFVEnergyVariable
scaling = 1e-4
initial_condition = ${cold_temp}
[]
[]
[AuxVariables]
[U]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[vel_x]
order = FIRST
family = MONOMIAL
[]
[vel_y]
order = FIRST
family = MONOMIAL
[]
[viz_T]
order = FIRST
family = MONOMIAL
[]
[]
[AuxKernels]
[mag]
type = VectorMagnitudeAux
variable = U
x = u
y = v
execute_on = 'initial timestep_end'
[]
[vel_x]
type = ParsedAux
variable = vel_x
expression = 'u'
execute_on = 'initial timestep_end'
coupled_variables = 'u'
[]
[vel_y]
type = ParsedAux
variable = vel_y
expression = 'v'
execute_on = 'initial timestep_end'
coupled_variables = 'v'
[]
[viz_T]
type = ParsedAux
variable = viz_T
expression = 'T'
execute_on = 'initial timestep_end'
coupled_variables = 'T'
[]
[]
[FVKernels]
[mass_time]
type = WCNSFVMassTimeDerivative
variable = pressure
drho_dt = drho_dt
[]
[mass]
type = WCNSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = u
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[u_gravity]
type = INSFVMomentumGravity
variable = u
gravity = '0 -1 0'
rho = ${rho}
momentum_component = 'x'
[]
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = v
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[v_gravity]
type = INSFVMomentumGravity
variable = v
gravity = '0 -1 0'
rho = ${rho}
momentum_component = 'y'
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[]
[FVBCs]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = u
boundary = 'left right top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = v
boundary = 'left right top bottom'
function = 0
[]
[T_hot]
type = FVDirichletBC
variable = T
boundary = left
value = ${hot_temp}
[]
[T_cold]
type = FVDirichletBC
variable = T
boundary = right
value = ${cold_temp}
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T'
rho = ${rho}
[]
[]
[Functions]
[lid_function]
type = ParsedFunction
expression = '4*x*(1-x)'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
steady_state_detection = true
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-5
optimal_iterations = 6
[]
nl_abs_tol = 1e-9
normalize_solution_diff_norm_by_dt = false
nl_max_its = 10
[]
[Outputs]
[out]
type = Exodus
[]
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/natural_convection/natural_circulation_pipe.i)
# natural convection through a pipe
# Reference solution in "reference_pipe_natural_convection.py"
# Reference mdot: 0.0792 kg/s
# this input
# iy mdot
# 10 8.302364e-02
# 20 8.111192e-02
# 40 8.007924e-02
# 80 7.954403e-02
# 160 7.927201e-02
# Convergence to the analytical result is observed
height = 10.0
gravity = 9.81
p0 = 1e5
molar_mass = 29.0e-3
T0 = 328
Ru = 8.3145
Ri = '${fparse Ru / molar_mass}'
density = '${fparse p0 / (Ri * T0)}'
head = '${fparse height * density * gravity}'
k = 25.68e-3
gamma = 1.4
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '0.1'
ix = '2'
dy = '${height}'
iy = '5'
[]
[]
[GlobalParams]
rhie_chow_user_object = pins_rhie_chow_interpolator
[]
[FluidProperties]
[air]
type = IdealGasFluidProperties
molar_mass = ${molar_mass}
k = ${k}
gamma = ${gamma}
[]
[]
[Modules]
[NavierStokesFV]
compressibility = 'weakly-compressible'
add_energy_equation = true
gravity = '0 -${gravity} 0'
density = rho
dynamic_viscosity = mu
specific_heat = cp
thermal_conductivity = k
initial_velocity = '0 1e-6 0'
initial_pressure = ${p0}
initial_temperature = ${T0}
inlet_boundaries = 'bottom'
momentum_inlet_types = 'fixed-pressure'
momentum_inlet_function = '${fparse p0 + head}'
energy_inlet_types = 'fixed-temperature'
energy_inlet_function = '${T0}'
energy_scaling = 1e-5
wall_boundaries = 'left right'
momentum_wall_types = 'slip slip'
energy_wall_types = 'heatflux heatflux'
energy_wall_function = '300 300'
outlet_boundaries = 'top'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '${fparse p0}'
momentum_advection_interpolation = 'upwind'
mass_advection_interpolation = 'upwind'
porous_medium_treatment = true
porosity = porosity
energy_advection_interpolation = 'average'
[]
[]
[FVKernels]
[u_friction]
type = INSFVMomentumFriction
variable = superficial_vel_x
linear_coef_name = linear_friction_coeff
momentum_component = 'x'
[]
[v_friction]
type = INSFVMomentumFriction
variable = superficial_vel_y
linear_coef_name = linear_friction_coeff
momentum_component = 'y'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-6
end_time = 1e4
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.1
growth_factor = 2
iteration_window = 2
optimal_iterations = 6
[]
[]
[Functions]
[mu_rampdown_fn]
type = PiecewiseLinear
x = '0 0.5 1 5 10 100 1000 2000'
y = '1000 1000 100 10 1 1 1 0'
[]
[]
[FunctorMaterials]
[fluid_props_to_mat_props]
type = GeneralFunctorFluidProps
fp = air
pressure = pressure
T_fluid = T_fluid
speed = speed
force_define_density = true
mu_rampdown = 'mu_rampdown_fn'
characteristic_length = 1
porosity = porosity
[]
[scalar_props]
type = ADGenericFunctorMaterial
prop_names = 'porosity loss_coeff'
prop_values = '1 1.3'
[]
[linear_friction_coeff]
type = ADParsedFunctorMaterial
property_name = 'linear_friction_coeff'
expression = 'loss_coeff * rho'
functor_names = 'loss_coeff rho'
[]
[]
[AuxVariables]
[rho_var]
type = MooseVariableFVReal
[]
[cp_var]
type = MooseVariableFVReal
[]
[rho_cp_T_fluid_var]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[rho_var_aux]
type = FunctorAux
variable = rho_var
functor = rho
[]
[cp_var_aux]
type = FunctorAux
variable = cp_var
functor = cp
[]
[rho_cp_T_fluid_var_aux]
type = ParsedAux
variable = rho_cp_T_fluid_var
coupled_variables = 'rho_var cp_var T_fluid'
expression = 'rho_var * cp_var * T_fluid'
[]
[]
[Postprocessors]
[inlet_mfr]
type = VolumetricFlowRate
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = rho
boundary = bottom
advected_interp_method = average
[]
[outlet_mfr]
type = VolumetricFlowRate
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = rho
boundary = top
advected_interp_method = average
[]
[inlet_energy]
type = VolumetricFlowRate
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = rho_cp_T_fluid_var
boundary = bottom
advected_interp_method = average
[]
[outlet_energy]
type = VolumetricFlowRate
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = rho_cp_T_fluid_var
boundary = top
advected_interp_method = average
[]
[]
[Debug]
show_var_residual_norms = true
[]
[Outputs]
exodus = true
[]
(modules/combined/examples/publications/rapid_dev/fig3.i)
#
# Fig. 3 input for 10.1016/j.commatsci.2017.02.017
# D. Schwen et al./Computational Materials Science 132 (2017) 36-45
# Comparison of an analytical (ca) and numerical (c) phase field interface
# profile. Supply the L parameter on the command line to gather the data for
# the inset plot.
#
[Mesh]
type = GeneratedMesh
dim = 1
nx = ${L}
xmin = -30
xmax = 30
[]
[Functions]
[./solution]
type = ParsedFunction
expression = 0.5*(1+tanh(x/2^0.5))
[../]
[]
[Variables]
[./c]
[./InitialCondition]
type = FunctionIC
function = solution
#type = FunctionIC
#function = if(x>0,1,0)
[../]
[../]
[./w]
[../]
[]
[AuxVariables]
[./diff]
[../]
[./ca]
[./InitialCondition]
type = FunctionIC
function = '0.5*(1+tanh(x/2^0.5))'
[../]
[../]
[]
[AuxKernels]
[./diff]
type = ParsedAux
variable = diff
expression = c-ca
coupled_variables = 'c ca'
[../]
[]
[Materials]
[./F]
type = DerivativeParsedMaterial
property_name = F
expression = 'c^2*(1-c)^2'
coupled_variables = c
[../]
[]
[Kernels]
# Split Cahn-Hilliard kernels
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = 1
w = w
[../]
[./wres]
type = SplitCHWRes
variable = w
mob_name = 1
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[]
[Postprocessors]
[./L2]
type = ElementL2Error
function = solution
variable = c
[../]
[]
[VectorPostprocessors]
[./c]
type = LineValueSampler
variable = 'c ca diff'
start_point = '-10 0 0'
end_point = '10 0 0'
num_points = 200
sort_by = x
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
nl_rel_tol = 1e-10
nl_abs_tol = 1e-12
end_time = 1e+6
[./TimeStepper]
type = IterationAdaptiveDT
dt = 1
optimal_iterations = 5
iteration_window = 1
[../]
[]
[Outputs]
csv = true
execute_on = final
[]
(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
[]
(modules/porous_flow/test/tests/dispersion/disp01.i)
# Test dispersive part of PorousFlowDispersiveFlux kernel by setting diffusion
# coefficients to zero. A pressure gradient is applied over the mesh to give a
# uniform velocity. Gravity is set to zero.
# Mass fraction is set to 1 on the left hand side and 0 on the right hand side.
[Mesh]
type = GeneratedMesh
dim = 1
nx = 100
xmax = 10
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[Variables]
[pp]
[]
[massfrac0]
[]
[]
[AuxVariables]
[velocity]
family = MONOMIAL
order = FIRST
[]
[]
[AuxKernels]
[velocity]
type = PorousFlowDarcyVelocityComponent
variable = velocity
component = x
[]
[]
[ICs]
[pp]
type = FunctionIC
variable = pp
function = pic
[]
[massfrac0]
type = ConstantIC
variable = massfrac0
value = 0
[]
[]
[Functions]
[pic]
type = ParsedFunction
expression = 1.1e5-x*1e3
[]
[]
[BCs]
[xleft]
type = DirichletBC
value = 1
variable = massfrac0
boundary = left
[]
[xright]
type = DirichletBC
value = 0
variable = massfrac0
boundary = right
[]
[pright]
type = DirichletBC
variable = pp
boundary = right
value = 1e5
[]
[pleft]
type = DirichletBC
variable = pp
boundary = left
value = 1.1e5
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = pp
[]
[adv0]
type = PorousFlowAdvectiveFlux
fluid_component = 0
variable = pp
[]
[diff0]
type = PorousFlowDispersiveFlux
variable = pp
disp_trans = 0
disp_long = 0.2
[]
[mass1]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = massfrac0
[]
[adv1]
type = PorousFlowAdvectiveFlux
fluid_component = 1
variable = massfrac0
[]
[diff1]
type = PorousFlowDispersiveFlux
fluid_component = 1
variable = massfrac0
disp_trans = 0
disp_long = 0.2
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pp massfrac0'
number_fluid_phases = 1
number_fluid_components = 2
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 1e9
density0 = 1000
viscosity = 0.001
thermal_expansion = 0
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
[]
[ppss]
type = PorousFlow1PhaseFullySaturated
porepressure = pp
[]
[massfrac]
type = PorousFlowMassFraction
mass_fraction_vars = massfrac0
[]
[simple_fluid]
type = PorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[poro]
type = PorousFlowPorosityConst
porosity = 0.3
[]
[diff]
type = PorousFlowDiffusivityConst
diffusion_coeff = '0 0'
tortuosity = 0.1
[]
[relp]
type = PorousFlowRelativePermeabilityConst
phase = 0
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-9 0 0 0 1e-9 0 0 0 1e-9'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
petsc_options_value = 'gmres asm lu NONZERO 2 '
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 1e3
dtmax = 50
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.5
cutback_factor = 0.5
dt = 1
[]
[]
[VectorPostprocessors]
[xmass]
type = NodalValueSampler
sort_by = id
variable = massfrac0
[]
[]
[Outputs]
[out]
type = CSV
execute_on = final
[]
[]
(modules/phase_field/examples/ebsd_reconstruction/IN100-111grn.i)
[Mesh]
[ebsd_mesh]
type = EBSDMeshGenerator
filename = IN100_120x120.txt
pre_refine = 2
[]
[]
[GlobalParams]
op_num = 8
var_name_base = gr
[]
[UserObjects]
[ebsd_reader]
type = EBSDReader
[]
[ebsd]
type = PolycrystalEBSD
coloring_algorithm = bt
ebsd_reader = ebsd_reader
enable_var_coloring = true
[]
[grain_tracker]
type = GrainTracker
flood_entity_type = ELEMENTAL
compute_halo_maps = true # For displaying HALO fields
polycrystal_ic_uo = ebsd
[]
[]
[ICs]
[PolycrystalICs]
[PolycrystalColoringIC]
polycrystal_ic_uo = ebsd
[]
[]
[]
[Variables]
[PolycrystalVariables]
[]
[]
[AuxVariables]
[bnds]
[]
[unique_grains_ic]
order = CONSTANT
family = MONOMIAL
[]
[unique_grains]
order = CONSTANT
family = MONOMIAL
[]
[ghost_elements]
order = CONSTANT
family = MONOMIAL
[]
[halos]
order = CONSTANT
family = MONOMIAL
[]
[var_indices_ic]
order = CONSTANT
family = MONOMIAL
[]
[var_indices]
order = CONSTANT
family = MONOMIAL
[]
[ebsd_grains]
family = MONOMIAL
order = CONSTANT
[]
[]
[Kernels]
[PolycrystalKernel]
[]
[]
[AuxKernels]
[BndsCalc]
type = BndsCalcAux
variable = bnds
execute_on = 'initial timestep_end'
[]
[ghost_elements]
type = FeatureFloodCountAux
variable = ghost_elements
field_display = GHOSTED_ENTITIES
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
[]
[halos]
type = FeatureFloodCountAux
variable = halos
field_display = HALOS
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
[]
[var_indices_ic]
type = FeatureFloodCountAux
variable = var_indices_ic
execute_on = 'initial'
flood_counter = ebsd
field_display = VARIABLE_COLORING
[]
[unique_grains_ic]
type = FeatureFloodCountAux
variable = unique_grains_ic
execute_on = 'initial'
flood_counter = ebsd
field_display = UNIQUE_REGION
[]
[var_indices]
type = FeatureFloodCountAux
variable = var_indices
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
[]
[unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
field_display = UNIQUE_REGION
[]
[grain_aux]
type = EBSDReaderPointDataAux
variable = ebsd_grains
ebsd_reader = ebsd_reader
data_name = 'feature_id'
execute_on = 'initial timestep_end'
[]
[]
[Modules]
[PhaseField]
[EulerAngles2RGB]
crystal_structure = cubic
euler_angle_provider = ebsd_reader
grain_tracker = grain_tracker
[]
[]
[]
[Materials]
[Copper]
# T = 500 # K
type = GBEvolution
T = 500
wGB = 0.6 # um
GBmob0 = 2.5e-6 # m^4/(Js) from Schoenfelder 1997
Q = 0.23 # Migration energy in eV
GBenergy = 0.708 # GB energy in J/m^2
molar_volume = 7.11e-6 # Molar volume in m^3/mol
length_scale = 1.0e-6
time_scale = 1.0e-6
[]
[]
[Postprocessors]
[dt]
type = TimestepSize
[]
[n_elements]
type = NumElems
execute_on = 'initial timestep_end'
[]
[n_nodes]
type = NumNodes
execute_on = 'initial timestep_end'
[]
[DOFs]
type = NumDOFs
[]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type -pc_hypre_boomeramg_strong_threshold'
petsc_options_value = 'hypre boomeramg 0.7'
l_tol = 1.0e-4
l_max_its = 20
nl_max_its = 20
nl_rel_tol = 1.0e-8
start_time = 0.0
num_steps = 30
[TimeStepper]
type = IterationAdaptiveDT
cutback_factor = 0.9
dt = 10.0
growth_factor = 1.1
optimal_iterations = 7
[]
[Adaptivity]
initial_adaptivity = 2
refine_fraction = 0.7
coarsen_fraction = 0.1
max_h_level = 2
[]
[]
[Outputs]
exodus = true
checkpoint = true
perf_graph = true
[]
(modules/navier_stokes/test/tests/finite_element/pins/expansion-channel/expansion-channel-slip-wall.i)
# This is an example showing the conservative form with combined velocity inlet condition,
# pressure outlet condition and slip wall boundary condition.
[GlobalParams]
gravity = '0 -9.8 0'
order = FIRST
family = LAGRANGE
u = vel_x
v = vel_y
pressure = p
temperature = T
porosity = porosity
eos = eos
conservative_form = true
p_int_by_parts = true
[]
[Mesh]
[file]
type = FileMeshGenerator
file = expansion-channel.e
[]
[add_corners]
type = ExtraNodesetGenerator
input = file
new_boundary = 'corners'
coord = '-0.05 -0.5 0; 0.05 -0.5 0; -0.1 0.5 0; 0.1 0.5 0'
[]
[]
[NodalNormals]
# boundaries 3 (left) and 4 (right) are walls
boundary = '3 4'
corner_boundary = 'corners'
[]
[FluidProperties]
[eos]
type = SimpleFluidProperties
density0 = 100 # kg/m^3
thermal_expansion = 0.001 # K^{-1}
cp = 100
viscosity = 0.1 # Pa-s, Re=rho*u*L/mu = 100*1*0.1/0.1 = 100
thermal_conductivity = 72
[]
[]
[Variables]
# velocities
[vel_x]
scaling = 1e-1
initial_condition = 0
[]
[vel_y]
scaling = 1e-2
initial_condition = 1
[]
# Pressure
[p]
initial_condition = 1.01e5
[]
# Temperature
[T]
scaling = 1e-4
initial_condition = 630
[]
[]
[AuxVariables]
[rho]
initial_condition = 77.0
[]
[porosity]
initial_condition = 0.6
[]
[vol_heat]
initial_condition = 1e3
[]
[]
[Materials]
[mat]
type = PINSFEMaterial
alpha = 1e3
beta = 100
[]
[]
[Kernels]
# mass balance (continuity) equation
[mass_time]
type = PINSFEFluidPressureTimeDerivative
variable = p
[]
[mass_space]
type = INSFEFluidMassKernel
variable = p
[]
# momentum equations for x- and y- velocities
[x_momentum_time]
type = PINSFEFluidVelocityTimeDerivative
variable = vel_x
[]
[x_momentum_space]
type = INSFEFluidMomentumKernel
variable = vel_x
component = 0
[]
[y_momentum_time]
type = PINSFEFluidVelocityTimeDerivative
variable = vel_y
[]
[y_momentum_space]
type = INSFEFluidMomentumKernel
variable = vel_y
component = 1
[]
# fluid energy equation
[temperature_time]
type = PINSFEFluidTemperatureTimeDerivative
variable = T
[]
[temperature_space]
type = INSFEFluidEnergyKernel
variable = T
power_density = vol_heat
[]
[]
[AuxKernels]
[rho_aux]
type = FluidDensityAux
variable = rho
p = p
T = T
fp = eos
[]
[]
[BCs]
# BCs for mass equation
# Inlet
[mass_inlet]
type = INSFEFluidMassBC
variable = p
boundary = '1'
[]
# Outlet
[mass_out]
type = INSFEFluidMassBC
variable = p
boundary = '2'
[]
# BCs for x-momentum equation
# Inlet
[vx_in]
type = INSFEFluidMomentumBC
variable = vel_x
boundary = '1'
component = 0
#p_fn = 1.05e5
v_fn = 1
[]
# Outlet
[vx_out]
type = INSFEFluidMomentumBC
variable = vel_x
boundary = '2'
component = 0
p_fn = 1e5
[]
# Walls (left and right walls)
[vx_wall]
type = INSFEFluidWallMomentumBC
variable = vel_x
boundary = '3 4'
component = 0
[]
# BCs for y-momentum equation
# Inlet
[vy_in]
type = INSFEFluidMomentumBC
variable = vel_y
boundary = '1'
component = 1
v_fn = 1
[]
# Outlet
[vy_out]
type = INSFEFluidMomentumBC
variable = vel_y
boundary = '2'
component = 1
p_fn = 1e5
[]
# Walls (left and right walls)
[vy_wall]
type = INSFEFluidWallMomentumBC
variable = vel_y
boundary = '3 4'
component = 1
[]
# Special slip-wall BCs for both x- and y- velocities
[slipwall]
type = INSFEMomentumFreeSlipBC
boundary = '3 4'
variable = vel_x
u = vel_x
v = vel_y
[]
# BCs for fluid energy equation
# Inlet
[T_in]
type = INSFEFluidEnergyBC
variable = T
boundary = '1'
T_fn = 630
[]
# Outlet
[T_out]
type = INSFEFluidEnergyBC
variable = T
boundary = '2'
T_fn = 630
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = FDP
full = true
solve_type = 'PJFNK'
[]
[]
[Executioner]
type = Transient
dt = 0.2
dtmin = 1.e-6
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.25
optimal_iterations = 15
linear_iteration_ratio = 100
dt = 0.1
cutback_factor = 0.5
cutback_factor_at_failure = 0.5
[]
dtmax = 25
petsc_options_iname = '-pc_type -ksp_gmres_restart'
petsc_options_value = 'lu 100'
nl_rel_tol = 1e-10
nl_abs_tol = 1e-8
nl_max_its = 12
l_tol = 1e-5
l_max_its = 100
start_time = 0.0
end_time = 500
num_steps = 2
[]
[Outputs]
perf_graph = true
print_linear_residuals = false
time_step_interval = 1
execute_on = 'initial timestep_end'
[console]
type = Console
output_linear = false
[]
[out]
type = Exodus
use_displaced = false
[]
[]
(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
[]
(modules/combined/examples/phase_field-mechanics/LandauPhaseTrans.i)
#
# Martensitic transformation
# Chemical driving force described by Landau Polynomial
# Coupled with elasticity (Mechanics)
#
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 100
ny = 100
xmin = 0
xmax = 100
ymin = 0
ymax = 100
elem_type = QUAD4
[]
[Variables]
[./eta1]
[./InitialCondition]
type = RandomIC
min = 0
max = 0.1
[../]
[../]
[./eta2]
[./InitialCondition]
type = RandomIC
min = 0
max = 0.1
[../]
[../]
[]
[Modules/TensorMechanics/Master]
[./all]
add_variables = true
generate_output = 'stress_xx stress_yy'
eigenstrain_names = 'eigenstrain1 eigenstrain2'
[../]
[]
[Kernels]
[./eta_bulk1]
type = AllenCahn
variable = eta1
args = 'eta2'
f_name = F
[../]
[./eta_bulk2]
type = AllenCahn
variable = eta2
args = 'eta1'
f_name = F
[../]
[./eta_interface1]
type = ACInterface
variable = eta1
kappa_name = kappa_eta
[../]
[./eta_interface2]
type = ACInterface
variable = eta2
kappa_name = kappa_eta
[../]
[./deta1dt]
type = TimeDerivative
variable = eta1
[../]
[./deta2dt]
type = TimeDerivative
variable = eta2
[../]
[]
[Materials]
[./consts]
type = GenericConstantMaterial
prop_names = 'L kappa_eta'
prop_values = '1 1'
[../]
[./chemical_free_energy]
type = DerivativeParsedMaterial
property_name = Fc
coupled_variables = 'eta1 eta2'
constant_names = 'A2 A3 A4'
constant_expressions = '0.2 -12.6 12.4'
expression = 'A2/2*(eta1^2+eta2^2) + A3/3*(eta1^3+eta2^3) + A4/4*(eta1^2+eta2^2)^2'
enable_jit = true
derivative_order = 2
[../]
[./elasticity_tensor]
type = ComputeElasticityTensor
C_ijkl = '700 300 300 700 300 700 300 300 300'
fill_method = symmetric9
[../]
[./stress]
type = ComputeLinearElasticStress
[../]
[./var_dependence1]
type = DerivativeParsedMaterial
property_name = var_dep1
coupled_variables = 'eta1'
expression = eta1
enable_jit = true
derivative_order = 2
[../]
[./var_dependence2]
type = DerivativeParsedMaterial
property_name = var_dep2
coupled_variables = 'eta2'
expression = eta2
enable_jit = true
derivative_order = 2
[../]
[./eigenstrain1]
type = ComputeVariableEigenstrain
eigen_base = '0.1 -0.1 0 0 0 0'
prefactor = var_dep1
args = 'eta1'
eigenstrain_name = eigenstrain1
[../]
[./eigenstrain2]
type = ComputeVariableEigenstrain
eigen_base = '-0.1 0.1 0 0 0 0'
prefactor = var_dep2
args = 'eta2'
eigenstrain_name = eigenstrain2
[../]
[./elastic_free_energy]
type = ElasticEnergyMaterial
f_name = Fe
args = 'eta1 eta2'
derivative_order = 2
[../]
[./totol_free_energy]
type = DerivativeSumMaterial
property_name = F
sum_materials = 'Fc Fe'
coupled_variables = 'eta1 eta2'
derivative_order = 2
[../]
[]
[BCs]
[./all_y]
type = DirichletBC
variable = disp_y
boundary = 'top bottom left right'
value = 0
[../]
[./all_x]
type = DirichletBC
variable = disp_x
boundary = 'top bottom left right'
value = 0
[../]
[]
[Preconditioning]
# active = ' '
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
# this gives best performance on 4 cores
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -sub_pc_type '
petsc_options_value = 'asm lu'
l_max_its = 30
nl_max_its = 10
l_tol = 1.0e-4
nl_rel_tol = 1.0e-8
nl_abs_tol = 1.0e-10
start_time = 0.0
num_steps = 10
[./TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 9
iteration_window = 2
growth_factor = 1.1
cutback_factor = 0.75
dt = 0.3
[../]
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(modules/navier_stokes/examples/flow-over-circle/executioner_postprocessor.i)
[Functions]
[inlet_function]
type = ParsedFunction
expression = '4*U*(y-ymin)*(ymax-y)/(ymax-ymin)/(ymax-ymin)'
symbol_names = 'U ymax ymin'
symbol_values = '${inlet_velocity} ${y_max} ${y_min}'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options = '-snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
line_search = 'none'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-10
nl_max_its = 10
end_time = 15
dtmax = 2e-2
dtmin = 1e-5
scheme = 'bdf2'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-3
optimal_iterations = 6
growth_factor = 1.5
[]
[]
[Outputs]
exodus = true
csv = true
checkpoint = true
[]
[Postprocessors]
[Re]
type = ParsedPostprocessor
function = 'rho * U * D / mu'
constant_names = 'rho U D mu'
constant_expressions = '${rho} ${fparse 2/3*inlet_velocity} ${fparse 2*circle_radius} ${mu}'
pp_names = ''
[]
[point_vel_x]
type = PointValue
point = '${fparse (x_max-x_min)/2} ${fparse (y_max-y_min)/2} 0'
variable = 'vel_x'
[]
[point_vel_y]
type = PointValue
point = '${fparse (x_max-x_min)/2} ${fparse (y_max-y_min)/2} 0'
variable = 'vel_y'
[]
[drag_force]
type = IntegralDirectedSurfaceForce
vel_x = vel_x
vel_y = vel_y
mu = ${mu}
pressure = pressure
principal_direction = '1 0 0'
boundary = 'circle'
outputs = none
execute_on = 'INITIAL TIMESTEP_END'
[]
[drag_coeff]
type = ParsedPostprocessor
function = '2*drag_force/rho/(avgvel*avgvel)/D'
constant_names = 'rho avgvel D'
constant_expressions = '${rho} ${fparse 2/3*inlet_velocity} ${fparse 2*circle_radius}'
pp_names = 'drag_force'
execute_on = 'INITIAL TIMESTEP_END'
[]
[lift_force]
type = IntegralDirectedSurfaceForce
vel_x = vel_x
vel_y = vel_y
mu = ${mu}
pressure = pressure
principal_direction = '0 1 0'
boundary = 'circle'
outputs = none
execute_on = 'INITIAL TIMESTEP_END'
[]
[lift_coeff]
type = ParsedPostprocessor
function = '2*lift_force/rho/(avgvel*avgvel)/D'
constant_names = 'rho avgvel D'
constant_expressions = '${rho} ${fparse 2/3*inlet_velocity} ${fparse 2*circle_radius}'
pp_names = 'lift_force'
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
(modules/phase_field/examples/grain_growth/grain_growth_2D_voronoi.i)
# This simulation predicts GB migration of a 2D copper polycrystal with 15 grains
# Mesh adaptivity and time step adaptivity are used
# An AuxVariable is used to calculate the grain boundary locations
# Postprocessors are used to record time step and the number of grains
# We are not using the GrainTracker in this example so the number
# of order paramaters must match the number of grains.
[Mesh]
# Mesh block. Meshes can be read in or automatically generated
type = GeneratedMesh
dim = 2 # Problem dimension
nx = 12 # Number of elements in the x-direction
ny = 12 # Number of elements in the y-direction
nz = 0 # Number of elements in the z-direction
xmin = 0 # minimum x-coordinate of the mesh
xmax = 1000 # maximum x-coordinate of the mesh
ymin = 0 # minimum y-coordinate of the mesh
ymax = 1000 # maximum y-coordinate of the mesh
zmin = 0
zmax = 0
elem_type = QUAD4 # Type of elements used in the mesh
uniform_refine = 3 # Initial uniform refinement of the mesh
parallel_type = replicated # Periodic BCs
[]
[GlobalParams]
# Parameters used by several kernels that are defined globally to simplify input file
op_num = 15 # Number of grains
var_name_base = gr # Base name of grains
[]
[UserObjects]
[./voronoi]
type = PolycrystalVoronoi
grain_num = 15
rand_seed = 42
coloring_algorithm = bt # We must use bt to force the UserObject to assign one grain to each op
[../]
[]
[ICs]
[./PolycrystalICs]
[./PolycrystalColoringIC]
polycrystal_ic_uo = voronoi
[../]
[../]
[]
[Variables]
# Variable block, where all variables in the simulation are declared
[./PolycrystalVariables]
# Custom action that created all of the grain variables
order = FIRST # element type used by each grain variable
family = LAGRANGE
[../]
[]
[AuxVariables]
#active = ''
# Dependent variables
[./bnds]
# Variable used to visualize the grain boundaries in the simulation
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
# Kernel block, where the kernels defining the residual equations are set up.
[./PolycrystalKernel]
# Custom action creating all necessary kernels for grain growth. All input parameters are up in GlobalParams
[../]
[]
[AuxKernels]
#active = ''
# AuxKernel block, defining the equations used to calculate the auxvars
[./bnds_aux]
# AuxKernel that calculates the GB term
type = BndsCalcAux
variable = bnds
execute_on = timestep_end
[../]
[]
[BCs]
# Boundary Condition block
[./Periodic]
[./top_bottom]
auto_direction = 'x y' # Makes problem periodic in the x and y directions
[../]
[../]
[]
[Materials]
[./CuGrGr]
# Material properties
type = GBEvolution # Quantitative material properties for copper grain growth. Dimensions are nm and ns
GBmob0 = 2.5e-6 #Mobility prefactor for Cu from schonfelder1997molecular bibtex entry
GBenergy = 0.708 #GB energy for Cu from schonfelder1997molecular bibtex entry
Q = 0.23 #Activation energy for grain growth from Schonfelder 1997
T = 450 # K #Constant temperature of the simulation (for mobility calculation)
wGB = 14 # nm #Width of the diffuse GB
[../]
[]
[Postprocessors]
active = 'dt '
# Scalar postprocessors
[./dt]
# Outputs the current time step
type = TimestepSize
[../]
[]
[Executioner]
type = Transient # Type of executioner, here it is transient with an adaptive time step
scheme = bdf2 # Type of time integration (2nd order backward euler), defaults to 1st order backward euler
#Preconditioned JFNK (default)
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart -mat_mffd_type'
petsc_options_value = 'hypre boomeramg 101 ds'
l_max_its = 30 # Max number of linear iterations
l_tol = 1e-4 # Relative tolerance for linear solves
nl_max_its = 40 # Max number of nonlinear iterations
nl_abs_tol = 1e-11 # Relative tolerance for nonlienar solves
nl_rel_tol = 1e-8 # Absolute tolerance for nonlienar solves
start_time = 0.0
end_time = 4000
[./TimeStepper]
type = IterationAdaptiveDT
dt = 25 # Initial time step. In this simulation it changes.
optimal_iterations = 6 #Time step will adapt to maintain this number of nonlinear iterations
[../]
[./Adaptivity]
# Block that turns on mesh adaptivity. Note that mesh will never coarsen beyond initial mesh (before uniform refinement)
initial_adaptivity = 2 # Number of times mesh is adapted to initial condition
refine_fraction = 0.7 # Fraction of high error that will be refined
coarsen_fraction = 0.1 # Fraction of low error that will coarsened
max_h_level = 4 # Max number of refinements used, starting from initial mesh (before uniform refinement)
[../]
[]
[Outputs]
exodus = true
csv = true
[./console]
type = Console
max_rows = 20
[../]
[]
(modules/solid_mechanics/test/tests/anisotropic_plasticity/ad_aniso_plasticity_x_rotate.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 3
nx = 10
ny = 2
nz = 2
xmin = 0.0
ymin = 0.0
zmin = 0.0
xmax = 10.0
ymax = 1.0
zmax = 1.0
[]
[corner_node]
type = ExtraNodesetGenerator
new_boundary = '100'
nodes = '3 69'
input = gen
[]
[corner_node_2]
type = ExtraNodesetGenerator
new_boundary = '101'
nodes = '4 47'
input = corner_node
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
volumetric_locking_correction = true
[]
[AuxVariables]
[hydrostatic_stress]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_xx]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_xy]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_zz]
order = CONSTANT
family = MONOMIAL
[]
[stress_yy]
order = CONSTANT
family = MONOMIAL
[]
[elastic_strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[hydrostatic_stress]
type = ADRankTwoScalarAux
variable = hydrostatic_stress
rank_two_tensor = stress
scalar_type = Hydrostatic
[]
[plasticity_strain_xx]
type = ADRankTwoAux
rank_two_tensor = trial_plasticity_plastic_strain
variable = plastic_strain_xx
index_i = 0
index_j = 0
[]
[plasticity_strain_xy]
type = ADRankTwoAux
rank_two_tensor = trial_plasticity_plastic_strain
variable = plastic_strain_xy
index_i = 0
index_j = 1
[]
[plasticity_strain_yy]
type = ADRankTwoAux
rank_two_tensor = trial_plasticity_plastic_strain
variable = plastic_strain_yy
index_i = 1
index_j = 1
[]
[plasticity_strain_zz]
type = ADRankTwoAux
rank_two_tensor = trial_plasticity_plastic_strain
variable = plastic_strain_zz
index_i = 2
index_j = 2
[]
[sigma_xx]
type = ADRankTwoAux
rank_two_tensor = stress
variable = stress_xx
index_i = 1
index_j = 1
[]
[elastic_strain_yy]
type = ADRankTwoAux
rank_two_tensor = elastic_strain
variable = elastic_strain_yy
index_i = 1
index_j = 1
[]
[sigma_yy]
type = ADRankTwoAux
rank_two_tensor = stress
variable = stress_yy
index_i = 1
index_j = 1
[]
[]
[Functions]
[pull]
type = PiecewiseLinear
x = '0 1e1 1e8'
y = '0 -4e2 -4e2'
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = FINITE
generate_output = 'elastic_strain_xx stress_xx'
use_automatic_differentiation = true
add_variables = true
[]
[]
[Materials]
[elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 70000
poissons_ratio = 0.25
[]
[elastic_strain]
type = ADComputeMultipleInelasticStress
inelastic_models = "trial_plasticity"
max_iterations = 50
absolute_tolerance = 1e-16
[]
[hill_tensor]
type = ADHillConstants
# F G H L M N
hill_constants = "0.5829856 0.364424 0.6342174 2.0691375 2.3492325 1.814589"
base_name = trial_plasticity
rotation_angles = '90 90 90'
[]
[trial_plasticity]
type = ADHillPlasticityStressUpdate
hardening_constant = 2000.0
yield_stress = 0.001 # was 200 for verification
absolute_tolerance = 1e-14
relative_tolerance = 1e-12
base_name = trial_plasticity
internal_solve_full_iteration_history = true
max_inelastic_increment = 2.0e-6
internal_solve_output_on = on_error
[]
[]
[BCs]
[no_disp_x]
type = ADDirichletBC
variable = disp_x
boundary = left
value = 0.0
[]
[no_disp_y]
type = ADDirichletBC
variable = disp_y
boundary = 100
value = 0.0
[]
[no_disp_z]
type = ADDirichletBC
variable = disp_z
boundary = 101
value = 0.0
[]
[Pressure]
[Side1]
boundary = right
function = pull
[]
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_rel_tol = 1e-11
nl_abs_tol = 1.0e-14
l_max_its = 90
num_steps = 25
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 30
iteration_window = 9
growth_factor = 1.05
cutback_factor = 0.5
timestep_limiting_postprocessor = matl_ts_min
dt = 1.0e-5
time_t = '0 3.4e-5 10'
time_dt = '1.0e-5 1.0e-7 1.0e-7'
[]
start_time = 0
automatic_scaling = true
[]
[Postprocessors]
[matl_ts_min]
type = MaterialTimeStepPostprocessor
[]
[max_disp_x]
type = ElementExtremeValue
variable = disp_x
[]
[max_disp_y]
type = ElementExtremeValue
variable = disp_y
[]
[max_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
[]
[dt]
type = TimestepSize
[]
[num_lin]
type = NumLinearIterations
outputs = console
[]
[num_nonlin]
type = NumNonlinearIterations
outputs = console
[]
[plasticity_strain_yy]
type = ElementalVariableValue
variable = plastic_strain_yy
execute_on = 'TIMESTEP_END'
elementid = 39
[]
[elastic_strain_yy]
type = ElementalVariableValue
variable = elastic_strain_yy
execute_on = 'TIMESTEP_END'
elementid = 39
[]
[sigma_yy]
type = ElementalVariableValue
variable = stress_yy
execute_on = 'TIMESTEP_END'
elementid = 39
[]
[plasticity_strain_xx]
type = ElementalVariableValue
variable = plastic_strain_xx
execute_on = 'TIMESTEP_END'
elementid = 39
[]
[elastic_strain_xx]
type = ElementalVariableValue
variable = elastic_strain_xx
execute_on = 'TIMESTEP_END'
elementid = 39
[]
[sigma_xx]
type = ElementalVariableValue
variable = stress_xx
execute_on = 'TIMESTEP_END'
elementid = 39
[]
[plasticity_strain_zz]
type = ElementalVariableValue
variable = plastic_strain_zz
execute_on = 'TIMESTEP_END'
elementid = 39
[]
[]
[Outputs]
csv = true
perf_graph = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/neighbor-connected-boundary/test.i)
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '5 5 5 10 5'
ix = '5 5 5 10 5'
dy = '5 10 5 5 5'
iy = '5 10 5 5 5'
subdomain_id = '2 3 2 2 2
2 1 2 2 2
2 1 2 2 2
2 1 1 1 4
2 2 2 2 2'
[]
[attached_to_fluid_block_inlet]
type = SideSetsBetweenSubdomainsGenerator
primary_block = 1
paired_block = 3
input = gen
new_boundary = attached_to_fluid_block_inlet
[]
[attached_to_fluid_block_outlet]
type = SideSetsBetweenSubdomainsGenerator
primary_block = 1
paired_block = 4
input = attached_to_fluid_block_inlet
new_boundary = attached_to_fluid_block_outlet
[]
[attached_to_fluid_block_walls]
type = SideSetsBetweenSubdomainsGenerator
input = attached_to_fluid_block_outlet
primary_block = '1'
paired_block = '2'
new_boundary = attached_to_fluid_block_walls
[]
[attached_to_non_fluid_block_inlet]
type = SideSetsBetweenSubdomainsGenerator
primary_block = 3
paired_block = 1
input = attached_to_fluid_block_walls
new_boundary = attached_to_non_fluid_block_inlet
[]
[attached_to_non_fluid_block_outlet]
type = SideSetsBetweenSubdomainsGenerator
primary_block = 4
paired_block = 1
input = attached_to_non_fluid_block_inlet
new_boundary = attached_to_non_fluid_block_outlet
[]
[attached_to_non_fluid_block_walls]
type = SideSetsBetweenSubdomainsGenerator
input = attached_to_non_fluid_block_outlet
primary_block = '2'
paired_block = '1'
new_boundary = attached_to_non_fluid_block_walls
[]
[]
[Problem]
kernel_coverage_check = false
material_coverage_check = false
[]
[Modules]
[NavierStokesFV]
block = 1
compressibility = 'incompressible'
pressure_face_interpolation = average
momentum_advection_interpolation = upwind
mass_advection_interpolation = upwind
# fluid properties
density = '1'
dynamic_viscosity = '1e-2'
# initial conditions
initial_velocity = '0 0 0'
initial_pressure = 0
# boundary conditions
inlet_boundaries = 'attached_to_non_fluid_block_inlet'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_function = '0 0.1'
outlet_boundaries = 'attached_to_non_fluid_block_outlet'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '0'
wall_boundaries = 'attached_to_non_fluid_block_walls'
momentum_wall_types = 'slip'
[]
[]
[Postprocessors]
[outlet_mfr]
type = VolumetricFlowRate
vel_x = 'vel_x'
vel_y = 'vel_y'
advected_quantity = 1
boundary = attached_to_fluid_block_outlet
rhie_chow_user_object = ins_rhie_chow_interpolator
[]
[inlet_mfr]
type = VolumetricFlowRate
vel_x = 'vel_x'
vel_y = 'vel_y'
advected_quantity = 1
boundary = attached_to_fluid_block_inlet
rhie_chow_user_object = ins_rhie_chow_interpolator
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options = '-pc_svd_monitor'
petsc_options_iname = '-pc_type'
petsc_options_value = 'svd'
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.1
growth_factor = 1.1
cutback_factor = 0.9
optimal_iterations = 6
iteration_window = 2
[]
nl_max_its = 10
nl_abs_tol = 1e-5
# Steady state detection.
steady_state_detection = true
steady_state_tolerance = 1e-10
num_steps = 1
[]
[Outputs]
exodus = true
[]
(test/tests/multiapps/sub_cycling/sub_iteration_adaptive.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./td]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 4
dt = 0.01
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[./TimeStepper]
type = IterationAdaptiveDT
dt = 0.01
[../]
[]
[Outputs]
exodus = true
[]
(modules/solid_mechanics/test/tests/material_limit_time_step/damage/elements_changed_timestep_limit.i)
# This is a basic test of the system for continuum damage mechanics
# materials. It uses ScalarMaterialDamage for the damage model,
# which simply gets its damage index from another material. In this
# case, we prescribe the evolution of the damage index using a
# function. A single element has a fixed prescribed displacement
# on one side that puts the element in tension, and then the
# damage index evolves from 0 to 1 over time, and this verifies
# that the stress correspondingly drops to 0.
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
type = GeneratedMesh
dim = 3
nx = 10
ny = 1
nz = 1
elem_type = HEX8
[]
[AuxVariables]
[damage_index]
order = CONSTANT
family = MONOMIAL
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = SMALL
incremental = true
add_variables = true
generate_output = 'stress_xx strain_xx'
[]
[]
[AuxKernels]
[damage_index]
type = MaterialRealAux
variable = damage_index
property = damage_index_prop
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 = DirichletBC
variable = disp_x
boundary = right
value = 0.01
[]
[]
[Functions]
[damage_evolution]
type = ParsedFunction
expression = 'min(1.0, max(0.0, t - x * 3.0))'
[]
[]
[Materials]
[damage_index]
type = GenericFunctionMaterial
prop_names = damage_index_prop
prop_values = damage_evolution
[]
[damage]
type = ScalarMaterialDamage
damage_index = damage_index_prop
use_old_damage = true
maximum_damage_increment = 0.5
[]
[stress]
type = ComputeDamageStress
damage_model = damage
[]
[elasticity]
type = ComputeIsotropicElasticityTensor
poissons_ratio = 0.2
youngs_modulus = 10e9
[]
[]
[Postprocessors]
[stress_xx]
type = ElementAverageValue
variable = stress_xx
[]
[strain_xx]
type = ElementAverageValue
variable = strain_xx
[]
[damage_index]
type = ElementAverageValue
variable = damage_index
[]
[time_step_limit]
type = MaterialTimeStepPostprocessor
use_material_timestep_limit = false
elements_changed_property = damage_index_prop
elements_changed = 4
[]
[]
[Executioner]
type = Transient
l_max_its = 50
l_tol = 1e-8
nl_max_its = 20
nl_rel_tol = 1e-12
nl_abs_tol = 1e-6
dtmin = 0.001
end_time = 4.0
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.2
growth_factor = 2.0
cutback_factor = 0.5
timestep_limiting_postprocessor = time_step_limit
[]
[]
[Outputs]
exodus = true
csv=true
[]
(modules/combined/examples/publications/rapid_dev/fig8.i)
#
# Fig. 8 input for 10.1016/j.commatsci.2017.02.017
# D. Schwen et al./Computational Materials Science 132 (2017) 36-45
# Two growing particles with differnet anisotropic Eigenstrains
#
[Mesh]
[./gen]
type = GeneratedMeshGenerator
dim = 2
nx = 80
ny = 40
xmin = -20
xmax = 20
ymin = 0
ymax = 20
elem_type = QUAD4
[../]
[./cnode]
type = ExtraNodesetGenerator
input = gen
coord = '0.0 0.0'
new_boundary = 100
tolerance = 0.1
[../]
[]
[GlobalParams]
# CahnHilliard needs the third derivatives
derivative_order = 3
enable_jit = true
displacements = 'disp_x disp_y'
int_width = 1
[]
# AuxVars to compute the free energy density for outputting
[AuxVariables]
[./local_energy]
order = CONSTANT
family = MONOMIAL
[../]
[./cross_energy]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./local_free_energy]
type = TotalFreeEnergy
variable = local_energy
interfacial_vars = 'c'
kappa_names = 'kappa_c'
additional_free_energy = cross_energy
execute_on = 'INITIAL TIMESTEP_END'
[../]
[./cross_terms]
type = CrossTermGradientFreeEnergy
variable = cross_energy
interfacial_vars = 'eta1 eta2 eta3'
kappa_names = 'kappa11 kappa12 kappa13
kappa21 kappa22 kappa23
kappa31 kappa32 kappa33'
execute_on = 'INITIAL TIMESTEP_END'
[../]
[]
# particle x positions and radius
P1X=8
P2X=-4
PR=2
[Variables]
# Solute concentration variable
[./c]
[./InitialCondition]
type = SpecifiedSmoothCircleIC
x_positions = '${P1X} ${P2X}'
y_positions = '0 0'
z_positions = '0 0'
radii = '${PR} ${PR}'
outvalue = 0.5
invalue = 0.9
[../]
[../]
[./w]
[../]
# Order parameter for the Matrix
[./eta1]
[./InitialCondition]
type = SpecifiedSmoothCircleIC
x_positions = '${P1X} ${P2X}'
y_positions = '0 0'
z_positions = '0 0'
radii = '${PR} ${PR}'
outvalue = 1.0
invalue = 0.0
[../]
[../]
# Order parameters for the 2 different inclusion orientations
[./eta2]
[./InitialCondition]
type = SmoothCircleIC
x1 = ${P2X}
y1 = 0
radius = ${PR}
invalue = 1.0
outvalue = 0.0
[../]
[../]
[./eta3]
[./InitialCondition]
type = SmoothCircleIC
x1 = ${P1X}
y1 = 0
radius = ${PR}
invalue = 1.0
outvalue = 0.0
[../]
[../]
# Lagrange-multiplier
[./lambda]
initial_condition = 1.0
[../]
[]
[Modules]
[./TensorMechanics]
[./Master]
[./all]
add_variables = true
strain = SMALL
eigenstrain_names = eigenstrain
[../]
[../]
[../]
[]
[Kernels]
# Split Cahn-Hilliard kernels
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
args = 'eta1 eta2 eta3'
kappa_name = kappa_c
w = w
[../]
[./wres]
type = SplitCHWRes
variable = w
mob_name = M
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
# Allen-Cahn and Lagrange-multiplier constraint kernels for order parameter 1
[./deta1dt]
type = TimeDerivative
variable = eta1
[../]
[./ACBulk1]
type = AllenCahn
variable = eta1
args = 'eta2 eta3 c'
mob_name = L1
f_name = F
[../]
[./ACInterface1]
type = ACMultiInterface
variable = eta1
etas = 'eta1 eta2 eta3'
mob_name = L1
kappa_names = 'kappa11 kappa12 kappa13'
[../]
[./lagrange1]
type = SwitchingFunctionConstraintEta
variable = eta1
h_name = h1
lambda = lambda
[../]
# Allen-Cahn and Lagrange-multiplier constraint kernels for order parameter 2
[./deta2dt]
type = TimeDerivative
variable = eta2
[../]
[./ACBulk2]
type = AllenCahn
variable = eta2
args = 'eta1 eta3 c'
mob_name = L2
f_name = F
[../]
[./ACInterface2]
type = ACMultiInterface
variable = eta2
etas = 'eta1 eta2 eta3'
mob_name = L2
kappa_names = 'kappa21 kappa22 kappa23'
[../]
[./lagrange2]
type = SwitchingFunctionConstraintEta
variable = eta2
h_name = h2
lambda = lambda
[../]
# Allen-Cahn and Lagrange-multiplier constraint kernels for order parameter 3
[./deta3dt]
type = TimeDerivative
variable = eta3
[../]
[./ACBulk3]
type = AllenCahn
variable = eta3
args = 'eta1 eta2 c'
mob_name = L3
f_name = F
[../]
[./ACInterface3]
type = ACMultiInterface
variable = eta3
etas = 'eta1 eta2 eta3'
mob_name = L3
kappa_names = 'kappa31 kappa32 kappa33'
[../]
[./lagrange3]
type = SwitchingFunctionConstraintEta
variable = eta3
h_name = h3
lambda = lambda
[../]
# Lagrange-multiplier constraint kernel for lambda
[./lagrange]
type = SwitchingFunctionConstraintLagrange
variable = lambda
etas = 'eta1 eta2 eta3'
h_names = 'h1 h2 h3'
epsilon = 1e-6
[../]
[]
[Materials]
# declare a few constants, such as mobilities (L,M) and interface gradient prefactors (kappa*)
[./consts]
type = GenericConstantMaterial
block = 0
prop_names = 'M kappa_c L1 L2 L3 kappa11 kappa12 kappa13 kappa21 kappa22 kappa23 kappa31 kappa32 kappa33'
prop_values = '0.2 0.5 1 1 1 2.00 2.00 2.00 2.00 2.00 2.00 2.00 2.00 2.00 '
[../]
# We use this to output the level of constraint enforcement
# ideally it should be 0 everywhere, if the constraint is fully enforced
[./etasummat]
type = ParsedMaterial
property_name = etasum
coupled_variables = 'eta1 eta2 eta3'
material_property_names = 'h1 h2 h3'
expression = 'h1+h2+h3-1'
outputs = exodus
[../]
# This parsed material creates a single property for visualization purposes.
# It will be 0 for phase 1, -1 for phase 2, and 1 for phase 3
[./phasemap]
type = ParsedMaterial
property_name = phase
coupled_variables = 'eta2 eta3'
expression = 'if(eta3>0.5,1,0)-if(eta2>0.5,1,0)'
outputs = exodus
[../]
# global mechanical properties
[./elasticity_tensor]
type = ComputeElasticityTensor
C_ijkl = '400 400'
fill_method = symmetric_isotropic
[../]
[./stress]
type = ComputeLinearElasticStress
[../]
# eigenstrain
[./eigenstrain_2]
type = GenericConstantRankTwoTensor
tensor_name = s2
tensor_values = '0 -0.05 0 0 0 0'
[../]
[./eigenstrain_3]
type = GenericConstantRankTwoTensor
tensor_name = s3
tensor_values = '-0.05 0 0 0 0 0'
[../]
[./eigenstrain]
type = CompositeEigenstrain
weights = 'h2 h3'
tensors = 's2 s3'
args = 'eta2 eta3'
eigenstrain_name = eigenstrain
[../]
# switching functions
[./switching1]
type = SwitchingFunctionMaterial
function_name = h1
eta = eta1
h_order = SIMPLE
[../]
[./switching2]
type = SwitchingFunctionMaterial
function_name = h2
eta = eta2
h_order = SIMPLE
[../]
[./switching3]
type = SwitchingFunctionMaterial
function_name = h3
eta = eta3
h_order = SIMPLE
[../]
[./barrier]
type = MultiBarrierFunctionMaterial
etas = 'eta1 eta2 eta3'
[../]
# chemical free energies
[./chemical_free_energy_1]
type = DerivativeParsedMaterial
property_name = Fc1
expression = '4*c^2'
coupled_variables = 'c'
derivative_order = 2
[../]
[./chemical_free_energy_2]
type = DerivativeParsedMaterial
property_name = Fc2
expression = '(c-0.9)^2-0.4'
coupled_variables = 'c'
derivative_order = 2
[../]
[./chemical_free_energy_3]
type = DerivativeParsedMaterial
property_name = Fc3
expression = '(c-0.9)^2-0.5'
coupled_variables = 'c'
derivative_order = 2
[../]
# global chemical free energy
[./chemical_free_energy]
type = DerivativeMultiPhaseMaterial
f_name = Fc
fi_names = 'Fc1 Fc2 Fc3'
hi_names = 'h1 h2 h3'
etas = 'eta1 eta2 eta3'
coupled_variables = 'c'
W = 3
[../]
# global elastic free energy
[./elastic_free_energy]
type = ElasticEnergyMaterial
f_name = Fe
args = 'eta2 eta3'
outputs = exodus
output_properties = Fe
derivative_order = 2
[../]
# Penalize phase 2 and 3 coexistence
[./multi_phase_penalty]
type = DerivativeParsedMaterial
property_name = Fp
expression = '50*(eta2*eta3)^2'
coupled_variables = 'eta2 eta3'
derivative_order = 2
outputs = exodus
output_properties = Fp
[../]
# free energy
[./free_energy]
type = DerivativeSumMaterial
property_name = F
sum_materials = 'Fc Fe Fp'
coupled_variables = 'c eta1 eta2 eta3'
derivative_order = 2
[../]
[]
[BCs]
# fix center point location
[./centerfix_x]
type = DirichletBC
boundary = 100
variable = disp_x
value = 0
[../]
# fix side point x coordinate to inhibit rotation
[./angularfix]
type = DirichletBC
boundary = bottom
variable = disp_y
value = 0
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
# We monitor the total free energy and the total solute concentration (should be constant)
[Postprocessors]
[./total_free_energy]
type = ElementIntegralVariablePostprocessor
variable = local_energy
execute_on = 'INITIAL TIMESTEP_END'
[../]
[./total_solute]
type = ElementIntegralVariablePostprocessor
variable = c
execute_on = 'INITIAL TIMESTEP_END'
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -sub_pc_type'
petsc_options_value = 'asm lu'
l_max_its = 30
nl_max_its = 10
l_tol = 1.0e-4
nl_rel_tol = 1.0e-8
nl_abs_tol = 1.0e-10
start_time = 0.0
end_time = 12.0
[./TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 8
iteration_window = 1
dt = 0.01
[../]
[]
[Outputs]
print_linear_residuals = false
execute_on = 'INITIAL TIMESTEP_END'
exodus = true
[./table]
type = CSV
delimiter = ' '
[../]
[]
[Debug]
# show_var_residual_norms = true
[]
(modules/solid_mechanics/test/tests/anisotropic_elastoplasticity/ad_uniaxial_y.i)
# This test simulates uniaxial tensile loading in y-direction.
# The slope of the stress vs. plastic strain is evaluated from
# the simulation and compared with the value calculated using
# the analytical expression. This test uses a material with li-
# near strain hardening.
# For uniaxial tensile loading in y-direction, the slope of the
# stress vs. plastic strain is (2K / (F + H)) where K is the ha-
# rdening constant, and F & H are the Hill's constant. For deta-
# ils on the derivation of the expression for slope please refer
# the documentation of this material.
# Slope obtained from this MOOSE test simulation:
# = 1.521 x 10^9
# Slope obtained from analytical expression:
# = 2 x 10^9 / (0.6 + 0.7) = 1.538 x 10^9
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 3
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
volumetric_locking_correction = true
[]
[AuxVariables]
[hydrostatic_stress]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_xx]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_xy]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[sigma_yy]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[hydrostatic_stress]
type = ADRankTwoScalarAux
variable = hydrostatic_stress
rank_two_tensor = stress
scalar_type = Hydrostatic
[]
[plasticity_strain_xx]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_xx
index_i = 0
index_j = 0
[]
[plasticity_strain_xy]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_xy
index_i = 0
index_j = 1
[]
[plasticity_strain_yy]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_yy
index_i = 1
index_j = 1
[]
[sigma_yy]
type = ADRankTwoAux
rank_two_tensor = stress
variable = stress_yy
index_i = 1
index_j = 1
[]
[]
[Functions]
[pull]
type = PiecewiseLinear
x = '0 1e1 1e8'
y = '0 -4e8 -4e8'
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = FINITE
generate_output = 'elastic_strain_yy stress_yy strain_yy plastic_strain_yy'
use_automatic_differentiation = true
add_variables = true
[]
[]
[Materials]
[elasticity_tensor]
type = ADComputeElasticityTensor
fill_method = orthotropic
C_ijkl = '10.0e10 15.0e10 20.0e10 2.0e10 2.0e10 2.0e10 0.2 0.2 0.2 0.13333333333333333 0.1 0.15'
[]
[elastic_strain]
type = ADComputeMultipleInelasticStress
inelastic_models = "trial_plasticity"
max_iterations = 50
absolute_tolerance = 1e-16
[]
[hill_tensor]
type = ADHillConstants
# F G H L M N
hill_constants = "0.6 0.4 0.7 1.5 1.5 1.5"
[]
[trial_plasticity]
type = ADHillElastoPlasticityStressUpdate
hardening_constant = 10e9
yield_stress = 60e6
absolute_tolerance = 1e-15
relative_tolerance = 1e-13
# internal_solve_full_iteration_history = true
max_inelastic_increment = 2.0e-5
# internal_solve_output_on = on_error
[]
[]
[BCs]
[no_disp_x]
type = ADDirichletBC
variable = disp_x
boundary = left
value = 0.0
[]
[no_disp_y]
type = ADDirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[]
[no_disp_z]
type = ADDirichletBC
variable = disp_z
boundary = back
value = 0.0
[]
[Pressure]
[Side1]
boundary = top
function = pull
[]
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_rel_tol = 1e-12
nl_abs_tol = 1.0e-14
l_max_its = 90
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 30
iteration_window = 9
growth_factor = 1.05
cutback_factor = 0.5
timestep_limiting_postprocessor = matl_ts_min
dt = 0.1
time_t = '0 2.5 10'
time_dt = '0.1 1.0e-2 1.0e-2'
[]
start_time = 0
end_time = 10.0
automatic_scaling = true
[]
[Postprocessors]
[matl_ts_min]
type = MaterialTimeStepPostprocessor
[]
[max_disp_y]
type = ElementExtremeValue
variable = disp_y
[]
[max_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
[]
[dt]
type = TimestepSize
[]
[plasticity_strain_yy]
type = ElementalVariableValue
variable = plastic_strain_yy
execute_on = 'TIMESTEP_END'
elementid = 0
[]
[elastic_strain_yy]
type = ElementalVariableValue
variable = elastic_strain_yy
execute_on = 'TIMESTEP_END'
elementid = 0
[]
[strain_yy]
type = ElementalVariableValue
variable = strain_yy
execute_on = 'TIMESTEP_END'
elementid = 0
[]
[sigma_yy]
type = ElementalVariableValue
variable = stress_yy
execute_on = 'TIMESTEP_END'
elementid = 0
[]
[]
[Outputs]
csv = true
perf_graph = true
[]
(modules/porous_flow/examples/multiapp_fracture_flow/3dFracture/fracture_only_aperture_changing.i)
# Cold water injection into one side of the fracture network, and production from the other side
injection_rate = 10 # kg/s
[Mesh]
uniform_refine = 0
[cluster34]
type = FileMeshGenerator
file = 'Cluster_34.exo'
[]
[injection_node]
type = BoundingBoxNodeSetGenerator
input = cluster34
bottom_left = '-1000 0 -1000'
top_right = '1000 0.504 1000'
new_boundary = injection_node
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 -9.81E-6' # Note the value, because of pressure_unit
[]
[Variables]
[frac_P]
scaling = 1E6
[]
[frac_T]
initial_condition = 473
[]
[]
[ICs]
[frac_P]
type = FunctionIC
variable = frac_P
function = insitu_pp
[]
[]
[PorousFlowFullySaturated]
coupling_type = ThermoHydro
porepressure = frac_P
temperature = frac_T
fp = water
pressure_unit = MPa
[]
[Kernels]
[toMatrix]
type = PorousFlowHeatMassTransfer
variable = frac_T
v = transferred_matrix_T
transfer_coefficient = heat_transfer_coefficient
save_in = joules_per_s
[]
[]
[AuxVariables]
[heat_transfer_coefficient]
family = MONOMIAL
order = CONSTANT
initial_condition = 0.0
[]
[transferred_matrix_T]
initial_condition = 473
[]
[joules_per_s]
[]
[normal_dirn_x]
family = MONOMIAL
order = CONSTANT
[]
[normal_dirn_y]
family = MONOMIAL
order = CONSTANT
[]
[normal_dirn_z]
family = MONOMIAL
order = CONSTANT
[]
[enclosing_element_normal_length]
family = MONOMIAL
order = CONSTANT
[]
[enclosing_element_normal_thermal_cond]
family = MONOMIAL
order = CONSTANT
[]
[aperture]
family = MONOMIAL
order = CONSTANT
[]
[perm_times_app]
family = MONOMIAL
order = CONSTANT
[]
[density]
family = MONOMIAL
order = CONSTANT
[]
[viscosity]
family = MONOMIAL
order = CONSTANT
[]
[insitu_pp]
[]
[]
[AuxKernels]
[normal_dirn_x_auxk]
type = PorousFlowElementNormal
variable = normal_dirn_x
component = x
[]
[normal_dirn_y]
type = PorousFlowElementNormal
variable = normal_dirn_y
component = y
[]
[normal_dirn_z]
type = PorousFlowElementNormal
variable = normal_dirn_z
component = z
[]
[heat_transfer_coefficient_auxk]
type = ParsedAux
variable = heat_transfer_coefficient
coupled_variables = 'enclosing_element_normal_length enclosing_element_normal_thermal_cond'
constant_names = h_s
constant_expressions = 1E3 # should be much bigger than thermal_conductivity / L ~ 1
expression = 'if(enclosing_element_normal_length = 0, 0, h_s * enclosing_element_normal_thermal_cond * 2 * enclosing_element_normal_length / (h_s * enclosing_element_normal_length * enclosing_element_normal_length + enclosing_element_normal_thermal_cond * 2 * enclosing_element_normal_length))'
[]
[aperture]
type = PorousFlowPropertyAux
variable = aperture
property = porosity
[]
[perm_times_app]
type = PorousFlowPropertyAux
variable = perm_times_app
property = permeability
row = 0
column = 0
[]
[density]
type = PorousFlowPropertyAux
variable = density
property = density
phase = 0
[]
[viscosity]
type = PorousFlowPropertyAux
variable = viscosity
property = viscosity
phase = 0
[]
[insitu_pp]
type = FunctionAux
execute_on = initial
variable = insitu_pp
function = insitu_pp
[]
[]
[BCs]
[inject_heat]
type = DirichletBC
boundary = injection_node
variable = frac_T
value = 373
[]
[]
[DiracKernels]
[inject_fluid]
type = PorousFlowPointSourceFromPostprocessor
mass_flux = ${injection_rate}
point = '58.8124 0.50384 74.7838'
variable = frac_P
[]
[withdraw_fluid]
type = PorousFlowPeacemanBorehole
SumQuantityUO = kg_out_uo
bottom_p_or_t = 10.6 # 1MPa + approx insitu at production point, to prevent aperture closing due to low porepressures
character = 1
line_length = 1
point_file = production.xyz
unit_weight = '0 0 0'
fluid_phase = 0
use_mobility = true
variable = frac_P
[]
[withdraw_heat]
type = PorousFlowPeacemanBorehole
SumQuantityUO = J_out_uo
bottom_p_or_t = 10.6 # 1MPa + approx insitu at production point, to prevent aperture closing due to low porepressures
character = 1
line_length = 1
point_file = production.xyz
unit_weight = '0 0 0'
fluid_phase = 0
use_mobility = true
use_enthalpy = true
variable = frac_T
[]
[]
[UserObjects]
[kg_out_uo]
type = PorousFlowSumQuantity
[]
[J_out_uo]
type = PorousFlowSumQuantity
[]
[]
[FluidProperties]
[true_water]
type = Water97FluidProperties
[]
[water]
type = TabulatedBicubicFluidProperties
fp = true_water
temperature_min = 275 # K
temperature_max = 600
interpolated_properties = 'density viscosity enthalpy internal_energy'
fluid_property_file = water97_tabulated.csv
[]
[]
[Materials]
[porosity]
type = PorousFlowPorosityLinear
porosity_ref = 1E-4 # fracture porosity = 1.0, but must include fracture aperture of 1E-4 at P = insitu_pp
P_ref = insitu_pp
P_coeff = 1E-3 # this is in metres/MPa, ie for P_ref = 1/P_coeff, the aperture becomes 1 metre
porosity_min = 1E-5
[]
[permeability]
type = PorousFlowPermeabilityKozenyCarman
k0 = 1E-15 # fracture perm = 1E-11 m^2, but must include fracture aperture of 1E-4
poroperm_function = kozeny_carman_phi0
m = 0
n = 3
phi0 = 1E-4
[]
[internal_energy]
type = PorousFlowMatrixInternalEnergy
density = 2700 # kg/m^3
specific_heat_capacity = 0 # basically no rock inside the fracture
[]
[aq_thermal_conductivity]
type = PorousFlowThermalConductivityIdeal
dry_thermal_conductivity = '0.6E-4 0 0 0 0.6E-4 0 0 0 0.6E-4' # thermal conductivity of water times fracture aperture. This should increase linearly with aperture, but is set constant in this model
[]
[]
[Functions]
[kg_rate]
type = ParsedFunction
symbol_values = 'dt kg_out'
symbol_names = 'dt kg_out'
expression = 'kg_out/dt'
[]
[insitu_pp]
type = ParsedFunction
expression = '10 - 0.847E-2 * z' # Approximate hydrostatic in MPa
[]
[]
[Postprocessors]
[dt]
type = TimestepSize
outputs = 'none'
[]
[kg_out]
type = PorousFlowPlotQuantity
uo = kg_out_uo
[]
[kg_per_s]
type = FunctionValuePostprocessor
function = kg_rate
[]
[J_out]
type = PorousFlowPlotQuantity
uo = J_out_uo
[]
[TK_out]
type = PointValue
variable = frac_T
point = '101.705 160.459 39.5722'
[]
[P_out]
type = PointValue
variable = frac_P
point = '101.705 160.459 39.5722'
[]
[P_in]
type = PointValue
variable = frac_P
point = '58.8124 0.50384 74.7838'
[]
[]
[VectorPostprocessors]
[heat_transfer_rate]
type = NodalValueSampler
outputs = none
sort_by = id
variable = joules_per_s
[]
[]
[Preconditioning]
[entire_jacobian]
type = SMP
full = true
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
petsc_options_value = ' asm lu NONZERO 2 '
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
[TimeStepper]
type = IterationAdaptiveDT
dt = 1
optimal_iterations = 10
growth_factor = 1.5
[]
dtmax = 1E8
end_time = 1E8
nl_abs_tol = 1E-3
nl_max_its = 20
[]
[Outputs]
print_linear_residuals = false
csv = true
[ex]
type = Exodus
sync_times = '1 10 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000 2100 2200 2300 2400 2500 2600 2700 2800 2900 3000 3100 3200 3300 3400 3500 3600 3700 3800 3900 4000 4100 4200 4300 4400 4500 4600 4700 4800 4900 5000 5100 5200 5300 5400 5500 5600 5700 5800 5900 6000 6100 6200 6300 6400 6500 6600 6700 6800 6900 7000 7100 7200 7300 7400 7500 7600 7700 7800 7900 8000 8100 8200 8300 8400 8500 8600 8700 8800 8900 9000 10000 11000 12000 13000 14000 15000 16000 17000 18000 19000 20000 30000 50000 70000 100000 200000 300000 400000 500000 600000 700000 800000 900000 1000000 1100000 1200000 1300000 1400000 1500000 1600000 1700000 1800000 1900000 2000000 2100000 2200000 2300000 2400000 2500000 2600000 2700000 2800000 2900000'
sync_only = true
[]
[]
(modules/navier_stokes/examples/solidification/galium_melting.i)
##########################################################
# Simulation of Galium Melting Experiment
# Ref: Gau, C., & Viskanta, R. (1986). Melting and solidification of a pure metal on a vertical wall.
# Key physics: melting/solidification, convective heat transfer, natural convection
##########################################################
mu = 1.81e-3
rho_solid = 6093
rho_liquid = 6093
k_solid = 32
k_liquid = 32
cp_solid = 381.5
cp_liquid = 381.5
L = 80160
alpha_b = 1.2e-4
T_solidus = 302.93
T_liquidus = '${fparse T_solidus + 0.1}'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
T_cold = 301.15
T_hot = 311.15
Nx = 100
Ny = 50
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 88.9e-3
ymin = 0
ymax = 63.5e-3
nx = ${Nx}
ny = ${Ny}
[]
[]
[AuxVariables]
[U]
type = MooseVariableFVReal
[]
[fl]
type = MooseVariableFVReal
initial_condition = 0.0
[]
[density]
type = MooseVariableFVReal
[]
[th_cond]
type = MooseVariableFVReal
[]
[cp_var]
type = MooseVariableFVReal
[]
[darcy_coef]
type = MooseVariableFVReal
[]
[fch_coef]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[mag]
type = VectorMagnitudeAux
variable = U
x = vel_x
y = vel_y
[]
[compute_fl]
type = NSLiquidFractionAux
variable = fl
temperature = T
T_liquidus = '${T_liquidus}'
T_solidus = '${T_solidus}'
execute_on = 'TIMESTEP_END'
[]
[rho_out]
type = FunctorAux
functor = 'rho_mixture'
variable = 'density'
[]
[th_cond_out]
type = FunctorAux
functor = 'k_mixture'
variable = 'th_cond'
[]
[cp_out]
type = FunctorAux
functor = 'cp_mixture'
variable = 'cp_var'
[]
[darcy_out]
type = FunctorAux
functor = 'Darcy_coefficient'
variable = 'darcy_coef'
[]
[fch_out]
type = FunctorAux
functor = 'Forchheimer_coefficient'
variable = 'fch_coef'
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 0.0
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 0.0
[]
[pressure]
type = INSFVPressureVariable
[]
[lambda]
family = SCALAR
order = FIRST
[]
[T]
type = INSFVEnergyVariable
initial_condition = '${T_cold}'
scaling = 1.0
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = rho_mixture
[]
[mean_zero_pressure]
type = FVIntegralValueConstraint
variable = pressure
lambda = lambda
phi0 = 0.0
[]
[u_time]
type = INSFVMomentumTimeDerivative
variable = vel_x
rho = rho_mixture
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = rho_mixture
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[u_friction]
type = INSFVMomentumFriction
variable = vel_x
momentum_component = 'x'
linear_coef_name = 'Darcy_coefficient'
quadratic_coef_name = 'Forchheimer_coefficient'
[]
[u_buoyancy]
type = INSFVMomentumBoussinesq
variable = vel_x
T_fluid = T
gravity = '0 -9.81 0'
rho = '${rho_liquid}'
ref_temperature = ${T_cold}
momentum_component = 'x'
[]
[u_gravity]
type = INSFVMomentumGravity
variable = vel_x
gravity = '0 -9.81 0'
rho = '${rho_liquid}'
momentum_component = 'x'
[]
[v_time]
type = INSFVMomentumTimeDerivative
variable = vel_y
rho = rho_mixture
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = rho_mixture
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[v_friction]
type = INSFVMomentumFriction
variable = vel_y
momentum_component = 'y'
linear_coef_name = 'Darcy_coefficient'
quadratic_coef_name = 'Forchheimer_coefficient'
[]
[v_buoyancy]
type = INSFVMomentumBoussinesq
variable = vel_y
T_fluid = T
gravity = '0 -9.81 0'
rho = '${rho_liquid}'
ref_temperature = ${T_cold}
momentum_component = 'y'
[]
[v_gravity]
type = INSFVMomentumGravity
variable = vel_y
gravity = '0 -9.81 0'
rho = '${rho_liquid}'
momentum_component = 'y'
[]
[T_time]
type = INSFVEnergyTimeDerivative
variable = T
rho = rho_mixture
dh_dt = dh_dt
[]
[energy_advection]
type = INSFVEnergyAdvection
variable = T
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[energy_diffusion]
type = FVDiffusion
coeff = k_mixture
variable = T
[]
[energy_source]
type = NSFVPhaseChangeSource
variable = T
L = ${L}
liquid_fraction = fl
T_liquidus = ${T_liquidus}
T_solidus = ${T_solidus}
rho = 'rho_mixture'
[]
[]
[FVBCs]
[walls-u]
type = INSFVNoSlipWallBC
boundary = 'left right top bottom'
variable = vel_x
function = 0
[]
[walls-v]
type = INSFVNoSlipWallBC
boundary = 'left right top bottom'
variable = vel_y
function = 0
[]
[hot_wall]
type = FVDirichletBC
variable = T
value = '${T_hot}'
boundary = 'left'
[]
[cold_wall]
type = FVDirichletBC
variable = T
value = '${T_cold}'
boundary = 'right'
[]
[]
[Materials]
[ins_fv]
type = INSFVEnthalpyMaterial
rho = rho_mixture
cp = cp_mixture
temperature = 'T'
[]
[eff_cp]
type = NSFVMixtureMaterial
phase_2_names = '${cp_solid} ${k_solid} ${rho_solid}'
phase_1_names = '${cp_liquid} ${k_liquid} ${rho_liquid}'
prop_names = 'cp_mixture k_mixture rho_mixture'
phase_1_fraction = fl
[]
[mushy_zone_resistance]
type = INSFVMushyPorousFrictionMaterial
liquid_fraction = 'fl'
mu = '${mu}'
rho_l = '${rho_liquid}'
dendrite_spacing_scaling = 1e-1
[]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'alpha_b'
prop_values = '${alpha_b}'
[]
[]
[Executioner]
type = Transient
# Time-stepping parameters
start_time = 0.0
end_time = 200.0
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 10
dt = 0.1
[]
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-2
nl_abs_tol = 1e-4
nl_max_its = 30
[]
[Outputs]
exodus = true
csv = false
[]
(modules/navier_stokes/test/tests/finite_element/ins/mms/supg/supg_adv_dominated_mms.i)
mu=1.5e-2
rho=2.5
[GlobalParams]
gravity = '0 0 0'
supg = true
convective_term = true
integrate_p_by_parts = false
transient_term = true
laplace = true
u = vel_x
v = vel_y
pressure = p
alpha = 1e0
order = SECOND
family = LAGRANGE
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1.0
ymin = 0
ymax = 1.0
elem_type = QUAD9
nx = 4
ny = 4
[]
[./corner_node]
type = ExtraNodesetGenerator
new_boundary = 'pinned_node'
nodes = '0'
input = gen
[../]
[]
[Variables]
[./vel_x]
[../]
[./vel_y]
[../]
[./p]
order = FIRST
[../]
[]
[Kernels]
# mass
[./mass]
type = INSMass
variable = p
[../]
[./x_time]
type = INSMomentumTimeDerivative
variable = vel_x
[../]
[./y_time]
type = INSMomentumTimeDerivative
variable = vel_y
[../]
# x-momentum, space
[./x_momentum_space]
type = INSMomentumLaplaceForm
variable = vel_x
component = 0
forcing_func = vel_x_source_func
[../]
# y-momentum, space
[./y_momentum_space]
type = INSMomentumLaplaceForm
variable = vel_y
component = 1
forcing_func = vel_y_source_func
[../]
[./p_source]
type = BodyForce
function = p_source_func
variable = p
[../]
[]
[BCs]
[./vel_x]
type = FunctionDirichletBC
boundary = 'left right top bottom'
function = vel_x_func
variable = vel_x
[../]
[./vel_y]
type = FunctionDirichletBC
boundary = 'left right top bottom'
function = vel_y_func
variable = vel_y
[../]
[./p]
type = FunctionDirichletBC
boundary = 'left right top bottom'
function = p_func
variable = p
[../]
[]
[Functions]
[./vel_x_source_func]
type = ParsedFunction
expression = '-${mu}*(-0.028*pi^2*x^2*sin(0.2*pi*x*y) - 0.028*pi^2*y^2*sin(0.2*pi*x*y) - 0.1*pi^2*sin(0.5*pi*x) - 0.4*pi^2*sin(pi*y)) + ${rho}*(0.14*pi*x*cos(0.2*pi*x*y) + 0.4*pi*cos(pi*y))*(0.6*sin(0.8*pi*x) + 0.3*sin(0.3*pi*y) + 0.2*sin(0.3*pi*x*y) + 0.3) + ${rho}*(0.14*pi*y*cos(0.2*pi*x*y) + 0.2*pi*cos(0.5*pi*x))*(0.4*sin(0.5*pi*x) + 0.4*sin(pi*y) + 0.7*sin(0.2*pi*x*y) + 0.5) + 0.1*pi*y*cos(0.2*pi*x*y) + 0.25*pi*cos(0.5*pi*x)'
[../]
[./vel_y_source_func]
type = ParsedFunction
expression = '-${mu}*(-0.018*pi^2*x^2*sin(0.3*pi*x*y) - 0.018*pi^2*y^2*sin(0.3*pi*x*y) - 0.384*pi^2*sin(0.8*pi*x) - 0.027*pi^2*sin(0.3*pi*y)) + ${rho}*(0.06*pi*x*cos(0.3*pi*x*y) + 0.09*pi*cos(0.3*pi*y))*(0.6*sin(0.8*pi*x) + 0.3*sin(0.3*pi*y) + 0.2*sin(0.3*pi*x*y) + 0.3) + ${rho}*(0.06*pi*y*cos(0.3*pi*x*y) + 0.48*pi*cos(0.8*pi*x))*(0.4*sin(0.5*pi*x) + 0.4*sin(pi*y) + 0.7*sin(0.2*pi*x*y) + 0.5) + 0.1*pi*x*cos(0.2*pi*x*y) + 0.3*pi*cos(0.3*pi*y)'
[../]
[./p_source_func]
type = ParsedFunction
expression = '-0.06*pi*x*cos(0.3*pi*x*y) - 0.14*pi*y*cos(0.2*pi*x*y) - 0.2*pi*cos(0.5*pi*x) - 0.09*pi*cos(0.3*pi*y)'
[../]
[./vel_x_func]
type = ParsedFunction
expression = '0.4*sin(0.5*pi*x) + 0.4*sin(pi*y) + 0.7*sin(0.2*pi*x*y) + 0.5'
[../]
[./vel_y_func]
type = ParsedFunction
expression = '0.6*sin(0.8*pi*x) + 0.3*sin(0.3*pi*y) + 0.2*sin(0.3*pi*x*y) + 0.3'
[../]
[./p_func]
type = ParsedFunction
expression = '0.5*sin(0.5*pi*x) + 1.0*sin(0.3*pi*y) + 0.5*sin(0.2*pi*x*y) + 0.5'
[../]
[./vxx_func]
type = ParsedFunction
expression = '0.14*pi*y*cos(0.2*pi*x*y) + 0.2*pi*cos(0.5*pi*x)'
[../]
[]
[Materials]
[./const]
type = GenericConstantMaterial
block = 0
prop_names = 'rho mu'
prop_values = '${rho} ${mu}'
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
solve_type = 'NEWTON'
[../]
[]
[Executioner]
type = Transient
num_steps = 10
petsc_options = '-snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
line_search = 'none'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-14
nl_max_its = 10
l_tol = 1e-6
l_max_its = 10
[./TimeStepper]
dt = .05
type = IterationAdaptiveDT
cutback_factor = 0.4
growth_factor = 1.2
optimal_iterations = 20
[../]
[]
[Outputs]
execute_on = 'final'
[./exodus]
type = Exodus
[../]
[./csv]
type = CSV
[../]
[]
[Postprocessors]
[./L2vel_x]
type = ElementL2Error
variable = vel_x
function = vel_x_func
outputs = 'console' execute_on = 'timestep_end'
[../]
[./L2vel_y]
variable = vel_y
function = vel_y_func
type = ElementL2Error
outputs = 'console' execute_on = 'timestep_end'
[../]
[./L2p]
variable = p
function = p_func
type = ElementL2Error
outputs = 'console' execute_on = 'timestep_end'
[../]
[./L2vxx]
variable = vxx
function = vxx_func
type = ElementL2Error
outputs = 'console' execute_on = 'timestep_end'
[../]
[]
[AuxVariables]
[./vxx]
family = MONOMIAL
order = FIRST
[../]
[]
[AuxKernels]
[./vxx]
type = VariableGradientComponent
component = x
variable = vxx
gradient_variable = vel_x
[../]
[]
(modules/porous_flow/examples/co2_intercomparison/1Dradial/1Dradial.i)
# Intercomparison problem 3: Radial flow from an injection well
#
# From Pruess et al, Code intercomparison builds confidence in
# numerical simulation models for geologic disposal of CO2, Energy 29 (2004)
#
# A variation with zero salinity can be run by changing the initial condition
# of the AuxVariable xnacl
[Mesh]
type = GeneratedMesh
dim = 1
nx = 500
xmax = 10000
bias_x = 1.01
coord_type = 'RZ'
rz_coord_axis = Y
[]
[GlobalParams]
PorousFlowDictator = 'dictator'
gravity = '0 0 0'
[]
[AuxVariables]
[pressure_liquid]
order = CONSTANT
family = MONOMIAL
[]
[saturation_gas]
order = CONSTANT
family = MONOMIAL
[]
[x1]
order = CONSTANT
family = MONOMIAL
[]
[y0]
order = CONSTANT
family = MONOMIAL
[]
[xnacl]
initial_condition = 0.15
[]
[]
[AuxKernels]
[pressure_liquid]
type = PorousFlowPropertyAux
variable = pressure_liquid
property = pressure
phase = 0
execute_on = 'timestep_end'
[]
[saturation_gas]
type = PorousFlowPropertyAux
variable = saturation_gas
property = saturation
phase = 1
execute_on = 'timestep_end'
[]
[x1]
type = PorousFlowPropertyAux
variable = x1
property = mass_fraction
phase = 0
fluid_component = 1
execute_on = 'timestep_end'
[]
[y0]
type = PorousFlowPropertyAux
variable = y0
property = mass_fraction
phase = 1
fluid_component = 0
execute_on = 'timestep_end'
[]
[]
[Variables]
[pgas]
initial_condition = 12e6
[]
[zi]
initial_condition = 0
scaling = 1e4
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = pgas
[]
[flux0]
type = PorousFlowAdvectiveFlux
fluid_component = 0
variable = pgas
[]
[mass1]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = zi
[]
[flux1]
type = PorousFlowAdvectiveFlux
fluid_component = 1
variable = zi
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pgas zi'
number_fluid_phases = 2
number_fluid_components = 3
[]
[pc]
type = PorousFlowCapillaryPressureVG
alpha = 5.099e-5
m = 0.457
sat_lr = 0.0
pc_max = 1e7
[]
[fs]
type = PorousFlowBrineCO2
brine_fp = brine
co2_fp = co2
capillary_pressure = pc
[]
[]
[FluidProperties]
[co2sw]
type = CO2FluidProperties
[]
[co2]
type = TabulatedBicubicFluidProperties
fp = co2sw
[]
[water]
type = Water97FluidProperties
[]
[watertab]
type = TabulatedBicubicFluidProperties
fp = water
temperature_min = 273.15
temperature_max = 573.15
fluid_property_file = water_fluid_properties.csv
save_file = false
[]
[brine]
type = BrineFluidProperties
water_fp = watertab
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = '45'
[]
[brineco2]
type = PorousFlowFluidState
gas_porepressure = 'pgas'
z = 'zi'
temperature_unit = Celsius
xnacl = 'xnacl'
capillary_pressure = pc
fluid_state = fs
[]
[porosity]
type = PorousFlowPorosityConst
porosity = '0.12'
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-13 0 0 0 1e-13 0 0 0 1e-13'
[]
[relperm_water]
type = PorousFlowRelativePermeabilityVG
m = 0.457
phase = 0
s_res = 0.3
sum_s_res = 0.35
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 1
s_res = 0.05
sum_s_res = 0.35
[]
[]
[BCs]
[rightwater]
type = PorousFlowPiecewiseLinearSink
boundary = 'right'
variable = pgas
use_mobility = true
PorousFlowDictator = dictator
fluid_phase = 0
multipliers = '0 1e9'
PT_shift = '12e6'
pt_vals = '0 1e9'
mass_fraction_component = 0
use_relperm = true
[]
[rightco2]
type = PorousFlowPiecewiseLinearSink
variable = zi
boundary = 'right'
use_mobility = true
PorousFlowDictator = dictator
fluid_phase = 1
multipliers = '0 1e9'
PT_shift = '12e6'
pt_vals = '0 1e9'
mass_fraction_component = 1
use_relperm = true
[]
[]
[DiracKernels]
[source]
type = PorousFlowSquarePulsePointSource
point = '0 0 0'
mass_flux = 1
variable = zi
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'gmres bjacobi lu NONZERO'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 8.64e8
nl_max_its = 25
l_max_its = 100
dtmax = 5e6
[TimeStepper]
type = IterationAdaptiveDT
dt = 100
[]
[]
[VectorPostprocessors]
[vars]
type = NodalValueSampler
sort_by = x
variable = 'pgas zi xnacl'
execute_on = 'timestep_end'
outputs = spatial
[]
[auxvars]
type = ElementValueSampler
sort_by = x
variable = 'saturation_gas x1 y0'
execute_on = 'timestep_end'
outputs = spatial
[]
[]
[Postprocessors]
[pgas]
type = PointValue
point = '25.25 0 0'
variable = pgas
outputs = time
[]
[sgas]
type = PointValue
point = '25.25 0 0'
variable = saturation_gas
outputs = time
[]
[zi]
type = PointValue
point = '25.25 0 0'
variable = zi
outputs = time
[]
[massgas]
type = PorousFlowFluidMass
fluid_component = 1
outputs = time
[]
[x1]
type = PointValue
point = '25.25 0 0'
variable = x1
outputs = time
[]
[y0]
type = PointValue
point = '25.25 0 0'
variable = y0
outputs = time
[]
[xnacl]
type = PointValue
point = '25.25 0 0'
variable = xnacl
outputs = time
[]
[]
[Outputs]
print_linear_residuals = false
perf_graph = true
sync_times = '2.592e6 8.64e6 8.64e7 8.64e8'
[time]
type = CSV
[]
[spatial]
type = CSV
sync_only = true
[]
[]
(modules/phase_field/examples/anisotropic_interfaces/snow.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 14
ny = 14
xmax = 9
ymax = 9
uniform_refine = 3
[]
[Variables]
[./w]
[../]
[./T]
[../]
[]
[ICs]
[./wIC]
type = SmoothCircleIC
variable = w
int_width = 0.1
x1 = 4.5
y1 = 4.5
radius = 0.07
outvalue = 0
invalue = 1
[../]
[]
[Kernels]
[./w_dot]
type = TimeDerivative
variable = w
[../]
[./anisoACinterface1]
type = ACInterfaceKobayashi1
variable = w
mob_name = M
[../]
[./anisoACinterface2]
type = ACInterfaceKobayashi2
variable = w
mob_name = M
[../]
[./AllenCahn]
type = AllenCahn
variable = w
mob_name = M
f_name = fbulk
coupled_variables = T
[../]
[./T_dot]
type = TimeDerivative
variable = T
[../]
[./CoefDiffusion]
type = Diffusion
variable = T
[../]
[./w_dot_T]
type = CoefCoupledTimeDerivative
variable = T
v = w
coef = -1.8
[../]
[]
[Materials]
[./free_energy]
type = DerivativeParsedMaterial
property_name = fbulk
coupled_variables = 'w T'
constant_names = pi
constant_expressions = 4*atan(1)
expression = 'm:=0.9 * atan(10 * (1 - T)) / pi; 1/4*w^4 - (1/2 - m/3) * w^3 + (1/4 - m/2) * w^2'
derivative_order = 2
outputs = exodus
[../]
[./material]
type = InterfaceOrientationMaterial
op = w
[../]
[./consts]
type = GenericConstantMaterial
prop_names = 'M'
prop_values = '3333.333'
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart'
petsc_options_value = 'hypre boomeramg 31'
nl_abs_tol = 1e-10
nl_rel_tol = 1e-08
l_max_its = 30
end_time = 1
[./TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 6
iteration_window = 2
dt = 0.0005
growth_factor = 1.1
cutback_factor = 0.75
[../]
[./Adaptivity]
initial_adaptivity = 3 # Number of times mesh is adapted to initial condition
refine_fraction = 0.7 # Fraction of high error that will be refined
coarsen_fraction = 0.1 # Fraction of low error that will coarsened
max_h_level = 5 # Max number of refinements used, starting from initial mesh (before uniform refinement)
weight_names = 'w T'
weight_values = '1 0.5'
[../]
[]
[Outputs]
time_step_interval = 5
exodus = true
[]
(modules/porous_flow/examples/lava_lamp/1phase_convection.i)
# Two phase density-driven convection of dissolved CO2 in brine
#
# The model starts with CO2 in the liquid phase only. The CO2 diffuses into the brine.
# As the density of the CO2-saturated brine is greater
# than the unsaturated brine, a gravitational instability arises and density-driven
# convection of CO2-rich fingers descend into the unsaturated brine.
#
# The instability is seeded by a random perturbation to the porosity field.
# Mesh adaptivity is used to refine the mesh as the fingers form.
#
# Note: this model is computationally expensive, so should be run with multiple cores.
[GlobalParams]
PorousFlowDictator = 'dictator'
gravity = '0 -9.81 0'
[]
[Adaptivity]
max_h_level = 2
marker = marker
initial_marker = initial
initial_steps = 2
[Indicators]
[indicator]
type = GradientJumpIndicator
variable = zi
[]
[]
[Markers]
[marker]
type = ErrorFractionMarker
indicator = indicator
refine = 0.8
[]
[initial]
type = BoxMarker
bottom_left = '0 1.95 0'
top_right = '2 2 0'
inside = REFINE
outside = DO_NOTHING
[]
[]
[]
[Mesh]
type = GeneratedMesh
dim = 2
ymin = 1.5
ymax = 2
xmax = 2
ny = 20
nx = 40
bias_y = 0.95
[]
[AuxVariables]
[xnacl]
initial_condition = 0.01
[]
[saturation_gas]
order = FIRST
family = MONOMIAL
[]
[xco2l]
order = FIRST
family = MONOMIAL
[]
[density_liquid]
order = FIRST
family = MONOMIAL
[]
[porosity]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[saturation_gas]
type = PorousFlowPropertyAux
variable = saturation_gas
property = saturation
phase = 1
execute_on = 'timestep_end'
[]
[xco2l]
type = PorousFlowPropertyAux
variable = xco2l
property = mass_fraction
phase = 0
fluid_component = 1
execute_on = 'timestep_end'
[]
[density_liquid]
type = PorousFlowPropertyAux
variable = density_liquid
property = density
phase = 0
execute_on = 'timestep_end'
[]
[]
[Variables]
[pgas]
[]
[zi]
scaling = 1e4
[]
[]
[ICs]
[pressure]
type = FunctionIC
function = 10e6-9.81*1000*y
variable = pgas
[]
[zi]
type = ConstantIC
value = 0
variable = zi
[]
[porosity]
type = RandomIC
variable = porosity
min = 0.25
max = 0.275
seed = 0
[]
[]
[BCs]
[top]
type = DirichletBC
value = 0.04
variable = zi
boundary = top
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = pgas
[]
[flux0]
type = PorousFlowAdvectiveFlux
fluid_component = 0
variable = pgas
[]
[diff0]
type = PorousFlowDispersiveFlux
fluid_component = 0
variable = pgas
disp_long = '0 0'
disp_trans = '0 0'
[]
[mass1]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = zi
[]
[flux1]
type = PorousFlowAdvectiveFlux
fluid_component = 1
variable = zi
[]
[diff1]
type = PorousFlowDispersiveFlux
fluid_component = 1
variable = zi
disp_long = '0 0'
disp_trans = '0 0'
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pgas zi'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureConst
pc = 0
[]
[fs]
type = PorousFlowBrineCO2
brine_fp = brine
co2_fp = co2
capillary_pressure = pc
[]
[]
[FluidProperties]
[co2sw]
type = CO2FluidProperties
[]
[co2]
type = TabulatedBicubicFluidProperties
fp = co2sw
[]
[brine]
type = BrineFluidProperties
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = '45'
[]
[brineco2]
type = PorousFlowFluidState
gas_porepressure = 'pgas'
z = 'zi'
temperature_unit = Celsius
xnacl = 'xnacl'
capillary_pressure = pc
fluid_state = fs
[]
[porosity]
type = PorousFlowPorosityConst
porosity = porosity
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-11 0 0 0 1e-11 0 0 0 1e-11'
[]
[relperm_water]
type = PorousFlowRelativePermeabilityCorey
phase = 0
n = 2
s_res = 0.1
sum_s_res = 0.2
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityCorey
phase = 1
n = 2
s_res = 0.1
sum_s_res = 0.2
[]
[diffusivity]
type = PorousFlowDiffusivityConst
diffusion_coeff = '2e-9 2e-9 2e-9 2e-9'
tortuosity = '1 1'
[]
[]
[Preconditioning]
active = basic
[mumps_is_best_for_parallel_jobs]
type = SMP
full = true
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = ' lu mumps'
[]
[basic]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
petsc_options_value = 'gmres asm lu NONZERO 2 '
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 1e6
nl_max_its = 25
l_max_its = 100
dtmax = 1e4
nl_abs_tol = 1e-6
[TimeStepper]
type = IterationAdaptiveDT
dt = 100
growth_factor = 2
cutback_factor = 0.5
[]
[]
[Functions]
[flux]
type = ParsedFunction
symbol_values = 'delta_xco2 dt'
symbol_names = 'dx dt'
expression = 'dx/dt'
[]
[]
[Postprocessors]
[total_co2_in_gas]
type = PorousFlowFluidMass
phase = 1
fluid_component = 1
[]
[total_co2_in_liquid]
type = PorousFlowFluidMass
phase = 0
fluid_component = 1
[]
[numdofs]
type = NumDOFs
[]
[delta_xco2]
type = ChangeOverTimePostprocessor
postprocessor = total_co2_in_liquid
[]
[dt]
type = TimestepSize
[]
[flux]
type = FunctionValuePostprocessor
function = flux
[]
[]
[Outputs]
print_linear_residuals = false
perf_graph = true
exodus = true
csv = true
[]
(modules/porous_flow/test/tests/fluidstate/theis_brineco2_nonisothermal.i)
# Two phase nonisothermal Theis problem: Flow from single source.
# Constant rate injection 2 kg/s of cold CO2 into warm reservoir
# 1D cylindrical mesh
# Initially, system has only a liquid phase, until enough gas is injected
# to form a gas phase, in which case the system becomes two phase.
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
nx = 40
xmin = 0.1
xmax = 200
bias_x = 1.05
[]
coord_type = RZ
rz_coord_axis = Y
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[AuxVariables]
[saturation_gas]
order = CONSTANT
family = MONOMIAL
[]
[x1]
order = CONSTANT
family = MONOMIAL
[]
[y0]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[saturation_gas]
type = PorousFlowPropertyAux
variable = saturation_gas
property = saturation
phase = 1
execute_on = timestep_end
[]
[x1]
type = PorousFlowPropertyAux
variable = x1
property = mass_fraction
phase = 0
fluid_component = 1
execute_on = timestep_end
[]
[y0]
type = PorousFlowPropertyAux
variable = y0
property = mass_fraction
phase = 1
fluid_component = 0
execute_on = timestep_end
[]
[]
[Variables]
[pgas]
initial_condition = 20e6
[]
[zi]
initial_condition = 0
[]
[xnacl]
initial_condition = 0.1
[]
[temperature]
initial_condition = 70
scaling = 1e-4
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = pgas
[]
[flux0]
type = PorousFlowAdvectiveFlux
fluid_component = 0
variable = pgas
[]
[mass1]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = zi
[]
[flux1]
type = PorousFlowAdvectiveFlux
fluid_component = 1
variable = zi
[]
[mass2]
type = PorousFlowMassTimeDerivative
fluid_component = 2
variable = xnacl
[]
[flux2]
type = PorousFlowAdvectiveFlux
fluid_component = 2
variable = xnacl
[]
[energy]
type = PorousFlowEnergyTimeDerivative
variable = temperature
[]
[heatadv]
type = PorousFlowHeatAdvection
variable = temperature
[]
[conduction]
type = PorousFlowHeatConduction
variable = temperature
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pgas zi xnacl temperature'
number_fluid_phases = 2
number_fluid_components = 3
[]
[pc]
type = PorousFlowCapillaryPressureConst
pc = 0
[]
[fs]
type = PorousFlowBrineCO2
brine_fp = brine
co2_fp = co2
capillary_pressure = pc
[]
[]
[FluidProperties]
[co2]
type = CO2FluidProperties
[]
[brine]
type = BrineFluidProperties
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = temperature
[]
[brineco2]
type = PorousFlowFluidState
gas_porepressure = pgas
z = zi
temperature = temperature
temperature_unit = Celsius
xnacl = xnacl
capillary_pressure = pc
fluid_state = fs
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.2
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-12 0 0 0 1e-12 0 0 0 1e-12'
[]
[relperm_water]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
s_res = 0.1
sum_s_res = 0.1
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 1
[]
[rockheat]
type = PorousFlowMatrixInternalEnergy
specific_heat_capacity = 1000
density = 2500
[]
[rock_thermal_conductivity]
type = PorousFlowThermalConductivityIdeal
dry_thermal_conductivity = '50 0 0 0 50 0 0 0 50'
[]
[]
[BCs]
[cold_gas]
type = DirichletBC
boundary = left
variable = temperature
value = 20
[]
[gas_injecton]
type = PorousFlowSink
boundary = left
variable = zi
flux_function = -0.159155
[]
[rightwater]
type = DirichletBC
boundary = right
value = 20e6
variable = pgas
[]
[righttemp]
type = DirichletBC
boundary = right
value = 70
variable = temperature
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
petsc_options_value = 'gmres asm lu NONZERO 2'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 1e4
nl_abs_tol = 1e-7
nl_rel_tol = 1e-5
[TimeStepper]
type = IterationAdaptiveDT
dt = 1
growth_factor = 1.5
[]
[]
[Postprocessors]
[pgas]
type = PointValue
point = '2 0 0'
variable = pgas
[]
[sgas]
type = PointValue
point = '2 0 0'
variable = saturation_gas
[]
[zi]
type = PointValue
point = '2 0 0'
variable = zi
[]
[temperature]
type = PointValue
point = '2 0 0'
variable = temperature
[]
[massgas]
type = PorousFlowFluidMass
fluid_component = 1
[]
[x1]
type = PointValue
point = '2 0 0'
variable = x1
[]
[y0]
type = PointValue
point = '2 0 0'
variable = y0
[]
[]
[Outputs]
print_linear_residuals = false
perf_graph = true
csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/materials/2d-transient.i)
l = 10
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_v = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 20
ny = 10
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
rho = 'rho'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = ${inlet_v}
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[]
[AuxVariables]
[velocity_norm]
type = MooseVariableFVReal
[]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FVKernels]
[mass_time]
type = WCNSFVMassTimeDerivative
variable = pressure
drho_dt = drho_dt
[]
[mass]
type = WCNSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = 'rho'
[]
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = u
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = 'rho'
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = 'mu'
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = v
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = 'rho'
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = 'mu'
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T
rho = rho
drho_dt = drho_dt
h = h
dh_dt = dh_dt
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T
v = power_density
[]
[]
[FVBCs]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = u
boundary = 'top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = v
boundary = 'top bottom'
function = 0
[]
# Inlet
[inlet_u]
type = INSFVInletVelocityBC
variable = u
boundary = 'left'
function = ${inlet_v}
[]
[inlet_v]
type = INSFVInletVelocityBC
variable = v
boundary = 'left'
function = 0
[]
[inlet_T]
type = FVDirichletBC
variable = T
boundary = 'left'
value = ${inlet_temp}
[]
[outlet_p]
type = INSFVOutletPressureBC
variable = pressure
boundary = 'right'
function = ${outlet_pressure}
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T'
rho = 'rho'
[]
[fluid_props_to_mat_props]
type = GeneralFunctorFluidProps
fp = fp
pressure = 'pressure'
T_fluid = 'T'
speed = 'velocity_norm'
# even though we provide rho from the parameters, we
# want to get rho from the fluid properties
force_define_density = true
# To initialize with a high viscosity
mu_rampdown = 'mu_rampdown'
# For porous flow
characteristic_length = 1
porosity = 1
[]
[]
[AuxKernels]
[speed]
type = VectorMagnitudeAux
variable = 'velocity_norm'
x = u
y = v
[]
[]
[Functions]
[mu_rampdown]
type = PiecewiseLinear
x = '1 2 3 4'
y = '1e3 1e2 1e1 1'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-3
optimal_iterations = 6
[]
end_time = 15
nl_abs_tol = 1e-12
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
off_diagonals_in_auto_scaling = true
compute_scaling_once = false
[]
[Outputs]
exodus = true
[]
(modules/phase_field/examples/grain_growth/grain_growth_3D.i)
# This simulation predicts GB migration of a 3D copper polycrystal with 25 grains represented with 15 order parameters
# Time step adaptivity are used
# An AuxVariable is used to calculate the grain boundary locations
# Postprocessors are used to record time step and the number of grains
[Mesh]
# Mesh block. Meshes can be read in or automatically generated
type = GeneratedMesh
dim = 3 # Problem dimension
nx = 10 # Number of elements in the x-direction
ny = 10 # Number of elements in the y-direction
nz = 10
xmax = 1000 # maximum x-coordinate of the mesh
ymax = 1000 # maximum y-coordinate of the mesh
zmax = 1000
uniform_refine = 1 # Initial uniform refinement of the mesh
parallel_type = distributed
[]
[GlobalParams]
# Parameters used by several kernels that are defined globally to simplify input file
op_num = 15 # Number of order parameters used
var_name_base = gr # Base name of grains
order = CONSTANT
family = MONOMIAL
[]
[Modules]
[PhaseField]
[GrainGrowth]
family = LAGRANGE
order = FIRST
[]
[]
[]
[UserObjects]
[voronoi]
type = PolycrystalVoronoi
grain_num = 25 # Number of grains
rand_seed = 10
coloring_algorithm = jp
[]
[grain_tracker]
type = GrainTracker
threshold = 0.2
connecting_threshold = 0.08
compute_halo_maps = true # Only necessary for displaying HALOS
polycrystal_ic_uo = voronoi
[]
[]
[ICs]
[PolycrystalICs]
[PolycrystalColoringIC]
polycrystal_ic_uo = voronoi
[]
[]
[]
[AuxVariables]
# Dependent variables
[unique_grains]
[]
[var_indices]
[]
[ghost_regions]
[]
[halos]
[]
[halo0]
[]
[halo1]
[]
[halo2]
[]
[halo3]
[]
[halo4]
[]
[halo5]
[]
[halo6]
[]
[halo7]
[]
[halo8]
[]
[halo9]
[]
[halo10]
[]
[halo11]
[]
[halo12]
[]
[halo13]
[]
[halo14]
[]
[proc]
[]
[]
[AuxKernels]
# AuxKernel block, defining the equations used to calculate the auxvars
[unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_tracker
field_display = UNIQUE_REGION
execute_on = 'initial timestep_end'
[]
[var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
execute_on = 'initial timestep_end'
[]
[ghosted_entities]
type = FeatureFloodCountAux
variable = ghost_regions
flood_counter = grain_tracker
field_display = GHOSTED_ENTITIES
execute_on = 'initial timestep_end'
[]
[halos]
type = FeatureFloodCountAux
variable = halos
flood_counter = voronoi
field_display = HALOS
execute_on = 'initial timestep_end'
[]
[halo0]
type = FeatureFloodCountAux
variable = halo0
map_index = 0
field_display = HALOS
flood_counter = grain_tracker
execute_on = 'initial timestep_end'
[]
[halo1]
type = FeatureFloodCountAux
variable = halo1
map_index = 1
field_display = HALOS
flood_counter = grain_tracker
[]
[halo2]
type = FeatureFloodCountAux
variable = halo2
map_index = 2
field_display = HALOS
flood_counter = grain_tracker
[]
[halo3]
type = FeatureFloodCountAux
variable = halo3
map_index = 3
field_display = HALOS
flood_counter = grain_tracker
[]
[halo4]
type = FeatureFloodCountAux
variable = halo4
map_index = 4
field_display = HALOS
flood_counter = grain_tracker
[]
[halo5]
type = FeatureFloodCountAux
variable = halo5
map_index = 5
field_display = HALOS
flood_counter = grain_tracker
[]
[halo6]
type = FeatureFloodCountAux
variable = halo6
map_index = 6
field_display = HALOS
flood_counter = grain_tracker
[]
[halo7]
type = FeatureFloodCountAux
variable = halo7
map_index = 7
field_display = HALOS
flood_counter = grain_tracker
[]
[halo8]
type = FeatureFloodCountAux
variable = halo8
map_index = 8
field_display = HALOS
flood_counter = grain_tracker
[]
[halo9]
type = FeatureFloodCountAux
variable = halo9
map_index = 9
field_display = HALOS
flood_counter = grain_tracker
[]
[halo10]
type = FeatureFloodCountAux
variable = halo10
map_index = 10
field_display = HALOS
flood_counter = grain_tracker
[]
[halo11]
type = FeatureFloodCountAux
variable = halo11
map_index = 11
field_display = HALOS
flood_counter = grain_tracker
[]
[halo12]
type = FeatureFloodCountAux
variable = halo12
map_index = 12
field_display = HALOS
flood_counter = grain_tracker
[]
[halo13]
type = FeatureFloodCountAux
variable = halo13
map_index = 13
field_display = HALOS
flood_counter = grain_tracker
[]
[halo14]
type = FeatureFloodCountAux
variable = halo14
map_index = 14
field_display = HALOS
flood_counter = grain_tracker
[]
[proc]
type = ProcessorIDAux
variable = proc
execute_on = 'initial timestep_end'
[]
[]
[Materials]
[CuGrGr]
# Material properties
type = GBEvolution
T = 450 # Constant temperature of the simulation (for mobility calculation)
wGB = 125 # Width of the diffuse GB
GBmob0 = 2.5e-6 #m^4(Js) for copper from schonfelder1997molecular bibtex entry
Q = 0.23 #eV for copper from schonfelder1997molecular bibtex entry
GBenergy = 0.708 #J/m^2 from schonfelder1997molecular bibtex entry
[]
[]
[Postprocessors]
# Scalar postprocessors
[dt]
# Outputs the current time step
type = TimestepSize
[]
[]
[Executioner]
type = Transient # Type of executioner, here it is transient with an adaptive time step
scheme = bdf2 # Type of time integration (2nd order backward euler), defaults to 1st order backward euler
#Preconditioned JFNK (default)
solve_type = 'PJFNK'
# Uses newton iteration to solve the problem.
petsc_options_iname = '-pc_type'
petsc_options_value = 'asm'
l_max_its = 30 # Max number of linear iterations
l_tol = 1e-4 # Relative tolerance for linear solves
nl_max_its = 20 # Max number of nonlinear iterations
start_time = 0.0
end_time = 4000
[TimeStepper]
type = IterationAdaptiveDT
dt = 25 # Initial time step. In this simulation it changes.
optimal_iterations = 6 # Time step will adapt to maintain this number of nonlinear iterations
[]
[]
[Outputs]
exodus = true
csv = true
[pg]
type = PerfGraphOutput
execute_on = 'initial final' # Default is "final"
level = 2 # Default is 1
[]
[]
(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
[]
(modules/porous_flow/test/tests/fluidstate/coldwater_injection.i)
# Cold water injection into 1D hot reservoir (Avdonin, 1964)
#
# To generate results presented in documentation for this problem,
# set xmax = 50 and nx = 250 in the Mesh block, and dtmax = 100 and
# end_time = 1.3e5 in the Executioner block.
[Mesh]
type = GeneratedMesh
dim = 1
nx = 25
xmax = 20
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[AuxVariables]
[temperature]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[temperature]
type = PorousFlowPropertyAux
variable = temperature
property = temperature
execute_on = 'initial timestep_end'
[]
[]
[Variables]
[pliquid]
initial_condition = 5e6
[]
[h]
scaling = 1e-6
[]
[]
[ICs]
[hic]
type = PorousFlowFluidPropertyIC
variable = h
porepressure = pliquid
property = enthalpy
temperature = 170
temperature_unit = Celsius
fp = water
[]
[]
[BCs]
[pleft]
type = DirichletBC
variable = pliquid
value = 5.05e6
boundary = left
[]
[pright]
type = DirichletBC
variable = pliquid
value = 5e6
boundary = right
[]
[hleft]
type = DirichletBC
variable = h
value = 678.52e3
boundary = left
[]
[hright]
type = DirichletBC
variable = h
value = 721.4e3
boundary = right
[]
[]
[Kernels]
[mass]
type = PorousFlowMassTimeDerivative
variable = pliquid
[]
[massflux]
type = PorousFlowAdvectiveFlux
variable = pliquid
[]
[heat]
type = PorousFlowEnergyTimeDerivative
variable = h
[]
[heatflux]
type = PorousFlowHeatAdvection
variable = h
[]
[heatcond]
type = PorousFlowHeatConduction
variable = h
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pliquid h'
number_fluid_phases = 2
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureVG
pc_max = 1e6
sat_lr = 0.1
m = 0.5
alpha = 1e-5
[]
[fs]
type = PorousFlowWaterVapor
water_fp = water
capillary_pressure = pc
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[Materials]
[watervapor]
type = PorousFlowFluidStateSingleComponent
porepressure = pliquid
enthalpy = h
temperature_unit = Celsius
capillary_pressure = pc
fluid_state = fs
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.2
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1.8e-11 0 0 0 1.8e-11 0 0 0 1.8e-11'
[]
[relperm_water]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
s_res = 0.1
sum_s_res = 0.1
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 1
sum_s_res = 0.1
[]
[internal_energy]
type = PorousFlowMatrixInternalEnergy
density = 2900
specific_heat_capacity = 740
[]
[rock_thermal_conductivity]
type = PorousFlowThermalConductivityIdeal
dry_thermal_conductivity = '20 0 0 0 20 0 0 0 20'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 5e3
nl_abs_tol = 1e-10
[TimeStepper]
type = IterationAdaptiveDT
dt = 100
[]
[]
[VectorPostprocessors]
[line]
type = ElementValueSampler
sort_by = x
variable = temperature
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
perf_graph = true
[csv]
type = CSV
execute_on = final
[]
[]
(modules/porous_flow/examples/tutorial/13.i)
# Example of reactive transport model with dissolution of dolomite
#
# The equilibrium system has 5 primary species (Variables) and
# 5 secondary species (PorousFlowMassFractionAqueousEquilibrium).
# Some of the equilibrium constants have been chosen rather arbitrarily.
#
# Equilibrium reactions
# H+ + HCO3- = CO2(aq)
# -H+ + HCO3- = CO32-
# HCO3- + Ca2+ = CaHCO3+
# HCO3- + Mg2+ = MgHCO3+
# HCO3- + Fe2+ = FeHCO3+
#
# The kinetic reaction that dissolves dolomite involves all 5 primary species.
#
# -2H+ + 2HCO3- + Ca2+ + 0.8Mg2+ + 0.2Fe2+ = CaMg0.8Fe0.2(CO3)2
#
# The initial concentration of precipitated dolomite is high, so it starts
# to dissolve immediately, increasing the concentrations of the primary species.
#
# Only single-phase, fully saturated physics is used.
# The pressure gradient is fixed, so that the Darcy velocity is 0.1m/s.
#
# Primary species are injected from the left side, and they flow to the right.
# Less dolomite dissolution therefore occurs on the left side (where
# the primary species have higher concentration).
#
# This test is more fully documented in tutorial_13
[Mesh]
type = GeneratedMesh
dim = 1
nx = 100
xmax = 1
[]
[Variables]
[h+]
[]
[hco3-]
[]
[ca2+]
[]
[mg2+]
[]
[fe2+]
[]
[]
[AuxVariables]
[eqm_k0]
initial_condition = 2.19E6
[]
[eqm_k1]
initial_condition = 4.73E-11
[]
[eqm_k2]
initial_condition = 0.222
[]
[eqm_k3]
initial_condition = 1E-2
[]
[eqm_k4]
initial_condition = 1E-3
[]
[kinetic_k]
initial_condition = 326.2
[]
[pressure]
[]
[dolomite]
family = MONOMIAL
order = CONSTANT
[]
[dolomite_initial]
initial_condition = 1E-7
[]
[]
[AuxKernels]
[dolomite]
type = PorousFlowPropertyAux
property = mineral_concentration
mineral_species = 0
variable = dolomite
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[ICs]
[pressure_ic]
type = FunctionIC
variable = pressure
function = '(1 - x) * 1E6'
[]
[h+_ic]
type = BoundingBoxIC
variable = h+
x1 = 0.0
y1 = 0.0
x2 = 1.0e-10
y2 = 0.25
inside = 5.0e-2
outside = 1.0e-6
[]
[hco3_ic]
type = BoundingBoxIC
variable = hco3-
x1 = 0.0
y1 = 0.0
x2 = 1.0e-10
y2 = 0.25
inside = 5.0e-2
outside = 1.0e-6
[]
[ca2_ic]
type = BoundingBoxIC
variable = ca2+
x1 = 0.0
y1 = 0.0
x2 = 1.0e-10
y2 = 0.25
inside = 5.0e-2
outside = 1.0e-6
[]
[mg2_ic]
type = BoundingBoxIC
variable = mg2+
x1 = 0.0
y1 = 0.0
x2 = 1.0e-10
y2 = 0.25
inside = 5.0e-2
outside = 1.0e-6
[]
[fe2_ic]
type = BoundingBoxIC
variable = fe2+
x1 = 0.0
y1 = 0.0
x2 = 1.0e-10
y2 = 0.25
inside = 5.0e-2
outside = 1.0e-6
[]
[]
[Kernels]
[h+_ie]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = h+
[]
[h+_conv]
type = PorousFlowAdvectiveFlux
fluid_component = 0
variable = h+
[]
[predis_h+]
type = PorousFlowPreDis
variable = h+
mineral_density = 2875.0
stoichiometry = -2
[]
[hco3-_ie]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = hco3-
[]
[hco3-_conv]
type = PorousFlowAdvectiveFlux
fluid_component = 1
variable = hco3-
[]
[predis_hco3-]
type = PorousFlowPreDis
variable = hco3-
mineral_density = 2875.0
stoichiometry = 2
[]
[ca2+_ie]
type = PorousFlowMassTimeDerivative
fluid_component = 2
variable = ca2+
[]
[ca2+_conv]
type = PorousFlowAdvectiveFlux
fluid_component = 2
variable = ca2+
[]
[predis_ca2+]
type = PorousFlowPreDis
variable = ca2+
mineral_density = 2875.0
stoichiometry = 1
[]
[mg2+_ie]
type = PorousFlowMassTimeDerivative
fluid_component = 3
variable = mg2+
[]
[mg2+_conv]
type = PorousFlowAdvectiveFlux
fluid_component = 3
variable = mg2+
[]
[predis_mg2+]
type = PorousFlowPreDis
variable = mg2+
mineral_density = 2875.0
stoichiometry = 0.8
[]
[fe2+_ie]
type = PorousFlowMassTimeDerivative
fluid_component = 4
variable = fe2+
[]
[fe2+_conv]
type = PorousFlowAdvectiveFlux
fluid_component = 4
variable = fe2+
[]
[predis_fe2+]
type = PorousFlowPreDis
variable = fe2+
mineral_density = 2875.0
stoichiometry = 0.2
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'h+ hco3- ca2+ mg2+ fe2+'
number_fluid_phases = 1
number_fluid_components = 6
number_aqueous_equilibrium = 5
number_aqueous_kinetic = 1
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
viscosity = 1E-3
[]
[]
[BCs]
[hco3-_left]
type = DirichletBC
variable = hco3-
boundary = left
value = 5E-2
[]
[h+_left]
type = DirichletBC
variable = h+
boundary = left
value = 5E-2
[]
[ca2+_left]
type = DirichletBC
variable = ca2+
boundary = left
value = 5E-2
[]
[mg2+_left]
type = DirichletBC
variable = mg2+
boundary = left
value = 5E-2
[]
[fe2+_left]
type = DirichletBC
variable = fe2+
boundary = left
value = 5E-2
[]
[hco3-_right]
type = DirichletBC
variable = hco3-
boundary = right
value = 1E-6
[]
[h+_right]
type = DirichletBC
variable = h+
boundary = right
value = 1e-6
[]
[ca2+_right]
type = DirichletBC
variable = ca2+
boundary = right
value = 1E-6
[]
[mg2+_right]
type = DirichletBC
variable = mg2+
boundary = right
value = 1E-6
[]
[fe2+_right]
type = DirichletBC
variable = fe2+
boundary = right
value = 1E-6
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = 298.15
[]
[ppss]
type = PorousFlow1PhaseFullySaturated
porepressure = pressure
[]
[equilibrium_massfrac]
type = PorousFlowMassFractionAqueousEquilibriumChemistry
mass_fraction_vars = 'h+ hco3- ca2+ mg2+ fe2+'
num_reactions = 5
equilibrium_constants = 'eqm_k0 eqm_k1 eqm_k2 eqm_k3 eqm_k4'
primary_activity_coefficients = '1 1 1 1 1'
secondary_activity_coefficients = '1 1 1 1 1'
reactions = '1 1 0 0 0
-1 1 0 0 0
0 1 1 0 0
0 1 0 1 0
0 1 0 0 1'
[]
[kinetic]
type = PorousFlowAqueousPreDisChemistry
primary_concentrations = 'h+ hco3- ca2+ mg2+ fe2+'
num_reactions = 1
equilibrium_constants = kinetic_k
primary_activity_coefficients = '1 1 1 1 1'
reactions = '-2 2 1 0.8 0.2'
specific_reactive_surface_area = '1.2E-8'
kinetic_rate_constant = '3E-4'
activation_energy = '1.5e4'
molar_volume = 64365.0
gas_constant = 8.314
reference_temperature = 298.15
[]
[dolomite_conc]
type = PorousFlowAqueousPreDisMineral
initial_concentrations = dolomite_initial
[]
[simple_fluid]
type = PorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.2
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1E-10 0 0 0 1E-10 0 0 0 1E-10'
[]
[relp]
type = PorousFlowRelativePermeabilityConst
phase = 0
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 1
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.1
[]
[]
[Preconditioning]
active = basic
[basic]
type = SMP
full = true
petsc_options = '-ksp_diagonal_scale -ksp_diagonal_scale_fix'
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
petsc_options_value = ' asm lu NONZERO 2'
[]
[preferred_but_might_not_be_installed]
type = SMP
full = true
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = ' lu mumps'
[]
[]
[Outputs]
print_linear_residuals = false
perf_graph = true
exodus = true
[]
(modules/porous_flow/test/tests/dispersion/disp01_fv.i)
# Test dispersive part of FVPorousFlowDispersiveFlux kernel by setting diffusion
# coefficients to zero. A pressure gradient is applied over the mesh to give a
# uniform velocity. Gravity is set to zero.
# Mass fraction is set to 1 on the left hand side and 0 on the right hand side.
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
xmax = 10
bias_x = 1.1
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[Variables]
[pp]
type = MooseVariableFVReal
[]
[massfrac0]
type = MooseVariableFVReal
[]
[]
[AuxVariables]
[velocity]
family = MONOMIAL
order = FIRST
[]
[]
[AuxKernels]
[velocity]
type = ADPorousFlowDarcyVelocityComponent
variable = velocity
component = x
[]
[]
[ICs]
[pp]
type = FunctionIC
variable = pp
function = pic
[]
[massfrac0]
type = ConstantIC
variable = massfrac0
value = 0
[]
[]
[Functions]
[pic]
type = ParsedFunction
expression = '1.1e5-x*1e3'
[]
[]
[FVBCs]
[xleft]
type = FVDirichletBC
value = 1
variable = massfrac0
boundary = left
[]
[xright]
type = FVDirichletBC
value = 0
variable = massfrac0
boundary = right
[]
[pright]
type = FVDirichletBC
variable = pp
boundary = right
value = 1e5
[]
[pleft]
type = FVDirichletBC
variable = pp
boundary = left
value = 1.1e5
[]
[]
[FVKernels]
[mass0]
type = FVPorousFlowMassTimeDerivative
fluid_component = 0
variable = pp
[]
[adv0]
type = FVPorousFlowAdvectiveFlux
fluid_component = 0
variable = pp
[]
[diff0]
type = FVPorousFlowDispersiveFlux
variable = pp
disp_trans = 0
disp_long = 0.2
[]
[mass1]
type = FVPorousFlowMassTimeDerivative
fluid_component = 1
variable = massfrac0
[]
[adv1]
type = FVPorousFlowAdvectiveFlux
fluid_component = 1
variable = massfrac0
[]
[diff1]
type = FVPorousFlowDispersiveFlux
fluid_component = 1
variable = massfrac0
disp_trans = 0
disp_long = 0.2
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pp massfrac0'
number_fluid_phases = 1
number_fluid_components = 2
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 1e9
density0 = 1000
viscosity = 0.001
thermal_expansion = 0
[]
[]
[Materials]
[temperature]
type = ADPorousFlowTemperature
[]
[ppss]
type = ADPorousFlow1PhaseFullySaturated
porepressure = pp
[]
[massfrac]
type = ADPorousFlowMassFraction
mass_fraction_vars = massfrac0
[]
[simple_fluid]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[poro]
type = ADPorousFlowPorosityConst
porosity = 0.3
[]
[diff]
type = ADPorousFlowDiffusivityConst
diffusion_coeff = '0 0'
tortuosity = 0.1
[]
[relp]
type = ADPorousFlowRelativePermeabilityConst
phase = 0
[]
[permeability]
type = ADPorousFlowPermeabilityConst
permeability = '1e-9 0 0 0 1e-9 0 0 0 1e-9'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'gmres asm lu NONZERO'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 3e2
dtmax = 100
nl_abs_tol = 1e-12
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 2
cutback_factor = 0.5
dt = 10
[]
[]
[VectorPostprocessors]
[xmass]
type = ElementValueSampler
sort_by = id
variable = 'massfrac0 velocity'
[]
[]
[Outputs]
[out]
type = CSV
execute_on = final
[]
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_mdot.i)
rho = 'rho'
l = 10
inlet_area = 1
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 10
ny = 5
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = ${inlet_velocity}
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T_fluid]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[scalar]
type = MooseVariableFVReal
initial_condition = 0.1
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FVKernels]
# Mass equation
[mass_time]
type = WCNSFVMassTimeDerivative
variable = pressure
drho_dt = drho_dt
[]
[mass]
type = WCNSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
# X component momentum equation
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = vel_x
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
# Y component momentum equation
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = vel_y
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
# Energy equation
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T_fluid
rho = rho
drho_dt = drho_dt
h = h
dh_dt = dh_dt
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T_fluid
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T_fluid
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T_fluid
v = power_density
[]
# Scalar concentration equation
[scalar_time]
type = FVFunctorTimeKernel
variable = scalar
[]
[scalar_advection]
type = INSFVScalarFieldAdvection
variable = scalar
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[scalar_diffusion]
type = FVDiffusion
variable = scalar
coeff = 1.1
[]
[scalar_source]
type = FVBodyForce
variable = scalar
function = 2.1
[]
[]
[FVBCs]
# Inlet
[inlet_mass]
type = WCNSFVMassFluxBC
variable = pressure
boundary = 'left'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_u]
type = WCNSFVMomentumFluxBC
variable = vel_x
boundary = 'left'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
momentum_component = 'x'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_v]
type = WCNSFVMomentumFluxBC
variable = vel_y
boundary = 'left'
mdot_pp = 0
area_pp = 'area_pp_left'
rho = 'rho'
momentum_component = 'y'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_T]
type = WCNSFVEnergyFluxBC
variable = T_fluid
T_fluid = T_fluid
boundary = 'left'
temperature_pp = 'inlet_T'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
cp = 'cp'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_scalar]
type = WCNSFVScalarFluxBC
variable = scalar
boundary = 'left'
scalar_value_pp = 'inlet_scalar_value'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
passive_scalar = scalar
[]
[outlet_p]
type = INSFVOutletPressureBC
variable = pressure
boundary = 'right'
function = ${outlet_pressure}
[]
# Walls
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'top bottom'
function = 0
[]
[]
# used for the boundary conditions in this example
[Postprocessors]
[inlet_mdot]
type = Receiver
default = ${fparse 1980 * inlet_velocity * inlet_area}
[]
[area_pp_left]
type = AreaPostprocessor
boundary = 'left'
execute_on = 'INITIAL'
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
[]
[inlet_scalar_value]
type = Receiver
default = 0.2
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T_fluid
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T_fluid'
rho = ${rho}
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-2
optimal_iterations = 6
[]
end_time = 1
nl_abs_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
exodus = true
execute_on = FINAL
[]
(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/phase_field/tutorials/spinodal_decomposition/s4_mobility.i)
#
# Example simulation of an iron-chromium alloy at 500 C. Equilibrium
# concentrations are at 23.6 and 82.3 mol% Cr. Kappa value, free energy equation,
# and mobility equation were provided by Lars Hoglund. Solved using the split
# form of the Cahn-Hilliard equation.
#
[Mesh]
type = GeneratedMesh
dim = 2
elem_type = QUAD4
nx = 25
ny = 25
nz = 0
xmin = 0
xmax = 25
ymin = 0
ymax = 25
zmin = 0
zmax = 0
uniform_refine = 2
[]
[Variables]
[./c] # Mole fraction of Cr (unitless)
order = FIRST
family = LAGRANGE
[../]
[./w] # Chemical potential (eV/mol)
order = FIRST
family = LAGRANGE
[../]
[]
[ICs]
[./concentrationIC] # 46.774 mol% Cr with variations
type = RandomIC
min = 0.44774
max = 0.48774
seed = 210
variable = c
[../]
[]
[BCs]
[./Periodic]
[./c_bcs]
auto_direction = 'x y'
[../]
[../]
[]
[Kernels]
[./w_dot]
variable = w
v = c
type = CoupledTimeDerivative
[../]
[./coupled_res]
variable = w
type = SplitCHWRes
mob_name = M
[../]
[./coupled_parsed]
variable = c
type = SplitCHParsed
f_name = f_loc
kappa_name = kappa_c
w = w
[../]
[]
[Materials]
# d is a scaling factor that makes it easier for the solution to converge
# without changing the results. It is defined in each of the first three
# materials and must have the same value in each one.
[./kappa] # Gradient energy coefficient (eV nm^2/mol)
type = GenericFunctionMaterial
prop_names = 'kappa_c'
prop_values = '8.125e-16*6.24150934e+18*1e+09^2*1e-27'
# kappa_c *eV_J*nm_m^2* d
[../]
[./mobility] # Mobility (nm^2 mol/eV/s)
# NOTE: This is a fitted equation, so only 'Conv' has units
type = DerivativeParsedMaterial
property_name = M
coupled_variables = c
constant_names = 'Acr Bcr Ccr Dcr
Ecr Fcr Gcr
Afe Bfe Cfe Dfe
Efe Ffe Gfe
nm_m eV_J d'
constant_expressions = '-32.770969 -25.8186669 -3.29612744 17.669757
37.6197853 20.6941796 10.8095813
-31.687117 -26.0291774 0.2286581 24.3633544
44.3334237 8.72990497 20.956768
1e+09 6.24150934e+18 1e-27'
expression = 'nm_m^2/eV_J/d*((1-c)^2*c*10^
(Acr*c+Bcr*(1-c)+Ccr*c*log(c)+Dcr*(1-c)*log(1-c)+
Ecr*c*(1-c)+Fcr*c*(1-c)*(2*c-1)+Gcr*c*(1-c)*(2*c-1)^2)
+c^2*(1-c)*10^
(Afe*c+Bfe*(1-c)+Cfe*c*log(c)+Dfe*(1-c)*log(1-c)+
Efe*c*(1-c)+Ffe*c*(1-c)*(2*c-1)+Gfe*c*(1-c)*(2*c-1)^2))'
derivative_order = 1
outputs = exodus
[../]
[./local_energy] # Local free energy function (eV/mol)
type = DerivativeParsedMaterial
property_name = f_loc
coupled_variables = c
constant_names = 'A B C D E F G eV_J d'
constant_expressions = '-2.446831e+04 -2.827533e+04 4.167994e+03 7.052907e+03
1.208993e+04 2.568625e+03 -2.354293e+03
6.24150934e+18 1e-27'
expression = 'eV_J*d*(A*c+B*(1-c)+C*c*log(c)+D*(1-c)*log(1-c)+
E*c*(1-c)+F*c*(1-c)*(2*c-1)+G*c*(1-c)*(2*c-1)^2)'
derivative_order = 2
[../]
[./precipitate_indicator] # Returns 1/625 if precipitate
type = ParsedMaterial
property_name = prec_indic
coupled_variables = c
expression = if(c>0.6,0.0016,0)
[../]
[]
[Postprocessors]
[./step_size] # Size of the time step
type = TimestepSize
[../]
[./iterations] # Number of iterations needed to converge timestep
type = NumNonlinearIterations
[../]
[./nodes] # Number of nodes in mesh
type = NumNodes
[../]
[./evaluations] # Cumulative residual calculations for simulation
type = NumResidualEvaluations
[../]
[./precipitate_area] # Fraction of surface devoted to precipitates
type = ElementIntegralMaterialProperty
mat_prop = prec_indic
[../]
[./active_time] # Time computer spent on simulation
type = PerfGraphData
section_name = "Root"
data_type = total
[../]
[]
[Preconditioning]
[./coupled]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
l_max_its = 30
l_tol = 1e-6
nl_max_its = 50
nl_abs_tol = 1e-9
end_time = 604800 # 7 days
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type
-sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly
ilu 1'
[./TimeStepper]
type = IterationAdaptiveDT
dt = 10
cutback_factor = 0.8
growth_factor = 1.5
optimal_iterations = 7
[../]
[./Adaptivity]
coarsen_fraction = 0.1
refine_fraction = 0.7
max_h_level = 2
[../]
[]
[Debug]
show_var_residual_norms = true
[]
[Outputs]
exodus = true
console = true
csv = true
[./console]
type = Console
max_rows = 10
[../]
[]
(modules/porous_flow/examples/solute_tracer_transport/solute_tracer_transport_2D.i)
# Longitudinal dispersivity
disp = 5
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 100
xmin = -50
xmax = 50
ny = 60
ymin = 0
ymax = 50
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[Variables]
[porepressure]
initial_condition = 1e5
[]
[C]
initial_condition = 0
[]
[]
[AuxVariables]
[Darcy_vel_x]
order = CONSTANT
family = MONOMIAL
[]
[Darcy_vel_y]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[Darcy_vel_x]
type = PorousFlowDarcyVelocityComponent
variable = Darcy_vel_x
component = x
fluid_phase = 0
[]
[Darcy_vel_y]
type = PorousFlowDarcyVelocityComponent
variable = Darcy_vel_y
component = y
fluid_phase = 0
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'porepressure C'
number_fluid_phases = 1
number_fluid_components = 2
[]
[]
[Kernels]
[mass_der_water]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = porepressure
[]
[adv_pp]
type = PorousFlowFullySaturatedDarcyFlow
variable = porepressure
fluid_component = 1
[]
[diff_pp]
type = PorousFlowDispersiveFlux
fluid_component = 1
variable = porepressure
disp_trans = 0
disp_long = ${disp}
[]
[mass_der_C]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = C
[]
[adv_C]
type = PorousFlowFullySaturatedDarcyFlow
fluid_component = 0
variable = C
[]
[diff_C]
type = PorousFlowDispersiveFlux
fluid_component = 0
variable = C
disp_trans = 0
disp_long = ${disp}
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[Materials]
[ps]
type = PorousFlow1PhaseFullySaturated
porepressure = porepressure
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.25
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1E-11 0 0 0 1E-11 0 0 0 1E-11'
[]
[water]
type = PorousFlowSingleComponentFluid
fp = water
phase = 0
[]
[massfrac]
type = PorousFlowMassFraction
mass_fraction_vars = C
[]
[temperature]
type = PorousFlowTemperature
temperature = 293
[]
[diff]
type = PorousFlowDiffusivityConst
diffusion_coeff = '0 0'
tortuosity = 0.1
[]
[relperm]
type = PorousFlowRelativePermeabilityConst
kr = 1
phase = 0
[]
[]
[DiracKernels]
[source_P]
type = PorousFlowSquarePulsePointSource
point = '0 0 0'
mass_flux = 1e-1
variable = porepressure
[]
[source_C]
type = PorousFlowSquarePulsePointSource
point = '0 0 0'
mass_flux = 1e-7
variable = C
[]
[]
[BCs]
[constant_outlet_porepressure_]
type = DirichletBC
variable = porepressure
value = 1e5
boundary = 'top left right'
[]
[outlet_tracer_top]
type = PorousFlowOutflowBC
variable = C
boundary = top
mass_fraction_component = 0
[]
[outlet_tracer_right]
type = PorousFlowOutflowBC
variable = C
boundary = right
mass_fraction_component = 0
[]
[outlet_tracer_left]
type = PorousFlowOutflowBC
variable = C
boundary = left
mass_fraction_component = 0
[]
[]
[Preconditioning]
[basic]
type = SMP
full = true
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
petsc_options_value = ' asm lu NONZERO 2'
[]
[]
[Executioner]
type = Transient
end_time = 17280000
dtmax = 100000
nl_rel_tol = 1e-6
nl_abs_tol = 1e-12
[TimeStepper]
type = IterationAdaptiveDT
dt = 1000
[]
[]
[Postprocessors]
[C]
type = PointValue
variable = C
point = '0 25 0'
[]
[Darcy_x]
type = PointValue
variable = Darcy_vel_x
point = '0 25 0'
[]
[Darcy_y]
type = PointValue
variable = Darcy_vel_y
point = '0 25 0'
[]
[]
[Outputs]
file_base = solute_tracer_transport_2D_${disp}
csv = true
exodus = true
[]
(modules/thermal_hydraulics/tutorials/single_phase_flow/04_loop.i)
T_in = 300. # K
m_dot_in = 1e-2 # kg/s
press = 10e5 # Pa
# core parameters
core_length = 1. # m
core_n_elems = 25
core_dia = '${units 2. cm -> m}'
core_pitch = '${units 8.7 cm -> m}'
# pipe parameters
pipe_dia = '${units 10. cm -> m}'
A_pipe = '${fparse 0.25 * pi * pipe_dia^2}'
A_core = '${fparse core_pitch^2 - 0.25 *pi * core_dia^2}'
P_wet_core = '${fparse 4*core_pitch + pi * core_dia}'
Dh_core = '${fparse 4 * A_core / P_wet_core}'
tot_power = 2000 # W
[GlobalParams]
initial_p = ${press}
initial_vel = 0.0001
initial_T = ${T_in}
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
gravity_vector = '0 0 0'
rdg_slope_reconstruction = minmod
scaling_factor_1phase = '1 1e-2 1e-4'
scaling_factor_rhoV = 1
scaling_factor_rhouV = 1e-2
scaling_factor_rhovV = 1e-2
scaling_factor_rhowV = 1e-2
scaling_factor_rhoEV = 1e-4
closures = simple_closures
fp = he
[]
[FluidProperties]
[he]
type = IdealGasFluidProperties
molar_mass = 4e-3
gamma = 1.67
k = 0.2556
mu = 3.22639e-5
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseTHM
[]
[]
[SolidProperties]
[steel]
type = ThermalFunctionSolidProperties
rho = 8050
k = 45
cp = 466
[]
[]
[Components]
[total_power]
type = TotalPower
power = ${tot_power}
[]
[up_pipe_1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 1'
length = 0.5
n_elems = 15
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct1]
type = JunctionParallelChannels1Phase
position = '0 0 0.5'
connections = 'up_pipe_1:out core_chan:in'
volume = 1e-5
[]
[core_chan]
type = FlowChannel1Phase
position = '0 0 0.5'
orientation = '0 0 1'
length = ${core_length}
n_elems = ${core_n_elems}
roughness = .0001
A = '${A_core}'
D_h = ${Dh_core}
[]
[core_hs]
type = HeatStructureCylindrical
position = '0 0 0.5'
orientation = '0 0 1'
length = ${core_length}
n_elems = ${core_n_elems}
names = 'block'
widths = '${fparse core_dia / 2.}'
solid_properties = 'steel'
solid_properties_T_ref = '300'
n_part_elems = 3
[]
[core_heating]
type = HeatSourceFromTotalPower
hs = core_hs
regions = block
power = total_power
[]
[core_ht]
type = HeatTransferFromHeatStructure1Phase
flow_channel = core_chan
hs = core_hs
hs_side = outer
P_hf = '${fparse pi * core_dia}'
[]
[jct2]
type = JunctionParallelChannels1Phase
position = '0 0 1.5'
connections = 'core_chan:out up_pipe_2:in'
volume = 1e-5
[]
[up_pipe_2]
type = FlowChannel1Phase
position = '0 0 1.5'
orientation = '0 0 1'
length = 0.5
n_elems = 10
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct3]
type = JunctionOneToOne1Phase
connections = 'up_pipe_2:out top_pipe_1:in'
[]
[top_pipe_1]
type = FlowChannel1Phase
position = '0 0 2'
orientation = '1 0 0'
length = 0.5
n_elems = 10
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[top_pipe_2]
type = FlowChannel1Phase
position = '0.5 0 2'
orientation = '1 0 0'
length = 0.5
n_elems = 10
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct4]
type = VolumeJunction1Phase
position = '0.5 0 2'
volume = 1e-5
connections = 'top_pipe_1:out top_pipe_2:in press_pipe:in'
[]
[press_pipe]
type = FlowChannel1Phase
position = '0.5 0 2'
orientation = '0 0 1'
length = 0.2
n_elems = 5
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[pressurizer]
type = InletStagnationPressureTemperature1Phase
p0 = ${press}
T0 = ${T_in}
input = press_pipe:out
[]
[jct5]
type = JunctionOneToOne1Phase
connections = 'top_pipe_2:out down_pipe_1:in'
[]
[down_pipe_1]
type = FlowChannel1Phase
position = '1 0 2'
orientation = '0 0 -1'
length = 0.25
A = ${A_pipe}
n_elems = 5
[]
[jct6]
type = JunctionOneToOne1Phase
connections = 'down_pipe_1:out cooling_pipe:in'
[]
[cooling_pipe]
type = FlowChannel1Phase
position = '1 0 1.75'
orientation = '0 0 -1'
length = 1.5
n_elems = 25
A = ${A_pipe}
[]
[cold_wall]
type = HeatTransferFromSpecifiedTemperature1Phase
flow_channel = cooling_pipe
T_wall = 300
P_hf = '${fparse pi * pipe_dia}'
[]
[jct7]
type = JunctionOneToOne1Phase
connections = 'cooling_pipe:out down_pipe_2:in'
[]
[down_pipe_2]
type = FlowChannel1Phase
position = '1 0 0.25'
orientation = '0 0 -1'
length = 0.25
n_elems = 10
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct8]
type = JunctionOneToOne1Phase
connections = 'down_pipe_2:out bottom_1:in'
[]
[bottom_1]
type = FlowChannel1Phase
position = '1 0 0'
orientation = '-1 0 0'
length = 0.5
n_elems = 5
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[pump]
type = Pump1Phase
position = '0.5 0 0'
connections = 'bottom_1:out bottom_2:in'
volume = 1e-4
A_ref = ${A_pipe}
head = 0
[]
[bottom_2]
type = FlowChannel1Phase
position = '0.5 0 0'
orientation = '-1 0 0'
length = 0.5
n_elems = 5
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct10]
type = JunctionOneToOne1Phase
connections = 'bottom_2:out up_pipe_1:in'
[]
[]
[ControlLogic]
[set_point]
type = GetFunctionValueControl
function = ${m_dot_in}
[]
[pid]
type = PIDControl
initial_value = 0
set_point = set_point:value
input = m_dot_pump
K_p = 1.
K_i = 4.
K_d = 0
[]
[set_pump_head]
type = SetComponentRealValueControl
component = pump
parameter = head
value = pid:output
[]
[]
[Postprocessors]
[power_to_coolant]
type = ADHeatRateConvection1Phase
block = core_chan
P_hf = '${fparse pi *core_dia}'
[]
[m_dot_pump]
type = ADFlowJunctionFlux1Phase
boundary = core_chan:in
connection_index = 1
equation = mass
junction = jct7
[]
[core_T_out]
type = SideAverageValue
boundary = core_chan:out
variable = T
[]
[core_p_in]
type = SideAverageValue
boundary = core_chan:in
variable = p
[]
[core_p_out]
type = SideAverageValue
boundary = core_chan:out
variable = p
[]
[core_delta_p]
type = ParsedPostprocessor
pp_names = 'core_p_in core_p_out'
function = 'core_p_in - core_p_out'
[]
[hx_pri_T_out]
type = SideAverageValue
boundary = cooling_pipe:out
variable = T
[]
[pump_head]
type = RealComponentParameterValuePostprocessor
component = pump
parameter = head
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
start_time = 0
[TimeStepper]
type = IterationAdaptiveDT
dt = 1
[]
dtmax = 5
end_time = 500
line_search = basic
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
nl_max_its = 25
[]
[Outputs]
exodus = true
[console]
type = Console
max_rows = 1
outlier_variable_norms = false
[]
print_linear_residuals = false
[]
(modules/navier_stokes/test/tests/finite_volume/materials/ergun/ergun.i)
# This file simulates flow of fluid in a porous elbow for the purpose of verifying
# correct implementation of the various different solution variable sets. This input
# tests correct implementation of the primitive superficial variable set. Flow enters on the top
# and exits on the right. Because the purpose is only to test the equivalence of
# different equation sets, no solid energy equation is included.
porosity_left = 0.4
porosity_right = 0.6
pebble_diameter = 0.06
mu = 1.81e-5 # This has been increased to avoid refining the mesh
M = 28.97e-3
R = 8.3144598
# inlet mass flowrate, kg/s
mdot = -10.0
# inlet mass flux (superficial)
mflux_in_superficial = ${fparse mdot / (pi * 0.5 * 0.5)}
# inlet mass flux (interstitial)
mflux_in_interstitial = ${fparse mflux_in_superficial / porosity_left}
p_initial = 201325.0
T_initial = 300.0
rho_initial = ${fparse p_initial / T_initial * M / R}
vel_y_initial = ${fparse mflux_in_interstitial / rho_initial}
vel_x_initial = 0.0
superficial_vel_y_initial = ${fparse mflux_in_superficial / rho_initial}
superficial_vel_x_initial = 1e-12
# Computation parameters
velocity_interp_method = 'rc'
advected_interp_method = 'upwind'
# ==============================================================================
# GEOMETRY AND MESH
# ==============================================================================
[Mesh]
[fmg]
type = FileMeshGenerator
file = 'ergun_in.e'
[]
coord_type = RZ
[]
[UserObjects]
[rc]
type = PINSFVRhieChowInterpolator
u = superficial_vel_x
v = superficial_vel_y
pressure = pressure
porosity = porosity
[]
[]
[GlobalParams]
porosity = porosity
pebble_diameter = ${pebble_diameter}
fp = fp
# rho for the kernels. Must match fluid property!
rho = ${rho_initial}
fv = true
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
# behavior at time of test creation
two_term_boundary_expansion = false
rhie_chow_user_object = 'rc'
[]
# ==============================================================================
# VARIABLES AND KERNELS
# ==============================================================================
[Variables]
[pressure]
type = INSFVPressureVariable
initial_condition = ${p_initial}
[]
[superficial_vel_x]
type = PINSFVSuperficialVelocityVariable
initial_condition = ${superficial_vel_x_initial}
[]
[superficial_vel_y]
type = PINSFVSuperficialVelocityVariable
initial_condition = ${superficial_vel_y_initial}
[]
[]
[FVKernels]
# Mass Equation.
[mass]
type = PINSFVMassAdvection
variable = 'pressure'
[]
# Momentum x component equation.
[vel_x_time]
type = PINSFVMomentumTimeDerivative
variable = 'superficial_vel_x'
momentum_component = 'x'
[]
[vel_x_advection]
type = PINSFVMomentumAdvection
variable = 'superficial_vel_x'
momentum_component = 'x'
[]
[vel_x_viscosity]
type = PINSFVMomentumDiffusion
variable = 'superficial_vel_x'
momentum_component = 'x'
mu = 'mu'
[]
[u_pressure]
type = PINSFVMomentumPressure
variable = 'superficial_vel_x'
pressure = pressure
momentum_component = 'x'
[]
[u_friction]
type = PINSFVMomentumFriction
variable = 'superficial_vel_x'
Darcy_name = 'Darcy_coefficient'
Forchheimer_name = 'Forchheimer_coefficient'
momentum_component = 'x'
speed = speed
mu = 'mu'
[]
# Momentum y component equation.
[vel_y_time]
type = PINSFVMomentumTimeDerivative
variable = 'superficial_vel_y'
momentum_component = 'y'
[]
[vel_y_advection]
type = PINSFVMomentumAdvection
variable = 'superficial_vel_y'
momentum_component = 'y'
[]
[vel_y_viscosity]
type = PINSFVMomentumDiffusion
variable = 'superficial_vel_y'
momentum_component = 'y'
mu = 'mu'
[]
[v_pressure]
type = PINSFVMomentumPressure
variable = 'superficial_vel_y'
pressure = pressure
momentum_component = 'y'
[]
[v_friction]
type = PINSFVMomentumFriction
variable = 'superficial_vel_y'
Darcy_name = 'Darcy_coefficient'
Forchheimer_name = 'Forchheimer_coefficient'
momentum_component = 'y'
mu = 'mu'
speed = speed
[]
[gravity]
type = PINSFVMomentumGravity
variable = 'superficial_vel_y'
gravity = '0 -9.81 0'
momentum_component = 'y'
[]
[]
# ==============================================================================
# AUXVARIABLES AND AUXKERNELS
# ==============================================================================
[AuxVariables]
[T_fluid]
initial_condition = ${T_initial}
order = CONSTANT
family = MONOMIAL
[]
[vel_x]
initial_condition = ${fparse vel_x_initial}
order = CONSTANT
family = MONOMIAL
[]
[vel_y]
initial_condition = ${fparse vel_y_initial}
order = CONSTANT
family = MONOMIAL
[]
[porosity_out]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[vel_x]
type = FunctorAux
variable = vel_x
functor = vel_x_mat
[]
[vel_y]
type = FunctorAux
variable = vel_y
functor = vel_y_mat
[]
[porosity_out]
type = FunctorAux
variable = porosity_out
functor = porosity
[]
[]
# ==============================================================================
# FLUID PROPERTIES, MATERIALS AND USER OBJECTS
# ==============================================================================
[FluidProperties]
[fp]
type = IdealGasFluidProperties
k = 0.0
mu = ${mu}
gamma = 1.4
molar_mass = ${M}
[]
[]
[FunctorMaterials]
[enthalpy]
type = INSFVEnthalpyMaterial
temperature = 'T_fluid'
[]
[speed]
type = PINSFVSpeedFunctorMaterial
superficial_vel_x = 'superficial_vel_x'
superficial_vel_y = 'superficial_vel_y'
porosity = porosity
vel_x = vel_x_mat
vel_y = vel_y_mat
[]
[kappa]
type = FunctorKappaFluid
[]
[const_Fdrags_mat]
type = FunctorErgunDragCoefficients
porosity = porosity
[]
[fluidprops]
type = GeneralFunctorFluidProps
mu_rampdown = mu_func
porosity = porosity
characteristic_length = ${pebble_diameter}
T_fluid = 'T_fluid'
pressure = 'pressure'
speed = 'speed'
[]
[]
d = 0.05
[Functions]
[mu_func]
type = PiecewiseLinear
x = '1 3 5 10 15 20'
y = '1e5 1e4 1e3 1e2 1e1 1'
[]
[real_porosity_function]
type = ParsedFunction
expression = 'if (x < 0.6 - ${d}, ${porosity_left}, if (x > 0.6 + ${d}, ${porosity_right},
(x-(0.6-${d}))/(2*${d})*(${porosity_right}-${porosity_left}) + ${porosity_left}))'
[]
[porosity]
type = ParsedFunction
expression = 'if (x < 0.6 - ${d}, ${porosity_left}, if (x > 0.6 + ${d}, ${porosity_right},
(x-(0.6-${d}))/(2*${d})*(${porosity_right}-${porosity_left}) + ${porosity_left}))'
[]
[]
# ==============================================================================
# BOUNDARY CONDITIONS
# ==============================================================================
[FVBCs]
[outlet_p]
type = INSFVOutletPressureBC
variable = 'pressure'
function = ${p_initial}
boundary = 'right'
[]
## No or Free slip BC
[free-slip-wall-x]
type = INSFVNaturalFreeSlipBC
boundary = 'bottom wall_1 wall_2 left'
variable = superficial_vel_x
momentum_component = 'x'
[]
[free-slip-wall-y]
type = INSFVNaturalFreeSlipBC
boundary = 'bottom wall_1 wall_2 left'
variable = superficial_vel_y
momentum_component = 'y'
[]
## Symmetry
[symmetry-x]
type = PINSFVSymmetryVelocityBC
boundary = 'left'
variable = superficial_vel_x
u = superficial_vel_x
v = superficial_vel_y
mu = 'mu'
momentum_component = 'x'
[]
[symmetry-y]
type = PINSFVSymmetryVelocityBC
boundary = 'left'
variable = superficial_vel_y
u = superficial_vel_x
v = superficial_vel_y
mu = 'mu'
momentum_component = 'y'
[]
[symmetry-p]
type = INSFVSymmetryPressureBC
boundary = 'left'
variable = 'pressure'
[]
## inlet
[inlet_vel_x]
type = INSFVInletVelocityBC
variable = 'superficial_vel_x'
function = ${superficial_vel_x_initial}
boundary = 'top'
[]
[inlet_vel_y]
type = INSFVInletVelocityBC
variable = 'superficial_vel_y'
function = ${superficial_vel_y_initial}
boundary = 'top'
[]
[]
# ==============================================================================
# EXECUTION PARAMETERS
# ==============================================================================
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type -ksp_gmres_restart'
petsc_options_value = 'asm lu NONZERO 200'
line_search = 'none'
# Problem time parameters
dtmin = 0.01
dtmax = 2000
end_time = 3000
# must be the same as the fluid
# Iterations parameters
l_max_its = 50
l_tol = 1e-8
nl_max_its = 25
# nl_rel_tol = 5e-7
nl_abs_tol = 2e-7
# Automatic scaling
automatic_scaling = true
verbose = true
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.025
cutback_factor = 0.5
growth_factor = 2.0
[]
# Steady state detection.
steady_state_detection = true
steady_state_tolerance = 1e-7
steady_state_start_time = 400
[]
# ==============================================================================
# POSTPROCESSORS DEBUG AND OUTPUTS
# ==============================================================================
[Postprocessors]
[mass_flow_in]
type = VolumetricFlowRate
boundary = 'top'
vel_x = 'superficial_vel_x'
vel_y = 'superficial_vel_y'
advected_quantity = ${rho_initial}
execute_on = 'INITIAL TIMESTEP_END'
[]
[mass_flow_out]
type = VolumetricFlowRate
boundary = 'right'
vel_x = 'superficial_vel_x'
vel_y = 'superficial_vel_y'
advected_quantity = ${rho_initial}
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_in]
type = SideAverageValue
variable = pressure
boundary = 'top'
[]
[dP]
type = LinearCombinationPostprocessor
pp_names = 'p_in'
pp_coefs = '1.0'
b = ${fparse -p_initial}
[]
[]
[Outputs]
exodus = true
print_linear_residuals = false
[]
(modules/navier_stokes/test/tests/finite_volume/ins/wall_distance_capped_mixing_length_aux/capped_mixing_length.i)
von_karman_const = 0.41
H = 1 #halfwidth of the channel
L = 150
Re = 13700
rho = 1
bulk_u = 1
mu = ${fparse rho * bulk_u * 2 * H / Re}
advected_interp_method='upwind'
velocity_interp_method='rc'
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '${L}'
dy = '0.667 0.333'
ix = '100'
iy = '10 1'
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = 1e-6
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1e-6
[]
[pressure]
type = INSFVPressureVariable
[]
[]
[AuxVariables]
[mixing_len]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[wall_shear_stress]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[wall_yplus]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = INSFVMomentumTimeDerivative
variable = u
rho = ${rho}
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_viscosity_rans]
type = INSFVMixingLengthReynoldsStress
variable = u
rho = ${rho}
mixing_length = mixing_len
momentum_component = 'x'
u = u
v = v
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_time]
type = INSFVMomentumTimeDerivative
variable = v
rho = ${rho}
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_viscosity_rans]
type = INSFVMixingLengthReynoldsStress
variable = v
rho = ${rho}
mixing_length = mixing_len
momentum_component = 'y'
u = u
v = v
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[]
[AuxKernels]
[mixing_len]
type = WallDistanceMixingLengthAux
walls = 'top'
variable = mixing_len
execute_on = 'initial'
von_karman_const = ${von_karman_const}
delta = 0.5
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = u
function = '1'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = v
function = '0'
[]
[wall-u]
type = INSFVWallFunctionBC
variable = u
boundary = 'top'
u = u
v = v
mu = ${mu}
rho = ${rho}
momentum_component = x
[]
[wall-v]
type = INSFVWallFunctionBC
variable = v
boundary = 'top'
u = u
v = v
mu = ${mu}
rho = ${rho}
momentum_component = y
[]
[sym-u]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = u
u = u
v = v
mu = ${mu}
momentum_component = x
[]
[sym-v]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = v
u = u
v = v
mu = ${mu}
momentum_component = y
[]
[symmetry_pressure]
type = INSFVSymmetryPressureBC
boundary = 'bottom'
variable = pressure
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = '0'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
line_search = 'none'
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 6
dt = 1e-3
[]
nl_abs_tol = 1e-8
end_time = 1e9
[]
[Outputs]
[out]
type = Exodus
execute_on = 'final'
[]
[]
(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
[]
(test/tests/multiapps/picard/picard_adaptive_sub.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./v]
[../]
[]
[AuxVariables]
[./u]
[../]
[]
[Kernels]
[./diff_v]
type = Diffusion
variable = v
[../]
[./force_v]
type = CoupledForce
variable = v
v = u
[../]
[]
[BCs]
[./left_v]
type = DirichletBC
variable = v
boundary = left
value = 1
[../]
[./right_v]
type = DirichletBC
variable = v
boundary = right
value = 0
[../]
[]
[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'
nl_abs_tol = 1e-10
[./TimeStepper]
type = IterationAdaptiveDT
cutback_factor = 0.4
growth_factor = 1.2
optimal_iterations = 6
dt = 0.1
[../]
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/mixing_length_total_viscosity_material/mixing_length_total_viscosity.i)
von_karman_const = 0.41
H = 1 #halfwidth of the channel
L = 150
Re = 13700
rho = 1
bulk_u = 1
mu = ${fparse rho * bulk_u * 2 * H / Re}
advected_interp_method='upwind'
velocity_interp_method='rc'
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '${L}'
dy = '0.667 0.333'
ix = '200'
iy = '10 1'
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 1e-6
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1e-6
[]
[pressure]
type = INSFVPressureVariable
[]
[]
[AuxVariables]
[mixing_length]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = INSFVMomentumTimeDerivative
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_viscosity_rans]
type = INSFVMixingLengthReynoldsStress
variable = vel_x
rho = ${rho}
mixing_length = mixing_length
momentum_component = 'x'
u = vel_x
v = vel_y
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[v_time]
type = INSFVMomentumTimeDerivative
variable = vel_y
rho = ${rho}
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_viscosity_rans]
type = INSFVMixingLengthReynoldsStress
variable = vel_y
rho = ${rho}
mixing_length = mixing_length
momentum_component = 'y'
u = vel_x
v = vel_y
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[]
[AuxKernels]
[mixing_len]
type = WallDistanceMixingLengthAux
walls = 'top'
variable = mixing_length
execute_on = 'initial'
von_karman_const = ${von_karman_const}
delta = 0.5
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_x
function = '1'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = vel_y
function = '0'
[]
[wall-u]
type = INSFVWallFunctionBC
variable = vel_x
boundary = 'top'
u = vel_x
v = vel_y
mu = ${mu}
rho = ${rho}
momentum_component = x
[]
[wall-v]
type = INSFVWallFunctionBC
variable = vel_y
boundary = 'top'
u = vel_x
v = vel_y
mu = ${mu}
rho = ${rho}
momentum_component = y
[]
[sym-u]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = vel_x
u = vel_x
v = vel_y
mu = total_viscosity
momentum_component = x
[]
[sym-v]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = vel_y
u = vel_x
v = vel_y
mu = total_viscosity
momentum_component = y
[]
[symmetry_pressure]
type = INSFVSymmetryPressureBC
boundary = 'bottom'
variable = pressure
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = '0'
[]
[]
[FunctorMaterials]
[total_viscosity]
type = MixingLengthTurbulentViscosityFunctorMaterial
u = 'vel_x' #computes total viscosity = mu_t + mu
v = 'vel_y' #property is called total_viscosity
mixing_length = mixing_length
mu = ${mu}
rho = ${rho}
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
line_search = 'none'
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 6
dt = 1e-3
[]
nl_abs_tol = 1e-8
end_time = 1e9
[]
[Outputs]
[out]
type = Exodus
execute_on = 'final'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/mixing_length_eddy_viscosity_aux/mixing_length_eddy_viscosity.i)
von_karman_const = 0.41
H = 1 #halfwidth of the channel
L = 150
Re = 13700
rho = 1
bulk_u = 1
mu = ${fparse rho * bulk_u * 2 * H / Re}
advected_interp_method='upwind'
velocity_interp_method='rc'
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '${L}'
dy = '0.667 0.333'
ix = '100'
iy = '10 1'
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = 1e-6
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1e-6
[]
[pressure]
type = INSFVPressureVariable
[]
[]
[AuxVariables]
[mixing_len]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[wall_shear_stress]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[wall_yplus]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[eddy_viscosity]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = INSFVMomentumTimeDerivative
variable = u
rho = ${rho}
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_viscosity_rans]
type = INSFVMixingLengthReynoldsStress
variable = u
rho = ${rho}
mixing_length = mixing_len
momentum_component = 'x'
u = u
v = v
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_time]
type = INSFVMomentumTimeDerivative
variable = v
rho = ${rho}
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_viscosity_rans]
type = INSFVMixingLengthReynoldsStress
variable = v
rho = ${rho}
mixing_length = mixing_len
momentum_component = 'y'
u = u
v = v
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[]
[AuxKernels]
[mixing_len]
type = WallDistanceMixingLengthAux
walls = 'top'
variable = mixing_len
execute_on = 'initial'
von_karman_const = ${von_karman_const}
delta = 0.5
[]
[turbulent_viscosity]
type = INSFVMixingLengthTurbulentViscosityAux
variable = eddy_viscosity
mixing_length = mixing_len
u = u
v = v
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = u
function = '1'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = v
function = '0'
[]
[wall-u]
type = INSFVWallFunctionBC
variable = u
boundary = 'top'
u = u
v = v
mu = ${mu}
rho = ${rho}
momentum_component = x
[]
[wall-v]
type = INSFVWallFunctionBC
variable = v
boundary = 'top'
u = u
v = v
mu = ${mu}
rho = ${rho}
momentum_component = y
[]
[sym-u]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = u
u = u
v = v
mu = ${mu}
momentum_component = x
[]
[sym-v]
type = INSFVSymmetryVelocityBC
boundary = 'bottom'
variable = v
u = u
v = v
mu = ${mu}
momentum_component = y
[]
[symmetry_pressure]
type = INSFVSymmetryPressureBC
boundary = 'bottom'
variable = pressure
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = '0'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
line_search = 'none'
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 6
dt = 1e-3
[]
nl_abs_tol = 1e-8
end_time = 1e9
[]
[Outputs]
[out]
type = Exodus
execute_on = 'final'
[]
[]
(modules/porous_flow/test/tests/fluidstate/coldwater_injection_radial.i)
# Cold water injection into 1D radial hot reservoir (Avdonin, 1964)
#
# To generate results presented in documentation for this problem,
# set xmax = 1000 and nx = 200 in the Mesh block, and dtmax = 1e4
# and end_time = 1e6 in the Executioner block.
[Mesh]
type = GeneratedMesh
dim = 1
nx = 50
xmin = 0.1
xmax = 5
bias_x = 1.05
rz_coord_axis = Y
coord_type = RZ
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[AuxVariables]
[temperature]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[temperature]
type = PorousFlowPropertyAux
variable = temperature
property = temperature
execute_on = 'initial timestep_end'
[]
[]
[Variables]
[pliquid]
initial_condition = 5e6
[]
[h]
scaling = 1e-6
[]
[]
[ICs]
[hic]
type = PorousFlowFluidPropertyIC
variable = h
porepressure = pliquid
property = enthalpy
temperature = 170
temperature_unit = Celsius
fp = water
[]
[]
[Functions]
[injection_rate]
type = ParsedFunction
symbol_values = injection_area
symbol_names = area
expression = '-0.1/area'
[]
[]
[BCs]
[source]
type = PorousFlowSink
variable = pliquid
flux_function = injection_rate
boundary = left
[]
[pright]
type = DirichletBC
variable = pliquid
value = 5e6
boundary = right
[]
[hleft]
type = DirichletBC
variable = h
value = 678.52e3
boundary = left
[]
[hright]
type = DirichletBC
variable = h
value = 721.4e3
boundary = right
[]
[]
[Kernels]
[mass]
type = PorousFlowMassTimeDerivative
variable = pliquid
[]
[massflux]
type = PorousFlowAdvectiveFlux
variable = pliquid
[]
[heat]
type = PorousFlowEnergyTimeDerivative
variable = h
[]
[heatflux]
type = PorousFlowHeatAdvection
variable = h
[]
[heatcond]
type = PorousFlowHeatConduction
variable = h
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pliquid h'
number_fluid_phases = 2
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureVG
pc_max = 1e6
sat_lr = 0.1
m = 0.5
alpha = 1e-5
[]
[fs]
type = PorousFlowWaterVapor
water_fp = water
capillary_pressure = pc
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[Materials]
[watervapor]
type = PorousFlowFluidStateSingleComponent
porepressure = pliquid
enthalpy = h
temperature_unit = Celsius
capillary_pressure = pc
fluid_state = fs
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.2
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1.8e-11 0 0 0 1.8e-11 0 0 0 1.8e-11'
[]
[relperm_water]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
s_res = 0.1
sum_s_res = 0.1
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 1
sum_s_res = 0.1
[]
[internal_energy]
type = PorousFlowMatrixInternalEnergy
density = 2900
specific_heat_capacity = 740
[]
[rock_thermal_conductivity]
type = PorousFlowThermalConductivityIdeal
dry_thermal_conductivity = '20 0 0 0 20 0 0 0 20'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 1e3
nl_abs_tol = 1e-8
[TimeStepper]
type = IterationAdaptiveDT
dt = 100
[]
[]
[Postprocessors]
[injection_area]
type = AreaPostprocessor
boundary = left
execute_on = initial
[]
[]
[VectorPostprocessors]
[line]
type = ElementValueSampler
sort_by = x
variable = temperature
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
perf_graph = true
[csv]
type = CSV
execute_on = final
[]
[]
(modules/thermal_hydraulics/test/tests/problems/area_constriction/area_constriction_junction.i)
# This test features air flowing through a channel whose cross-sectional area
# shrinks to half its value in the right half. Assuming incompressible flow
# conditions, such as having a low Mach number, the velocity should approximately
# double from inlet to outlet. In this version of the test, the area discontinuity
# is achieved by connecting two flow channels with a junction.
p_outlet = 1e5
[GlobalParams]
gravity_vector = '0 0 0'
initial_T = 300
initial_p = ${p_outlet}
fp = fp
closures = simple_closures
f = 0
scaling_factor_1phase = '1 1 1e-5'
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.4
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[inlet]
type = InletDensityVelocity1Phase
input = 'pipe1:in'
rho = 1.16263315948279 # rho @ (p = 1e5 Pa, T = 300 K)
vel = 1
[]
[pipe1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 0.5
n_elems = 50
A = 1
initial_vel = 1
[]
[junction]
type = JunctionOneToOne1Phase
connections = 'pipe1:out pipe2:in'
[]
[pipe2]
type = FlowChannel1Phase
position = '0.5 0 0'
orientation = '1 0 0'
length = 0.5
n_elems = 50
A = 0.5
initial_vel = 2
[]
[outlet]
type = Outlet1Phase
input = 'pipe2:out'
p = ${p_outlet}
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
end_time = 10
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.001
optimal_iterations = 5
iteration_window = 1
growth_factor = 1.2
[]
steady_state_detection = true
solve_type = PJFNK
nl_rel_tol = 1e-10
nl_abs_tol = 1e-8
nl_max_its = 15
l_tol = 1e-3
l_max_its = 10
[]
[Outputs]
exodus = true
velocity_as_vector = false
show = 'A rho vel p'
[]
(test/tests/time_steppers/iteration_adaptive/adapt_tstep_grow_dtfunc_restart.i)
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Variables]
[u]
[]
[]
[Kernels]
[dt]
type = TimeDerivative
variable = u
[]
[]
[Executioner]
type = Transient
end_time = 20.0
verbose = true
[TimeStepper]
type = IterationAdaptiveDT
dt = 1.0
optimal_iterations = 10
time_t = '0.0 5.0'
time_dt = '1.0 5.0'
[]
[]
[Postprocessors]
[_dt]
type = TimestepSize
[]
[]
[Outputs]
csv = true
checkpoint = false
[]
[Problem]
restart_file_base=adapt_tstep_grow_dtfunc_ckp_cp/0003
[]
(modules/porous_flow/test/tests/sinks/injection_production_eg.i)
# phase = 0 is liquid phase
# phase = 1 is gas phase
# fluid_component = 0 is water
# fluid_component = 1 is CO2
# Constant rate of CO2 injection into the left boundary
# 1D mesh
# The PorousFlowPiecewiseLinearSinks remove the correct water and CO2 from the right boundary
# Note i take pretty big timesteps here so the system is quite nonlinear
[Mesh]
type = GeneratedMesh
dim = 1
nx = 20
xmax = 20
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[AuxVariables]
[saturation_gas]
order = CONSTANT
family = MONOMIAL
[]
[frac_water_in_liquid]
initial_condition = 1.0
[]
[frac_water_in_gas]
initial_condition = 0.0
[]
[]
[AuxKernels]
[saturation_gas]
type = PorousFlowPropertyAux
variable = saturation_gas
property = saturation
phase = 1
execute_on = timestep_end
[]
[]
[Variables]
[pwater]
initial_condition = 20E6
[]
[pgas]
initial_condition = 20.1E6
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = pwater
[]
[flux0]
type = PorousFlowAdvectiveFlux
fluid_component = 0
variable = pwater
[]
[mass1]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = pgas
[]
[flux1]
type = PorousFlowAdvectiveFlux
fluid_component = 1
variable = pgas
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pgas pwater'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureVG
alpha = 1E-6
m = 0.6
[]
[]
[FluidProperties]
[true_water]
type = Water97FluidProperties
[]
[tabulated_water]
type = TabulatedBicubicFluidProperties
fp = true_water
temperature_min = 275
pressure_max = 1E8
interpolated_properties = 'density viscosity enthalpy internal_energy'
fluid_property_file = water97_tabulated_11.csv
[]
[true_co2]
type = CO2FluidProperties
[]
[tabulated_co2]
type = TabulatedBicubicFluidProperties
fp = true_co2
temperature_min = 275
pressure_max = 1E8
interpolated_properties = 'density viscosity enthalpy internal_energy'
fluid_property_file = co2_tabulated_11.csv
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = 293.15
[]
[saturation_calculator]
type = PorousFlow2PhasePP
phase0_porepressure = pwater
phase1_porepressure = pgas
capillary_pressure = pc
[]
[massfrac]
type = PorousFlowMassFraction
mass_fraction_vars = 'frac_water_in_liquid frac_water_in_gas'
[]
[water]
type = PorousFlowSingleComponentFluid
fp = tabulated_water
phase = 0
[]
[co2]
type = PorousFlowSingleComponentFluid
fp = tabulated_co2
phase = 1
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.2
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-12 0 0 0 1e-12 0 0 0 1e-12'
[]
[relperm_water]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
s_res = 0.1
sum_s_res = 0.2
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityBC
nw_phase = true
lambda = 2
s_res = 0.1
sum_s_res = 0.2
phase = 1
[]
[]
[BCs]
[co2_injection]
type = PorousFlowSink
boundary = left
variable = pgas # pgas is associated with the CO2 mass balance (fluid_component = 1 in its Kernels)
flux_function = -1E-2 # negative means a source, rather than a sink
[]
[right_water]
type = PorousFlowPiecewiseLinearSink
boundary = right
# a sink of water, since the Kernels given to pwater are for fluid_component = 0 (the water)
variable = pwater
# this Sink is a function of liquid porepressure
# Also, all the mass_fraction, mobility and relperm are referenced to the liquid phase now
fluid_phase = 0
# Sink strength = (Pwater - 20E6)
pt_vals = '0 1E9'
multipliers = '0 1E9'
PT_shift = 20E6
# multiply Sink strength computed above by mass fraction of water at the boundary
mass_fraction_component = 0
# also multiply Sink strength by mobility of the liquid
use_mobility = true
# also multiply Sink strength by the relperm of the liquid
use_relperm = true
# also multiplly Sink strength by 1/L, where L is the distance to the fixed-porepressure external environment
flux_function = 10 # 1/L
[]
[right_co2]
type = PorousFlowPiecewiseLinearSink
boundary = right
variable = pgas
fluid_phase = 1
pt_vals = '0 1E9'
multipliers = '0 1E9'
PT_shift = 20.1E6
mass_fraction_component = 1
use_mobility = true
use_relperm = true
flux_function = 10 # 1/L
[]
[]
[Preconditioning]
active = 'basic'
[basic]
type = SMP
full = true
petsc_options = '-snes_converged_reason -ksp_diagonal_scale -ksp_diagonal_scale_fix -ksp_gmres_modifiedgramschmidt -snes_linesearch_monitor'
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
petsc_options_value = 'gmres asm lu NONZERO 2'
[]
[preferred]
type = SMP
full = true
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu mumps'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
nl_abs_tol = 1E-13
nl_rel_tol = 1E-10
end_time = 1e4
[TimeStepper]
type = IterationAdaptiveDT
dt = 1E4
growth_factor = 1.1
[]
[]
[VectorPostprocessors]
[pps]
type = LineValueSampler
warn_discontinuous_face_values = false
start_point = '0 0 0'
end_point = '20 0 0'
num_points = 20
sort_by = x
variable = 'pgas pwater saturation_gas'
[]
[]
[Outputs]
print_linear_residuals = false
perf_graph = true
[out]
type = CSV
execute_on = final
[]
[]
(modules/solid_mechanics/test/tests/anisotropic_elastoplasticity/ad_uniaxial_x.i)
# This test simulates uniaxial tensile loading in x-direction.
# The slope of the stress vs. plastic strain is evaluated from
# the simulation and compared with the value calculated using
# the analytical expression. This test uses a material with li-
# near strain hardening.
# For uniaxial tensile loading in y-direction, the slope of the
# stress vs. plastic strain is (2K / (G + H)) where K is the ha-
# rdening constant, and G & H are the Hill's constant. For deta-
# ils on the derivation of the expression for slope please refer
# the documentation of this material.
# Slope obtained from this MOOSE test simulation:
# = 1.791 x 10^9
# Slope obtained from analytical expression:
# = 2 x 10^9 / (0.4 + 0.7) = 1.818 x 10^9
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 3
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
volumetric_locking_correction = true
[]
[AuxVariables]
[hydrostatic_stress]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_xx]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_xy]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[sigma_xx]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[hydrostatic_stress]
type = ADRankTwoScalarAux
variable = hydrostatic_stress
rank_two_tensor = stress
scalar_type = Hydrostatic
[]
[plasticity_strain_xx]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_xx
index_i = 0
index_j = 0
[]
[plasticity_strain_xy]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_xy
index_i = 0
index_j = 1
[]
[plasticity_strain_yy]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_yy
index_i = 1
index_j = 1
[]
[sigma_xx]
type = ADRankTwoAux
rank_two_tensor = stress
variable = stress_xx
index_i = 0
index_j = 0
[]
[]
[Functions]
[pull]
type = PiecewiseLinear
x = '0 1e1'
y = '0 -2e8'
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = FINITE
generate_output = 'elastic_strain_xx stress_xx strain_xx plastic_strain_xx'
use_automatic_differentiation = true
add_variables = true
[]
[]
[Materials]
[elasticity_tensor]
type = ADComputeElasticityTensor
fill_method = orthotropic
C_ijkl = '10.0e10 15.0e10 20.0e10 2.0e10 2.0e10 2.0e10 0.2 0.2 0.2 0.13333333333333333 0.1 0.15'
[]
[elastic_strain]
type = ADComputeMultipleInelasticStress
inelastic_models = "trial_plasticity"
max_iterations = 50
absolute_tolerance = 1e-16
[]
[hill_tensor]
type = ADHillConstants
# F G H L M N
hill_constants = "0.6 0.4 0.7 1.5 1.5 1.5"
[]
[trial_plasticity]
type = ADHillElastoPlasticityStressUpdate
hardening_constant = 10e9
yield_stress = 60e6
absolute_tolerance = 1e-15 # 1e-8
relative_tolerance = 1e-13 # 1e-15
# internal_solve_full_iteration_history = true
max_inelastic_increment = 2.0e-5
# internal_solve_output_on = on_error
[]
[]
[BCs]
[no_disp_x]
type = ADDirichletBC
variable = disp_x
boundary = left
value = 0.0
[]
[no_disp_y]
type = ADDirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[]
[no_disp_z]
type = ADDirichletBC
variable = disp_z
boundary = back
value = 0.0
[]
[Pressure]
[Side1]
boundary = right
function = pull
[]
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_rel_tol = 1e-12
nl_abs_tol = 1.0e-14
l_max_its = 90
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 30
iteration_window = 9
growth_factor = 1.05
cutback_factor = 0.5
timestep_limiting_postprocessor = matl_ts_min
dt = 0.1
time_t = '0 2.5 10'
time_dt = '0.1 1.0e-2 1.0e-2'
[]
start_time = 0
end_time = 10.0
automatic_scaling = true
[]
[Postprocessors]
[matl_ts_min]
type = MaterialTimeStepPostprocessor
[]
[max_disp_x]
type = ElementExtremeValue
variable = disp_x
[]
[max_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
[]
[dt]
type = TimestepSize
[]
[plasticity_strain_xx]
type = ElementalVariableValue
variable = plastic_strain_xx
execute_on = 'TIMESTEP_END'
elementid = 0
[]
[elastic_strain_xx]
type = ElementalVariableValue
variable = elastic_strain_xx
execute_on = 'TIMESTEP_END'
elementid = 0
[]
[strain_xx]
type = ElementalVariableValue
variable = strain_xx
execute_on = 'TIMESTEP_END'
elementid = 0
[]
[sigma_xx]
type = ElementalVariableValue
variable = stress_xx
execute_on = 'TIMESTEP_END'
elementid = 0
[]
[]
[Outputs]
csv = true
perf_graph = true
[]
(modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/rotated-2d-bkt-function-porosity.i)
p_initial=1.01e5
T=273.15
# u refers to the superficial velocity
u_in=1
user_limiter='upwind'
friction_coeff=10
[GlobalParams]
fp = fp
two_term_boundary_expansion = true
limiter = ${user_limiter}
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1
nx = 3
ymin = 0
ymax = 18
ny = 90
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[pressure]
type = MooseVariableFVReal
initial_condition = ${p_initial}
[]
[sup_vel_x]
type = MooseVariableFVReal
initial_condition = 1e-15
scaling = 1e-2
[]
[sup_vel_y]
type = MooseVariableFVReal
initial_condition = 1e-15
scaling = 1e-2
[]
[T_fluid]
type = MooseVariableFVReal
initial_condition = ${T}
scaling = 1e-5
[]
[]
[AuxVariables]
[vel_y]
type = MooseVariableFVReal
[]
[sup_mom_y]
type = MooseVariableFVReal
[]
[rho]
type = MooseVariableFVReal
[]
[eps]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[vel_y]
type = ADMaterialRealAux
variable = vel_y
property = vel_y
execute_on = 'timestep_end'
[]
[sup_mom_y]
type = ADMaterialRealAux
variable = sup_mom_y
property = superficial_rhov
execute_on = 'timestep_end'
[]
[rho]
type = ADMaterialRealAux
variable = rho
property = rho
execute_on = 'timestep_end'
[]
[eps]
type = MaterialRealAux
variable = eps
property = porosity
execute_on = 'timestep_end'
[]
[]
[FVKernels]
[mass_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_dt'
variable = pressure
[]
[mass_advection]
type = PCNSFVKT
variable = pressure
eqn = "mass"
[]
[momentum_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rhou_dt'
variable = sup_vel_x
[]
[momentum_advection]
type = PCNSFVKT
variable = sup_vel_x
eqn = "momentum"
momentum_component = 'x'
[]
[eps_grad]
type = PNSFVPGradEpsilon
variable = sup_vel_x
momentum_component = 'x'
epsilon_function = 'eps'
[]
[drag]
type = PCNSFVMomentumFriction
variable = sup_vel_x
momentum_component = 'x'
Darcy_name = 'cl'
momentum_name = superficial_rhou
[]
[momentum_time_y]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rhov_dt'
variable = sup_vel_y
[]
[momentum_advection_y]
type = PCNSFVKT
variable = sup_vel_y
eqn = "momentum"
momentum_component = 'y'
[]
[eps_grad_y]
type = PNSFVPGradEpsilon
variable = sup_vel_y
momentum_component = 'y'
epsilon_function = 'eps'
[]
[drag_y]
type = PCNSFVMomentumFriction
variable = sup_vel_y
momentum_component = 'y'
Darcy_name = 'cl'
momentum_name = superficial_rhov
[]
[energy_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_et_dt'
variable = T_fluid
[]
[energy_advection]
type = PCNSFVKT
variable = T_fluid
eqn = "energy"
[]
[]
[FVBCs]
[rho_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = pressure
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'mass'
[]
[rhou_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = sup_vel_x
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'x'
[]
[rhov_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = sup_vel_y
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'y'
[]
[rho_et_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = T_fluid
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'energy'
[]
[rho_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = pressure
pressure = ${p_initial}
eqn = 'mass'
[]
[rhou_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = sup_vel_x
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'x'
[]
[rhov_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = sup_vel_y
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'y'
[]
[rho_et_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = T_fluid
pressure = ${p_initial}
eqn = 'energy'
[]
[wall_pressure_x]
type = PCNSFVImplicitMomentumPressureBC
momentum_component = 'x'
boundary = 'left right'
variable = sup_vel_x
[]
[wall_pressure_y]
type = PCNSFVImplicitMomentumPressureBC
momentum_component = 'y'
boundary = 'left right'
variable = sup_vel_y
[]
# Use these to help create more accurate cell centered gradients for cells adjacent to boundaries
[T_bottom]
type = FVDirichletBC
variable = T_fluid
value = ${T}
boundary = 'bottom'
[]
[sup_vel_x_bottom_and_walls]
type = FVDirichletBC
variable = sup_vel_x
value = 0
boundary = 'bottom left right'
[]
[sup_vel_y_walls]
type = FVDirichletBC
variable = sup_vel_y
value = 0
boundary = 'left right'
[]
[sup_vel_y_bottom]
type = FVDirichletBC
variable = sup_vel_y
value = ${u_in}
boundary = 'bottom'
[]
[p_top]
type = FVDirichletBC
variable = pressure
value = ${p_initial}
boundary = 'top'
[]
[]
[Functions]
[ud_in]
type = ParsedVectorFunction
expression_x = '0'
expression_y = '${u_in}'
[]
[eps]
type = ParsedFunction
expression = 'if(y < 2.8, 1,
if(y < 3.2, 1 - .5 / .4 * (y - 2.8),
if(y < 6.8, .5,
if(y < 7.2, .5 - .25 / .4 * (y - 6.8),
if(y < 10.8, .25,
if(y < 11.2, .25 + .25 / .4 * (y - 10.8),
if(y < 14.8, .5,
if(y < 15.2, .5 + .5 / .4 * (y - 14.8),
1))))))))'
[]
[]
[Materials]
[var_mat]
type = PorousPrimitiveVarMaterial
pressure = pressure
T_fluid = T_fluid
superficial_vel_x = sup_vel_x
superficial_vel_y = sup_vel_y
fp = fp
porosity = porosity
[]
[porosity]
type = GenericFunctionMaterial
prop_names = 'porosity'
prop_values = 'eps'
[]
[ad_generic]
type = ADGenericConstantVectorMaterial
prop_names = 'cl'
prop_values = '${friction_coeff} ${friction_coeff} ${friction_coeff}'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
solve_type = NEWTON
line_search = 'bt'
type = Transient
nl_max_its = 20
[TimeStepper]
type = IterationAdaptiveDT
dt = 5e-5
optimal_iterations = 6
growth_factor = 1.2
[]
num_steps = 10000
end_time = 500
nl_abs_tol = 1e-7
petsc_options_iname = '-pc_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu mumps'
[]
[Outputs]
[out]
type = Exodus
execute_on = 'final'
[]
checkpoint = true
[]
[Debug]
show_var_residual_norms = true
[]
(modules/porous_flow/test/tests/sinks/injection_production_eg_outflowBC.i)
# phase = 0 is liquid phase
# phase = 1 is gas phase
# fluid_component = 0 is water
# fluid_component = 1 is CO2
# Constant rates of water and CO2 injection into the left boundary
# 1D mesh
# The PorousFlowOutflowBCs remove the correct water and CO2 from the right boundary
[Mesh]
type = GeneratedMesh
dim = 1
nx = 20
xmax = 20
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[AuxVariables]
[saturation_gas]
order = CONSTANT
family = MONOMIAL
[]
[frac_water_in_liquid]
initial_condition = 1.0
[]
[frac_water_in_gas]
initial_condition = 0.0
[]
[water_kg_per_s]
[]
[co2_kg_per_s]
[]
[]
[AuxKernels]
[saturation_gas]
type = PorousFlowPropertyAux
variable = saturation_gas
property = saturation
phase = 1
execute_on = timestep_end
[]
[]
[Variables]
[pwater]
initial_condition = 20E6
[]
[pgas]
initial_condition = 21E6
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = pwater
[]
[flux0]
type = PorousFlowAdvectiveFlux
fluid_component = 0
variable = pwater
[]
[mass1]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = pgas
[]
[flux1]
type = PorousFlowAdvectiveFlux
fluid_component = 1
variable = pgas
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pgas pwater'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureVG
alpha = 1E-6
m = 0.6
[]
[]
[FluidProperties]
[true_water]
type = Water97FluidProperties
[]
[tabulated_water]
type = TabulatedBicubicFluidProperties
fp = true_water
temperature_min = 275
pressure_max = 1E8
interpolated_properties = 'density viscosity enthalpy internal_energy'
fluid_property_file = water97_tabulated_11.csv
[]
[true_co2]
type = CO2FluidProperties
[]
[tabulated_co2]
type = TabulatedBicubicFluidProperties
fp = true_co2
temperature_min = 275
pressure_max = 1E8
interpolated_properties = 'density viscosity enthalpy internal_energy'
fluid_property_file = co2_tabulated_11.csv
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = 293.15
[]
[saturation_calculator]
type = PorousFlow2PhasePP
phase0_porepressure = pwater
phase1_porepressure = pgas
capillary_pressure = pc
[]
[massfrac]
type = PorousFlowMassFraction
mass_fraction_vars = 'frac_water_in_liquid frac_water_in_gas'
[]
[water]
type = PorousFlowSingleComponentFluid
fp = tabulated_water
phase = 0
[]
[co2]
type = PorousFlowSingleComponentFluid
fp = tabulated_co2
phase = 1
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.2
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-12 0 0 0 1e-12 0 0 0 1e-12'
[]
[relperm_water]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
s_res = 0.1
sum_s_res = 0.2
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityBC
nw_phase = true
lambda = 2
s_res = 0.1
sum_s_res = 0.2
phase = 1
[]
[]
[BCs]
[water_injection]
type = PorousFlowSink
boundary = left
variable = pwater # pwater is associated with the water mass balance (fluid_component = 0 in its Kernels)
flux_function = -1E-5 # negative means a source, rather than a sink
[]
[co2_injection]
type = PorousFlowSink
boundary = left
variable = pgas # pgas is associated with the CO2 mass balance (fluid_component = 1 in its Kernels)
flux_function = -2E-5 # negative means a source, rather than a sink
[]
[right_water_component0]
type = PorousFlowOutflowBC
boundary = right
variable = pwater
mass_fraction_component = 0
save_in = water_kg_per_s
[]
[right_co2_component1]
type = PorousFlowOutflowBC
boundary = right
variable = pgas
mass_fraction_component = 1
save_in = co2_kg_per_s
[]
[]
[Preconditioning]
active = 'basic'
[basic]
type = SMP
full = true
petsc_options = '-snes_converged_reason -ksp_diagonal_scale -ksp_diagonal_scale_fix -ksp_gmres_modifiedgramschmidt'
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
petsc_options_value = 'gmres asm lu NONZERO 2'
[]
[preferred]
type = SMP
full = true
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu mumps'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
nl_abs_tol = 1E-10
nl_rel_tol = 1E-10
end_time = 1E5
[TimeStepper]
type = IterationAdaptiveDT
dt = 1E5
growth_factor = 1.1
[]
[]
[Postprocessors]
[water_kg_per_s]
type = NodalSum
boundary = right
variable = water_kg_per_s
[]
[co2_kg_per_s]
type = NodalSum
boundary = right
variable = co2_kg_per_s
[]
[]
[VectorPostprocessors]
[pps]
type = LineValueSampler
start_point = '0 0 0'
end_point = '20 0 0'
num_points = 20
sort_by = x
variable = 'pgas pwater saturation_gas'
[]
[]
[Outputs]
[out]
type = CSV
execute_on = final
[]
[]
(modules/heat_transfer/test/tests/recover/ad_recover.i)
[GlobalParams]
order = SECOND
family = LAGRANGE
[]
[Problem]
coord_type = RZ
[]
[Mesh]
file = recover_in.e
[]
[Variables]
[./temp]
initial_condition = 580.0
[../]
[]
[AuxVariables]
[./gap_cond]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./heat]
type = ADHeatConduction
variable = temp
[../]
[./heat_source]
type = ADMatHeatSource
material_property = volumetric_heat
variable = temp
scalar = 1e3
block = pellet_type_1
[../]
[]
[ThermalContact]
[./thermal_contact]
type = GapHeatTransfer
variable = temp
primary = 5
secondary = 10
emissivity_primary = 0
emissivity_secondary = 0
quadrature = true
[../]
[]
[BCs]
[./outside]
type = DirichletBC
value = 580
boundary = '1 2 3'
variable = temp
[../]
[./edge]
type = DirichletBC
value = 700
boundary = 10
variable = temp
[../]
[]
[Materials]
[./volumetric_heat]
type = ADGenericFunctionMaterial
prop_names = 'volumetric_heat'
prop_values = 't'
[../]
[./thermal_3]
type = ADHeatConductionMaterial
block = 3
thermal_conductivity = 5
specific_heat = 12
[../]
[./thermal_1]
type = ADHeatConductionMaterial
block = 1
thermal_conductivity = 16.0
specific_heat = 330.0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options = '-snes_ksp_ew'
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = ' lu superlu_dist'
nl_rel_tol = 1e-9
nl_abs_tol = 1e-11
start_time = -200
n_startup_steps = 1
end_time = 1.02e5
num_steps = 10
dtmax = 2e6
dtmin = 1
[./TimeStepper]
type = IterationAdaptiveDT
dt = 2.0e2
optimal_iterations = 15
iteration_window = 2
[../]
[./Quadrature]
order = FIFTH
side_order = SEVENTH
[../]
[]
[Postprocessors]
[./ave_temp_interior]
type = SideAverageValue
boundary = 9
variable = temp
execute_on = 'initial linear'
[../]
[./avg_clad_temp]
type = SideAverageValue
boundary = 7
variable = temp
execute_on = 'initial timestep_end'
[../]
[./flux_from_clad]
type = ADSideDiffusiveFluxIntegral
variable = temp
boundary = 5
diffusivity = thermal_conductivity
[../]
[./_dt]
type = TimestepSize
[../]
[]
[Outputs]
exodus = true
[]
(modules/thermal_hydraulics/test/tests/problems/area_constriction/area_constriction.i)
# This test features air flowing through a channel whose cross-sectional area
# shrinks to half its value in the right half. Assuming incompressible flow
# conditions, such as having a low Mach number, the velocity should approximately
# double from inlet to outlet.
p_outlet = 1e5
[GlobalParams]
gravity_vector = '0 0 0'
initial_T = 300
initial_p = ${p_outlet}
initial_vel = initial_vel_fn
fp = fp
closures = simple_closures
f = 0
scaling_factor_1phase = '1 1 1e-5'
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
gamma = 1.4
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Functions]
[A_fn]
type = PiecewiseConstant
axis = x
direction = right
x = '0.5 1.0'
y = '1.0 0.5'
[]
[initial_vel_fn]
type = PiecewiseConstant
axis = x
direction = right
x = '0.5 1.0'
y = '1.0 2'
[]
[]
[Components]
[inlet]
type = InletDensityVelocity1Phase
input = 'pipe:in'
rho = 1.16263315948279 # rho @ (p = 1e5 Pa, T = 300 K)
vel = 1
[]
[pipe]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '1 0 0'
length = 1
n_elems = 100
A = A_fn
[]
[outlet]
type = Outlet1Phase
input = 'pipe:out'
p = ${p_outlet}
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
end_time = 10
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.001
optimal_iterations = 5
iteration_window = 1
growth_factor = 1.2
[]
steady_state_detection = true
solve_type = PJFNK
nl_rel_tol = 1e-10
nl_abs_tol = 1e-8
nl_max_its = 15
l_tol = 1e-3
l_max_its = 10
[]
[Outputs]
exodus = true
velocity_as_vector = false
show = 'A rho vel p'
[]
(modules/solid_mechanics/test/tests/ad_isotropic_elasticity_tensor/2D-axisymmetric_rz_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
elem_type = QUAD8
[]
[GlobalParams]
displacements = 'disp_r disp_z'
[]
[Problem]
coord_type = RZ
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = SMALL
add_variables = true
use_automatic_differentiation = true
[]
[]
[AuxVariables]
[stress_theta]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[stress_theta]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 2
index_j = 2
variable = stress_theta
execute_on = timestep_end
[]
[]
[Materials]
[elasticity_tensor]
#Material constants selected to match isotropic lambda and shear modulus case
type = ADComputeElasticityTensor
C_ijkl = '1022726 113636 113636 1022726 454545'
fill_method = axisymmetric_rz
[]
[elastic_stress]
type = ADComputeLinearElasticStress
[]
[]
[BCs]
# pin particle along symmetry planes
[no_disp_r]
type = DirichletBC
variable = disp_r
boundary = left
value = 0.0
[]
[no_disp_z]
type = DirichletBC
variable = disp_z
boundary = bottom
value = 0.0
[]
# exterior and internal pressures
[exterior_pressure_r]
type = ADPressure
variable = disp_r
boundary = right
factor = 200000
[]
[]
[Debug]
show_var_residual_norms = true
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
petsc_options_value = ' 201 hypre boomeramg 10'
line_search = 'none'
#Preconditioned JFNK (default)
solve_type = 'PJFNK'
nl_rel_tol = 5e-9
nl_abs_tol = 1e-10
nl_max_its = 15
l_tol = 1e-3
l_max_its = 50
start_time = 0.0
end_time = 1
num_steps = 1000
dtmax = 5e6
dtmin = 1
[TimeStepper]
type = IterationAdaptiveDT
dt = 1
optimal_iterations = 6
iteration_window = 0
linear_iteration_ratio = 100
[]
[Predictor]
type = SimplePredictor
scale = 1.0
[]
[]
[Postprocessors]
[dt]
type = TimestepSize
[]
[]
[Outputs]
file_base = 2D-axisymmetric_rz_test_out
exodus = true
[]
(modules/phase_field/examples/nucleation/cahn_hilliard.i)
#
# Test the DiscreteNucleation material in a toy system. The global
# concentration is above the solubility limit, but below the spinodal.
# Without further intervention no nucleation will occur in a phase
# field model. The DiscreteNucleation material will locally modify the
# free energy to coerce nuclei to grow.
#
[Mesh]
type = GeneratedMesh
dim = 2
nx = 120
ny = 120
xmax = 500
ymax = 500
elem_type = QUAD
[]
[Modules]
[./PhaseField]
[./Conserved]
[./c]
free_energy = F
mobility = M
kappa = kappa_c
solve_type = REVERSE_SPLIT
[../]
[../]
[../]
[]
[ICs]
[./c_IC]
type = RandomIC
variable = c
min = 0.2
max = 0.21
[../]
[]
[Materials]
[./pfmobility]
type = GenericConstantMaterial
prop_names = 'M kappa_c'
prop_values = '1 25'
[../]
[./chemical_free_energy]
# simple double well free energy
type = DerivativeParsedMaterial
property_name = Fc
coupled_variables = 'c'
constant_names = 'barr_height cv_eq'
constant_expressions = '0.1 0'
expression = 16*barr_height*c^2*(1-c)^2 # +0.01*(c*plog(c,0.005)+(1-c)*plog(1-c,0.005))
derivative_order = 2
outputs = exodus
[../]
[./probability]
# This is a made up toy nucleation rate it should be replaced by
# classical nucleation theory in a real simulation.
type = ParsedMaterial
property_name = P
coupled_variables = c
expression = c*1e-7
outputs = exodus
[../]
[./nucleation]
# The nucleation material is configured to insert nuclei into the free energy
# tht force the concentration to go to 0.95, and holds this enforcement for 500
# time units.
type = DiscreteNucleation
property_name = Fn
op_names = c
op_values = 0.90
penalty = 5
penalty_mode = MIN
map = map
outputs = exodus
[../]
[./free_energy]
# add the chemical and nucleation free energy contributions together
type = DerivativeSumMaterial
derivative_order = 2
coupled_variables = c
sum_materials = 'Fc Fn'
[../]
[]
[UserObjects]
[./inserter]
# The inserter runs at the end of each time step to add nucleation events
# that happend during the timestep (if it converged) to the list of nuclei
type = DiscreteNucleationInserter
hold_time = 100
probability = P
radius = 10
[../]
[./map]
# The map UO runs at the beginning of a timestep and generates a per-element/qp
# map of nucleus locations. The map is only regenerated if the mesh changed or
# the list of nuclei was modified.
# The map converts the nucleation points into finite area objects with a given radius.
type = DiscreteNucleationMap
periodic = c
inserter = inserter
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[BCs]
[./Periodic]
[./all]
auto_direction = 'x y'
[../]
[../]
[]
[Postprocessors]
[./dt]
type = TimestepSize
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -sub_pc_type'
petsc_options_value = 'asm lu '
nl_max_its = 20
l_tol = 1.0e-4
nl_rel_tol = 1.0e-10
nl_abs_tol = 1.0e-10
start_time = 0.0
num_steps = 1200
[./TimeStepper]
type = IterationAdaptiveDT
dt = 10
growth_factor = 1.5
cutback_factor = 0.5
optimal_iterations = 5
[../]
[]
[Outputs]
exodus = true
[]
(modules/solid_mechanics/test/tests/anisotropic_elastoplasticity/hoop_strain_comparison_coarse_zaxis.i)
# This test compares the hoop strain at two different elements in an internally
# pressurized cylinder with anisotropic plasticity: different yield condition
# for hoop and axial directions. The elements are located circumferentially
# apart but at same axial position. It is expected that due to pressurization
# hoop strains will develop with uniform magnitude along hoop direction. The
# test verifies that the plastic hoop strain is uniform in hoop direction.
# For 3D simulations with material properties oriented along the curved
# geometry such as cylinder or sphere, the stresses and strains are rotated to
# the local coordinate system from the global coordinate system. The plastic
# strain is calculated in the local coordinate system and then transformed to
# the global coordinate system. This test involves a 3D cylindrical geometry,
# and helps in indirectly verifying that this transformation of stresses and
# strains back and forth between the local and global coordinate system is
# correctly implemented.
[Mesh]
file = quarter_cylinder_coarse_zaxis.e
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
volumetric_locking_correction = true
[]
[AuxVariables]
[hydrostatic_stress]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_xx]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_xy]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_zz]
order = CONSTANT
family = MONOMIAL
[]
[stress_zz]
order = CONSTANT
family = MONOMIAL
[]
[stress_xx]
order = CONSTANT
family = MONOMIAL
[]
[stress_yy]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[hydrostatic_stress]
type = ADRankTwoScalarAux
variable = hydrostatic_stress
rank_two_tensor = stress
scalar_type = Hydrostatic
[]
[plasticity_strain_xx]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_xx
index_i = 0
index_j = 0
[]
[plasticity_strain_xy]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_xy
index_i = 0
index_j = 1
[]
[plasticity_strain_yy]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_yy
index_i = 1
index_j = 1
[]
[plasticity_strain_zz]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_zz
index_i = 2
index_j = 2
[]
[stress_zz]
type = ADRankTwoAux
rank_two_tensor = stress
variable = stress_zz
index_i = 2
index_j = 2
[]
[stress_xx]
type = ADRankTwoAux
rank_two_tensor = stress
variable = stress_xx
index_i = 0
index_j = 0
[]
[stress_yy]
type = ADRankTwoAux
rank_two_tensor = stress
variable = stress_yy
index_i = 1
index_j = 1
[]
[]
[Functions]
[push]
type = PiecewiseLinear
x = '0 1e2'
y = '0 200e6'
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = FINITE
generate_output = 'elastic_strain_zz elastic_strain_xx elastic_strain_yy stress_xx stress_yy stress_zz strain_zz plastic_strain_zz plastic_strain_xx plastic_strain_yy hoop_stress hoop_strain'
use_automatic_differentiation = true
add_variables = true
cylindrical_axis_point1 = '0 0 0'
cylindrical_axis_point2 = '0 0 1'
[]
[]
[Constraints]
[mid_section_plane]
type = EqualValueBoundaryConstraint
variable = disp_z
secondary = top # boundary
penalty = 1.0e+10
[]
[]
[Materials]
[elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 200.0e9
poissons_ratio = 0.2
[]
[elastic_strain]
type = ADComputeMultipleInelasticStress
inelastic_models = "plasticity"
max_iterations = 50
absolute_tolerance = 1e-30 #1e-16
[]
[hill_tensor]
type = ADHillConstants
# F G H L M N
# hill_constants = "0.5 0.5 0.5 1.5 1.5 1.5"
hill_constants = "0.5 0.5 0.25 1.5 1.5 1.5"
[]
[plasticity]
type = ADHillElastoPlasticityStressUpdate
hardening_constant = 1.5e10
hardening_exponent = 1.0
yield_stress = 0.0 # 60e6
local_cylindrical_csys = true
axis = z
absolute_tolerance = 1e-15 # 1e-8
relative_tolerance = 1e-13 # 1e-15
internal_solve_full_iteration_history = true
max_inelastic_increment = 2.0e-6
internal_solve_output_on = on_error
[]
[]
[BCs]
[no_disp_x]
type = ADDirichletBC
variable = disp_x
boundary = x_face
value = 0.0
[]
[no_disp_z]
type = ADDirichletBC
variable = disp_z
boundary = bottom
value = 0.0
[]
[no_disp_y]
type = ADDirichletBC
variable = disp_y
boundary = y_face
value = 0.0
[]
[Pressure]
[Side1]
boundary = inner
function = push
[]
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_rel_tol = 1e-12
nl_abs_tol = 1e-14
# nl_abs_tol = 1e-10
l_max_its = 90
nl_max_its = 30
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 30
iteration_window = 9
growth_factor = 1.05
cutback_factor = 0.5
timestep_limiting_postprocessor = matl_ts_min
dt = 0.1e-4
time_t = '0 6.23 10'
time_dt = '0.1 1.0e-2 1.0e-2'
[]
num_steps = 1
start_time = 0
end_time = 200.0
automatic_scaling = true
dtmax = 0.1e-4
[]
[Postprocessors]
[matl_ts_min]
type = MaterialTimeStepPostprocessor
[]
[hoop_strain_elementA]
type = ElementalVariableValue
elementid = 10
variable = hoop_strain
[]
[hoop_strain_elementB]
type = ElementalVariableValue
elementid = 4
variable = hoop_strain
[]
[hoop_strain_diff]
type = DifferencePostprocessor
value1 = hoop_strain_elementA
value2 = hoop_strain_elementB
[]
[]
[Outputs]
csv = true
exodus = false
perf_graph = true
[]
(modules/phase_field/tutorials/spinodal_decomposition/s3_decomp.i)
#
# Simulation of iron-chromium alloy decomposition using simplified conditions.
#
[Mesh]
type = GeneratedMesh
dim = 2
elem_type = QUAD4
nx = 25
ny = 25
nz = 0
xmin = 0
xmax = 25
ymin = 0
ymax = 25
zmin = 0
zmax = 0
uniform_refine = 2
[]
[Variables]
[./c] # Mole fraction of Cr (unitless)
order = FIRST
family = LAGRANGE
[../]
[./w] # Chemical potential (eV/mol)
order = FIRST
family = LAGRANGE
[../]
[]
[ICs]
[./concentrationIC] # 46.774 mol% Cr with variations
type = RandomIC
min = 0.44774
max = 0.48774
seed = 210
variable = c
[../]
[]
[BCs]
[./Periodic]
[./c_bcs]
auto_direction = 'x y'
[../]
[../]
[]
[Kernels]
[./w_dot]
variable = w
v = c
type = CoupledTimeDerivative
[../]
[./coupled_res]
variable = w
type = SplitCHWRes
mob_name = M
[../]
[./coupled_parsed]
variable = c
type = SplitCHParsed
f_name = f_loc
kappa_name = kappa_c
w = w
[../]
[]
[Materials]
# d is a scaling factor that makes it easier for the solution to converge
# without changing the results. It is defined in each of the materials and
# must have the same value in each one.
[./constants]
# Define constant values kappa_c and M. Eventually M will be replaced with
# an equation rather than a constant.
type = GenericFunctionMaterial
prop_names = 'kappa_c M'
prop_values = '8.125e-16*6.24150934e+18*1e+09^2*1e-27
2.2841e-26*1e+09^2/6.24150934e+18/1e-27'
# kappa_c*eV_J*nm_m^2*d
# M*nm_m^2/eV_J/d
[../]
[./local_energy]
# Defines the function for the local free energy density as given in the
# problem, then converts units and adds scaling factor.
type = DerivativeParsedMaterial
property_name = f_loc
coupled_variables = c
constant_names = 'A B C D E F G eV_J d'
constant_expressions = '-2.446831e+04 -2.827533e+04 4.167994e+03 7.052907e+03
1.208993e+04 2.568625e+03 -2.354293e+03
6.24150934e+18 1e-27'
expression = 'eV_J*d*(A*c+B*(1-c)+C*c*log(c)+D*(1-c)*log(1-c)+
E*c*(1-c)+F*c*(1-c)*(2*c-1)+G*c*(1-c)*(2*c-1)^2)'
derivative_order = 2
[../]
[]
[Postprocessors]
[./step_size] # Size of the time step
type = TimestepSize
[../]
[./iterations] # Number of iterations needed to converge timestep
type = NumNonlinearIterations
[../]
[./nodes] # Number of nodes in mesh
type = NumNodes
[../]
[./evaluations] # Cumulative residual calculations for simulation
type = NumResidualEvaluations
[../]
[./active_time] # Time computer spent on simulation
type = PerfGraphData
section_name = "Root"
data_type = total
[../]
[]
[Preconditioning]
[./coupled]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
l_max_its = 30
l_tol = 1e-6
nl_max_its = 50
nl_abs_tol = 1e-9
end_time = 604800 # 7 days
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type
-sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly
ilu 1'
[./TimeStepper]
type = IterationAdaptiveDT
dt = 10
cutback_factor = 0.8
growth_factor = 1.5
optimal_iterations = 7
[../]
[./Adaptivity]
coarsen_fraction = 0.1
refine_fraction = 0.7
max_h_level = 2
[../]
[]
[Debug]
show_var_residual_norms = true
[]
[Outputs]
exodus = true
console = true
csv = true
[./console]
type = Console
max_rows = 10
[../]
[]
(modules/porous_flow/examples/solute_tracer_transport/solute_tracer_transport.i)
# Longitudinal dispersivity
disp = 0.7
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 100
xmin = 0
xmax = 100
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[Variables]
[porepressure]
initial_condition = 1e5
[]
[C]
initial_condition = 0
[]
[]
[AuxVariables]
[Darcy_vel_x]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[Darcy_vel_x]
type = PorousFlowDarcyVelocityComponent
variable = Darcy_vel_x
component = x
fluid_phase = 0
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'porepressure C'
number_fluid_phases = 1
number_fluid_components = 2
[]
[]
[Kernels]
[mass_der_water]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = porepressure
[]
[adv_pp]
type = PorousFlowFullySaturatedDarcyFlow
variable = porepressure
fluid_component = 1
[]
[diff_pp]
type = PorousFlowDispersiveFlux
fluid_component = 1
variable = porepressure
disp_trans = 0
disp_long = ${disp}
[]
[mass_der_C]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = C
[]
[adv_C]
type = PorousFlowFullySaturatedDarcyFlow
fluid_component = 0
variable = C
[]
[diff_C]
type = PorousFlowDispersiveFlux
fluid_component = 0
variable = C
disp_trans = 0
disp_long = ${disp}
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[Materials]
[ps]
type = PorousFlow1PhaseFullySaturated
porepressure = porepressure
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.25
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1E-11 0 0 0 1E-11 0 0 0 1E-11'
[]
[water]
type = PorousFlowSingleComponentFluid
fp = water
phase = 0
[]
[massfrac]
type = PorousFlowMassFraction
mass_fraction_vars = C
[]
[temperature]
type = PorousFlowTemperature
temperature = 293
[]
[diff]
type = PorousFlowDiffusivityConst
diffusion_coeff = '0 0'
tortuosity = 0.1
[]
[relperm]
type = PorousFlowRelativePermeabilityConst
kr = 1
phase = 0
[]
[]
[BCs]
[constant_inlet_pressure]
type = DirichletBC
variable = porepressure
value = 1.2e5
boundary = left
[]
[constant_outlet_porepressure]
type = DirichletBC
variable = porepressure
value = 1e5
boundary = right
[]
[inlet_tracer]
type = DirichletBC
variable = C
value = 0.001
boundary = left
[]
[outlet_tracer]
type = PorousFlowOutflowBC
variable = C
boundary = right
mass_fraction_component = 0
[]
[]
[Preconditioning]
[basic]
type = SMP
full = true
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
petsc_options_value = ' asm lu NONZERO 2'
[]
[]
[Executioner]
type = Transient
end_time = 17280000
dtmax = 86400
nl_rel_tol = 1e-6
nl_abs_tol = 1e-12
[TimeStepper]
type = IterationAdaptiveDT
dt = 1000
[]
[]
[Postprocessors]
[C]
type = PointValue
variable = C
point = '50 0 0'
[]
[Darcy_x]
type = PointValue
variable = Darcy_vel_x
point = '50 0 0'
[]
[]
[Outputs]
file_base = solute_tracer_transport_${disp}
csv = true
[]
(modules/solid_mechanics/test/tests/material_limit_time_step/creep/nafems_test5a_lim.i)
[GlobalParams]
temperature = temp
order = FIRST
family = LAGRANGE
volumetric_locking_correction = true
displacements = 'disp_x disp_y'
[]
[Mesh]
file = plane1_mesh.e
[]
[Problem]
type = ReferenceResidualProblem
extra_tag_vectors = 'ref'
reference_vector = 'ref'
group_variables = 'disp_x disp_y'
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[]
[AuxVariables]
[./temp]
initial_condition = 1500.0
[../]
[./creep]
order = CONSTANT
family = MONOMIAL
[../]
[./stress_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./stress_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./stress_zz]
order = CONSTANT
family = MONOMIAL
[../]
[./vonmises]
order = CONSTANT
family = MONOMIAL
[../]
[./pressure]
order = CONSTANT
family = MONOMIAL
[../]
[./invariant3]
order = CONSTANT
family = MONOMIAL
[../]
[./creep_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./creep_strain_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./creep_strain_zz]
order = CONSTANT
family = MONOMIAL
[../]
[./creep_strain_xy]
order = CONSTANT
family = MONOMIAL
[../]
[./elastic_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./elastic_strain_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./elastic_strain_zz]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[SolidMechanics]
use_displaced_mesh = true
extra_vector_tags = 'ref'
[../]
[]
[AuxKernels]
[./creep_aux]
type = MaterialRealAux
property = effective_creep_strain
variable = creep
[../]
[./stress_xx]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_xx
index_i = 0
index_j = 0
[../]
[./stress_yy]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_yy
index_i = 1
index_j = 1
[../]
[./stress_zz]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_zz
index_i = 2
index_j = 2
[../]
[./vonmises]
type = RankTwoScalarAux
rank_two_tensor = stress
variable = vonmises
scalar_type = VonMisesStress
[../]
[./pressure]
type = RankTwoScalarAux
rank_two_tensor = stress
variable = pressure
scalar_type = Hydrostatic
[../]
[./invariant3]
type = RankTwoScalarAux
rank_two_tensor = stress
variable = invariant3
scalar_type = ThirdInvariant
[../]
[./creep_strain_xx]
type = RankTwoAux
rank_two_tensor = creep_strain
variable = creep_strain_xx
index_i = 0
index_j = 0
[../]
[./creep_strain_yy]
type = RankTwoAux
rank_two_tensor = creep_strain
variable = creep_strain_yy
index_i = 1
index_j = 1
[../]
[./creep_strain_zz]
type = RankTwoAux
rank_two_tensor = creep_strain
variable = creep_strain_zz
index_i = 2
index_j = 2
[../]
[./creep_strain_xy]
type = RankTwoAux
rank_two_tensor = creep_strain
variable = creep_strain_xy
index_i = 0
index_j = 1
[../]
[./elastic_str_xx_aux]
type = RankTwoAux
rank_two_tensor = elastic_strain
variable = elastic_strain_xx
index_i = 0
index_j = 0
[../]
[./elastic_str_yy_aux]
type = RankTwoAux
rank_two_tensor = elastic_strain
variable = elastic_strain_yy
index_i = 1
index_j = 1
[../]
[./elastic_str_zz_aux]
type = RankTwoAux
rank_two_tensor = elastic_strain
variable = elastic_strain_zz
index_i = 2
index_j = 2
[../]
[]
[BCs]
[./bot_y]
type = DirichletBC
variable = disp_y
boundary = 1
value = 0.0
[../]
[./side_x]
type = DirichletBC
variable = disp_x
boundary = 2
value = 0.0
[../]
[./top_press]
type = Pressure
variable = disp_y
boundary = 3
factor = -100.0
[../]
[./side_press]
type = Pressure
variable = disp_x
boundary = 4
factor = -200.0
[../]
[]
[Materials]
[./elasticity_tensor]
type = ComputeIsotropicElasticityTensor
block = 1
youngs_modulus = 200e3
poissons_ratio = 0.3
[../]
[./strain]
type = ComputePlaneFiniteStrain
block = 1
[../]
[./radial_return_stress]
type = ComputeMultipleInelasticStress
block = 1
inelastic_models = 'powerlawcrp'
[../]
[./powerlawcrp]
type = PowerLawCreepStressUpdate
block = 1
coefficient = 3.125e-14
n_exponent = 5.0
m_exponent = 0.0
activation_energy = 0.0
max_inelastic_increment = 0.01
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = ' lu superlu_dist'
line_search = 'none'
l_max_its = 50
nl_max_its = 100
end_time = 1000.0
num_steps = 10000
l_tol = 1e-3
[./TimeStepper]
type = IterationAdaptiveDT
dt = 1e-6
time_t = '1e-6 2e-6 3e-6 5e-6 9e-6 1.7e-5 3.3e-5 6.5e-5 1.29e-4 2.57e-4 5.13e-4 1.025e-3 2.049e-3 4.097e-3 8.193e-3 1.638e-2 3.276e-2 5.734e-2 0.106 0.180 0.291 0.457 0.706 1.08 1.64 2.48 3.74 5.63 8.46 12.7 19.1 28.7 43.0 64.5 108.0 194.0 366.0 710.0 1000.0'
time_dt = '1e-6 1e-6 2e-6 4e-6 8e-6 1.6e-5 3.2e-5 6.4e-5 1.28e-4 2.56e-4 5.12e-4 1.024e-3 2.048e-3 4.096e-3 8.192e-3 1.6384e-2 2.458e-2 4.915e-2 7.40e-2 0.111 0.166 0.249 0.374 0.560 0.840 1.26 1.89 2.83 4.25 6.40 9.6 14.3 21.5 43.0 86.1 172.0 344.0 290.0 290.0'
optimal_iterations = 30
iteration_window = 9
growth_factor = 2.0
cutback_factor = 0.5
timestep_limiting_postprocessor = matl_ts_min
[../]
[]
[Postprocessors]
[./matl_ts_min]
type = MaterialTimeStepPostprocessor
[../]
[./sigma_xx]
type = ElementAverageValue
variable = stress_xx
[../]
[./sigma_yy]
type = ElementAverageValue
variable = stress_yy
[../]
[./sigma_zz]
type = ElementAverageValue
variable = stress_zz
[../]
[./vonmises]
type = ElementAverageValue
variable = vonmises
[../]
[./pressure]
type = ElementAverageValue
variable = pressure
[../]
[./invariant3]
type = ElementAverageValue
variable = invariant3
[../]
[./eps_crp_xx]
type = ElementAverageValue
variable = creep_strain_xx
[../]
[./eps_crp_yy]
type = ElementAverageValue
variable = creep_strain_yy
[../]
[./eps_crp_zz]
type = ElementAverageValue
variable = creep_strain_zz
[../]
[./eps_crp_mag]
type = ElementAverageValue
variable = creep
[../]
[./disp_x2]
type = NodalVariableValue
nodeid = 1
variable = disp_x
[../]
[./disp_x3]
type = NodalVariableValue
nodeid = 2
variable = disp_x
[../]
[./disp_y3]
type = NodalVariableValue
nodeid = 2
variable = disp_y
[../]
[./disp_y4]
type = NodalVariableValue
nodeid = 3
variable = disp_y
[../]
[./_dt]
type = TimestepSize
[../]
[./elas_str_xx]
type = ElementAverageValue
variable = elastic_strain_xx
[../]
[./elas_str_yy]
type = ElementAverageValue
variable = elastic_strain_yy
[../]
[./elas_str_zz]
type = ElementAverageValue
variable = elastic_strain_zz
[../]
[]
[Outputs]
print_linear_residuals = true
perf_graph = true
csv = true
[./out]
type = Exodus
elemental_as_nodal = true
[../]
[./console]
type = Console
max_rows = 25
[../]
[]
(modules/combined/examples/periodic_strain/global_strain_pfm.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 50
ny = 50
xmin = -0.5
xmax = 0.5
ymin = -0.5
ymax = 0.5
[]
[./cnode]
input = gen
type = ExtraNodesetGenerator
coord = '0.0 0.0'
new_boundary = 100
[../]
[]
[Variables]
[./u_x]
[../]
[./u_y]
[../]
[./global_strain]
order = THIRD
family = SCALAR
[../]
[./c]
[./InitialCondition]
type = FunctionIC
function = 'sin(2*x*pi)*sin(2*y*pi)*0.05+0.6'
[../]
[../]
[./w]
[../]
[]
[AuxVariables]
[./local_energy]
order = CONSTANT
family = MONOMIAL
[../]
[./disp_x]
[../]
[./disp_y]
[../]
[./s00]
order = CONSTANT
family = MONOMIAL
[../]
[./s01]
order = CONSTANT
family = MONOMIAL
[../]
[./s10]
order = CONSTANT
family = MONOMIAL
[../]
[./s11]
order = CONSTANT
family = MONOMIAL
[../]
[./e00]
order = CONSTANT
family = MONOMIAL
[../]
[./e01]
order = CONSTANT
family = MONOMIAL
[../]
[./e10]
order = CONSTANT
family = MONOMIAL
[../]
[./e11]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./disp_x]
type = GlobalDisplacementAux
variable = disp_x
scalar_global_strain = global_strain
global_strain_uo = global_strain_uo
component = 0
[../]
[./disp_y]
type = GlobalDisplacementAux
variable = disp_y
scalar_global_strain = global_strain
global_strain_uo = global_strain_uo
component = 1
[../]
[./local_free_energy]
type = TotalFreeEnergy
execute_on = 'initial LINEAR'
variable = local_energy
interfacial_vars = 'c'
kappa_names = 'kappa_c'
[../]
[./s00]
type = RankTwoAux
variable = s00
rank_two_tensor = stress
index_i = 0
index_j = 0
[../]
[./s01]
type = RankTwoAux
variable = s01
rank_two_tensor = stress
index_i = 0
index_j = 1
[../]
[./s10]
type = RankTwoAux
variable = s10
rank_two_tensor = stress
index_i = 1
index_j = 0
[../]
[./s11]
type = RankTwoAux
variable = s11
rank_two_tensor = stress
index_i = 1
index_j = 1
[../]
[./e00]
type = RankTwoAux
variable = e00
rank_two_tensor = total_strain
index_i = 0
index_j = 0
[../]
[./e01]
type = RankTwoAux
variable = e01
rank_two_tensor = total_strain
index_i = 0
index_j = 1
[../]
[./e10]
type = RankTwoAux
variable = e10
rank_two_tensor = total_strain
index_i = 1
index_j = 0
[../]
[./e11]
type = RankTwoAux
variable = e11
rank_two_tensor = total_strain
index_i = 1
index_j = 1
[../]
[]
[GlobalParams]
derivative_order = 2
enable_jit = true
displacements = 'u_x u_y'
block = 0
[]
[Kernels]
[./TensorMechanics]
[../]
# Cahn-Hilliard kernels
[./c_dot]
type = CoupledTimeDerivative
variable = w
v = c
block = 0
[../]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
w = w
block = 0
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
block = 0
[../]
[]
[ScalarKernels]
[./global_strain]
type = GlobalStrain
variable = global_strain
global_strain_uo = global_strain_uo
[../]
[]
[BCs]
[./Periodic]
[./all]
auto_direction = 'x y'
variable = 'c w u_x u_y'
[../]
[../]
# fix center point location
[./centerfix_x]
type = DirichletBC
boundary = 100
variable = u_x
value = 0
[../]
[./centerfix_y]
type = DirichletBC
boundary = 100
variable = u_y
value = 0
[../]
[]
[Materials]
[./consts]
type = GenericConstantMaterial
prop_names = 'M kappa_c'
prop_values = '0.2 0.01 '
[../]
[./shear1]
type = GenericConstantRankTwoTensor
tensor_values = '0 0 0 0 0 0.5'
tensor_name = shear1
[../]
[./shear2]
type = GenericConstantRankTwoTensor
tensor_values = '0 0 0 0 0 -0.5'
tensor_name = shear2
[../]
[./expand3]
type = GenericConstantRankTwoTensor
tensor_values = '1 1 0 0 0 0'
tensor_name = expand3
[../]
[./weight1]
type = DerivativeParsedMaterial
expression = '0.3*c^2'
property_name = weight1
coupled_variables = c
[../]
[./weight2]
type = DerivativeParsedMaterial
expression = '0.3*(1-c)^2'
property_name = weight2
coupled_variables = c
[../]
[./weight3]
type = DerivativeParsedMaterial
expression = '4*(0.5-c)^2'
property_name = weight3
coupled_variables = c
[../]
[./elasticity_tensor]
type = ComputeElasticityTensor
C_ijkl = '1 1'
fill_method = symmetric_isotropic
[../]
[./strain]
type = ComputeSmallStrain
global_strain = global_strain
eigenstrain_names = eigenstrain
[../]
[./eigenstrain]
type = CompositeEigenstrain
tensors = 'shear1 shear2 expand3'
weights = 'weight1 weight2 weight3'
args = c
eigenstrain_name = eigenstrain
[../]
[./global_strain]
type = ComputeGlobalStrain
scalar_global_strain = global_strain
global_strain_uo = global_strain_uo
[../]
[./stress]
type = ComputeLinearElasticStress
[../]
# chemical free energies
[./chemical_free_energy]
type = DerivativeParsedMaterial
property_name = Fc
expression = '4*c^2*(1-c)^2'
coupled_variables = 'c'
outputs = exodus
output_properties = Fc
[../]
# elastic free energies
[./elastic_free_energy]
type = ElasticEnergyMaterial
f_name = Fe
args = 'c'
outputs = exodus
output_properties = Fe
[../]
# free energy (chemical + elastic)
[./free_energy]
type = DerivativeSumMaterial
block = 0
property_name = F
sum_materials = 'Fc Fe'
coupled_variables = 'c'
[../]
[]
[UserObjects]
[./global_strain_uo]
type = GlobalStrainUserObject
execute_on = 'Initial Linear Nonlinear'
[../]
[]
[Postprocessors]
[./total_free_energy]
type = ElementIntegralVariablePostprocessor
execute_on = 'initial TIMESTEP_END'
variable = local_energy
[../]
[./total_solute]
type = ElementIntegralVariablePostprocessor
execute_on = 'initial TIMESTEP_END'
variable = c
[../]
[./min]
type = ElementExtremeValue
execute_on = 'initial TIMESTEP_END'
value_type = min
variable = c
[../]
[./max]
type = ElementExtremeValue
execute_on = 'initial TIMESTEP_END'
value_type = max
variable = c
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = 'PJFNK'
line_search = basic
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly lu 1'
l_max_its = 30
nl_max_its = 12
l_tol = 1.0e-4
nl_rel_tol = 1.0e-8
nl_abs_tol = 1.0e-10
start_time = 0.0
end_time = 2.0
[./TimeStepper]
type = IterationAdaptiveDT
dt = 0.01
growth_factor = 1.5
cutback_factor = 0.8
optimal_iterations = 9
iteration_window = 2
[../]
[]
[Outputs]
execute_on = 'timestep_end'
print_linear_residuals = false
exodus = true
[./table]
type = CSV
delimiter = ' '
[../]
[]
(modules/phase_field/test/tests/MultiPhase/mixedswitchingfunctionmaterial.i)
# This is a test of the MixedSwitchingfunctionmaterial
# Several mixed type of switching function with ajustable weight parameter
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 20
xmin = 0
xmax = 20
ymin = 0
ymax = 20
elem_type = QUAD4
[]
[Variables]
[./eta]
[../]
[]
[ICs]
[./IC_eta]
type = SmoothCircleIC
variable = eta
x1 = 10
y1 = 10
radius = 5
invalue = 1
outvalue = 0
int_width = 1
[../]
[]
[Kernels]
[./eta_bulk]
type = AllenCahn
variable = eta
f_name = F
[../]
[./eta_interface]
type = ACInterface
variable = eta
kappa_name = kappa_eta
[../]
[./detadt]
type = TimeDerivative
variable = eta
[../]
[]
[Materials]
[./consts]
type = GenericConstantMaterial
prop_names = 'L kappa_eta'
prop_values = '1.0 1.0'
[../]
[./switching]
type = MixedSwitchingFunctionMaterial
function_name = h
eta = eta
h_order = MIX234
weight = 1.0
[../]
[./barrier]
type = BarrierFunctionMaterial
eta = eta
g_order = SIMPLE
[../]
# Total free energy: F = Fa*(1-h) + Fb*h
[./free_energy]
type = DerivativeTwoPhaseMaterial
property_name = F
fa_name = '0'
fb_name = '-1'
eta = eta
W = 3.1
derivative_order = 2
outputs = exodus
[../]
[]
[BCs]
[./Periodic]
[./all]
auto_direction = 'x y'
[../]
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = 'PJFNK'
l_max_its = 30
nl_max_its = 10
l_tol = 1.0e-4
nl_rel_tol = 1.0e-10
nl_abs_tol = 1.0e-12
start_time = 0.0
num_steps = 2
[./TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 9
iteration_window = 2
growth_factor = 1.1
cutback_factor = 0.75
dt = 0.3
[../]
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/time_steppers/iteration_adaptive/piecewise_constant.i)
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Problem]
solve = false
[]
[Functions]
[./temp_spike]
type = PiecewiseConstant
x = '0 1 1.1 1.2 2'
y = '1 1 2 1 1'
[../]
[]
[Executioner]
type = Transient
end_time = 2.0
verbose = true
[./TimeStepper]
type = IterationAdaptiveDT
dt = 0.9
timestep_limiting_function = temp_spike
force_step_every_function_point = true
[../]
[]
[Postprocessors]
[./dt]
type = TimestepSize
[../]
[]
[Outputs]
csv = true
[]
(modules/level_set/test/tests/reinitialization/reinit.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 8
ny = 8
uniform_refine = 3
[]
[Variables]
[./phi]
[../]
[]
[AuxVariables]
[./phi_0]
[../]
[]
[BCs]
[./Periodic]
[./all]
variable = phi
auto_direction = 'x y'
[../]
[../]
[]
[Kernels]
[./time]
type = TimeDerivative
variable = phi
[../]
[./reinit]
type = LevelSetOlssonReinitialization
variable = phi
phi_0 = phi_0
epsilon = 0.05
[../]
[]
[Problem]
type = LevelSetReinitializationProblem
[]
[UserObjects]
[./arnold]
type = LevelSetOlssonTerminator
tol = 1
[../]
[]
[Executioner]
type = Transient
solve_type = PJFNK
start_time = 0
num_steps = 100
nl_rel_tol = 1e-8
nl_abs_tol = 1e-10
scheme = crank-nicolson
petsc_options_iname = '-pc_type -pc_sub_type -ksp_gmres_restart'
petsc_options_value = 'hypre boomeramg 300'
[./TimeStepper]
type = IterationAdaptiveDT
dt = 0.001
optimal_iterations = 5
growth_factor = 5
[../]
[]
(modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/rotated-2d-bkt-function-porosity-mixed.i)
p_initial=1.01e5
T=273.15
# u refers to the superficial velocity
u_in=1
rho_in=1.30524
sup_mom_y_in=${fparse u_in * rho_in}
user_limiter='upwind'
friction_coeff=10
[GlobalParams]
fp = fp
two_term_boundary_expansion = true
limiter = ${user_limiter}
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1
nx = 3
ymin = 0
ymax = 18
ny = 90
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[pressure]
type = MooseVariableFVReal
initial_condition = ${p_initial}
[]
[sup_mom_x]
type = MooseVariableFVReal
initial_condition = 1e-15
scaling = 1e-2
[]
[sup_mom_y]
type = MooseVariableFVReal
initial_condition = 1e-15
scaling = 1e-2
[]
[T_fluid]
type = MooseVariableFVReal
initial_condition = ${T}
scaling = 1e-5
[]
[]
[AuxVariables]
[vel_y]
type = MooseVariableFVReal
[]
[rho]
type = MooseVariableFVReal
[]
[eps]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[vel_y]
type = ADMaterialRealAux
variable = vel_y
property = vel_y
execute_on = 'timestep_end'
[]
[rho]
type = ADMaterialRealAux
variable = rho
property = rho
execute_on = 'timestep_end'
[]
[eps]
type = MaterialRealAux
variable = eps
property = porosity
execute_on = 'timestep_end'
[]
[]
[FVKernels]
[mass_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_dt'
variable = pressure
[]
[mass_advection]
type = PCNSFVKT
variable = pressure
eqn = "mass"
[]
[momentum_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rhou_dt'
variable = sup_mom_x
[]
[momentum_advection]
type = PCNSFVKT
variable = sup_mom_x
eqn = "momentum"
momentum_component = 'x'
[]
[eps_grad]
type = PNSFVPGradEpsilon
variable = sup_mom_x
momentum_component = 'x'
epsilon_function = 'eps'
[]
[drag]
type = PCNSFVMomentumFriction
variable = sup_mom_x
momentum_component = 'x'
Darcy_name = 'cl'
momentum_name = superficial_rhou
[]
[momentum_time_y]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rhov_dt'
variable = sup_mom_y
[]
[momentum_advection_y]
type = PCNSFVKT
variable = sup_mom_y
eqn = "momentum"
momentum_component = 'y'
[]
[eps_grad_y]
type = PNSFVPGradEpsilon
variable = sup_mom_y
momentum_component = 'y'
epsilon_function = 'eps'
[]
[drag_y]
type = PCNSFVMomentumFriction
variable = sup_mom_y
momentum_component = 'y'
Darcy_name = 'cl'
momentum_name = superficial_rhov
[]
[energy_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_et_dt'
variable = T_fluid
[]
[energy_advection]
type = PCNSFVKT
variable = T_fluid
eqn = "energy"
[]
[]
[FVBCs]
[rho_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = pressure
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'mass'
velocity_function_includes_rho = true
[]
[rhou_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = sup_mom_x
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'x'
velocity_function_includes_rho = true
[]
[rhov_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = sup_mom_y
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'y'
velocity_function_includes_rho = true
[]
[rho_et_bottom]
type = PCNSFVStrongBC
boundary = 'bottom'
variable = T_fluid
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'energy'
velocity_function_includes_rho = true
[]
[rho_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = pressure
pressure = ${p_initial}
eqn = 'mass'
[]
[rhou_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = sup_mom_x
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'x'
[]
[rhov_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = sup_mom_y
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'y'
[]
[rho_et_top]
type = PCNSFVStrongBC
boundary = 'top'
variable = T_fluid
pressure = ${p_initial}
eqn = 'energy'
[]
[wall_pressure_x]
type = PCNSFVImplicitMomentumPressureBC
momentum_component = 'x'
boundary = 'left right'
variable = sup_mom_x
[]
[wall_pressure_y]
type = PCNSFVImplicitMomentumPressureBC
momentum_component = 'y'
boundary = 'left right'
variable = sup_mom_y
[]
# Use these to help create more accurate cell centered gradients for cells adjacent to boundaries
[T_bottom]
type = FVDirichletBC
variable = T_fluid
value = ${T}
boundary = 'bottom'
[]
[sup_mom_x_bottom_and_walls]
type = FVDirichletBC
variable = sup_mom_x
value = 0
boundary = 'bottom left right'
[]
[sup_mom_y_walls]
type = FVDirichletBC
variable = sup_mom_y
value = 0
boundary = 'left right'
[]
[sup_mom_y_bottom]
type = FVDirichletBC
variable = sup_mom_y
value = ${sup_mom_y_in}
boundary = 'bottom'
[]
[p_top]
type = FVDirichletBC
variable = pressure
value = ${p_initial}
boundary = 'top'
[]
[]
[Functions]
[ud_in]
type = ParsedVectorFunction
expression_x = '0'
expression_y = '${sup_mom_y_in}'
[]
[eps]
type = ParsedFunction
expression = 'if(y < 2.8, 1,
if(y < 3.2, 1 - .5 / .4 * (y - 2.8),
if(y < 6.8, .5,
if(y < 7.2, .5 - .25 / .4 * (y - 6.8),
if(y < 10.8, .25,
if(y < 11.2, .25 + .25 / .4 * (y - 10.8),
if(y < 14.8, .5,
if(y < 15.2, .5 + .5 / .4 * (y - 14.8),
1))))))))'
[]
[]
[Materials]
[var_mat]
type = PorousMixedVarMaterial
pressure = pressure
T_fluid = T_fluid
superficial_rhou = sup_mom_x
superficial_rhov = sup_mom_y
fp = fp
porosity = porosity
[]
[porosity]
type = GenericFunctionMaterial
prop_names = 'porosity'
prop_values = 'eps'
[]
[ad_generic]
type = ADGenericConstantVectorMaterial
prop_names = 'cl'
prop_values = '${friction_coeff} ${friction_coeff} ${friction_coeff}'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
solve_type = NEWTON
line_search = 'bt'
type = Transient
nl_max_its = 20
[TimeStepper]
type = IterationAdaptiveDT
dt = 5e-5
optimal_iterations = 6
growth_factor = 1.2
[]
num_steps = 10000
end_time = 500
nl_abs_tol = 1e-7
petsc_options_iname = '-pc_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu mumps'
[]
[Outputs]
[out]
type = Exodus
execute_on = 'final'
[]
checkpoint = true
[]
[Debug]
show_var_residual_norms = true
[]
(modules/thermal_hydraulics/test/tests/components/volume_junction_1phase/junction_with_calorifically_imperfect_gas.i)
# This input file tests compatibility of VolumeJunction1Phase and CaloricallyImperfectGas.
# Loss coefficient is applied in first junction.
# Expected pressure drop ~0.5*K*rho_in*vel_in^2=0.5*100*3.219603*1 = 160.9 Pa
T_in = 523.0
vel = 1
p_out = 7e6
[GlobalParams]
initial_p = ${p_out}
initial_vel = ${vel}
initial_T = ${T_in}
gravity_vector = '0 0 0'
closures = simple_closures
n_elems = 3
f = 0
scaling_factor_1phase = '1 1 1e-5'
scaling_factor_rhoV = '1e2'
scaling_factor_rhowV = '1e-2'
scaling_factor_rhoEV = '1e-5'
[]
[Functions]
[e_fn]
type = PiecewiseLinear
x = '100 280 300 350 400 450 500 550 600 700 800 900 1000 1200 1400 1600 1800 2000 2200 2400 2600 2800 3000 5000'
y = '783.9 2742.3 2958.6 3489.2 4012.7 4533.3 5053.8 5574 6095.1 7140.2 8192.9 9256.3 10333.6 12543.9 14836.6 17216.3 19688.4 22273.7 25018.3 28042.3 31544.2 35818.1 41256.5 100756.5'
scale_factor = 1e3
[]
[mu_fn]
type = PiecewiseLinear
x = '100 280 300 350 400 450 500 550 600 700 800 900 1000 1200 1400 1600 1800 2000 2200 2400 2600 2800 3000 5000'
y = '85.42 85.42 89.53 99.44 108.9 117.98 126.73 135.2 143.43 159.25 174.36 188.9 202.96 229.88 255.5 280.05 303.67 326.45 344.97 366.49 387.87 409.48 431.86 431.86'
scale_factor = 1e-7
[]
[k_fn]
type = PiecewiseLinear
x = '100 280 300 350 400 450 500 550 600 700 800 900 1000 1200 1400 1600 1800 2000 2200 2400 2600 2800 3000 5000'
y = '186.82 186.82 194.11 212.69 231.55 250.38 268.95 287.19 305.11 340.24 374.92 409.66 444.75 511.13 583.42 656.44 733.32 826.53 961.15 1180.38 1546.31 2135.49 3028.08 3028.08'
scale_factor = 1e-3
[]
[]
[FluidProperties]
[fp]
type = CaloricallyImperfectGas
molar_mass = 0.002
e = e_fn
k = k_fn
mu = mu_fn
min_temperature = 100
max_temperature = 5000
out_of_bound_error = false
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[inlet_bc]
type = InletVelocityTemperature1Phase
input = 'inlet:in'
vel = ${vel}
T = ${T_in}
[]
[inlet]
type = FlowChannel1Phase
fp = fp
position = '0 0 11'
orientation = '0 0 -1'
length = 1
A = 5
[]
[inlet_plenum]
type = VolumeJunction1Phase
position = '0 0 10'
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = ${vel}
K = 100
connections = 'inlet:out channel1:in channel2:in'
volume = 1
[]
[channel1]
type = FlowChannel1Phase
fp = fp
position = '0 0 10'
orientation = '0 0 -1'
length = 10
A = 4
D_h = 1
[]
[channel2]
type = FlowChannel1Phase
fp = fp
position = '0 0 10'
orientation = '0 0 -1'
length = 10
A = 1
D_h = 1
[]
[outlet_plenum]
type = VolumeJunction1Phase
position = '0 0 0'
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = ${vel}
connections = 'channel1:out channel2:out outlet:in'
volume = 1
[]
[outlet]
type = FlowChannel1Phase
fp = fp
position = '0 0 0'
orientation = '0 0 -1'
length = 1
A = 5
[]
[outlet_bc]
type = Outlet1Phase
p = ${p_out}
input = 'outlet:out'
[]
[]
[Postprocessors]
[p_in]
type = SideAverageValue
variable = p
boundary = inlet:in
[]
[p_out]
type = SideAverageValue
variable = p
boundary = outlet:out
[]
[Delta_p]
type = DifferencePostprocessor
value1 = p_out
value2 = p_in
[]
[inlet_in_m_dot]
type = ADFlowBoundaryFlux1Phase
boundary = 'inlet_bc'
equation = mass
[]
[inlet_out_m_dot]
type = ADFlowJunctionFlux1Phase
boundary = 'inlet:out'
connection_index = 0
junction = inlet_plenum
equation = mass
[]
[channel1_in_m_dot]
type = ADFlowJunctionFlux1Phase
boundary = 'channel1:in'
connection_index = 1
junction = inlet_plenum
equation = mass
[]
[channel1_out_m_dot]
type = ADFlowJunctionFlux1Phase
boundary = 'channel1:out'
connection_index = 0
junction = outlet_plenum
equation = mass
[]
[channel2_in_m_dot]
type = ADFlowJunctionFlux1Phase
boundary = 'channel2:in'
connection_index = 2
junction = inlet_plenum
equation = mass
[]
[channel2_out_m_dot]
type = ADFlowJunctionFlux1Phase
boundary = 'channel2:out'
connection_index = 1
junction = outlet_plenum
equation = mass
[]
[outlet_in_m_dot]
type = ADFlowJunctionFlux1Phase
boundary = 'outlet:in'
connection_index = 2
junction = outlet_plenum
equation = mass
[]
[outlet_out_m_dot]
type = ADFlowBoundaryFlux1Phase
boundary = 'outlet_bc'
equation = mass
[]
[net_mass_flow_rate_domain]
type = LinearCombinationPostprocessor
pp_names = 'inlet_in_m_dot outlet_out_m_dot'
pp_coefs = '1 -1'
[]
[net_mass_flow_rate_volume_junction]
type = LinearCombinationPostprocessor
pp_names = 'inlet_out_m_dot channel1_in_m_dot channel2_in_m_dot'
pp_coefs = '1 -1 -1'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
start_time = 0
end_time = 20
[TimeStepper]
type = IterationAdaptiveDT
dt = 1
optimal_iterations = 8
iteration_window = 2
[]
timestep_tolerance = 1e-6
abort_on_solve_fail = true
line_search = basic
nl_rel_tol = 1e-8
nl_abs_tol = 4e-8
nl_max_its = 25
l_tol = 1e-3
l_max_its = 5
petsc_options = '-snes_converged_reason'
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu '
[]
[Outputs]
[out]
type = CSV
execute_on = 'FINAL'
show = 'net_mass_flow_rate_domain net_mass_flow_rate_volume_junction Delta_p'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/pwcns/boundary_conditions/flux_bcs_mdot-action.i)
l = 10
inlet_area = 2
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = ${inlet_area}
nx = 10
ny = 5
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[Modules]
[NavierStokesFV]
compressibility = 'weakly-compressible'
add_energy_equation = true
porous_medium_treatment = true
porosity = 'porosity'
density = 'rho'
dynamic_viscosity = 'mu'
thermal_conductivity = 'k'
specific_heat = 'cp'
initial_velocity = '${inlet_velocity} 1e-15 0'
initial_temperature = '${inlet_temp}'
initial_pressure = '${outlet_pressure}'
inlet_boundaries = 'left'
momentum_inlet_types = 'flux-mass'
flux_inlet_pps = 'inlet_mdot'
energy_inlet_types = 'flux-mass'
energy_inlet_function = 'inlet_T'
wall_boundaries = 'top bottom'
momentum_wall_types = 'noslip noslip'
energy_wall_types = 'heatflux heatflux'
energy_wall_function = '0 0'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '${outlet_pressure}'
external_heat_source = 'power_density'
mass_advection_interpolation = 'average'
momentum_advection_interpolation = 'average'
energy_advection_interpolation = 'average'
[]
[]
[Postprocessors]
[inlet_mdot]
type = Receiver
default = ${fparse 1980 * inlet_velocity * inlet_area}
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k mu porosity'
prop_values = '${cp} ${k} ${mu} 0.5'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T_fluid
pressure = pressure
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-2
optimal_iterations = 6
[]
end_time = 1
nl_abs_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
exodus = true
execute_on = FINAL
[]
(modules/navier_stokes/test/tests/finite_element/ins/lid_driven/transient_fsp.i)
n=64
mu=2e-3
[GlobalParams]
gravity = '0 0 0'
preset = true
supg = false
[]
[Problem]
extra_tag_matrices = 'mass'
previous_nl_solution_required = true
type = NavierStokesProblem
mass_matrix = 'mass'
schur_fs_index = '1'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1.0
ymin = 0
ymax = 1.0
nx = ${n}
ny = ${n}
elem_type = QUAD9
[]
[]
[Variables]
[vel_x]
order = SECOND
family = LAGRANGE
[]
[vel_y]
order = SECOND
family = LAGRANGE
[]
[p]
order = FIRST
family = LAGRANGE
[]
[]
[Kernels]
# mass
[mass]
type = INSMass
variable = p
u = vel_x
v = vel_y
pressure = p
[]
[x_time]
type = INSMomentumTimeDerivative
variable = vel_x
[]
[x_momentum_space]
type = INSMomentumLaplaceForm
variable = vel_x
u = vel_x
v = vel_y
pressure = p
component = 0
[]
[x_mass]
type = MassMatrix
variable = vel_x
matrix_tags = 'mass'
[]
[y_time]
type = INSMomentumTimeDerivative
variable = vel_y
[]
[y_momentum_space]
type = INSMomentumLaplaceForm
variable = vel_y
u = vel_x
v = vel_y
pressure = p
component = 1
[]
[y_mass]
type = MassMatrix
variable = vel_y
matrix_tags = 'mass'
[]
[]
[BCs]
[x_no_slip]
type = DirichletBC
variable = vel_x
boundary = 'bottom right left'
value = 0.0
[]
[lid]
type = FunctionDirichletBC
variable = vel_x
boundary = 'top'
function = 'lid_function'
[]
[y_no_slip]
type = DirichletBC
variable = vel_y
boundary = 'bottom right top left'
value = 0.0
[]
[]
[Materials]
[const]
type = GenericConstantMaterial
block = 0
prop_names = 'rho mu'
prop_values = '1 ${mu}'
[]
[]
[Functions]
[lid_function]
# We pick a function that is exactly represented in the velocity
# space so that the Dirichlet conditions are the same regardless
# of the mesh spacing.
type = ParsedFunction
expression = '4*x*(1-x)'
[]
[]
[Preconditioning]
[FSP]
type = FSP
topsplit = 'by_diri_others'
[by_diri_others]
splitting = 'diri others'
splitting_type = additive
petsc_options_iname = '-ksp_type'
petsc_options_value = 'preonly'
[]
[diri]
sides = 'left right top bottom'
vars = 'vel_x vel_y'
petsc_options_iname = '-pc_type'
petsc_options_value = 'jacobi'
[]
[others]
splitting = 'u p'
splitting_type = schur
petsc_options_iname = '-pc_fieldsplit_schur_fact_type -pc_fieldsplit_schur_precondition -ksp_gmres_restart -ksp_rtol -ksp_type -ksp_atol'
petsc_options_value = 'full self 300 1e-5 fgmres 1e-9'
unside_by_var_boundary_name = 'left top right bottom left top right bottom'
unside_by_var_var_name = 'vel_x vel_x vel_x vel_x vel_y vel_y vel_y vel_y'
[]
[u]
vars = 'vel_x vel_y'
unside_by_var_boundary_name = 'left top right bottom left top right bottom'
unside_by_var_var_name = 'vel_x vel_x vel_x vel_x vel_y vel_y vel_y vel_y'
# petsc_options = '-ksp_converged_reason'
petsc_options_iname = '-pc_type -ksp_pc_side -ksp_type -ksp_rtol -pc_hypre_type -ksp_gmres_restart'
petsc_options_value = 'hypre right gmres 1e-2 boomeramg 300'
[]
[p]
vars = 'p'
petsc_options = '-pc_lsc_scale_diag -ksp_converged_reason'# -lsc_ksp_converged_reason -lsc_ksp_monitor_true_residual
petsc_options_iname = '-ksp_type -ksp_gmres_restart -ksp_rtol -pc_type -ksp_pc_side -lsc_pc_type -lsc_pc_hypre_type -lsc_ksp_type -lsc_ksp_rtol -lsc_ksp_pc_side -lsc_ksp_gmres_restart'
petsc_options_value = 'fgmres 300 1e-2 lsc right hypre boomeramg gmres 1e-1 right 300'
[]
[]
[]
[Postprocessors]
[pavg]
type = ElementAverageValue
variable = p
[]
[]
[UserObjects]
[set_pressure]
type = NSPressurePin
pin_type = 'average'
variable = p
pressure_average = 'pavg'
[]
[]
[Executioner]
solve_type = NEWTON
type = Transient
petsc_options_iname = '-snes_max_it'
petsc_options_value = '100'
line_search = 'none'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-9
abort_on_solve_fail = true
normalize_solution_diff_norm_by_dt = false
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 6
dt = 1e-2
[]
steady_state_detection = true
[]
[Outputs]
[exo]
type = Exodus
execute_on = 'final'
hide = 'pavg'
[]
[]
(modules/thermal_hydraulics/test/tests/problems/brayton_cycle/recuperated_brayton_cycle.i)
# This input file models an open, recuperated Brayton cycle with a PID
# controlled start up using a coupled motor.
#
# Heat is supplied to the system by a volumetric heat source, and a second heat
# source is used to model a recuperator. The recuperator transfers heat from the
# turbine exhaust gas to the compressor outlet gas.
#
# Initially the fluid and heat structures are at rest at ambient conditions,
# and the shaft speed is zero.
# The transient is controlled as follows:
# * 0 - 2000 s: Motor increases shaft speed to approx. 85,000 RPM by PID control
# * 1000 - 8600 s: Power in main heat source increases from 0 - 104 kW
# * 2000 - 200000 s: Torque supplied by turbine increases to steady state level
# as working fluid temperature increases. Torque supplied by
# the motor is ramped down to 0 N-m transitioning shaft control
# to the turbine at its rated speed of 96,000 RPM.
I_motor = 1.0
I_generator = 1.0
generator_torque_per_shaft_speed = -0.00025
motor_ramp_up_duration = 3605
motor_ramp_down_duration = 1800
post_motor_time = 2160000
t1 = ${motor_ramp_up_duration}
t2 = ${fparse t1 + motor_ramp_down_duration}
t3 = ${fparse t2 + post_motor_time}
D1 = 0.15
D2 = ${D1}
D3 = ${D1}
D4 = ${D1}
D5 = ${D1}
D6 = ${D1}
D7 = ${D1}
D8 = ${D1}
A1 = ${fparse 0.25 * pi * D1^2}
A2 = ${fparse 0.25 * pi * D2^2}
A3 = ${fparse 0.25 * pi * D3^2}
A4 = ${fparse 0.25 * pi * D4^2}
A5 = ${fparse 0.25 * pi * D5^2}
A6 = ${fparse 0.25 * pi * D6^2}
A7 = ${fparse 0.25 * pi * D7^2}
A8 = ${fparse 0.25 * pi * D8^2}
recuperator_width = 0.15
L1 = 5.0
L2 = ${L1}
L3 = ${fparse 2 * L1}
L4 = ${fparse 2 * L1}
L5 = ${L1}
L6 = ${L1}
L7 = ${fparse L1 + recuperator_width}
L8 = ${L1}
x1 = 0.0
x2 = ${fparse x1 + L1}
x3 = ${fparse x2 + L2}
x4 = ${x3}
x5 = ${fparse x4 - L4}
x6 = ${x5}
x7 = ${fparse x6 + L6}
x8 = ${fparse x7 + L7}
y1 = 0
y2 = ${y1}
y3 = ${y2}
y4 = ${fparse y3 - L3}
y5 = ${y4}
y6 = ${fparse y5 + L5}
y7 = ${y6}
y8 = ${y7}
x1_out = ${fparse x1 + L1 - 0.001}
x2_in = ${fparse x2 + 0.001}
y5_in = ${fparse y5 + 0.001}
x6_out = ${fparse x6 + L6 - 0.001}
x7_in = ${fparse x7 + 0.001}
y8_in = ${fparse y8 + 0.001}
y8_out = ${fparse y8 + L8 - 0.001}
hot_leg_in = ${y8_in}
hot_leg_out = ${y8_out}
cold_leg_in = ${fparse y3 - 0.001}
cold_leg_out = ${fparse y3 - (L3/2) - 0.001}
n_elems1 = 5
n_elems2 = ${n_elems1}
n_elems3 = ${fparse 2 * n_elems1}
n_elems4 = ${fparse 2 * n_elems1}
n_elems5 = ${n_elems1}
n_elems6 = ${n_elems1}
n_elems7 = ${n_elems1}
n_elems8 = ${n_elems1}
A_ref_comp = ${fparse 0.5 * (A1 + A2)}
V_comp = ${fparse A_ref_comp * 1.0}
I_comp = 1.0
A_ref_turb = ${fparse 0.5 * (A4 + A5)}
V_turb = ${fparse A_ref_turb * 1.0}
I_turb = 1.0
c0_rated_comp = 351.6925137
rho0_rated_comp = 1.146881112
rated_mfr = 0.25
speed_rated_rpm = 96000
speed_rated = ${fparse speed_rated_rpm * 2 * pi / 60.0}
speed_initial = 0
eff_comp = 0.79
eff_turb = 0.843
T_ambient = 300
p_ambient = 1e5
hs_power = 105750
[GlobalParams]
gravity_vector = '0 0 0'
initial_p = ${p_ambient}
initial_T = ${T_ambient}
initial_vel = 0
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
fp = fp_air
closures = closures
f = 0
scaling_factor_1phase = '1 1 1e-5'
scaling_factor_rhoV = 1
scaling_factor_rhouV = 1e-2
scaling_factor_rhovV = 1e-2
scaling_factor_rhowV = 1e-2
scaling_factor_rhoEV = 1e-5
scaling_factor_temperature = 1e-2
rdg_slope_reconstruction = none
[]
[FluidProperties]
[fp_air]
type = IdealGasFluidProperties
emit_on_nan = none
[]
[]
[SolidProperties]
[steel]
type = ThermalFunctionSolidProperties
rho = 8050
k = 45
cp = 466
[]
[]
[Closures]
[closures]
type = Closures1PhaseSimple
[]
[]
[Functions]
##########################
# Motor
##########################
# Functions for control logic that determines when to shut off the PID system
[is_tripped_fn]
type = ParsedFunction
symbol_names = 'motor_torque turbine_torque'
symbol_values = 'motor_torque turbine_torque'
expression = 'turbine_torque > motor_torque'
[]
[PID_tripped_constant_value]
type = ConstantFunction
value = 1
[]
[PID_tripped_status_fn]
type = ParsedFunction
symbol_values = 'PID_trip_status'
symbol_names = 'PID_trip_status'
expression = 'PID_trip_status'
[]
[time_fn]
type = ParsedFunction
expression = t
[]
# Shutdown function which ramps down the motor once told by the control logic
[motor_torque_fn_shutdown]
type = ParsedFunction
symbol_values = 'PID_trip_status time_trip'
symbol_names = 'PID_trip_status time_trip'
expression = 'if(PID_trip_status = 1, max(2.4 - (2.4 * ((t - time_trip) / 35000)),0.0), 1)'
[]
# Generates motor power curve
[motor_power_fn]
type = ParsedFunction
expression = 'torque * speed'
symbol_names = 'torque speed'
symbol_values = 'motor_torque shaft:omega'
[]
##########################
# Generator
##########################
# Generates generator torque curve
[generator_torque_fn]
type = ParsedFunction
expression = 'slope * t'
symbol_names = 'slope'
symbol_values = '${generator_torque_per_shaft_speed}'
[]
# Generates generator power curve
[generator_power_fn]
type = ParsedFunction
expression = 'torque * speed'
symbol_names = 'torque speed'
symbol_values = 'generator_torque shaft:omega'
[]
##########################
# Reactor
##########################
# Ramps up reactor power when activated by control logic
[power_fn]
type = PiecewiseLinear
x = '0 1000 8600'
y = '0 0 ${hs_power}'
[]
##########################
# Compressor
##########################
# compressor pressure ratios
[rp_comp1]
type = PiecewiseLinear
data_file = 'rp_comp1.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_comp2]
type = PiecewiseLinear
data_file = 'rp_comp2.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_comp3]
type = PiecewiseLinear
data_file = 'rp_comp3.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_comp4]
type = PiecewiseLinear
data_file = 'rp_comp4.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_comp5]
type = PiecewiseLinear
data_file = 'rp_comp5.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
# compressor efficiencies
[eff_comp1]
type = ConstantFunction
value = ${eff_comp}
[]
[eff_comp2]
type = ConstantFunction
value = ${eff_comp}
[]
[eff_comp3]
type = ConstantFunction
value = ${eff_comp}
[]
[eff_comp4]
type = ConstantFunction
value = ${eff_comp}
[]
[eff_comp5]
type = ConstantFunction
value = ${eff_comp}
[]
##########################
# Turbine
##########################
# turbine pressure ratios
[rp_turb0]
type = ConstantFunction
value = 1
[]
[rp_turb1]
type = PiecewiseLinear
data_file = 'rp_turb1.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_turb2]
type = PiecewiseLinear
data_file = 'rp_turb2.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_turb3]
type = PiecewiseLinear
data_file = 'rp_turb3.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_turb4]
type = PiecewiseLinear
data_file = 'rp_turb4.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
[rp_turb5]
type = PiecewiseLinear
data_file = 'rp_turb5.csv'
x_index_in_file = 0
y_index_in_file = 1
format = columns
extrap = true
[]
# turbine efficiency
[eff_turb1]
type = ConstantFunction
value = ${eff_turb}
[]
[eff_turb2]
type = ConstantFunction
value = ${eff_turb}
[]
[eff_turb3]
type = ConstantFunction
value = ${eff_turb}
[]
[eff_turb4]
type = ConstantFunction
value = ${eff_turb}
[]
[eff_turb5]
type = ConstantFunction
value = ${eff_turb}
[]
[]
[Components]
# system inlet pulling air from the open atmosphere
[inlet]
type = InletStagnationPressureTemperature1Phase
input = 'pipe1:in'
p0 = ${p_ambient}
T0 = ${T_ambient}
[]
# Inlet pipe
[pipe1]
type = FlowChannel1Phase
position = '${x1} ${y1} 0'
orientation = '1 0 0'
length = ${L1}
n_elems = ${n_elems1}
A = ${A1}
[]
# Compressor as defined in MAGNET PCU document (Guillen 2020)
[compressor]
type = ShaftConnectedCompressor1Phase
position = '${x2} ${y2} 0'
inlet = 'pipe1:out'
outlet = 'pipe2:in'
A_ref = ${A_ref_comp}
volume = ${V_comp}
omega_rated = ${speed_rated}
mdot_rated = ${rated_mfr}
c0_rated = ${c0_rated_comp}
rho0_rated = ${rho0_rated_comp}
# Determines which compression ratio curve and efficiency curve to use depending on ratio of speed/rated_speed
speeds = '0.5208 0.6250 0.7292 0.8333 0.9375'
Rp_functions = 'rp_comp1 rp_comp2 rp_comp3 rp_comp4 rp_comp5'
eff_functions = 'eff_comp1 eff_comp2 eff_comp3 eff_comp4 eff_comp5'
min_pressure_ratio = 1.0
speed_cr_I = 0
inertia_const = ${I_comp}
inertia_coeff = '${I_comp} 0 0 0'
# assume no shaft friction
speed_cr_fr = 0
tau_fr_const = 0
tau_fr_coeff = '0 0 0 0'
[]
# Outlet pipe from the compressor
[pipe2]
type = FlowChannel1Phase
position = '${x2} ${y2} 0'
orientation = '1 0 0'
length = ${L2}
n_elems = ${n_elems2}
A = ${A2}
[]
# 90 degree connection between pipe 2 and 3
[junction2_cold_leg]
type = VolumeJunction1Phase
connections = 'pipe2:out cold_leg:in'
position = '${x3} ${y3} 0'
volume = ${fparse A2*0.1}
[]
# Cold leg of the recuperator
[cold_leg]
type = FlowChannel1Phase
position = '${x3} ${y3} 0'
orientation = '0 -1 0'
length = ${fparse L3/2}
n_elems = ${fparse n_elems3/2}
A = ${A3}
[]
# Recuperator which transfers heat from exhaust gas to reactor inlet gas to improve thermal efficency
[recuperator]
type = HeatStructureCylindrical
orientation = '0 -1 0'
position = '${x3} ${y3} 0'
length = ${fparse L3/2}
widths = ${recuperator_width}
n_elems = ${fparse n_elems3/2}
n_part_elems = 2
names = recuperator
solid_properties = steel
solid_properties_T_ref = '300'
inner_radius = ${D1}
[]
# heat transfer from recuperator to cold leg
[heat_transfer_cold_leg]
type = HeatTransferFromHeatStructure1Phase
flow_channel = cold_leg
hs = recuperator
hs_side = OUTER
Hw = 10000
[]
# heat transfer from hot leg to recuperator
[heat_transfer_hot_leg]
type = HeatTransferFromHeatStructure1Phase
flow_channel = hot_leg
hs = recuperator
hs_side = INNER
Hw = 10000
[]
[junction_cold_leg_3]
type = JunctionOneToOne1Phase
connections = 'cold_leg:out pipe3:in'
[]
[pipe3]
type = FlowChannel1Phase
position = '${x3} ${fparse y3 - (L3/2)} 0'
orientation = '0 -1 0'
length = ${fparse L3/2}
n_elems = ${fparse n_elems3/2}
A = ${A3}
[]
# 90 degree connection between pipe 3 and 4
[junction3_4]
type = VolumeJunction1Phase
connections = 'pipe3:out pipe4:in'
position = '${x4} ${y4} 0'
volume = ${fparse A3*0.1}
[]
# Pipe through the "reactor core"
[pipe4]
type = FlowChannel1Phase
position = '${x4} ${y4} 0'
orientation = '-1 0 0'
length = ${L4}
n_elems = ${n_elems4}
A = ${A4}
[]
# "Reactor Core" and it's associated heat transfer to pipe 4
[reactor]
type = HeatStructureCylindrical
orientation = '-1 0 0'
position = '${x4} ${y4} 0'
length = ${L4}
widths = 0.15
n_elems = ${n_elems4}
n_part_elems = 2
names = core
solid_properties = steel
solid_properties_T_ref = '300'
[]
[total_power]
type = TotalPower
power = 0
[]
[heat_generation]
type = HeatSourceFromTotalPower
power = total_power
hs = reactor
regions = core
[]
[heat_transfer]
type = HeatTransferFromHeatStructure1Phase
flow_channel = pipe4
hs = reactor
hs_side = OUTER
Hw = 10000
[]
# 90 degree connection between pipe 4 and 5
[junction4_5]
type = VolumeJunction1Phase
connections = 'pipe4:out pipe5:in'
position = '${x5} ${y5} 0'
volume = ${fparse A4*0.1}
[]
# Pipe carrying hot gas back to the PCU
[pipe5]
type = FlowChannel1Phase
position = '${x5} ${y5} 0'
orientation = '0 1 0'
length = ${L5}
n_elems = ${n_elems5}
A = ${A5}
[]
# 90 degree connection between pipe 5 and 6
[junction5_6]
type = VolumeJunction1Phase
connections = 'pipe5:out pipe6:in'
position = '${x6} ${y6} 0'
volume = ${fparse A5*0.1}
[]
# Inlet pipe to the turbine
[pipe6]
type = FlowChannel1Phase
position = '${x6} ${y6} 0'
orientation = '1 0 0'
length = ${L6}
n_elems = ${n_elems6}
A = ${A6}
[]
# Turbine as defined in MAGNET PCU document (Guillen 2020) and (Wright 2006)
[turbine]
type = ShaftConnectedCompressor1Phase
position = '${x7} ${y7} 0'
inlet = 'pipe6:out'
outlet = 'pipe7:in'
A_ref = ${A_ref_turb}
volume = ${V_turb}
# A turbine is treated as an "inverse" compressor, this value determines if component is to be treated as turbine or compressor
# If treat_as_turbine is omitted, code automatically assumes it is a compressor
treat_as_turbine = true
omega_rated = ${speed_rated}
mdot_rated = ${rated_mfr}
c0_rated = ${c0_rated_comp}
rho0_rated = ${rho0_rated_comp}
# Determines which compression ratio curve and efficiency curve to use depending on ratio of speed/rated_speed
speeds = '0 0.5208 0.6250 0.7292 0.8333 0.9375'
Rp_functions = 'rp_turb0 rp_turb1 rp_turb2 rp_turb3 rp_turb4 rp_turb5'
eff_functions = 'eff_turb1 eff_turb1 eff_turb2 eff_turb3 eff_turb4 eff_turb5'
min_pressure_ratio = 1.0
speed_cr_I = 0
inertia_const = ${I_turb}
inertia_coeff = '${I_turb} 0 0 0'
# assume no shaft friction
speed_cr_fr = 0
tau_fr_const = 0
tau_fr_coeff = '0 0 0 0'
[]
# Outlet pipe from turbine
[pipe7]
type = FlowChannel1Phase
position = '${x7} ${y7} 0'
orientation = '1 0 0'
length = ${L7}
n_elems = ${n_elems7}
A = ${A7}
[]
# 90 degree connection between pipe 7 and 8
[junction7_hot_leg]
type = VolumeJunction1Phase
connections = 'pipe7:out hot_leg:in'
position = '${x8} ${y8} 0'
volume = ${fparse A7*0.1}
[]
# Hot leg of the recuperator
[hot_leg]
type = FlowChannel1Phase
position = '${x8} ${y8} 0'
orientation = '0 1 0'
length = ${L8}
n_elems = ${n_elems8}
A = ${A8}
[]
# System outlet dumping exhaust gas to the atmosphere
[outlet]
type = Outlet1Phase
input = 'hot_leg:out'
p = ${p_ambient}
[]
# Roatating shaft connecting motor, compressor, turbine, and generator
[shaft]
type = Shaft
connected_components = 'motor compressor turbine generator'
initial_speed = ${speed_initial}
[]
# 3-Phase electircal motor used for system start-up, controlled by PID
[motor]
type = ShaftConnectedMotor
inertia = ${I_motor}
torque = 0 # controlled
[]
# Electric generator supplying power to the grid
[generator]
type = ShaftConnectedMotor
inertia = ${I_generator}
torque = generator_torque_fn
[]
[]
# Control logics which govern startup of the motor, startup of the "reactor core", and shutdown of the motor
[ControlLogic]
# Sets desired shaft speed to be reached by motor NOTE: SHOULD BE SET LOWER THAN RATED TURBINE RPM
[set_point]
type = GetFunctionValueControl
function = ${fparse speed_rated_rpm - 9000}
[]
# PID with gains determined by iterative process NOTE: Gain values are system specific
[initial_motor_PID]
type = PIDControl
set_point = set_point:value
input = shaft_RPM
initial_value = 0
K_p = 0.0011
K_i = 0.00000004
K_d = 0
[]
# Determines when the PID system should be running and when it should begin the shutdown cycle. If needed: PID output, else: shutdown function
[logic]
type = ParsedFunctionControl
function = 'if(motor+0.5 > turb, PID, shutdown_fn)'
symbol_names = 'motor turb PID shutdown_fn'
symbol_values = 'motor_torque turbine_torque initial_motor_PID:output motor_torque_fn_shutdown'
[]
# Takes the output generated in [logic] and applies it to the motor torque
[motor_PID]
type = SetComponentRealValueControl
component = motor
parameter = torque
value = logic:value
[]
# Determines when to turn on heat source
[power_logic]
type = ParsedFunctionControl
function = 'power_fn'
symbol_names = 'power_fn'
symbol_values = 'power_fn'
[]
# Applies heat source to the total_power block
[power_applied]
type = SetComponentRealValueControl
component = total_power
parameter = power
value = power_logic:value
[]
[]
[Controls]
# Enables set_PID_tripped
[PID_trip_status]
type = ConditionalFunctionEnableControl
conditional_function = is_tripped_fn
enable_objects = 'AuxScalarKernels::PID_trip_status_aux'
execute_on = 'TIMESTEP_END'
[]
# Enables set_time_PID
[time_PID]
type = ConditionalFunctionEnableControl
conditional_function = PID_tripped_status_fn
disable_objects = 'AuxScalarKernels::time_trip_aux'
execute_on = 'TIMESTEP_END'
[]
[]
[AuxVariables]
# Creates a variable that will later be set to the time when tau_turbine > tau_motor
[time_trip]
order = FIRST
family = SCALAR
[]
# Creates variable which indicates if tau_turbine > tau_motor....... If tau_motor > tau_turbine, 0, else 1
[PID_trip_status]
order = FIRST
family = SCALAR
initial_condition = 0
[]
[]
[AuxScalarKernels]
# Creates variable from time_fn which indicates when tau_turbine > tau_motor
[time_trip_aux]
type = FunctionScalarAux
function = time_fn
variable = time_trip
execute_on = 'TIMESTEP_END'
[]
# Overwrites variable PID_trip_status to the value from PID_tripped_constant_value (changes 0 to 1)
[PID_trip_status_aux]
type = FunctionScalarAux
function = PID_tripped_constant_value
variable = PID_trip_status
execute_on = 'TIMESTEP_END'
enable = false
[]
[]
[Postprocessors]
# Indicates when tau_turbine > tau_motor
[trip_time]
type = ScalarVariable
variable = time_trip
execute_on = 'TIMESTEP_END'
[]
##########################
# Motor
##########################
[motor_torque]
type = RealComponentParameterValuePostprocessor
component = motor
parameter = torque
execute_on = 'INITIAL TIMESTEP_END'
[]
[motor_power]
type = FunctionValuePostprocessor
function = motor_power_fn
execute_on = 'INITIAL TIMESTEP_END'
[]
##########################
# generator
##########################
[generator_torque]
type = ShaftConnectedComponentPostprocessor
quantity = torque
shaft_connected_component_uo = generator:shaftconnected_uo
execute_on = 'INITIAL TIMESTEP_END'
[]
[generator_power]
type = FunctionValuePostprocessor
function = generator_power_fn
execute_on = 'INITIAL TIMESTEP_END'
[]
##########################
# Shaft
##########################
# Speed in rad/s
[shaft_speed]
type = ScalarVariable
variable = 'shaft:omega'
execute_on = 'INITIAL TIMESTEP_END'
[]
# speed in RPM
[shaft_RPM]
type = ParsedPostprocessor
pp_names = 'shaft_speed'
function = '(shaft_speed * 60) /( 2 * ${fparse pi})'
execute_on = 'INITIAL TIMESTEP_END'
[]
##########################
# Compressor
##########################
[comp_dissipation_torque]
type = ScalarVariable
variable = 'compressor:dissipation_torque'
execute_on = 'INITIAL TIMESTEP_END'
[]
[comp_isentropic_torque]
type = ScalarVariable
variable = 'compressor:isentropic_torque'
execute_on = 'INITIAL TIMESTEP_END'
[]
[comp_friction_torque]
type = ScalarVariable
variable = 'compressor:friction_torque'
execute_on = 'INITIAL TIMESTEP_END'
[]
[compressor_torque]
type = ParsedPostprocessor
pp_names = 'comp_dissipation_torque comp_isentropic_torque comp_friction_torque'
function = 'comp_dissipation_torque + comp_isentropic_torque + comp_friction_torque'
[]
[p_in_comp]
type = PointValue
variable = p
point = '${x1_out} ${y1} 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_out_comp]
type = PointValue
variable = p
point = '${x2_in} ${y2} 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_ratio_comp]
type = ParsedPostprocessor
pp_names = 'p_in_comp p_out_comp'
function = 'p_out_comp / p_in_comp'
execute_on = 'INITIAL TIMESTEP_END'
[]
[T_in_comp]
type = PointValue
variable = T
point = '${x1_out} ${y1} 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[T_out_comp]
type = PointValue
variable = T
point = '${x2_in} ${y2} 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[T_ratio_comp]
type = ParsedPostprocessor
pp_names = 'T_in_comp T_out_comp'
function = '(T_out_comp - T_in_comp) / T_out_comp'
execute_on = 'INITIAL TIMESTEP_END'
[]
[mfr_comp]
type = ADFlowJunctionFlux1Phase
boundary = pipe1:out
connection_index = 0
equation = mass
junction = compressor
[]
##########################
# turbine
##########################
[turb_dissipation_torque]
type = ScalarVariable
variable = 'turbine:dissipation_torque'
execute_on = 'INITIAL TIMESTEP_END'
[]
[turb_isentropic_torque]
type = ScalarVariable
variable = 'turbine:isentropic_torque'
execute_on = 'INITIAL TIMESTEP_END'
[]
[turb_friction_torque]
type = ScalarVariable
variable = 'turbine:friction_torque'
execute_on = 'INITIAL TIMESTEP_END'
[]
[turbine_torque]
type = ParsedPostprocessor
pp_names = 'turb_dissipation_torque turb_isentropic_torque turb_friction_torque'
function = 'turb_dissipation_torque + turb_isentropic_torque + turb_friction_torque'
[]
[p_in_turb]
type = PointValue
variable = p
point = '${x6_out} ${y6} 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_out_turb]
type = PointValue
variable = p
point = '${x7_in} ${y7} 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[p_ratio_turb]
type = ParsedPostprocessor
pp_names = 'p_in_turb p_out_turb'
function = 'p_in_turb / p_out_turb'
execute_on = 'INITIAL TIMESTEP_END'
[]
[T_in_turb]
type = PointValue
variable = T
point = '${x6_out} ${y6} 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[T_out_turb]
type = PointValue
variable = T
point = '${x7_in} ${y7} 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[mfr_turb]
type = ADFlowJunctionFlux1Phase
boundary = pipe6:out
connection_index = 0
equation = mass
junction = turbine
[]
##########################
# Recuperator
##########################
[cold_leg_in]
type = PointValue
variable = T
point = '${x3} ${cold_leg_in} 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[cold_leg_out]
type = PointValue
variable = T
point = '${x3} ${cold_leg_out} 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[hot_leg_in]
type = PointValue
variable = T
point = '${x8} ${hot_leg_in} 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[hot_leg_out]
type = PointValue
variable = T
point = '${x8} ${hot_leg_out} 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
##########################
# Reactor
##########################
[reactor_inlet]
type = PointValue
variable = T
point = '${x4} ${y4} 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[reactor_outlet]
type = PointValue
variable = T
point = '${x5} ${y5_in} 0'
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
end_time = ${t3}
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.01
growth_factor = 1.1
cutback_factor = 0.9
[]
dtmin = 1e-5
dtmax = 1000
steady_state_detection = true
steady_state_start_time = 200000
solve_type = NEWTON
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
nl_max_its = 15
l_tol = 1e-4
l_max_its = 10
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu '
[]
[Outputs]
[e]
type = Exodus
file_base = 'recuperated_brayton_cycle_out'
[]
[csv]
type = CSV
file_base = 'recuperated_brayton_cycle'
execute_vector_postprocessors_on = 'INITIAL'
[]
[console]
type = Console
show = 'shaft_speed p_ratio_comp p_ratio_turb compressor:pressure_ratio turbine:pressure_ratio'
[]
[]
(modules/porous_flow/examples/multiapp_fracture_flow/3dFracture/matrix_app.i)
# 3D matrix app doing thermo-hydro PorousFlow and receiving heat energy via a VectorPostprocessor from the 2D fracture App
[Mesh]
uniform_refine = 0
[generate]
type = GeneratedMeshGenerator
dim = 3
nx = 11
xmin = -10
xmax = 210
ny = 9
ymin = -10
ymax = 160
nz = 11
zmin = -10
zmax = 210
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Variables]
[matrix_P]
scaling = 1E6
[]
[matrix_T]
initial_condition = 473
[]
[]
[ICs]
[frac_P]
type = FunctionIC
variable = matrix_P
function = insitu_pp
[]
[]
[Functions]
[insitu_pp]
type = ParsedFunction
expression = '10 - 0.847E-2 * z' # Approximate hydrostatic in MPa
[]
[]
[PorousFlowFullySaturated]
coupling_type = ThermoHydro
porepressure = matrix_P
temperature = matrix_T
fp = water
gravity = '0 0 -9.81E-6' # Note the value, because of pressure_unit
pressure_unit = MPa
[]
[DiracKernels]
[heat_from_fracture]
type = ReporterPointSource
variable = matrix_T
value_name = heat_transfer_rate/transferred_joules_per_s
x_coord_name = heat_transfer_rate/x
y_coord_name = heat_transfer_rate/y
z_coord_name = heat_transfer_rate/z
[]
[]
[FluidProperties]
[water]
type = SimpleFluidProperties # this is largely irrelevant here since we care about heat conduction only
thermal_expansion = 0 # to prevent depressurization as the reservoir is cooled
[]
[]
[Materials]
[porosity]
type = PorousFlowPorosityConst
porosity = 1E-3 # small porosity of rock
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1E-18 0 0 0 1E-18 0 0 0 1E-18'
[]
[internal_energy]
type = PorousFlowMatrixInternalEnergy
density = 2700 # kg/m^3
specific_heat_capacity = 800 # rough guess at specific heat capacity
[]
[aq_thermal_conductivity]
type = PorousFlowThermalConductivityIdeal
dry_thermal_conductivity = '5 0 0 0 5 0 0 0 5'
[]
[]
[VectorPostprocessors]
[heat_transfer_rate]
type = ConstantVectorPostprocessor
vector_names = 'transferred_joules_per_s x y z'
value = '0; 0; 0; 0'
outputs = none
[]
[]
[AuxVariables]
[normal_thermal_conductivity]
family = MONOMIAL
order = CONSTANT
[]
[fracture_normal_x]
family = MONOMIAL
order = CONSTANT
initial_condition = 0
[]
[fracture_normal_y]
family = MONOMIAL
order = CONSTANT
initial_condition = 1
[]
[fracture_normal_z]
family = MONOMIAL
order = CONSTANT
initial_condition = 0
[]
[element_normal_length]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[normal_thermal_conductivity_auxk]
type = ConstantAux
variable = normal_thermal_conductivity
value = 5 # very simple in this case
[]
[element_normal_length_auxk]
type = PorousFlowElementLength
variable = element_normal_length
direction = 'fracture_normal_x fracture_normal_y fracture_normal_z'
[]
[]
[Preconditioning]
[entire_jacobian]
type = SMP
full = true
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
[TimeStepper]
type = IterationAdaptiveDT
dt = 1
growth_factor = 1.1
optimal_iterations = 4
[]
dtmax = 1E8
end_time = 1E8
nl_abs_tol = 1E-2
[]
[Outputs]
print_linear_residuals = false
exodus = false
[]
[MultiApps]
[fracture_app]
type = TransientMultiApp
input_files = fracture_only_aperture_changing.i
cli_args = 'Outputs/ex/sync_only=false'
execute_on = TIMESTEP_BEGIN
sub_cycling = true
### catch_up = true
### max_catch_up_steps = 100
[]
[]
[Transfers]
[element_normal_length_to_fracture]
type = MultiAppNearestNodeTransfer
to_multi_app = fracture_app
source_variable = element_normal_length
variable = enclosing_element_normal_length
[]
[element_normal_thermal_cond_to_fracture]
type = MultiAppNearestNodeTransfer
to_multi_app = fracture_app
source_variable = normal_thermal_conductivity
variable = enclosing_element_normal_thermal_cond
[]
[T_to_fracture]
type = MultiAppGeometricInterpolationTransfer
to_multi_app = fracture_app
source_variable = matrix_T
variable = transferred_matrix_T
[]
[normal_x_from_fracture]
type = MultiAppNearestNodeTransfer
from_multi_app = fracture_app
source_variable = normal_dirn_x
variable = fracture_normal_x
[]
[normal_y_from_fracture]
type = MultiAppNearestNodeTransfer
from_multi_app = fracture_app
source_variable = normal_dirn_y
variable = fracture_normal_y
[]
[normal_z_from_fracture]
type = MultiAppNearestNodeTransfer
from_multi_app = fracture_app
source_variable = normal_dirn_z
variable = fracture_normal_z
[]
[heat_from_fracture]
type = MultiAppReporterTransfer
from_multi_app = fracture_app
from_reporters = 'heat_transfer_rate/joules_per_s heat_transfer_rate/x heat_transfer_rate/y heat_transfer_rate/z'
to_reporters = 'heat_transfer_rate/transferred_joules_per_s heat_transfer_rate/x heat_transfer_rate/y heat_transfer_rate/z'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_velocity-action.i)
l = 10
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 10
ny = 5
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[Modules]
[NavierStokesFV]
compressibility = 'weakly-compressible'
add_energy_equation = true
add_scalar_equation = true
passive_scalar_names = 'scalar'
density = 'rho'
dynamic_viscosity = 'mu'
thermal_conductivity = 'k'
specific_heat = 'cp'
passive_scalar_diffusivity = 1.1
initial_velocity = '${inlet_velocity} 1e-15 0'
initial_temperature = '${inlet_temp}'
initial_pressure = '${outlet_pressure}'
initial_scalar_variables = 0.1
inlet_boundaries = 'left'
momentum_inlet_types = 'flux-velocity'
flux_inlet_pps = 'inlet_u'
energy_inlet_types = 'flux-velocity'
energy_inlet_function = 'inlet_T'
passive_scalar_inlet_types = 'flux-velocity'
passive_scalar_inlet_function = 'inlet_scalar_value'
wall_boundaries = 'top bottom'
momentum_wall_types = 'noslip noslip'
energy_wall_types = 'heatflux heatflux'
energy_wall_function = '0 0'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '${outlet_pressure}'
external_heat_source = 'power_density'
passive_scalar_source = 2.1
mass_advection_interpolation = 'average'
momentum_advection_interpolation = 'average'
energy_advection_interpolation = 'average'
[]
[]
[Postprocessors]
[inlet_u]
type = Receiver
default = ${inlet_velocity}
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
[]
[inlet_scalar_value]
type = Receiver
default = 0.2
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k mu'
prop_values = '${cp} ${k} ${mu}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T_fluid
pressure = pressure
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-2
optimal_iterations = 6
[]
end_time = 1
nl_abs_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
exodus = true
execute_on = FINAL
[]
(modules/combined/examples/phase_field-mechanics/grain_texture.i)
# This simulation predicts GB migration of 8 grains and outputs grain texture information
# Mesh adaptivity is not used so that the VectorPostprocessor's output will be uniform
# Time step adaptivity is used
# An AuxVariable is used to calculate the grain boundary locations
# Postprocessors are used to record time step
[Mesh]
# Mesh block. Meshes can be read in or automatically generated
type = GeneratedMesh
dim = 2 # Problem dimension
nx = 100 # Number of elements in the x-direction
ny = 100 # Number of elements in the y-direction
xmin = 0 # minimum x-coordinate of the mesh
xmax = 1000 # maximum x-coordinate of the mesh
ymin = 0 # minimum y-coordinate of the mesh
ymax = 1000 # maximum y-coordinate of the mesh
elem_type = QUAD4 # Type of elements used in the mesh
[]
[GlobalParams]
# Parameters used by several kernels that are defined globally to simplify input file
op_num = 8 # Number of order parameters used
var_name_base = gr # Base name of grains
grain_num = 8 #Number of grains
[]
[Variables]
# Variable block, where all variables in the simulation are declared
[./PolycrystalVariables]
[../]
[]
[UserObjects]
[./voronoi]
type = PolycrystalVoronoi
coloring_algorithm = bt
[../]
[./grain_tracker]
type = GrainTracker
threshold = 0.2
connecting_threshold = 0.08
[../]
[]
[ICs]
[./PolycrystalICs]
[./PolycrystalColoringIC]
polycrystal_ic_uo = voronoi
[../]
[../]
[]
[AuxVariables]
# Dependent variables
[./bnds]
# Variable used to visualize the grain boundaries in the simulation
order = FIRST
family = LAGRANGE
[../]
[./unique_grains]
order = CONSTANT
family = MONOMIAL
[../]
[./var_indices]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
# Kernel block, where the kernels defining the residual equations are set up.
[./PolycrystalKernel]
# Custom action creating all necessary kernels for grain growth. All input parameters are up in GlobalParams
[../]
[]
[AuxKernels]
# AuxKernel block, defining the equations used to calculate the auxvars
[./bnds_aux]
# AuxKernel that calculates the GB term
type = BndsCalcAux
variable = bnds
execute_on = timestep_end
[../]
[./unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
execute_on = timestep_end
flood_counter = grain_tracker
field_display = UNIQUE_REGION
[../]
[./var_indices]
type = FeatureFloodCountAux
variable = var_indices
execute_on = timestep_end
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
[../]
[]
[BCs]
# Boundary Condition block
[./Periodic]
[./top_bottom]
auto_direction = 'x y' # Makes problem periodic in the x and y directions
[../]
[../]
[]
[Materials]
[./CuGrGr]
# Material properties
type = GBEvolution # Quantitative material properties for copper grain growth. Dimensions are nm and ns
block = 0 # Block ID (only one block in this problem)
GBmob0 = 2.5e-6 #Mobility prefactor for Cu from Schonfelder1997
GBenergy = 0.708 # GB energy in J/m^2
Q = 0.23 #Activation energy for grain growth from Schonfelder 1997
T = 450 # K #Constant temperature of the simulation (for mobility calculation)
wGB = 14 # nm #Width of the diffuse GB
outputs = exodus
[../]
[]
[UserObjects]
[./euler_angle_file]
type = EulerAngleFileReader
file_name = grn_8_rand_2D.tex
[../]
[]
[VectorPostprocessors]
[./gbInfo]
type = GrainTextureVectorPostprocessor
unique_grains = unique_grains
euler_angle_provider = euler_angle_file
sort_by = id # sort output by elem id
[../]
[]
[Executioner]
type = Transient # Type of executioner, here it is transient with an adaptive time step
scheme = bdf2 # Type of time integration (2nd order backward euler), defaults to 1st order backward euler
#Preconditioned JFNK (default)
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart -mat_mffd_type'
petsc_options_value = 'hypre boomeramg 101 ds'
l_max_its = 30 # Max number of linear iterations
l_tol = 1e-4 # Relative tolerance for linear solves
nl_max_its = 40 # Max number of nonlinear iterations
nl_abs_tol = 1e-11 # Relative tolerance for nonlinear solves
nl_rel_tol = 1e-10 # Absolute tolerance for nonlinear solves
start_time = 0.0
num_steps = 50
[./TimeStepper]
type = IterationAdaptiveDT
dt = 25 # Initial time step. In this simulation it changes.
optimal_iterations = 6 # Time step will adapt to maintain this number of nonlinear iterations
[../]
[]
[Outputs]
execute_on = 'INITIAL TIMESTEP_END'
exodus = true
csv = true
perf_graph = true
[./console]
type = Console
max_rows = 20
[../]
[]
(modules/solid_mechanics/test/tests/umat/time_step/elastic_timestep.i)
# Testing the UMAT Interface - linear elastic model using the large strain formulation.
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 3
xmin = -0.5
xmax = 0.5
ymin = -0.5
ymax = 0.5
zmin = -0.5
zmax = 0.5
[]
[]
[Functions]
[top_pull]
type = ParsedFunction
expression = t/100
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
add_variables = true
strain = FINITE
[]
[]
[BCs]
[y_pull_function]
type = FunctionDirichletBC
variable = disp_y
boundary = top
function = top_pull
[]
[x_bot]
type = DirichletBC
variable = disp_x
boundary = left
value = 0.0
[]
[y_bot]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[]
[z_bot]
type = DirichletBC
variable = disp_z
boundary = front
value = 0.0
[]
[]
[Materials]
[umat]
type = AbaqusUMATStress
constant_properties = '1000 0.3'
plugin = '../../../plugins/elastic_timestep'
num_state_vars = 0
use_one_based_indexing = true
[]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options = '-snes_ksp_ew'
petsc_options_iname = '-ksp_gmres_restart'
petsc_options_value = '101'
line_search = 'none'
l_max_its = 100
nl_max_its = 100
nl_rel_tol = 1e-12
nl_abs_tol = 1e-10
l_tol = 1e-9
start_time = 0.0
end_time = 30
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 30
iteration_window = 9
growth_factor = 2.0
cutback_factor = 1.0
timestep_limiting_postprocessor = matl_ts_min
dt = 1.0
[]
[]
[UserObjects]
[time_step_size]
type = TimestepSize
execute_on = 'INITIAL LINEAR'
[]
[terminator_umat]
type = Terminator
expression = 'time_step_size > matl_ts_min'
fail_mode = SOFT
execute_on = 'FINAL'
[]
[]
[Postprocessors]
[matl_ts_min]
type = MaterialTimeStepPostprocessor
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Outputs]
exodus = true
[]
(modules/combined/examples/phase_field-mechanics/poly_grain_growth_2D_eldrforce.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 20
nz = 0
xmax = 1000
ymax = 1000
zmax = 0
elem_type = QUAD4
uniform_refine = 2
[]
[GlobalParams]
op_num = 8
var_name_base = gr
grain_num = 36
[]
[Variables]
[./PolycrystalVariables]
[../]
[./disp_x]
order = FIRST
family = LAGRANGE
[../]
[./disp_y]
order = FIRST
family = LAGRANGE
[../]
[]
[UserObjects]
[./euler_angle_file]
type = EulerAngleFileReader
file_name = grn_36_rand_2D.tex
[../]
[./voronoi]
type = PolycrystalVoronoi
coloring_algorithm = bt
[../]
[./grain_tracker]
type = GrainTrackerElasticity
threshold = 0.2
compute_var_to_feature_map = true
execute_on = 'initial timestep_begin'
flood_entity_type = ELEMENTAL
C_ijkl = '1.27e5 0.708e5 0.708e5 1.27e5 0.708e5 1.27e5 0.7355e5 0.7355e5 0.7355e5'
fill_method = symmetric9
euler_angle_provider = euler_angle_file
[../]
[]
[ICs]
[./PolycrystalICs]
[./PolycrystalColoringIC]
polycrystal_ic_uo = voronoi
[../]
[../]
[]
[AuxVariables]
[./bnds]
order = FIRST
family = LAGRANGE
[../]
[./elastic_strain11]
order = CONSTANT
family = MONOMIAL
[../]
[./elastic_strain22]
order = CONSTANT
family = MONOMIAL
[../]
[./elastic_strain12]
order = CONSTANT
family = MONOMIAL
[../]
[./unique_grains]
order = CONSTANT
family = MONOMIAL
[../]
[./var_indices]
order = CONSTANT
family = MONOMIAL
[../]
[./vonmises_stress]
order = CONSTANT
family = MONOMIAL
[../]
[./C1111]
order = CONSTANT
family = MONOMIAL
[../]
[./euler_angle]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./PolycrystalKernel]
[../]
[./PolycrystalElasticDrivingForce]
[../]
[./TensorMechanics]
use_displaced_mesh = true
displacements = 'disp_x disp_y'
[../]
[]
[AuxKernels]
[./BndsCalc]
type = BndsCalcAux
variable = bnds
execute_on = timestep_end
[../]
[./elastic_strain11]
type = RankTwoAux
variable = elastic_strain11
rank_two_tensor = elastic_strain
index_i = 0
index_j = 0
execute_on = timestep_end
[../]
[./elastic_strain22]
type = RankTwoAux
variable = elastic_strain22
rank_two_tensor = elastic_strain
index_i = 1
index_j = 1
execute_on = timestep_end
[../]
[./elastic_strain12]
type = RankTwoAux
variable = elastic_strain12
rank_two_tensor = elastic_strain
index_i = 0
index_j = 1
execute_on = timestep_end
[../]
[./unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
execute_on = timestep_end
flood_counter = grain_tracker
field_display = UNIQUE_REGION
[../]
[./var_indices]
type = FeatureFloodCountAux
variable = var_indices
execute_on = timestep_end
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
[../]
[./C1111]
type = RankFourAux
variable = C1111
rank_four_tensor = elasticity_tensor
index_l = 0
index_j = 0
index_k = 0
index_i = 0
execute_on = timestep_end
[../]
[./vonmises_stress]
type = RankTwoScalarAux
variable = vonmises_stress
rank_two_tensor = stress
scalar_type = VonMisesStress
execute_on = timestep_end
[../]
[./euler_angle]
type = OutputEulerAngles
variable = euler_angle
euler_angle_provider = euler_angle_file
grain_tracker = grain_tracker
output_euler_angle = 'phi1'
execute_on = 'initial timestep_end'
[../]
[]
[BCs]
[./Periodic]
[./All]
auto_direction = 'x'
variable = 'gr0 gr1 gr2 gr3 gr4 gr5 gr6 gr7'
[../]
[../]
[./top_displacement]
type = DirichletBC
variable = disp_y
boundary = top
value = -50.0
[../]
[./x_anchor]
type = DirichletBC
variable = disp_x
boundary = 'left right'
value = 0.0
[../]
[./y_anchor]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[../]
[]
[Materials]
[./Copper]
type = GBEvolution
block = 0
T = 500 # K
wGB = 15 # nm
GBmob0 = 2.5e-6 # m^4/(Js) from Schoenfelder 1997
Q = 0.23 # Migration energy in eV
GBenergy = 0.708 # GB energy in J/m^2
[../]
[./ElasticityTensor]
type = ComputePolycrystalElasticityTensor
grain_tracker = grain_tracker
[../]
[./strain]
type = ComputeSmallStrain
block = 0
displacements = 'disp_x disp_y'
[../]
[./stress]
type = ComputeLinearElasticStress
block = 0
[../]
[]
[Postprocessors]
[./ngrains]
type = FeatureFloodCount
variable = bnds
threshold = 0.7
[../]
[./dofs]
type = NumDOFs
[../]
[./dt]
type = TimestepSize
[../]
[./run_time]
type = PerfGraphData
section_name = "Root"
data_type = total
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
coupled_groups = 'disp_x,disp_y'
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart -pc_hypre_boomeramg_strong_threshold'
petsc_options_value = 'hypre boomeramg 31 0.7'
l_tol = 1.0e-4
l_max_its = 30
nl_max_its = 25
nl_rel_tol = 1.0e-7
start_time = 0.0
num_steps = 50
[./TimeStepper]
type = IterationAdaptiveDT
dt = 1.5
growth_factor = 1.2
cutback_factor = 0.8
optimal_iterations = 8
[../]
[./Adaptivity]
initial_adaptivity = 2
refine_fraction = 0.8
coarsen_fraction = 0.05
max_h_level = 3
[../]
[]
[Outputs]
file_base = poly36_grtracker
exodus = true
[]
(modules/porous_flow/examples/natural_convection/natural_convection.i)
# Example problem: Elder, Transient convection in a porous mediu, 1967
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 64
ny = 32
xmin = 0
xmax = 300
ymax = 0
ymin = -150
[]
[heater]
type = ParsedGenerateSideset
input = gen
combinatorial_geometry = 'x <= 150 & y = -150'
new_sideset_name = heater
[]
uniform_refine = 1
[]
[Variables]
[porepressure]
[]
[T]
initial_condition = 285
[]
[]
[AuxVariables]
[density]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[density]
type = PorousFlowPropertyAux
variable = density
property = density
execute_on = TIMESTEP_END
[]
[]
[ICs]
[hydrostatic]
type = FunctionIC
variable = porepressure
function = '1e5 - 9.81 * 1000 * y'
[]
[]
[GlobalParams]
PorousFlowDictator = 'dictator'
gravity = '0 -9.81 0'
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[PorousFlowFullySaturated]
coupling_type = ThermoHydro
porepressure = porepressure
temperature = T
fp = water
[]
[Materials]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.1
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1.21E-10 0 0 0 1.21E-10 0 0 0 1.21E-10'
[]
[Matrix_internal_energy]
type = PorousFlowMatrixInternalEnergy
density = 2500
specific_heat_capacity = 0
[]
[thermal_conductivity]
type = PorousFlowThermalConductivityIdeal
dry_thermal_conductivity = '1.5 0 0 0 1.5 0 0 0 0'
[]
[]
[BCs]
[t_bot]
type = DirichletBC
variable = T
value = 293
boundary = 'heater'
[]
[t_top]
type = DirichletBC
variable = T
value = 285
boundary = 'top'
[]
[p_top]
type = DirichletBC
variable = porepressure
value = 1e5
boundary = top
[]
[]
[Preconditioning]
[basic]
type = SMP
full = true
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
petsc_options_value = ' asm lu NONZERO 2'
[]
[]
[Executioner]
type = Transient
end_time = 63072000
dtmax = 1e6
nl_rel_tol = 1e-6
[TimeStepper]
type = IterationAdaptiveDT
dt = 1000
[]
[Adaptivity]
interval = 1
refine_fraction = 0.2
coarsen_fraction = 0.3
max_h_level = 4
[]
[]
[Outputs]
exodus = true
[]
# If you uncomment this it will print out all the kernels and materials that the PorousFlowFullySaturated action generates
#[Problem]
# type = DumpObjectsProblem
# dump_path = PorousFlowFullySaturated
#[]
(modules/porous_flow/examples/lava_lamp/2phase_convection.i)
# Two phase density-driven convection of dissolved CO2 in brine
#
# Initially, the model has a gas phase at the top with a saturation of 0.29
# (which corresponds to an initial value of zi = 0.2).
# Diffusion of the dissolved CO2
# component from the saturated liquid to the unsaturated liquid below reduces the
# amount of CO2 in the gas phase. As the density of the CO2-saturated brine is greater
# than the unsaturated brine, a gravitational instability arises and density-driven
# convection of CO2-rich fingers descend into the unsaturated brine.
#
# The instability is seeded by a random perturbation to the porosity field.
# Mesh adaptivity is used to refine the mesh as the fingers form.
#
# Note: this model is computationally expensive, so should be run with multiple cores,
# preferably on a cluster.
[GlobalParams]
PorousFlowDictator = 'dictator'
gravity = '0 -9.81 0'
[]
[Adaptivity]
max_h_level = 2
marker = marker
initial_marker = initial
initial_steps = 2
[Indicators]
[indicator]
type = GradientJumpIndicator
variable = zi
[]
[]
[Markers]
[marker]
type = ErrorFractionMarker
indicator = indicator
refine = 0.8
[]
[initial]
type = BoxMarker
bottom_left = '0 1.95 0'
top_right = '2 2 0'
inside = REFINE
outside = DO_NOTHING
[]
[]
[]
[Mesh]
type = GeneratedMesh
dim = 2
ymax = 2
xmax = 2
ny = 40
nx = 40
bias_y = 0.95
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = pgas
[]
[flux0]
type = PorousFlowAdvectiveFlux
fluid_component = 0
variable = pgas
[]
[diff0]
type = PorousFlowDispersiveFlux
fluid_component = 0
variable = pgas
disp_long = '0 0'
disp_trans = '0 0'
[]
[mass1]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = zi
[]
[flux1]
type = PorousFlowAdvectiveFlux
fluid_component = 1
variable = zi
[]
[diff1]
type = PorousFlowDispersiveFlux
fluid_component = 1
variable = zi
disp_long = '0 0'
disp_trans = '0 0'
[]
[]
[AuxVariables]
[xnacl]
initial_condition = 0.01
[]
[saturation_gas]
order = FIRST
family = MONOMIAL
[]
[xco2l]
order = FIRST
family = MONOMIAL
[]
[density_liquid]
order = FIRST
family = MONOMIAL
[]
[porosity]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[saturation_gas]
type = PorousFlowPropertyAux
variable = saturation_gas
property = saturation
phase = 1
execute_on = 'timestep_end'
[]
[xco2l]
type = PorousFlowPropertyAux
variable = xco2l
property = mass_fraction
phase = 0
fluid_component = 1
execute_on = 'timestep_end'
[]
[density_liquid]
type = PorousFlowPropertyAux
variable = density_liquid
property = density
phase = 0
execute_on = 'timestep_end'
[]
[]
[Variables]
[pgas]
[]
[zi]
scaling = 1e4
[]
[]
[ICs]
[pressure]
type = FunctionIC
function = 10e6-9.81*1000*y
variable = pgas
[]
[zi]
type = BoundingBoxIC
variable = zi
x1 = 0
x2 = 2
y1 = 1.95
y2 = 2
inside = 0.2
outside = 0
[]
[porosity]
type = RandomIC
variable = porosity
min = 0.25
max = 0.275
seed = 0
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pgas zi'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureConst
pc = 0
[]
[fs]
type = PorousFlowBrineCO2
brine_fp = brine
co2_fp = co2
capillary_pressure = pc
[]
[]
[FluidProperties]
[co2sw]
type = CO2FluidProperties
[]
[co2]
type = TabulatedBicubicFluidProperties
fp = co2sw
[]
[brine]
type = BrineFluidProperties
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = '45'
[]
[brineco2]
type = PorousFlowFluidState
gas_porepressure = 'pgas'
z = 'zi'
temperature_unit = Celsius
xnacl = 'xnacl'
capillary_pressure = pc
fluid_state = fs
[]
[porosity]
type = PorousFlowPorosityConst
porosity = porosity
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-11 0 0 0 1e-11 0 0 0 1e-11'
[]
[relperm_water]
type = PorousFlowRelativePermeabilityCorey
phase = 0
n = 2
s_res = 0.1
sum_s_res = 0.2
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityCorey
phase = 1
n = 2
s_res = 0.1
sum_s_res = 0.2
[]
[diffusivity]
type = PorousFlowDiffusivityConst
diffusion_coeff = '2e-9 2e-9 2e-9 2e-9'
tortuosity = '1 1'
[]
[]
[Preconditioning]
active = basic
[mumps_is_best_for_parallel_jobs]
type = SMP
full = true
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = ' lu mumps'
[]
[basic]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
petsc_options_value = 'gmres asm lu NONZERO 2 '
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 1e6
nl_max_its = 25
l_max_its = 100
dtmax = 1e4
nl_abs_tol = 1e-6
[TimeStepper]
type = IterationAdaptiveDT
dt = 10
growth_factor = 2
cutback_factor = 0.5
[]
[]
[Functions]
[flux]
type = ParsedFunction
symbol_values = 'delta_xco2 dt'
symbol_names = 'dx dt'
expression = 'dx/dt'
[]
[]
[Postprocessors]
[total_co2_in_gas]
type = PorousFlowFluidMass
phase = 1
fluid_component = 1
[]
[total_co2_in_liquid]
type = PorousFlowFluidMass
phase = 0
fluid_component = 1
[]
[numdofs]
type = NumDOFs
[]
[delta_xco2]
type = ChangeOverTimePostprocessor
postprocessor = total_co2_in_liquid
[]
[dt]
type = TimestepSize
[]
[flux]
type = FunctionValuePostprocessor
function = flux
[]
[]
[Outputs]
print_linear_residuals = false
perf_graph = true
exodus = true
csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_mdot-action.i)
l = 10
inlet_area = 1
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 10
ny = 5
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[Modules]
[NavierStokesFV]
compressibility = 'weakly-compressible'
add_energy_equation = true
add_scalar_equation = true
passive_scalar_names = 'scalar'
density = 'rho'
dynamic_viscosity = 'mu'
thermal_conductivity = 'k'
specific_heat = 'cp'
passive_scalar_diffusivity = 1.1
initial_velocity = '${inlet_velocity} 1e-15 0'
initial_temperature = '${inlet_temp}'
initial_pressure = '${outlet_pressure}'
initial_scalar_variables = 0.1
inlet_boundaries = 'left'
momentum_inlet_types = 'flux-mass'
flux_inlet_pps = 'inlet_mdot'
energy_inlet_types = 'flux-mass'
energy_inlet_function = 'inlet_T'
passive_scalar_inlet_types = 'flux-mass'
passive_scalar_inlet_function = 'inlet_scalar_value'
wall_boundaries = 'top bottom'
momentum_wall_types = 'noslip noslip'
energy_wall_types = 'heatflux heatflux'
energy_wall_function = '0 0'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '${outlet_pressure}'
external_heat_source = 'power_density'
passive_scalar_source = 2.1
mass_advection_interpolation = 'average'
momentum_advection_interpolation = 'average'
energy_advection_interpolation = 'average'
[]
[]
[Postprocessors]
[inlet_mdot]
type = Receiver
default = ${fparse 1980 * inlet_velocity * inlet_area}
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
[]
[inlet_scalar_value]
type = Receiver
default = 0.2
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k mu'
prop_values = '${cp} ${k} ${mu}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T_fluid
pressure = pressure
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-2
optimal_iterations = 6
[]
end_time = 1
nl_abs_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
exodus = true
execute_on = FINAL
[]
(modules/porous_flow/examples/restart/gravityeq.i)
# Initial run to establish gravity equilibrium. As only brine is present (no gas),
# we can use the single phase equation of state and kernels, reducing the computational
# cost. An estimate of the hydrostatic pressure gradient is used as the initial condition
# using an approximate brine density of 1060 kg/m^3.
# The end time is set to a large value (~100 years) to allow the pressure to reach
# equilibrium. Steady state detection is used to halt the run when a steady state is reached.
[Mesh]
type = GeneratedMesh
dim = 2
ny = 10
nx = 10
ymax = 100
xmax = 5000
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 -9.81 0'
temperature_unit = Celsius
[]
[Variables]
[porepressure]
[]
[]
[ICs]
[porepressure]
type = FunctionIC
function = ppic
variable = porepressure
[]
[]
[Functions]
[ppic]
type = ParsedFunction
expression = '10e6 + 1060*9.81*(100-y)'
[]
[]
[BCs]
[top]
type = DirichletBC
variable = porepressure
value = 10e6
boundary = top
[]
[]
[AuxVariables]
[temperature]
initial_condition = 50
[]
[xnacl]
initial_condition = 0.1
[]
[brine_density]
family = MONOMIAL
order = CONSTANT
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
variable = porepressure
[]
[flux0]
type = PorousFlowFullySaturatedDarcyFlow
variable = porepressure
[]
[]
[AuxKernels]
[brine_density]
type = PorousFlowPropertyAux
property = density
variable = brine_density
execute_on = 'initial timestep_end'
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = porepressure
number_fluid_phases = 1
number_fluid_components = 1
[]
[]
[FluidProperties]
[brine]
type = BrineFluidProperties
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = temperature
[]
[ps]
type = PorousFlow1PhaseFullySaturated
porepressure = porepressure
[]
[massfrac]
type = PorousFlowMassFraction
[]
[brine]
type = PorousFlowBrine
compute_enthalpy = false
compute_internal_energy = false
xnacl = xnacl
phase = 0
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.1
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-13 0 0 0 1e-13 0 0 0 1e-13'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 3e9
nl_abs_tol = 1e-12
nl_rel_tol = 1e-06
steady_state_detection = true
steady_state_tolerance = 1e-12
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e1
[]
[]
[Outputs]
execute_on = 'initial timestep_end'
exodus = true
perf_graph = true
[]
(test/tests/mesh/preparedness/test.i)
[GlobalParams]
prevent_boundary_ids_overlap = false
[]
[Mesh]
[region_2_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.065 0.13 0.305 0.17 0.196'
ix = ' 2 2 2 2 2'
dy = '0.85438 '
iy = '6'
subdomain_id = '68 68 68 68 68'
[]
[region_2_move]
type = TransformGenerator
transform = TRANSLATE
vector_value = '1.2 1.551 0'
input = region_2_gen
[]
[region_3_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.24 0.24 0.24 0.24 0.24'
ix = ' 2 2 2 2 2'
dy = '0.744166666666666 0.744166666666667 0.744166666666667'
iy = ' 2 2 2'
subdomain_id = '56 57 58 59 60
51 52 53 54 55
46 47 48 49 50'
[]
[region_3_move]
type = TransformGenerator
transform = TRANSLATE
vector_value = '0 2.40538 0'
input = region_3_gen
[]
[region_1_gen]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 6
xmin = 0
xmax = 0.26
ymin = 1.551
ymax = 1.851
subdomain_ids = '62 62 62 62 62 62 62 62 62 62
62 62 62 62 62 62 62 62 62 62
62 62 62 62 62 62 62 62 62 62
62 62 62 62 62 62 62 62 62 62
62 62 62 62 62 62 62 62 62 62
62 62 62 62 62 62 62 62 62 62'
[]
[region_1_extend_1]
type = FillBetweenSidesetsGenerator
input_mesh_1 = 'region_3_move'
input_mesh_2 = 'region_1_gen'
boundary_1 = '0'
boundary_2 = '2'
num_layers = 6
block_id= 61
use_quad_elements = true
keep_inputs = true
begin_side_boundary_id = '3'
end_side_boundary_id = '1'
[]
[region_1_extend_2]
type = FillBetweenSidesetsGenerator
input_mesh_1 = 'region_2_move'
input_mesh_2 = 'region_1_gen'
boundary_1 = 3
boundary_2 = 1
num_layers = 6
block_id= 69
use_quad_elements = true
keep_inputs = false
begin_side_boundary_id = '0'
end_side_boundary_id = '3'
input_boundary_1_id = '1'
input_boundary_2_id = '3'
[]
[region_2_2_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.065 0.13 0.305 0.17 0.196'
ix = ' 2 2 2 2 2'
dy = '0.85438 '
iy = '6'
subdomain_id = '68 68 68 68 68'
[]
[region_2_2_move]
type = TransformGenerator
transform = TRANSLATE
vector_value = '1.2 1.551 0'
input = region_2_2_gen
[]
[region_6_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.26 0.94 0.065 0.13 0.305 0.17 0.196'
ix = '10 6 2 2 2 2 2'
dy = '0.584 0.967'
iy = ' 4 6'
subdomain_id = '62 72 72 72 72 72 72
62 70 71 71 71 71 71'
[]
[stitch_1_2_6]
type = StitchedMeshGenerator
inputs = 'region_1_extend_1 region_1_extend_2 region_2_2_move region_6_gen'
stitch_boundaries_pairs = '1 3;
1 3;
0 2'
[]
[rename_boundary_stitch_1_2_6]
type = RenameBoundaryGenerator
input = stitch_1_2_6
old_boundary = '1'
new_boundary = '2'
[]
[region_4_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.065 0.13'
ix = ' 2 2 '
dy = '0.744166666666666 0.744166666666667 0.744166666666667'
iy = ' 2 2 2'
subdomain_id = '78 92
78 91
78 90'
[]
[region_4_move]
type = TransformGenerator
transform = TRANSLATE
vector_value = '1.2 2.40538 0'
input = region_4_gen
[]
[region_5_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.17 0.196'
ix = '2 2'
dy = '0.39 1.8425'
iy = '2 4'
subdomain_id = '100 104
100 104'
[]
[region_5_move]
type = TransformGenerator
transform = TRANSLATE
vector_value = '1.7 2.40538 0'
input = region_5_gen
[]
[region_5_extend]
type = FillBetweenSidesetsGenerator
input_mesh_1 = 'region_4_move'
input_mesh_2 = 'region_5_move'
boundary_1 = 1
boundary_2 = 3
num_layers = 2
block_id= 96
use_quad_elements = true
keep_inputs = true
begin_side_boundary_id = '0'
end_side_boundary_id = '2'
[]
[rename_boundary_region_5]
type = RenameBoundaryGenerator
input = region_5_extend
old_boundary = '0'
new_boundary = '3'
[]
[stitch_1_2_6_5]
type = StitchedMeshGenerator
inputs = 'rename_boundary_stitch_1_2_6 rename_boundary_region_5'
stitch_boundaries_pairs = '2 3;'
[]
[region_7_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.24 0.24 0.24 0.24 0.24 0.065 0.13 0.305 0.17 0.196'
ix = ' 2 2 2 2 2 2 2 2 2 2'
dy = '0.744166666666667 0.744166666666667 0.744166666666667 0.744166666666667
0.744166666666667 0.744166666666667 0.744166666666666 0.744166666666666
0.744166666666666 0.458 0.86002'
iy = '2 2 2 2 2 2 2 2 2 2 4'
subdomain_id = '41 42 43 44 45 77 89 95 99 103
36 37 38 39 40 77 88 95 99 103
31 32 33 34 35 77 87 95 99 103
26 27 28 29 30 76 86 94 98 102
21 22 23 24 25 76 85 94 98 102
16 17 18 19 20 76 84 94 98 102
11 12 13 14 15 75 83 93 97 101
6 7 8 9 10 75 82 93 97 101
1 2 3 4 5 75 81 93 97 101
67 67 67 67 67 74 80 65 65 66
63 63 63 63 63 73 79 64 64 64'
[]
[region_7_move]
type = TransformGenerator
transform = TRANSLATE
vector_value = '0.0 4.63788 0'
input = region_7_gen
[]
[stitch]
type = StitchedMeshGenerator
inputs = 'stitch_1_2_6_5 region_7_move'
stitch_boundaries_pairs = '2 0'
[]
[rename_boundary_1]
type = BoundaryDeletionGenerator
input = stitch
boundary_names = '0 1 2 3'
[]
[rename_boundary_2]
type = SideSetsFromPointsGenerator
input = rename_boundary_1
new_boundary = '2 4 1 3'
points = '1.2 0. 0.
2.066 1.551 0.
1.2 12.6534 0.
0. 1.551 0.'
[]
[rename_boundary_3]
type = RenameBoundaryGenerator
input = rename_boundary_2
new_boundary = 'rbottom ssright rtop ssleft'
old_boundary = '2 4 1 3'
[]
[rename_blocks]
type = RenameBlockGenerator
input = rename_boundary_3
old_block = '1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
101 102 103 104'
new_block = 'pbedfuel001 pbedfuel002 pbedfuel003 pbedfuel004 pbedfuel005
pbedfuel006 pbedfuel007 pbedfuel008 pbedfuel009 pbedfuel010
pbedfuel011 pbedfuel012 pbedfuel013 pbedfuel014 pbedfuel015
pbedfuel016 pbedfuel017 pbedfuel018 pbedfuel019 pbedfuel020
pbedfuel021 pbedfuel022 pbedfuel023 pbedfuel024 pbedfuel025
pbedfuel026 pbedfuel027 pbedfuel028 pbedfuel029 pbedfuel030
pbedfuel031 pbedfuel032 pbedfuel033 pbedfuel034 pbedfuel035
pbedfuel036 pbedfuel037 pbedfuel038 pbedfuel039 pbedfuel040
pbedfuel041 pbedfuel042 pbedfuel043 pbedfuel044 pbedfuel045
pbedfuel046 pbedfuel047 pbedfuel048 pbedfuel049 pbedfuel050
pbedfuel051 pbedfuel052 pbedfuel053 pbedfuel054 pbedfuel055
pbedfuel056 pbedfuel057 pbedfuel058 pbedfuel059 pbedfuel060
consfuel061 dischfuel062 upref063 upref064 upref065 upref066
upcvt067 lwref068 outch069 lwrpln070 htleg071 lwref072 buffr073
buffr074 buffr075 buffr076 buffr077 buffr078 crds079 crds080
crds081 crds082 crds083 crds084 crds085 crds086 crds087 crds088
crds089 crds090 crds091 crds092 radrf093 radrf094 radrf095 radrf096
risr097 risr098 risr099 risr100 radrf101 radrf102 radrf103 radrf104'
[]
[]
[Variables]
[T_solid]
type = MooseVariableFVReal
initial_condition = 100
[]
[]
[FVKernels]
[energy_storage]
type = FVTimeKernel
variable = T_solid
[]
[solid_energy_diffusion_core]
type = FVAnisotropicDiffusion
variable = T_solid
coeff = 'effective_thermal_conductivity'
[]
[]
[FVBCs]
[side_set_bc1]
type = FVDirichletBC
variable = T_solid
value = '300'
boundary = 'rtop'
[]
[side_set_bc2]
type = FVDirichletBC
variable = T_solid
value = '600'
boundary = 'rbottom'
[]
[]
[Materials]
[all_channels_porosity]
type = ADGenericFunctorMaterial
prop_names = 'porosity'
prop_values = 0.5
[]
[solid_blocks_full_density_graphite]
type = ADGenericFunctorMaterial
prop_names = 'rho_s cp_s k_s '
prop_values = '1.0 2.0 3.0'
[]
[effective_solid_thermal_conductivity_solid_only]
type = ADGenericVectorFunctorMaterial
prop_names = 'effective_thermal_conductivity'
prop_values = 'k_s k_s k_s'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_factor_shift_type'
petsc_options_value = 'lu 100 NONZERO'
# Tolerances.
nl_abs_tol = 1e-8
nl_rel_tol = 1e-9
line_search = none
nl_max_its = 15
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.05
cutback_factor = 0.5
growth_factor = 2.00
optimal_iterations = 6
[]
# Steady state detection.
steady_state_detection = true
steady_state_tolerance = 1e-13
abort_on_solve_fail = true
num_steps = 1
[]
[Outputs]
exodus = true
print_linear_residuals = false
print_linear_converged_reason = false
print_nonlinear_converged_reason = false
[]
(modules/navier_stokes/test/tests/finite_element/ins/scalar_adr/supg/2d_advection_error_testing.i)
ax=1
ay=1
[GlobalParams]
u = ${ax}
v = ${ay}
pressure = 0
tau_type = mod
transient_term = true
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
xmax = 1
ymax = 1
elem_type = QUAD9
[]
[Variables]
[./c]
family = LAGRANGE
order = SECOND
[../]
[]
[Kernels]
[./adv]
type = AdvectionSUPG
variable = c
forcing_func = 'ffn'
[../]
[]
[BCs]
[./all]
type = FunctionDirichletBC
variable = c
boundary = 'left right top bottom'
function = 'c_func'
[../]
[]
[Materials]
[./mat]
type = GenericConstantMaterial
prop_names = 'mu rho'
prop_values = '0 1'
[../]
[]
[Functions]
[./ffn]
type = ParsedFunction
expression = '${ax}*(0.14*pi*y*cos(0.2*pi*x*y) + 0.2*pi*cos(0.5*pi*x)) + ${ay}*(0.14*pi*x*cos(0.2*pi*x*y) + 0.4*pi*cos(pi*y))'
[../]
[./c_func]
type = ParsedFunction
expression = '0.4*sin(0.5*pi*x) + 0.4*sin(pi*y) + 0.7*sin(0.2*pi*x*y) + 0.5'
[../]
[./cx_func]
type = ParsedFunction
expression = '0.14*pi*y*cos(0.2*pi*x*y) + 0.2*pi*cos(0.5*pi*x)'
[../]
[]
# [Executioner]
# type = Steady
# petsc_options_iname = '-pc_type -pc_factor_shift_type'
# petsc_options_value = 'lu NONZERO'
# []
[Executioner]
type = Transient
num_steps = 10
petsc_options = '-snes_converged_reason -ksp_converged_reason -snes_view'
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu NONZERO superlu_dist'
line_search = 'none'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-12
nl_max_its = 10
l_tol = 1e-6
l_max_its = 10
[./TimeStepper]
dt = .05
type = IterationAdaptiveDT
cutback_factor = 0.4
growth_factor = 1.2
optimal_iterations = 20
[../]
[]
[Outputs]
[./exodus]
type = Exodus
[../]
[./csv]
type = CSV
[../]
[]
[Postprocessors]
[./L2c]
type = ElementL2Error
variable = c
function = c_func
outputs = 'console' execute_on = 'timestep_end'
[../]
[./L2cx]
type = ElementL2Error
variable = cx
function = cx_func
outputs = 'console' execute_on = 'timestep_end'
[../]
[]
[AuxVariables]
[./cx]
family = MONOMIAL
order = FIRST
[../]
[]
[AuxKernels]
[./cx_aux]
type = VariableGradientComponent
component = x
variable = cx
gradient_variable = c
[../]
[]
(modules/phase_field/examples/anisotropic_interfaces/GrandPotentialSolidification.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 28
ny = 28
xmin = -7
xmax = 7
ymin = -7
ymax = 7
uniform_refine = 2
[]
[GlobalParams]
radius = 0.2
int_width = 0.1
x1 = 0.0
y1 = 0.0
derivative_order = 2
[]
[Variables]
[./w]
[../]
[./etaa0]
[../]
[./etab0]
[../]
[./T]
[../]
[]
[AuxVariables]
[./bnds]
[../]
[]
[AuxKernels]
[./bnds]
type = BndsCalcAux
variable = bnds
v = 'etaa0 etab0'
[../]
[]
[ICs]
[./w]
type = SmoothCircleIC
variable = w
# note w = A*(c-cleq), A = 1.0, cleq = 0.0 ,i.e., w = c (in the matrix/liquid phase)
outvalue = -4.0
invalue = 0.0
[../]
[./etaa0]
type = SmoothCircleIC
variable = etaa0
#Solid phase
outvalue = 0.0
invalue = 1.0
[../]
[./etab0]
type = SmoothCircleIC
variable = etab0
#Liquid phase
outvalue = 1.0
invalue = 0.0
[../]
[]
[Kernels]
# Order parameter eta_alpha0
[./ACa0_bulk]
type = ACGrGrMulti
variable = etaa0
v = 'etab0'
gamma_names = 'gab'
[../]
[./ACa0_sw]
type = ACSwitching
variable = etaa0
Fj_names = 'omegaa omegab'
hj_names = 'ha hb'
coupled_variables = 'etab0 w T'
[../]
[./ACa0_int1]
type = ACInterface2DMultiPhase1
variable = etaa0
etas = 'etab0'
kappa_name = kappaa
dkappadgrad_etaa_name = dkappadgrad_etaa
d2kappadgrad_etaa_name = d2kappadgrad_etaa
[../]
[./ACa0_int2]
type = ACInterface2DMultiPhase2
variable = etaa0
kappa_name = kappaa
dkappadgrad_etaa_name = dkappadgrad_etaa
[../]
[./ea0_dot]
type = TimeDerivative
variable = etaa0
[../]
# Order parameter eta_beta0
[./ACb0_bulk]
type = ACGrGrMulti
variable = etab0
v = 'etaa0'
gamma_names = 'gab'
[../]
[./ACb0_sw]
type = ACSwitching
variable = etab0
Fj_names = 'omegaa omegab'
hj_names = 'ha hb'
coupled_variables = 'etaa0 w T'
[../]
[./ACb0_int1]
type = ACInterface2DMultiPhase1
variable = etab0
etas = 'etaa0'
kappa_name = kappab
dkappadgrad_etaa_name = dkappadgrad_etab
d2kappadgrad_etaa_name = d2kappadgrad_etab
[../]
[./ACb0_int2]
type = ACInterface2DMultiPhase2
variable = etab0
kappa_name = kappab
dkappadgrad_etaa_name = dkappadgrad_etab
[../]
[./eb0_dot]
type = TimeDerivative
variable = etab0
[../]
#Chemical potential
[./w_dot]
type = SusceptibilityTimeDerivative
variable = w
f_name = chi
[../]
[./Diffusion]
type = MatDiffusion
variable = w
diffusivity = Dchi
[../]
[./coupled_etaa0dot]
type = CoupledSwitchingTimeDerivative
variable = w
v = etaa0
Fj_names = 'rhoa rhob'
hj_names = 'ha hb'
coupled_variables = 'etaa0 etab0'
[../]
[./coupled_etab0dot]
type = CoupledSwitchingTimeDerivative
variable = w
v = etab0
Fj_names = 'rhoa rhob'
hj_names = 'ha hb'
coupled_variables = 'etaa0 etab0'
[../]
[./T_dot]
type = TimeDerivative
variable = T
[../]
[./CoefDiffusion]
type = Diffusion
variable = T
[../]
[./etaa0_dot_T]
type = CoefCoupledTimeDerivative
variable = T
v = etaa0
coef = -5.0
[../]
[]
[Materials]
[./ha]
type = SwitchingFunctionMultiPhaseMaterial
h_name = ha
all_etas = 'etaa0 etab0'
phase_etas = 'etaa0'
[../]
[./hb]
type = SwitchingFunctionMultiPhaseMaterial
h_name = hb
all_etas = 'etaa0 etab0'
phase_etas = 'etab0'
[../]
[./omegaa]
type = DerivativeParsedMaterial
coupled_variables = 'w'
property_name = omegaa
material_property_names = 'Vm ka caeq'
expression = '-0.5*w^2/Vm^2/ka-w/Vm*caeq'
[../]
[./omegab]
type = DerivativeParsedMaterial
coupled_variables = 'w T'
property_name = omegab
material_property_names = 'Vm kb cbeq S Tm'
expression = '-0.5*w^2/Vm^2/kb-w/Vm*cbeq-S*(T-Tm)'
[../]
[./rhoa]
type = DerivativeParsedMaterial
coupled_variables = 'w'
property_name = rhoa
material_property_names = 'Vm ka caeq'
expression = 'w/Vm^2/ka + caeq/Vm'
[../]
[./rhob]
type = DerivativeParsedMaterial
coupled_variables = 'w'
property_name = rhob
material_property_names = 'Vm kb cbeq'
expression = 'w/Vm^2/kb + cbeq/Vm'
[../]
[./kappaa]
type = InterfaceOrientationMultiphaseMaterial
kappa_name = kappaa
dkappadgrad_etaa_name = dkappadgrad_etaa
d2kappadgrad_etaa_name = d2kappadgrad_etaa
etaa = etaa0
etab = etab0
anisotropy_strength = 0.05
kappa_bar = 0.05
outputs = exodus
output_properties = 'kappaa'
[../]
[./kappab]
type = InterfaceOrientationMultiphaseMaterial
kappa_name = kappab
dkappadgrad_etaa_name = dkappadgrad_etab
d2kappadgrad_etaa_name = d2kappadgrad_etab
etaa = etab0
etab = etaa0
anisotropy_strength = 0.05
kappa_bar = 0.05
outputs = exodus
output_properties = 'kappab'
[../]
[./const]
type = GenericConstantMaterial
prop_names = 'L D chi Vm ka caeq kb cbeq gab mu S Tm'
prop_values = '33.33 1.0 0.1 1.0 10.0 0.1 10.0 0.9 4.5 10.0 1.0 5.0'
[../]
[./Mobility]
type = ParsedMaterial
property_name = Dchi
material_property_names = 'D chi'
expression = 'D*chi'
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart'
petsc_options_value = 'hypre boomeramg 31'
l_tol = 1.0e-3
l_max_its = 30
nl_max_its = 15
nl_rel_tol = 1.0e-8
nl_abs_tol = 1e-10
end_time = 2.0
dtmax = 0.05
[./TimeStepper]
type = IterationAdaptiveDT
dt = 0.0005
cutback_factor = 0.7
growth_factor = 1.2
[../]
[]
[Adaptivity]
initial_steps = 5
max_h_level = 3
initial_marker = err_eta
marker = err_bnds
[./Markers]
[./err_eta]
type = ErrorFractionMarker
coarsen = 0.3
refine = 0.95
indicator = ind_eta
[../]
[./err_bnds]
type = ErrorFractionMarker
coarsen = 0.3
refine = 0.95
indicator = ind_bnds
[../]
[../]
[./Indicators]
[./ind_eta]
type = GradientJumpIndicator
variable = etaa0
[../]
[./ind_bnds]
type = GradientJumpIndicator
variable = bnds
[../]
[../]
[]
[Outputs]
time_step_interval = 5
exodus = true
[]
(modules/phase_field/test/tests/slkks/full_solve.i)
#
# SLKKS two phase example for the BCC and SIGMA phases. The sigma phase contains
# multiple sublattices. Free energy from
# Jacob, Aurelie, Erwin Povoden-Karadeniz, and Ernst Kozeschnik. "Revised thermodynamic
# description of the Fe-Cr system based on an improved sublattice model of the sigma phase."
# Calphad 60 (2018): 16-28.
#
# In this simulation we consider diffusion (Cahn-Hilliard) and phase transformation.
#
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 30
ny = 1
xmin = -25
xmax = 25
[]
[]
[AuxVariables]
[Fglobal]
order = CONSTANT
family = MONOMIAL
[]
[]
[Variables]
# order parameters
[eta1]
initial_condition = 0.5
[]
[eta2]
initial_condition = 0.5
[]
# solute concentration
[cCr]
order = FIRST
family = LAGRANGE
[InitialCondition]
type = FunctionIC
function = '(x+25)/50*0.5+0.1'
[]
[]
# sublattice concentrations (good guesses are needed here! - they can be obtained
# form a static solve like in sublattice_concentrations.i)
[BCC_CR]
[InitialCondition]
type = FunctionIC
function = '(x+25)/50*0.5+0.1'
[]
[]
[SIGMA_0CR]
[InitialCondition]
type = FunctionIC
function = '(x+25)/50*0.17+0.01'
[]
[]
[SIGMA_1CR]
[InitialCondition]
type = FunctionIC
function = '(x+25)/50*0.36+0.02'
[]
[]
[SIGMA_2CR]
[InitialCondition]
type = FunctionIC
function = '(x+25)/50*0.33+0.20'
[]
[]
# Lagrange multiplier
[lambda]
[]
[]
[Materials]
# CALPHAD free energies
[F_BCC_A2]
type = DerivativeParsedMaterial
property_name = F_BCC_A2
outputs = exodus
output_properties = F_BCC_A2
expression = 'BCC_FE:=1-BCC_CR; G := 8.3145*T*(1.0*if(BCC_CR > 1.0e-15,BCC_CR*log(BCC_CR),0) + '
'1.0*if(BCC_FE > 1.0e-15,BCC_FE*plog(BCC_FE,eps),0) + 3.0*if(BCC_VA > '
'1.0e-15,BCC_VA*log(BCC_VA),0))/(BCC_CR + BCC_FE) + 8.3145*T*if(T < '
'548.2*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) - 932.5*BCC_CR*BCC_FE*BCC_VA + '
'311.5*BCC_CR*BCC_VA - '
'1043.0*BCC_FE*BCC_VA,-8.13674105561218e-49*T^15/(0.525599232981783*BCC_CR*BCC_FE*BCC_'
'VA*(BCC_CR - BCC_FE) - 0.894055608820709*BCC_CR*BCC_FE*BCC_VA + '
'0.298657718120805*BCC_CR*BCC_VA - BCC_FE*BCC_VA + 9.58772770853308e-13)^15 - '
'4.65558036243985e-30*T^9/(0.525599232981783*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) - '
'0.894055608820709*BCC_CR*BCC_FE*BCC_VA + 0.298657718120805*BCC_CR*BCC_VA - '
'BCC_FE*BCC_VA + 9.58772770853308e-13)^9 - '
'1.3485349181899e-10*T^3/(0.525599232981783*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) - '
'0.894055608820709*BCC_CR*BCC_FE*BCC_VA + 0.298657718120805*BCC_CR*BCC_VA - '
'BCC_FE*BCC_VA + 9.58772770853308e-13)^3 + 1 - '
'0.905299382744392*(548.2*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) - '
'932.5*BCC_CR*BCC_FE*BCC_VA + 311.5*BCC_CR*BCC_VA - 1043.0*BCC_FE*BCC_VA + '
'1.0e-9)/T,if(T < -548.2*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) + '
'932.5*BCC_CR*BCC_FE*BCC_VA - 311.5*BCC_CR*BCC_VA + '
'1043.0*BCC_FE*BCC_VA,-8.13674105561218e-49*T^15/(-0.525599232981783*BCC_CR*BCC_FE*BCC'
'_VA*(BCC_CR - BCC_FE) + 0.894055608820709*BCC_CR*BCC_FE*BCC_VA - '
'0.298657718120805*BCC_CR*BCC_VA + BCC_FE*BCC_VA + 9.58772770853308e-13)^15 - '
'4.65558036243985e-30*T^9/(-0.525599232981783*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) '
'+ 0.894055608820709*BCC_CR*BCC_FE*BCC_VA - 0.298657718120805*BCC_CR*BCC_VA + '
'BCC_FE*BCC_VA + 9.58772770853308e-13)^9 - '
'1.3485349181899e-10*T^3/(-0.525599232981783*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) + '
'0.894055608820709*BCC_CR*BCC_FE*BCC_VA - 0.298657718120805*BCC_CR*BCC_VA + '
'BCC_FE*BCC_VA + 9.58772770853308e-13)^3 + 1 - '
'0.905299382744392*(-548.2*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) + '
'932.5*BCC_CR*BCC_FE*BCC_VA - 311.5*BCC_CR*BCC_VA + 1043.0*BCC_FE*BCC_VA + '
'1.0e-9)/T,if(T > -548.2*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) + '
'932.5*BCC_CR*BCC_FE*BCC_VA - 311.5*BCC_CR*BCC_VA + 1043.0*BCC_FE*BCC_VA & '
'548.2*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) - 932.5*BCC_CR*BCC_FE*BCC_VA + '
'311.5*BCC_CR*BCC_VA - 1043.0*BCC_FE*BCC_VA < '
'0,-79209031311018.7*(-0.525599232981783*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) + '
'0.894055608820709*BCC_CR*BCC_FE*BCC_VA - 0.298657718120805*BCC_CR*BCC_VA + '
'BCC_FE*BCC_VA + 9.58772770853308e-13)^5/T^5 - '
'3.83095660520737e+42*(-0.525599232981783*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) + '
'0.894055608820709*BCC_CR*BCC_FE*BCC_VA - 0.298657718120805*BCC_CR*BCC_VA + '
'BCC_FE*BCC_VA + 9.58772770853308e-13)^15/T^15 - '
'1.22565886734485e+72*(-0.525599232981783*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) + '
'0.894055608820709*BCC_CR*BCC_FE*BCC_VA - 0.298657718120805*BCC_CR*BCC_VA + '
'BCC_FE*BCC_VA + 9.58772770853308e-13)^25/T^25,if(T > '
'548.2*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) - 932.5*BCC_CR*BCC_FE*BCC_VA + '
'311.5*BCC_CR*BCC_VA - 1043.0*BCC_FE*BCC_VA & 548.2*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - '
'BCC_FE) - 932.5*BCC_CR*BCC_FE*BCC_VA + 311.5*BCC_CR*BCC_VA - 1043.0*BCC_FE*BCC_VA > '
'0,-79209031311018.7*(0.525599232981783*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) - '
'0.894055608820709*BCC_CR*BCC_FE*BCC_VA + 0.298657718120805*BCC_CR*BCC_VA - '
'BCC_FE*BCC_VA + 9.58772770853308e-13)^5/T^5 - '
'3.83095660520737e+42*(0.525599232981783*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) - '
'0.894055608820709*BCC_CR*BCC_FE*BCC_VA + 0.298657718120805*BCC_CR*BCC_VA - '
'BCC_FE*BCC_VA + 9.58772770853308e-13)^15/T^15 - '
'1.22565886734485e+72*(0.525599232981783*BCC_CR*BCC_FE*BCC_VA*(BCC_CR - BCC_FE) - '
'0.894055608820709*BCC_CR*BCC_FE*BCC_VA + 0.298657718120805*BCC_CR*BCC_VA - '
'BCC_FE*BCC_VA + 9.58772770853308e-13)^25/T^25,0))))*log((2.15*BCC_CR*BCC_FE*BCC_VA - '
'0.008*BCC_CR*BCC_VA + 2.22*BCC_FE*BCC_VA)*if(2.15*BCC_CR*BCC_FE*BCC_VA - '
'0.008*BCC_CR*BCC_VA + 2.22*BCC_FE*BCC_VA <= 0,-1.0,1.0) + 1)/(BCC_CR + BCC_FE) + '
'1.0*(BCC_CR*BCC_VA*if(T >= 298.15 & T < 2180.0,139250.0*1/T - 26.908*T*log(T) + '
'157.48*T + 0.00189435*T^2.0 - 1.47721e-6*T^3.0 - 8856.94,if(T >= 2180.0 & T < '
'6000.0,-2.88526e+32*T^(-9.0) - 50.0*T*log(T) + 344.18*T - 34869.344,0)) + '
'BCC_FE*BCC_VA*if(T >= 298.15 & T < 1811.0,77358.5*1/T - 23.5143*T*log(T) + 124.134*T '
'- 0.00439752*T^2.0 - 5.89269e-8*T^3.0 + 1225.7,if(T >= 1811.0 & T < '
'6000.0,2.2960305e+31*T^(-9.0) - 46.0*T*log(T) + 299.31255*T - 25383.581,0)))/(BCC_CR '
'+ BCC_FE) + 1.0*(BCC_CR*BCC_FE*BCC_VA*(500.0 - 1.5*T)*(BCC_CR - BCC_FE) + '
'BCC_CR*BCC_FE*BCC_VA*(24600.0 - 14.98*T) + BCC_CR*BCC_FE*BCC_VA*(9.15*T - '
'14000.0)*(BCC_CR - BCC_FE)^2)/(BCC_CR + BCC_FE); G/100000'
coupled_variables = 'BCC_CR'
constant_names = 'BCC_VA T eps'
constant_expressions = '1 1000 0.01'
[]
[F_SIGMA]
type = DerivativeParsedMaterial
property_name = F_SIGMA
outputs = exodus
output_properties = F_SIGMA
expression = 'SIGMA_0FE := 1-SIGMA_0CR; SIGMA_1FE := 1-SIGMA_1CR; SIGMA_2FE := 1-SIGMA_2CR; G := '
'8.3145*T*(10.0*if(SIGMA_0CR > 1.0e-15,SIGMA_0CR*plog(SIGMA_0CR,eps),0) + '
'10.0*if(SIGMA_0FE > 1.0e-15,SIGMA_0FE*plog(SIGMA_0FE,eps),0) + 4.0*if(SIGMA_1CR > '
'1.0e-15,SIGMA_1CR*plog(SIGMA_1CR,eps),0) + 4.0*if(SIGMA_1FE > '
'1.0e-15,SIGMA_1FE*plog(SIGMA_1FE,eps),0) + 16.0*if(SIGMA_2CR > '
'1.0e-15,SIGMA_2CR*plog(SIGMA_2CR,eps),0) + 16.0*if(SIGMA_2FE > '
'1.0e-15,SIGMA_2FE*plog(SIGMA_2FE,eps),0))/(10.0*SIGMA_0CR + 10.0*SIGMA_0FE + '
'4.0*SIGMA_1CR + 4.0*SIGMA_1FE + 16.0*SIGMA_2CR + 16.0*SIGMA_2FE) + '
'(SIGMA_0FE*SIGMA_1CR*SIGMA_2CR*SIGMA_2FE*(-70.0*T - 170400.0) + '
'SIGMA_0FE*SIGMA_1FE*SIGMA_2CR*SIGMA_2FE*(-10.0*T - 330839.0))/(10.0*SIGMA_0CR + '
'10.0*SIGMA_0FE + 4.0*SIGMA_1CR + 4.0*SIGMA_1FE + 16.0*SIGMA_2CR + 16.0*SIGMA_2FE) + '
'(SIGMA_0CR*SIGMA_1CR*SIGMA_2CR*(30.0*if(T >= 298.15 & T < 2180.0,139250.0*1/T - '
'26.908*T*log(T) + 157.48*T + 0.00189435*T^2.0 - 1.47721e-6*T^3.0 - 8856.94,if(T >= '
'2180.0 & T < 6000.0,-2.88526e+32*T^(-9.0) - 50.0*T*log(T) + 344.18*T - 34869.344,0)) '
'+ 132000.0) + SIGMA_0CR*SIGMA_1CR*SIGMA_2FE*(-110.0*T + 16.0*if(T >= 298.15 & T < '
'1811.0,77358.5*1/T - 23.5143*T*log(T) + 124.134*T - 0.00439752*T^2.0 - '
'5.89269e-8*T^3.0 + 1225.7,if(T >= 1811.0 & T < 6000.0,2.2960305e+31*T^(-9.0) - '
'46.0*T*log(T) + 299.31255*T - 25383.581,0)) + 14.0*if(T >= 298.15 & T < '
'2180.0,139250.0*1/T - 26.908*T*log(T) + 157.48*T + 0.00189435*T^2.0 - '
'1.47721e-6*T^3.0 - 8856.94,if(T >= 2180.0 & T < 6000.0,-2.88526e+32*T^(-9.0) - '
'50.0*T*log(T) + 344.18*T - 34869.344,0)) + 123500.0) + '
'SIGMA_0CR*SIGMA_1FE*SIGMA_2CR*(4.0*if(T >= 298.15 & T < 1811.0,77358.5*1/T - '
'23.5143*T*log(T) + 124.134*T - 0.00439752*T^2.0 - 5.89269e-8*T^3.0 + 1225.7,if(T >= '
'1811.0 & T < 6000.0,2.2960305e+31*T^(-9.0) - 46.0*T*log(T) + 299.31255*T - '
'25383.581,0)) + 26.0*if(T >= 298.15 & T < 2180.0,139250.0*1/T - 26.908*T*log(T) + '
'157.48*T + 0.00189435*T^2.0 - 1.47721e-6*T^3.0 - 8856.94,if(T >= 2180.0 & T < '
'6000.0,-2.88526e+32*T^(-9.0) - 50.0*T*log(T) + 344.18*T - 34869.344,0)) + 140486.0) '
'+ SIGMA_0CR*SIGMA_1FE*SIGMA_2FE*(20.0*if(T >= 298.15 & T < 1811.0,77358.5*1/T - '
'23.5143*T*log(T) + 124.134*T - 0.00439752*T^2.0 - 5.89269e-8*T^3.0 + 1225.7,if(T >= '
'1811.0 & T < 6000.0,2.2960305e+31*T^(-9.0) - 46.0*T*log(T) + 299.31255*T - '
'25383.581,0)) + 10.0*if(T >= 298.15 & T < 2180.0,139250.0*1/T - 26.908*T*log(T) + '
'157.48*T + 0.00189435*T^2.0 - 1.47721e-6*T^3.0 - 8856.94,if(T >= 2180.0 & T < '
'6000.0,-2.88526e+32*T^(-9.0) - 50.0*T*log(T) + 344.18*T - 34869.344,0)) + 148800.0) '
'+ SIGMA_0FE*SIGMA_1CR*SIGMA_2CR*(10.0*if(T >= 298.15 & T < 1811.0,77358.5*1/T - '
'23.5143*T*log(T) + 124.134*T - 0.00439752*T^2.0 - 5.89269e-8*T^3.0 + 1225.7,if(T >= '
'1811.0 & T < 6000.0,2.2960305e+31*T^(-9.0) - 46.0*T*log(T) + 299.31255*T - '
'25383.581,0)) + 20.0*if(T >= 298.15 & T < 2180.0,139250.0*1/T - 26.908*T*log(T) + '
'157.48*T + 0.00189435*T^2.0 - 1.47721e-6*T^3.0 - 8856.94,if(T >= 2180.0 & T < '
'6000.0,-2.88526e+32*T^(-9.0) - 50.0*T*log(T) + 344.18*T - 34869.344,0)) + 56200.0) + '
'SIGMA_0FE*SIGMA_1CR*SIGMA_2FE*(26.0*if(T >= 298.15 & T < 1811.0,77358.5*1/T - '
'23.5143*T*log(T) + 124.134*T - 0.00439752*T^2.0 - 5.89269e-8*T^3.0 + 1225.7,if(T >= '
'1811.0 & T < 6000.0,2.2960305e+31*T^(-9.0) - 46.0*T*log(T) + 299.31255*T - '
'25383.581,0)) + 4.0*if(T >= 298.15 & T < 2180.0,139250.0*1/T - 26.908*T*log(T) + '
'157.48*T + 0.00189435*T^2.0 - 1.47721e-6*T^3.0 - 8856.94,if(T >= 2180.0 & T < '
'6000.0,-2.88526e+32*T^(-9.0) - 50.0*T*log(T) + 344.18*T - 34869.344,0)) + 152700.0) '
'+ SIGMA_0FE*SIGMA_1FE*SIGMA_2CR*(14.0*if(T >= 298.15 & T < 1811.0,77358.5*1/T - '
'23.5143*T*log(T) + 124.134*T - 0.00439752*T^2.0 - 5.89269e-8*T^3.0 + 1225.7,if(T >= '
'1811.0 & T < 6000.0,2.2960305e+31*T^(-9.0) - 46.0*T*log(T) + 299.31255*T - '
'25383.581,0)) + 16.0*if(T >= 298.15 & T < 2180.0,139250.0*1/T - 26.908*T*log(T) + '
'157.48*T + 0.00189435*T^2.0 - 1.47721e-6*T^3.0 - 8856.94,if(T >= 2180.0 & T < '
'6000.0,-2.88526e+32*T^(-9.0) - 50.0*T*log(T) + 344.18*T - 34869.344,0)) + 46200.0) + '
'SIGMA_0FE*SIGMA_1FE*SIGMA_2FE*(30.0*if(T >= 298.15 & T < 1811.0,77358.5*1/T - '
'23.5143*T*log(T) + 124.134*T - 0.00439752*T^2.0 - 5.89269e-8*T^3.0 + 1225.7,if(T >= '
'1811.0 & T < 6000.0,2.2960305e+31*T^(-9.0) - 46.0*T*log(T) + 299.31255*T - '
'25383.581,0)) + 173333.0))/(10.0*SIGMA_0CR + 10.0*SIGMA_0FE + 4.0*SIGMA_1CR + '
'4.0*SIGMA_1FE + 16.0*SIGMA_2CR + 16.0*SIGMA_2FE); G/100000'
coupled_variables = 'SIGMA_0CR SIGMA_1CR SIGMA_2CR'
constant_names = 'T eps'
constant_expressions = '1000 0.01'
[]
# h(eta)
[h1]
type = SwitchingFunctionMaterial
function_name = h1
h_order = HIGH
eta = eta1
[]
[h2]
type = SwitchingFunctionMaterial
function_name = h2
h_order = HIGH
eta = eta2
[]
# g(eta)
[g1]
type = BarrierFunctionMaterial
function_name = g1
g_order = SIMPLE
eta = eta1
[]
[g2]
type = BarrierFunctionMaterial
function_name = g2
g_order = SIMPLE
eta = eta2
[]
# constant properties
[constants]
type = GenericConstantMaterial
prop_names = 'D L kappa'
prop_values = '10 1 0.1 '
[]
# Coefficients for diffusion equation
[Dh1]
type = DerivativeParsedMaterial
material_property_names = 'D h1(eta1)'
expression = D*h1
property_name = Dh1
coupled_variables = eta1
derivative_order = 1
[]
[Dh2a]
type = DerivativeParsedMaterial
material_property_names = 'D h2(eta2)'
expression = D*h2*10/30
property_name = Dh2a
coupled_variables = eta2
derivative_order = 1
[]
[Dh2b]
type = DerivativeParsedMaterial
material_property_names = 'D h2(eta2)'
expression = D*h2*4/30
property_name = Dh2b
coupled_variables = eta2
derivative_order = 1
[]
[Dh2c]
type = DerivativeParsedMaterial
material_property_names = 'D h2(eta2)'
expression = D*h2*16/30
property_name = Dh2c
coupled_variables = eta2
derivative_order = 1
[]
[]
[Kernels]
#Kernels for diffusion equation
[diff_time]
type = TimeDerivative
variable = cCr
[]
[diff_c1]
type = MatDiffusion
variable = cCr
diffusivity = Dh1
v = BCC_CR
args = eta1
[]
[diff_c2a]
type = MatDiffusion
variable = cCr
diffusivity = Dh2a
v = SIGMA_0CR
args = eta2
[]
[diff_c2b]
type = MatDiffusion
variable = cCr
diffusivity = Dh2b
v = SIGMA_1CR
args = eta2
[]
[diff_c2c]
type = MatDiffusion
variable = cCr
diffusivity = Dh2c
v = SIGMA_2CR
args = eta2
[]
# enforce pointwise equality of chemical potentials
[chempot1a2a]
# The BCC phase has only one sublattice
# we tie it to the first sublattice with site fraction 10/(10+4+16) in the sigma phase
type = KKSPhaseChemicalPotential
variable = BCC_CR
cb = SIGMA_0CR
kb = '${fparse 10/30}'
fa_name = F_BCC_A2
fb_name = F_SIGMA
args_b = 'SIGMA_1CR SIGMA_2CR'
[]
[chempot2a2b]
# This kernel ties the first two sublattices in the sigma phase together
type = SLKKSChemicalPotential
variable = SIGMA_0CR
a = 10
cs = SIGMA_1CR
as = 4
F = F_SIGMA
coupled_variables = 'SIGMA_2CR'
[]
[chempot2b2c]
# This kernel ties the remaining two sublattices in the sigma phase together
type = SLKKSChemicalPotential
variable = SIGMA_1CR
a = 4
cs = SIGMA_2CR
as = 16
F = F_SIGMA
coupled_variables = 'SIGMA_0CR'
[]
[phaseconcentration]
# This kernel ties the sum of the sublattice concentrations to the global concentration cCr
type = SLKKSMultiPhaseConcentration
variable = SIGMA_2CR
c = cCr
ns = '1 3'
as = '1 10 4 16'
cs = 'BCC_CR SIGMA_0CR SIGMA_1CR SIGMA_2CR'
h_names = 'h1 h2'
eta = 'eta1 eta2'
[]
# Kernels for Allen-Cahn equation for eta1
[deta1dt]
type = TimeDerivative
variable = eta1
[]
[ACBulkF1]
type = KKSMultiACBulkF
variable = eta1
Fj_names = 'F_BCC_A2 F_SIGMA'
hj_names = 'h1 h2'
gi_name = g1
eta_i = eta1
wi = 0.1
coupled_variables = 'BCC_CR SIGMA_0CR SIGMA_1CR SIGMA_2CR eta2'
[]
[ACBulkC1]
type = SLKKSMultiACBulkC
variable = eta1
F = F_BCC_A2
c = BCC_CR
ns = '1 3'
as = '1 10 4 16'
cs = 'BCC_CR SIGMA_0CR SIGMA_1CR SIGMA_2CR'
h_names = 'h1 h2'
eta = 'eta1 eta2'
[]
[ACInterface1]
type = ACInterface
variable = eta1
kappa_name = kappa
[]
[lagrange1]
type = SwitchingFunctionConstraintEta
variable = eta1
h_name = h1
lambda = lambda
coupled_variables = 'eta2'
[]
# Kernels for Allen-Cahn equation for eta1
[deta2dt]
type = TimeDerivative
variable = eta2
[]
[ACBulkF2]
type = KKSMultiACBulkF
variable = eta2
Fj_names = 'F_BCC_A2 F_SIGMA'
hj_names = 'h1 h2'
gi_name = g2
eta_i = eta2
wi = 0.1
coupled_variables = 'BCC_CR SIGMA_0CR SIGMA_1CR SIGMA_2CR eta1'
[]
[ACBulkC2]
type = SLKKSMultiACBulkC
variable = eta2
F = F_BCC_A2
c = BCC_CR
ns = '1 3'
as = '1 10 4 16'
cs = 'BCC_CR SIGMA_0CR SIGMA_1CR SIGMA_2CR'
h_names = 'h1 h2'
eta = 'eta1 eta2'
[]
[ACInterface2]
type = ACInterface
variable = eta2
kappa_name = kappa
[]
[lagrange2]
type = SwitchingFunctionConstraintEta
variable = eta2
h_name = h2
lambda = lambda
coupled_variables = 'eta1'
[]
# Lagrange-multiplier constraint kernel for lambda
[lagrange]
type = SwitchingFunctionConstraintLagrange
variable = lambda
h_names = 'h1 h2'
etas = 'eta1 eta2'
epsilon = 1e-6
[]
[]
[AuxKernels]
[GlobalFreeEnergy]
type = KKSMultiFreeEnergy
variable = Fglobal
Fj_names = 'F_BCC_A2 F_SIGMA'
hj_names = 'h1 h2'
gj_names = 'g1 g2'
interfacial_vars = 'eta1 eta2'
kappa_names = 'kappa kappa'
w = 0.1
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
line_search = none
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type -ksp_gmres_restart'
petsc_options_value = 'asm lu nonzero 30'
l_max_its = 100
nl_max_its = 20
nl_abs_tol = 1e-10
end_time = 1000
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 12
iteration_window = 2
growth_factor = 2
cutback_factor = 0.5
dt = 0.1
[]
[]
[Postprocessors]
[F]
type = ElementIntegralVariablePostprocessor
variable = Fglobal
[]
[cmin]
type = NodalExtremeValue
value_type = min
variable = cCr
[]
[cmax]
type = NodalExtremeValue
value_type = max
variable = cCr
[]
[]
[Outputs]
exodus = true
print_linear_residuals = false
# exclude lagrange multiplier from output, it can diff more easily
hide = lambda
[]
(modules/porous_flow/test/tests/gravity/grav02e_fv.i)
# Checking that gravity head is established in the transient situation when 0<=saturation<=1 (note the less-than-or-equal-to).
# 2phase (PS), 2components, constant capillary pressure, constant fluid bulk-moduli for each phase, constant viscosity,
# constant permeability, Corey relative permeabilities with no residual saturation
[Mesh]
type = GeneratedMesh
dim = 1
nx = 10
xmax = 100
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '-10 0 0'
[]
[Variables]
[ppwater]
type = MooseVariableFVReal
initial_condition = 1.5e6
[]
[sgas]
type = MooseVariableFVReal
initial_condition = 0.3
[]
[]
[AuxVariables]
[massfrac_ph0_sp0]
type = MooseVariableFVReal
initial_condition = 1
[]
[massfrac_ph1_sp0]
type = MooseVariableFVReal
initial_condition = 0
[]
[ppgas]
type = MooseVariableFVReal
[]
[swater]
type = MooseVariableFVReal
[]
[relpermwater]
type = MooseVariableFVReal
[]
[relpermgas]
type = MooseVariableFVReal
[]
[]
[FVKernels]
[mass0]
type = FVPorousFlowMassTimeDerivative
fluid_component = 0
variable = ppwater
[]
[flux0]
type = FVPorousFlowAdvectiveFlux
fluid_component = 0
variable = ppwater
[]
[mass1]
type = FVPorousFlowMassTimeDerivative
fluid_component = 1
variable = sgas
[]
[flux1]
type = FVPorousFlowAdvectiveFlux
fluid_component = 1
variable = sgas
[]
[]
[AuxKernels]
[ppgas]
type = ADPorousFlowPropertyAux
property = pressure
phase = 1
variable = ppgas
execute_on = 'initial timestep_end'
[]
[swater]
type = ADPorousFlowPropertyAux
property = saturation
phase = 0
variable = swater
execute_on = 'initial timestep_end'
[]
[relpermwater]
type = ADPorousFlowPropertyAux
property = relperm
phase = 0
variable = relpermwater
execute_on = 'initial timestep_end'
[]
[relpermgas]
type = ADPorousFlowPropertyAux
property = relperm
phase = 1
variable = relpermgas
execute_on = 'initial timestep_end'
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'ppwater sgas'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureConst
pc = 1e5
[]
[]
[FluidProperties]
[simple_fluid0]
type = SimpleFluidProperties
bulk_modulus = 2e9
density0 = 1000
viscosity = 1e-3
thermal_expansion = 0
[]
[simple_fluid1]
type = SimpleFluidProperties
bulk_modulus = 2e9
density0 = 10
viscosity = 1e-5
thermal_expansion = 0
[]
[]
[Materials]
[temperature]
type = ADPorousFlowTemperature
[]
[ppss]
type = ADPorousFlow2PhasePS
phase0_porepressure = ppwater
phase1_saturation = sgas
capillary_pressure = pc
[]
[massfrac]
type = ADPorousFlowMassFraction
mass_fraction_vars = 'massfrac_ph0_sp0 massfrac_ph1_sp0'
[]
[simple_fluid0]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid0
phase = 0
[]
[simple_fluid1]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid1
phase = 1
[]
[porosity]
type = ADPorousFlowPorosityConst
porosity = 0.1
[]
[permeability]
type = ADPorousFlowPermeabilityConst
permeability = '1e-11 0 0 0 1e-11 0 0 0 1e-11'
[]
[relperm_water]
type = ADPorousFlowRelativePermeabilityCorey
n = 2
phase = 0
[]
[relperm_gas]
type = ADPorousFlowRelativePermeabilityCorey
n = 2
phase = 1
[]
[]
[VectorPostprocessors]
[vars]
type = ElementValueSampler
variable = 'ppgas ppwater sgas swater'
sort_by = x
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 5e3
nl_abs_tol = 1e-12
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e3
[]
[]
[Outputs]
execute_on = 'final'
perf_graph = true
csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/cns/straight_channel_porosity_step/implicit-euler-basic-kt-primitive.i)
p_initial=1.01e5
T=273.15
# u refers to the superficial velocity
u_in=1
user_limiter='upwind'
[GlobalParams]
fp = fp
two_term_boundary_expansion = true
limiter = ${user_limiter}
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 1
xmin = 0
xmax = 18
nx = 180
[]
[to_pt5]
input = cartesian
type = SubdomainBoundingBoxGenerator
bottom_left = '2 0 0'
top_right = '4 1 0'
block_id = 1
[]
[pt5]
input = to_pt5
type = SubdomainBoundingBoxGenerator
bottom_left = '4 0 0'
top_right = '6 1 0'
block_id = 2
[]
[to_pt25]
input = pt5
type = SubdomainBoundingBoxGenerator
bottom_left = '6 0 0'
top_right = '8 1 0'
block_id = 3
[]
[pt25]
input = to_pt25
type = SubdomainBoundingBoxGenerator
bottom_left = '8 0 0'
top_right = '10 1 0'
block_id = 4
[]
[to_pt5_again]
input = pt25
type = SubdomainBoundingBoxGenerator
bottom_left = '10 0 0'
top_right = '12 1 0'
block_id = 5
[]
[pt5_again]
input = to_pt5_again
type = SubdomainBoundingBoxGenerator
bottom_left = '12 0 0'
top_right = '14 1 0'
block_id = 6
[]
[to_one]
input = pt5_again
type = SubdomainBoundingBoxGenerator
bottom_left = '14 0 0'
top_right = '16 1 0'
block_id = 7
[]
[one]
input = to_one
type = SubdomainBoundingBoxGenerator
bottom_left = '16 0 0'
top_right = '18 1 0'
block_id = 8
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[pressure]
type = MooseVariableFVReal
initial_condition = ${p_initial}
[]
[sup_vel_x]
type = MooseVariableFVReal
initial_condition = 1e-15
scaling = 1e-2
[]
[T_fluid]
type = MooseVariableFVReal
initial_condition = ${T}
scaling = 1e-5
[]
[]
[AuxVariables]
[vel_x]
type = MooseVariableFVReal
[]
[sup_mom_x]
type = MooseVariableFVReal
[]
[rho]
type = MooseVariableFVReal
[]
[worst_courant]
type = MooseVariableFVReal
[]
[porosity]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[vel_x]
type = ADMaterialRealAux
variable = vel_x
property = vel_x
execute_on = 'timestep_end'
[]
[sup_mom_x]
type = ADMaterialRealAux
variable = sup_mom_x
property = superficial_rhou
execute_on = 'timestep_end'
[]
[rho]
type = ADMaterialRealAux
variable = rho
property = rho
execute_on = 'timestep_end'
[]
[worst_courant]
type = Courant
variable = worst_courant
u = sup_vel_x
execute_on = 'timestep_end'
[]
[porosity]
type = MaterialRealAux
variable = porosity
property = porosity
execute_on = 'timestep_end'
[]
[]
[FVKernels]
[mass_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_dt'
variable = pressure
[]
[mass_advection]
type = PCNSFVKT
variable = pressure
eqn = "mass"
[]
[momentum_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rhou_dt'
variable = sup_vel_x
[]
[momentum_advection]
type = PCNSFVKT
variable = sup_vel_x
eqn = "momentum"
momentum_component = 'x'
[]
[eps_grad]
type = PNSFVPGradEpsilon
variable = sup_vel_x
momentum_component = 'x'
epsilon_function = 'eps'
[]
[energy_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_et_dt'
variable = T_fluid
[]
[energy_advection]
type = PCNSFVKT
variable = T_fluid
eqn = "energy"
[]
[]
[FVBCs]
[rho_left]
type = PCNSFVStrongBC
boundary = 'left'
variable = pressure
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'mass'
[]
[rhou_left]
type = PCNSFVStrongBC
boundary = 'left'
variable = sup_vel_x
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'x'
[]
[rho_et_left]
type = PCNSFVStrongBC
boundary = 'left'
variable = T_fluid
superficial_velocity = 'ud_in'
T_fluid = ${T}
eqn = 'energy'
[]
[rho_right]
type = PCNSFVStrongBC
boundary = 'right'
variable = pressure
pressure = ${p_initial}
eqn = 'mass'
[]
[rhou_right]
type = PCNSFVStrongBC
boundary = 'right'
variable = sup_vel_x
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'x'
[]
[rho_et_right]
type = PCNSFVStrongBC
boundary = 'right'
variable = T_fluid
pressure = ${p_initial}
eqn = 'energy'
[]
# Use these to help create more accurate cell centered gradients for cells adjacent to boundaries
[T_left]
type = FVDirichletBC
variable = T_fluid
value = ${T}
boundary = 'left'
[]
[sup_vel_left]
type = FVDirichletBC
variable = sup_vel_x
value = ${u_in}
boundary = 'left'
[]
[p_right]
type = FVDirichletBC
variable = pressure
value = ${p_initial}
boundary = 'right'
[]
[]
[Functions]
[ud_in]
type = ParsedVectorFunction
expression_x = '${u_in}'
[]
[eps]
type = ParsedFunction
expression = 'if(x < 2, 1,
if(x < 4, 1 - .5 / 2 * (x - 2),
if(x < 6, .5,
if(x < 8, .5 - .25 / 2 * (x - 6),
if(x < 10, .25,
if(x < 12, .25 + .25 / 2 * (x - 10),
if(x < 14, .5,
if(x < 16, .5 + .5 / 2 * (x - 14),
1))))))))'
[]
[]
[Materials]
[var_mat]
type = PorousPrimitiveVarMaterial
pressure = pressure
T_fluid = T_fluid
superficial_vel_x = sup_vel_x
fp = fp
porosity = porosity
[]
[porosity]
type = GenericFunctionMaterial
prop_names = 'porosity'
prop_values = 'eps'
[]
[]
[Executioner]
solve_type = NEWTON
line_search = 'bt'
type = Transient
nl_max_its = 20
[TimeStepper]
type = IterationAdaptiveDT
dt = 5e-5
optimal_iterations = 6
growth_factor = 1.2
[]
num_steps = 10000
end_time = 500
nl_abs_tol = 1e-8
[]
[Outputs]
[out]
type = Exodus
execute_on = 'final'
[]
checkpoint = true
[]
[Debug]
show_var_residual_norms = true
[]
(modules/solid_mechanics/test/tests/isotropic_elasticity_tensor/2D-axisymmetric_rz_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
elem_type = QUAD8
[]
[GlobalParams]
displacements = 'disp_r disp_z'
[]
[Problem]
coord_type = RZ
[]
[Physics/SolidMechanics/QuasiStatic]
[./all]
strain = SMALL
add_variables = true
[../]
[]
[AuxVariables]
[./stress_theta]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./stress_theta]
type = RankTwoAux
rank_two_tensor = stress
index_i = 2
index_j = 2
variable = stress_theta
execute_on = timestep_end
[../]
[]
[Materials]
[./elasticity_tensor]
#Material constants selected to match isotropic lambda and shear modulus case
type = ComputeElasticityTensor
C_ijkl = '1022726 113636 113636 1022726 454545'
fill_method = axisymmetric_rz
[../]
[./elastic_stress]
type = ComputeLinearElasticStress
[../]
[]
[BCs]
# pin particle along symmetry planes
[./no_disp_r]
type = DirichletBC
variable = disp_r
boundary = left
value = 0.0
[../]
[./no_disp_z]
type = DirichletBC
variable = disp_z
boundary = bottom
value = 0.0
[../]
# exterior and internal pressures
[./exterior_pressure_r]
type = Pressure
variable = disp_r
boundary = right
factor = 200000
[../]
[]
[Debug]
show_var_residual_norms = true
[]
[Executioner]
type = Transient
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
petsc_options_value = ' 201 hypre boomeramg 10'
line_search = 'none'
#Preconditioned JFNK (default)
solve_type = 'PJFNK'
nl_rel_tol = 5e-9
nl_abs_tol = 1e-10
nl_max_its = 15
l_tol = 1e-3
l_max_its = 50
start_time = 0.0
end_time = 1
num_steps = 1000
dtmax = 5e6
dtmin = 1
[./TimeStepper]
type = IterationAdaptiveDT
dt = 1
optimal_iterations = 6
iteration_window = 0
linear_iteration_ratio = 100
[../]
[./Predictor]
type = SimplePredictor
scale = 1.0
[../]
[]
[Postprocessors]
[./dt]
type = TimestepSize
[../]
[]
[Outputs]
file_base = 2D-axisymmetric_rz_test_out
exodus = true
[]
(modules/porous_flow/test/tests/dispersion/disp01_heavy.i)
# Test dispersive part of PorousFlowDispersiveFlux kernel by setting diffusion
# coefficients to zero. A pressure gradient is applied over the mesh to give a
# uniform velocity. Gravity is set to zero.
# Mass fraction is set to 1 on the left hand side and 0 on the right hand side.
[Mesh]
type = GeneratedMesh
dim = 1
nx = 200
xmax = 10
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
compute_enthalpy = false
compute_internal_energy = false
[]
[Variables]
[pp]
[]
[massfrac0]
[]
[]
[AuxVariables]
[velocity]
family = MONOMIAL
order = FIRST
[]
[]
[AuxKernels]
[velocity]
type = PorousFlowDarcyVelocityComponent
variable = velocity
component = x
[]
[]
[ICs]
[pp]
type = FunctionIC
variable = pp
function = pic
[]
[massfrac0]
type = ConstantIC
variable = massfrac0
value = 0
[]
[]
[Functions]
[pic]
type = ParsedFunction
expression = 1.1e5-x*1e3
[]
[]
[BCs]
[xleft]
type = DirichletBC
value = 1
variable = massfrac0
boundary = left
[]
[xright]
type = DirichletBC
value = 0
variable = massfrac0
boundary = right
[]
[pright]
type = DirichletBC
variable = pp
boundary = right
value = 1e5
[]
[pleft]
type = DirichletBC
variable = pp
boundary = left
value = 1.1e5
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = pp
[]
[adv0]
type = PorousFlowAdvectiveFlux
fluid_component = 0
variable = pp
[]
[diff0]
type = PorousFlowDispersiveFlux
variable = pp
disp_trans = 0
disp_long = 0.2
[]
[mass1]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = massfrac0
[]
[adv1]
type = PorousFlowAdvectiveFlux
fluid_component = 1
variable = massfrac0
[]
[diff1]
type = PorousFlowDispersiveFlux
fluid_component = 1
variable = massfrac0
disp_trans = 0
disp_long = 0.2
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pp massfrac0'
number_fluid_phases = 1
number_fluid_components = 2
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 1e9
density0 = 1000
viscosity = 0.001
thermal_expansion = 0
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
[]
[ppss]
type = PorousFlow1PhaseFullySaturated
porepressure = pp
[]
[massfrac]
type = PorousFlowMassFraction
mass_fraction_vars = massfrac0
[]
[simple_fluid]
type = PorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[poro]
type = PorousFlowPorosityConst
porosity = 0.3
[]
[diff]
type = PorousFlowDiffusivityConst
diffusion_coeff = '0 0'
tortuosity = 0.1
[]
[relp]
type = PorousFlowRelativePermeabilityConst
phase = 0
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-9 0 0 0 1e-9 0 0 0 1e-9'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
petsc_options_value = 'gmres asm lu NONZERO 2 '
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 1e3
dtmax = 10
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 1.5
cutback_factor = 0.5
dt = 1
[]
[]
[VectorPostprocessors]
[xmass]
type = NodalValueSampler
sort_by = id
variable = massfrac0
[]
[]
[Outputs]
[out]
type = CSV
execute_on = final
[]
[]
(modules/combined/test/tests/adaptive_timestepping/adapt_tstep_function_change_restart2.i)
# This is a test designed to evaluate the cabability of the
# IterationAdaptiveDT TimeStepper to adjust time step size according to
# a function. For example, if the power input function for a BISON
# simulation rapidly increases or decreases, the IterationAdaptiveDT
# TimeStepper should take time steps small enough to capture the
# oscillation.
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
order = FIRST
family = LAGRANGE
block = 1
[]
[Mesh]
file = 1hex8_10mm_cube.e
[]
[Functions]
[./Fiss_Function]
type = PiecewiseLinear
x = '0 1e6 2e6 2.001e6 2.002e6'
y = '0 3e8 3e8 12e8 0'
[../]
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[./disp_z]
[../]
[./temp]
[../]
[]
[Modules/TensorMechanics/Master]
[./all]
strain = FINITE
volumetric_locking_correction = true
incremental = true
eigenstrain_names = thermal_expansion
decomposition_method = EigenSolution
add_variables = true
generate_output = 'vonmises_stress'
temperature = temp
[../]
[]
[Kernels]
[./heat]
type = HeatConduction
variable = temp
[../]
[./heat_ie]
type = HeatConductionTimeDerivative
variable = temp
[../]
[./heat_source]
type = HeatSource
variable = temp
value = 1.0
function = Fiss_Function
[../]
[]
[BCs]
[./bottom_temp]
type = DirichletBC
variable = temp
boundary = 1
value = 300
[../]
[./top_bottom_disp_x]
type = DirichletBC
variable = disp_x
boundary = '1'
value = 0
[../]
[./top_bottom_disp_y]
type = DirichletBC
variable = disp_y
boundary = '1'
value = 0
[../]
[./top_bottom_disp_z]
type = DirichletBC
variable = disp_z
boundary = '1'
value = 0
[../]
[]
[Materials]
[./thermal]
type = HeatConductionMaterial
temp = temp
specific_heat = 1.0
thermal_conductivity = 1.0
[../]
[./elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 300e6
poissons_ratio = .3
[../]
[./stress]
type = ComputeFiniteStrainElasticStress
[../]
[./thermal_expansion]
type = ComputeThermalExpansionEigenstrain
thermal_expansion_coeff = 5e-6
stress_free_temperature = 300.0
temperature = temp
eigenstrain_name = thermal_expansion
[../]
[./density]
type = Density
density = 10963.0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
verbose = true
nl_abs_tol = 1e-10
num_steps = 50000
end_time = 2.002e6
[./TimeStepper]
type = IterationAdaptiveDT
timestep_limiting_function = Fiss_Function
max_function_change = 3e7
dt = 1e6
[../]
[]
[Postprocessors]
[./Temperature_of_Block]
type = ElementAverageValue
variable = temp
execute_on = 'timestep_end'
[../]
[./vonMises]
type = ElementAverageValue
variable = vonmises_stress
execute_on = 'timestep_end'
[../]
[]
[Outputs]
[./out]
type = Exodus
elemental_as_nodal = true
[../]
[./console]
type = Console
max_rows = 10
[../]
[]
[Problem]
restart_file_base = adapt_tstep_function_change_restart1_checkpoint_cp/0065
[]
(modules/phase_field/examples/nucleation/refine.i)
#
# Example derived from cahn_hilliard.i demonstrating the use of Adaptivity
# with the DiscreteNucleation system. The DiscreteNucleationMarker triggers
# mesh refinement for the nucleus geometry. It is up to the user to specify
# refinement for the physics. In this example this is done using a GradientJumpIndicator
# with a ValueThresholdMarker. The nucleation system marker and the physics marker
# must be combined using a ComboMarker to combine their effect.
#
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmax = 500
ymax = 500
elem_type = QUAD
[]
[Modules]
[./PhaseField]
[./Conserved]
[./c]
free_energy = F
mobility = M
kappa = kappa_c
solve_type = REVERSE_SPLIT
[../]
[../]
[../]
[]
[ICs]
[./c_IC]
type = ConstantIC
variable = c
value = 0.2
[../]
[]
[Materials]
[./pfmobility]
type = GenericConstantMaterial
prop_names = 'M kappa_c'
prop_values = '1 25'
[../]
[./chemical_free_energy]
# simple double well free energy
type = DerivativeParsedMaterial
property_name = Fc
coupled_variables = 'c'
constant_names = 'barr_height cv_eq'
constant_expressions = '0.1 0'
expression = 16*barr_height*c^2*(1-c)^2 # +0.01*(c*plog(c,0.005)+(1-c)*plog(1-c,0.005))
derivative_order = 2
outputs = exodus
[../]
[./probability]
# This is a made up toy nucleation rate it should be replaced by
# classical nucleation theory in a real simulation.
type = ParsedMaterial
property_name = P
coupled_variables = c
expression = 'if(c<0.21,c*1e-8,0)'
outputs = exodus
[../]
[./nucleation]
# The nucleation material is configured to insert nuclei into the free energy
# tht force the concentration to go to 0.95, and holds this enforcement for 500
# time units.
type = DiscreteNucleation
property_name = Fn
op_names = c
op_values = 0.90
penalty = 5
penalty_mode = MIN
map = map
outputs = exodus
[../]
[./free_energy]
# add the chemical and nucleation free energy contributions together
type = DerivativeSumMaterial
derivative_order = 2
coupled_variables = c
sum_materials = 'Fc Fn'
[../]
[]
[UserObjects]
[./inserter]
# The inserter runs at the end of each time step to add nucleation events
# that happened during the timestep (if it converged) to the list of nuclei
type = DiscreteNucleationInserter
hold_time = 50
probability = P
radius = 10
[../]
[./map]
# The map UO runs at the beginning of a timestep and generates a per-element/qp
# map of nucleus locations. The map is only regenerated if the mesh changed or
# the list of nuclei was modified.
# The map converts the nucleation points into finite area objects with a given radius.
type = DiscreteNucleationMap
periodic = c
inserter = inserter
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[BCs]
[./Periodic]
[./all]
auto_direction = 'x y'
[../]
[../]
[]
[Postprocessors]
[./dt]
type = TimestepSize
[../]
[./ndof]
type = NumDOFs
[../]
[./rate]
type = DiscreteNucleationData
value = RATE
inserter = inserter
[../]
[./dtnuc]
type = DiscreteNucleationTimeStep
inserter = inserter
p2nucleus = 0.0005
dt_max = 10
[../]
[./update]
type = DiscreteNucleationData
value = UPDATE
inserter = inserter
[../]
[./count]
type = DiscreteNucleationData
value = COUNT
inserter = inserter
[../]
[]
[Adaptivity]
[./Indicators]
[./jump]
type = GradientJumpIndicator
variable = c
[../]
[../]
[./Markers]
[./nuc]
type = DiscreteNucleationMarker
map = map
[../]
[./grad]
type = ValueThresholdMarker
variable = jump
coarsen = 0.1
refine = 0.2
[../]
[./combo]
type = ComboMarker
markers = 'nuc grad'
[../]
[../]
marker = combo
cycles_per_step = 3
recompute_markers_during_cycles = true
max_h_level = 3
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -sub_pc_type'
petsc_options_value = 'asm lu '
nl_max_its = 20
l_tol = 1.0e-4
nl_rel_tol = 1.0e-10
nl_abs_tol = 1.0e-10
start_time = 0.0
num_steps = 120
[./TimeStepper]
type = IterationAdaptiveDT
dt = 10
growth_factor = 1.5
cutback_factor = 0.5
optimal_iterations = 8
iteration_window = 2
timestep_limiting_postprocessor = dtnuc
[../]
[]
[Outputs]
exodus = true
csv = true
print_linear_residuals = false
[]
(modules/porous_flow/examples/thm_example/2D_c.i)
# Two phase, temperature-dependent, with mechanics and chemistry, radial with fine mesh, constant injection of cold co2 into a overburden-reservoir-underburden containing mostly water
# species=0 is water
# species=1 is co2
# phase=0 is liquid, and since massfrac_ph0_sp0 = 1, this is all water
# phase=1 is gas, and since massfrac_ph1_sp0 = 0, this is all co2
#
# The mesh used below has very high resolution, so the simulation takes a long time to complete.
# Some suggested meshes of different resolution:
# nx=50, bias_x=1.2
# nx=100, bias_x=1.1
# nx=200, bias_x=1.05
# nx=400, bias_x=1.02
# nx=1000, bias_x=1.01
# nx=2000, bias_x=1.003
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2000
bias_x = 1.003
xmin = 0.1
xmax = 5000
ny = 1
ymin = 0
ymax = 11
[]
[Problem]
coord_type = RZ
[]
[GlobalParams]
displacements = 'disp_r disp_z'
PorousFlowDictator = dictator
gravity = '0 0 0'
biot_coefficient = 1.0
[]
[Variables]
[pwater]
initial_condition = 18.3e6
[]
[sgas]
initial_condition = 0.0
[]
[temp]
initial_condition = 358
[]
[disp_r]
[]
[]
[AuxVariables]
[rate]
[]
[disp_z]
[]
[massfrac_ph0_sp0]
initial_condition = 1 # all H20 in phase=0
[]
[massfrac_ph1_sp0]
initial_condition = 0 # no H2O in phase=1
[]
[pgas]
family = MONOMIAL
order = FIRST
[]
[swater]
family = MONOMIAL
order = FIRST
[]
[stress_rr]
order = CONSTANT
family = MONOMIAL
[]
[stress_tt]
order = CONSTANT
family = MONOMIAL
[]
[stress_zz]
order = CONSTANT
family = MONOMIAL
[]
[mineral_conc_m3_per_m3]
family = MONOMIAL
order = CONSTANT
initial_condition = 0.1
[]
[eqm_const]
initial_condition = 0.0
[]
[porosity]
family = MONOMIAL
order = CONSTANT
[]
[]
[Kernels]
[mass_water_dot]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = pwater
[]
[flux_water]
type = PorousFlowAdvectiveFlux
fluid_component = 0
use_displaced_mesh = false
variable = pwater
[]
[mass_co2_dot]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = sgas
[]
[flux_co2]
type = PorousFlowAdvectiveFlux
fluid_component = 1
use_displaced_mesh = false
variable = sgas
[]
[energy_dot]
type = PorousFlowEnergyTimeDerivative
variable = temp
[]
[advection]
type = PorousFlowHeatAdvection
use_displaced_mesh = false
variable = temp
[]
[conduction]
type = PorousFlowExponentialDecay
use_displaced_mesh = false
variable = temp
reference = 358
rate = rate
[]
[grad_stress_r]
type = StressDivergenceRZTensors
temperature = temp
eigenstrain_names = thermal_contribution
variable = disp_r
use_displaced_mesh = false
component = 0
[]
[poro_r]
type = PorousFlowEffectiveStressCoupling
variable = disp_r
use_displaced_mesh = false
component = 0
[]
[]
[AuxKernels]
[rate]
type = FunctionAux
variable = rate
execute_on = timestep_begin
function = decay_rate
[]
[pgas]
type = PorousFlowPropertyAux
property = pressure
phase = 1
variable = pgas
[]
[swater]
type = PorousFlowPropertyAux
property = saturation
phase = 0
variable = swater
[]
[stress_rr]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_rr
index_i = 0
index_j = 0
[]
[stress_tt]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_tt
index_i = 2
index_j = 2
[]
[stress_zz]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_zz
index_i = 1
index_j = 1
[]
[mineral]
type = PorousFlowPropertyAux
property = mineral_concentration
mineral_species = 0
variable = mineral_conc_m3_per_m3
[]
[eqm_const_auxk]
type = ParsedAux
variable = eqm_const
coupled_variables = temp
expression = '(358 - temp) / (358 - 294)'
[]
[porosity_auxk]
type = PorousFlowPropertyAux
property = porosity
variable = porosity
[]
[]
[Functions]
[decay_rate]
# Eqn(26) of the first paper of LaForce et al.
# Ka * (rho C)_a = 10056886.914
# h = 11
type = ParsedFunction
expression = 'sqrt(10056886.914/t)/11.0'
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'temp pwater sgas disp_r'
number_fluid_phases = 2
number_fluid_components = 2
number_aqueous_kinetic = 1
aqueous_phase_number = 1
[]
[pc]
type = PorousFlowCapillaryPressureConst
pc = 0
[]
[]
[FluidProperties]
[water]
type = SimpleFluidProperties
bulk_modulus = 2.27e14
density0 = 970.0
viscosity = 0.3394e-3
cv = 4149.0
cp = 4149.0
porepressure_coefficient = 0.0
thermal_expansion = 0
[]
[co2]
type = SimpleFluidProperties
bulk_modulus = 2.27e14
density0 = 516.48
viscosity = 0.0393e-3
cv = 2920.5
cp = 2920.5
porepressure_coefficient = 0.0
thermal_expansion = 0
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = temp
[]
[ppss]
type = PorousFlow2PhasePS
phase0_porepressure = pwater
phase1_saturation = sgas
capillary_pressure = pc
[]
[massfrac]
type = PorousFlowMassFraction
mass_fraction_vars = 'massfrac_ph0_sp0 massfrac_ph1_sp0'
[]
[water]
type = PorousFlowSingleComponentFluid
fp = water
phase = 0
[]
[gas]
type = PorousFlowSingleComponentFluid
fp = co2
phase = 1
[]
[porosity_reservoir]
type = PorousFlowPorosity
porosity_zero = 0.2
chemical = true
reference_chemistry = 0.1
initial_mineral_concentrations = 0.1
[]
[permeability_reservoir]
type = PorousFlowPermeabilityConst
permeability = '2e-12 0 0 0 0 0 0 0 0'
[]
[relperm_liquid]
type = PorousFlowRelativePermeabilityCorey
n = 4
phase = 0
s_res = 0.200
sum_s_res = 0.405
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityBC
phase = 1
s_res = 0.205
sum_s_res = 0.405
nw_phase = true
lambda = 2
[]
[thermal_conductivity_reservoir]
type = PorousFlowThermalConductivityIdeal
dry_thermal_conductivity = '0 0 0 0 1.320 0 0 0 0'
wet_thermal_conductivity = '0 0 0 0 3.083 0 0 0 0'
[]
[internal_energy_reservoir]
type = PorousFlowMatrixInternalEnergy
specific_heat_capacity = 1100
density = 2350.0
[]
[elasticity_tensor]
type = ComputeIsotropicElasticityTensor
shear_modulus = 6.0E9
poissons_ratio = 0.2
[]
[strain]
type = ComputeAxisymmetricRZSmallStrain
eigenstrain_names = 'thermal_contribution ini_stress'
[]
[ini_strain]
type = ComputeEigenstrainFromInitialStress
initial_stress = '-12.8E6 0 0 0 -51.3E6 0 0 0 -12.8E6'
eigenstrain_name = ini_stress
[]
[thermal_contribution]
type = ComputeThermalExpansionEigenstrain
temperature = temp
stress_free_temperature = 358
thermal_expansion_coeff = 5E-6
eigenstrain_name = thermal_contribution
[]
[stress]
type = ComputeLinearElasticStress
[]
[eff_fluid_pressure]
type = PorousFlowEffectiveFluidPressure
[]
[vol_strain]
type = PorousFlowVolumetricStrain
[]
[predis]
type = PorousFlowAqueousPreDisChemistry
num_reactions = 1
primary_concentrations = 1.0 # fixed activity
equilibrium_constants_as_log10 = true
equilibrium_constants = eqm_const
primary_activity_coefficients = 1.0 # fixed activity
reactions = 1
kinetic_rate_constant = 1E-6
molar_volume = 1.0
specific_reactive_surface_area = 1.0
activation_energy = 0.0 # no Arrhenius
[]
[mineral_conc]
type = PorousFlowAqueousPreDisMineral
initial_concentrations = 0.1
[]
[predis_nodes]
type = PorousFlowAqueousPreDisChemistry
at_nodes = true
num_reactions = 1
primary_concentrations = 1.0 # fixed activity
equilibrium_constants_as_log10 = true
equilibrium_constants = eqm_const
primary_activity_coefficients = 1.0 # fixed activity
reactions = 1
kinetic_rate_constant = 1E-6
molar_volume = 1.0
specific_reactive_surface_area = 1.0
activation_energy = 0.0 # no Arrhenius
[]
[mineral_conc_nodes]
type = PorousFlowAqueousPreDisMineral
at_nodes = true
initial_concentrations = 0.1
[]
[]
[BCs]
[outer_pressure_fixed]
type = DirichletBC
boundary = right
value = 18.3e6
variable = pwater
[]
[outer_saturation_fixed]
type = DirichletBC
boundary = right
value = 0.0
variable = sgas
[]
[outer_temp_fixed]
type = DirichletBC
boundary = right
value = 358
variable = temp
[]
[fixed_outer_r]
type = DirichletBC
variable = disp_r
value = 0
boundary = right
[]
[co2_injection]
type = PorousFlowSink
boundary = left
variable = sgas
use_mobility = false
use_relperm = false
fluid_phase = 1
flux_function = 'min(t/100.0,1)*(-2.294001475)' # 5.0E5 T/year = 15.855 kg/s, over area of 2Pi*0.1*11
[]
[cold_co2]
type = DirichletBC
boundary = left
variable = temp
value = 294
[]
[cavity_pressure_x]
type = Pressure
boundary = left
variable = disp_r
component = 0
postprocessor = p_bh # note, this lags
use_displaced_mesh = false
[]
[]
[Postprocessors]
[p_bh]
type = PointValue
variable = pwater
point = '0.1 0 0'
execute_on = timestep_begin
use_displaced_mesh = false
[]
[mineral_bh] # mineral concentration (m^3(mineral)/m^3(rock)) at the borehole
type = PointValue
variable = mineral_conc_m3_per_m3
point = '0.1 0 0'
use_displaced_mesh = false
[]
[]
[VectorPostprocessors]
[ptsuss]
type = LineValueSampler
use_displaced_mesh = false
start_point = '0.1 0 0'
end_point = '5000 0 0'
sort_by = x
num_points = 50000
outputs = csv
variable = 'pwater temp sgas disp_r stress_rr stress_tt mineral_conc_m3_per_m3 porosity'
[]
[]
[Preconditioning]
active = 'smp'
[smp]
type = SMP
full = true
#petsc_options = '-snes_converged_reason -ksp_diagonal_scale -ksp_diagonal_scale_fix -ksp_gmres_modifiedgramschmidt -snes_linesearch_monitor'
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap -snes_atol -snes_rtol -snes_max_it'
petsc_options_value = 'gmres asm lu NONZERO 2 1E2 1E-5 50'
[]
[mumps]
type = SMP
full = true
petsc_options = '-snes_converged_reason -ksp_diagonal_scale -ksp_diagonal_scale_fix -ksp_gmres_modifiedgramschmidt -snes_linesearch_monitor'
petsc_options_iname = '-ksp_type -pc_type -pc_factor_mat_solver_package -pc_factor_shift_type -snes_rtol -snes_atol -snes_max_it'
petsc_options_value = 'gmres lu mumps NONZERO 1E-5 1E2 50'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 1.5768e8
#dtmax = 1e6
[TimeStepper]
type = IterationAdaptiveDT
dt = 1
growth_factor = 1.1
[]
[]
[Outputs]
print_linear_residuals = false
sync_times = '3600 86400 2.592E6 1.5768E8'
perf_graph = true
exodus = true
[csv]
type = CSV
sync_only = true
[]
[]
(modules/solid_mechanics/test/tests/anisotropic_elastoplasticity/ad_aniso_plasticity_x_one.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 3
nx = 10
ny = 2
nz = 2
xmin = 0.0
ymin = 0.0
zmin = 0.0
xmax = 10.0
ymax = 1.0
zmax = 1.0
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
volumetric_locking_correction = true
[]
[AuxVariables]
[hydrostatic_stress]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_xx]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_xy]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[hydrostatic_stress]
type = ADRankTwoScalarAux
variable = hydrostatic_stress
rank_two_tensor = stress
scalar_type = Hydrostatic
[]
[plasticity_strain_xx]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_xx
index_i = 0
index_j = 0
[]
[plasticity_strain_xy]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_xy
index_i = 0
index_j = 1
[]
[plasticity_strain_yy]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_yy
index_i = 1
index_j = 1
[]
[sigma_xx]
type = ADRankTwoAux
rank_two_tensor = stress
variable = stress_xx
index_i = 1
index_j = 1
[]
[]
[Functions]
[pull]
type = PiecewiseLinear
x = '0 1e1 1e8'
y = '0 -4e2 -4e2'
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = FINITE
generate_output = 'elastic_strain_xx stress_xx'
use_automatic_differentiation = true
add_variables = true
[]
[]
[Materials]
[elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 70000
poissons_ratio = 0.25
[]
[elastic_strain]
type = ADComputeMultipleInelasticStress
inelastic_models = "trial_plasticity"
max_iterations = 50
absolute_tolerance = 1e-16
[]
[hill_tensor]
type = ADHillConstants
# F G H L M N
hill_constants = "0.5829856 0.364424 0.6342174 2.0691375 2.3492325 1.814589"
[]
[trial_plasticity]
type = ADHillElastoPlasticityStressUpdate
hardening_constant = 2000.0
yield_stress = 0.001 # was 200 for verification
absolute_tolerance = 1e-15
relative_tolerance = 1e-13
# internal_solve_full_iteration_history = true
max_inelastic_increment = 2.0e-6
# internal_solve_output_on = on_error
[]
[]
[BCs]
[no_disp_x]
type = ADDirichletBC
variable = disp_x
boundary = left
value = 0.0
[]
[no_disp_y]
type = ADDirichletBC
variable = disp_y
boundary = left
value = 0.0
[]
[no_disp_z]
type = ADDirichletBC
variable = disp_z
boundary = left
value = 0.0
[]
[Pressure]
[Side1]
boundary = right
function = pull
[]
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_rel_tol = 1e-12
nl_abs_tol = 1.0e-14
l_max_its = 90
num_steps = 25
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 30
iteration_window = 9
growth_factor = 1.05
cutback_factor = 0.5
timestep_limiting_postprocessor = matl_ts_min
dt = 1.0e-5
time_t = '0 3.4e-5 10'
time_dt = '1.0e-5 1.0e-7 1.0e-7'
[]
start_time = 0
automatic_scaling = true
[]
[Postprocessors]
[matl_ts_min]
type = MaterialTimeStepPostprocessor
[]
[max_disp_x]
type = ElementExtremeValue
variable = disp_x
[]
[max_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
[]
[dt]
type = TimestepSize
[]
[plasticity_strain_xx]
type = ElementalVariableValue
variable = plastic_strain_xx
execute_on = 'TIMESTEP_END'
elementid = 0
[]
[elastic_strain_xx]
type = ElementalVariableValue
variable = elastic_strain_xx
execute_on = 'TIMESTEP_END'
elementid = 0
[]
[sigma_xx]
type = ElementalVariableValue
variable = stress_xx
execute_on = 'TIMESTEP_END'
elementid = 0
[]
[]
[Outputs]
csv = true
perf_graph = true
[]
(modules/heat_transfer/test/tests/recover/recover.i)
[GlobalParams]
order = SECOND
family = LAGRANGE
[]
[Problem]
coord_type = RZ
[]
[Mesh]
file = recover_in.e
[]
[Variables]
[./temp]
initial_condition = 580.0
[../]
[]
[AuxVariables]
[./gap_cond]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./heat]
type = HeatConduction
variable = temp
[../]
[./heat_source]
type = BodyForce
variable = temp
block = pellet_type_1
value = 1e3
function = 't'
[../]
[]
[ThermalContact]
[./thermal_contact]
type = GapHeatTransfer
variable = temp
primary = 5
secondary = 10
emissivity_primary = 0
emissivity_secondary = 0
quadrature = true
[../]
[]
[BCs]
[./outside]
type = DirichletBC
value = 580
boundary = '1 2 3'
variable = temp
[../]
[./edge]
type = DirichletBC
value = 700
boundary = 10
variable = temp
[../]
[]
[Materials]
[./thermal_3]
type = HeatConductionMaterial
block = 3
thermal_conductivity = 5
specific_heat = 12
[../]
[./thermal_1]
type = HeatConductionMaterial
block = 1
thermal_conductivity = 16.0
specific_heat = 330.0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options = '-snes_ksp_ew'
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = ' lu superlu_dist'
nl_rel_tol = 1e-9
nl_abs_tol = 1e-11
start_time = -200
n_startup_steps = 1
end_time = 1.02e5
num_steps = 10
dtmax = 2e6
dtmin = 1
[./TimeStepper]
type = IterationAdaptiveDT
dt = 2.0e2
optimal_iterations = 15
iteration_window = 2
[../]
[./Quadrature]
order = FIFTH
side_order = SEVENTH
[../]
[]
[Postprocessors]
[./ave_temp_interior]
type = SideAverageValue
boundary = 9
variable = temp
execute_on = 'initial linear'
[../]
[./avg_clad_temp]
type = SideAverageValue
boundary = 7
variable = temp
execute_on = 'initial timestep_end'
[../]
[./flux_from_clad]
type = SideDiffusiveFluxIntegral
variable = temp
boundary = 5
diffusivity = thermal_conductivity
[../]
[./_dt]
type = TimestepSize
[../]
[]
[Outputs]
exodus = true
[]
(modules/solid_mechanics/test/tests/ad_anisotropic_creep/aniso_creep_integration_error.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 3
nx = 10
ny = 2
nz = 2
xmin = 0.0
ymin = 0.0
zmin = 0.0
xmax = 10.0
ymax = 1.0
zmax = 1.0
[]
[corner_node]
type = ExtraNodesetGenerator
new_boundary = '100'
nodes = '3 69'
input = gen
[]
[corner_node_2]
type = ExtraNodesetGenerator
new_boundary = '101'
nodes = '4 47'
input = corner_node
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
volumetric_locking_correction = true
[]
[AuxVariables]
[hydrostatic_stress]
order = CONSTANT
family = MONOMIAL
[]
[creep_strain_xx]
order = CONSTANT
family = MONOMIAL
[]
[creep_strain_xy]
order = CONSTANT
family = MONOMIAL
[]
[creep_strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[hydrostatic_stress]
type = RankTwoScalarAux
variable = hydrostatic_stress
rank_two_tensor = stress
scalar_type = Hydrostatic
[]
[creep_strain_xx]
type = RankTwoAux
rank_two_tensor = creep_strain
variable = creep_strain_xx
index_i = 0
index_j = 0
[]
[creep_strain_xy]
type = RankTwoAux
rank_two_tensor = creep_strain
variable = creep_strain_xy
index_i = 0
index_j = 1
[]
[creep_strain_yy]
type = RankTwoAux
rank_two_tensor = creep_strain
variable = creep_strain_yy
index_i = 1
index_j = 1
[]
[sigma_xx]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_xx
index_i = 1
index_j = 1
[]
[]
[Functions]
[pull]
type = PiecewiseLinear
x = '0 1.0'
y = '0 -4e1'
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = FINITE
generate_output = 'elastic_strain_xx stress_xx'
use_automatic_differentiation = false
add_variables = true
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 7000
poissons_ratio = 0.0
[]
[elastic_strain]
type = ComputeMultipleInelasticStress
inelastic_models = "trial_creep_two"
max_iterations = 50
absolute_tolerance = 1e-16
[]
[hill_tensor]
type = HillConstants
# F G H L M N
hill_constants = "0.5 0.25 0.3866 1.6413 1.6413 1.2731"
[]
[trial_creep_two]
type = HillCreepStressUpdate
coefficient = 1e-16
n_exponent = 9
m_exponent = 0
activation_energy = 0
max_inelastic_increment = 1.0e-4
absolute_tolerance = 1e-20
relative_tolerance = 1e-20
max_integration_error = 1.0e-5
[]
[]
[BCs]
[no_disp_x]
type = DirichletBC
variable = disp_x
boundary = left
value = 0.0
[]
[no_disp_y]
type = DirichletBC
variable = disp_y
boundary = 100
value = 0.0
[]
[no_disp_z]
type = DirichletBC
variable = disp_z
boundary = 101
value = 0.0
[]
[Pressure]
[Side1]
boundary = right
function = pull
[]
[]
[]
[UserObjects]
[terminator_creep]
type = Terminator
expression = 'time_step_size > matl_ts_min'
fail_mode = SOFT
execute_on = TIMESTEP_END
[]
[]
[Executioner]
type = Transient
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_rel_tol = 1.0e-13
nl_abs_tol = 1.0e-13
l_max_its = 10
end_time = 1.65e-1
dt = 2.5e-2
start_time = 0
automatic_scaling = true
[./TimeStepper]
type = IterationAdaptiveDT
dt = 2.5e-2
time_t = '0.0 10.0'
time_dt = '2.5e-2 2.5e-2 '
optimal_iterations = 30
iteration_window = 9
growth_factor = 1.5
cutback_factor = 0.5
timestep_limiting_postprocessor = matl_ts_min
[../]
[]
[Postprocessors]
[time_step_size]
type = TimestepSize
[]
[matl_ts_min]
type = MaterialTimeStepPostprocessor
[]
[max_disp_x]
type = ElementExtremeValue
variable = disp_x
[]
[max_disp_y]
type = ElementExtremeValue
variable = disp_y
[]
[max_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
[]
[dt]
type = TimestepSize
[]
[num_lin]
type = NumLinearIterations
outputs = console
[]
[num_nonlin]
type = NumNonlinearIterations
outputs = console
[]
[creep_strain_xx]
type = ElementalVariableValue
variable = creep_strain_xx
execute_on = 'TIMESTEP_END'
elementid = 39
[]
[elastic_strain_xx]
type = ElementalVariableValue
variable = elastic_strain_xx
execute_on = 'TIMESTEP_END'
elementid = 39
[]
[sigma_xx]
type = ElementalVariableValue
variable = stress_xx
execute_on = 'TIMESTEP_END'
elementid = 39
[]
[]
[Outputs]
csv = true
exodus = true
perf_graph = true
[]
(modules/navier_stokes/test/tests/finite_element/ins/mms/supg/supg_pspg_adv_dominated_mms.i)
mu=1.5e-4
rho=2.5
[GlobalParams]
gravity = '0 0 0'
supg = true
pspg = true
convective_term = true
integrate_p_by_parts = false
transient_term = true
laplace = true
u = vel_x
v = vel_y
pressure = p
alpha = 1e0
order = FIRST
family = LAGRANGE
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1.0
ymin = 0
ymax = 1.0
elem_type = QUAD9
nx = 4
ny = 4
[]
[./corner_node]
type = ExtraNodesetGenerator
new_boundary = 'pinned_node'
nodes = '0'
input = gen
[../]
[]
[Variables]
[./vel_x]
[../]
[./vel_y]
[../]
[./p]
order = FIRST
[../]
[]
[Kernels]
# mass
[./mass]
type = INSMass
variable = p
x_vel_forcing_func = vel_x_source_func
y_vel_forcing_func = vel_y_source_func
[../]
[./x_time]
type = INSMomentumTimeDerivative
variable = vel_x
[../]
[./y_time]
type = INSMomentumTimeDerivative
variable = vel_y
[../]
# x-momentum, space
[./x_momentum_space]
type = INSMomentumLaplaceForm
variable = vel_x
component = 0
forcing_func = vel_x_source_func
[../]
# y-momentum, space
[./y_momentum_space]
type = INSMomentumLaplaceForm
variable = vel_y
component = 1
forcing_func = vel_y_source_func
[../]
[./p_source]
type = BodyForce
function = p_source_func
variable = p
[../]
[]
[BCs]
[./vel_x]
type = FunctionDirichletBC
boundary = 'left right top bottom'
function = vel_x_func
variable = vel_x
[../]
[./vel_y]
type = FunctionDirichletBC
boundary = 'left right top bottom'
function = vel_y_func
variable = vel_y
[../]
[./p]
type = FunctionDirichletBC
boundary = 'left right top bottom'
function = p_func
variable = p
[../]
[]
[Functions]
[./vel_x_source_func]
type = ParsedFunction
expression = '-${mu}*(-0.028*pi^2*x^2*sin(0.2*pi*x*y) - 0.028*pi^2*y^2*sin(0.2*pi*x*y) - 0.1*pi^2*sin(0.5*pi*x) - 0.4*pi^2*sin(pi*y)) + ${rho}*(0.14*pi*x*cos(0.2*pi*x*y) + 0.4*pi*cos(pi*y))*(0.6*sin(0.8*pi*x) + 0.3*sin(0.3*pi*y) + 0.2*sin(0.3*pi*x*y) + 0.3) + ${rho}*(0.14*pi*y*cos(0.2*pi*x*y) + 0.2*pi*cos(0.5*pi*x))*(0.4*sin(0.5*pi*x) + 0.4*sin(pi*y) + 0.7*sin(0.2*pi*x*y) + 0.5) + 0.1*pi*y*cos(0.2*pi*x*y) + 0.25*pi*cos(0.5*pi*x)'
[../]
[./vel_y_source_func]
type = ParsedFunction
expression = '-${mu}*(-0.018*pi^2*x^2*sin(0.3*pi*x*y) - 0.018*pi^2*y^2*sin(0.3*pi*x*y) - 0.384*pi^2*sin(0.8*pi*x) - 0.027*pi^2*sin(0.3*pi*y)) + ${rho}*(0.06*pi*x*cos(0.3*pi*x*y) + 0.09*pi*cos(0.3*pi*y))*(0.6*sin(0.8*pi*x) + 0.3*sin(0.3*pi*y) + 0.2*sin(0.3*pi*x*y) + 0.3) + ${rho}*(0.06*pi*y*cos(0.3*pi*x*y) + 0.48*pi*cos(0.8*pi*x))*(0.4*sin(0.5*pi*x) + 0.4*sin(pi*y) + 0.7*sin(0.2*pi*x*y) + 0.5) + 0.1*pi*x*cos(0.2*pi*x*y) + 0.3*pi*cos(0.3*pi*y)'
[../]
[./p_source_func]
type = ParsedFunction
expression = '-0.06*pi*x*cos(0.3*pi*x*y) - 0.14*pi*y*cos(0.2*pi*x*y) - 0.2*pi*cos(0.5*pi*x) - 0.09*pi*cos(0.3*pi*y)'
[../]
[./vel_x_func]
type = ParsedFunction
expression = '0.4*sin(0.5*pi*x) + 0.4*sin(pi*y) + 0.7*sin(0.2*pi*x*y) + 0.5'
[../]
[./vel_y_func]
type = ParsedFunction
expression = '0.6*sin(0.8*pi*x) + 0.3*sin(0.3*pi*y) + 0.2*sin(0.3*pi*x*y) + 0.3'
[../]
[./p_func]
type = ParsedFunction
expression = '0.5*sin(0.5*pi*x) + 1.0*sin(0.3*pi*y) + 0.5*sin(0.2*pi*x*y) + 0.5'
[../]
[./vxx_func]
type = ParsedFunction
expression = '0.14*pi*y*cos(0.2*pi*x*y) + 0.2*pi*cos(0.5*pi*x)'
[../]
[]
[Materials]
[./const]
type = GenericConstantMaterial
block = 0
prop_names = 'rho mu'
prop_values = '${rho} ${mu}'
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
solve_type = 'NEWTON'
[../]
[]
[Executioner]
petsc_options = '-snes_converged_reason -ksp_converged_reason -snes_view'
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu NONZERO superlu_dist'
line_search = 'none'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-12
nl_max_its = 10
l_tol = 1e-6
l_max_its = 10
# To run to steady-state, set num-steps to some large number (1000000 for example)
type = Transient
num_steps = 10
steady_state_detection = true
steady_state_tolerance = 1e-10
[./TimeStepper]
dt = .1
type = IterationAdaptiveDT
cutback_factor = 0.4
growth_factor = 1.2
optimal_iterations = 20
[../]
[]
[Outputs]
execute_on = 'final'
[./exodus]
type = Exodus
[../]
[./csv]
type = CSV
[../]
[]
[Postprocessors]
[./L2vel_x]
type = ElementL2Error
variable = vel_x
function = vel_x_func
outputs = 'console' execute_on = 'timestep_end'
[../]
[./L2vel_y]
variable = vel_y
function = vel_y_func
type = ElementL2Error
outputs = 'console' execute_on = 'timestep_end'
[../]
[./L2p]
variable = p
function = p_func
type = ElementL2Error
outputs = 'console' execute_on = 'timestep_end'
[../]
[./L2vxx]
variable = vxx
function = vxx_func
type = ElementL2Error
outputs = 'console' execute_on = 'timestep_end'
[../]
[]
[AuxVariables]
[./vxx]
family = MONOMIAL
order = FIRST
[../]
[]
[AuxKernels]
[./vxx]
type = VariableGradientComponent
component = x
variable = vxx
gradient_variable = vel_x
[../]
[]
(test/tests/time_steppers/time_stepper_system/multiple_timesteppers.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
[]
[]
[Functions]
[dts]
type = PiecewiseLinear
x = '0 0.85 2'
y = '0.2 0.15 0.2'
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Transient
end_time = 0.8
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
# Use as many different time steppers as we could to test the compositionDT,
# SolutionTimeAdaptiveDT give slightly different dt per run, set rel_err = 1e-2
# to ensure the test won't fail due to the small difference in the high-digit.
[TimeSteppers]
[ConstDT1]
type = ConstantDT
dt = 0.2
[]
[FunctionDT]
type = FunctionDT
function = dts
[]
[LogConstDT]
type = LogConstantDT
log_dt = 0.2
first_dt = 0.1
[]
[IterationAdapDT]
type = IterationAdaptiveDT
dt = 0.5
[]
[Timesequence]
type = TimeSequenceStepper
time_sequence = '0 0.25 0.3 0.5 0.8'
[]
[PPDT]
type = PostprocessorDT
postprocessor = PostDT
dt = 0.1
[]
[]
[]
[Postprocessors]
[timestep]
type = TimePostprocessor
execute_on = 'timestep_end'
[]
[PostDT]
type = ElementAverageValue
variable = u
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
csv = true
file_base='multiple_timesteppers'
[]
(modules/navier_stokes/test/tests/finite_volume/cns/pressure_outlet/subsonic_nozzle_fixed_inflow_hllc.i)
inlet_vel = 120
rho_in = 0.8719748696
H_in = 4.0138771448e+05
gamma = 1.4
R = 8.3145
molar_mass = 29e-3
R_specific = ${fparse R / molar_mass}
cp = ${fparse gamma * R_specific / (gamma - 1)}
cv = ${fparse cp / gamma}
T_in = ${fparse H_in / gamma / cv}
mass_flux = ${fparse inlet_vel * rho_in}
outlet_pressure = 0.9e5
[GlobalParams]
fp = fp
[]
[Debug]
show_material_props = true
[]
[Mesh]
[file]
type = FileMeshGenerator
file = subsonic_nozzle.e
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Variables]
[rho]
family = MONOMIAL
order = CONSTANT
fv = true
initial_condition = 0.8719748696
[]
[rho_u]
family = MONOMIAL
order = CONSTANT
fv = true
initial_condition = 1e-4
[]
[rho_v]
family = MONOMIAL
order = CONSTANT
fv = true
[]
[rho_E]
family = MONOMIAL
order = CONSTANT
fv = true
initial_condition = 2.5e5
[]
[]
[FVKernels]
# Mass conservation
[mass_time]
type = FVTimeKernel
variable = rho
[]
[mass_advection]
type = CNSFVMassHLLC
variable = rho
[]
# Momentum x conservation
[momentum_x_time]
type = FVTimeKernel
variable = rho_u
[]
[momentum_x_advection]
type = CNSFVMomentumHLLC
variable = rho_u
momentum_component = x
[]
# Momentum y conservation
[momentum_y_time]
type = FVTimeKernel
variable = rho_v
[]
[momentum_y_advection]
type = CNSFVMomentumHLLC
variable = rho_v
momentum_component = y
[]
# Fluid energy conservation
[fluid_energy_time]
type = FVTimeKernel
variable = rho_E
[]
[fluid_energy_advection]
type = CNSFVFluidEnergyHLLC
variable = rho_E
[]
[]
[FVBCs]
## inflow boundaries
[mass_inflow]
type = CNSFVHLLCSpecifiedMassFluxAndTemperatureMassBC
variable = rho
boundary = left
rhou = ${mass_flux}
rhov = 0
temperature = ${T_in}
[]
[momentum_x_inflow]
type = CNSFVHLLCSpecifiedMassFluxAndTemperatureMomentumBC
variable = rho_u
boundary = left
rhou = ${mass_flux}
rhov = 0
temperature = ${T_in}
momentum_component = x
[]
[momentum_y_inflow]
type = CNSFVHLLCSpecifiedMassFluxAndTemperatureMomentumBC
variable = rho_v
boundary = left
rhou = ${mass_flux}
rhov = 0
temperature = ${T_in}
momentum_component = y
[]
[fluid_energy_inflow]
type = CNSFVHLLCSpecifiedMassFluxAndTemperatureFluidEnergyBC
variable = rho_E
boundary = left
rhou = ${mass_flux}
rhov = 0
temperature = ${T_in}
[]
## outflow conditions
[mass_outflow]
type = CNSFVHLLCSpecifiedPressureMassBC
variable = rho
boundary = right
pressure = ${outlet_pressure}
[]
[momentum_x_outflow]
type = CNSFVHLLCSpecifiedPressureMomentumBC
variable = rho_u
boundary = right
momentum_component = x
pressure = ${outlet_pressure}
[]
[momentum_y_outflow]
type = CNSFVHLLCSpecifiedPressureMomentumBC
variable = rho_v
boundary = right
momentum_component = y
pressure = ${outlet_pressure}
[]
[fluid_energy_outflow]
type = CNSFVHLLCSpecifiedPressureFluidEnergyBC
variable = rho_E
boundary = right
pressure = ${outlet_pressure}
[]
# wall conditions
[momentum_x_pressure_wall]
type = CNSFVMomImplicitPressureBC
variable = rho_u
momentum_component = x
boundary = wall
[]
[momentum_y_pressure_wall]
type = CNSFVMomImplicitPressureBC
variable = rho_v
momentum_component = y
boundary = wall
[]
[]
[AuxVariables]
[Ma]
family = MONOMIAL
order = CONSTANT
[]
[p]
family = MONOMIAL
order = CONSTANT
[]
[Ma_layered]
family = MONOMIAL
order = CONSTANT
[]
[]
[UserObjects]
[layered_Ma_UO]
type = LayeredAverage
variable = Ma
num_layers = 10
direction = x
[]
[]
[AuxKernels]
[Ma_aux]
type = NSMachAux
variable = Ma
fluid_properties = fp
use_material_properties = true
[]
[p_aux]
type = ADMaterialRealAux
variable = p
property = pressure
[]
[Ma_layered_aux]
type = SpatialUserObjectAux
variable = Ma_layered
user_object = layered_Ma_UO
[]
[]
[Materials]
[var_mat]
type = ConservedVarValuesMaterial
rho = rho
rhou = rho_u
rhov = rho_v
rho_et = rho_E
[]
[sound_speed]
type = SoundspeedMat
[]
[]
[Postprocessors]
[outflow_Ma]
type = SideAverageValue
variable = Ma
boundary = right
[]
[outflow_pressure]
type = SideAverageValue
variable = p
boundary = right
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[]
[Executioner]
type = Transient
end_time = 10
solve_type = NEWTON
nl_abs_tol = 1e-7
[TimeIntegrator]
type = ImplicitEuler
[]
[TimeStepper]
type = IterationAdaptiveDT
dt = 5e-3
optimal_iterations = 6
growth_factor = 1.5
[]
[]
[VectorPostprocessors]
[Ma_layered]
type = LineValueSampler
variable = Ma_layered
start_point = '0 0 0'
end_point = '3 0 0'
num_points = 100
sort_by = x
warn_discontinuous_face_values = false
[]
[]
[Outputs]
[out]
type = Exodus
execute_on = 'final'
[]
[]
(modules/porous_flow/examples/ates/ates.i)
# Simulation designed to assess the recovery efficiency of a single-well ATES system
# Using KT stabilisation
# Boundary conditions: fixed porepressure and temperature at top, bottom and far end of model.
#####################################
flux_limiter = minmod # minmod, vanleer, mc, superbee, none
# depth of top of aquifer (m)
depth = 400
inject_fluid_mass = 1E8 # kg
produce_fluid_mass = ${inject_fluid_mass} # kg
inject_temp = 90 # degC
inject_time = 91 # days
store_time = 91 # days
produce_time = 91 # days
rest_time = 91 # days
num_cycles = 5 # Currently needs to be <= 10
cycle_length = ${fparse inject_time + store_time + produce_time + rest_time}
end_simulation = ${fparse cycle_length * num_cycles}
# Note: I have setup 10 cycles but you can set num_cycles less than 10.
start_injection1 = 0
start_injection2 = ${cycle_length}
start_injection3 = ${fparse cycle_length * 2}
start_injection4 = ${fparse cycle_length * 3}
start_injection5 = ${fparse cycle_length * 4}
start_injection6 = ${fparse cycle_length * 5}
start_injection7 = ${fparse cycle_length * 6}
start_injection8 = ${fparse cycle_length * 7}
start_injection9 = ${fparse cycle_length * 8}
start_injection10 = ${fparse cycle_length * 9}
end_injection1 = ${fparse start_injection1 + inject_time}
end_injection2 = ${fparse start_injection2 + inject_time}
end_injection3 = ${fparse start_injection3 + inject_time}
end_injection4 = ${fparse start_injection4 + inject_time}
end_injection5 = ${fparse start_injection5 + inject_time}
end_injection6 = ${fparse start_injection6 + inject_time}
end_injection7 = ${fparse start_injection7 + inject_time}
end_injection8 = ${fparse start_injection8 + inject_time}
end_injection9 = ${fparse start_injection9 + inject_time}
end_injection10 = ${fparse start_injection10 + inject_time}
start_production1 = ${fparse end_injection1 + store_time}
start_production2 = ${fparse end_injection2 + store_time}
start_production3 = ${fparse end_injection3 + store_time}
start_production4 = ${fparse end_injection4 + store_time}
start_production5 = ${fparse end_injection5 + store_time}
start_production6 = ${fparse end_injection6 + store_time}
start_production7 = ${fparse end_injection7 + store_time}
start_production8 = ${fparse end_injection8 + store_time}
start_production9 = ${fparse end_injection9 + store_time}
start_production10 = ${fparse end_injection10 + store_time}
end_production1 = ${fparse start_production1 + produce_time}
end_production2 = ${fparse start_production2 + produce_time}
end_production3 = ${fparse start_production3 + produce_time}
end_production4 = ${fparse start_production4 + produce_time}
end_production5 = ${fparse start_production5 + produce_time}
end_production6 = ${fparse start_production6 + produce_time}
end_production7 = ${fparse start_production7 + produce_time}
end_production8 = ${fparse start_production8 + produce_time}
end_production9 = ${fparse start_production9 + produce_time}
end_production10 = ${fparse start_production10 + produce_time}
synctimes = '${start_injection1} ${end_injection1} ${start_production1} ${end_production1}
${start_injection2} ${end_injection2} ${start_production2} ${end_production2}
${start_injection3} ${end_injection3} ${start_production3} ${end_production3}
${start_injection4} ${end_injection4} ${start_production4} ${end_production4}
${start_injection5} ${end_injection5} ${start_production5} ${end_production5}
${start_injection6} ${end_injection6} ${start_production6} ${end_production6}
${start_injection7} ${end_injection7} ${start_production7} ${end_production7}
${start_injection8} ${end_injection8} ${start_production8} ${end_production8}
${start_injection9} ${end_injection9} ${start_production9} ${end_production9}
${start_injection10} ${end_injection10} ${start_production10} ${end_production10}'
#####################################
# Geometry in RZ coordinates
# borehole radius (m)
bh_r = 0.1
# model radius (m)
max_r = 1000
# aquifer thickness (m)
aq_thickness = 20
# cap thickness (m)
cap_thickness = 40
# injection region top and bottom (m). Note, the mesh is created with the aquifer in y = (-0.5 * aq_thickness, 0.5 * aq_thickness), irrespective of depth (depth only sets the insitu porepressure and temperature)
screen_top = ${fparse 0.5 * aq_thickness}
screen_bottom = ${fparse -0.5 * aq_thickness}
# number of elements in radial direction
num_r = 25
# number of elements across half height of aquifer
num_y_aq = 10
# number of elements across height of cap
num_y_cap = 8
# mesh bias in radial direction
bias_r = 1.22
# mesh bias in vertical direction in aquifer top
bias_y_aq_top = 0.9
# mesh bias in vertical direction in cap top
bias_y_cap_top = 1.3
# mesh bias in vertical direction in aquifer bottom
bias_y_aq_bottom = ${fparse 1.0 / bias_y_aq_top}
# mesh bias in vertical direction in cap bottom
bias_y_cap_bottom = ${fparse 1.0 / bias_y_cap_top}
depth_centre = ${fparse depth + aq_thickness/2}
#####################################
# temperature at ground surface (degC)
temp0 = 20
# Vertical geothermal gradient (K/m). A positive number means temperature increases downwards.
geothermal_gradient = 20E-3
#####################################
# Gravity
gravity = -9.81
#####################################
half_aq_thickness = ${fparse aq_thickness * 0.5}
half_height = ${fparse half_aq_thickness + cap_thickness}
approx_screen_length = ${fparse screen_top - screen_bottom}
# Thermal radius (note this is not strictly correct, it should use the bulk specific heat
# capacity as defined below, but it doesn't matter here because this is purely for
# defining the region of refined mesh)
th_r = ${fparse sqrt(inject_fluid_mass / 1000 * 4.12e6 / (approx_screen_length * 3.1416 * aq_specific_heat_cap * aq_density))}
# radius of fine mesh
fine_r = ${fparse th_r * 2}
bias_r_fine = 1
num_r_fine = ${fparse int(fine_r/1)}
######################################
# aquifer properties
aq_porosity = 0.25
aq_hor_perm = 1E-11 # m^2
aq_ver_perm = 2E-12 # m^2
aq_density = 2650 # kg/m^3
aq_specific_heat_cap = 800 # J/Kg/K
aq_hor_thermal_cond = 3 # W/m/K
aq_ver_thermal_cond = 3 # W/m/K
aq_disp_parallel = 0 # m
aq_disp_perp = 0 # m
# Bulk volumetric heat capacity of aquifer:
aq_vol_cp = ${fparse aq_specific_heat_cap * aq_density * (1 - aq_porosity) + 4180 * 1000 * aq_porosity}
# Thermal radius (correct version using bulk cp):
R_th = ${fparse sqrt(inject_fluid_mass * 4180 / (approx_screen_length * 3.1416 * aq_vol_cp))}
aq_lambda_eff_hor = ${fparse aq_hor_thermal_cond + 0.3 * aq_disp_parallel * R_th * aq_vol_cp / (inject_time * 60 * 60 * 24)}
aq_lambda_eff_ver = ${fparse aq_ver_thermal_cond + 0.3 * aq_disp_perp * R_th * aq_vol_cp / (inject_time * 60 * 60 * 24)}
aq_hor_dry_thermal_cond = ${fparse aq_lambda_eff_hor * 60 * 60 * 24} # J/day/m/K
aq_ver_dry_thermal_cond = ${fparse aq_lambda_eff_ver * 60 * 60 * 24} # J/day/m/K
aq_hor_wet_thermal_cond = ${fparse aq_lambda_eff_hor * 60 * 60 * 24} # J/day/m/K
aq_ver_wet_thermal_cond = ${fparse aq_lambda_eff_ver * 60 * 60 * 24} # J/day/m/K
# cap-rock properties
cap_porosity = 0.25
cap_hor_perm = 1E-16 # m^2
cap_ver_perm = 1E-17 # m^2
cap_density = 2650 # kg/m^3
cap_specific_heat_cap = 800 # J/kg/K
cap_hor_thermal_cond = 3 # W/m/K
cap_ver_thermal_cond = 3 # W/m/K
cap_hor_dry_thermal_cond = ${fparse cap_hor_thermal_cond * 60 * 60 * 24} # J/day/m/K
cap_ver_dry_thermal_cond = ${fparse cap_ver_thermal_cond * 60 * 60 * 24} # J/day/m/K
cap_hor_wet_thermal_cond = ${fparse cap_hor_thermal_cond * 60 * 60 * 24} # J/day/m/K
cap_ver_wet_thermal_cond = ${fparse cap_ver_thermal_cond * 60 * 60 * 24} # J/day/m/K
######################################
[Mesh]
coord_type = RZ
[aq_top_fine]
type = GeneratedMeshGenerator
dim = 2
nx = ${num_r_fine}
xmin = ${bh_r}
xmax = ${fine_r}
bias_x = ${bias_r_fine}
bias_y = ${bias_y_aq_top}
ny = ${num_y_aq}
ymin = 0
ymax = ${half_aq_thickness}
[]
[cap_top_fine]
type = GeneratedMeshGenerator
dim = 2
nx = ${num_r_fine}
xmin = ${bh_r}
xmax = ${fine_r}
bias_x = ${bias_r_fine}
bias_y = ${bias_y_cap_top}
ny = ${num_y_cap}
ymax = ${half_height}
ymin = ${half_aq_thickness}
[]
[aq_and_cap_top_fine]
type = StitchedMeshGenerator
inputs = 'aq_top_fine cap_top_fine'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'top bottom'
[]
[aq_bottom_fine]
type = GeneratedMeshGenerator
dim = 2
nx = ${num_r_fine}
xmin = ${bh_r}
xmax = ${fine_r}
bias_x = ${bias_r_fine}
bias_y = ${bias_y_aq_bottom}
ny = ${num_y_aq}
ymax = 0
ymin = -${half_aq_thickness}
[]
[cap_bottom_fine]
type = GeneratedMeshGenerator
dim = 2
nx = ${num_r_fine}
xmin = ${bh_r}
xmax = ${fine_r}
bias_x = ${bias_r_fine}
bias_y = ${bias_y_cap_bottom}
ny = ${num_y_cap}
ymin = -${half_height}
ymax = -${half_aq_thickness}
[]
[aq_and_cap_bottom_fine]
type = StitchedMeshGenerator
inputs = 'aq_bottom_fine cap_bottom_fine'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'bottom top'
[]
[aq_and_cap_fine]
type = StitchedMeshGenerator
inputs = 'aq_and_cap_bottom_fine aq_and_cap_top_fine'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'top bottom'
[]
[aq_top]
type = GeneratedMeshGenerator
dim = 2
nx = ${num_r}
xmin = ${fine_r}
xmax = ${max_r}
bias_x = ${bias_r}
bias_y = ${bias_y_aq_top}
ny = ${num_y_aq}
ymin = 0
ymax = ${half_aq_thickness}
[]
[cap_top]
type = GeneratedMeshGenerator
dim = 2
nx = ${num_r}
xmin = ${fine_r}
xmax = ${max_r}
bias_x = ${bias_r}
bias_y = ${bias_y_cap_top}
ny = ${num_y_cap}
ymax = ${half_height}
ymin = ${half_aq_thickness}
[]
[aq_and_cap_top]
type = StitchedMeshGenerator
inputs = 'aq_top cap_top'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'top bottom'
[]
[aq_bottom]
type = GeneratedMeshGenerator
dim = 2
nx = ${num_r}
xmin = ${fine_r}
xmax = ${max_r}
bias_x = ${bias_r}
bias_y = ${bias_y_aq_bottom}
ny = ${num_y_aq}
ymax = 0
ymin = -${half_aq_thickness}
[]
[cap_bottom]
type = GeneratedMeshGenerator
dim = 2
nx = ${num_r}
xmin = ${fine_r}
xmax = ${max_r}
bias_x = ${bias_r}
bias_y = ${bias_y_cap_bottom}
ny = ${num_y_cap}
ymin = -${half_height}
ymax = -${half_aq_thickness}
[]
[aq_and_cap_bottom]
type = StitchedMeshGenerator
inputs = 'aq_bottom cap_bottom'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'bottom top'
[]
[aq_and_cap]
type = StitchedMeshGenerator
inputs = 'aq_and_cap_bottom aq_and_cap_top'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'top bottom'
[]
[aq_and_cap_all]
type = StitchedMeshGenerator
inputs = 'aq_and_cap_fine aq_and_cap'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'right left'
[]
[aquifer]
type = ParsedSubdomainMeshGenerator
input = aq_and_cap_all
combinatorial_geometry = 'y >= -${half_aq_thickness} & y <= ${half_aq_thickness}'
block_id = 1
[]
[top_cap]
type = ParsedSubdomainMeshGenerator
input = aquifer
combinatorial_geometry = 'y >= ${half_aq_thickness}'
block_id = 2
[]
[bottom_cap]
type = ParsedSubdomainMeshGenerator
input = top_cap
combinatorial_geometry = 'y <= -${half_aq_thickness}'
block_id = 3
[]
[injection_area]
type = ParsedGenerateSideset
combinatorial_geometry = 'x<=${bh_r}*1.000001 & y >= ${screen_bottom} & y <= ${screen_top}'
included_subdomains = 1
new_sideset_name = 'injection_area'
input = 'bottom_cap'
[]
[rename]
type = RenameBlockGenerator
old_block = '1 2 3'
new_block = 'aquifer caps caps'
input = 'injection_area'
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 ${gravity} 0'
[]
[Variables]
[porepressure]
[]
[temperature]
scaling = 1E-5
[]
[]
[PorousFlowFullySaturated]
coupling_type = ThermoHydro
porepressure = porepressure
temperature = temperature
fp = tabulated_water
stabilization = KT
flux_limiter_type = ${flux_limiter}
use_displaced_mesh = false
temperature_unit = Celsius
pressure_unit = Pa
time_unit = days
[]
[ICs]
[porepressure]
type = FunctionIC
variable = porepressure
function = insitu_pressure
[]
[temperature]
type = FunctionIC
variable = temperature
function = insitu_temperature
[]
[]
[BCs]
[outer_boundary_porepressure]
type = FunctionDirichletBC
preset = true
variable = porepressure
function = insitu_pressure
boundary = 'bottom right top'
[]
[outer_boundary_temperature]
type = FunctionDirichletBC
preset = true
variable = temperature
function = insitu_temperature
boundary = 'bottom right top'
[]
[inject_heat]
type = FunctionDirichletBC
variable = temperature
function = ${inject_temp}
boundary = 'injection_area'
[]
[inject_fluid]
type = PorousFlowSink
variable = porepressure
boundary = injection_area
flux_function = injection_rate_value
[]
[produce_heat]
type = PorousFlowSink
variable = temperature
boundary = injection_area
flux_function = production_rate_value
fluid_phase = 0
use_enthalpy = true
save_in = heat_flux_out
[]
[produce_fluid]
type = PorousFlowSink
variable = porepressure
boundary = injection_area
flux_function = production_rate_value
[]
[]
[Controls]
[inject_on]
type = ConditionalFunctionEnableControl
enable_objects = 'BCs::inject_heat BCs::inject_fluid'
conditional_function = inject
implicit = false
execute_on = 'initial timestep_begin'
[]
[produce_on]
type = ConditionalFunctionEnableControl
enable_objects = 'BCs::produce_heat BCs::produce_fluid'
conditional_function = produce
implicit = false
execute_on = 'initial timestep_begin'
[]
[]
[Functions]
[insitu_pressure]
type = ParsedFunction
expression = '(y - ${depth_centre}) * 1000 * ${gravity} + 1E5' # approx insitu pressure in Pa
[]
[insitu_temperature]
type = ParsedFunction
expression = '${temp0} + (${depth_centre} - y) * ${geothermal_gradient}'
[]
[inject]
type = ParsedFunction
expression = 'if(t >= ${start_injection1} & t < ${end_injection1}, 1,
if(t >= ${start_injection2} & t < ${end_injection2}, 1,
if(t >= ${start_injection3} & t < ${end_injection3}, 1,
if(t >= ${start_injection4} & t < ${end_injection4}, 1,
if(t >= ${start_injection5} & t < ${end_injection5}, 1,
if(t >= ${start_injection6} & t < ${end_injection6}, 1,
if(t >= ${start_injection7} & t < ${end_injection7}, 1,
if(t >= ${start_injection8} & t < ${end_injection8}, 1,
if(t >= ${start_injection9} & t < ${end_injection9}, 1,
if(t >= ${start_injection10} & t < ${end_injection10}, 1, 0))))))))))'
[]
[produce]
type = ParsedFunction
expression = 'if(t >= ${start_production1} & t < ${end_production1}, 1,
if(t >= ${start_production2} & t < ${end_production2}, 1,
if(t >= ${start_production3} & t < ${end_production3}, 1,
if(t >= ${start_production4} & t < ${end_production4}, 1,
if(t >= ${start_production5} & t < ${end_production5}, 1,
if(t >= ${start_production6} & t < ${end_production6}, 1,
if(t >= ${start_production7} & t < ${end_production7}, 1,
if(t >= ${start_production8} & t < ${end_production8}, 1,
if(t >= ${start_production9} & t < ${end_production9}, 1,
if(t >= ${start_production10} & t < ${end_production10}, 1, 0))))))))))'
[]
[injection_rate_value]
type = ParsedFunction
symbol_names = true_screen_area
symbol_values = true_screen_area
expression = '-${inject_fluid_mass}/(true_screen_area * ${inject_time})'
[]
[production_rate_value]
type = ParsedFunction
symbol_names = true_screen_area
symbol_values = true_screen_area
expression = '${produce_fluid_mass}/(true_screen_area * ${produce_time})'
[]
[heat_out_in_timestep]
type = ParsedFunction
symbol_names = 'dt heat_out'
symbol_values = 'dt heat_out_fromBC'
expression = 'dt*heat_out'
[]
[produced_T_time_integrated]
type = ParsedFunction
symbol_names = 'dt produced_T'
symbol_values = 'dt produced_T'
expression = 'dt*produced_T / ${produce_time}'
[]
[]
[AuxVariables]
[density]
family = MONOMIAL
order = CONSTANT
[]
[porosity]
family = MONOMIAL
order = CONSTANT
[]
[heat_flux_out]
outputs = none
[]
[]
[AuxKernels]
[density]
type = PorousFlowPropertyAux
variable = density
property = density
[]
[porosity]
type = PorousFlowPropertyAux
variable = porosity
property = porosity
[]
[]
[FluidProperties]
[true_water]
type = Water97FluidProperties
[]
[tabulated_water]
type = TabulatedFluidProperties
fp = true_water
temperature_min = 275 # K
temperature_max = 600
interpolated_properties = 'density viscosity enthalpy internal_energy'
fluid_property_file = water97_tabulated_modified.csv
[]
[]
[Materials]
[porosity_aq]
type = PorousFlowPorosityConst
porosity = ${aq_porosity}
block = aquifer
[]
[porosity_caps]
type = PorousFlowPorosityConst
porosity = ${cap_porosity}
block = caps
[]
[permeability_aquifer]
type = PorousFlowPermeabilityConst
block = aquifer
permeability = '${aq_hor_perm} 0 0 0 ${aq_ver_perm} 0 0 0 0'
[]
[permeability_caps]
type = PorousFlowPermeabilityConst
block = caps
permeability = '${cap_hor_perm} 0 0 0 ${cap_ver_perm} 0 0 0 0'
[]
[aq_internal_energy]
type = PorousFlowMatrixInternalEnergy
block = aquifer
density = ${aq_density}
specific_heat_capacity = ${aq_specific_heat_cap}
[]
[caps_internal_energy]
type = PorousFlowMatrixInternalEnergy
block = caps
density = ${cap_density}
specific_heat_capacity = ${cap_specific_heat_cap}
[]
[aq_thermal_conductivity]
type = PorousFlowThermalConductivityIdeal
block = aquifer
dry_thermal_conductivity = '${aq_hor_dry_thermal_cond} 0 0 0 ${aq_ver_dry_thermal_cond} 0 0 0 0'
wet_thermal_conductivity = '${aq_hor_wet_thermal_cond} 0 0 0 ${aq_ver_wet_thermal_cond} 0 0 0 0'
[]
[caps_thermal_conductivity]
type = PorousFlowThermalConductivityIdeal
block = caps
dry_thermal_conductivity = '${cap_hor_dry_thermal_cond} 0 0 0 ${cap_ver_dry_thermal_cond} 0 0 0 0'
wet_thermal_conductivity = '${cap_hor_wet_thermal_cond} 0 0 0 ${cap_ver_wet_thermal_cond} 0 0 0 0'
[]
[]
[Postprocessors]
[true_screen_area] # this accounts for meshes that do not match screen_top and screen_bottom exactly
type = AreaPostprocessor
boundary = injection_area
execute_on = 'initial'
outputs = 'none'
[]
[dt]
type = TimestepSize
[]
[heat_out_fromBC]
type = NodalSum
variable = heat_flux_out
boundary = injection_area
execute_on = 'initial timestep_end'
outputs = 'none'
[]
[heat_out_per_timestep]
type = FunctionValuePostprocessor
function = heat_out_in_timestep
execute_on = 'timestep_end'
outputs = 'none'
[]
[heat_out_cumulative]
type = CumulativeValuePostprocessor
postprocessor = heat_out_per_timestep
execute_on = 'timestep_end'
outputs = 'csv console'
[]
[produced_T]
type = SideAverageValue
boundary = injection_area
variable = temperature
execute_on = 'initial timestep_end'
outputs = 'csv console'
[]
[produced_T_time_integrated]
type = FunctionValuePostprocessor
function = produced_T_time_integrated
execute_on = 'timestep_end'
outputs = 'none'
[]
[produced_T_cumulative]
type = CumulativeValuePostprocessor
postprocessor = produced_T_time_integrated
execute_on = 'timestep_end'
outputs = 'csv console'
[]
[]
[Preconditioning]
[basic]
type = SMP
full = true
petsc_options = '-ksp_diagonal_scale -ksp_diagonal_scale_fix'
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
petsc_options_value = ' asm lu NONZERO 2'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = ${end_simulation}
timestep_tolerance = 1e-5
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-3
growth_factor = 2
[]
dtmax = 1
dtmin = 1e-5
# rough calc for fluid, |R| ~ V*k*1E6 ~ V*1E-5
# rough calc for heat, |R| ~ V*(lam*1E-3 + h*1E-5) ~ V*(1E3 + 1E-2)
# so scale heat by 1E-7 and go for nl_abs_tol = 1E-4, which should give a max error of
# ~1Pa and ~0.1K in the first metre around the borehole
nl_abs_tol = 1E-4
nl_rel_tol = 1E-5
[]
[Outputs]
sync_times = ${synctimes}
[ex]
type = Exodus
time_step_interval = 20
[]
[csv]
type = CSV
execute_postprocessors_on = 'initial timestep_end'
[]
[]
(modules/thermal_hydraulics/test/tests/components/junction_parallel_channels_1phase/junction_with_calorifically_imperfect_gas.i)
# This input file tests compatibility of JunctionParallelChannels1Phase and CaloricallyImperfectGas.
# Loss coefficient is applied in first junction.
# Expected pressure drop from form loss ~0.5*K*rho_in*vel_in^2=0.5*100*3.219603*1 = 160.9 Pa
# Pressure drop from averall flow area change ~ 21.9 Pa
# Expected pressure drop ~ 182.8 Pa
T_in = 523.0
vel = 1
p_out = 7e6
[GlobalParams]
initial_p = ${p_out}
initial_vel = ${vel}
initial_T = ${T_in}
gravity_vector = '0 0 0'
closures = simple_closures
n_elems = 3
f = 0
scaling_factor_1phase = '1 1 1e-5'
scaling_factor_rhoV = '1e2'
scaling_factor_rhowV = '1e-2'
scaling_factor_rhoEV = '1e-5'
[]
[Functions]
[e_fn]
type = PiecewiseLinear
x = '100 280 300 350 400 450 500 550 600 700 800 900 1000 1200 1400 1600 1800 2000 2200 2400 2600 2800 3000 5000'
y = '783.9 2742.3 2958.6 3489.2 4012.7 4533.3 5053.8 5574 6095.1 7140.2 8192.9 9256.3 10333.6 12543.9 14836.6 17216.3 19688.4 22273.7 25018.3 28042.3 31544.2 35818.1 41256.5 100756.5'
scale_factor = 1e3
[]
[mu_fn]
type = PiecewiseLinear
x = '100 280 300 350 400 450 500 550 600 700 800 900 1000 1200 1400 1600 1800 2000 2200 2400 2600 2800 3000 5000'
y = '85.42 85.42 89.53 99.44 108.9 117.98 126.73 135.2 143.43 159.25 174.36 188.9 202.96 229.88 255.5 280.05 303.67 326.45 344.97 366.49 387.87 409.48 431.86 431.86'
scale_factor = 1e-7
[]
[k_fn]
type = PiecewiseLinear
x = '100 280 300 350 400 450 500 550 600 700 800 900 1000 1200 1400 1600 1800 2000 2200 2400 2600 2800 3000 5000'
y = '186.82 186.82 194.11 212.69 231.55 250.38 268.95 287.19 305.11 340.24 374.92 409.66 444.75 511.13 583.42 656.44 733.32 826.53 961.15 1180.38 1546.31 2135.49 3028.08 3028.08'
scale_factor = 1e-3
[]
[]
[FluidProperties]
[fp]
type = CaloricallyImperfectGas
molar_mass = 0.002
e = e_fn
k = k_fn
mu = mu_fn
min_temperature = 100
max_temperature = 5000
out_of_bound_error = false
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[Components]
[inlet_bc]
type = InletVelocityTemperature1Phase
input = 'inlet:in'
vel = ${vel}
T = ${T_in}
[]
[inlet]
type = FlowChannel1Phase
fp = fp
position = '0 0 11'
orientation = '0 0 -1'
length = 1
A = 3
[]
[inlet_plenum]
type = JunctionParallelChannels1Phase
position = '0 0 10'
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = ${vel}
K = 100
connections = 'inlet:out channel1:in channel2:in'
volume = 1
[]
[channel1]
type = FlowChannel1Phase
fp = fp
position = '0 0 10'
orientation = '0 0 -1'
length = 10
A = 4
D_h = 1
[]
[channel2]
type = FlowChannel1Phase
fp = fp
position = '0 0 10'
orientation = '0 0 -1'
length = 10
A = 1
D_h = 1
[]
[outlet_plenum]
type = JunctionParallelChannels1Phase
position = '0 0 0'
initial_vel_x = 1
initial_vel_y = 0
initial_vel_z = ${vel}
connections = 'channel1:out channel2:out outlet:in'
volume = 1
[]
[outlet]
type = FlowChannel1Phase
fp = fp
position = '0 0 0'
orientation = '0 0 -1'
length = 1
A = 1
[]
[outlet_bc]
type = Outlet1Phase
p = ${p_out}
input = 'outlet:out'
[]
[]
[Postprocessors]
[p_in]
type = SideAverageValue
variable = p
boundary = inlet:in
[]
[p_out]
type = SideAverageValue
variable = p
boundary = outlet:out
[]
[Delta_p]
type = DifferencePostprocessor
value1 = p_out
value2 = p_in
[]
[inlet_in_m_dot]
type = ADFlowBoundaryFlux1Phase
boundary = 'inlet_bc'
equation = mass
[]
[inlet_out_m_dot]
type = ADFlowJunctionFlux1Phase
boundary = 'inlet:out'
connection_index = 0
junction = inlet_plenum
equation = mass
[]
[channel1_in_m_dot]
type = ADFlowJunctionFlux1Phase
boundary = 'channel1:in'
connection_index = 1
junction = inlet_plenum
equation = mass
[]
[channel1_out_m_dot]
type = ADFlowJunctionFlux1Phase
boundary = 'channel1:out'
connection_index = 0
junction = outlet_plenum
equation = mass
[]
[channel2_in_m_dot]
type = ADFlowJunctionFlux1Phase
boundary = 'channel2:in'
connection_index = 2
junction = inlet_plenum
equation = mass
[]
[channel2_out_m_dot]
type = ADFlowJunctionFlux1Phase
boundary = 'channel2:out'
connection_index = 1
junction = outlet_plenum
equation = mass
[]
[outlet_in_m_dot]
type = ADFlowJunctionFlux1Phase
boundary = 'outlet:in'
connection_index = 2
junction = outlet_plenum
equation = mass
[]
[outlet_out_m_dot]
type = ADFlowBoundaryFlux1Phase
boundary = 'outlet_bc'
equation = mass
[]
[net_mass_flow_rate_domain]
type = LinearCombinationPostprocessor
pp_names = 'inlet_in_m_dot outlet_out_m_dot'
pp_coefs = '1 -1'
[]
[net_mass_flow_rate_volume_junction]
type = LinearCombinationPostprocessor
pp_names = 'inlet_out_m_dot channel1_in_m_dot channel2_in_m_dot'
pp_coefs = '1 -1 -1'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
start_time = 0
end_time = 20
[TimeStepper]
type = IterationAdaptiveDT
dt = 1
optimal_iterations = 8
iteration_window = 2
[]
timestep_tolerance = 1e-6
abort_on_solve_fail = true
line_search = basic
nl_rel_tol = 1e-8
nl_abs_tol = 2e-8
nl_max_its = 25
l_tol = 1e-3
l_max_its = 5
petsc_options = '-snes_converged_reason'
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu '
[]
[Outputs]
[out]
type = CSV
execute_on = 'FINAL'
show = 'net_mass_flow_rate_domain net_mass_flow_rate_volume_junction Delta_p'
[]
[]
(modules/phase_field/examples/grain_growth/3D_6000_gr.i)
[Mesh]
type = GeneratedMesh
dim = 3
nx = 180
ny = 180
nz = 180
xmin = 0
xmax = 180
ymin = 0
ymax = 180
zmin = 0
zmax = 180
elem_type = HEX8
[]
[GlobalParams]
op_num = 28
var_name_base = gr
[]
[Variables]
[./PolycrystalVariables]
order = FIRST
family = LAGRANGE
[../]
[]
[UserObjects]
[./voronoi]
type = PolycrystalVoronoi
grain_num = 6000 # Number of grains
rand_seed = 8675 # 301
coloring_algorithm = jp
[../]
[./term]
type = Terminator
expression = 'grain_tracker < 218'
[../]
[]
[ICs]
[./PolycrystalICs]
[./PolycrystalColoringIC]
polycrystal_ic_uo = voronoi
[../]
[../]
[]
[AuxVariables]
[./bnds]
order = FIRST
family = LAGRANGE
[../]
[./unique_grains]
order = CONSTANT
family = MONOMIAL
[../]
[./ghost_elements]
order = CONSTANT
family = MONOMIAL
[../]
[./halos]
order = CONSTANT
family = MONOMIAL
[../]
[./var_indices]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./PolycrystalKernel]
[../]
[]
[AuxKernels]
[./BndsCalc]
type = BndsCalcAux
variable = bnds
execute_on = 'initial timestep_end'
[../]
[./unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
field_display = UNIQUE_REGION
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
[../]
[./ghost_elements]
type = FeatureFloodCountAux
variable = ghost_elements
field_display = GHOSTED_ENTITIES
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
[../]
[./halos]
type = FeatureFloodCountAux
variable = halos
field_display = HALOS
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
[../]
[./var_indices]
type = FeatureFloodCountAux
variable = var_indices
field_display = VARIABLE_COLORING
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
[../]
[]
#[BCs]
# [./Periodic]
# [./All]
# auto_direction = 'x y'
# [../]
# [../]
#[]
[Materials]
[./Copper]
type = GBEvolution
T = 500
wGB = 3 # um
GBmob0 = 2.5e-6 #m^4/(Js) from Schoenfelder 1997
Q = 0.23 #Migration energy in eV
GBenergy = 0.708 #GB energy in J/m^2
molar_volume = 7.11e-6 #Molar volume in m^3/mol
length_scale = 1.0e-6
time_scale = 1.0
[../]
[]
[Postprocessors]
[./dt]
type = TimestepSize
[../]
[./n_elements]
type = NumElems
execute_on = timestep_end
[../]
[./n_nodes]
type = NumNodes
execute_on = timestep_end
[../]
[./DOFs]
type = NumDOFs
[../]
[./grain_tracker]
type = GrainTracker
threshold = 0.1
compute_halo_maps = true
[../]
[]
#[Preconditioning]
# [./SMP]
# type = SMP
# full = true
# [../]
#[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK #Preconditioned JFNK (default)
petsc_options_iname = '-pc_type'
petsc_options_value = 'asm'
l_tol = 1.0e-4
l_max_its = 30
nl_max_its = 20
nl_rel_tol = 1.0e-8
start_time = 0.0
num_steps = 500
dt = 0.0002
[./TimeStepper]
type = IterationAdaptiveDT
cutback_factor = 0.9
dt = 0.0002
growth_factor = 1.1
optimal_iterations = 8
[../]
#[./Adaptivity]
# initial_adaptivity = 4
# refine_fraction = 0.6
# coarsen_fraction = 0.1
# max_h_level = 4
# print_changed_info = true
#[../]
[]
[Outputs]
nemesis = true
checkpoint = true
csv = true
[./console]
type = Console
[../]
[]
(modules/combined/examples/periodic_strain/global_strain_pfm_3D.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 3
nx = 20
ny = 20
nz = 20
xmin = -0.5
xmax = 0.5
ymin = -0.5
ymax = 0.5
zmin = -0.5
zmax = 0.5
[]
[./cnode]
input = gen
type = ExtraNodesetGenerator
coord = '0.0 0.0 0.0'
new_boundary = 100
[../]
[]
[Variables]
[./u_x]
[../]
[./u_y]
[../]
[./u_z]
[../]
[./global_strain]
order = SIXTH
family = SCALAR
[../]
[./c]
[./InitialCondition]
type = FunctionIC
function = 'sin(2*x*pi)*sin(2*y*pi)*sin(2*z*pi)*0.05+0.6'
[../]
[../]
[./w]
[../]
[]
[AuxVariables]
[./local_energy]
order = CONSTANT
family = MONOMIAL
[../]
[./disp_x]
[../]
[./disp_y]
[../]
[./disp_z]
[../]
[./s00]
order = CONSTANT
family = MONOMIAL
[../]
[./s01]
order = CONSTANT
family = MONOMIAL
[../]
[./s10]
order = CONSTANT
family = MONOMIAL
[../]
[./s11]
order = CONSTANT
family = MONOMIAL
[../]
[./e00]
order = CONSTANT
family = MONOMIAL
[../]
[./e01]
order = CONSTANT
family = MONOMIAL
[../]
[./e10]
order = CONSTANT
family = MONOMIAL
[../]
[./e11]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./disp_x]
type = GlobalDisplacementAux
variable = disp_x
scalar_global_strain = global_strain
global_strain_uo = global_strain_uo
component = 0
[../]
[./disp_y]
type = GlobalDisplacementAux
variable = disp_y
scalar_global_strain = global_strain
global_strain_uo = global_strain_uo
component = 1
[../]
[./disp_z]
type = GlobalDisplacementAux
variable = disp_z
scalar_global_strain = global_strain
global_strain_uo = global_strain_uo
component = 2
[../]
[./local_free_energy]
type = TotalFreeEnergy
execute_on = 'initial LINEAR'
variable = local_energy
interfacial_vars = 'c'
kappa_names = 'kappa_c'
[../]
[./s00]
type = RankTwoAux
variable = s00
rank_two_tensor = stress
index_i = 0
index_j = 0
[../]
[./s01]
type = RankTwoAux
variable = s01
rank_two_tensor = stress
index_i = 0
index_j = 1
[../]
[./s10]
type = RankTwoAux
variable = s10
rank_two_tensor = stress
index_i = 1
index_j = 0
[../]
[./s11]
type = RankTwoAux
variable = s11
rank_two_tensor = stress
index_i = 1
index_j = 1
[../]
[./e00]
type = RankTwoAux
variable = e00
rank_two_tensor = total_strain
index_i = 0
index_j = 0
[../]
[./e01]
type = RankTwoAux
variable = e01
rank_two_tensor = total_strain
index_i = 0
index_j = 1
[../]
[./e10]
type = RankTwoAux
variable = e10
rank_two_tensor = total_strain
index_i = 1
index_j = 0
[../]
[./e11]
type = RankTwoAux
variable = e11
rank_two_tensor = total_strain
index_i = 1
index_j = 1
[../]
[]
[GlobalParams]
derivative_order = 2
enable_jit = true
displacements = 'u_x u_y u_z'
block = 0
[]
[Kernels]
[./TensorMechanics]
[../]
# Cahn-Hilliard kernels
[./c_dot]
type = CoupledTimeDerivative
variable = w
v = c
block = 0
[../]
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = kappa_c
w = w
block = 0
[../]
[./w_res]
type = SplitCHWRes
variable = w
mob_name = M
block = 0
[../]
[]
[ScalarKernels]
[./global_strain]
type = GlobalStrain
variable = global_strain
global_strain_uo = global_strain_uo
[../]
[]
[BCs]
[./Periodic]
[./all]
auto_direction = 'x y z'
variable = 'c w u_x u_y u_z'
[../]
[../]
# fix center point location
[./centerfix_x]
type = DirichletBC
boundary = 100
variable = u_x
value = 0
[../]
[./centerfix_y]
type = DirichletBC
boundary = 100
variable = u_y
value = 0
[../]
[./centerfix_z]
type = DirichletBC
boundary = 100
variable = u_z
value = 0
[../]
[]
[Materials]
[./consts]
type = GenericConstantMaterial
prop_names = 'M kappa_c'
prop_values = '0.2 0.01 '
[../]
[./shear1]
type = GenericConstantRankTwoTensor
tensor_values = '0 0 0 0.5 0.5 0.5'
tensor_name = shear1
[../]
[./shear2]
type = GenericConstantRankTwoTensor
tensor_values = '0 0 0 -0.5 -0.5 -0.5'
tensor_name = shear2
[../]
[./expand3]
type = GenericConstantRankTwoTensor
tensor_values = '1 1 1 0 0 0'
tensor_name = expand3
[../]
[./weight1]
type = DerivativeParsedMaterial
expression = '0.3*c^2'
property_name = weight1
coupled_variables = c
[../]
[./weight2]
type = DerivativeParsedMaterial
expression = '0.3*(1-c)^2'
property_name = weight2
coupled_variables = c
[../]
[./weight3]
type = DerivativeParsedMaterial
expression = '4*(0.5-c)^2'
property_name = weight3
coupled_variables = c
[../]
[./elasticity_tensor]
type = ComputeElasticityTensor
C_ijkl = '1 1'
fill_method = symmetric_isotropic
[../]
[./strain]
type = ComputeSmallStrain
global_strain = global_strain
eigenstrain_names = eigenstrain
[../]
[./eigenstrain]
type = CompositeEigenstrain
tensors = 'shear1 shear2 expand3'
weights = 'weight1 weight2 weight3'
args = c
eigenstrain_name = eigenstrain
[../]
[./global_strain]
type = ComputeGlobalStrain
scalar_global_strain = global_strain
global_strain_uo = global_strain_uo
[../]
[./stress]
type = ComputeLinearElasticStress
[../]
# chemical free energies
[./chemical_free_energy]
type = DerivativeParsedMaterial
property_name = Fc
expression = '4*c^2*(1-c)^2'
coupled_variables = 'c'
outputs = exodus
output_properties = Fc
[../]
# elastic free energies
[./elastic_free_energy]
type = ElasticEnergyMaterial
f_name = Fe
args = 'c'
outputs = exodus
output_properties = Fe
[../]
# free energy (chemical + elastic)
[./free_energy]
type = DerivativeSumMaterial
block = 0
property_name = F
sum_materials = 'Fc Fe'
coupled_variables = 'c'
[../]
[]
[UserObjects]
[./global_strain_uo]
type = GlobalStrainUserObject
execute_on = 'Initial Linear Nonlinear'
[../]
[]
[Postprocessors]
[./total_free_energy]
type = ElementIntegralVariablePostprocessor
execute_on = 'initial TIMESTEP_END'
variable = local_energy
[../]
[./total_solute]
type = ElementIntegralVariablePostprocessor
execute_on = 'initial TIMESTEP_END'
variable = c
[../]
[./min]
type = ElementExtremeValue
execute_on = 'initial TIMESTEP_END'
value_type = min
variable = c
[../]
[./max]
type = ElementExtremeValue
execute_on = 'initial TIMESTEP_END'
value_type = max
variable = c
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = 'PJFNK'
line_search = basic
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly lu 1'
l_max_its = 30
nl_max_its = 12
l_tol = 1.0e-4
nl_rel_tol = 1.0e-8
nl_abs_tol = 1.0e-10
start_time = 0.0
end_time = 2.0
[./TimeStepper]
type = IterationAdaptiveDT
dt = 0.01
growth_factor = 1.5
cutback_factor = 0.8
optimal_iterations = 9
iteration_window = 2
[../]
[]
[Outputs]
execute_on = 'timestep_end'
print_linear_residuals = false
exodus = true
[./table]
type = CSV
delimiter = ' '
[../]
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/dirichlet_bcs_velocity.i)
rho = 'rho'
l = 10
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 10
ny = 5
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = ${inlet_velocity}
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FVKernels]
[mass_time]
type = WCNSFVMassTimeDerivative
variable = pressure
drho_dt = drho_dt
[]
[mass]
type = WCNSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = u
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = v
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T
rho = rho
drho_dt = drho_dt
h = h
dh_dt = dh_dt
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T
v = power_density
[]
[]
[FVBCs]
# Inlet
[inlet_u]
type = WCNSFVInletVelocityBC
variable = u
boundary = 'left'
velocity_pp = 'inlet_u'
[]
[inlet_v]
type = WCNSFVInletVelocityBC
variable = v
boundary = 'left'
velocity_pp = 0
[]
[inlet_T]
type = WCNSFVInletTemperatureBC
variable = T
boundary = 'left'
temperature_pp = 'inlet_T'
[]
[outlet_p]
type = INSFVOutletPressureBC
variable = pressure
boundary = 'right'
function = ${outlet_pressure}
[]
# Walls
[no_slip_x]
type = INSFVNoSlipWallBC
variable = u
boundary = 'top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = v
boundary = 'top bottom'
function = 0
[]
[]
# used for the boundary conditions in this example
[Postprocessors]
[inlet_u]
type = Receiver
default = ${inlet_velocity}
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T'
rho = ${rho}
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-2
optimal_iterations = 6
[]
end_time = 1
line_search = 'none'
automatic_scaling = true
compute_scaling_once = false
off_diagonals_in_auto_scaling = true
[]
[Debug]
show_var_residual_norms = true
[]
[Outputs]
exodus = true
execute_on = FINAL
[]
(modules/fsi/test/tests/2d-finite-strain-steady/thermal-me.i)
# Units: specific_heat_capacity--cp--J/(kg.K); density--rho--kg/(cm^3);
# dynamic_viscosity--mu--kg/(cm.s); thermal_conductivity--k--W/(cm.K);
# pressure--kg/(cm.s^2); force--kg.cm/s^2
outlet_pressure = 0
inlet_velocity = 150 # cm/s
ini_temp = 593 # K
heat_transfer_coefficient = 9 # W/(cm2.K)
g = -981 # cm/s2
alpha_fluid = 2e-4 # thermal expansion coefficient of fluid used in INSADBoussinesqBodyForce
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
file = '2layers_2d_midline.msh'
[]
[Variables]
[velocity]
family = LAGRANGE_VEC
order = FIRST
block = 'fluid'
[]
[p]
family = LAGRANGE
order = FIRST
block = 'fluid'
[]
[Tf]
family = LAGRANGE
order = FIRST
block = 'fluid'
[]
[Ts]
family = LAGRANGE
order = FIRST
block = 'solid'
[]
[disp_x]
family = LAGRANGE
order = FIRST
block = 'solid fluid'
[]
[disp_y]
family = LAGRANGE
order = FIRST
block = 'solid fluid'
[]
[]
[AuxVariables]
[heat_source]
family = MONOMIAL
order = FIRST
block = 'solid'
[]
[]
[ICs]
[initial_velocity]
type = VectorConstantIC
variable = velocity
x_value = 0
y_value = ${inlet_velocity}
z_value = 0
[]
[initial_p]
type = FunctionIC
variable = p
function = ini_p
[]
[initial_Tf]
type = ConstantIC
variable = Tf
value = ${ini_temp}
[]
[initial_Ts]
type = ConstantIC
variable = Ts
value = ${ini_temp}
[]
[]
[Kernels]
[fluid_mass]
type = INSADMass
variable = p
use_displaced_mesh = true
[]
[fluid_mass_pspg]
type = INSADMassPSPG
variable = p
use_displaced_mesh = true
[]
[fluid_momentum_time]
type = INSADMomentumTimeDerivative
variable = velocity
use_displaced_mesh = true
[]
[fluid_momentum_convection]
type = INSADMomentumAdvection
variable = velocity
use_displaced_mesh = true
[]
[fluid_momentum_viscous]
type = INSADMomentumViscous
variable = velocity
use_displaced_mesh = true
[]
[fluid_momentum_pressure]
type = INSADMomentumPressure
variable = velocity
pressure = p
integrate_p_by_parts = true
use_displaced_mesh = true
[]
[fluid_momentum_gravity]
type = INSADGravityForce
variable = velocity
gravity = '0 ${g} 0'
use_displaced_mesh = true
[]
[fluid_momentum_buoyancy]
type = INSADBoussinesqBodyForce
variable = velocity
gravity = '0 ${g} 0'
alpha_name = 'alpha_fluid'
ref_temp = 'T_ref'
temperature = Tf
use_displaced_mesh = true
[]
[fluid_momentum_supg]
type = INSADMomentumSUPG
variable = velocity
velocity = velocity
use_displaced_mesh = true
[]
[fluid_temperature_time]
type = INSADHeatConductionTimeDerivative
variable = Tf
use_displaced_mesh = true
[]
[fluid_temperature_conduction]
type = ADHeatConduction
variable = Tf
thermal_conductivity = 'k'
use_displaced_mesh = true
[]
[fluid_temperature_advection]
type = INSADEnergyAdvection
variable = Tf
use_displaced_mesh = true
[]
[fluid_temperature_supg]
type = INSADEnergySUPG
variable = Tf
velocity = velocity
use_displaced_mesh = true
[]
[solid_temperature_time]
type = ADHeatConductionTimeDerivative
variable = Ts
density_name = 'rho'
specific_heat = 'cp'
block = 'solid'
use_displaced_mesh = true
[]
[solid_temperature_conduction]
type = ADHeatConduction
variable = Ts
thermal_conductivity = 'k'
block = 'solid'
use_displaced_mesh = true
[]
[heat_source]
type = ADCoupledForce
variable = Ts
v = heat_source
block = 'solid'
use_displaced_mesh = true
[]
[disp_x_smooth]
type = Diffusion
variable = disp_x
block = fluid
[]
[disp_y_smooth]
type = Diffusion
variable = disp_y
block = fluid
[]
[]
[Modules/TensorMechanics/Master]
strain = FINITE
material_output_order = FIRST
generate_output = 'vonmises_stress stress_xx stress_yy stress_zz strain_xx strain_yy strain_zz'
[solid]
block = 'solid'
temperature = Ts
automatic_eigenstrain_names = true
[]
[]
[InterfaceKernels]
[convection_heat_transfer]
type = ConjugateHeatTransfer
variable = Tf
T_fluid = Tf
neighbor_var = 'Ts'
boundary = 'solid_wall'
htc = 'htc'
use_displaced_mesh = true
[]
[]
[AuxKernels]
[heat_source_distribution_auxk]
type = FunctionAux
variable = heat_source
function = heat_source_distribution_function
block = 'solid'
use_displaced_mesh = true
[]
[]
[BCs]
[no_slip]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'solid_wall'
use_displaced_mesh = true
[]
[inlet_velocity]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'fluid_bottom'
function_y = ${inlet_velocity}
use_displaced_mesh = true
[]
[symmetry]
type = ADVectorFunctionDirichletBC
variable = velocity
boundary = 'fluid_wall'
function_x = 0
set_x_comp = true
set_y_comp = false
set_z_comp = false
use_displaced_mesh = true
[]
[outlet_p]
type = DirichletBC
variable = p
boundary = 'fluid_top'
value = ${outlet_pressure}
use_displaced_mesh = true
[]
[inlet_T]
type = DirichletBC
variable = Tf
boundary = 'fluid_bottom'
value = ${ini_temp}
use_displaced_mesh = true
[]
[pin1_y]
type = DirichletBC
variable = disp_y
boundary = 'pin1'
value = 0
use_displaced_mesh = true
[]
[pin1_x]
type = DirichletBC
variable = disp_x
boundary = 'pin1'
value = 0
use_displaced_mesh = true
[]
[top_and_bottom_y]
type = DirichletBC
variable = disp_y
boundary = 'solid_bottom solid_top fluid_top fluid_bottom'
value = 0
use_displaced_mesh = true
[]
[left_and_right_x]
type = DirichletBC
variable = disp_x
boundary = 'fluid_wall fluid_bottom'
value = 0
use_displaced_mesh = true
[]
[]
[Materials]
[rho_solid]
type = ADParsedMaterial
property_name = rho
expression = '0.0110876 * pow(9.9672e-1 + 1.179e-5 * Ts - 2.429e-9 * pow(Ts,2) + 1.219e-12 * pow(Ts,3),-3)'
coupled_variables = 'Ts'
block = 'solid'
use_displaced_mesh = true
[]
[cp_solid]
type = ADParsedMaterial
property_name = cp
expression = '0.76 * ((302.27 * pow((548.68 / Ts),2) * exp(548.68 / Ts)) / pow((exp(548.68 / Ts) - 1),2) + 2 * 8.463e-3 * Ts + 8.741e7 * 18531.7 * exp(-18531.7 / Ts) / pow(Ts,2)) + 0.24 * ((322.49 * pow((587.41/Ts),2) * exp(587.41 / Ts)) / pow((exp(587.41 / Ts) - 1),2) + 2 * 1.4679e-2 * Ts)'
coupled_variables = 'Ts'
block = 'solid'
use_displaced_mesh = true
[]
[k_solid]
type = ADParsedMaterial
property_name = k
expression = '1.158/(7.5408 + 17.692 * (Ts / 1000) + 3.6142 * pow((Ts/1000),2)) + 74.105 * pow((Ts / 1000),-2.5) * exp(-16.35 / (Ts / 1000))'
coupled_variables = 'Ts'
block = 'solid'
use_displaced_mesh = true
[]
[rho_fluid]
type = ADParsedMaterial
property_name = rho
expression = '(11096 - 1.3236 * Tf) * 1e-6'
coupled_variables = 'Tf'
block = 'fluid'
use_displaced_mesh = true
[]
[cp_fluid]
type = ADParsedMaterial
property_name = cp
expression = '159 - 2.72e-2 * Tf + 7.12e-6 * pow(Tf,2)'
coupled_variables = 'Tf'
block = 'fluid'
use_displaced_mesh = true
[]
[k_fluid]
type = ADParsedMaterial
property_name = k
expression = '(3.61 + 1.517e-2 * Tf - 1.741e-6 * pow(Tf,2)) * 1e-2'
coupled_variables = 'Tf'
block = 'fluid'
use_displaced_mesh = true
[]
[mu_fluid]
type = ADParsedMaterial
property_name = mu
expression = '4.94e-6 * exp(754.1/Tf)'
coupled_variables = 'Tf'
block = 'fluid'
use_displaced_mesh = true
[]
[buoyancy_thermal_expansion_coefficient_fluid]
type = ADGenericConstantMaterial
prop_names = 'alpha_fluid'
prop_values = '${alpha_fluid}'
block = 'fluid'
use_displaced_mesh = true
[]
[buoyancy_reference_temperature_fluid]
type = GenericConstantMaterial
prop_names = 'T_ref'
prop_values = '${ini_temp}'
block = 'fluid'
use_displaced_mesh = true
[]
[ins_mat_fluid]
type = INSADStabilized3Eqn
velocity = velocity
pressure = p
temperature = Tf
block = 'fluid'
use_displaced_mesh = true
[]
[htc]
type = ADGenericFunctionMaterial
prop_names = htc
prop_values = htc_function
use_displaced_mesh = true
[]
[elasticity_solid]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 2e7
poissons_ratio = 0.32
block = 'solid'
use_displaced_mesh = true
[]
[thermal_expansion_solid]
type = ComputeThermalExpansionEigenstrain
temperature = Ts
thermal_expansion_coeff = 2e-4
stress_free_temperature = 593
eigenstrain_name = thermal_expansion
block = 'solid'
use_displaced_mesh = true
[]
[stress_solid]
type = ComputeFiniteStrainElasticStress
block = 'solid'
[]
[]
[Functions]
[htc_function]
type = ParsedFunction
expression = ${heat_transfer_coefficient}
[]
[ini_p]
type = ParsedFunction
expression = '0.010302 * 981 * (10 - y)'
[]
[heat_source_distribution_function]
type = ParsedFunction
expression = '300 * sin(pi * y / 10)'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
solve_type = 'PJFNK'
[]
[]
[Executioner]
type = Transient
end_time = 1e4
solve_type = 'NEWTON'
petsc_options = '-snes_converged_reason -ksp_converged_reason -snes_linesearch_monitor'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
line_search = 'none'
nl_max_its = 30
l_max_its = 100
automatic_scaling = true
compute_scaling_once = true
off_diagonals_in_auto_scaling = true
dtmin = 1
nl_abs_tol = 1e-12
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 6
growth_factor = 1.5
dt = 1
[]
[]
[Outputs]
[csv]
type = CSV
file_base = 'thermal-me'
execute_on = 'final'
[]
[]
[Postprocessors]
[average_solid_Ts]
type = ElementAverageValue
variable = Ts
block = 'solid'
use_displaced_mesh = true
[]
[average_fluid_Tf]
type = ElementAverageValue
variable = Tf
block = 'fluid'
use_displaced_mesh = true
[]
[max_solid_Ts]
type = ElementExtremeValue
variable = Ts
value_type = max
block = 'solid'
use_displaced_mesh = true
[]
[max_fluid_Tf]
type = ElementExtremeValue
variable = Tf
value_type = max
block = 'fluid'
use_displaced_mesh = true
[]
[min_solid_Ts]
type = ElementExtremeValue
variable = Ts
value_type = min
block = 'solid'
use_displaced_mesh = true
[]
[min_fluid_Tf]
type = ElementExtremeValue
variable = Tf
value_type = min
block = 'fluid'
use_displaced_mesh = true
[]
[]
[Debug]
show_var_residual_norms = true
[]
(modules/porous_flow/test/tests/fluidstate/theis_brineco2.i)
# Two phase Theis problem: Flow from single source.
# Constant rate injection 2 kg/s
# 1D cylindrical mesh
# Initially, system has only a liquid phase, until enough gas is injected
# to form a gas phase, in which case the system becomes two phase.
#
# This test takes a few minutes to run, so is marked heavy
[Mesh]
type = GeneratedMesh
dim = 1
nx = 2000
xmax = 2000
[]
[Problem]
type = FEProblem
coord_type = RZ
rz_coord_axis = Y
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[AuxVariables]
[saturation_gas]
order = CONSTANT
family = MONOMIAL
[]
[x1]
order = CONSTANT
family = MONOMIAL
[]
[y0]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[saturation_gas]
type = PorousFlowPropertyAux
variable = saturation_gas
property = saturation
phase = 1
execute_on = timestep_end
[]
[x1]
type = PorousFlowPropertyAux
variable = x1
property = mass_fraction
phase = 0
fluid_component = 1
execute_on = timestep_end
[]
[y0]
type = PorousFlowPropertyAux
variable = y0
property = mass_fraction
phase = 1
fluid_component = 0
execute_on = timestep_end
[]
[]
[Variables]
[pgas]
initial_condition = 20e6
[]
[zi]
initial_condition = 0
[]
[xnacl]
initial_condition = 0.1
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = pgas
[]
[flux0]
type = PorousFlowAdvectiveFlux
fluid_component = 0
variable = pgas
[]
[mass1]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = zi
[]
[flux1]
type = PorousFlowAdvectiveFlux
fluid_component = 1
variable = zi
[]
[mass2]
type = PorousFlowMassTimeDerivative
fluid_component = 2
variable = xnacl
[]
[flux2]
type = PorousFlowAdvectiveFlux
fluid_component = 2
variable = xnacl
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pgas zi xnacl'
number_fluid_phases = 2
number_fluid_components = 3
[]
[pc]
type = PorousFlowCapillaryPressureConst
pc = 0
[]
[fs]
type = PorousFlowBrineCO2
brine_fp = brine
co2_fp = co2
capillary_pressure = pc
[]
[]
[FluidProperties]
[co2sw]
type = CO2FluidProperties
[]
[co2]
type = TabulatedFluidProperties
fp = co2sw
[]
[water]
type = Water97FluidProperties
[]
[watertab]
type = TabulatedFluidProperties
fp = water
temperature_min = 273.15
temperature_max = 573.15
fluid_property_file = water_fluid_properties.csv
save_file = false
[]
[brine]
type = BrineFluidProperties
water_fp = watertab
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = 20
[]
[brineco2]
type = PorousFlowFluidState
gas_porepressure = pgas
z = zi
temperature_unit = Celsius
xnacl = xnacl
capillary_pressure = pc
fluid_state = fs
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.2
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-12 0 0 0 1e-12 0 0 0 1e-12'
[]
[relperm_water]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
s_res = 0.1
sum_s_res = 0.1
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 1
[]
[]
[BCs]
[rightwater]
type = DirichletBC
boundary = right
value = 20e6
variable = pgas
[]
[]
[DiracKernels]
[source]
type = PorousFlowSquarePulsePointSource
point = '0 0 0'
mass_flux = 2
variable = zi
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 1e5
[TimeStepper]
type = IterationAdaptiveDT
dt = 1
growth_factor = 1.5
[]
[]
[VectorPostprocessors]
[line]
type = LineValueSampler
warn_discontinuous_face_values = false
sort_by = x
start_point = '0 0 0'
end_point = '2000 0 0'
num_points = 10000
variable = 'pgas zi xnacl x1 saturation_gas'
execute_on = 'timestep_end'
[]
[]
[Postprocessors]
[pgas]
type = PointValue
point = '4 0 0'
variable = pgas
[]
[sgas]
type = PointValue
point = '4 0 0'
variable = saturation_gas
[]
[zi]
type = PointValue
point = '4 0 0'
variable = zi
[]
[massgas]
type = PorousFlowFluidMass
fluid_component = 1
[]
[x1]
type = PointValue
point = '4 0 0'
variable = x1
[]
[y0]
type = PointValue
point = '4 0 0'
variable = y0
[]
[xnacl]
type = PointValue
point = '4 0 0'
variable = xnacl
[]
[]
[Outputs]
print_linear_residuals = false
perf_graph = true
[csvout]
type = CSV
execute_on = timestep_end
execute_vector_postprocessors_on = final
[]
[]
(modules/navier_stokes/examples/laser-welding/2d-fv.i)
period=.2e-4 # s
endtime=${fparse 3 * period} # s
timestep=${fparse period / 100} # s
surfacetemp=2700 # K
bottomtemp=2700 # K
sb=5.67e-8 # W/(m^2 K^4)
advected_interp_method='upwind'
velocity_interp_method='rc'
rho='rho'
mu='mu'
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -.7e-3 # m
xmax = 0.7e-3 # m
ymin = -.35e-3 # m
ymax = 0
nx = 75
ny = 20
displacements = 'disp_x disp_y'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
use_displaced_mesh = true
disp_x = disp_x
disp_y = disp_y
[]
[]
[Problem]
extra_tag_vectors = 'e_time e_advection e_conduction e_laser e_radiation e_mesh_advection'
[]
[AuxVariables]
[mu_out]
type = MooseVariableFVReal
[]
[e_time]
type = MooseVariableFVReal
[]
[e_advection]
type = MooseVariableFVReal
[]
[e_mesh_advection]
type = MooseVariableFVReal
[]
[e_conduction]
type = MooseVariableFVReal
[]
[e_laser]
type = MooseVariableFVReal
[]
[e_radiation]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[mu_out]
type = FunctorAux
functor = mu
variable = mu_out
execute_on = timestep_end
[]
[e_time]
variable = e_time
vector_tag = e_time
v = T
execute_on = 'timestep_end'
type = TagVectorAux
[]
[e_advection]
variable = e_advection
vector_tag = e_advection
v = T
execute_on = 'timestep_end'
type = TagVectorAux
[]
[e_mesh_advection]
variable = e_mesh_advection
vector_tag = e_mesh_advection
v = T
execute_on = 'timestep_end'
type = TagVectorAux
[]
[e_conduction]
variable = e_conduction
vector_tag = e_conduction
v = T
execute_on = 'timestep_end'
type = TagVectorAux
[]
[e_laser]
variable = e_laser
vector_tag = e_laser
v = T
execute_on = 'timestep_end'
type = TagVectorAux
[]
[e_radiation]
variable = e_radiation
vector_tag = e_radiation
v = T
execute_on = 'timestep_end'
type = TagVectorAux
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
[]
[vel_y]
type = INSFVVelocityVariable
[]
[T]
type = INSFVEnergyVariable
[]
[pressure]
type = INSFVPressureVariable
[]
[disp_x]
[]
[disp_y]
[]
[]
[ICs]
[T]
type = FunctionIC
variable = T
function = '${surfacetemp} + ((${surfacetemp} - ${bottomtemp}) / .35e-3) * y'
[]
[]
[Kernels]
[disp_x]
type = MatDiffusion
variable = disp_x
diffusivity = 1e6
[]
[disp_y]
type = MatDiffusion
variable = disp_y
diffusivity = 1e6
[]
[]
[FVKernels]
# pressure equation
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
use_displaced_mesh = true
boundaries_to_force = top
[]
# momentum equations
# u equation
[u_time]
type = INSFVMomentumTimeDerivative
variable = vel_x
rho = ${rho}
momentum_component = 'x'
use_displaced_mesh = true
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'x'
use_displaced_mesh = true
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
use_displaced_mesh = true
[]
[u_pressure]
type = INSFVMomentumPressureFlux
variable = vel_x
momentum_component = 'x'
pressure = pressure
use_displaced_mesh = true
[]
[u_mesh_advection_volumetric]
type = INSFVMomentumMeshAdvection
variable = vel_x
momentum_component = 'x'
rho = ${rho}
disp_x = disp_x
disp_y = disp_y
add_to_a = false
use_displaced_mesh = true
[]
# v equation
[v_time]
type = INSFVMomentumTimeDerivative
variable = vel_y
rho = ${rho}
momentum_component = 'y'
use_displaced_mesh = true
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
momentum_component = 'y'
use_displaced_mesh = true
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
use_displaced_mesh = true
[]
[v_pressure]
type = INSFVMomentumPressureFlux
variable = vel_y
momentum_component = 'y'
pressure = pressure
use_displaced_mesh = true
[]
[v_mesh_advection_volumetric]
type = INSFVMomentumMeshAdvection
variable = vel_y
momentum_component = 'y'
rho = ${rho}
disp_x = disp_x
disp_y = disp_y
add_to_a = false
use_displaced_mesh = true
[]
# energy equation
[temperature_time]
type = INSFVEnergyTimeDerivative
variable = T
rho = ${rho}
dh_dt = dh_dt
use_displaced_mesh = true
extra_vector_tags = 'e_time'
[]
[temperature_advection]
type = INSFVEnergyAdvection
variable = T
use_displaced_mesh = true
extra_vector_tags = 'e_advection'
[]
[temperature_conduction]
type = FVDiffusion
coeff = 'k'
variable = T
use_displaced_mesh = true
extra_vector_tags = 'e_conduction'
[]
[temperature_mesh_advection_volumetric]
type = INSFVMeshAdvection
variable = T
rho = ${rho}
disp_x = disp_x
disp_y = disp_y
advected_quantity = 'h'
use_displaced_mesh = true
extra_vector_tags = 'e_mesh_advection'
[]
[]
[FVBCs]
# momentum boundary conditions
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'bottom right left'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'bottom right left'
function = 0
[]
[vapor_recoil_x]
type = INSFVVaporRecoilPressureMomentumFluxBC
variable = vel_x
boundary = 'top'
momentum_component = 'x'
rc_pressure = rc_pressure
use_displaced_mesh = true
[]
[vapor_recoil_y]
type = INSFVVaporRecoilPressureMomentumFluxBC
variable = vel_y
boundary = 'top'
momentum_component = 'y'
rc_pressure = rc_pressure
use_displaced_mesh = true
[]
# energy boundary conditions
[T_cold]
type = FVDirichletBC
variable = T
boundary = 'bottom'
value = '${bottomtemp}'
[]
[radiation_flux]
type = FVFunctorRadiativeBC
variable = T
boundary = 'top'
emissivity = '1'
Tinfinity = 300
stefan_boltzmann_constant = ${sb}
use_displaced_mesh = true
extra_vector_tags = 'e_radiation'
[]
[weld_flux]
type = FVGaussianEnergyFluxBC
variable = T
boundary = 'top'
P0 = 159.96989792079225
R = 1.25e-4
x_beam_coord = '2e-4 * sin(t * 2 * pi / ${period})'
y_beam_coord = 0
z_beam_coord = 0
use_displaced_mesh = true
extra_vector_tags = 'e_laser'
[]
[]
[BCs]
# displacement boundary conditions
[x_no_disp]
type = DirichletBC
variable = disp_x
boundary = 'bottom'
value = 0
[]
[y_no_disp]
type = DirichletBC
variable = disp_y
boundary = 'bottom'
value = 0
[]
[displace_x_top]
type = INSADDisplaceBoundaryBC
boundary = 'top'
variable = 'disp_x'
velocity = 'vel'
component = 0
associated_subdomain = 0
[]
[displace_y_top]
type = INSADDisplaceBoundaryBC
boundary = 'top'
variable = 'disp_y'
velocity = 'vel'
component = 1
associated_subdomain = 0
[]
[displace_x_top_dummy]
type = INSADDummyDisplaceBoundaryIntegratedBC
boundary = 'top'
variable = 'disp_x'
velocity = 'vel'
component = 0
[]
[displace_y_top_dummy]
type = INSADDummyDisplaceBoundaryIntegratedBC
boundary = 'top'
variable = 'disp_y'
velocity = 'vel'
component = 1
[]
[]
[FunctorMaterials]
[steel]
type = AriaLaserWeld304LStainlessSteelFunctorMaterial
temperature = T
beta = 1e7
[]
[disp_vec_value_and_dot]
type = ADGenericVectorFunctorMaterial
prop_names = 'disp_vec'
prop_values = 'disp_x disp_y 0'
[]
[vel]
type = ADGenericVectorFunctorMaterial
prop_names = 'vel'
prop_values = 'vel_x vel_y 0'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_mat_solver_type -mat_mffd_err'
petsc_options_value = 'lu NONZERO strumpack 1e-6'
[]
[]
[Executioner]
type = Transient
end_time = ${endtime}
dtmin = 1e-8
dtmax = ${timestep}
petsc_options = '-snes_converged_reason -ksp_converged_reason -options_left'
solve_type = 'PJFNK'
line_search = 'none'
nl_max_its = 12
l_max_its = 100
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 7
dt = ${timestep}
linear_iteration_ratio = 1e6
growth_factor = 1.1
[]
[]
[Outputs]
exodus = true
csv = true
[]
[Debug]
show_var_residual_norms = true
[]
[Postprocessors]
[laser_flux]
type = TagVectorSum
vector = 'e_laser'
[]
[volume_rho_cp_dT]
type = TagVectorSum
vector = 'e_time'
[]
[conduction]
type = TagVectorSum
vector = 'e_conduction'
[]
[advection]
type = TagVectorSum
vector = 'e_advection'
[]
[mesh_advection]
type = TagVectorSum
vector = 'e_mesh_advection'
[]
[radiation]
type = TagVectorSum
vector = 'e_radiation'
[]
[total_sum]
type = ParsedPostprocessor
function = 'laser_flux + volume_rho_cp_dT + advection + mesh_advection + conduction + radiation'
pp_names = 'laser_flux volume_rho_cp_dT advection mesh_advection conduction radiation'
[]
[]
(modules/phase_field/test/tests/GBType/GB_Type_Phase1.i)
# MOOSE input file
# Written by Pierre-Clement Simon - Idaho National Laboratory
#
# Project:
# TRISO fuel fission gas transport: Silver diffusion in silicon carbide
#
# Published with:
# ---
#
# Phase Field Model: Isotropic diffusion equation
# type: Transient
# Grain structure: Single grain
# BCs: Fixed value on the right, flux on the left
#
#
# Info:
# - Input file used to generate polycrystals for SiC
#
# Updates from previous file:
# -
#
# Units
# length: --
# time: --
# energy: --
# quantity: --
# This simulation predicts GB migration of a 2D copper polycrystal with 15 grains
# Mesh adaptivity (new system) and time step adaptivity are used
# An AuxVariable is used to calculate the grain boundary locations
# Postprocessors are used to record time step and the number of grains
# We are not using the GrainTracker in this example so the number
# of order paramaters must match the number of grains.
[Mesh]
[ebsd_mesh]
type = EBSDMeshGenerator
# Two Parallel Grains
filename = 'EBSD_ThreeGrains.txt'
[]
[]
[GlobalParams]
# Parameters used by several kernels that are defined globally to simplify input file
op_num = 6 # Number of grains
var_name_base = gr # Base name of grains
[]
[UserObjects]
[ebsd_reader]
type = EBSDReader
[]
[ebsd]
type = PolycrystalEBSD
coloring_algorithm = bt
ebsd_reader = ebsd_reader
enable_var_coloring = true
# output_adjacency_matrix = true
[]
[grain_tracker]
type = GrainTracker
threshold = 0.001
connecting_threshold = 0.008
compute_var_to_feature_map = true
compute_halo_maps = true # For displaying HALO fields
remap_grains = true
polycrystal_ic_uo = ebsd
[]
[]
[ICs]
[PolycrystalICs]
[PolycrystalColoringIC]
polycrystal_ic_uo = ebsd
[]
[]
[]
[Variables]
# Variable block, where all variables in the simulation are declared
[./PolycrystalVariables]
# Custom action that created all of the grain variables and sets their initial condition
[../]
[]
[AuxVariables]
# Dependent variables
[./bnds]
# Variable used to visualize the grain boundaries in the simulation
[../]
[./unique_grains]
order = CONSTANT
family = MONOMIAL
[../]
[./aphi1]
order = CONSTANT
family = MONOMIAL
[../]
[./bPhi]
order = CONSTANT
family = MONOMIAL
[../]
[./cphi2]
order = CONSTANT
family = MONOMIAL
[../]
[./ebsd_numbers]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
# Kernel block, where the kernels defining the residual equations are set up.
[./PolycrystalKernel]
# Custom action creating all necessary kernels for grain growth. All input parameters are up in GlobalParams
[../]
[]
[AuxKernels]
# AuxKernel block, defining the equations used to calculate the auxvars
[./bnds_aux]
# AuxKernel that calculates the GB term
type = BndsCalcAux
variable = bnds
execute_on = 'initial timestep_end'
[../]
# generate the unique ID from grain_tracker
[./unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
field_display = UNIQUE_REGION
[../]
# The phi will output the Euler angle from EBSD data, and the data structure
# will change with the guide from grain_tracker
[./aphi1]
type = OutputEulerAngles
variable = aphi1
euler_angle_provider = ebsd_reader
grain_tracker = grain_tracker
output_euler_angle = 'phi1'
execute_on = 'INITIAL TIMESTEP_END'
[../]
[./bPhi]
type = OutputEulerAngles
variable = bPhi
euler_angle_provider = ebsd_reader
grain_tracker = grain_tracker
output_euler_angle = 'Phi'
execute_on = 'INITIAL TIMESTEP_END'
[../]
[./cphi2]
type = OutputEulerAngles
variable = cphi2
euler_angle_provider = ebsd_reader
grain_tracker = grain_tracker
output_euler_angle = 'phi2'
execute_on = 'INITIAL TIMESTEP_END'
[../]
# Import the unique grain ID from ebsd data, and the data structure
# will change with the guide from grain_tracker
[ebsd_numbers]
type = EBSDReaderAvgDataAux
data_name = feature_id
ebsd_reader = ebsd_reader
grain_tracker = grain_tracker
variable = ebsd_numbers
execute_on = 'initial timestep_end'
[../]
[]
[BCs]
# Boundary Condition block
[./Periodic]
[./top_bottom]
auto_direction = 'x y' # Makes problem periodic in the x and y directions
[../]
[../]
[]
[Materials]
[./CuGrGr]
# Material properties
type = GBEvolution # Quantitative material properties for copper grain growth. Dimensions are nm and ns
GBmob0 = 2.5e-6 # Mobility prefactor for Cu from schonfelder1997molecular bibtex entry
GBenergy = 0.708 # GB energy for Cu from schonfelder1997molecular bibtex entry
Q = 0.23 # Activation energy for grain growth from Schonfelder 1997
T = 450 # Constant temperature of the simulation (for mobility calculation)
wGB = 6 # Width of the diffuse GB
[../]
[./GB_type]
# The new developed Miso Bnds Aux Kernel
type = ComputeGBMisorientationType
ebsd_reader = ebsd_reader
grain_tracker = grain_tracker
output_properties = 'gb_type'
outputs = exodus
[../]
[]
[Postprocessors]
# Scalar postprocessors
[./dt]
# Outputs the current time step
type = TimestepSize
[../]
[n_elements]
type = NumElems
execute_on = 'initial timestep_end'
[]
[n_nodes]
type = NumNodes
execute_on = 'initial timestep_end'
[]
[DOFs]
type = NumDOFs
[]
[]
[Adaptivity]
initial_steps = 1
max_h_level = 1
marker = combined
[./Indicators]
[./error]
type = GradientJumpIndicator
variable = bnds
[../]
[../]
[./Markers]
[./bound_adapt]
type = ValueThresholdMarker
third_state = DO_NOTHING
coarsen = 0.999 #1.0
refine = 0.95 #0.95
variable = bnds
invert = true
[../]
[./errorfrac]
type = ErrorFractionMarker
coarsen = 0.1
indicator = error
refine = 0.7
[../]
[./combined]
type = ComboMarker
markers = 'bound_adapt errorfrac'
[../]
[../]
[]
[Executioner]
type = Transient # Type of executioner, here it is transient with an adaptive time step
scheme = bdf2 # Type of time integration (2nd order backward euler), defaults to 1st order backward euler
#Preconditioned JFNK (default)
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type -pc_hypre_boomeramg_strong_threshold'
petsc_options_value = ' hypre boomeramg 0.7'
l_max_its = 30 # Max number of linear iterations
l_tol = 1e-4 # Relative tolerance for linear solves
nl_max_its = 40 # Max number of nonlinear iterations
nl_abs_tol = 1e-11 # Relative tolerance for nonlienar solves
nl_rel_tol = 1e-10 # Absolute tolerance for nonlienar solves
[TimeStepper]
type = IterationAdaptiveDT
cutback_factor = 0.9
dt = 1
growth_factor = 1.1
optimal_iterations = 7
[]
start_time = 0.0
num_steps = 2
[]
[Outputs]
perf_graph = true
exodus = true
[./console]
type = Console
max_rows = 10
[../]
[]
(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
[]
(modules/combined/examples/phase_field-mechanics/EBSD_reconstruction_grain_growth_mech.i)
# This example reconstructs the grain structure from an EBSD data file
# Then, an isotropic grain model is run with linear elasticity and an anisotropic
# elasticity tensor that uses the measured EBSD angles.
[Mesh]
[ebsd_mesh]
type = EBSDMeshGenerator
uniform_refine = 2 #Mesh can go two levels coarser than the EBSD grid
filename = IN100_128x128.txt
[]
[]
[GlobalParams]
op_num = 8
var_name_base = gr
displacements = 'disp_x disp_y'
[]
[Variables]
[PolycrystalVariables] #Polycrystal variable generation (30 order parameters)
[]
[disp_x]
[]
[disp_y]
[]
[]
[AuxVariables]
[bnds]
[]
[gt_indices]
order = CONSTANT
family = MONOMIAL
[]
[unique_grains]
order = CONSTANT
family = MONOMIAL
[]
[vonmises_stress]
order = CONSTANT
family = MONOMIAL
[]
[C1111]
order = CONSTANT
family = MONOMIAL
[]
[phi1]
order = CONSTANT
family = MONOMIAL
[]
[Phi]
order = CONSTANT
family = MONOMIAL
[]
[phi2]
order = CONSTANT
family = MONOMIAL
[]
[EBSD_grain]
family = MONOMIAL
order = CONSTANT
[]
[]
[ICs]
[PolycrystalICs]
[ReconVarIC]
ebsd_reader = ebsd
coloring_algorithm = bt
[]
[]
[]
[Kernels]
[PolycrystalKernel]
[]
[PolycrystalElasticDrivingForce]
[]
[TensorMechanics]
[]
[]
[AuxKernels]
[BndsCalc]
type = BndsCalcAux
variable = bnds
execute_on = 'initial timestep_end'
[]
[gt_indices]
type = FeatureFloodCountAux
variable = gt_indices
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
[]
[unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
execute_on = 'initial timestep_end'
flood_counter = grain_tracker
field_display = UNIQUE_REGION
[]
[C1111]
type = RankFourAux
variable = C1111
rank_four_tensor = elasticity_tensor
index_l = 0
index_j = 0
index_k = 0
index_i = 0
execute_on = timestep_end
[]
[vonmises_stress]
type = RankTwoScalarAux
variable = vonmises_stress
rank_two_tensor = stress
scalar_type = VonMisesStress
execute_on = timestep_end
[]
[phi1]
type = OutputEulerAngles
variable = phi1
euler_angle_provider = ebsd
grain_tracker = grain_tracker
output_euler_angle = 'phi1'
execute_on = 'initial'
[]
[Phi]
type = OutputEulerAngles
variable = Phi
euler_angle_provider = ebsd
grain_tracker = grain_tracker
output_euler_angle = 'Phi'
execute_on = 'initial'
[]
[phi2]
type = OutputEulerAngles
variable = phi2
euler_angle_provider = ebsd
grain_tracker = grain_tracker
output_euler_angle = 'phi2'
execute_on = 'initial'
[]
[grain_aux]
type = EBSDReaderPointDataAux
variable = EBSD_grain
ebsd_reader = ebsd
data_name = 'feature_id'
execute_on = 'initial'
[]
[]
[BCs]
[top_displacement]
type = DirichletBC
variable = disp_y
boundary = top
value = -2.0
[]
[x_anchor]
type = DirichletBC
variable = disp_x
boundary = 'left right'
value = 0.0
[]
[y_anchor]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[]
[]
[Modules]
[PhaseField]
[EulerAngles2RGB]
crystal_structure = cubic
euler_angle_provider = ebsd
grain_tracker = grain_tracker
[]
[]
[]
[Materials]
[Copper]
# T = 500 # K
type = GBEvolution
block = 0
T = 500
wGB = 0.6 # um
GBmob0 = 2.5e-6 # m^4/(Js) from Schoenfelder 1997
Q = 0.23 # Migration energy in eV
GBenergy = 0.708 # GB energy in J/m^2
molar_volume = 7.11e-6; # Molar volume in m^3/mol
length_scale = 1.0e-6
time_scale = 1.0e-6
[]
[ElasticityTensor]
type = ComputePolycrystalElasticityTensor
grain_tracker = grain_tracker
[]
[strain]
type = ComputeSmallStrain
block = 0
displacements = 'disp_x disp_y'
[]
[stress]
type = ComputeLinearElasticStress
block = 0
[]
[]
[Postprocessors]
[dt]
type = TimestepSize
[]
[n_elements]
type = NumElems
execute_on = 'initial timestep_end'
[]
[n_nodes]
type = NumNodes
execute_on = 'initial timestep_end'
[]
[DOFs]
type = NumDOFs
[]
[]
[UserObjects]
[ebsd]
type = EBSDReader
[]
[grain_tracker]
type = GrainTrackerElasticity
compute_var_to_feature_map = true
ebsd_reader = ebsd
fill_method = symmetric9
C_ijkl = '1.27e5 0.708e5 0.708e5 1.27e5 0.708e5 1.27e5 0.7355e5 0.7355e5 0.7355e5'
euler_angle_provider = ebsd
[]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type -pc_hypre_boomeramg_strong_threshold'
petsc_options_value = ' hypre boomeramg 0.7'
l_tol = 1.0e-4
l_max_its = 20
nl_max_its = 20
nl_rel_tol = 1.0e-8
start_time = 0.0
num_steps = 30
dt = 10
[Adaptivity]
initial_adaptivity = 0
refine_fraction = 0.7
coarsen_fraction = 0.1
max_h_level = 2
[]
[TimeStepper]
type = IterationAdaptiveDT
cutback_factor = 0.9
dt = 10.0
growth_factor = 1.1
optimal_iterations = 7
[]
[]
[Outputs]
csv = true
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/phase_field/examples/anisotropic_interfaces/GrandPotentialPlanarGrowth.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmin = -2
xmax = 2
ymin = -2
ymax = 2
uniform_refine = 2
[]
[GlobalParams]
x1 = -2
y1 = -2
x2 = 2
y2 = -1.5
derivative_order = 2
[]
[Variables]
[./w]
[../]
[./etaa0]
[../]
[./etab0]
[../]
[]
[AuxVariables]
[./bnds]
[../]
#Temperature
[./T]
[../]
[]
[AuxKernels]
[./bnds]
type = BndsCalcAux
variable = bnds
v = 'etaa0 etab0'
[../]
[./T]
type = FunctionAux
function = 95.0+2.0*(y-1.0*t)
variable = T
execute_on = 'initial timestep_begin'
[../]
[]
[ICs]
[./w]
type = BoundingBoxIC
variable = w
# note w = A*(c-cleq), A = 1.0, cleq = 0.0 ,i.e., w = c (in the matrix/liquid phase)
outside = -4.0
inside = 0.0
[../]
[./etaa0]
type = BoundingBoxIC
variable = etaa0
#Solid phase
outside = 0.0
inside = 1.0
[../]
[./etab0]
type = BoundingBoxIC
variable = etab0
#Liquid phase
outside = 1.0
inside = 0.0
[../]
[]
[Kernels]
# Order parameter eta_alpha0
[./ACa0_bulk]
type = ACGrGrMulti
variable = etaa0
v = 'etab0'
gamma_names = 'gab'
[../]
[./ACa0_sw]
type = ACSwitching
variable = etaa0
Fj_names = 'omegaa omegab'
hj_names = 'ha hb'
coupled_variables = 'etab0 w'
[../]
[./ACa0_int1]
type = ACInterface2DMultiPhase1
variable = etaa0
etas = 'etab0'
kappa_name = kappaa
dkappadgrad_etaa_name = dkappadgrad_etaa
d2kappadgrad_etaa_name = d2kappadgrad_etaa
[../]
[./ACa0_int2]
type = ACInterface2DMultiPhase2
variable = etaa0
kappa_name = kappaa
dkappadgrad_etaa_name = dkappadgrad_etaa
[../]
[./ea0_dot]
type = TimeDerivative
variable = etaa0
[../]
# Order parameter eta_beta0
[./ACb0_bulk]
type = ACGrGrMulti
variable = etab0
v = 'etaa0'
gamma_names = 'gab'
[../]
[./ACb0_sw]
type = ACSwitching
variable = etab0
Fj_names = 'omegaa omegab'
hj_names = 'ha hb'
coupled_variables = 'etaa0 w'
[../]
[./ACb0_int1]
type = ACInterface2DMultiPhase1
variable = etab0
etas = 'etaa0'
kappa_name = kappab
dkappadgrad_etaa_name = dkappadgrad_etab
d2kappadgrad_etaa_name = d2kappadgrad_etab
[../]
[./ACb0_int2]
type = ACInterface2DMultiPhase2
variable = etab0
kappa_name = kappab
dkappadgrad_etaa_name = dkappadgrad_etab
[../]
[./eb0_dot]
type = TimeDerivative
variable = etab0
[../]
#Chemical potential
[./w_dot]
type = SusceptibilityTimeDerivative
variable = w
f_name = chi
[../]
[./Diffusion]
type = MatDiffusion
variable = w
diffusivity = Dchi
[../]
[./coupled_etaa0dot]
type = CoupledSwitchingTimeDerivative
variable = w
v = etaa0
Fj_names = 'rhoa rhob'
hj_names = 'ha hb'
coupled_variables = 'etaa0 etab0'
[../]
[./coupled_etab0dot]
type = CoupledSwitchingTimeDerivative
variable = w
v = etab0
Fj_names = 'rhoa rhob'
hj_names = 'ha hb'
coupled_variables = 'etaa0 etab0'
[../]
[]
[Materials]
[./ha]
type = SwitchingFunctionMultiPhaseMaterial
h_name = ha
all_etas = 'etaa0 etab0'
phase_etas = 'etaa0'
[../]
[./hb]
type = SwitchingFunctionMultiPhaseMaterial
h_name = hb
all_etas = 'etaa0 etab0'
phase_etas = 'etab0'
[../]
[./omegaa]
type = DerivativeParsedMaterial
coupled_variables = 'w'
property_name = omegaa
material_property_names = 'Vm ka caeq'
expression = '-0.5*w^2/Vm^2/ka-w/Vm*caeq'
[../]
[./omegab]
type = DerivativeParsedMaterial
coupled_variables = 'w T'
property_name = omegab
material_property_names = 'Vm kb cbeq S Tm'
expression = '-0.5*w^2/Vm^2/kb-w/Vm*cbeq-S*(T-Tm)'
[../]
[./rhoa]
type = DerivativeParsedMaterial
coupled_variables = 'w'
property_name = rhoa
material_property_names = 'Vm ka caeq'
expression = 'w/Vm^2/ka + caeq/Vm'
[../]
[./rhob]
type = DerivativeParsedMaterial
coupled_variables = 'w'
property_name = rhob
material_property_names = 'Vm kb cbeq'
expression = 'w/Vm^2/kb + cbeq/Vm'
[../]
[./kappaa]
type = InterfaceOrientationMultiphaseMaterial
kappa_name = kappaa
dkappadgrad_etaa_name = dkappadgrad_etaa
d2kappadgrad_etaa_name = d2kappadgrad_etaa
etaa = etaa0
etab = etab0
outputs = exodus
output_properties = 'kappaa'
[../]
[./kappab]
type = InterfaceOrientationMultiphaseMaterial
kappa_name = kappab
dkappadgrad_etaa_name = dkappadgrad_etab
d2kappadgrad_etaa_name = d2kappadgrad_etab
etaa = etab0
etab = etaa0
outputs = exodus
output_properties = 'kappab'
[../]
[./const]
type = GenericConstantMaterial
prop_names = 'L D chi Vm ka caeq kb cbeq gab mu S Tm'
prop_values = '1.0 1.0 0.1 1.0 10.0 0.1 10.0 0.9 4.5 10.0 1.0 100.0'
[../]
[./Mobility]
type = ParsedMaterial
property_name = Dchi
material_property_names = 'D chi'
expression = 'D*chi'
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart'
petsc_options_value = 'hypre boomeramg 31'
l_tol = 1.0e-3
l_max_its = 30
nl_max_its = 15
nl_rel_tol = 1.0e-8
nl_abs_tol = 1e-8
end_time = 2.0
[./TimeStepper]
type = IterationAdaptiveDT
dt = 0.0005
cutback_factor = 0.7
growth_factor = 1.2
[../]
[]
[Adaptivity]
initial_steps = 3
max_h_level = 3
initial_marker = err_eta
marker = err_bnds
[./Markers]
[./err_eta]
type = ErrorFractionMarker
coarsen = 0.3
refine = 0.95
indicator = ind_eta
[../]
[./err_bnds]
type = ErrorFractionMarker
coarsen = 0.3
refine = 0.95
indicator = ind_bnds
[../]
[../]
[./Indicators]
[./ind_eta]
type = GradientJumpIndicator
variable = etaa0
[../]
[./ind_bnds]
type = GradientJumpIndicator
variable = bnds
[../]
[../]
[]
[Outputs]
time_step_interval = 10
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/cns/heated-channel/transient-porous-kt-primitive.i)
p_initial=1.01e5
T=273.15
u_in=10
eps=1
superficial_vel_in=${fparse u_in * eps}
[GlobalParams]
fp = fp
limiter = 'vanLeer'
two_term_boundary_expansion = true
[]
[Mesh]
[cartesian]
type = GeneratedMeshGenerator
dim = 1
xmin = 0
xmax = 10
nx = 100
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Problem]
fv_bcs_integrity_check = false
[]
[Variables]
[pressure]
type = MooseVariableFVReal
initial_condition = ${p_initial}
[]
[superficial_vel_x]
type = MooseVariableFVReal
initial_condition = ${superficial_vel_in}
[]
[temperature]
type = MooseVariableFVReal
initial_condition = ${T}
[]
[]
[AuxVariables]
[rho]
type = MooseVariableFVReal
[]
[superficial_rhou]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[rho]
type = ADMaterialRealAux
variable = rho
property = rho
execute_on = 'timestep_end'
[]
[superficial_rhou]
type = ADMaterialRealAux
variable = superficial_rhou
property = superficial_rhou
execute_on = 'timestep_end'
[]
[]
[FVKernels]
[mass_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_dt'
variable = pressure
[]
[mass_advection]
type = PCNSFVKT
variable = pressure
eqn = "mass"
[]
[momentum_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rhou_dt'
variable = superficial_vel_x
[]
[momentum_advection]
type = PCNSFVKT
variable = superficial_vel_x
eqn = "momentum"
momentum_component = 'x'
[]
[energy_time]
type = FVMatPropTimeKernel
mat_prop_time_derivative = 'dsuperficial_rho_et_dt'
variable = temperature
[]
[energy_advection]
type = PCNSFVKT
variable = temperature
eqn = "energy"
[]
[heat]
type = FVBodyForce
variable = temperature
value = 1e6
[]
[]
[FVBCs]
[rho_left]
type = PCNSFVStrongBC
boundary = 'left'
variable = pressure
superficial_velocity = 'superficial_vel_in'
T_fluid = ${T}
eqn = 'mass'
[]
[rhou_left]
type = PCNSFVStrongBC
boundary = 'left'
variable = superficial_vel_x
superficial_velocity = 'superficial_vel_in'
T_fluid = ${T}
eqn = 'momentum'
momentum_component = 'x'
[]
[rho_et_left]
type = PCNSFVStrongBC
boundary = 'left'
variable = temperature
superficial_velocity = 'superficial_vel_in'
T_fluid = ${T}
eqn = 'energy'
[]
[rho_right]
type = PCNSFVStrongBC
boundary = 'right'
variable = pressure
pressure = ${p_initial}
eqn = 'mass'
[]
[rhou_right]
type = PCNSFVStrongBC
boundary = 'right'
variable = superficial_vel_x
pressure = ${p_initial}
eqn = 'momentum'
momentum_component = 'x'
[]
[rho_et_right]
type = PCNSFVStrongBC
boundary = 'right'
variable = temperature
pressure = ${p_initial}
eqn = 'energy'
[]
# Use these to help create more accurate cell centered gradients for cells adjacent to boundaries
[T_left]
type = FVDirichletBC
variable = temperature
value = ${T}
boundary = 'left'
[]
[sup_vel_left]
type = FVDirichletBC
variable = superficial_vel_x
value = ${superficial_vel_in}
boundary = 'left'
[]
[p_right]
type = FVDirichletBC
variable = pressure
value = ${p_initial}
boundary = 'right'
[]
[]
[Functions]
[superficial_vel_in]
type = ParsedVectorFunction
expression_x = '${superficial_vel_in}'
[]
[]
[Materials]
[var_mat]
type = PorousPrimitiveVarMaterial
pressure = pressure
T_fluid = temperature
superficial_vel_x = superficial_vel_x
fp = fp
porosity = porosity
[]
[fluid_only]
type = GenericConstantMaterial
prop_names = 'porosity'
prop_values = '${eps}'
[]
[]
[Executioner]
solve_type = NEWTON
type = Transient
nl_max_its = 20
[TimeStepper]
type = IterationAdaptiveDT
dt = 5e-5
optimal_iterations = 10
[]
steady_state_detection = false
steady_state_tolerance = 1e-12
abort_on_solve_fail = false
end_time = 100
nl_abs_tol = 1e-8
dtmin = 5e-5
automatic_scaling = true
compute_scaling_once = false
verbose = true
petsc_options_iname = '-pc_type -pc_factor_mat_solver_type -pc_factor_shift_type -snes_linesearch_minlambda'
petsc_options_value = 'lu mumps NONZERO 1e-3 '
[]
[Outputs]
[exo]
type = Exodus
execute_on = 'final'
[]
[dof]
type = DOFMap
execute_on = 'initial'
[]
checkpoint = true
[]
[Debug]
show_var_residual_norms = true
[]
(test/tests/multiapps/sub_cycling/sub_negative.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./td]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
start_time = -1.0
end_time = 0
[TimeStepper]
type = IterationAdaptiveDT
cutback_factor = 0.666
dt = 0.2
[]
[]
[Outputs]
exodus = true
[]
(modules/solid_mechanics/test/tests/rom_stress_update/creep_ramp_sub_true.i)
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 1
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[AuxVariables]
[temperature]
initial_condition = 889
[]
[effective_inelastic_strain]
order = FIRST
family = MONOMIAL
[]
[cell_dislocations]
order = FIRST
family = MONOMIAL
[]
[wall_dislocations]
order = FIRST
family = MONOMIAL
[]
[number_of_substeps]
order = FIRST
family = MONOMIAL
[]
[]
[AuxKernels]
[effective_inelastic_strain]
type = MaterialRealAux
variable = effective_inelastic_strain
property = effective_creep_strain
[]
[cell_dislocations]
type = MaterialRealAux
variable = cell_dislocations
property = cell_dislocations
[]
[wall_dislocations]
type = MaterialRealAux
variable = wall_dislocations
property = wall_dislocations
[]
[number_of_substeps]
type = MaterialRealAux
variable = number_of_substeps
property = number_of_substeps
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = FINITE
add_variables = true
generate_output = 'vonmises_stress'
[]
[]
[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
[]
[pressure_x]
type = Pressure
variable = disp_x
boundary = right
factor = -0.5
function = shear_function
[]
[pressure_y]
type = Pressure
variable = disp_y
boundary = top
factor = -0.5
function = shear_function
[]
[pressure_z]
type = Pressure
variable = disp_z
boundary = front
factor = 0.5
function = shear_function
[]
[]
[Functions]
[shear_function]
type = ParsedFunction
expression = 'timeToDoubleInHours := 10;
if(t<=28*60*60, 15.0e6, 15.0e6*(t-28*3600)/3600/timeToDoubleInHours+15.0e6)'
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1.68e11
poissons_ratio = 0.31
[]
[stress]
type = ComputeMultipleInelasticStress
inelastic_models = rom_stress_prediction
[]
[mx_phase_fraction]
type = GenericConstantMaterial
prop_names = mx_phase_fraction
prop_values = 5.13e-2 #precipitation bounds: 6e-3, 1e-1
outputs = all
[]
[rom_stress_prediction]
type = SS316HLAROMANCEStressUpdateTest
temperature = temperature
initial_cell_dislocation_density = 6.0e12
initial_wall_dislocation_density = 4.4e11
# outputs = all
use_substepping = ERROR_BASED
substep_strain_tolerance = 1.0e-5
stress_input_window_low_failure = WARN
stress_input_window_high_failure = ERROR
cell_input_window_high_failure = ERROR
cell_input_window_low_failure = ERROR
wall_input_window_low_failure = ERROR
wall_input_window_high_failure = ERROR
temperature_input_window_high_failure = ERROR
temperature_input_window_low_failure = ERROR
environment_input_window_high_failure = ERROR
environment_input_window_low_failure = ERROR
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
nl_abs_tol = 1e-12
nl_rel_tol = 1e-4
automatic_scaling = true
compute_scaling_once = false
dtmin = 0.1
dtmax = 1e5
end_time = 136800
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.1 ## This model requires a tiny timestep at the onset for the first 10s
iteration_window = 4
optimal_iterations = 12
time_t = '100800'
time_dt = '1e5'
[]
[]
[Postprocessors]
[effective_strain_avg]
type = ElementAverageValue
variable = effective_inelastic_strain
[]
[temperature]
type = ElementAverageValue
variable = temperature
[]
[cell_dislocations]
type = ElementAverageValue
variable = cell_dislocations
[]
[wall_disloactions]
type = ElementAverageValue
variable = wall_dislocations
[]
[max_vonmises_stress]
type = ElementExtremeValue
variable = vonmises_stress
value_type = max
[]
[number_of_substeps]
type = ElementAverageValue
variable = number_of_substeps
[]
[]
[Outputs]
csv = true
[]
(modules/porous_flow/examples/reservoir_model/regular_grid.i)
# SPE 10 comparative problem - model 1
# Data and description from https://www.spe.org/web/csp/datasets/set01.htm
# Simple input file that just establishes gravity equilibrium in the model
#
# Heterogeneous permeability is included by reading data from an external file
# using the PiecewiseMultilinear function, and saving that data to an elemental
# AuxVariable that is then used in PorousFlowPermeabilityConstFromVar
[Mesh]
type = GeneratedMesh
dim = 2
nx = 100
ny = 20
xmax = 762
ymax = 15.24
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 -9.81 0'
temperature_unit = Celsius
[]
[Variables]
[porepressure]
initial_condition = 20e6
[]
[]
[Functions]
[perm_md_fcn]
type = PiecewiseMultilinear
data_file = spe10_case1.data
[]
[]
[BCs]
[top]
type = DirichletBC
variable = porepressure
value = 20e6
boundary = top
[]
[]
[AuxVariables]
[temperature]
initial_condition = 50
[]
[xnacl]
initial_condition = 0.1
[]
[porosity]
family = MONOMIAL
order = CONSTANT
initial_condition = 0.2
[]
[perm_md]
family = MONOMIAL
order = CONSTANT
[]
[perm]
family = MONOMIAL
order = CONSTANT
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
variable = porepressure
[]
[flux0]
type = PorousFlowFullySaturatedDarcyFlow
variable = porepressure
[]
[]
[AuxKernels]
[perm_md]
type = FunctionAux
function = perm_md_fcn
variable = perm_md
execute_on = initial
[]
[perm]
type = ParsedAux
variable = perm
coupled_variables = perm_md
expression = '9.869233e-16*perm_md'
execute_on = initial
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = porepressure
number_fluid_phases = 1
number_fluid_components = 1
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[watertab]
type = TabulatedBicubicFluidProperties
fp = water
save_file = false
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = temperature
[]
[ps]
type = PorousFlow1PhaseFullySaturated
porepressure = porepressure
[]
[massfrac]
type = PorousFlowMassFraction
[]
[brine]
type = PorousFlowBrine
compute_enthalpy = false
compute_internal_energy = false
xnacl = xnacl
phase = 0
water_fp = watertab
[]
[porosity]
type = PorousFlowPorosityConst
porosity = porosity
[]
[permeability]
type = PorousFlowPermeabilityConstFromVar
perm_xx = perm
perm_yy = perm
perm_zz = perm
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 1e5
nl_abs_tol = 1e-12
nl_rel_tol = 1e-06
steady_state_detection = true
steady_state_tolerance = 1e-12
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e2
[]
[]
[Outputs]
execute_on = 'initial timestep_end'
exodus = true
perf_graph = true
[]
(test/tests/time_steppers/iteration_adaptive/multi_piecewise.i)
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Problem]
solve = false
[]
[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_spike3]
type = PiecewiseConstant
x = '1 6 8'
y = '1 4 4'
[../]
[./temp_spike4]
type = PiecewiseConstant
x = '0 7 9'
y = '1 1 2'
[../]
[]
[Executioner]
type = Transient
end_time = 10
verbose = true
[./TimeStepper]
type = IterationAdaptiveDT
dt = 10
timestep_limiting_function = 'temp_spike1 temp_spike2 temp_spike3 temp_spike4'
force_step_every_function_point = true
[../]
[]
[Postprocessors]
[./dt]
type = TimestepSize
[../]
[]
[Outputs]
csv = true
[]
(modules/phase_field/tutorials/spinodal_decomposition/s5_energycurve.i)
#
# Example simulation of an iron-chromium alloy at 500 C. Equilibrium
# concentrations are at 23.6 and 82.3 mol% Cr. Kappa value, free energy equation,
# and mobility equation were provided by Lars Hoglund. Solved using the split
# form of the Cahn-Hilliard equation.
[Mesh]
type = GeneratedMesh
dim = 2
elem_type = QUAD4
nx = 25
ny = 25
nz = 0
xmin = 0
xmax = 25
ymin = 0
ymax = 25
zmin = 0
zmax = 0
uniform_refine = 2
[]
[Variables]
[./c] # Mole fraction of Cr (unitless)
order = FIRST
family = LAGRANGE
scaling = 1e+04
[../]
[./w] # Chemical potential (eV/mol)
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./f_density] # Local energy density (eV/mol)
order = CONSTANT
family = MONOMIAL
[../]
[]
[ICs]
[./concentrationIC] # 46.774 mol% Cr with variations
type = RandomIC
min = 0.44774
max = 0.48774
seed = 210
variable = c
[../]
[]
[BCs]
[./Periodic]
[./c_bcs]
auto_direction = 'x y'
[../]
[../]
[]
[Kernels]
[./w_dot]
variable = w
v = c
type = CoupledTimeDerivative
[../]
[./coupled_res]
variable = w
type = SplitCHWRes
mob_name = M
[../]
[./coupled_parsed]
variable = c
type = SplitCHParsed
f_name = f_loc
kappa_name = kappa_c
w = w
[../]
[]
[AuxKernels]
# Calculates the energy density by combining the local and gradient energies
[./f_density] # (eV/mol/nm^2)
type = TotalFreeEnergy
variable = f_density
f_name = 'f_loc'
kappa_names = 'kappa_c'
interfacial_vars = c
[../]
[]
[Materials]
# d is a scaling factor that makes it easier for the solution to converge
# without changing the results. It is defined in each of the first three
# materials and must have the same value in each one.
[./kappa] # Gradient energy coefficient (eV nm^2/mol)
type = GenericFunctionMaterial
prop_names = 'kappa_c'
prop_values = '8.125e-16*6.24150934e+18*1e+09^2*1e-27'
# kappa_c *eV_J*nm_m^2* d
[../]
[./mobility] # Mobility (nm^2 mol/eV/s)
# NOTE: This is a fitted equation, so only 'Conv' has units
type = DerivativeParsedMaterial
property_name = M
coupled_variables = c
constant_names = 'Acr Bcr Ccr Dcr
Ecr Fcr Gcr
Afe Bfe Cfe Dfe
Efe Ffe Gfe
nm_m eV_J d'
constant_expressions = '-32.770969 -25.8186669 -3.29612744 17.669757
37.6197853 20.6941796 10.8095813
-31.687117 -26.0291774 0.2286581 24.3633544
44.3334237 8.72990497 20.956768
1e+09 6.24150934e+18 1e-27'
expression = 'nm_m^2/eV_J/d*((1-c)^2*c*10^
(Acr*c+Bcr*(1-c)+Ccr*c*log(c)+Dcr*(1-c)*log(1-c)+
Ecr*c*(1-c)+Fcr*c*(1-c)*(2*c-1)+Gcr*c*(1-c)*(2*c-1)^2)
+c^2*(1-c)*10^
(Afe*c+Bfe*(1-c)+Cfe*c*log(c)+Dfe*(1-c)*log(1-c)+
Efe*c*(1-c)+Ffe*c*(1-c)*(2*c-1)+Gfe*c*(1-c)*(2*c-1)^2))'
derivative_order = 1
outputs = exodus
[../]
[./local_energy] # Local free energy function (eV/mol)
type = DerivativeParsedMaterial
property_name = f_loc
coupled_variables = c
constant_names = 'A B C D E F G eV_J d'
constant_expressions = '-2.446831e+04 -2.827533e+04 4.167994e+03 7.052907e+03
1.208993e+04 2.568625e+03 -2.354293e+03
6.24150934e+18 1e-27'
expression = 'eV_J*d*(A*c+B*(1-c)+C*c*log(c)+D*(1-c)*log(1-c)+
E*c*(1-c)+F*c*(1-c)*(2*c-1)+G*c*(1-c)*(2*c-1)^2)'
derivative_order = 2
[../]
[./precipitate_indicator] # Returns 1/625 if precipitate
type = ParsedMaterial
property_name = prec_indic
coupled_variables = c
expression = if(c>0.6,0.0016,0)
[../]
[]
[Postprocessors]
[./step_size] # Size of the time step
type = TimestepSize
[../]
[./iterations] # Number of iterations needed to converge timestep
type = NumNonlinearIterations
[../]
[./nodes] # Number of nodes in mesh
type = NumNodes
[../]
[./evaluations] # Cumulative residual calculations for simulation
type = NumResidualEvaluations
[../]
[./total_energy] # Total free energy at each timestep
type = ElementIntegralVariablePostprocessor
variable = f_density
execute_on = 'initial timestep_end'
[../]
[./num_features] # Number of precipitates formed
type = FeatureFloodCount
variable = c
threshold = 0.6
[../]
[./precipitate_area] # Fraction of surface devoted to precipitates
type = ElementIntegralMaterialProperty
mat_prop = prec_indic
[../]
[./active_time] # Time computer spent on simulation
type = PerfGraphData
section_name = "Root"
data_type = total
[../]
[]
[Preconditioning]
[./coupled]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
l_max_its = 30
l_tol = 1e-6
nl_max_its = 50
nl_abs_tol = 1e-9
end_time = 604800 # 7 days
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_ksp_type
-sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly
ilu 1'
[./TimeStepper]
type = IterationAdaptiveDT
dt = 10
cutback_factor = 0.8
growth_factor = 1.5
optimal_iterations = 7
[../]
[./Adaptivity]
coarsen_fraction = 0.1
refine_fraction = 0.7
max_h_level = 2
[../]
[]
[Outputs]
exodus = true
console = true
csv = true
[./console]
type = Console
max_rows = 10
[../]
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/rayleigh-bernard-two-phase.i)
mu = 1.0
rho = 1e3
mu_d = 0.3
rho_d = 1.0
dp = 0.01
U_lid = 0.0
g = -9.81
[GlobalParams]
velocity_interp_method = 'rc'
advected_interp_method = 'upwind'
rhie_chow_user_object = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = .1
ymin = 0
ymax = .1
nx = 11
ny = 11
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
[]
[vel_y]
type = INSFVVelocityVariable
[]
[pressure]
type = INSFVPressureVariable
[]
[phase_2]
type = INSFVScalarFieldVariable
[]
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[pin_pressure]
type = NSPressurePin
variable = pressure
pin_type = point-value
point = '0 0 0'
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = 'rho_mixture'
[]
[u_time]
type = INSFVMomentumTimeDerivative
variable = vel_x
rho = 'rho_mixture'
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = 'rho_mixture'
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_mixture'
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[u_buoyant]
type = INSFVMomentumGravity
variable = vel_x
rho = 'rho_mixture'
momentum_component = 'x'
gravity = '0 ${g} 0'
[]
[v_time]
type = INSFVMomentumTimeDerivative
variable = vel_y
rho = 'rho_mixture'
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = 'rho_mixture'
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_mixture'
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[v_buoyant]
type = INSFVMomentumGravity
variable = vel_y
rho = 'rho_mixture'
momentum_component = 'y'
gravity = '0 ${g} 0'
[]
[phase_2_time]
type = FVFunctorTimeKernel
variable = phase_2
[]
[phase_2_advection]
type = INSFVScalarFieldAdvection
variable = phase_2
u_slip = 'vel_slip_x'
v_slip = 'vel_slip_y'
[]
[phase_2_diffusion]
type = FVDiffusion
variable = phase_2
coeff = 1e-3
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${U_lid}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[bottom_phase_2]
type = FVDirichletBC
variable = phase_2
boundary = 'bottom'
value = 1.0
[]
[top_phase_2]
type = FVDirichletBC
variable = phase_2
boundary = 'top'
value = 0.0
[]
[]
[AuxVariables]
[U]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[drag_coefficient]
type = MooseVariableFVReal
[]
[rho_mixture_var]
type = MooseVariableFVReal
[]
[mu_mixture_var]
type = MooseVariableFVReal
[]
[phase_1]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[mag]
type = VectorMagnitudeAux
variable = U
x = vel_x
y = vel_y
[]
[populate_cd]
type = FunctorAux
variable = drag_coefficient
functor = 'Darcy_coefficient'
[]
[populate_rho_mixture_var]
type = FunctorAux
variable = rho_mixture_var
functor = 'rho_mixture'
[]
[populate_mu_mixture_var]
type = FunctorAux
variable = mu_mixture_var
functor = 'mu_mixture'
[]
[compute_phase_1]
type = ParsedAux
variable = phase_1
coupled_variables = 'phase_2'
expression = '1 - phase_2'
[]
[]
[FunctorMaterials]
[CD]
type = NSFVDispersePhaseDragFunctorMaterial
rho = 'rho_mixture'
mu = mu_mixture
u = 'vel_x'
v = 'vel_y'
particle_diameter = ${dp}
[]
[mixing_material]
type = NSFVMixtureFunctorMaterial
phase_1_names = '${rho_d} ${mu_d}'
phase_2_names = '${rho} ${mu}'
prop_names = 'rho_mixture mu_mixture'
phase_1_fraction = 'phase_2'
[]
[populate_u_slip]
type = WCNSFV2PSlipVelocityFunctorMaterial
slip_velocity_name = 'vel_slip_x'
momentum_component = 'x'
u = 'vel_x'
v = 'vel_y'
rho = ${rho}
mu = 'mu_mixture'
rho_d = ${rho_d}
particle_diameter = ${dp}
linear_coef_name = 'Darcy_coefficient'
[]
[populate_v_slip]
type = WCNSFV2PSlipVelocityFunctorMaterial
slip_velocity_name = 'vel_slip_y'
momentum_component = 'y'
u = 'vel_x'
v = 'vel_y'
rho = ${rho}
mu = 'mu_mixture'
rho_d = ${rho_d}
particle_diameter = ${dp}
linear_coef_name = 'Darcy_coefficient'
[]
[]
[Postprocessors]
[average_void]
type = ElementAverageValue
variable = 'phase_2'
[]
[max_y_velocity]
type = ElementExtremeValue
variable = 'vel_y'
value_type = max
[]
[min_y_velocity]
type = ElementExtremeValue
variable = 'vel_y'
value_type = min
[]
[max_x_velocity]
type = ElementExtremeValue
variable = 'vel_x'
value_type = max
[]
[min_x_velocity]
type = ElementExtremeValue
variable = 'vel_x'
value_type = min
[]
[max_x_slip_velocity]
type = ElementExtremeFunctorValue
functor = 'vel_slip_x'
value_type = max
[]
[max_y_slip_velocity]
type = ElementExtremeFunctorValue
functor = 'vel_slip_y'
value_type = max
[]
[max_drag_coefficient]
type = ElementExtremeFunctorValue
functor = 'drag_coefficient'
value_type = max
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 10
iteration_window = 2
growth_factor = 2
cutback_factor = 0.5
dt = 1e-3
[]
nl_max_its = 20
nl_rel_tol = 1e-03
nl_abs_tol = 1e-9
l_max_its = 5
end_time = 1e8
[]
[Outputs]
exodus = false
[CSV]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/phase_field/test/tests/Nucleation/timestep.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
nz = 0
xmin = 0
xmax = 20
ymin = 0
ymax = 20
[]
[Variables]
[./c]
order = FIRST
family = LAGRANGE
[../]
[]
[BCs]
[./left]
type = DirichletBC
boundary = left
variable = c
value = 0
[../]
[./right]
type = DirichletBC
boundary = right
variable = c
value = 1
[../]
[./Periodic]
[./all]
auto_direction = y
[../]
[../]
[]
[Kernels]
[./c]
type = Diffusion
variable = c
[../]
[./dt]
type = TimeDerivative
variable = c
[../]
[]
[UserObjects]
[./inserter]
type = DiscreteNucleationInserter
hold_time = 1
probability = 0.0005
radius = 3.27
[../]
[./map]
type = DiscreteNucleationMap
periodic = c
inserter = inserter
[../]
[]
[Postprocessors]
[./dt]
type = TimestepSize
[../]
[./dtnuc]
type = DiscreteNucleationTimeStep
inserter = inserter
p2nucleus = 0.1
dt_max = 0.5
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
num_steps = 20
[./TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 8
iteration_window = 2
timestep_limiting_postprocessor = dtnuc
dt = 1
[../]
[]
[Outputs]
execute_on = 'timestep_end'
csv = true
[]
(modules/solid_mechanics/test/tests/anisotropic_plasticity/ad_aniso_plasticity_y.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 3
# Original verification nx = 2, ny = 10, nz = 2
nx = 2
ny = 10
nz = 2
xmin = 0.0
ymin = 0.0
zmin = 0.0
xmax = 1.0
ymax = 10.0
zmax = 1.0
[]
[corner_node]
type = ExtraNodesetGenerator
new_boundary = '100'
nodes = '4 10'
input = gen
[]
[corner_node_2]
type = ExtraNodesetGenerator
new_boundary = '101'
nodes = '1 67'
input = corner_node
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
volumetric_locking_correction = true
[]
[AuxVariables]
[hydrostatic_stress]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_xx]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_xy]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[stress_yy]
order = CONSTANT
family = MONOMIAL
[]
[elastic_strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[hydrostatic_stress]
type = ADRankTwoScalarAux
variable = hydrostatic_stress
rank_two_tensor = stress
scalar_type = Hydrostatic
[]
[plasticity_strain_xx]
type = ADRankTwoAux
rank_two_tensor = trial_plasticity_plastic_strain
variable = plastic_strain_xx
index_i = 0
index_j = 0
[]
[plasticity_strain_xy]
type = ADRankTwoAux
rank_two_tensor = trial_plasticity_plastic_strain
variable = plastic_strain_xy
index_i = 0
index_j = 1
[]
[plasticity_strain_yy]
type = ADRankTwoAux
rank_two_tensor = trial_plasticity_plastic_strain
variable = plastic_strain_yy
index_i = 1
index_j = 1
[]
[elastic_strain_yy]
type = ADRankTwoAux
rank_two_tensor = elastic_strain
variable = elastic_strain_yy
index_i = 1
index_j = 1
[]
[sigma_yy]
type = ADRankTwoAux
rank_two_tensor = stress
variable = stress_yy
index_i = 1
index_j = 1
[]
[]
[Functions]
[pull]
type = PiecewiseLinear
x = '0 1e1 1e8'
y = '0 -4e2 -4e2'
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = FINITE
use_automatic_differentiation = true
add_variables = true
[]
[]
[Materials]
[elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 70000
poissons_ratio = 0.25
[]
[elastic_strain]
type = ADComputeMultipleInelasticStress
inelastic_models = "trial_plasticity"
max_iterations = 50
absolute_tolerance = 1e-16
[]
[hill_tensor]
type = ADHillConstants
# F G H L M N
hill_constants = "0.5829856 0.364424 0.6342174 2.0691375 2.3492325 1.814589"
base_name = trial_plasticity
[]
[trial_plasticity]
type = ADHillPlasticityStressUpdate
hardening_constant = 2000.0
yield_stress = 0.001
absolute_tolerance = 1e-14
relative_tolerance = 1e-12
base_name = trial_plasticity
internal_solve_full_iteration_history = true
max_inelastic_increment = 2.0e-6
internal_solve_output_on = on_error
[]
[]
[BCs]
[no_disp_x]
type = ADDirichletBC
variable = disp_x
boundary = 101
value = 0.0
[]
[no_disp_y]
type = ADDirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[]
[no_disp_z]
type = ADDirichletBC
variable = disp_z
boundary = 100
value = 0.0
[]
[Pressure]
[Side1]
boundary = top
function = pull
[]
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_rel_tol = 1e-11
nl_abs_tol = 1.0e-14
l_max_its = 90
num_steps = 25
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 30
iteration_window = 9
growth_factor = 1.05
cutback_factor = 0.5
timestep_limiting_postprocessor = matl_ts_min
dt = 1e-5
time_t = '0 3.2e-5 10'
time_dt = '1e-5 1.0e-7 1.0e-7'
[]
start_time = 0
automatic_scaling = true
[]
[Postprocessors]
[matl_ts_min]
type = MaterialTimeStepPostprocessor
[]
[max_disp_x]
type = ElementExtremeValue
variable = disp_x
[]
[max_disp_y]
type = ElementExtremeValue
variable = disp_y
[]
[max_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
[]
[dt]
type = TimestepSize
[]
[num_lin]
type = NumLinearIterations
outputs = console
[]
[num_nonlin]
type = NumNonlinearIterations
outputs = console
[]
[plasticity_strain_yy]
type = ElementalVariableValue
variable = plastic_strain_yy
execute_on = 'TIMESTEP_END'
elementid = 39
[]
[elastic_strain_yy]
type = ElementalVariableValue
variable = elastic_strain_yy
execute_on = 'TIMESTEP_END'
elementid = 39
[]
[sigma_yy]
type = ElementalVariableValue
variable = stress_yy
execute_on = 'TIMESTEP_END'
elementid = 39
[]
[]
[Outputs]
csv = true
perf_graph = true
[]
(modules/solid_mechanics/test/tests/anisotropic_elastoplasticity/hoop_strain_comparison.i)
# This test compares the hoop strain at two different elements in an internally
# pressurized cylinder with anisotropic plasticity: different yield condition
# for hoop and axial directions. The elements are located circumferentially
# apart but at same axial position. It is expected that due to pressurization
# hoop strains will develop with uniform magnitude along hoop direction. The
# test verifies that the plastic hoop strain is uniform in hoop direction.
# For 3D simulations with material properties oriented along the curved
# geometry such as cylinder or sphere, the stresses and strains are rotated to
# the local coordinate system from the global coordinate system. The plastic
# strain is calculated in the local coordinate system and then transformed to
# the global coordinate system. This test involves a 3D cylindrical geometry,
# and helps in indirectly verifying that this transformation of stresses and
# strains back and forth between the local and global coordinate system is
# correctly implemented.
[Mesh]
file = quarter_cylinder.e
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
volumetric_locking_correction = true
[]
[AuxVariables]
[hydrostatic_stress]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_xx]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_xy]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_zz]
order = CONSTANT
family = MONOMIAL
[]
[stress_zz]
order = CONSTANT
family = MONOMIAL
[]
[stress_xx]
order = CONSTANT
family = MONOMIAL
[]
[stress_yy]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[hydrostatic_stress]
type = ADRankTwoScalarAux
variable = hydrostatic_stress
rank_two_tensor = stress
scalar_type = Hydrostatic
[]
[plasticity_strain_xx]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_xx
index_i = 0
index_j = 0
[]
[plasticity_strain_xy]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_xy
index_i = 0
index_j = 1
[]
[plasticity_strain_yy]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_yy
index_i = 1
index_j = 1
[]
[plasticity_strain_zz]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_zz
index_i = 2
index_j = 2
[]
[stress_zz]
type = ADRankTwoAux
rank_two_tensor = stress
variable = stress_zz
index_i = 2
index_j = 2
[]
[stress_xx]
type = ADRankTwoAux
rank_two_tensor = stress
variable = stress_xx
index_i = 0
index_j = 0
[]
[stress_yy]
type = ADRankTwoAux
rank_two_tensor = stress
variable = stress_yy
index_i = 1
index_j = 1
[]
[]
[Functions]
[push]
type = PiecewiseLinear
x = '0 1e2'
y = '0 200e6'
[]
[swelling_func]
type = ParsedFunction
expression = 0
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = FINITE
generate_output = 'elastic_strain_zz elastic_strain_xx elastic_strain_yy stress_xx stress_yy stress_zz strain_zz plastic_strain_zz plastic_strain_xx plastic_strain_yy hoop_stress hoop_strain'
use_automatic_differentiation = true
add_variables = true
cylindrical_axis_point1 = '0 0 0'
cylindrical_axis_point2 = '0 1 0'
[]
[]
[Constraints]
[mid_section_plane]
type = EqualValueBoundaryConstraint
variable = disp_y
secondary = top # boundary
penalty = 1.0e+10
[]
[]
[Materials]
[swelling]
type = ADGenericFunctionMaterial
prop_values = swelling_func
prop_names = swelling
[]
[elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 200.0e9
poissons_ratio = 0.2
[]
[elastic_strain]
type = ADComputeMultipleInelasticStress
inelastic_models = "plasticity"
max_iterations = 50
absolute_tolerance = 1e-30 #1e-16
[]
[hill_tensor]
type = ADHillConstants
# F G H L M N
# hill_constants = "0.5 0.5 0.5 1.5 1.5 1.5"
hill_constants = "0.5 0.25 0.5 1.5 1.5 1.5"
[]
[plasticity]
type = ADHillElastoPlasticityStressUpdate
hardening_constant = 1.5e10
hardening_exponent = 1.0
yield_stress = 0.0 # 60e6
local_cylindrical_csys = true
# local_spherical_csys = false
axis = y
absolute_tolerance = 1e-15 # 1e-8
relative_tolerance = 1e-13 # 1e-15
internal_solve_full_iteration_history = true
max_inelastic_increment = 2.0e-6
internal_solve_output_on = on_error
[]
[]
[BCs]
[no_disp_x]
type = ADDirichletBC
variable = disp_x
boundary = x_face
value = 0.0
[]
[no_disp_y]
type = ADDirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[]
[no_disp_z]
type = ADDirichletBC
variable = disp_z
boundary = z_face
value = 0.0
[]
[Pressure]
[Side1]
boundary = inner
function = push
[]
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_rel_tol = 1e-12
nl_abs_tol = 1e-14
# nl_abs_tol = 1e-10
l_max_its = 90
nl_max_its = 30
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 30
iteration_window = 9
growth_factor = 1.05
cutback_factor = 0.5
timestep_limiting_postprocessor = matl_ts_min
dt = 0.1e-4
time_t = '0 6.23 10'
time_dt = '0.1 1.0e-2 1.0e-2'
[]
num_steps = 3
start_time = 0
end_time = 200.0
automatic_scaling = true
dtmax = 0.1e-4
[]
[Postprocessors]
[matl_ts_min]
type = MaterialTimeStepPostprocessor
[]
[hoop_strain_elementA]
type = ElementalVariableValue
elementid = 464
variable = hoop_strain
[]
[hoop_strain_elementB]
type = ElementalVariableValue
elementid = 478
variable = hoop_strain
[]
[hoop_strain_diff]
type = DifferencePostprocessor
value1 = hoop_strain_elementA
value2 = hoop_strain_elementB
[]
[]
[Outputs]
csv = true
exodus = false
perf_graph = true
[]
(modules/combined/test/tests/adaptive_timestepping/adapt_tstep_function_change_restart1.i)
# This is a test designed to evaluate the cabability of the
# IterationAdaptiveDT TimeStepper to adjust time step size according to
# a function. For example, if the power input function for a BISON
# simulation rapidly increases or decreases, the IterationAdaptiveDT
# TimeStepper should take time steps small enough to capture the
# oscillation.
[GlobalParams]
order = FIRST
family = LAGRANGE
block = 1
displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
file = 1hex8_10mm_cube.e
[]
[Functions]
[./Fiss_Function]
type = PiecewiseLinear
x = '0 1e6 2e6 2.001e6 2.002e6'
y = '0 3e8 3e8 12e8 0'
[../]
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[./disp_z]
[../]
[./temp]
initial_condition = 300.0
[../]
[]
[Modules/TensorMechanics/Master]
[./all]
strain = FINITE
incremental = true
volumetric_locking_correction = true
eigenstrain_names = thermal_expansion
decomposition_method = EigenSolution
add_variables = true
generate_output = 'vonmises_stress'
temperature = temp
[../]
[]
[Kernels]
[./heat]
type = HeatConduction
variable = temp
[../]
[./heat_ie]
type = HeatConductionTimeDerivative
variable = temp
[../]
[./heat_source]
type = HeatSource
variable = temp
value = 1.0
function = Fiss_Function
[../]
[]
[BCs]
[./bottom_temp]
type = DirichletBC
variable = temp
boundary = 1
value = 300
[../]
[./top_bottom_disp_x]
type = DirichletBC
variable = disp_x
boundary = '1'
value = 0
[../]
[./top_bottom_disp_y]
type = DirichletBC
variable = disp_y
boundary = '1'
value = 0
[../]
[./top_bottom_disp_z]
type = DirichletBC
variable = disp_z
boundary = '1'
value = 0
[../]
[]
[Materials]
[./thermal]
type = HeatConductionMaterial
temp = temp
specific_heat = 1.0
thermal_conductivity = 1.0
[../]
[./elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 300e6
poissons_ratio = .3
[../]
[./stress]
type = ComputeFiniteStrainElasticStress
[../]
[./thermal_expansion]
type = ComputeThermalExpansionEigenstrain
thermal_expansion_coeff = 5e-6
stress_free_temperature = 300.0
temperature = temp
eigenstrain_name = thermal_expansion
[../]
[./density]
type = Density
density = 10963.0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
verbose = true
nl_abs_tol = 1e-10
start_time = 0.0
num_steps = 65
end_time = 2.002e6
[./TimeStepper]
type = IterationAdaptiveDT
timestep_limiting_function = Fiss_Function
max_function_change = 3e7
dt = 1e6
[../]
[]
[Postprocessors]
[./Temperature_of_Block]
type = ElementAverageValue
variable = temp
execute_on = 'initial timestep_end'
[../]
[./vonMises]
type = ElementAverageValue
variable = vonmises_stress
execute_on = 'initial timestep_end'
[../]
[]
[Outputs]
[./out]
type = Exodus
elemental_as_nodal = true
[../]
[./console]
type = Console
max_rows = 10
[../]
[./checkpoint]
type = Checkpoint
num_files = 1
[../]
[]
(modules/phase_field/examples/grain_growth/grain_growth_2D_graintracker.i)
# This simulation predicts GB migration of a 2D copper polycrystal with 100 grains represented with 8 order parameters
# Mesh adaptivity and time step adaptivity are used
# An AuxVariable is used to calculate the grain boundary locations
# Postprocessors are used to record time step and the number of grains
[Mesh]
# Mesh block. Meshes can be read in or automatically generated
type = GeneratedMesh
dim = 2 # Problem dimension
nx = 44 # Number of elements in the x-direction
ny = 44 # Number of elements in the y-direction
xmax = 1000 # maximum x-coordinate of the mesh
ymax = 1000 # maximum y-coordinate of the mesh
elem_type = QUAD4 # Type of elements used in the mesh
uniform_refine = 2 # Initial uniform refinement of the mesh
[]
[GlobalParams]
# Parameters used by several kernels that are defined globally to simplify input file
op_num = 8 # Number of order parameters used
var_name_base = gr # Base name of grains
[]
[Modules]
[PhaseField]
[GrainGrowth]
[]
[]
[]
[UserObjects]
[voronoi]
type = PolycrystalVoronoi
grain_num = 100 # Number of grains
rand_seed = 10
int_width = 7
[]
[grain_tracker]
type = GrainTracker
[]
[]
[ICs]
[PolycrystalICs]
[PolycrystalColoringIC]
polycrystal_ic_uo = voronoi
[]
[]
[]
[AuxVariables]
# Dependent variables
[unique_grains]
order = CONSTANT
family = MONOMIAL
[]
[var_indices]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
# AuxKernel block, defining the equations used to calculate the auxvars
[bnds_aux]
# AuxKernel that calculates the GB term
type = BndsCalcAux
variable = bnds
execute_on = 'initial timestep_end'
[]
[unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_tracker
field_display = UNIQUE_REGION
execute_on = 'initial timestep_end'
[]
[var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
execute_on = 'initial timestep_end'
[]
[]
[BCs]
# Boundary Condition block
[Periodic]
[All]
auto_direction = 'x y' # Makes problem periodic in the x and y directions
[]
[]
[]
[Materials]
[CuGrGr]
# Material properties
type = GBEvolution
T = 450 # Constant temperature of the simulation (for mobility calculation)
wGB = 14 # Width of the diffuse GB
GBmob0 = 2.5e-6 #m^4(Js) for copper from schonfelder1997molecular bibtex entry
Q = 0.23 #eV for copper from schonfelder1997molecular bibtex entry
GBenergy = 0.708 #J/m^2 from schonfelder1997molecular bibtex entry
[]
[]
[Postprocessors]
# Scalar postprocessors
[dt]
# Outputs the current time step
type = TimestepSize
[]
[]
[Executioner]
type = Transient # Type of executioner, here it is transient with an adaptive time step
scheme = bdf2 # Type of time integration (2nd order backward euler), defaults to 1st order backward euler
#Preconditioned JFNK (default)
solve_type = 'PJFNK'
# Uses newton iteration to solve the problem.
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
l_max_its = 50 # Max number of linear iterations
l_tol = 1e-4 # Relative tolerance for linear solves
nl_max_its = 10 # Max number of nonlinear iterations
end_time = 4000
[TimeStepper]
type = IterationAdaptiveDT
dt = 20 # Initial time step. In this simulation it changes.
optimal_iterations = 6 # Time step will adapt to maintain this number of nonlinear iterations
[]
[Adaptivity]
# Block that turns on mesh adaptivity. Note that mesh will never coarsen beyond initial mesh (before uniform refinement)
initial_adaptivity = 2 # Number of times mesh is adapted to initial condition
refine_fraction = 0.8 # Fraction of high error that will be refined
coarsen_fraction = 0.05 # Fraction of low error that will coarsened
max_h_level = 2 # Max number of refinements used, starting from initial mesh (before uniform refinement)
[]
[]
[Outputs]
exodus = true # Exodus file will be outputted
csv = true
[]
(modules/solid_mechanics/test/tests/material_limit_time_step/elas_plas/nafems_nl1_lim.i)
#
# Tests material model IsotropicPlasticity with material based time stepper
# Boundary conditions from NAFEMS test NL1
#
[GlobalParams]
order = FIRST
family = LAGRANGE
volumetric_locking_correction = true
displacements = 'disp_x disp_y'
[]
[Mesh]#Comment
file = one_elem2.e
[] # Mesh
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[] # Variables
[AuxVariables]
[./stress_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./stress_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./stress_zz]
order = CONSTANT
family = MONOMIAL
[../]
[./stress_xy]
order = CONSTANT
family = MONOMIAL
[../]
[./vonmises]
order = CONSTANT
family = MONOMIAL
[../]
[./elastic_strain_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./plastic_strain_eff]
order = CONSTANT
family = MONOMIAL
[../]
[./tot_strain_yy]
order = CONSTANT
family = MONOMIAL
[../]
[] # AuxVariables
[Kernels]
[SolidMechanics]
use_displaced_mesh = true
[../]
[]
[AuxKernels]
[./stress_xx]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_xx
index_i = 0
index_j = 0
[../]
[./stress_yy]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_yy
index_i = 1
index_j = 1
[../]
[./stress_zz]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_zz
index_i = 2
index_j = 2
[../]
[./stress_xy]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_xy
index_i = 0
index_j = 1
[../]
[./vonmises]
type = RankTwoScalarAux
rank_two_tensor = stress
variable = vonmises
scalar_type = VonMisesStress
execute_on = timestep_end
[../]
[./elastic_strain_yy]
type = RankTwoAux
rank_two_tensor = elastic_strain
variable = elastic_strain_yy
index_i = 1
index_j = 1
[../]
[./plastic_strain_eff]
type = MaterialRealAux
property = effective_plastic_strain
variable = plastic_strain_eff
[../]
[./tot_strain_yy]
type = RankTwoAux
rank_two_tensor = total_strain
variable = tot_strain_yy
index_i = 1
index_j = 1
[../]
[] # AuxKernels
[Functions]
[./appl_dispx]
type = PiecewiseLinear
x = '0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0'
y = '0.0 0.25e-4 0.50e-4 0.50e-4 0.50e-4 0.25e-4 0.0 0.0 0.0'
[../]
[./appl_dispy]
type = PiecewiseLinear
x = '0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0'
y = '0.0 0.0 0.0 0.25e-4 0.50e-4 0.50e-4 0.50e-4 0.25e-4 0.0 '
[../]
[]
[BCs]
[./side_x]
type = DirichletBC
variable = disp_x
boundary = 101
value = 0.0
[../]
[./origin_x]
type = DirichletBC
variable = disp_x
boundary = 103
value = 0.0
[../]
[./bot_y]
type = DirichletBC
variable = disp_y
boundary = 102
value = 0.0
[../]
[./origin_y]
type = DirichletBC
variable = disp_y
boundary = 103
value = 0.0
[../]
[./top_y]
type = FunctionDirichletBC
variable = disp_y
boundary = 1
function = appl_dispy
[../]
[./right_x]
type = FunctionDirichletBC
variable = disp_x
boundary = 2
function = appl_dispx
[../]
[]
[Materials]
[./elasticity_tensor]
type = ComputeIsotropicElasticityTensor
block = 1
youngs_modulus = 250e9
poissons_ratio = 0.25
[../]
[./strain]
type = ComputePlaneFiniteStrain
block = 1
[../]
[./stress]
type = ComputeMultipleInelasticStress
inelastic_models = 'isoplas'
block = 1
[../]
[./isoplas]
type = IsotropicPlasticityStressUpdate
yield_stress = 5e6
hardening_constant = 0.0
relative_tolerance = 1e-20
absolute_tolerance = 1e-8
max_inelastic_increment = 0.000001
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
nl_rel_tol = 1e-10
nl_abs_tol = 1e-12
l_tol = 1e-4
l_max_its = 100
nl_max_its = 20
[./TimeStepper]
type = IterationAdaptiveDT
dt = 0.1
time_t = '1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0'
time_dt = '0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1'
optimal_iterations = 30
iteration_window = 9
growth_factor = 2.0
cutback_factor = 0.5
timestep_limiting_postprocessor = matl_ts_min
[../]
start_time = 0.0
num_steps = 1000
end_time = 8.0
[] # Executioner
[Postprocessors]
[./matl_ts_min]
type = MaterialTimeStepPostprocessor
[../]
[./stress_xx]
type = ElementAverageValue
variable = stress_xx
[../]
[./stress_yy]
type = ElementAverageValue
variable = stress_yy
[../]
[./stress_zz]
type = ElementAverageValue
variable = stress_zz
[../]
[./vonmises]
type = ElementAverageValue
variable = vonmises
[../]
[./el_strain_yy]
type = ElementAverageValue
variable = elastic_strain_yy
[../]
[./plas_strain_eff]
type = ElementAverageValue
variable = plastic_strain_eff
[../]
[./tot_strain_yy]
type = ElementAverageValue
variable = tot_strain_yy
[../]
[./disp_x1]
type = NodalVariableValue
nodeid = 0
variable = disp_x
[../]
[./disp_x4]
type = NodalVariableValue
nodeid = 3
variable = disp_x
[../]
[./disp_y1]
type = NodalVariableValue
nodeid = 0
variable = disp_y
[../]
[./disp_y4]
type = NodalVariableValue
nodeid = 3
variable = disp_y
[../]
[./_dt]
type = TimestepSize
[../]
[]
[Outputs]
exodus = true
csv = true
[./console]
type = Console
output_linear = true
[../]
[] # Outputs
(modules/porous_flow/test/tests/fluidstate/theis_nonisothermal.i)
# Two-phase nonisothermal Theis problem: Flow from single source using WaterNCG fluidstate.
# Constant rate injection 2 kg/s of cold gas into warm reservoir
# 1D cylindrical mesh
# Initially, system has only a liquid phase, until enough gas is injected
# to form a gas phase, in which case the system becomes two phase.
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
nx = 40
xmin = 0.1
xmax = 200
bias_x = 1.05
[]
coord_type = RZ
rz_coord_axis = Y
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[AuxVariables]
[saturation_gas]
order = CONSTANT
family = MONOMIAL
[]
[x1]
order = CONSTANT
family = MONOMIAL
[]
[y0]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[saturation_gas]
type = PorousFlowPropertyAux
variable = saturation_gas
property = saturation
phase = 1
execute_on = timestep_end
[]
[x1]
type = PorousFlowPropertyAux
variable = x1
property = mass_fraction
phase = 0
fluid_component = 1
execute_on = timestep_end
[]
[y0]
type = PorousFlowPropertyAux
variable = y0
property = mass_fraction
phase = 1
fluid_component = 0
execute_on = timestep_end
[]
[]
[Variables]
[pgas]
initial_condition = 20e6
[]
[zi]
initial_condition = 0
[]
[temperature]
initial_condition = 70
scaling = 1e-4
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = pgas
[]
[flux0]
type = PorousFlowAdvectiveFlux
fluid_component = 0
variable = pgas
[]
[mass1]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = zi
[]
[flux1]
type = PorousFlowAdvectiveFlux
fluid_component = 1
variable = zi
[]
[energy]
type = PorousFlowEnergyTimeDerivative
variable = temperature
[]
[heatadv]
type = PorousFlowHeatAdvection
variable = temperature
[]
[conduction]
type = PorousFlowHeatConduction
variable = temperature
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pgas zi temperature'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureConst
pc = 0
[]
[fs]
type = PorousFlowWaterNCG
water_fp = water
gas_fp = methane
capillary_pressure = pc
[]
[]
[FluidProperties]
[methane]
type = MethaneFluidProperties
[]
[water]
type = Water97FluidProperties
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = temperature
[]
[waterncg]
type = PorousFlowFluidState
gas_porepressure = pgas
z = zi
temperature = temperature
temperature_unit = Celsius
capillary_pressure = pc
fluid_state = fs
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.2
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-12 0 0 0 1e-12 0 0 0 1e-12'
[]
[relperm_water]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
s_res = 0.1
sum_s_res = 0.1
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 1
[]
[rockheat]
type = PorousFlowMatrixInternalEnergy
specific_heat_capacity = 1000
density = 2500
[]
[rock_thermal_conductivity]
type = PorousFlowThermalConductivityIdeal
dry_thermal_conductivity = '50 0 0 0 50 0 0 0 50'
[]
[]
[BCs]
[cold_gas]
type = DirichletBC
boundary = left
variable = temperature
value = 20
[]
[gas_injecton]
type = PorousFlowSink
boundary = left
variable = zi
flux_function = -0.159155
[]
[rightwater]
type = DirichletBC
boundary = right
value = 20e6
variable = pgas
[]
[righttemp]
type = DirichletBC
boundary = right
value = 70
variable = temperature
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
petsc_options_value = 'gmres asm lu NONZERO 2'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 1e4
nl_abs_tol = 1e-7
nl_rel_tol = 1e-5
[TimeStepper]
type = IterationAdaptiveDT
dt = 1
growth_factor = 1.5
[]
[]
[Postprocessors]
[pgas]
type = PointValue
point = '2 0 0'
variable = pgas
[]
[sgas]
type = PointValue
point = '2 0 0'
variable = saturation_gas
[]
[zi]
type = PointValue
point = '2 0 0'
variable = zi
[]
[temperature]
type = PointValue
point = '2 0 0'
variable = temperature
[]
[massgas]
type = PorousFlowFluidMass
fluid_component = 1
[]
[x1]
type = PointValue
point = '2 0 0'
variable = x1
[]
[y0]
type = PointValue
point = '2 0 0'
variable = y0
[]
[]
[Outputs]
print_linear_residuals = false
perf_graph = true
csv = true
[]
(modules/phase_field/examples/anisotropic_interfaces/ad_snow.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 14
ny = 14
xmax = 9
ymax = 9
uniform_refine = 3
[]
[Variables]
[./w]
[../]
[./T]
[../]
[]
[ICs]
[./wIC]
type = SmoothCircleIC
variable = w
int_width = 0.1
x1 = 4.5
y1 = 4.5
radius = 0.07
outvalue = 0
invalue = 1
[../]
[]
[Kernels]
[./w_dot]
type = ADTimeDerivative
variable = w
[../]
[./anisoACinterface1]
type = ADACInterfaceKobayashi1
variable = w
mob_name = adM
[../]
[./anisoACinterface2]
type = ADACInterfaceKobayashi2
variable = w
mob_name = adM
[../]
[./AllenCahn]
type = AllenCahn
variable = w
mob_name = M
f_name = fbulk
coupled_variables = T
[../]
[./T_dot]
type = ADTimeDerivative
variable = T
[../]
[./CoefDiffusion]
type = ADDiffusion
variable = T
[../]
[./w_dot_T]
type = ADCoefCoupledTimeDerivative
variable = T
v = w
coef = -1.8
[../]
[]
[Materials]
[./free_energy]
type = DerivativeParsedMaterial
property_name = fbulk
coupled_variables = 'w T'
constant_names = pi
constant_expressions = 4*atan(1)
expression = 'm:=0.9 * atan(10 * (1 - T)) / pi; 1/4*w^4 - (1/2 - m/3) * w^3 + (1/4 - m/2) * w^2'
derivative_order = 2
outputs = exodus
[../]
[./material]
type = ADInterfaceOrientationMaterial
op = w
[../]
[./consts1]
type = ADGenericConstantMaterial
prop_names = 'adM'
prop_values = '3333.333'
[../]
[./consts2]
type = GenericConstantMaterial
prop_names = 'M'
prop_values = '3333.333'
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu '
nl_abs_tol = 1e-10
nl_rel_tol = 1e-08
l_max_its = 30
end_time = 1
[./TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 6
iteration_window = 2
dt = 0.0005
growth_factor = 1.1
cutback_factor = 0.75
[../]
[./Adaptivity]
initial_adaptivity = 3 # Number of times mesh is adapted to initial condition
refine_fraction = 0.7 # Fraction of high error that will be refined
coarsen_fraction = 0.1 # Fraction of low error that will coarsened
max_h_level = 5 # Max number of refinements used, starting from initial mesh (before uniform refinement)
weight_names = 'w T'
weight_values = '1 0.5'
[../]
[]
[Outputs]
time_step_interval = 5
exodus = true
[]
(modules/solid_mechanics/test/tests/material_limit_time_step/mult_inelastic/no_inelastic_model_timestep_limit.i)
# This is a basic test of the material time step computed by the
# ComputeMultipleInelasticStress model. If no inelastic models
# are defined, the material time step should be the maximum
# value representable by a real number.
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 1
elem_type = HEX8
[]
[AuxVariables]
[damage_index]
order = CONSTANT
family = MONOMIAL
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = SMALL
incremental = true
add_variables = true
generate_output = 'stress_xx strain_xx'
[]
[]
[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 = DirichletBC
variable = disp_x
boundary = right
value = 0.01
[]
[]
[Materials]
[stress]
type = ComputeMultipleInelasticStress
inelastic_models = ''
[]
[elasticity]
type = ComputeIsotropicElasticityTensor
poissons_ratio = 0.2
youngs_modulus = 10e9
[]
[]
[Postprocessors]
[stress_xx]
type = ElementAverageValue
variable = stress_xx
[]
[strain_xx]
type = ElementAverageValue
variable = strain_xx
[]
[time_step_limit]
type = MaterialTimeStepPostprocessor
[]
[]
[Executioner]
type = Transient
l_max_its = 50
l_tol = 1e-8
nl_max_its = 20
nl_rel_tol = 1e-12
nl_abs_tol = 1e-8
dt = 0.1
dtmin = 0.001
end_time = 1.1
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.1
growth_factor = 2.0
cutback_factor = 0.5
timestep_limiting_postprocessor = time_step_limit
[]
[]
[Outputs]
csv=true
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_velocity.i)
rho = 'rho'
l = 10
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 10
ny = 5
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = ${inlet_velocity}
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T_fluid]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[scalar]
type = MooseVariableFVReal
initial_condition = 0.1
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FVKernels]
[mass_time]
type = WCNSFVMassTimeDerivative
variable = pressure
drho_dt = drho_dt
[]
[mass]
type = WCNSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = vel_x
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = vel_y
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T_fluid
rho = rho
drho_dt = drho_dt
h = h
dh_dt = dh_dt
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T_fluid
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T_fluid
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T_fluid
v = power_density
[]
# Scalar concentration equation
[scalar_time]
type = FVFunctorTimeKernel
variable = scalar
[]
[scalar_advection]
type = INSFVScalarFieldAdvection
variable = scalar
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[scalar_diffusion]
type = FVDiffusion
variable = scalar
coeff = 1.1
[]
[scalar_source]
type = FVBodyForce
variable = scalar
function = 2.1
[]
[]
[FVBCs]
# Inlet
[inlet_mass]
type = WCNSFVMassFluxBC
variable = pressure
boundary = 'left'
velocity_pp = 'inlet_u'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_u]
type = WCNSFVMomentumFluxBC
variable = vel_x
boundary = 'left'
velocity_pp = 'inlet_u'
rho = 'rho'
momentum_component = 'x'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_v]
type = WCNSFVMomentumFluxBC
variable = vel_y
boundary = 'left'
velocity_pp = 0
rho = 'rho'
momentum_component = 'y'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_T]
type = WCNSFVEnergyFluxBC
variable = T_fluid
T_fluid = T_fluid
boundary = 'left'
velocity_pp = 'inlet_u'
temperature_pp = 'inlet_T'
rho = 'rho'
cp = 'cp'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_scalar]
type = WCNSFVScalarFluxBC
variable = scalar
boundary = 'left'
scalar_value_pp = 'inlet_scalar_value'
velocity_pp = 'inlet_u'
vel_x = vel_x
vel_y = vel_y
rho = rho
passive_scalar = scalar
[]
[outlet_p]
type = INSFVOutletPressureBC
variable = pressure
boundary = 'right'
function = ${outlet_pressure}
[]
# Walls
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'top bottom'
function = 0
[]
[]
# used for the boundary conditions in this example
[Postprocessors]
[inlet_u]
type = Receiver
default = ${inlet_velocity}
[]
[area_pp_left]
type = AreaPostprocessor
boundary = 'left'
execute_on = 'INITIAL'
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
[]
[inlet_scalar_value]
type = Receiver
default = 0.2
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T_fluid
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T_fluid'
rho = ${rho}
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-2
optimal_iterations = 6
[]
end_time = 1
nl_abs_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
exodus = true
execute_on = FINAL
[]
(modules/thermal_hydraulics/tutorials/single_phase_flow/06_custom_closures.i)
T_in = 300. # K
m_dot_in = 1e-2 # kg/s
press = 10e5 # Pa
# core parameters
core_length = 1. # m
core_n_elems = 25
core_dia = '${units 2. cm -> m}'
core_pitch = '${units 8.7 cm -> m}'
A_core = '${fparse core_pitch^2 - 0.25 *pi * core_dia^2}'
P_wet_core = '${fparse 4*core_pitch + pi * core_dia}'
Dh_core = '${fparse 4 * A_core / P_wet_core}'
# pipe parameters
pipe_dia = '${units 10. cm -> m}'
A_pipe = '${fparse 0.25 * pi * pipe_dia^2}'
tot_power = 2000 # W
# heat exchanger parameters
hx_dia_inner = '${units 12. cm -> m}'
hx_wall_thickness = '${units 5. mm -> m}'
hx_dia_outer = '${units 50. cm -> m}'
hx_radius_wall = '${fparse hx_dia_inner / 2. + hx_wall_thickness}'
hx_length = 1.5 # m
hx_n_elems = 25
m_dot_sec_in = 1. # kg/s
[GlobalParams]
initial_p = ${press}
initial_vel = 0.0001
initial_T = ${T_in}
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
gravity_vector = '0 0 0'
rdg_slope_reconstruction = minmod
scaling_factor_1phase = '1 1e-2 1e-4'
scaling_factor_rhoV = 1
scaling_factor_rhouV = 1e-2
scaling_factor_rhovV = 1e-2
scaling_factor_rhowV = 1e-2
scaling_factor_rhoEV = 1e-4
closures = thm_closures
fp = he
[]
[Functions]
[m_dot_sec_fn]
type = PiecewiseLinear
xy_data = '
0 0
10 ${m_dot_sec_in}'
[]
[]
[FluidProperties]
[he]
type = IdealGasFluidProperties
molar_mass = 4e-3
gamma = 1.67
k = 0.2556
mu = 3.22639e-5
[]
[water]
type = StiffenedGasFluidProperties
gamma = 2.35
cv = 1816.0
q = -1.167e6
p_inf = 1.0e9
q_prime = 0
[]
[]
[Closures]
[thm_closures]
type = Closures1PhaseTHM
[]
[none_closures]
type = Closures1PhaseNone
[]
[]
[Materials]
[Re_mat]
type = ADReynoldsNumberMaterial
Re = Re
rho = rho
vel = vel
D_h = D_h
mu = mu
block = hx/pri
[]
[f_mat]
type = ADParsedMaterial
property_name = f_D
constant_names = 'a b c'
constant_expressions = '1 0.1 -0.5'
material_property_names = 'Re'
expression = 'a + b * Re^c'
block = hx/pri
[]
[Pr_mat]
type = ADPrandtlNumberMaterial
Pr = Pr
cp = cp
mu = mu
k = k
block = hx/pri
[]
[Nu_mat]
type = ADParsedMaterial
property_name = 'Nu'
constant_names = 'a b c'
constant_expressions = '0.03 0.9 0.5'
material_property_names = 'Re Pr'
expression = 'a * Re ^b * Pr^c'
block = hx/pri
[]
[Hw_mat]
type = ADConvectiveHeatTransferCoefficientMaterial
D_h = D_h
k = k
Nu = Nu
Hw = Hw
block = hx/pri
[]
[]
[SolidProperties]
[steel]
type = ThermalFunctionSolidProperties
rho = 8050
k = 45
cp = 466
[]
[]
[Components]
[total_power]
type = TotalPower
power = ${tot_power}
[]
[up_pipe_1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 1'
length = 0.5
n_elems = 15
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct1]
type = JunctionParallelChannels1Phase
position = '0 0 0.5'
connections = 'up_pipe_1:out core_chan:in'
volume = 1e-5
[]
[core_chan]
type = FlowChannel1Phase
position = '0 0 0.5'
orientation = '0 0 1'
length = ${core_length}
n_elems = ${core_n_elems}
roughness = .0001
A = ${A_core}
D_h = ${Dh_core}
[]
[core_hs]
type = HeatStructureCylindrical
position = '0 0 0.5'
orientation = '0 0 1'
length = ${core_length}
n_elems = ${core_n_elems}
names = 'block'
widths = '${fparse core_dia / 2.}'
solid_properties = 'steel'
solid_properties_T_ref = '300'
n_part_elems = 3
[]
[core_heating]
type = HeatSourceFromTotalPower
hs = core_hs
regions = block
power = total_power
[]
[core_ht]
type = HeatTransferFromHeatStructure1Phase
flow_channel = core_chan
hs = core_hs
hs_side = outer
P_hf = '${fparse pi * core_dia}'
[]
[jct2]
type = JunctionParallelChannels1Phase
position = '0 0 1.5'
connections = 'core_chan:out up_pipe_2:in'
volume = 1e-5
[]
[up_pipe_2]
type = FlowChannel1Phase
position = '0 0 1.5'
orientation = '0 0 1'
length = 0.5
n_elems = 10
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct3]
type = JunctionOneToOne1Phase
connections = 'up_pipe_2:out top_pipe_1:in'
[]
[top_pipe_1]
type = FlowChannel1Phase
position = '0 0 2'
orientation = '1 0 0'
length = 0.5
n_elems = 10
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[top_pipe_2]
type = FlowChannel1Phase
position = '0.5 0 2'
orientation = '1 0 0'
length = 0.5
n_elems = 10
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct4]
type = VolumeJunction1Phase
position = '0.5 0 2'
volume = 1e-5
connections = 'top_pipe_1:out top_pipe_2:in press_pipe:in'
[]
[press_pipe]
type = FlowChannel1Phase
position = '0.5 0 2'
orientation = '0 1 0'
length = 0.2
n_elems = 5
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[pressurizer]
type = InletStagnationPressureTemperature1Phase
p0 = ${press}
T0 = ${T_in}
input = press_pipe:out
[]
[jct5]
type = JunctionOneToOne1Phase
connections = 'top_pipe_2:out down_pipe_1:in'
[]
[down_pipe_1]
type = FlowChannel1Phase
position = '1 0 2'
orientation = '0 0 -1'
length = 0.25
A = ${A_pipe}
n_elems = 5
[]
[jct6]
type = JunctionParallelChannels1Phase
position = '1 0 1.75'
connections = 'down_pipe_1:out hx/pri:in'
volume = 1e-5
[]
[hx]
[pri]
type = FlowChannel1Phase
position = '1 0 1.75'
orientation = '0 0 -1'
length = ${hx_length}
n_elems = ${hx_n_elems}
roughness = 1e-5
A = '${fparse pi * hx_dia_inner * hx_dia_inner / 4.}'
D_h = ${hx_dia_inner}
closures = none_closures
[]
[ht_pri]
type = HeatTransferFromHeatStructure1Phase
hs = hx/wall
hs_side = inner
flow_channel = hx/pri
P_hf = '${fparse pi * hx_dia_inner}'
[]
[wall]
type = HeatStructureCylindrical
position = '1 0 1.75'
orientation = '0 0 -1'
length = ${hx_length}
n_elems = ${hx_n_elems}
widths = '${hx_wall_thickness}'
n_part_elems = '3'
solid_properties = 'steel'
solid_properties_T_ref = '300'
names = '0'
inner_radius = '${fparse hx_dia_inner / 2.}'
[]
[ht_sec]
type = HeatTransferFromHeatStructure1Phase
hs = hx/wall
hs_side = outer
flow_channel = hx/sec
P_hf = '${fparse 2 * pi * hx_radius_wall}'
[]
[sec]
type = FlowChannel1Phase
position = '${fparse 1 + hx_wall_thickness} 0 0.25'
orientation = '0 0 1'
length = ${hx_length}
n_elems = ${hx_n_elems}
A = '${fparse pi * (hx_dia_outer * hx_dia_outer / 4. - hx_radius_wall * hx_radius_wall)}'
D_h = '${fparse hx_dia_outer - (2 * hx_radius_wall)}'
fp = water
initial_T = 300
[]
[]
[jct7]
type = JunctionParallelChannels1Phase
position = '1 0 0.5'
connections = 'hx/pri:out down_pipe_2:in'
volume = 1e-5
[]
[down_pipe_2]
type = FlowChannel1Phase
position = '1 0 0.25'
orientation = '0 0 -1'
length = 0.25
n_elems = 10
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct8]
type = JunctionOneToOne1Phase
connections = 'down_pipe_2:out bottom_1:in'
[]
[bottom_1]
type = FlowChannel1Phase
position = '1 0 0'
orientation = '-1 0 0'
length = 0.5
n_elems = 5
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[pump]
type = Pump1Phase
position = '0.5 0 0'
connections = 'bottom_1:out bottom_2:in'
volume = 1e-4
A_ref = ${A_pipe}
head = 0
[]
[bottom_2]
type = FlowChannel1Phase
position = '0.5 0 0'
orientation = '-1 0 0'
length = 0.5
n_elems = 5
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct9]
type = JunctionOneToOne1Phase
connections = 'bottom_2:out up_pipe_1:in'
[]
[inlet_sec]
type = InletMassFlowRateTemperature1Phase
input = 'hx/sec:in'
m_dot = 0
T = 300
[]
[outlet_sec]
type = Outlet1Phase
input = 'hx/sec:out'
p = 1e5
[]
[]
[ControlLogic]
[set_point]
type = GetFunctionValueControl
function = ${m_dot_in}
[]
[pid]
type = PIDControl
initial_value = 0.0
set_point = set_point:value
input = m_dot_pump
K_p = 1.
K_i = 4.
K_d = 0
[]
[set_pump_head]
type = SetComponentRealValueControl
component = pump
parameter = head
value = pid:output
[]
[m_dot_sec_inlet_ctrl]
type = GetFunctionValueControl
function = m_dot_sec_fn
[]
[set_m_dot_sec_ctrl]
type = SetComponentRealValueControl
component = inlet_sec
parameter = m_dot
value = m_dot_sec_inlet_ctrl:value
[]
[]
[Postprocessors]
[power_to_coolant]
type = ADHeatRateConvection1Phase
block = core_chan
P_hf = '${fparse pi *core_dia}'
[]
[m_dot_pump]
type = ADFlowJunctionFlux1Phase
boundary = core_chan:in
connection_index = 1
equation = mass
junction = jct7
[]
[core_T_out]
type = SideAverageValue
boundary = core_chan:out
variable = T
[]
[core_p_in]
type = SideAverageValue
boundary = core_chan:in
variable = p
[]
[core_p_out]
type = SideAverageValue
boundary = core_chan:out
variable = p
[]
[core_delta_p]
type = ParsedPostprocessor
pp_names = 'core_p_in core_p_out'
function = 'core_p_in - core_p_out'
[]
[hx_pri_T_out]
type = SideAverageValue
boundary = hx/pri:out
variable = T
[]
[hx_sec_T_in]
type = SideAverageValue
boundary = inlet_sec
variable = T
[]
[hx_sec_T_out]
type = SideAverageValue
boundary = outlet_sec
variable = T
[]
[m_dot_sec]
type = ADFlowBoundaryFlux1Phase
boundary = inlet_sec
equation = mass
[]
[Hw_hx_pri]
type = ADElementAverageMaterialProperty
mat_prop = Hw
block = hx/pri
[]
[fD_hx_pri]
type = ADElementAverageMaterialProperty
mat_prop = f_D
block = hx/pri
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
start_time = 0
[TimeStepper]
type = IterationAdaptiveDT
dt = 1
[]
dtmax = 5
end_time = 500
line_search = basic
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
nl_max_its = 25
[]
[Outputs]
exodus = true
[console]
type = Console
max_rows = 1
outlier_variable_norms = false
[]
print_linear_residuals = false
[]
(modules/solid_mechanics/test/tests/anisotropic_elastoplasticity/ad_uniaxial_x_non_linear.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 3
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
volumetric_locking_correction = true
[]
[AuxVariables]
[hydrostatic_stress]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_xx]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_xy]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[sigma_xx]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[hydrostatic_stress]
type = ADRankTwoScalarAux
variable = hydrostatic_stress
rank_two_tensor = stress
scalar_type = Hydrostatic
[]
[plasticity_strain_xx]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_xx
index_i = 0
index_j = 0
[]
[plasticity_strain_xy]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_xy
index_i = 0
index_j = 1
[]
[plasticity_strain_yy]
type = ADRankTwoAux
rank_two_tensor = plastic_strain
variable = plastic_strain_yy
index_i = 1
index_j = 1
[]
[sigma_xx]
type = ADRankTwoAux
rank_two_tensor = stress
variable = stress_xx
index_i = 0
index_j = 0
[]
[]
[Functions]
[pull]
type = PiecewiseLinear
x = '0 1e1'
y = '0 -2e8'
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = FINITE
generate_output = 'elastic_strain_xx stress_xx strain_xx plastic_strain_xx'
use_automatic_differentiation = true
add_variables = true
[]
[]
[Materials]
[elasticity_tensor]
type = ADComputeElasticityTensor
fill_method = orthotropic
C_ijkl = '10.0e10 15.0e10 20.0e10 2.0e10 2.0e10 2.0e10 0.2 0.2 0.2 0.13333333333333333 0.1 0.15'
[]
[elastic_strain]
type = ADComputeMultipleInelasticStress
inelastic_models = "trial_plasticity"
max_iterations = 50
absolute_tolerance = 1e-16
[]
[hill_tensor]
type = ADHillConstants
# F G H L M N
hill_constants = "0.6 0.4 0.7 1.5 1.5 1.5"
[]
[trial_plasticity]
type = ADHillElastoPlasticityStressUpdate
hardening_constant = 1e9
hardening_exponent = 0.5
yield_stress = 60e6
absolute_tolerance = 1e-15 # 1e-8
relative_tolerance = 1e-13 # 1e-15
internal_solve_full_iteration_history = true
max_inelastic_increment = 2.0e-5
internal_solve_output_on = on_error
[]
[]
[BCs]
[no_disp_x]
type = ADDirichletBC
variable = disp_x
boundary = left
value = 0.0
[]
[no_disp_y]
type = ADDirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[]
[no_disp_z]
type = ADDirichletBC
variable = disp_z
boundary = back
value = 0.0
[]
[Pressure]
[Side1]
boundary = right
function = pull
[]
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_rel_tol = 1e-12
nl_abs_tol = 1.0e-14
l_max_its = 90
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 30
iteration_window = 9
growth_factor = 1.05
cutback_factor = 0.5
timestep_limiting_postprocessor = matl_ts_min
dt = 0.1
time_t = '0 2.5 10'
time_dt = '0.1 1.0e-2 1.0e-2'
[]
start_time = 0
end_time = 10.0
automatic_scaling = true
[]
[Postprocessors]
[matl_ts_min]
type = MaterialTimeStepPostprocessor
[]
[max_disp_x]
type = ElementExtremeValue
variable = disp_x
[]
[max_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
[]
[dt]
type = TimestepSize
[]
[plasticity_strain_xx]
type = ElementalVariableValue
variable = plastic_strain_xx
execute_on = 'TIMESTEP_END'
elementid = 0
[]
[elastic_strain_xx]
type = ElementalVariableValue
variable = elastic_strain_xx
execute_on = 'TIMESTEP_END'
elementid = 0
[]
[strain_xx]
type = ElementalVariableValue
variable = strain_xx
execute_on = 'TIMESTEP_END'
elementid = 0
[]
[sigma_xx]
type = ElementalVariableValue
variable = stress_xx
execute_on = 'TIMESTEP_END'
elementid = 0
[]
[]
[Outputs]
csv = true
perf_graph = true
[]
(test/tests/multiapps/loose_couple_time_adapt/adaptiveDT.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = 2
value = 1
[../]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 0.006
[./TimeStepper]
type = IterationAdaptiveDT
dt = 0.001
optimal_iterations = 6
[../]
nl_abs_tol = 1.0e-8
[]
[Outputs]
exodus = true
[]
(test/tests/userobjects/Terminator/terminator_pass.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 30
ny = 6
xmin = -15.0
xmax = 15.0
ymin = -3.0
ymax = 3.0
elem_type = QUAD4
[]
[Variables]
[c]
order = FIRST
family = LAGRANGE
initial_condition = 1
[]
[]
[Postprocessors]
[dt]
type = TimestepSize
[]
[]
[UserObjects]
[arnold]
type = Terminator
expression = 'dt > 20'
fail_mode = HARD
error_level = INFO
message = 'Arnold says this should end'
execute_on = TIMESTEP_END
[]
[]
[Kernels]
[cres]
type = Diffusion
variable = c
[]
[time]
type = TimeDerivative
variable = c
[]
[]
[BCs]
[c]
type = DirichletBC
variable = c
boundary = left
value = 0
[]
[]
[Executioner]
type = Transient
[TimeStepper]
type = IterationAdaptiveDT
dt = 4
[]
nl_abs_step_tol = 1e-10
[]
[Outputs]
csv = true
print_linear_residuals = false
[]
(modules/solid_mechanics/test/tests/2D_geometries/2D-RZ_test.i)
# Considers the mechanics solution for a thick spherical shell that is uniformly
# pressurized on the inner and outer surfaces, using 2D axisymmetric geometry.
# This test uses the strain calculators ComputeAxisymmetricRZSmallStrain
# and ComputeAxisymmetricRZIncrementalStrain which are generated by the
# SolidMechanics QuasiStatic Physics depending on the cli_args given in the tests file.
#
# From Roark (Formulas for Stress and Strain, McGraw-Hill, 1975), the radially-dependent
# circumferential stress in a uniformly pressurized thick spherical shell is given by:
#
# S(r) = [ Pi[ri^3(2r^3+ro^3)] - Po[ro^3(2r^3+ri^3)] ] / [2r^3(ro^3-ri^3)]
#
# where:
# Pi = inner pressure
# Po = outer pressure
# ri = inner radius
# ro = outer radius
#
# The tests assume an inner and outer radii of 5 and 10, with internal and external
# pressures of 100000 and 200000, respectively. The resulting compressive tangential
# stress is largest at the inner wall and, from the above equation, has a value
# of -271429.
[Mesh]
file = 2D-RZ_mesh.e
[]
[GlobalParams]
displacements = 'disp_r disp_z'
[]
[Problem]
coord_type = RZ
[]
[Physics/SolidMechanics/QuasiStatic]
[./all]
strain = SMALL
add_variables = true
generate_output = 'stress_zz'
[../]
[]
[Materials]
[./elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1e10
poissons_ratio = 0.345
[../]
[./stress]
[../]
[]
[BCs]
# pin particle along symmetry planes
[./no_disp_r]
type = DirichletBC
variable = disp_r
boundary = xzero
value = 0.0
[../]
[./no_disp_z]
type = DirichletBC
variable = disp_z
boundary = yzero
value = 0.0
[../]
# exterior and internal pressures
[./exterior_pressure_r]
type = Pressure
variable = disp_r
boundary = outer
factor = 200000
[../]
[./exterior_pressure_z]
type = Pressure
variable = disp_z
boundary = outer
factor = 200000
[../]
[./interior_pressure_r]
type = Pressure
variable = disp_r
boundary = inner
factor = 100000
[../]
[./interior_pressure_z]
type = Pressure
variable = disp_z
boundary = inner
factor = 100000
[../]
[]
[Debug]
show_var_residual_norms = true
[]
[Executioner]
type = Transient
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
petsc_options_value = ' 201 hypre boomeramg 10'
line_search = 'none'
#Preconditioned JFNK (default)
solve_type = 'PJFNK'
nl_rel_tol = 5e-9
nl_abs_tol = 1e-10
nl_max_its = 15
l_tol = 1e-3
l_max_its = 50
start_time = 0.0
end_time = 1
# num_steps = 1000
dtmax = 5e6
dtmin = 1
[./TimeStepper]
type = IterationAdaptiveDT
dt = 1
optimal_iterations = 6
iteration_window = 0
linear_iteration_ratio = 100
[../]
[./Predictor]
type = SimplePredictor
scale = 1.0
[../]
[]
[Postprocessors]
[./dt]
type = TimestepSize
[../]
[]
[Outputs]
exodus = true
[]
(test/tests/fvkernels/fv_simple_diffusion/grad-adaptive.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 100
[]
[Variables]
[v]
type = MooseVariableFVReal
initial_condition = 0
[]
[]
[AuxVariables]
[dummy]
type = MooseVariableFVReal
[]
[]
[FVKernels]
[time]
type = FVTimeKernel
variable = v
[]
[diff]
type = FVDiffusion
variable = v
coeff = coeff
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = v
boundary = left
value = 0
[]
[right]
type = FVDirichletBC
variable = v
boundary = right
value = 1
[]
[]
[Materials]
[diff]
type = ADGenericFunctorMaterial
prop_names = 'coeff'
prop_values = '1'
[]
[]
[Postprocessors]
[average]
type = ElementAverageValue
variable = v
[]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-6
optimal_iterations = 6
[]
end_time = 1000
nl_abs_tol = 1e-8
[]
[Outputs]
exodus = false
[csv]
type = CSV
execute_on = 'final'
[]
[]
[Adaptivity]
steps = 1
marker = error
[Indicators]
[jump]
type = GradientJumpIndicator
variable = v
[]
[]
[Markers]
[error]
type = ErrorFractionMarker
coarsen = 0.1
refine = 0.7
indicator = jump
[]
[]
max_h_level = 1
[]
(modules/thermal_hydraulics/tutorials/single_phase_flow/03_upper_loop.i)
T_in = 300. # K
m_dot_in = 1e-2 # kg/s
press = 10e5 # Pa
# core parameters
core_length = 1. # m
core_n_elems = 25
core_dia = '${units 2. cm -> m}'
core_pitch = '${units 8.7 cm -> m}'
A_core = '${fparse core_pitch^2 - 0.25 *pi * core_dia^2}'
P_wet_core = '${fparse 4*core_pitch + pi * core_dia}'
Dh_core = '${fparse 4 * A_core / P_wet_core}'
# pipe parameters
pipe_dia = '${units 10. cm -> m}'
A_pipe = '${fparse 0.25 * pi * pipe_dia^2}'
tot_power = 2000 # W
[GlobalParams]
initial_p = ${press}
initial_vel = 0.0001
initial_T = ${T_in}
initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0
gravity_vector = '0 0 0'
rdg_slope_reconstruction = minmod
scaling_factor_1phase = '1 1e-2 1e-4'
scaling_factor_rhoV = 1
scaling_factor_rhouV = 1e-2
scaling_factor_rhovV = 1e-2
scaling_factor_rhowV = 1e-2
scaling_factor_rhoEV = 1e-4
closures = thm_closures
fp = he
[]
[FluidProperties]
[he]
type = IdealGasFluidProperties
molar_mass = 4e-3
gamma = 1.67
k = 0.2556
mu = 3.22639e-5
[]
[]
[Closures]
[thm_closures]
type = Closures1PhaseTHM
[]
[]
[SolidProperties]
[steel]
type = ThermalFunctionSolidProperties
rho = 8050
k = 45
cp = 466
[]
[]
[Components]
[total_power]
type = TotalPower
power = ${tot_power}
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'up_pipe_1:in'
m_dot = ${m_dot_in}
T = ${T_in}
[]
[up_pipe_1]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 1'
length = 0.5
n_elems = 15
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct1]
type = JunctionParallelChannels1Phase
position = '0 0 0.5'
connections = 'up_pipe_1:out core_chan:in'
volume = 1e-5
[]
[core_chan]
type = FlowChannel1Phase
position = '0 0 0.5'
orientation = '0 0 1'
length = ${core_length}
n_elems = ${core_n_elems}
roughness = .0001
A = '${A_core}'
D_h = ${Dh_core}
[]
[core_hs]
type = HeatStructureCylindrical
position = '0 0 0.5'
orientation = '0 0 1'
length = ${core_length}
n_elems = ${core_n_elems}
names = 'block'
widths = '${fparse core_dia / 2.}'
solid_properties = 'steel'
solid_properties_T_ref = '300'
n_part_elems = 3
[]
[core_heating]
type = HeatSourceFromTotalPower
hs = core_hs
regions = block
power = total_power
[]
[core_ht]
type = HeatTransferFromHeatStructure1Phase
flow_channel = core_chan
hs = core_hs
hs_side = outer
P_hf = '${fparse pi * core_dia}'
[]
[jct2]
type = JunctionParallelChannels1Phase
position = '0 0 1.5'
connections = 'core_chan:out up_pipe_2:in'
volume = 1e-5
[]
[up_pipe_2]
type = FlowChannel1Phase
position = '0 0 1.5'
orientation = '0 0 1'
length = 0.5
n_elems = 10
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct3]
type = JunctionOneToOne1Phase
connections = 'up_pipe_2:out top_pipe:in'
[]
[top_pipe]
type = FlowChannel1Phase
position = '0 0 2'
orientation = '1 0 0'
length = 1
n_elems = 10
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[jct4]
type = JunctionOneToOne1Phase
connections = 'top_pipe:out down_pipe_1:in'
[]
[down_pipe_1]
type = FlowChannel1Phase
position = '1 0 2'
orientation = '0 0 -1'
length = 0.25
A = ${A_pipe}
n_elems = 5
[]
[jct5]
type = JunctionOneToOne1Phase
connections = 'down_pipe_1:out cooling_pipe:in'
[]
[cooling_pipe]
type = FlowChannel1Phase
position = '1 0 1.75'
orientation = '0 0 -1'
length = 1.5
n_elems = 25
A = ${A_pipe}
[]
[cold_wall]
type = HeatTransferFromSpecifiedTemperature1Phase
flow_channel = cooling_pipe
T_wall = 300
P_hf = '${fparse pi * pipe_dia}'
[]
[jct6]
type = JunctionOneToOne1Phase
connections = 'cooling_pipe:out down_pipe_2:in'
[]
[down_pipe_2]
type = FlowChannel1Phase
position = '1 0 0.25'
orientation = '0 0 -1'
length = 0.25
n_elems = 10
A = ${A_pipe}
D_h = ${pipe_dia}
[]
[outlet]
type = Outlet1Phase
input = 'down_pipe_2:out'
p = ${press}
[]
[]
[Postprocessors]
[power_to_coolant]
type = ADHeatRateConvection1Phase
block = core_chan
P_hf = '${fparse pi *core_dia}'
[]
[core_T_out]
type = SideAverageValue
boundary = core_chan:out
variable = T
[]
[core_p_in]
type = SideAverageValue
boundary = core_chan:in
variable = p
[]
[core_p_out]
type = SideAverageValue
boundary = core_chan:out
variable = p
[]
[core_delta_p]
type = ParsedPostprocessor
pp_names = 'core_p_in core_p_out'
function = 'core_p_in - core_p_out'
[]
[hx_pri_T_out]
type = SideAverageValue
boundary = cooling_pipe:out
variable = T
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
start_time = 0
[TimeStepper]
type = IterationAdaptiveDT
dt = 1
[]
end_time = 500
line_search = basic
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
nl_max_its = 25
[]
[Outputs]
exodus = true
[console]
type = Console
max_rows = 1
outlier_variable_norms = false
[]
print_linear_residuals = false
[]
(modules/porous_flow/test/tests/fluidstate/theis.i)
# Two phase Theis problem: Flow from single source using WaterNCG fluidstate.
# Constant rate injection 2 kg/s
# 1D cylindrical mesh
# Initially, system has only a liquid phase, until enough gas is injected
# to form a gas phase, in which case the system becomes two phase.
[Mesh]
type = GeneratedMesh
dim = 1
nx = 40
xmax = 200
bias_x = 1.05
coord_type = RZ
rz_coord_axis = Y
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[AuxVariables]
[saturation_gas]
order = CONSTANT
family = MONOMIAL
[]
[x1]
order = CONSTANT
family = MONOMIAL
[]
[y0]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[saturation_gas]
type = PorousFlowPropertyAux
variable = saturation_gas
property = saturation
phase = 1
execute_on = timestep_end
[]
[x1]
type = PorousFlowPropertyAux
variable = x1
property = mass_fraction
phase = 0
fluid_component = 1
execute_on = timestep_end
[]
[y0]
type = PorousFlowPropertyAux
variable = y0
property = mass_fraction
phase = 1
fluid_component = 0
execute_on = timestep_end
[]
[]
[Variables]
[pgas]
initial_condition = 20e6
[]
[zi]
initial_condition = 0
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = pgas
[]
[flux0]
type = PorousFlowAdvectiveFlux
fluid_component = 0
variable = pgas
[]
[mass1]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = zi
[]
[flux1]
type = PorousFlowAdvectiveFlux
fluid_component = 1
variable = zi
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pgas zi'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureConst
pc = 0
[]
[fs]
type = PorousFlowWaterNCG
water_fp = water
gas_fp = co2
capillary_pressure = pc
[]
[]
[FluidProperties]
[co2]
type = CO2FluidProperties
[]
[water]
type = Water97FluidProperties
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = 20
[]
[waterncg]
type = PorousFlowFluidState
gas_porepressure = pgas
z = zi
temperature_unit = Celsius
capillary_pressure = pc
fluid_state = fs
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.2
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-12 0 0 0 1e-12 0 0 0 1e-12'
[]
[relperm_water]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
s_res = 0.1
sum_s_res = 0.1
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 1
[]
[]
[BCs]
[rightwater]
type = DirichletBC
boundary = right
value = 20e6
variable = pgas
[]
[]
[DiracKernels]
[source]
type = PorousFlowSquarePulsePointSource
point = '0 0 0'
mass_flux = 2
variable = zi
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options = '-snes_converged_reason -ksp_diagonal_scale -ksp_diagonal_scale_fix -ksp_gmres_modifiedgramschmidt -snes_linesearch_monitor'
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap -snes_atol -snes_rtol -snes_max_it'
petsc_options_value = 'gmres asm lu NONZERO 2 1E-8 1E-10 20'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 2e2
[TimeStepper]
type = IterationAdaptiveDT
dt = 10
growth_factor = 2
[]
[]
[VectorPostprocessors]
[line]
type = NodalValueSampler
sort_by = x
variable = 'pgas zi'
execute_on = 'timestep_end'
[]
[]
[Postprocessors]
[pgas]
type = PointValue
point = '1 0 0'
variable = pgas
[]
[sgas]
type = PointValue
point = '1 0 0'
variable = saturation_gas
[]
[zi]
type = PointValue
point = '1 0 0'
variable = zi
[]
[massgas]
type = PorousFlowFluidMass
fluid_component = 1
[]
[x1]
type = PointValue
point = '1 0 0'
variable = x1
[]
[y0]
type = PointValue
point = '1 0 0'
variable = y0
[]
[]
[Outputs]
print_linear_residuals = false
perf_graph = true
[csvout]
type = CSV
execute_on = timestep_end
execute_vector_postprocessors_on = final
[]
[]
(modules/porous_flow/test/tests/fluidstate/water_vapor_phasechange.i)
# Tests correct calculation of properties in PorousFlowWaterVapor as a phase change
# from liquid to a two-phase model occurs due to a pressure drop.
# A single 10 m^3 element is used, with constant mass and heat production using
# a Dirac kernel. Initial conditions correspond to just outside the two-phase region in
# the liquid state.
#
# An identical problem can be run using TOUGH2, with the following outputs after 1,000s
# Pressure: 8.58 Mpa
# Temperature: 299.92 K
# Vapor saturation: 0.00637
[Mesh]
type = GeneratedMesh
dim = 3
xmax = 10
ymax = 10
zmax = 10
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Variables]
[pliq]
initial_condition = 9e6
[]
[h]
scaling = 1e-3
[]
[]
[ICs]
[hic]
type = PorousFlowFluidPropertyIC
variable = h
porepressure = pliq
property = enthalpy
temperature = 300
temperature_unit = Celsius
fp = water
[]
[]
[DiracKernels]
[mass]
type = ConstantPointSource
point = '5 5 5'
variable = pliq
value = -1
[]
[heat]
type = ConstantPointSource
point = '5 5 5'
variable = h
value = -1.344269e6
[]
[]
[AuxVariables]
[pressure_gas]
order = CONSTANT
family = MONOMIAL
[]
[pressure_water]
order = CONSTANT
family = MONOMIAL
[]
[enthalpy_gas]
order = CONSTANT
family = MONOMIAL
[]
[enthalpy_water]
order = CONSTANT
family = MONOMIAL
[]
[saturation_gas]
order = CONSTANT
family = MONOMIAL
[]
[saturation_water]
order = CONSTANT
family = MONOMIAL
[]
[density_water]
order = CONSTANT
family = MONOMIAL
[]
[density_gas]
order = CONSTANT
family = MONOMIAL
[]
[viscosity_water]
order = CONSTANT
family = MONOMIAL
[]
[viscosity_gas]
order = CONSTANT
family = MONOMIAL
[]
[temperature]
order = CONSTANT
family = MONOMIAL
[]
[e_gas]
order = CONSTANT
family = MONOMIAL
[]
[e_water]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[enthalpy_water]
type = PorousFlowPropertyAux
variable = enthalpy_water
property = enthalpy
phase = 0
execute_on = 'initial timestep_end'
[]
[enthalpy_gas]
type = PorousFlowPropertyAux
variable = enthalpy_gas
property = enthalpy
phase = 1
execute_on = 'initial timestep_end'
[]
[pressure_water]
type = PorousFlowPropertyAux
variable = pressure_water
property = pressure
phase = 0
execute_on = 'initial timestep_end'
[]
[pressure_gas]
type = PorousFlowPropertyAux
variable = pressure_gas
property = pressure
phase = 1
execute_on = 'initial timestep_end'
[]
[saturation_water]
type = PorousFlowPropertyAux
variable = saturation_water
property = saturation
phase = 0
execute_on = 'initial timestep_end'
[]
[saturation_gas]
type = PorousFlowPropertyAux
variable = saturation_gas
property = saturation
phase = 1
execute_on = 'initial timestep_end'
[]
[density_water]
type = PorousFlowPropertyAux
variable = density_water
property = density
phase = 0
execute_on = 'initial timestep_end'
[]
[density_gas]
type = PorousFlowPropertyAux
variable = density_gas
property = density
phase = 1
execute_on = 'initial timestep_end'
[]
[viscosity_water]
type = PorousFlowPropertyAux
variable = viscosity_water
property = viscosity
phase = 0
execute_on = 'initial timestep_end'
[]
[viscosity_gas]
type = PorousFlowPropertyAux
variable = viscosity_gas
property = viscosity
phase = 1
execute_on = 'initial timestep_end'
[]
[temperature]
type = PorousFlowPropertyAux
variable = temperature
property = temperature
execute_on = 'initial timestep_end'
[]
[e_water]
type = PorousFlowPropertyAux
variable = e_water
property = internal_energy
phase = 0
execute_on = 'initial timestep_end'
[]
[egas]
type = PorousFlowPropertyAux
variable = e_gas
property = internal_energy
phase = 1
execute_on = 'initial timestep_end'
[]
[]
[Kernels]
[mass]
type = PorousFlowMassTimeDerivative
variable = pliq
[]
[heat]
type = PorousFlowEnergyTimeDerivative
variable = h
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pliq h'
number_fluid_phases = 2
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureBC
pe = 1e5
lambda = 2
pc_max = 1e6
[]
[fs]
type = PorousFlowWaterVapor
water_fp = water
capillary_pressure = pc
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[Materials]
[watervapor]
type = PorousFlowFluidStateSingleComponent
porepressure = pliq
enthalpy = h
temperature_unit = Celsius
capillary_pressure = pc
fluid_state = fs
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-14 0 0 0 1e-14 0 0 0 1e-14'
[]
[relperm0]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
[]
[relperm1]
type = PorousFlowRelativePermeabilityCorey
n = 3
phase = 1
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.2
[]
[internal_energy]
type = PorousFlowMatrixInternalEnergy
density = 2650
specific_heat_capacity = 1000
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 1e3
nl_abs_tol = 1e-12
[TimeStepper]
type = IterationAdaptiveDT
dt = 10
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Postprocessors]
[density_water]
type = ElementAverageValue
variable = density_water
execute_on = 'initial timestep_end'
[]
[density_gas]
type = ElementAverageValue
variable = density_gas
execute_on = 'initial timestep_end'
[]
[viscosity_water]
type = ElementAverageValue
variable = viscosity_water
execute_on = 'initial timestep_end'
[]
[viscosity_gas]
type = ElementAverageValue
variable = viscosity_gas
execute_on = 'initial timestep_end'
[]
[enthalpy_water]
type = ElementAverageValue
variable = enthalpy_water
execute_on = 'initial timestep_end'
[]
[enthalpy_gas]
type = ElementAverageValue
variable = enthalpy_gas
execute_on = 'initial timestep_end'
[]
[sg]
type = ElementAverageValue
variable = saturation_gas
execute_on = 'initial timestep_end'
[]
[sw]
type = ElementAverageValue
variable = saturation_water
execute_on = 'initial timestep_end'
[]
[pwater]
type = ElementAverageValue
variable = pressure_water
execute_on = 'initial timestep_end'
[]
[pgas]
type = ElementAverageValue
variable = pressure_gas
execute_on = 'initial timestep_end'
[]
[temperature]
type = ElementAverageValue
variable = temperature
execute_on = 'initial timestep_end'
[]
[enthalpy]
type = ElementAverageValue
variable = h
execute_on = 'initial timestep_end'
[]
[pliq]
type = ElementAverageValue
variable = pliq
execute_on = 'initial timestep_end'
[]
[liquid_mass]
type = PorousFlowFluidMass
phase = 0
execute_on = 'initial timestep_end'
[]
[vapor_mass]
type = PorousFlowFluidMass
phase = 1
execute_on = 'initial timestep_end'
[]
[liquid_heat]
type = PorousFlowHeatEnergy
phase = 0
execute_on = 'initial timestep_end'
[]
[vapor_heat]
type = PorousFlowHeatEnergy
phase = 1
execute_on = 'initial timestep_end'
[]
[e_water]
type = ElementAverageValue
variable = e_water
execute_on = 'initial timestep_end'
[]
[e_gas]
type = ElementAverageValue
variable = e_gas
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
csv = true
perf_graph = false
[]
(modules/solid_mechanics/test/tests/anisotropic_plasticity/ad_aniso_plasticity_x.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 3
nx = 10
ny = 2
nz = 2
xmin = 0.0
ymin = 0.0
zmin = 0.0
xmax = 10.0
ymax = 1.0
zmax = 1.0
[]
[corner_node]
type = ExtraNodesetGenerator
new_boundary = '100'
nodes = '3 69'
input = gen
[]
[corner_node_2]
type = ExtraNodesetGenerator
new_boundary = '101'
nodes = '4 47'
input = corner_node
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
volumetric_locking_correction = true
[]
[AuxVariables]
[hydrostatic_stress]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_xx]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_xy]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain_zz]
order = CONSTANT
family = MONOMIAL
[]
[stress_yy]
order = CONSTANT
family = MONOMIAL
[]
[elastic_strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[hydrostatic_stress]
type = ADRankTwoScalarAux
variable = hydrostatic_stress
rank_two_tensor = stress
scalar_type = Hydrostatic
[]
[plasticity_strain_xx]
type = ADRankTwoAux
rank_two_tensor = trial_plasticity_plastic_strain
variable = plastic_strain_xx
index_i = 0
index_j = 0
[]
[plasticity_strain_xy]
type = ADRankTwoAux
rank_two_tensor = trial_plasticity_plastic_strain
variable = plastic_strain_xy
index_i = 0
index_j = 1
[]
[plasticity_strain_yy]
type = ADRankTwoAux
rank_two_tensor = trial_plasticity_plastic_strain
variable = plastic_strain_yy
index_i = 1
index_j = 1
[]
[plasticity_strain_zz]
type = ADRankTwoAux
rank_two_tensor = trial_plasticity_plastic_strain
variable = plastic_strain_zz
index_i = 2
index_j = 2
[]
[sigma_xx]
type = ADRankTwoAux
rank_two_tensor = stress
variable = stress_xx
index_i = 1
index_j = 1
[]
[elastic_strain_yy]
type = ADRankTwoAux
rank_two_tensor = elastic_strain
variable = elastic_strain_yy
index_i = 1
index_j = 1
[]
[sigma_yy]
type = ADRankTwoAux
rank_two_tensor = stress
variable = stress_yy
index_i = 1
index_j = 1
[]
[]
[Functions]
[pull]
type = PiecewiseLinear
x = '0 1e1 1e8'
y = '0 -4e2 -4e2'
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = FINITE
generate_output = 'elastic_strain_xx stress_xx'
use_automatic_differentiation = true
add_variables = true
[]
[]
[Materials]
[elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 70000
poissons_ratio = 0.25
[]
[elastic_strain]
type = ADComputeMultipleInelasticStress
inelastic_models = "trial_plasticity"
max_iterations = 50
absolute_tolerance = 1e-16
[]
[hill_tensor]
type = ADHillConstants
# F G H L M N
hill_constants = "0.5829856 0.364424 0.6342174 2.0691375 2.3492325 1.814589"
base_name = trial_plasticity
[]
[trial_plasticity]
type = ADHillPlasticityStressUpdate
hardening_constant = 2000.0
yield_stress = 0.001 # was 200 for verification
absolute_tolerance = 1e-14
relative_tolerance = 1e-12
base_name = trial_plasticity
internal_solve_full_iteration_history = true
max_inelastic_increment = 2.0e-6
internal_solve_output_on = on_error
[]
[]
[BCs]
[no_disp_x]
type = ADDirichletBC
variable = disp_x
boundary = left
value = 0.0
[]
[no_disp_y]
type = ADDirichletBC
variable = disp_y
boundary = 100
value = 0.0
[]
[no_disp_z]
type = ADDirichletBC
variable = disp_z
boundary = 101
value = 0.0
[]
[Pressure]
[Side1]
boundary = right
function = pull
[]
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_rel_tol = 1e-11
nl_abs_tol = 1.0e-14
l_max_its = 90
num_steps = 25
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 30
iteration_window = 9
growth_factor = 1.05
cutback_factor = 0.5
timestep_limiting_postprocessor = matl_ts_min
dt = 1.0e-5
time_t = '0 3.4e-5 10'
time_dt = '1.0e-5 1.0e-7 1.0e-7'
[]
start_time = 0
automatic_scaling = true
[]
[Postprocessors]
[matl_ts_min]
type = MaterialTimeStepPostprocessor
[]
[max_disp_x]
type = ElementExtremeValue
variable = disp_x
[]
[max_disp_y]
type = ElementExtremeValue
variable = disp_y
[]
[max_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
[]
[dt]
type = TimestepSize
[]
[num_lin]
type = NumLinearIterations
outputs = console
[]
[num_nonlin]
type = NumNonlinearIterations
outputs = console
[]
[plasticity_strain_yy]
type = ElementalVariableValue
variable = plastic_strain_yy
execute_on = 'TIMESTEP_END'
elementid = 39
[]
[elastic_strain_yy]
type = ElementalVariableValue
variable = elastic_strain_yy
execute_on = 'TIMESTEP_END'
elementid = 39
[]
[sigma_yy]
type = ElementalVariableValue
variable = stress_yy
execute_on = 'TIMESTEP_END'
elementid = 39
[]
[plasticity_strain_xx]
type = ElementalVariableValue
variable = plastic_strain_xx
execute_on = 'TIMESTEP_END'
elementid = 39
[]
[elastic_strain_xx]
type = ElementalVariableValue
variable = elastic_strain_xx
execute_on = 'TIMESTEP_END'
elementid = 39
[]
[sigma_xx]
type = ElementalVariableValue
variable = stress_xx
execute_on = 'TIMESTEP_END'
elementid = 39
[]
[plasticity_strain_zz]
type = ElementalVariableValue
variable = plastic_strain_zz
execute_on = 'TIMESTEP_END'
elementid = 39
[]
[]
[Outputs]
csv = true
perf_graph = true
[]