- variableThe name of the variable that this side indicator applies to
C++ Type:VariableName
Controllable:No
Description:The name of the variable that this side indicator applies to
GradientJumpIndicator
Compute the jump of the solution gradient across element boundaries.
Description
The GradientJumpIndicator object computes the error as computed by the change in the gradient of a variable across element interfaces.
Example Input File Syntax
The following code snippet demonstrates the use of the GradientJumpIndicator object within a typical input file.
[Adaptivity]
[Indicators]
[error]
type = GradientJumpIndicator
variable = u
[]
[]
[]
(test/tests/indicators/gradient_jump_indicator/gradient_jump_indicator_test.i)Input Parameters
- blockThe list of blocks (ids or names) that this object will be applied
C++ Type:std::vector<SubdomainName>
Controllable:No
Description:The list of blocks (ids or names) that this object will be applied
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
- scale_by_flux_facesFalseWhether or not to scale the error values by the number of flux faces. This attempts to not penalize elements on boundaries for having less neighbors.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not to scale the error values by the number of flux faces. This attempts to not penalize elements on boundaries for having less neighbors.
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Default:False
C++ Type:bool
Controllable:No
Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
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.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:No
Description:Set the enabled status of the MooseObject.
- outputsVector of output names where you would like to restrict the output of variables(s) associated with this object
C++ Type:std::vector<OutputName>
Controllable:No
Description:Vector of output names where you would like to restrict the output of variables(s) associated with this object
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Advanced Parameters
Input Files
- (modules/phase_field/examples/anisotropic_interfaces/GrandPotentialPlanarGrowth.i)
- (test/tests/executioners/adapt_and_modify/adapt_and_modify.i)
- (modules/phase_field/test/tests/initial_conditions/polycrystal_BndsCalcIC.i)
- (test/tests/executioners/adapt_and_modify/adapt_and_modify_heavy.i)
- (modules/navier_stokes/examples/laser-welding/3d.i)
- (modules/ray_tracing/test/tests/userobjects/cone_ray_study/cone_ray_study_3d.i)
- (modules/ray_tracing/test/tests/traceray/adaptivity/adaptivity_3d.i)
- (test/tests/auxkernels/solution_aux/aux_nonlinear_solution_adapt_xda.i)
- (test/tests/outputs/system_info/system_info_mesh.i)
- (modules/ray_tracing/test/tests/traceray/adaptivity/adaptivity_2d.i)
- (modules/ray_tracing/test/tests/traceray/adaptivity/adaptivity_1d.i)
- (test/tests/functions/image_function/threshold_adapt_parallel.i)
- (test/tests/userobjects/element_subdomain_modifier/adaptivity_moving_boundary.i)
- (test/tests/meshgenerators/distributed_rectilinear/dmg_displaced_mesh/pbc_adaptivity.i)
- (test/tests/outputs/oversample/ex02_adapt.i)
- (test/tests/vectorpostprocessors/dynamic_point_sampler/dynamic_point_sampler.i)
- (test/tests/functions/image_function/image.i)
- (modules/navier_stokes/examples/laser-welding/2d.i)
- (tutorials/darcy_thermo_mech/step10_multiapps/problems/step10_micro.i)
- (modules/phase_field/test/tests/grain_tracker_test/grain_tracker_test_elemental.i)
- (examples/ex05_amr/ex05.i)
- (test/tests/indicators/gradient_jump_indicator/gradient_jump_indicator_test.i)
- (modules/ray_tracing/test/tests/userobjects/cone_ray_study/cone_ray_study.i)
- (modules/porous_flow/test/tests/pressure_pulse/pressure_pulse_1d_adaptivity.i)
- (modules/porous_flow/test/tests/recover/theis.i)
- (modules/porous_flow/examples/lava_lamp/1phase_convection.i)
- (modules/phase_field/examples/nucleation/refine.i)
- (test/tests/misc/selective_reinit/selective_reinit_test.i)
- (tutorials/darcy_thermo_mech/step07_adaptivity/problems/step7d_adapt_blocks.i)
- (test/tests/fvkernels/fv_simple_diffusion/grad-adaptive.i)
- (modules/solid_mechanics/examples/piston/piston_params.i)
- (test/tests/meshgenerators/distributed_rectilinear/dmg_displaced_mesh/adaptivity.i)
- (modules/phase_field/examples/anisotropic_interfaces/GrandPotentialTwophaseAnisotropy.i)
- (test/tests/outputs/debug/show_execution_adaptivity.i)
- (modules/ray_tracing/test/tests/raykernels/line_source_ray_kernel/simple_diffusion_line_source.i)
- (modules/phase_field/test/tests/GBType/GB_Type_Phase1.i)
- (test/tests/outputs/system_info/system_info.i)
- (tutorials/darcy_thermo_mech/step10_multiapps/tests/auxkernels/corrosion/corrosion.i)
- (modules/functional_expansion_tools/examples/3D_volumetric_cylindrical_subapp_mesh_refine/sub.i)
- (test/tests/meshgenerators/distributed_rectilinear/generator/distributed_rectilinear_mesh_generator_adaptivity.i)
- (test/tests/indicators/gradient_jump_indicator/gradient_jump_indicator_fv_test.i)
- (test/tests/adaptivity/cycles_per_step/cycles_per_step.i)
- (test/tests/adaptivity/scalar/scalar_adaptivity.i)
- (test/tests/dgkernels/adaptivity/adaptivity.i)
- (test/tests/adaptivity/cycles_per_step/test.i)
- (modules/phase_field/examples/anisotropic_interfaces/GrandPotentialSolidification.i)
- (modules/level_set/test/tests/transfers/markers/multi_level/parent.i)
- (modules/porous_flow/examples/lava_lamp/2phase_convection.i)
- (test/tests/outputs/output_interface/marker.i)
- (test/tests/auxkernels/solution_aux/aux_nonlinear_solution_adapt.i)
- (test/tests/functions/image_function/threshold_adapt.i)
- (modules/phase_field/examples/grain_growth/grain_growth_2D_voronoi_newadapt.i)
- (test/tests/outputs/output_interface/indicator.i)
- (test/tests/userobjects/element_subdomain_modifier/adaptivity_moving_boundary_3d.i)
- (test/tests/userobjects/element_subdomain_modifier/amr_bc.i)
- (tutorials/darcy_thermo_mech/step07_adaptivity/problems/step7c_adapt.i)
(test/tests/indicators/gradient_jump_indicator/gradient_jump_indicator_test.i)
###########################################################
# This is a test of the Mesh Indicator System. It computes
# a user-defined "error" for each element in the Mesh.
#
# This test has been verified to give the same error
# calculation as the libMesh kelly_error_estimator. If
# this test is diffing... the diff is wrong!
#
# @Requirement F2.40
###########################################################
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
nz = 10
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Functions]
[./solution]
type = ParsedFunction
expression = (exp(x)-1)/(exp(1)-1)
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./conv]
type = Convection
variable = u
velocity = '1 0 0'
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
# Mesh Indicator System
[Adaptivity]
[Indicators]
[error]
type = GradientJumpIndicator
variable = u
[]
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
exodus = true
[]
(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
[]
(test/tests/executioners/adapt_and_modify/adapt_and_modify.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 15
ny = 15
[]
[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
[../]
[]
[UserObjects]
[./rh_uo]
type = RandomHitUserObject
execute_on = 'initial timestep_begin'
num_hits = 1
[../]
[./rhsm]
type = RandomHitSolutionModifier
execute_on = 'custom'
modify = u
random_hits = rh_uo
amount = 1000
[../]
[]
[Executioner]
type = AdaptAndModify
num_steps = 4
dt = 1e-3
solve_type = 'PJFNK'
nl_rel_tol = 1e-15
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
adapt_cycles = 2
[]
[Adaptivity]
marker = rhm # Switch to combo to get the effect of both
[./Indicators]
[./gji]
type = GradientJumpIndicator
variable = u
[../]
[../]
[./Markers]
[./rhm]
type = RandomHitMarker
random_hits = rh_uo
[../]
[./efm]
type = ErrorFractionMarker
coarsen = 0.001
indicator = gji
refine = 0.8
[../]
[./combo]
type = ComboMarker
markers = 'efm rhm'
[../]
[../]
[]
[Outputs]
exodus = true
[]
(modules/phase_field/test/tests/initial_conditions/polycrystal_BndsCalcIC.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 20
nz = 0
xmin = 0
xmax = 100
ymin = 0
ymax = 100
zmin = 0
zmax = 0
elem_type = QUAD4
[]
[GlobalParams]
op_num = 3
var_name_base = gr
int_width = 5 # int_width > 0 is required for initial adaptivity to work based on Bnds
[]
[Variables]
[./PolycrystalVariables]
[../]
[]
[UserObjects]
[./voronoi]
type = PolycrystalVoronoi
rand_seed = 105
grain_num = 3
[../]
[]
[ICs]
[./PolycrystalICs]
[./PolycrystalColoringIC]
polycrystal_ic_uo = voronoi
[../]
[../]
[./bnds]
type = BndsCalcIC # IC is created for activating the initial adaptivity
variable = bnds
[../]
[]
[AuxVariables]
[./bnds]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./PolycrystalKernel]
[../]
[]
[AuxKernels]
[./BndsCalc]
type = BndsCalcAux
variable = bnds
execute_on = timestep_end
[../]
[]
[BCs]
[./Periodic]
[./All]
auto_direction = 'x y'
[../]
[../]
[]
[Materials]
[./Copper]
type = GBEvolution
T = 500 # K
wGB = 6 # 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
[../]
[]
[Postprocessors]
[./ngrains]
type = FeatureFloodCount
variable = bnds
threshold = 0.7
[../]
[]
[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-4
l_max_its = 30
nl_max_its = 20
nl_rel_tol = 1.0e-9
start_time = 0.0
num_steps = 2
dt = 1.0
[]
[Adaptivity]
initial_steps = 1
max_h_level = 1
marker = err_bnds
[./Markers]
[./err_bnds]
type = ErrorFractionMarker
coarsen = 0.3
refine = 0.9
indicator = ind_bnds
[../]
[../]
[./Indicators]
[./ind_bnds]
type = GradientJumpIndicator
variable = bnds
[../]
[../]
[]
[Outputs]
exodus = true
perf_graph = true
[]
(test/tests/executioners/adapt_and_modify/adapt_and_modify_heavy.i)
[Mesh]
# This example uses Adaptivity Indicators, which are written out as
# CONSTANT MONOMIAL variables, which don't currently work correctly
# 2122 for more information.
type = GeneratedMesh
dim = 2
nx = 15
ny = 15
# parallel_type = replicated
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./elem]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./td]
type = TimeDerivative
variable = u
[../]
[]
[AuxKernels]
[./elem]
type = UniqueIDAux
variable = elem
execute_on = timestep_begin
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[UserObjects]
[./rh_uo]
type = RandomHitUserObject
execute_on = timestep_begin
num_hits = 1
[../]
[./rhsm]
type = RandomHitSolutionModifier
execute_on = custom
modify = u
random_hits = rh_uo
amount = 10
[../]
[]
[Executioner]
type = AdaptAndModify
num_steps = 400
dt = 2e-4
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
adapt_cycles = 2
[]
[Adaptivity]
marker = rhm # Switch to combo to get the effect of both
[./Indicators]
[./gji]
type = GradientJumpIndicator
variable = u
[../]
[../]
[./Markers]
[./rhm]
type = RandomHitMarker
random_hits = rh_uo
[../]
[./efm]
type = ErrorFractionMarker
coarsen = 0.2
indicator = gji
refine = 0.8
[../]
[./combo]
type = ComboMarker
markers = 'efm rhm'
[../]
[../]
[]
[Outputs]
exodus = 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/ray_tracing/test/tests/userobjects/cone_ray_study/cone_ray_study_3d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 5
ny = 5
nz = 2
xmax = 5
ymax = 5
zmax = 2
[]
[]
[Variables/u]
[]
[Kernels]
[reaction]
type = Reaction
variable = u
[]
[diffusion]
type = Diffusion
variable = u
[]
[]
[UserObjects/study]
type = ConeRayStudy
start_points = '2.5 2.5 0'
directions = '0 0 1'
half_cone_angles = 10
# Must be set with RayKernels that
# contribute to the residual
execute_on = PRE_KERNELS
# For outputting Rays
always_cache_traces = true
ray_data_name = weight
[]
[RayKernels/null]
type = NullRayKernel
[]
# Rays only hit the front surface
[RayBCs/kill]
type = KillRayBC
boundary = 'front'
[]
[RayKernels/line_source]
type = LineSourceRayKernel
variable = u
# Scale by the weights in the ConeRayStudy
ray_data_factor_names = weight
[]
[Executioner]
type = Steady
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[rays]
type = RayTracingExodus
study = study
execute_on = FINAL
[]
[]
[Adaptivity]
steps = 0 # 6 for pretty pictures
marker = marker
initial_marker = marker
max_h_level = 6
[Indicators/indicator]
type = GradientJumpIndicator
variable = u
[]
[Markers/marker]
type = ErrorFractionMarker
indicator = indicator
coarsen = 0.25
refine = 0.5
[]
[]
(modules/ray_tracing/test/tests/traceray/adaptivity/adaptivity_3d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 2
ny = 2
nz = 2
[]
[]
[Variables/u]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[time]
type = TimeDerivative
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Transient
num_steps = 3
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Adaptivity]
steps = 1
marker = marker
initial_marker = marker
max_h_level = 2
[Indicators/indicator]
type = GradientJumpIndicator
variable = u
[]
[Markers/marker]
type = ErrorFractionMarker
indicator = indicator
coarsen = 0.1
refine = 0.1
[]
[]
[UserObjects/study]
type = LotsOfRaysRayStudy
ray_kernel_coverage_check = false
vertex_to_vertex = true
centroid_to_vertex = true
centroid_to_centroid = true
execute_on = timestep_end
[]
[RayBCs/kill]
type = KillRayBC
boundary = 'top right bottom left front back'
[]
[Postprocessors]
[total_distance]
type = RayTracingStudyResult
study = study
result = total_distance
execute_on = timestep_end
[]
[total_rays]
type = RayTracingStudyResult
study = study
result = total_rays_started
execute_on = timestep_end
[]
[]
[Outputs]
exodus = false
csv = true
[]
(test/tests/auxkernels/solution_aux/aux_nonlinear_solution_adapt_xda.i)
[Mesh]
# This test uses SolutionUserObject which doesn't work with DistributedMesh.
type = FileMesh
file = aux_nonlinear_solution_adapt_out_0004_mesh.xda
parallel_type = replicated
[]
[Adaptivity]
marker = error_frac
steps = 2
[./Indicators]
[./jump_indicator]
type = GradientJumpIndicator
variable = u
[../]
[../]
[./Markers]
[./error_frac]
type = ErrorFractionMarker
indicator = jump_indicator
refine = 0.7
[../]
[../]
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./u_aux]
[../]
[]
[Functions]
[./u_xda_func]
type = SolutionFunction
solution = xda_u
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./aux_xda_kernel]
type = SolutionAux
variable = u_aux
solution = xda_u_aux
execute_on = initial
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = 1
value = 1
[../]
[./right]
type = DirichletBC
variable = u
boundary = 2
value = 2
[../]
[]
[UserObjects]
[./xda_u_aux]
type = SolutionUserObject
system = aux0
mesh = aux_nonlinear_solution_adapt_out_0004_mesh.xda
es = aux_nonlinear_solution_adapt_out_0004.xda
system_variables = u_aux
execute_on = initial
[../]
[./xda_u]
type = SolutionUserObject
system = nl0
mesh = aux_nonlinear_solution_adapt_out_0004_mesh.xda
es = aux_nonlinear_solution_adapt_out_0004.xda
system_variables = u
execute_on = initial
[../]
[]
[Executioner]
type = Steady
solve_type = PJFNK
nl_rel_tol = 1e-10
[]
[Outputs]
exodus = true
[]
[ICs]
[./u_func_ic]
function = u_xda_func
variable = u
type = FunctionIC
[../]
[]
(test/tests/outputs/system_info/system_info_mesh.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Adaptivity]
marker = marker
max_h_level = 2
[./Indicators]
[./indicator]
type = GradientJumpIndicator
variable = u
[../]
[../]
[./Markers]
[./marker]
type = ErrorFractionMarker
coarsen = 0.1
indicator = indicator
refine = 0.7
[../]
[../]
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./aux_u]
[../]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
[./time]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 3
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
print_mesh_changed_info = true
[]
(modules/ray_tracing/test/tests/traceray/adaptivity/adaptivity_2d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
[]
[]
[Variables/u]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[time]
type = TimeDerivative
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Transient
num_steps = 3
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Adaptivity]
steps = 1
marker = marker
initial_marker = marker
max_h_level = 2
[Indicators/indicator]
type = GradientJumpIndicator
variable = u
[]
[Markers/marker]
type = ErrorFractionMarker
indicator = indicator
coarsen = 0.1
refine = 0.1
[]
[]
[UserObjects/study]
type = LotsOfRaysRayStudy
ray_kernel_coverage_check = false
vertex_to_vertex = true
centroid_to_vertex = true
centroid_to_centroid = true
execute_on = timestep_end
[]
[RayBCs/kill]
type = KillRayBC
boundary = 'top right bottom left'
[]
[Postprocessors]
[total_distance]
type = RayTracingStudyResult
study = study
result = total_distance
execute_on = timestep_end
[]
[total_rays]
type = RayTracingStudyResult
study = study
result = total_rays_started
execute_on = timestep_end
[]
[]
[Outputs]
exodus = false
csv = true
[]
(modules/ray_tracing/test/tests/traceray/adaptivity/adaptivity_1d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 2
[]
[]
[Variables/u]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[time]
type = TimeDerivative
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Transient
num_steps = 3
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Adaptivity]
steps = 1
marker = marker
initial_marker = marker
max_h_level = 2
[Indicators/indicator]
type = GradientJumpIndicator
variable = u
[]
[Markers/marker]
type = ErrorFractionMarker
indicator = indicator
coarsen = 0.1
refine = 0.1
[]
[]
[UserObjects/study]
type = LotsOfRaysRayStudy
ray_kernel_coverage_check = false
vertex_to_vertex = true
centroid_to_vertex = true
centroid_to_centroid = true
execute_on = timestep_end
[]
[RayBCs/kill]
type = KillRayBC
boundary = 'left right'
[]
[Postprocessors]
[total_distance]
type = RayTracingStudyResult
study = study
result = total_distance
execute_on = timestep_end
[]
[total_rays]
type = RayTracingStudyResult
study = study
result = total_rays_started
execute_on = timestep_end
[]
[]
[Outputs]
exodus = false
csv = true
[]
(test/tests/functions/image_function/threshold_adapt_parallel.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
parallel_type = distributed
[]
[Variables]
[u]
[]
[]
[Functions]
[image_func]
type = ImageFunction
file_base = stack/test
file_suffix = png
file_range = '0' # file_range is a vector input, a single entry means "read only 1 file"
threshold = 2.7e4
upper_value = 1
lower_value = -1
[]
[]
[ICs]
[u_ic]
type = FunctionIC
function = image_func
variable = u
[]
[]
[Problem]
type = FEProblem
solve = false
[]
[Executioner]
type = Transient
num_steps = 1
dt = 0.1
[]
[Adaptivity]
max_h_level = 5
initial_steps = 5
initial_marker = marker
[Indicators]
[indicator]
type = GradientJumpIndicator
variable = u
[]
[]
[Markers]
[marker]
type = ErrorFractionMarker
indicator = indicator
refine = 0.9
[]
[]
[]
(test/tests/userobjects/element_subdomain_modifier/adaptivity_moving_boundary.i)
[Problem]
solve = false
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 16
ny = 16
[]
[left]
type = SubdomainBoundingBoxGenerator
input = 'gen'
block_id = 1
bottom_left = '-1 -1 0'
top_right = '0 1 1'
[]
[right]
type = SubdomainBoundingBoxGenerator
input = 'left'
block_id = 2
bottom_left = '0 -1 0'
top_right = '1 1 1'
[]
[moving_boundary]
type = SideSetsAroundSubdomainGenerator
input = 'right'
block = 1
new_boundary = 'moving_boundary'
normal = '1 0 0'
[]
[]
[UserObjects]
[moving_circle]
type = CoupledVarThresholdElementSubdomainModifier
coupled_var = 'phi'
block = 2
criterion_type = ABOVE
threshold = 0.5
subdomain_id = 1
moving_boundary_name = moving_boundary
execute_on = 'TIMESTEP_BEGIN'
[]
[]
[Functions]
[moving_gauss]
type = ParsedFunction
value = 'exp(-((x+0.5-t)^2+(y)^2)/0.25)'
[]
[]
[AuxVariables]
[phi]
[]
[]
[AuxKernels]
[phi]
type = FunctionAux
variable = phi
function = moving_gauss
execute_on = 'INITIAL TIMESTEP_BEGIN TIMESTEP_END'
[]
[]
[Adaptivity]
steps = 1
marker = marker
initial_marker = marker
max_h_level = 1
[Indicators/indicator]
type = GradientJumpIndicator
variable = phi
[]
[Markers]
[efm]
type = ErrorFractionMarker
indicator = indicator
coarsen = 0.2
refine = 0.5
[]
[marker]
type = BoundaryPreservedMarker
preserved_boundary = moving_boundary
marker = 'efm'
[]
[]
[]
[Executioner]
type = Transient
dt = 0.1
num_steps = 10
[]
[Outputs]
exodus = true
[]
(test/tests/meshgenerators/distributed_rectilinear/dmg_displaced_mesh/pbc_adaptivity.i)
[Mesh]
[dmg]
type = DistributedRectilinearMeshGenerator
dim = 2
nx = 40
ny = 40
xmax = 40
ymax = 40
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[./disp_x]
order = FIRST
family = LAGRANGE
[../]
[./disp_y]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./pid]
order = CONSTANT
family = monomial
[]
[]
[AuxKernels]
[./pidaux]
type = ProcessorIDAux
variable = pid
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./forcing]
type = GaussContForcing
variable = u
[../]
[./dot]
type = TimeDerivative
variable = u
[../]
[./diff_x]
type = Diffusion
variable = disp_x
[../]
[./diff_y]
type = Diffusion
variable = disp_y
[../]
[]
[BCs]
[./Periodic]
[./x]
variable = u
primary = 'left'
secondary = 'right'
translation = '40 0 0'
[../]
[./y]
variable = u
primary = 'bottom'
secondary = 'top'
translation = '0 40 0'
[../]
[../]
[./left_x]
type = DirichletBC
variable = disp_x
boundary = left
value = -0.01
[../]
[./right_x]
type = DirichletBC
variable = disp_x
boundary = right
value = 0.01
[../]
[./left_y]
type = DirichletBC
variable = disp_y
boundary = left
value = -0.01
[../]
[./right_y]
type = DirichletBC
variable = disp_y
boundary = right
value = 0.01
[../]
[]
[Executioner]
type = Transient
dt = 1
num_steps = 5
solve_type = NEWTON
[]
[Outputs]
exodus = true
[]
[Adaptivity]
initial_steps = 2
steps = 1
marker = marker
initial_marker = marker
max_h_level = 2
[./Indicators]
[./indicator]
type = GradientJumpIndicator
variable = u
[../]
[../]
[./Markers]
[./marker]
type = ErrorFractionMarker
indicator = indicator
coarsen = 0.1
refine = 0.7
[../]
[../]
[]
(test/tests/outputs/oversample/ex02_adapt.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
nz = 0
zmax = 0
elem_type = QUAD9
[]
[Variables]
[./diffused]
order = SECOND
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = diffused
[../]
[]
[DiracKernels]
[./foo]
variable = diffused
type = ConstantPointSource
value = 1
point = '0.3 0.3 0.0'
[../]
[]
[BCs]
[./all]
type = DirichletBC
variable = diffused
boundary = 'bottom left right top'
value = 0.0
[../]
[]
[Executioner]
type = Steady
solve_type = PJFNK
[]
[Adaptivity]
max_h_level = 2
initial_steps = 2
marker = marker
steps = 2
initial_marker = marker
[./Indicators]
[./indicator]
type = GradientJumpIndicator
variable = diffused
[../]
[../]
[./Markers]
[./marker]
type = ErrorFractionMarker
indicator = indicator
refine = 0.5
[../]
[../]
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[./os2]
type = Exodus
refinements = 2
[../]
[./os4]
type = Exodus
refinements = 4
[../]
[]
(test/tests/vectorpostprocessors/dynamic_point_sampler/dynamic_point_sampler.i)
[Mesh]
type = GeneratedMesh
nx = 5
ny = 5
dim = 2
[]
[Variables]
[u]
[]
[]
[Functions]
[forcing_func]
type = ParsedFunction
expression = alpha*alpha*pi*pi*sin(alpha*pi*x)
symbol_names = 'alpha'
symbol_values = '4'
[]
[u_func]
type = ParsedGradFunction
value = sin(alpha*pi*x)
grad_x = alpha*pi*sin(alpha*pi*x)
symbol_names = 'alpha'
symbol_values = '4'
[]
[]
[Kernels]
[diff]
type = CoefDiffusion
variable = u
coef = 0.1
[]
[forcing]
type = BodyForce
variable = u
function = forcing_func
[]
[time]
type = TimeDerivative
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = 'u'
boundary = 'left'
value = 0
[]
[right]
type = DirichletBC
variable = 'u'
boundary = 'right'
value = 0
[]
[]
[Executioner]
type = Transient
num_steps = 7
dt = 0.1
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Postprocessors]
[l2_error]
type = ElementL2Error
variable = u
function = u_func
[]
[dofs]
type = NumDOFs
[]
[]
[Adaptivity]
max_h_level = 3
marker = error
[Indicators]
[jump]
type = GradientJumpIndicator
variable = u
[]
[]
[Markers]
[error]
type = ErrorFractionMarker
indicator = jump
coarsen = 0.1
refine = 0.3
[]
[]
[]
[VectorPostprocessors]
[dynamic_line_sampler]
type = DynamicPointValueSampler
variable = u
start_point = '0 0.5 0'
end_point = '1 0.5 0'
num_points = 6
sort_by = x
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
csv = true
[]
(test/tests/functions/image_function/image.i)
[Mesh]
type = GeneratedMesh
dim = 3
nx = 10
ny = 10
nz = 10
[]
[Adaptivity]
max_h_level = 5
initial_steps = 5
initial_marker = marker
[Indicators]
[indicator]
type = GradientJumpIndicator
variable = u
[]
[]
[Markers]
[marker]
type = ErrorFractionMarker
indicator = indicator
refine = 0.9
[]
[]
[]
[Variables]
[u]
[]
[]
[Functions]
[image_func]
type = ImageFunction
file = stack/test_00.png
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[ICs]
[u_ic]
type = FunctionIC
function = image_func
variable = u
[]
[]
[Problem]
type = FEProblem
solve = false
[]
[Executioner]
type = Transient
num_steps = 1
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
(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'
[]
[]
(tutorials/darcy_thermo_mech/step10_multiapps/problems/step10_micro.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
ymax = 0.1
xmax = 0.1
[]
uniform_refine = 0
[]
[Adaptivity]
max_h_level = 4
initial_steps = 6
initial_marker = error_marker
cycles_per_step = 2
marker = error_marker
[Indicators]
[phi_jump]
type = GradientJumpIndicator
variable = phi
[]
[]
[Markers]
[error_marker]
type = ErrorFractionMarker
indicator = phi_jump
refine = 0.8
coarsen = 0.1
[]
[]
[]
[Variables]
[temperature]
initial_condition = 300
[]
[]
[AuxVariables]
[phi]
[]
[]
[AuxKernels]
[corrosion]
type = RandomCorrosion
variable = phi
reference_temperature = 300
temperature = temperature_in
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Kernels]
[heat_conduction]
type = ADHeatConduction
variable = temperature
[]
[]
[BCs]
[left]
type = PostprocessorDirichletBC
variable = temperature
boundary = left
postprocessor = temperature_in
[]
[right]
type = NeumannBC
variable = temperature
boundary = right
value = 100 # prescribed flux
[]
[]
[Materials]
[column]
type = PackedColumn
temperature = temperature
radius = 1 # mm
phase = phi
[]
[]
[Postprocessors]
[temperature_in]
type = Receiver
default = 301
[]
[k_eff]
type = ThermalConductivity
variable = temperature
T_hot = temperature_in
flux = 100
dx = 0.1
boundary = right
length_scale = 1
k0 = 12.05
execute_on = 'INITIAL TIMESTEP_END'
[]
[average_porosity]
type = ADElementAverageMaterialProperty
mat_prop = porosity
execute_on = 'INITIAL TIMESTEP_END'
[]
[t_right]
type = SideAverageValue
boundary = right
variable = temperature
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
end_time = 1000
dt = 1
steady_state_tolerance = 1e-9
steady_state_detection = true
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
automatic_scaling = true
[]
[Outputs]
execute_on = 'initial timestep_end'
exodus = true
[]
[ICs]
[close_pack]
radius = 0.01 # meter
outvalue = 0 # water
variable = phi
invalue = 1 # steel
type = ClosePackIC
[]
[]
(modules/phase_field/test/tests/grain_tracker_test/grain_tracker_test_elemental.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 25
ny = 25
nz = 0
xmax = 1000
ymax = 1000
zmax = 0
elem_type = QUAD4
[]
[GlobalParams]
op_num = 12 # Should match grain_num so we can test with FauxGrainTracker too
var_name_base = gr
[]
[Variables]
[./PolycrystalVariables]
[../]
[]
[UserObjects]
[./voronoi]
type = PolycrystalVoronoi
grain_num = 12 # Number of grains
coloring_algorithm = bt # bt will assign one grain to each op if they are the same
rand_seed = 8675
[../]
[./grain_tracker]
type = GrainTracker
[../]
[]
[ICs]
[./PolycrystalICs]
[./PolycrystalColoringIC]
polycrystal_ic_uo = voronoi
[../]
[../]
[]
[AuxVariables]
[./bnds]
order = FIRST
family = LAGRANGE
[../]
[./unique_grains]
order = CONSTANT
family = MONOMIAL
[../]
[./var_indices]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./PolycrystalKernel]
[../]
[]
[AuxKernels]
[./BndsCalc]
type = BndsCalcAux
variable = bnds
[../]
[./unique_grains]
type = FeatureFloodCountAux
variable = unique_grains
flood_counter = grain_tracker
field_display = UNIQUE_REGION
[../]
[./var_indices]
type = FeatureFloodCountAux
variable = var_indices
flood_counter = grain_tracker
field_display = VARIABLE_COLORING
[../]
[]
[BCs]
[./Periodic]
[./all]
auto_direction = 'x y'
[../]
[../]
[]
[Materials]
[./CuGrGr]
type = GBEvolution
T = 500 # K
wGB = 100 # nm
GBmob0 = 2.5e-6
Q = 0.23
GBenergy = 0.708
molar_volume = 7.11e-6
[../]
[]
[Postprocessors]
[./DOFs]
type = NumDOFs
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart'
petsc_options_value = 'hypre boomeramg 31'
l_tol = 1.0e-4
l_max_its = 30
nl_max_its = 20
nl_rel_tol = 1.0e-9
start_time = 0.0
num_steps = 2
dt = 100.0
[]
[Adaptivity]
marker = error_marker
max_h_level = 1
[./Markers]
active = 'error_marker'
[./bnds_marker]
type = ValueThresholdMarker
invert = true
refine = 0.85
coarsen = 0.975
third_state = DO_NOTHING
variable = bnds
[../]
[./error_marker]
type = ErrorFractionMarker
coarsen = 0.1
indicator = bnds_error
refine = 0.7
[../]
[../]
[./Indicators]
[./bnds_error]
type = GradientJumpIndicator
variable = bnds
[../]
[../]
[]
[Outputs]
exodus = true
[]
(examples/ex05_amr/ex05.i)
[Mesh]
file = cube-hole.e
[]
# This is where mesh adaptivity magic happens:
[Adaptivity]
marker = errorfrac # this specifies which marker from 'Markers' subsection to use
steps = 2 # run adaptivity 2 times, recomputing solution, indicators, and markers each time
# Use an indicator to compute an error-estimate for each element:
[./Indicators]
# create an indicator computing an error metric for the convected variable
[./error] # arbitrary, use-chosen name
type = GradientJumpIndicator
variable = convected
outputs = none
[../]
[../]
# Create a marker that determines which elements to refine/coarsen based on error estimates
# from an indicator:
[./Markers]
[./errorfrac] # arbitrary, use-chosen name (must match 'marker=...' name above
type = ErrorFractionMarker
indicator = error # use the 'error' indicator specified above
refine = 0.5 # split/refine elements in the upper half of the indicator error range
coarsen = 0 # don't do any coarsening
outputs = none
[../]
[../]
[]
[Variables]
[./convected]
order = FIRST
family = LAGRANGE
[../]
[./diffused]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./example_diff]
type = ExampleCoefDiffusion
variable = convected
coef = 0.125
[../]
[./conv]
type = ExampleConvection
variable = convected
some_variable = diffused
[../]
[./diff]
type = Diffusion
variable = diffused
[../]
[]
[BCs]
# convected=0 on all vertical sides except the right (x-max)
[./cylinder_convected]
type = DirichletBC
variable = convected
boundary = inside
value = 1
[../]
[./exterior_convected]
type = DirichletBC
variable = convected
boundary = 'left top bottom'
value = 0
[../]
[./left_diffused]
type = DirichletBC
variable = diffused
boundary = left
value = 0
[../]
[./right_diffused]
type = DirichletBC
variable = diffused
boundary = right
value = 10
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
l_tol = 1e-3
nl_rel_tol = 1e-12
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/indicators/gradient_jump_indicator/gradient_jump_indicator_test.i)
###########################################################
# This is a test of the Mesh Indicator System. It computes
# a user-defined "error" for each element in the Mesh.
#
# This test has been verified to give the same error
# calculation as the libMesh kelly_error_estimator. If
# this test is diffing... the diff is wrong!
#
# @Requirement F2.40
###########################################################
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
nz = 10
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Functions]
[./solution]
type = ParsedFunction
expression = (exp(x)-1)/(exp(1)-1)
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./conv]
type = Convection
variable = u
velocity = '1 0 0'
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
# Mesh Indicator System
[Adaptivity]
[Indicators]
[error]
type = GradientJumpIndicator
variable = u
[]
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
exodus = true
[]
(modules/ray_tracing/test/tests/userobjects/cone_ray_study/cone_ray_study.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmax = 5
ymax = 5
[]
[]
[Variables/u]
[]
[Kernels]
[reaction]
type = Reaction
variable = u
[]
[diffusion]
type = Diffusion
variable = u
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[UserObjects/study]
type = ConeRayStudy
start_points = '1 1.5 0'
directions = '2 1 0'
half_cone_angles = 2.5
ray_data_name = weight
# Must be set with RayKernels that
# contribute to the residual
execute_on = PRE_KERNELS
# For outputting Rays
always_cache_traces = true
[]
[RayBCs]
[reflect]
type = ReflectRayBC
boundary = 'right'
[]
[kill_rest]
type = KillRayBC
boundary = 'top'
[]
[]
[RayKernels/line_source]
type = LineSourceRayKernel
variable = u
# Scale by the weights in the ConeRayStudy
ray_data_factor_names = weight
[]
[Outputs]
exodus = true
[rays]
type = RayTracingExodus
study = study
execute_on = FINAL
[]
[]
[Adaptivity]
steps = 0 # 6 for pretty pictures
marker = marker
initial_marker = marker
max_h_level = 6
[Indicators/indicator]
type = GradientJumpIndicator
variable = u
[]
[Markers/marker]
type = ErrorFractionMarker
indicator = indicator
coarsen = 0.25
refine = 0.5
[]
[]
(modules/porous_flow/test/tests/pressure_pulse/pressure_pulse_1d_adaptivity.i)
# Pressure pulse in 1D with 1 phase - transient simulation with a constant
# PorousFlowPorosity and mesh adaptivity with an indicator
[Mesh]
type = GeneratedMesh
dim = 1
nx = 10
xmin = 0
xmax = 100
[]
[Adaptivity]
marker = marker
[Markers]
[marker]
type = ErrorFractionMarker
indicator = front
refine = 0.5
coarsen = 0.2
[]
[]
[Indicators]
[front]
type = GradientJumpIndicator
variable = pp
[]
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Variables]
[pp]
initial_condition = 2E6
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = pp
[]
[flux]
type = PorousFlowAdvectiveFlux
variable = pp
gravity = '0 0 0'
fluid_component = 0
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pp'
number_fluid_phases = 1
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureVG
m = 0.5
alpha = 1e-7
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 2e9
density0 = 1000
thermal_expansion = 0
viscosity = 1e-3
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
[]
[ppss]
type = PorousFlow1PhaseP
porepressure = pp
capillary_pressure = pc
[]
[massfrac]
type = PorousFlowMassFraction
[]
[simple_fluid]
type = PorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[porosity]
type = PorousFlowPorosity
porosity_zero = 0.1
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1E-15 0 0 0 1E-15 0 0 0 1E-15'
[]
[relperm]
type = PorousFlowRelativePermeabilityCorey
n = 0
phase = 0
[]
[]
[BCs]
[left]
type = DirichletBC
boundary = left
preset = false
value = 3E6
variable = pp
[]
[right]
type = PorousFlowPiecewiseLinearSink
variable = pp
boundary = right
fluid_phase = 0
pt_vals = '0 1E9'
multipliers = '0 1E9'
mass_fraction_component = 0
use_mobility = true
flux_function = 1E-6
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
dt = 1e3
end_time = 5e3
[]
[Postprocessors]
[p000]
type = PointValue
variable = pp
point = '0 0 0'
execute_on = 'initial timestep_end'
[]
[p010]
type = PointValue
variable = pp
point = '10 0 0'
execute_on = 'initial timestep_end'
[]
[p020]
type = PointValue
variable = pp
point = '20 0 0'
execute_on = 'initial timestep_end'
[]
[p030]
type = PointValue
variable = pp
point = '30 0 0'
execute_on = 'initial timestep_end'
[]
[p040]
type = PointValue
variable = pp
point = '40 0 0'
execute_on = 'initial timestep_end'
[]
[p050]
type = PointValue
variable = pp
point = '50 0 0'
execute_on = 'initial timestep_end'
[]
[p060]
type = PointValue
variable = pp
point = '60 0 0'
execute_on = 'initial timestep_end'
[]
[p070]
type = PointValue
variable = pp
point = '70 0 0'
execute_on = 'initial timestep_end'
[]
[p080]
type = PointValue
variable = pp
point = '80 0 0'
execute_on = 'initial timestep_end'
[]
[p090]
type = PointValue
variable = pp
point = '90 0 0'
execute_on = 'initial timestep_end'
[]
[p100]
type = PointValue
variable = pp
point = '100 0 0'
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
print_linear_residuals = false
csv = true
[]
(modules/porous_flow/test/tests/recover/theis.i)
# Tests that PorousFlow can successfully recover using a checkpoint file.
# This test contains stateful material properties, adaptivity and integrated
# boundary conditions with nodal-sized materials.
#
# This test file is run three times:
# 1) The full input file is run to completion
# 2) The input file is run for half the time and checkpointing is included
# 3) The input file is run in recovery using the checkpoint data
#
# The final output of test 3 is compared to the final output of test 1 to verify
# that recovery was successful.
[Mesh]
type = GeneratedMesh
dim = 1
nx = 20
xmax = 100
bias_x = 1.05
coord_type = RZ
rz_coord_axis = Y
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[Adaptivity]
marker = marker
max_h_level = 4
[Indicators]
[front]
type = GradientJumpIndicator
variable = zi
[]
[]
[Markers]
[marker]
type = ErrorFractionMarker
indicator = front
refine = 0.8
coarsen = 0.2
[]
[]
[]
[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]
[aquifer]
type = PorousFlowPiecewiseLinearSink
variable = pgas
boundary = right
pt_vals = '0 1e8'
multipliers = '0 1e8'
flux_function = 1e-6
PT_shift = 20e6
[]
[]
[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 = 2e2
dt = 50
[]
[VectorPostprocessors]
[line]
type = NodalValueSampler
sort_by = x
variable = 'pgas zi'
[]
[]
[Outputs]
print_linear_residuals = false
perf_graph = true
csv = 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/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
[]
(test/tests/misc/selective_reinit/selective_reinit_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./dummy]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./constant_dummy]
type = ConstantAux
variable = dummy
execute_on = 'initial timestep_end'
value = 4
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Postprocessors]
[./u_integral]
type = ElementIntegralVariablePostprocessor
variable = u
execute_on = linear
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Adaptivity]
[./Indicators]
[./indicator]
type = GradientJumpIndicator
variable = u
[../]
[../]
[./Markers]
[./box]
type = BoxMarker
bottom_left = '0.2 0.2 0'
top_right = '0.8 0.8 0'
inside = refine
outside = coarsen
[../]
[../]
[]
[Outputs]
exodus = true
show = u
[]
[LotsOfAuxVariables]
[./avar]
number = 20
[../]
[]
(tutorials/darcy_thermo_mech/step07_adaptivity/problems/step7d_adapt_blocks.i)
[Mesh]
uniform_refine = 3
[generate]
type = GeneratedMeshGenerator
dim = 2
nx = 40
ny = 4
xmax = 0.304 # Length of test chamber
ymax = 0.0257 # Test chamber radius
[]
[bottom]
type = SubdomainBoundingBoxGenerator
input = generate
location = inside
bottom_left = '0 0 0'
top_right = '0.304 0.01285 0'
block_id = 1
[]
coord_type = RZ
rz_coord_axis = X
[]
[Variables]
[pressure]
[]
[temperature]
initial_condition = 300 # Start at room temperature
[]
[]
[AuxVariables]
[velocity]
order = CONSTANT
family = MONOMIAL_VEC
[]
[]
[Kernels]
[darcy_pressure]
type = DarcyPressure
variable = pressure
[]
[heat_conduction]
type = ADHeatConduction
variable = temperature
[]
[heat_conduction_time_derivative]
type = ADHeatConductionTimeDerivative
variable = temperature
[]
[heat_convection]
type = DarcyAdvection
variable = temperature
pressure = pressure
[]
[]
[AuxKernels]
[velocity]
type = DarcyVelocity
variable = velocity
execute_on = timestep_end
pressure = pressure
[]
[]
[BCs]
[inlet]
type = DirichletBC
variable = pressure
boundary = left
value = 4000 # (Pa) From Figure 2 from paper. First data point for 1mm spheres.
[]
[outlet]
type = DirichletBC
variable = pressure
boundary = right
value = 0 # (Pa) Gives the correct pressure drop from Figure 2 for 1mm spheres
[]
[inlet_temperature]
type = FunctionDirichletBC
variable = temperature
boundary = left
function = 'if(t<0,350+50*t,350)'
[]
[outlet_temperature]
type = HeatConductionOutflow
variable = temperature
boundary = right
[]
[]
[Materials]
viscosity_file = data/water_viscosity.csv
density_file = data/water_density.csv
thermal_conductivity_file = data/water_thermal_conductivity.csv
specific_heat_file = data/water_specific_heat.csv
[column_bottom]
type = PackedColumn
block = 1
radius = 1.15
temperature = temperature
fluid_viscosity_file = ${viscosity_file}
fluid_density_file = ${density_file}
fluid_thermal_conductivity_file = ${thermal_conductivity_file}
fluid_specific_heat_file = ${specific_heat_file}
[]
[column_top]
type = PackedColumn
block = 0
radius = 1
temperature = temperature
porosity = '0.25952 + 0.7*x/0.304'
fluid_viscosity_file = ${viscosity_file}
fluid_density_file = ${density_file}
fluid_thermal_conductivity_file = ${thermal_conductivity_file}
fluid_specific_heat_file = ${specific_heat_file}
[]
[]
[Problem]
type = FEProblem
[]
[Executioner]
type = Transient
solve_type = NEWTON
automatic_scaling = true
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
end_time = 100
dt = 0.25
start_time = -1
steady_state_tolerance = 1e-5
steady_state_detection = true
[TimeStepper]
type = FunctionDT
function = 'if(t<0,0.1,0.25)'
[]
[]
[Adaptivity]
marker = error_frac
max_h_level = 3
[Indicators]
[temperature_jump]
type = GradientJumpIndicator
variable = temperature
scale_by_flux_faces = true
[]
[]
[Markers]
[error_frac]
type = ErrorFractionMarker
coarsen = 0.025
indicator = temperature_jump
refine = 0.9
[]
[]
[]
[Outputs]
[out]
type = Exodus
output_material_properties = 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/solid_mechanics/examples/piston/piston_params.i)
## This example is documented on YouTube at:
## https://www.youtube.com/watch?v=L9plLYkAbvQ
##
## Additional files (e.g. the CAD model, results)
## can be downloaded freely from Zenodo at:
## https://doi.org/10.5281/zenodo.3886965
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
# Read in mesh from file
type = FileMesh
file = piston_coarse.e
[]
# This is where mesh adaptivity magic happens
[Adaptivity]
steps = 1
max_h_level = 3
cycles_per_step = 1
initial_marker = uniform
marker = errorFraction
[Markers]
[uniform]
type = UniformMarker
mark = refine
[]
[errorFraction]
type = ErrorFractionMarker
coarsen = 0.5
indicator = gradientJump
refine = 0.5
[]
[]
[Indicators]
[gradientJump]
type = GradientJumpIndicator
variable = disp_y
[]
[]
[]
[Physics/SolidMechanics/QuasiStatic]
# Parameters that apply to all subblocks are specified at this level.
# They can be overwritten in the subblocks.
add_variables = true
incremental = false
strain = SMALL
generate_output = 'vonmises_stress'
[block]
block = 1
[]
[]
[BCs]
[Pressure]
[load]
# Applies the pressure
boundary = load_surf
function = 't*550e5'
[]
[]
[symmetry_x]
# Applies symmetry on the xmin faces
type = DirichletBC
variable = disp_x
boundary = 'xmin'
value = 0.0
[]
[hold_y]
# Anchors the bottom against deformation in the y-direction
type = DirichletBC
variable = disp_y
boundary = 'ymin'
value = 0.0
[]
[symmetry_z]
# Applies symmetry on the zmin faces
type = DirichletBC
variable = disp_z
boundary = 'zmin'
value = 0.0
[]
[]
[Materials]
[elasticity_tensor_steel]
# Creates the elasticity tensor using steel parameters
youngs_modulus = 210e9 #Pa
poissons_ratio = 0.3
type = ComputeIsotropicElasticityTensor
block = 1
[]
[stress]
# Computes the stress, using linear elasticity
type = ComputeLinearElasticStress
block = 1
[]
[]
[Preconditioning]
[SMP]
# Creates the entire Jacobian, for the Newton solve
type = SMP
full = true
[]
[]
[Executioner]
# We solve a steady state problem using Newton's iteration
type = Transient
solve_type = NEWTON
nl_rel_tol = 1e-9
l_max_its = 30
l_tol = 1e-4
nl_max_its = 10
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_gmres_restart'
petsc_options_value = 'hypre boomeramg 31'
dt = 0.1
num_steps = 10
[]
[Outputs]
exodus = true
perf_graph = true
[]
(test/tests/meshgenerators/distributed_rectilinear/dmg_displaced_mesh/adaptivity.i)
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[gmg]
type = DistributedRectilinearMeshGenerator
dim = 2
nx = 20
ny = 20
[]
[]
[Variables]
[./u]
[../]
[./disp_x]
[../]
[./disp_y]
[../]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
[./time]
type = TimeDerivative
variable = u
[../]
[./diff_x]
type = Diffusion
variable = disp_x
[../]
[./diff_y]
type = Diffusion
variable = disp_y
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[./left_x]
type = DirichletBC
variable = disp_x
boundary = left
value = -0.01
[../]
[./right_x]
type = DirichletBC
variable = disp_x
boundary = left
value = 0.01
[../]
[./left_y]
type = DirichletBC
variable = disp_y
boundary = left
value = -0.01
[../]
[./right_y]
type = DirichletBC
variable = disp_y
boundary = right
value = 0.01
[../]
[]
[Executioner]
type = Transient
num_steps = 3
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Adaptivity]
initial_steps = 2
steps = 1
marker = marker
initial_marker = marker
max_h_level = 2
[./Indicators]
[./indicator]
type = GradientJumpIndicator
variable = u
[../]
[../]
[./Markers]
[./marker]
type = ErrorFractionMarker
indicator = indicator
coarsen = 0.1
refine = 0.7
[../]
[../]
[]
[Outputs]
exodus = true
[]
(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/outputs/debug/show_execution_adaptivity.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Debug]
show_execution_order = 'ALWAYS'
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = CoefDiffusion
variable = u
coef = 0.1
[]
[time]
type = TimeDerivative
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Transient
num_steps = 2
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Adaptivity]
initial_steps = 2
cycles_per_step = 2
marker = marker
initial_marker = marker
max_h_level = 2
[Indicators/indicator]
type = GradientJumpIndicator
variable = u
[]
[Markers/marker]
type = ErrorFractionMarker
indicator = indicator
coarsen = 0.1
refine = 0.7
[]
[]
(modules/ray_tracing/test/tests/raykernels/line_source_ray_kernel/simple_diffusion_line_source.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmax = 5
ymax = 5
[]
[]
[Variables/u]
[]
[Kernels/diff]
type = Diffusion
variable = u
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
[UserObjects/study]
type = RepeatableRayStudy
names = 'line_source_ray'
start_points = '1 1 0'
end_points = '5 2 0'
execute_on = PRE_KERNELS # must be set for line sources!
[]
[RayKernels/line_source]
type = LineSourceRayKernel
variable = u
value = 5
[]
# This isn't used in the test but can be enabled
# for pretty pictures as is used in an example!
[Adaptivity]
steps = 0 # 5
marker = marker
initial_marker = marker
max_h_level = 5
[Indicators/indicator]
type = GradientJumpIndicator
variable = u
[]
[Markers/marker]
type = ErrorFractionMarker
indicator = indicator
coarsen = 0.1
refine = 0.5
[]
[]
(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/outputs/system_info/system_info.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Adaptivity]
marker = marker
max_h_level = 2
[./Indicators]
[./indicator]
type = GradientJumpIndicator
variable = u
[../]
[../]
[./Markers]
[./marker]
type = ErrorFractionMarker
coarsen = 0.1
indicator = indicator
refine = 0.7
[../]
[../]
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./aux_u]
[../]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
[./time]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 3
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(tutorials/darcy_thermo_mech/step10_multiapps/tests/auxkernels/corrosion/corrosion.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
ymax = 0.1
xmax = 0.1
[]
uniform_refine = 0
[]
[Adaptivity]
max_h_level = 3
initial_steps = 5
cycles_per_step = 2
initial_marker = error_marker
marker = error_marker
[Indicators]
[phi_jump]
type = GradientJumpIndicator
variable = phi
[]
[]
[Markers]
[error_marker]
type = ErrorFractionMarker
indicator = phi_jump
refine = 0.9
[]
[]
[]
[Variables]
[temperature]
initial_condition = 300
[]
[]
[AuxVariables]
[phi]
[]
[]
[AuxKernels]
[corrosion]
type = RandomCorrosion
execute_on = 'timestep_end'
variable = phi
reference_temperature = 300
temperature = 301
[]
[]
[Kernels]
[heat_conduction]
type = ADHeatConduction
variable = temperature
[]
[]
[BCs]
[left]
type = PostprocessorDirichletBC
variable = temperature
boundary = left
postprocessor = 301
[]
[right]
type = NeumannBC
variable = temperature
boundary = right
value = 100 # prescribed flux
[]
[]
[Materials]
[column]
type = PackedColumn
temperature = temperature
radius = 1 # mm
phase = phi
outputs = exodus
output_properties = porosity
[]
[]
[Problem]
type = FEProblem
[]
[Postprocessors]
[k_eff]
type = ThermalConductivity
variable = temperature
T_hot = 301
flux = 100
dx = 0.1
boundary = right
length_scale = 1
[]
[]
[Executioner]
type = Transient
num_steps = 5
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
execute_on = 'initial timestep_end'
exodus = true
[console]
type = Console
execute_postprocessors_on = 'timestep_begin timestep_end'
[]
[]
[ICs]
[close_pack]
radius = 0.01
outvalue = 0 # water
variable = phi
invalue = 1 #steel
type = ClosePackIC
[]
[]
(modules/functional_expansion_tools/examples/3D_volumetric_cylindrical_subapp_mesh_refine/sub.i)
# Derived from the example '3D_volumetric_cylindrical' with the following differences:
#
# 1) The model mesh is refined in the MasterApp by 1
# 2) Mesh adaptivity is enabled for the SubApp
# 3) Output from the SubApp is enabled so that the mesh changes can be visualized
[Mesh]
type = FileMesh
file = cyl-tet.e
[]
[Adaptivity]
marker = errorfrac
steps = 2
[./Indicators]
[./error]
type = GradientJumpIndicator
variable = s
outputs = none
[../]
[../]
[./Markers]
[./errorfrac]
type = ErrorFractionMarker
refine = 0.4
coarsen = 0.1
indicator = error
outputs = none
[../]
[../]
[]
# Non-copy transfers only work with AuxVariable, but nothing will be solved without a variable
# defined. The solution is to define an empty variable tha does nothing, but causes MOOSE to solve
# the AuxKernels that we need.
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
# We must have a kernel for every variable, hence this null kernel to match the variable 'empty'
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s] # Something to make 's' change each time, but allow a converging solution
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = CylindricalDuo
orders = '5 3' # Axial first, then (r, t) FX
physical_bounds = '-2.5 2.5 0 0 1' # z_min z_max x_center y_center radius
z = Legendre # Axial in z
disc = Zernike # (r, t) default to unit disc in x-y plane
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXVolumeUserObject
function = FX_Basis_Value_Sub
variable = s
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
file_base = sub
[]
(test/tests/meshgenerators/distributed_rectilinear/generator/distributed_rectilinear_mesh_generator_adaptivity.i)
[Mesh]
[gmg]
type = DistributedRectilinearMeshGenerator
dim = 2
nx = 10
ny = 10
[]
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
[./time]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 5
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Adaptivity]
initial_steps = 2
steps = 1
marker = marker
initial_marker = marker
max_h_level = 2
[./Indicators]
[./indicator]
type = GradientJumpIndicator
variable = u
[../]
[../]
[./Markers]
[./marker]
type = ErrorFractionMarker
indicator = indicator
coarsen = 0.1
refine = 0.7
[../]
[../]
[]
[Outputs]
exodus = true
[]
(test/tests/indicators/gradient_jump_indicator/gradient_jump_indicator_fv_test.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
xmax = 2
nx = 2
ny = 1
subdomain_ids = '0 1'
[]
[interface_mesh]
type = SideSetsBetweenSubdomainsGenerator
input = gmg
primary_block = 0
paired_block = 1
new_boundary = interface
[]
# This creates enough elements to have defined gradients
[refine]
type = RefineBlockGenerator
input = interface_mesh
block = '0 1'
refinement = '3 3'
[]
[]
[Adaptivity]
marker = error_frac
max_h_level = 5
[Indicators]
[u0_jump]
type = GradientJumpIndicator
variable = u0
scale_by_flux_faces = false
[]
[]
[Markers]
[error_frac]
type = ErrorFractionMarker
coarsen = 0.15
indicator = u0_jump
refine = 0.7
[]
[]
[]
[Variables]
[u0]
family = MONOMIAL
order = CONSTANT
fv = true
block = 0
initial_condition = 0
[]
[u1]
family = MONOMIAL
order = CONSTANT
fv = true
block = 1
initial_condition = 0
[]
[]
[FVKernels]
[time0]
type = FVTimeKernel
variable = u0
[]
[diff0]
type = FVDiffusion
variable = u0
coeff = 1
block = 0
[]
[time1]
type = FVTimeKernel
variable = u1
[]
[diff1]
type = FVDiffusion
variable = u1
coeff = 1
block = 1
[]
[]
[FVInterfaceKernels]
[diffusion]
type = FVDiffusionInterface
variable1 = u0
variable2 = u1
boundary = interface
subdomain1 = 0
subdomain2 = 1
coeff1 = 1
coeff2 = 1
[]
[]
[FVBCs]
[left] # arbitrary user-chosen name
type = FVDirichletBC
variable = u0
boundary = 'left' # This must match a named boundary in the mesh file
value = 1
[]
[right] # arbitrary user-chosen name
type = FVNeumannBC
variable = u1
boundary = 'right' # This must match a named boundary in the mesh file
value = 0
[]
[]
[Executioner]
type = Transient
solve_type = 'Newton'
end_time = 0.5
dt = 0.1
[]
[VectorPostprocessors]
[samples]
type = LineValueSampler
variable = u0
# Avoiding element faces
start_point = '0.0001 1e-6 0'
end_point = '0.999999 1e-6 0'
num_points = 10
sort_by = 'x'
[]
[]
[Outputs]
execute_on = 'timestep_end'
csv = true
[]
(test/tests/adaptivity/cycles_per_step/cycles_per_step.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = CoefDiffusion
variable = u
coef = 0.1
[]
[time]
type = TimeDerivative
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Transient
num_steps = 5
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Adaptivity]
initial_steps = 2
cycles_per_step = 2
marker = marker
initial_marker = marker
max_h_level = 2
[Indicators/indicator]
type = GradientJumpIndicator
variable = u
[]
[Markers/marker]
type = ErrorFractionMarker
indicator = indicator
coarsen = 0.1
refine = 0.7
[]
[]
[Outputs]
exodus = true
[]
(test/tests/adaptivity/scalar/scalar_adaptivity.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmin = -0.5
xmax = 0.5
ymin = -0.5
ymax = 0.5
[]
[Variables]
[scalar]
order = THIRD
family = SCALAR
[]
[u]
[InitialCondition]
type = FunctionIC
function = 'x*x+y*y'
[]
[]
[]
[Kernels]
[u_dot]
type = TimeDerivative
variable = u
[]
[c_res]
type = Diffusion
variable = u
[]
[]
[ScalarKernels]
[d1]
type = ODETimeDerivative
variable = scalar
[]
[]
[BCs]
[Periodic]
[all]
auto_direction = 'x y'
variable = 'u'
[]
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -sub_pc_type'
petsc_options_value = 'asm lu '
num_steps = 2
[]
[Adaptivity]
initial_steps = 2
max_h_level = 2
marker = EFM
[Markers]
[EFM]
type = ErrorFractionMarker
coarsen = 0.2
refine = 0.8
indicator = GJI
[]
[]
[Indicators]
[GJI]
type = GradientJumpIndicator
variable = u
[]
[]
[]
[Outputs]
exodus = true
[]
(test/tests/dgkernels/adaptivity/adaptivity.i)
# This input file is used for two tests:
# 1) Check that DGKernels work with mesh adaptivity
# 2) Error out when DGKernels are used with adaptivity
# and stateful material prpoerties
[Mesh]
type = GeneratedMesh
dim = 3
nx = 2
ny = 2
nz = 2
parallel_type = 'replicated'
[]
[Variables]
[./u]
order = FIRST
family = MONOMIAL
[./InitialCondition]
type = ConstantIC
value = 1
[../]
[../]
[]
[Functions]
[./forcing_fn]
type = ParsedFunction
expression = (x*x*x)-6.0*x
[../]
[./bc_fn]
type = ParsedFunction
expression = (x*x*x)
[../]
[]
[Kernels]
[./diff]
type = MatDiffusionTest
variable = u
prop_name = diffusivity
[../]
[./abs]
type = Reaction
variable = u
[../]
[./forcing]
type = BodyForce
variable = u
function = forcing_fn
[../]
[]
[DGKernels]
[./dgdiff]
type = DGDiffusion
variable = u
sigma = 6
epsilon = -1.0
diff = diffusivity
[../]
[]
[BCs]
active = 'all'
[./all]
type = DGMDDBC
variable = u
boundary = '1 2 3 4'
function = bc_fn
prop_name = diffusivity
sigma = 6
epsilon = -1.0
[../]
[]
[Materials]
active = 'constant'
[./stateful]
type = StatefulTest
prop_names = 'diffusivity'
prop_values = '1'
[../]
[./constant]
type = GenericConstantMaterial
prop_names = 'diffusivity'
prop_values = '1'
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Adaptivity]
marker = 'marker'
steps = 1
[./Indicators]
[./error]
type = GradientJumpIndicator
variable = u
[../]
[../]
[./Markers]
[./marker]
type = ErrorFractionMarker
coarsen = 0.5
indicator = error
refine = 0.5
[../]
[../]
[]
[Outputs]
exodus = true
[]
(test/tests/adaptivity/cycles_per_step/test.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
[./time]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 5
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Adaptivity]
initial_steps = 2
steps = 1
marker = marker
initial_marker = marker
max_h_level = 2
[./Indicators]
[./indicator]
type = GradientJumpIndicator
variable = u
[../]
[../]
[./Markers]
[./marker]
type = ErrorFractionMarker
indicator = indicator
coarsen = 0.1
refine = 0.7
[../]
[../]
[]
[Outputs]
exodus = true
[]
(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/level_set/test/tests/transfers/markers/multi_level/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
uniform_refine = 2
[]
[Adaptivity]
marker = marker
max_h_level = 2
cycles_per_step = 2
[./Indicators]
[./error]
type = GradientJumpIndicator
variable = u
[../]
[../]
[./Markers]
[./marker]
type = ErrorFractionMarker
coarsen = 0.4
refine = 0.5
indicator = error
[../]
[../]
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./time]
type = TimeDerivative
variable = u
[../]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Problem]
type = LevelSetProblem
[]
[Executioner]
type = Transient
dt = 0.02
num_steps = 4
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[./sub]
type = TransientMultiApp
input_files = 'sub.i'
execute_on = TIMESTEP_END
[../]
[]
[Transfers]
[./marker_to_sub]
type = LevelSetMeshRefinementTransfer
to_multi_app = sub
source_variable = marker
variable = marker
check_multiapp_execute_on = false
[../]
[]
[Outputs]
hide = u
exodus = true
[]
(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
[]
(test/tests/outputs/output_interface/marker.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Adaptivity]
[./Indicators]
[./indicator_0]
type = GradientJumpIndicator
variable = u
outputs = none
[../]
[./indicator_1]
type = GradientJumpIndicator
variable = u
outputs = none
[../]
[../]
[./Markers]
[./marker_0]
type = ValueThresholdMarker
outputs = markers
refine = 0.5
variable = u
[../]
[./marker_1]
type = BoxMarker
bottom_left = '0.25 0.25 0'
top_right = '0.75 0.75 0'
inside = REFINE
outside = DONT_MARK
outputs = markers
[../]
[../]
[]
[Outputs]
[./markers]
type = Exodus
[../]
[./no_markers]
type = Exodus
[../]
[]
(test/tests/auxkernels/solution_aux/aux_nonlinear_solution_adapt.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./u_aux]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./aux_kernel]
type = FunctionAux
function = x*y
variable = u_aux
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = 2
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = PJFNK
nl_rel_tol = 1e-10
[]
[Adaptivity]
marker = error_frac
steps = 3
[./Indicators]
[./jump_indicator]
type = GradientJumpIndicator
variable = u
[../]
[../]
[./Markers]
[./error_frac]
type = ErrorFractionMarker
indicator = jump_indicator
refine = 0.7
[../]
[../]
[]
[Outputs]
xda = true
[]
(test/tests/functions/image_function/threshold_adapt.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
[]
[Variables]
[u]
[]
[]
[Functions]
[image_func]
type = ImageFunction
file_base = stack/test
file_suffix = png
file_range = '0' # file_range is a vector input, a single entry means "read only 1 file"
threshold = 2.7e4
upper_value = 1
lower_value = -1
[]
[]
[ICs]
[u_ic]
type = FunctionIC
function = image_func
variable = u
[]
[]
[Problem]
type = FEProblem
solve = false
[]
[Executioner]
type = Transient
num_steps = 1
dt = 0.1
[]
[Adaptivity]
max_h_level = 5
initial_steps = 5
initial_marker = marker
[Indicators]
[indicator]
type = GradientJumpIndicator
variable = u
[]
[]
[Markers]
[marker]
type = ErrorFractionMarker
indicator = indicator
refine = 0.9
[]
[]
[]
[Outputs]
exodus = true
[]
(modules/phase_field/examples/grain_growth/grain_growth_2D_voronoi_newadapt.i)
# 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]
# 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 and sets their initial condition
[../]
[]
[AuxVariables]
# Dependent variables
[./bnds]
# Variable used to visualize the grain boundaries in the simulation
[../]
[]
[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
[../]
[]
[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
[../]
[]
[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'
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-10 # Absolute tolerance for nonlienar solves
[./TimeStepper]
type = SolutionTimeAdaptiveDT
dt = 25 # Initial time step. In this simulation it changes.
[../]
start_time = 0.0
end_time = 4000
num_steps = 3
[]
[Adaptivity]
marker = errorfrac
max_h_level = 4
[./Indicators]
[./error]
type = GradientJumpIndicator
variable = bnds
[../]
[../]
[./Markers]
[./bound_adapt]
type = ValueThresholdMarker
third_state = DO_NOTHING
coarsen = 1.0
refine = 0.99
variable = bnds
invert = true
[../]
[./errorfrac]
type = ErrorFractionMarker
coarsen = 0.1
indicator = error
refine = 0.7
[../]
[../]
[]
[Outputs]
exodus = true
csv = true
[./console]
type = Console
max_rows = 20
[../]
[]
(test/tests/outputs/output_interface/indicator.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Adaptivity]
[./Indicators]
[./indicator_0]
type = GradientJumpIndicator
variable = u
outputs = indicators
[../]
[./indicator_1]
type = GradientJumpIndicator
variable = u
outputs = indicators
[../]
[../]
[]
[Outputs]
[./indicators]
type = Exodus
[../]
[./no_indicators]
type = Exodus
[../]
[]
(test/tests/userobjects/element_subdomain_modifier/adaptivity_moving_boundary_3d.i)
[Problem]
solve = false
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 3
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 10
ny = 10
nz = 6
[]
[left]
type = SubdomainBoundingBoxGenerator
input = 'gen'
block_id = 1
bottom_left = '-1 -1 0'
top_right = '0 1 1'
[]
[right]
type = SubdomainBoundingBoxGenerator
input = 'left'
block_id = 2
bottom_left = '0 -1 0'
top_right = '1 1 1'
[]
[moving_boundary]
type = SideSetsAroundSubdomainGenerator
input = 'right'
block = 1
new_boundary = 'moving_boundary'
normal = '1 0 0'
[]
[]
[UserObjects]
[moving_circle]
type = CoupledVarThresholdElementSubdomainModifier
coupled_var = 'phi'
block = 2
criterion_type = ABOVE
threshold = 0.5
subdomain_id = 1
moving_boundary_name = moving_boundary
execute_on = 'TIMESTEP_BEGIN'
[]
[]
[Functions]
[moving_gauss]
type = ParsedFunction
value = 'exp(-((x+0.5-t)^2+(y)^2)/0.25)'
[]
[]
[AuxVariables]
[phi]
[]
[]
[AuxKernels]
[phi]
type = FunctionAux
variable = phi
function = moving_gauss
execute_on = 'INITIAL TIMESTEP_BEGIN TIMESTEP_END'
[]
[]
[Adaptivity]
steps = 1
marker = marker
initial_marker = marker
max_h_level = 1
[Indicators/indicator]
type = GradientJumpIndicator
variable = phi
[]
[Markers]
[efm]
type = ErrorFractionMarker
indicator = indicator
coarsen = 0.2
refine = 0.5
[]
[marker]
type = BoundaryPreservedMarker
preserved_boundary = moving_boundary
marker = 'efm'
[]
[]
[]
[Executioner]
type = Transient
dt = 0.1
num_steps = 5
[]
[Outputs]
exodus = true
[]
(test/tests/userobjects/element_subdomain_modifier/amr_bc.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 16
ny = 16
[]
[left]
type = SubdomainBoundingBoxGenerator
input = 'gen'
block_id = 1
bottom_left = '-1 -1 0'
top_right = '0 1 1'
[]
[right]
type = SubdomainBoundingBoxGenerator
input = 'left'
block_id = 2
bottom_left = '0 -1 0'
top_right = '1 1 1'
[]
[moving_boundary]
type = SideSetsAroundSubdomainGenerator
input = 'right'
block = 1
new_boundary = 'moving_boundary'
normal = '1 0 0'
[]
[]
[UserObjects]
[moving_circle]
type = CoupledVarThresholdElementSubdomainModifier
coupled_var = 'phi'
block = 2
criterion_type = ABOVE
threshold = 0.5
subdomain_id = 1
moving_boundary_name = moving_boundary
execute_on = 'TIMESTEP_BEGIN'
[]
[]
[Functions]
[moving_gauss]
type = ParsedFunction
value = 'exp(-((x+0.5-t)^2+(y)^2)/0.25)'
[]
[]
[AuxVariables]
[phi]
[]
[]
[AuxKernels]
[phi]
type = FunctionAux
variable = phi
function = moving_gauss
execute_on = 'INITIAL TIMESTEP_BEGIN TIMESTEP_END'
[]
[]
[Adaptivity]
steps = 1
marker = marker
initial_marker = marker
max_h_level = 1
[Indicators/indicator]
type = GradientJumpIndicator
variable = phi
[]
[Markers]
[efm]
type = ErrorFractionMarker
indicator = indicator
coarsen = 0.2
refine = 0.5
[]
[marker]
type = BoundaryPreservedMarker
preserved_boundary = moving_boundary
marker = 'efm'
[]
[]
[]
[Variables]
[u][]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[]
[BCs]
active = 'mbc leftright'
[mbc]
type = DirichletBC
variable = u
boundary = moving_boundary
value = 1
[]
[nbc]
type = NeumannBC
variable = u
boundary = moving_boundary
value = 10
[]
[leftright]
type = DirichletBC
variable = u
boundary = 'left right'
value = 0
[]
[]
[Executioner]
type = Transient
dt = 0.1
num_steps = 5
[]
[Outputs]
exodus = true
[]
(tutorials/darcy_thermo_mech/step07_adaptivity/problems/step7c_adapt.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 30
ny = 3
xmax = 0.304 # Length of test chamber
ymax = 0.0257 # Test chamber radius
[]
coord_type = RZ
rz_coord_axis = X
uniform_refine = 3
[]
[Variables]
[pressure]
[]
[temperature]
initial_condition = 300 # Start at room temperature
[]
[]
[AuxVariables]
[velocity]
order = CONSTANT
family = MONOMIAL_VEC
[]
[]
[Kernels]
[darcy_pressure]
type = DarcyPressure
variable = pressure
[]
[heat_conduction]
type = ADHeatConduction
variable = temperature
[]
[heat_conduction_time_derivative]
type = ADHeatConductionTimeDerivative
variable = temperature
[]
[heat_convection]
type = DarcyAdvection
variable = temperature
pressure = pressure
[]
[]
[AuxKernels]
[velocity]
type = DarcyVelocity
variable = velocity
execute_on = timestep_end
pressure = pressure
[]
[]
[BCs]
[inlet]
type = DirichletBC
variable = pressure
boundary = left
value = 4000 # (Pa) From Figure 2 from paper. First data point for 1mm spheres.
[]
[outlet]
type = DirichletBC
variable = pressure
boundary = right
value = 0 # (Pa) Gives the correct pressure drop from Figure 2 for 1mm spheres
[]
[inlet_temperature]
type = FunctionDirichletBC
variable = temperature
boundary = left
function = 'if(t<0,350+50*t,350)'
[]
[outlet_temperature]
type = HeatConductionOutflow
variable = temperature
boundary = right
[]
[]
[Materials]
[column]
type = PackedColumn
radius = 1
temperature = temperature
[]
[]
[Problem]
type = FEProblem
[]
[Executioner]
type = Transient
solve_type = NEWTON
automatic_scaling = true
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
end_time = 100
dt = 0.25
start_time = -1
steady_state_tolerance = 1e-5
steady_state_detection = true
[TimeStepper]
type = FunctionDT
function = 'if(t<0,0.1,0.25)'
[]
[]
[Outputs]
exodus = true
[]
[Adaptivity]
marker = error_frac
max_h_level = 3
[Indicators]
[temperature_jump]
type = GradientJumpIndicator
variable = temperature
scale_by_flux_faces = true
[]
[]
[Markers]
[error_frac]
type = ErrorFractionMarker
coarsen = 0.15
indicator = temperature_jump
refine = 0.7
[]
[]
[]