- variableThe name of the variable that this residual object operates on
C++ Type:NonlinearVariableName
Controllable:No
Description:The name of the variable that this residual object operates on
NullKernel
Kernel that sets a zero residual.
This kernel can be used as a placeholder if a nonlinear variable was added to the simulation but the kernels for that variable have not yet been created / added to the input file. This kernel will ensure that the kernel coverage checking of the domain does not flag the variable as problematic. It will also ensure that the system matrix remains invertible as it contributes a small number times the identity matrix to the Jacobian for the variable it applies to.
Alternatives
Ideally, the non-linear variable should be moved to be an auxiliary variable. This will reduce the size of the nonlinear system, making it easier to solve.
The kernel block coverage checking of the domain can also be turned off by setting
kernel_coverage_check=false
in the[Problem]
block.A time derivative kernel can be used for a non-linear variable with the missing physics kernels, as this describes a valid equation .
This kernel should mainly be used for creating small tests and while debugging simulations.
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
- displacementsThe displacements
C++ Type:std::vector<VariableName>
Controllable:No
Description:The displacements
- jacobian_fill1e-09On diagonal Jacobian fill term to retain an invertible matrix for the preconditioner
Default:1e-09
C++ Type:double
Controllable:No
Description:On diagonal Jacobian fill term to retain an invertible matrix for the preconditioner
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Default:False
C++ Type:bool
Controllable:No
Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Optional Parameters
- absolute_value_vector_tagsThe tags for the vectors this residual object should fill with the absolute value of the residual contribution
C++ Type:std::vector<TagName>
Controllable:No
Description:The tags for the vectors this residual object should fill with the absolute value of the residual contribution
- extra_matrix_tagsThe extra tags for the matrices this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the matrices this Kernel should fill
- extra_vector_tagsThe extra tags for the vectors this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the vectors this Kernel should fill
- matrix_tagssystemThe tag for the matrices this Kernel should fill
Default:system
C++ Type:MultiMooseEnum
Options:nontime, system
Controllable:No
Description:The tag for the matrices this Kernel should fill
- vector_tagsnontimeThe tag for the vectors this Kernel should fill
Default:nontime
C++ Type:MultiMooseEnum
Options:nontime, time
Controllable:No
Description:The tag for the vectors this Kernel should fill
Tagging Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- diag_save_inThe name of auxiliary variables to save this Kernel's diagonal Jacobian contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
C++ Type:std::vector<AuxVariableName>
Controllable:No
Description:The name of auxiliary variables to save this Kernel's diagonal Jacobian contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- implicitTrueDetermines whether this object is calculated using an implicit or explicit form
Default:True
C++ Type:bool
Controllable:No
Description:Determines whether this object is calculated using an implicit or explicit form
- save_inThe name of auxiliary variables to save this Kernel's residual contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
C++ Type:std::vector<AuxVariableName>
Controllable:No
Description:The name of auxiliary variables to save this Kernel's residual contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
- seed0The seed for the master random number generator
Default:0
C++ Type:unsigned int
Controllable:No
Description:The seed for the master random number generator
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Advanced Parameters
Input Files
- (modules/optimization/test/tests/optimizationreporter/optimization_reporter_base/optRep_fromCsv_groupBounds.i)
- (test/tests/meshgenerators/file_mesh_generator/3d_steady_diffusion_iga.i)
- (modules/porous_flow/test/tests/jacobian/basic_advection2.i)
- (modules/functional_expansion_tools/examples/1D_volumetric_Cartesian/sub.i)
- (test/tests/batch_property_derivative/test.i)
- (modules/porous_flow/test/tests/jacobian/basic_advection4.i)
- (test/tests/meshgenerators/file_mesh_generator/2d_diffusion_iga.i)
- (modules/porous_flow/test/tests/jacobian/basic_advection5.i)
- (modules/functional_expansion_tools/examples/3D_volumetric_Cartesian_direct/sub.i)
- (test/tests/meshgenerators/file_mesh_generator/2d_discontinuous_iga.i)
- (modules/optimization/test/tests/optimizationreporter/parameter_mesh_base/paramMeshOptRep.i)
- (modules/porous_flow/test/tests/jacobian/basic_advection3.i)
- (modules/optimization/test/tests/vectorpostprocessors/adjoint_strain_batch_stress_grad_inner_product/strain_stress_grad_inner_product.i)
- (modules/functional_expansion_tools/examples/3D_volumetric_Cartesian/sub.i)
- (modules/functional_expansion_tools/test/tests/errors/multiapp_sub.i)
- (modules/functional_expansion_tools/test/tests/standard_use/volume_sub.i)
- (modules/optimization/test/tests/optimizationreporter/parameter_mesh_base/twoParamMeshOptRep.i)
- (modules/porous_flow/examples/co2_intercomparison/1Dradial/properties.i)
- (modules/optimization/test/tests/optimizationreporter/optimization_reporter_base/optRep_fromCsv_mixBounds.i)
- (test/tests/meshgenerators/file_mesh_generator/exact_discontinuous_iga.i)
- (modules/functional_expansion_tools/examples/3D_volumetric_cylindrical_subapp_mesh_refine/sub.i)
- (modules/optimization/test/tests/optimizationreporter/optimization_reporter_base/optRep_fromCsv_paramBounds.i)
- (test/tests/meshgenerators/file_mesh_generator/1d_discontinuous_iga.i)
- (modules/solid_mechanics/test/tests/lagrangian/action/homogenization_block.i)
- (modules/functional_expansion_tools/test/tests/standard_use/volume_coupling_custom_norm_sub.i)
- (modules/functional_expansion_tools/examples/2D_volumetric_Cartesian/sub.i)
- (modules/combined/test/tests/additive_manufacturing/check_stateful_properties.i)
- (modules/functional_expansion_tools/examples/3D_volumetric_Cartesian_different_submesh/sub.i)
- (modules/phase_field/test/tests/misc/equal_gradient_lagrange.i)
- (modules/functional_expansion_tools/examples/3D_volumetric_cylindrical/sub.i)
- (modules/functional_expansion_tools/test/tests/standard_use/multiapp_sub.i)
- (modules/optimization/test/tests/optimizationreporter/optimization_reporter_base/optRep_fromInput.i)
- (test/tests/meshgenerators/file_mesh_generator/2d_discontinuous_iga_l2.i)
- (modules/porous_flow/test/tests/jacobian/basic_advection6.i)
Child Objects
(modules/optimization/test/tests/optimizationreporter/optimization_reporter_base/optRep_fromCsv_groupBounds.i)
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Variables]
[u]
[]
[]
[Kernels]
[null]
type = NullKernel
variable = u
[]
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'p1 p2 p3'
num_values = '2 4 6'
initial_condition = '1; 3; 7'
upper_bounds = '110; 210; 310'
lower_bounds = '-1; -2; -3'
measurement_file = 'measurementData.csv'
file_xcoord = 'coordx'
file_ycoord ='y'
file_zcoord = 'z'
file_value = 'measured_value'
outputs = out
[]
[UserObjects]
[optReporterTester]
type = OptimizationReporterTest
values_to_set_parameters_to = '10 20 30 40 50 60 70 80 90 100 110 120'
values_to_set_simulation_measurements_to = '111 212 313 314'
expected_objective_value = 115000
expected_lower_bounds = '-1 -1 -2 -2 -2 -2 -3 -3 -3 -3 -3 -3'
expected_upper_bounds = '110 110 210 210 210 210 310 310 310 310 310 310'
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
[out]
type = JSON
execute_system_information_on = none
[]
[]
(test/tests/meshgenerators/file_mesh_generator/3d_steady_diffusion_iga.i)
[Mesh]
[cyl2d_iga]
type = FileMeshGenerator
file = Cube_With_Sidesets.e
[]
allow_renumbering = false # VTK diffs via XMLDiff are
parallel_type = replicated # really fragile
[]
[Variables]
[u]
order = SECOND # Must match mesh order
family = RATIONAL_BERNSTEIN
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
block = 0 # Avoid direct calculations on spline nodes
[]
[null]
type = NullKernel
variable = u
block = 1 # Keep kernel coverage check happy
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = 3
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = 1
value = 1
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
vtk = true
[]
(modules/porous_flow/test/tests/jacobian/basic_advection2.i)
# Basic advection with 1 porepressure as a PorousFlow variable
# Fully saturated
# Constant permeability
# Constant viscosity
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Variables]
[u]
[]
[P]
[]
[]
[ICs]
[P]
type = RandomIC
variable = P
[]
[u]
type = RandomIC
variable = u
[]
[]
[Kernels]
[dummy_P]
type = NullKernel
variable = P
[]
[u_advection]
type = PorousFlowBasicAdvection
variable = u
phase = 0
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = P
number_fluid_phases = 1
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureVG
alpha = 1
m = 0.6
sat_lr = 0.1
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 3
density0 = 4
thermal_expansion = 0
viscosity = 150.0
[]
[]
[Materials]
[temperature_qp]
type = PorousFlowTemperature
[]
[ppss_qp]
type = PorousFlow1PhaseP
porepressure = P
capillary_pressure = pc
[]
[simple_fluid_qp]
type = PorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '5 0 0 0 5 0 0 0 5'
[]
[relperm_qp]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
s_res = 0.1
sum_s_res = 0.1
[]
[darcy_velocity_qp]
type = PorousFlowDarcyVelocityMaterial
gravity = '0.25 0 0'
[]
[]
[Preconditioning]
[check]
type = SMP
full = true
#petsc_options = '-snes_test_display'
petsc_options_iname = '-snes_type'
petsc_options_value = ' test'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 1
[]
(modules/functional_expansion_tools/examples/1D_volumetric_Cartesian/sub.i)
# Basic example coupling a master and sub app in a 1D Cartesian volume.
#
# The master app provides field values to the sub app via Functional Expansions, which then performs
# its calculations. The sub app's solution field values are then transferred back to the master app
# and coupled into the solution of the master app solution.
#
# This example couples Functional Expansions via AuxVariable.
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
# 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 = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
[../]
[]
[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'
[]
(test/tests/batch_property_derivative/test.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 100
ny = 100
[]
[]
[Variables]
[v]
[]
[]
[Kernels]
[null]
type = NullKernel
variable = v
[]
[]
[UserObjects]
[batch_deriv]
type = BatchPropertyDerivativeRankTwoTensorReal
material_property = number
[]
[batch]
type = BatchPropertyDerivativeTest
batch_deriv_uo = batch_deriv
prop = tensor
execute_on = 'LINEAR'
[]
[]
[Materials]
[prop1]
type = GenericConstantRankTwoTensor
tensor_name = tensor
tensor_values = '1 2 3 4 5 6 7 8 9'
[]
[prop2]
type = GenericFunctionMaterial
prop_names = number
prop_values = 'x^2+sin(y*3)+cos(t*10)'
[]
[test]
type = BatchTestPropertyDerivative
prop = tensor
batch_uo = batch
[]
[]
[Postprocessors]
[average]
type = ElementAverageMaterialProperty
mat_prop = batch_out
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
(modules/porous_flow/test/tests/jacobian/basic_advection4.i)
# Basic advection with 1 porepressure and temperature as PorousFlow variables
# Constant permeability
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Variables]
[u]
[]
[T]
[]
[P]
[]
[]
[ICs]
[P]
type = RandomIC
variable = P
min = 2E5
max = 4E5
[]
[T]
type = RandomIC
variable = T
min = 300
max = 900
[]
[u]
type = RandomIC
variable = u
[]
[]
[Kernels]
[dummy_T]
type = NullKernel
variable = T
[]
[dummy_P]
type = NullKernel
variable = P
[]
[u_advection]
type = PorousFlowBasicAdvection
variable = u
phase = 0
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'P T'
number_fluid_phases = 1
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureVG
alpha = 1E-5
m = 0.6
sat_lr = 0.1
[]
[]
[FluidProperties]
[methane]
type = MethaneFluidProperties
[]
[]
[Materials]
[temperature_qp]
type = PorousFlowTemperature
temperature = T
[]
[ppss_qp]
type = PorousFlow1PhaseP
porepressure = P
capillary_pressure = pc
[]
[fluid_qp]
type = PorousFlowSingleComponentFluid
fp = methane
phase = 0
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '5 0 0 0 5 0 0 0 5'
[]
[relperm_qp]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
s_res = 0.1
sum_s_res = 0.1
[]
[darcy_velocity_qp]
type = PorousFlowDarcyVelocityMaterial
gravity = '0.25 0 0'
[]
[]
[Preconditioning]
[check]
type = SMP
full = true
#petsc_options = '-snes_test_display'
petsc_options_iname = '-snes_type'
petsc_options_value = ' test'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 1
[]
(test/tests/meshgenerators/file_mesh_generator/2d_diffusion_iga.i)
[Mesh]
[cyl2d_iga]
type = FileMeshGenerator
file = PressurizedCyl_Patch6_4Elem.e
[]
allow_renumbering = false # VTK diffs via XMLDiff are
parallel_type = replicated # really fragile
[]
[Variables]
[u]
order = SECOND # Must match mesh order
family = RATIONAL_BERNSTEIN
[]
[]
[Kernels]
[time]
type = TimeDerivative
variable = u
block = 0 # Avoid direct calculations on spline nodes
[]
[diff]
type = Diffusion
variable = u
block = 0 # Avoid direct calculations on spline nodes
[]
[null]
type = NullKernel
variable = u
block = 1 # Keep kernel coverage check happy
[]
[]
[ICs]
[u]
type = FunctionIC
variable = u
function = 'sin(x)'
[]
[]
[Executioner]
type = Transient
num_steps = 2
solve_type = NEWTON
dtmin = 1
[]
[Outputs]
vtk = true
[]
(modules/porous_flow/test/tests/jacobian/basic_advection5.i)
# Basic advection with 1 porepressure as a PorousFlow variable
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Variables]
[u]
[]
[P]
[]
[]
[ICs]
[P]
type = RandomIC
variable = P
min = -1
max = 1
[]
[u]
type = RandomIC
variable = u
[]
[]
[Kernels]
[dummy_P]
type = NullKernel
variable = P
[]
[u_advection]
type = PorousFlowBasicAdvection
variable = u
phase = 0
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = P
number_fluid_phases = 1
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureVG
alpha = 1
m = 0.6
sat_lr = 0.1
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 3
density0 = 4
thermal_expansion = 0
viscosity = 150.0
[]
[]
[Materials]
[temperature_qp]
type = PorousFlowTemperature
[]
[ppss_qp]
type = PorousFlow1PhaseP
porepressure = P
capillary_pressure = pc
[]
[simple_fluid_qp]
type = PorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[effective_fluid_pressure]
type = PorousFlowEffectiveFluidPressure
[]
[porosity]
type = PorousFlowPorosity
porosity_zero = 0.1
fluid = true
biot_coefficient = 0.5
solid_bulk = 1
[]
[permeability]
type = PorousFlowPermeabilityKozenyCarman
poroperm_function = kozeny_carman_phi0
k0 = 5
m = 2
n = 2
phi0 = 0.1
[]
[relperm_qp]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
[]
[darcy_velocity_qp]
type = PorousFlowDarcyVelocityMaterial
gravity = '0.25 0 0'
[]
[]
[Preconditioning]
[check]
type = SMP
full = true
#petsc_options = '-snes_test_display'
petsc_options_iname = '-snes_type'
petsc_options_value = ' test'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 1
[]
(modules/functional_expansion_tools/examples/3D_volumetric_Cartesian_direct/sub.i)
# Derived from the example '3D_volumetric_Cartesian' with the following differences:
#
# 1) The coupling is performed via BodyForce instead of the
# FunctionSeriesToAux+CoupledForce approach
[Mesh]
type = GeneratedMesh
dim = 3
xmin = 0.0
xmax = 10.0
nx = 15
ymin = 1.0
ymax = 11.0
ny = 25
zmin = 2.0
zmax = 12.0
nz = 35
[]
# 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 = Cartesian
orders = '3 4 5'
physical_bounds = '0.0 10.0 1.0 11.0 2.0 12.0'
x = Legendre
y = Legendre
z = Legendre
[../]
[]
[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'
[]
(test/tests/meshgenerators/file_mesh_generator/2d_discontinuous_iga.i)
[Mesh]
[cyl2d_iga]
type = FileMeshGenerator
file = PressurizedCyl_Patch6_4Elem.e
discontinuous_spline_extraction = true
[]
[]
[Variables]
[u]
order = SECOND # Must match mesh order
family = RATIONAL_BERNSTEIN
[]
[]
[Kernels]
[time]
type = TimeDerivative
variable = u
block = 0 # Avoid direct calculations on spline nodes
[]
[diff]
type = Diffusion
variable = u
block = 0 # Avoid direct calculations on spline nodes
[]
[null]
type = NullKernel
variable = u
block = 1 # Keep kernel coverage check happy
[]
[]
[ICs]
[u]
type = FunctionIC
variable = u
function = 'sin(x)'
[]
[]
[Executioner]
type = Transient
num_steps = 2
solve_type = NEWTON
dtmin = 1
[]
[Outputs]
exodus = true
[]
(modules/optimization/test/tests/optimizationreporter/parameter_mesh_base/paramMeshOptRep.i)
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Variables]
[u]
[]
[]
[Kernels]
[null]
type = NullKernel
variable = u
[]
[]
[OptimizationReporter]
type = ParameterMeshOptimization
parameter_names = 'parameter'
parameter_families = 'LAGRANGE'
parameter_orders = 'FIRST'
parameter_meshes = parameter_mesh_boundsIC_out.e
measurement_points = '0.1 0.2 0.3
0.4 0.5 0.6
0.7 0.8 0.9
1.0 1.1 1.2'
measurement_values = '11 12 13 14'
outputs = outjson
[]
[UserObjects]
[optReporterTester]
type = OptimizationReporterTest
values_to_set_parameters_to = '10 20 30 40 50 60 0 0 0 0 0 0 0 0 0 0 0 0'
values_to_set_simulation_measurements_to = '111 212 313 314'
expected_objective_value = 115000
expected_lower_bounds = '0 0.5 0.5 0 1 1 0 1 1 0 2 2 0 1.5 1.5 0 3 3'
expected_upper_bounds = '2 2.5 2.5 2 3 3 2 3 3 2 4 4 2 3.5 3.5 2 5 5'
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
[outjson]
type = JSON
execute_system_information_on = none
[]
[]
(modules/porous_flow/test/tests/jacobian/basic_advection3.i)
# Basic advection with 1 porepressure as a PorousFlow variable
# Constant permeability
# Constant viscosity
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Variables]
[u]
[]
[P]
[]
[]
[ICs]
[P]
type = RandomIC
variable = P
min = -1
max = 0
[]
[u]
type = RandomIC
variable = u
[]
[]
[Kernels]
[dummy_P]
type = NullKernel
variable = P
[]
[u_advection]
type = PorousFlowBasicAdvection
variable = u
phase = 0
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = P
number_fluid_phases = 1
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureVG
alpha = 1
m = 0.6
sat_lr = 0.1
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 3
density0 = 4
thermal_expansion = 0
viscosity = 150.0
[]
[]
[Materials]
[temperature_qp]
type = PorousFlowTemperature
[]
[ppss_qp]
type = PorousFlow1PhaseP
porepressure = P
capillary_pressure = pc
[]
[simple_fluid_qp]
type = PorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '5 0 0 0 5 0 0 0 5'
[]
[relperm_qp]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
s_res = 0.1
sum_s_res = 0.1
[]
[darcy_velocity_qp]
type = PorousFlowDarcyVelocityMaterial
gravity = '0.25 0 0'
[]
[]
[Preconditioning]
[check]
type = SMP
full = true
#petsc_options = '-snes_test_display'
petsc_options_iname = '-snes_type'
petsc_options_value = ' test'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 1
[]
(modules/optimization/test/tests/vectorpostprocessors/adjoint_strain_batch_stress_grad_inner_product/strain_stress_grad_inner_product.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 4
ny = 4
[]
[]
[Variables]
[v]
initial_condition = 1
[]
[]
[Kernels]
[null]
type = NullKernel
variable = v
[]
[]
[UserObjects]
[batch_deriv]
type = BatchPropertyDerivativeRankTwoTensorReal
material_property = number
[]
# assign value using the following object
[batch]
type = OptimizationBatchPropertyDerivativeTest
batch_deriv_uo = batch_deriv
prop = tensor
execute_on = 'LINEAR'
[]
[]
[Materials]
[prop1]
type = GenericConstantRankTwoTensor
tensor_name = tensor
tensor_values = '1 2 3 4 5 6 7 8 9'
[]
[prop2]
type = GenericFunctionMaterial
prop_names = number
prop_values = '1.0'
[]
[prop3]
type = GenericConstantRankTwoTensor
tensor_name = dummy_strain
tensor_values = '10 11 12 13 14 15 16 17 18'
[]
[]
[Functions]
[fcn]
type = NearestReporterCoordinatesFunction
x_coord_name = param/coordx
y_coord_name = param/coordy
value_name = param/value
[]
[]
[Reporters]
[param]
type = ConstantReporter
real_vector_names = 'coordx coordy value'
real_vector_values = '0 0.5 1; 0 0.5 1; 1.0 2.0 3.0'
outputs = none
[]
[]
[VectorPostprocessors]
[inner_product]
type = AdjointStrainBatchStressGradInnerProduct
adjoint_strain_name = dummy_strain
stress_derivative = batch_deriv
function = fcn
variable = v
[]
[]
[Executioner]
type = Transient
dt = 0.1
end_time = 1
[]
[Outputs]
csv = true
execute_on = final
[]
(modules/functional_expansion_tools/examples/3D_volumetric_Cartesian/sub.i)
# Basic example coupling a master and sub app in a 3D Cartesian volume.
#
# The master app provides field values to the sub app via Functional Expansions, which then performs
# its calculations. The sub app's solution field values are then transferred back to the master app
# and coupled into the solution of the master app solution.
#
# This example couples Functional Expansions via AuxVariable.
#
# Note: this problem is not light, and may take a few minutes to solve.
[Mesh]
type = GeneratedMesh
dim = 3
xmin = 0.0
xmax = 10.0
nx = 15
ymin = 1.0
ymax = 11.0
ny = 25
zmin = 2.0
zmax = 12.0
nz = 35
[]
# 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 = Cartesian
orders = '3 4 5'
physical_bounds = '0.0 10.0 1.0 11.0 2.0 12.0'
x = Legendre
y = Legendre
z = Legendre
[../]
[]
[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'
[]
(modules/functional_expansion_tools/test/tests/errors/multiapp_sub.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s]
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
[../]
[]
[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'
[]
(modules/functional_expansion_tools/test/tests/standard_use/volume_sub.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s]
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
[../]
[]
[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'
[]
(modules/optimization/test/tests/optimizationreporter/parameter_mesh_base/twoParamMeshOptRep.i)
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Variables]
[u]
[]
[]
[Kernels]
[null]
type = NullKernel
variable = u
[]
[]
[OptimizationReporter]
type = ParameterMeshOptimization
parameter_names = 'parameter1 parameter2'
parameter_meshes = 'parameter_mesh_boundsIC_out.e parameter_mesh_boundsIC_out.e'
parameter_families = 'LAGRANGE MONOMIAL'
parameter_orders = 'FIRST CONSTANT'
num_parameter_times=1
measurement_points = '0.1 0.2 0.3
0.4 0.5 0.6
0.7 0.8 0.9
1.0 1.1 1.2'
measurement_values = '11 12 13 14'
outputs = outjson
[]
[UserObjects]
[optReporterTester]
type = OptimizationReporterTest
values_to_set_parameters_to = '10 20 30 40 50 60 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0'
values_to_set_simulation_measurements_to = '111 212 313 314'
expected_objective_value = 115000
expected_lower_bounds = '0 0.5 0.5 0 1 1 0 1 1 0 2 2 0 1.5 1.5 0 3 3 0.25 0.75 0.5 1.5 0.75 2.25'
expected_upper_bounds = '2 2.5 2.5 2 3 3 2 3 3 2 4 4 2 3.5 3.5 2 5 5 2.25 2.75 2.5 3.5 2.75 4.25'
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
[outjson]
type = JSON
execute_system_information_on = none
[]
[]
(modules/porous_flow/examples/co2_intercomparison/1Dradial/properties.i)
# Liquid and gas properties for code intercomparison problem 3
#
# From Pruess et al, Code intercomparison builds confidence in
# numerical simulation models for geologic disposal of CO2, Energy 29 (2004)
#
# This test simply calculates density and viscosity of each phase for
# various pressures and salinities, as well as mass fractions of CO2 in the
# liquid phase and H2O in the gas phase.
#
# Four versions of this are run:
# 1) No CO2, 0 salt mass fraction (pure water)
# 2) Enough CO2 to form gas phase, 0 salt mass fraction (pure water)
# 3) No CO2, 0.15 salt mass fraction
# 4) Enough CO2 to form gas phase, 0.15 salt mass fraction
#
# These results compare well with detailed results presented in Pruess et al,
# Intercomparison of numerical simulation codes for geologic disposal of CO2,
# LBNL-51813 (2002)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
xmax = 4
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[AuxVariables]
[density_liquid]
order = CONSTANT
family = MONOMIAL
[]
[density_gas]
order = CONSTANT
family = MONOMIAL
[]
[viscosity_liquid]
order = CONSTANT
family = MONOMIAL
[]
[viscosity_gas]
order = CONSTANT
family = MONOMIAL
[]
[x1]
order = CONSTANT
family = MONOMIAL
[]
[y0]
order = CONSTANT
family = MONOMIAL
[]
[xnacl]
initial_condition = 0.0
[]
[]
[AuxKernels]
[density_liquid]
type = PorousFlowPropertyAux
variable = density_liquid
property = density
phase = 0
execute_on = timestep_end
[]
[density_gas]
type = PorousFlowPropertyAux
variable = density_gas
property = density
phase = 1
execute_on = timestep_end
[]
[viscosity_liquid]
type = PorousFlowPropertyAux
variable = viscosity_liquid
property = viscosity
phase = 0
execute_on = timestep_end
[]
[viscosity_gas]
type = PorousFlowPropertyAux
variable = viscosity_gas
property = viscosity
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]
order = CONSTANT
family = MONOMIAL
[]
[zi]
initial_condition = 0.0
[]
[]
[Functions]
[pic]
type = ParsedFunction
expression = 'if(x<1,12e6,if(x<2,16e6,if(x<3,20e6,24e6)))'
[]
[]
[ICs]
[pic]
type = FunctionIC
function = pic
variable = pgas
[]
[]
[Kernels]
[diffusionp]
type = NullKernel
variable = pgas
[]
[diffusionz]
type = NullKernel
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 = PorousFlowBrineCO2
brine_fp = brine
co2_fp = co2
capillary_pressure = pc
[]
[]
[FluidProperties]
[co2]
type = CO2FluidProperties
[]
[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
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
petsc_options_value = 'gmres asm lu NONZERO 2 '
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
perf_graph = true
csv = true
execute_on = timestep_end
file_base = properties_water
[]
[VectorPostprocessors]
[vpp]
type = ElementValueSampler
variable = 'pgas density_liquid density_gas viscosity_liquid viscosity_gas x1 y0'
sort_by = x
[]
[]
(modules/optimization/test/tests/optimizationreporter/optimization_reporter_base/optRep_fromCsv_mixBounds.i)
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Variables]
[u]
[]
[]
[Kernels]
[null]
type = NullKernel
variable = u
[]
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'p1 p2 p3'
num_values = '2 4 6'
initial_condition = '1 2; 3; 7 8 9 10 11 12'
upper_bounds = '101; 103; 107 108 109 110 111 112'
lower_bounds = '-1 -2; -3 -4 -5 -6; -7'
measurement_file = 'measurementData.csv'
file_xcoord = 'coordx'
file_ycoord ='y'
file_zcoord = 'z'
file_value = 'measured_value'
outputs = out
[]
[UserObjects]
[optReporterTester]
type = OptimizationReporterTest
values_to_set_parameters_to = '10 20 30 40 50 60 70 80 90 100 110 120'
values_to_set_simulation_measurements_to = '111 212 313 314'
expected_objective_value = 115000
expected_lower_bounds = '-1 -2 -3 -4 -5 -6 -7 -7 -7 -7 -7 -7'
expected_upper_bounds = '101 101 103 103 103 103 107 108 109 110 111 112'
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
[out]
type = JSON
execute_system_information_on = none
[]
[]
(test/tests/meshgenerators/file_mesh_generator/exact_discontinuous_iga.i)
[Mesh]
[cyl2d_iga]
type = FileMeshGenerator
file = test_quadratic.e
discontinuous_spline_extraction = true
[]
[]
[Variables]
[u]
order = SECOND # Must match mesh order
family = RATIONAL_BERNSTEIN
[]
[]
[ICs]
[u]
type = FunctionIC
variable = u
function = 'x'
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
block = 0 # Avoid direct calculations on spline nodes
[]
[./time]
type = TimeDerivative
variable = u
block = 0
[../]
[null]
type = NullKernel
variable = u
block = 1 # Keep kernel coverage check happy
[]
[]
[Executioner]
type = Transient
num_steps = 1
solve_type = NEWTON
dt = 1
[]
[Outputs]
exodus = true
[]
(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
[]
(modules/optimization/test/tests/optimizationreporter/optimization_reporter_base/optRep_fromCsv_paramBounds.i)
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Variables]
[u]
[]
[]
[Kernels]
[null]
type = NullKernel
variable = u
[]
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'p1 p2 p3'
num_values = '2 4 6'
initial_condition = '1 2; 3 4 5 6; 7 8 9 10 11 12'
upper_bounds = '101 102; 103 104 105 106; 107 108 109 110 111 112'
lower_bounds = '-1 -2; -3 -4 -5 -6; -7 -8 -9 -10 -11 -12'
measurement_file = 'measurementData.csv'
file_xcoord = 'coordx'
file_ycoord ='y'
file_zcoord = 'z'
file_value = 'measured_value'
outputs = out
[]
[UserObjects]
[optReporterTester]
type = OptimizationReporterTest
values_to_set_parameters_to = '10 20 30 40 50 60 70 80 90 100 110 120'
values_to_set_simulation_measurements_to = '111 212 313 314'
expected_objective_value = 115000
expected_lower_bounds = '-1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12'
expected_upper_bounds = '101 102 103 104 105 106 107 108 109 110 111 112'
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
[out]
type = JSON
execute_system_information_on = none
[]
[]
(test/tests/meshgenerators/file_mesh_generator/1d_discontinuous_iga.i)
[Mesh]
[cyl2d_iga]
type = FileMeshGenerator
file = test_2edge.e
discontinuous_spline_extraction = true
[]
[]
[Variables]
[u]
order = SECOND # Must match mesh order
family = RATIONAL_BERNSTEIN
[]
[]
[Kernels]
[time]
type = TimeDerivative
variable = u
block = 0 # Avoid direct calculations on spline nodes
[]
[diff]
type = Diffusion
variable = u
block = 0 # Avoid direct calculations on spline nodes
[]
[null]
type = NullKernel
variable = u
block = 1 # Keep kernel coverage check happy
[]
[]
[ICs]
[u]
type = FunctionIC
variable = u
function = 'sin(x)'
[]
[]
[Executioner]
type = Transient
num_steps = 2
solve_type = NEWTON
dtmin = 1
[]
[Outputs]
exodus = true
[]
(modules/solid_mechanics/test/tests/lagrangian/action/homogenization_block.i)
[Mesh]
use_displaced_mesh = false
[msh]
type = GeneratedMeshGenerator
dim = 3
nx = 4
ny = 4
nz = 4
[]
[A]
type = SubdomainBoundingBoxGenerator
input = msh
bottom_left = '0 0 0'
top_right = '1 1 1'
block_id = 0
block_name = A
[]
[B]
type = SubdomainBoundingBoxGenerator
input = A
bottom_left = '0 0 0'
top_right = '0.25 0.25 0.5'
block_id = 1
block_name = B
[]
[]
[Variables]
[x]
block = 'B'
[]
[]
[Physics]
[SolidMechanics]
[QuasiStatic]
displacements = 'disp_x disp_y disp_z'
[all]
displacements = 'disp_x disp_y disp_z'
strain = FINITE
add_variables = true
new_system = true
formulation = TOTAL
volumetric_locking_correction = true
block = 'A'
constraint_types = 'stress strain strain stress stress strain stress stress strain'
targets = '0 0 0 0 0 0 0 0 0'
[]
[]
[]
[]
[Materials]
[stress]
type = ComputeLagrangianLinearElasticStress
block = 'A'
[]
[C1]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 2e5
poissons_ratio = 0.3
block = 'A'
[]
[]
[Kernels]
[blah]
type = NullKernel
variable = x
[]
[]
[Executioner]
type = Steady
[]
(modules/functional_expansion_tools/test/tests/standard_use/volume_coupling_custom_norm_sub.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s]
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
generation_type = 'sqrt_mu'
expansion_type = 'sqrt_mu'
[../]
[]
[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'
[]
(modules/functional_expansion_tools/examples/2D_volumetric_Cartesian/sub.i)
# Basic example coupling a master and sub app in a 2D Cartesian volume.
#
# The master app provides field values to the sub app via Functional Expansions, which then performs
# its calculations. The sub app's solution field values are then transferred back to the master app
# and coupled into the solution of the master app solution.
#
# This example couples Functional Expansions via AuxVariable.
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0.0
xmax = 10.0
nx = 15
ymin = 1.0
ymax = 11.0
ny = 25
[]
# 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 = Cartesian
orders = '3 4'
physical_bounds = '0.0 10.0 1.0 11.0'
x = Legendre
y = Legendre
[../]
[]
[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'
[]
(modules/combined/test/tests/additive_manufacturing/check_stateful_properties.i)
[Problem]
kernel_coverage_check = false
material_coverage_check = false
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 3
xmin = 0
xmax = 10
ymin = 0
ymax = 10
zmin = 0
zmax = 0.5
nx = 20
ny = 20
nz = 1
[]
[left_domain]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '0 0 0'
top_right = '5 10 0.5'
block_id = 1
[]
[right_domain]
input = left_domain
type = SubdomainBoundingBoxGenerator
bottom_left = '5 0 0'
top_right = '10 10 0.5'
block_id = 2
[]
[sidesets]
input = right_domain
type = SideSetsAroundSubdomainGenerator
normal = '1 0 0'
block = 1
new_boundary = 'moving_interface'
[]
[]
[Variables]
[temp]
initial_condition = 300
block = '1'
[]
[]
# Output aux variables to check if stateful properties
# are initialized properly for newly added elements
[AuxVariables]
[density_aux]
order = CONSTANT
family = MONOMIAL
block = '1'
[]
[specific_heat_aux]
order = CONSTANT
family = MONOMIAL
block = '1'
[]
[thermal_conductivity_aux]
order = CONSTANT
family = MONOMIAL
block = '1'
[]
[]
[Kernels]
[null]
type = NullKernel
variable = temp
jacobian_fill = 1e-5
[]
[]
[AuxKernels]
[density]
type = ADMaterialRealAux
property = density
variable = density_aux
block = 1
[]
[specific_heat]
type = ADMaterialRealAux
property = specific_heat
variable = specific_heat_aux
block = 1
[]
[thermal_conductivity]
type = ADMaterialRealAux
property = thermal_conductivity
variable = thermal_conductivity_aux
block = 1
[]
[]
[Functions]
[fx]
type = ParsedFunction
expression = '5.25'
[]
[fy]
type = ParsedFunction
expression = '2.5*t'
[]
[fz]
type = ParsedFunction
expression = '0.25'
[]
[]
[Materials]
[density]
type = ADDensity
density = 4.43e-6
block = '1'
[]
[heat]
type = ADHeatConductionMaterial
specific_heat = 600
thermal_conductivity = 10e-3
block = '1'
[]
[volumetric_heat]
type = ADGenericConstantMaterial
prop_names = 'volumetric_heat'
prop_values = 100
block = '1'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
automatic_scaling = true
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
line_search = 'none'
l_max_its = 10
nl_max_its = 20
nl_rel_tol = 1e-4
start_time = 0.0
end_time = 1.0
dt = 1e-1
dtmin = 1e-4
[]
[UserObjects]
[activated_elem_uo]
type = ActivateElementsByPath
execute_on = timestep_begin
function_x = fx
function_y = fy
function_z = fz
active_subdomain_id = 1
expand_boundary_name = 'moving_interface'
[]
[]
[Outputs]
exodus = true
[]
(modules/functional_expansion_tools/examples/3D_volumetric_Cartesian_different_submesh/sub.i)
# Derived from the example '3D_volumetric_Cartesian' with the following differences:
#
# 1) The number of x and y divisions in the sub app is not the same as the master app
# 2) The subapp mesh is skewed in x and z
[Mesh]
type = GeneratedMesh
dim = 3
xmin = 0.0
xmax = 10.0
nx = 23
bias_x = 1.2
ymin = 1.0
ymax = 11.0
ny = 33
zmin = 2.0
zmax = 12.0
nz = 35
bias_z = 0.8
[]
# 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 = Cartesian
orders = '3 4 5'
physical_bounds = '0.0 10.0 1.0 11.0 2.0 12.0'
x = Legendre
y = Legendre
z = Legendre
[../]
[]
[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'
[]
(modules/phase_field/test/tests/misc/equal_gradient_lagrange.i)
#
# This test demonstrates an InterfaceKernel set that can enforce the componentwise
# continuity of the gradient of a variable using the Lagrange multiplier method.
#
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 20
ny = 10
ymax = 0.5
[]
[./box1]
type = SubdomainBoundingBoxGenerator
block_id = 1
bottom_left = '0 0 0'
top_right = '0.51 1 0'
input = gen
[../]
[./box2]
type = SubdomainBoundingBoxGenerator
block_id = 2
bottom_left = '0.49 0 0'
top_right = '1 1 0'
input = box1
[../]
[./iface_u]
type = SideSetsBetweenSubdomainsGenerator
primary_block = 1
paired_block = 2
new_boundary = 10
input = box2
[../]
[]
[Variables]
[./u2]
block = 1
[./InitialCondition]
type = FunctionIC
function = 'r:=sqrt((x-0.4)^2+(y-0.5)^2);if(r<0.05,5,1)'
[../]
[../]
[./v2]
block = 2
initial_condition = 0.8
[../]
[./lambda]
[../]
[]
[Kernels]
[./u2_diff]
type = Diffusion
variable = u2
block = 1
[../]
[./u2_dt]
type = TimeDerivative
variable = u2
block = 1
[../]
[./v2_diff]
type = Diffusion
variable = v2
block = 2
[../]
[./v2_dt]
type = TimeDerivative
variable = v2
block = 2
[../]
[./lambda]
type = NullKernel
variable = lambda
[../]
[]
[InterfaceKernels]
[./iface]
type = InterfaceDiffusionBoundaryTerm
boundary = 10
variable = u2
neighbor_var = v2
[../]
[./lambda]
type = EqualGradientLagrangeMultiplier
variable = lambda
boundary = 10
element_var = u2
neighbor_var = v2
component = 0
[../]
[./constraint]
type = EqualGradientLagrangeInterface
boundary = 10
lambda = lambda
variable = u2
neighbor_var = v2
component = 0
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[VectorPostprocessors]
[./uv]
type = LineValueSampler
variable = 'u2 v2'
start_point = '0 0.5 0'
end_point = '1 0.5 0'
sort_by = x
num_points = 100
[../]
[]
[Executioner]
type = Transient
petsc_options_iname = '-pctype -sub_pc_type -sub_pc_factor_shift_type -pc_factor_shift_type'
petsc_options_value = ' asm lu nonzero nonzero'
dt = 0.002
num_steps = 10
[]
[Outputs]
exodus = true
csv = true
hide = lambda
print_linear_residuals = false
[]
(modules/functional_expansion_tools/examples/3D_volumetric_cylindrical/sub.i)
# Basic example coupling a master and sub app in a 3D cylindrical mesh from an input file
#
# The master app provides field values to the sub app via Functional Expansions, which then performs
# its calculations. The sub app's solution field values are then transferred back to the master app
# and coupled into the solution of the master app solution.
#
# This example couples Functional Expansions via AuxVariable, the recommended approach.
#
# Note: this problem is not light, and may take a few minutes to solve.
[Mesh]
type = FileMesh
file = cyl-tet.e
[]
# 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'
[]
(modules/functional_expansion_tools/test/tests/standard_use/multiapp_sub.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s]
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
[../]
[]
[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'
[]
(modules/optimization/test/tests/optimizationreporter/optimization_reporter_base/optRep_fromInput.i)
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Variables]
[u]
[]
[]
[Kernels]
[null]
type = NullKernel
variable = u
[]
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'p1 p2 p3'
num_values = '2 4 6'
initial_condition = '1 2; 3 4 5 6; 7 8 9 10 11 12'
upper_bounds = '110; 210; 310'
lower_bounds = '-1; -2; -3'
measurement_points = '0.1 0.2 0.3
0.4 0.5 0.6
0.7 0.8 0.9
1.0 1.1 1.2'
measurement_values = '11 12 13 14'
outputs = out
[]
[UserObjects]
[optReporterTester]
type = OptimizationReporterTest
values_to_set_parameters_to = '10 20 30 40 50 60 70 80 90 100 110 120'
values_to_set_simulation_measurements_to = '111 212 313 314'
expected_objective_value = 115000
expected_lower_bounds = '-1 -1 -2 -2 -2 -2 -3 -3 -3 -3 -3 -3'
expected_upper_bounds = '110 110 210 210 210 210 310 310 310 310 310 310'
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
[out]
type = JSON
execute_system_information_on = none
[]
[]
(test/tests/meshgenerators/file_mesh_generator/2d_discontinuous_iga_l2.i)
[Mesh]
[cyl2d_iga]
type = FileMeshGenerator
file = PressurizedCyl_Patch6_4Elem.e
discontinuous_spline_extraction = true
[]
[]
[Variables]
[u]
order = SECOND # Must match mesh order
family = RATIONAL_BERNSTEIN
[]
[]
[Kernels]
[time]
type = TimeDerivative
variable = u
block = 0 # Avoid direct calculations on spline nodes
[]
[rxn]
type = Reaction
variable = u
rate = -0.1
block = 0 # Avoid direct calculations on spline nodes
[]
[null]
type = NullKernel
variable = u
block = 1 # Keep kernel coverage check happy
[]
[]
[ICs]
[u]
type = FunctionIC
variable = u
function = '1.0'
[]
[]
[Executioner]
type = Transient
num_steps = 2
solve_type = NEWTON
dtmin = 1
[]
[Outputs]
exodus = true
[]
(modules/porous_flow/test/tests/jacobian/basic_advection6.i)
# Basic advection with 2 porepressure as PorousFlow variables
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Variables]
[u]
[]
[P0]
[]
[P1]
[]
[]
[ICs]
[P0]
type = RandomIC
variable = P0
min = -1
max = 0
[]
[P1]
type = RandomIC
variable = P1
min = 0
max = 1
[]
[u]
type = RandomIC
variable = u
[]
[]
[Kernels]
[dummy_P0]
type = NullKernel
variable = P0
[]
[dummy_P1]
type = NullKernel
variable = P1
[]
[u_advection]
type = PorousFlowBasicAdvection
variable = u
phase = 0
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'P0 P1'
number_fluid_phases = 2
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureVG
alpha = 1
m = 0.6
sat_lr = 0.1
[]
[]
[FluidProperties]
[simple_fluid0]
type = SimpleFluidProperties
bulk_modulus = 3
density0 = 4
thermal_expansion = 0
viscosity = 150.0
[]
[simple_fluid1]
type = SimpleFluidProperties
bulk_modulus = 4
density0 = 3
thermal_expansion = 0
viscosity = 130.0
[]
[]
[Materials]
[temperature_qp]
type = PorousFlowTemperature
[]
[ppss_qp]
type = PorousFlow2PhasePP
phase0_porepressure = P0
phase1_porepressure = P1
capillary_pressure = pc
[]
[simple_fluid0_qp]
type = PorousFlowSingleComponentFluid
fp = simple_fluid0
phase = 0
[]
[simple_fluid1_qp]
type = PorousFlowSingleComponentFluid
fp = simple_fluid1
phase = 1
[]
[effective_fluid_pressure]
type = PorousFlowEffectiveFluidPressure
[]
[porosity]
type = PorousFlowPorosity
porosity_zero = 0.1
fluid = true
biot_coefficient = 0.5
solid_bulk = 1
[]
[permeability]
type = PorousFlowPermeabilityKozenyCarman
poroperm_function = kozeny_carman_phi0
k0 = 5
m = 2
n = 2
phi0 = 0.1
[]
[relperm0_qp]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
s_res = 0.1
sum_s_res = 0.1
[]
[relperm1_qp]
type = PorousFlowRelativePermeabilityCorey
n = 3
phase = 1
s_res = 0.0
sum_s_res = 0.1
[]
[darcy_velocity_qp]
type = PorousFlowDarcyVelocityMaterial
gravity = '0.25 0 0'
[]
[]
[Preconditioning]
[check]
type = SMP
full = true
petsc_options = '-snes_test_display'
petsc_options_iname = '-snes_type'
petsc_options_value = ' test'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 1
[]
(test/include/kernels/PhiZeroKernel.h)
// This file is part of the MOOSE framework
// https://www.mooseframework.org
//
// All rights reserved, see COPYRIGHT for full restrictions
// https://github.com/idaholab/moose/blob/master/COPYRIGHT
//
// Licensed under LGPL 2.1, please see LICENSE for details
// https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "NullKernel.h"
/**
*This kernel is used to test that _phi_zero, _grad_phi_zero and _second_phi_zero help variables
*have proper dimensions, i.e. [MaxVarNDofsPerElem][MaxQp]
*/
class PhiZeroKernel : public NullKernel
{
public:
static InputParameters validParams();
PhiZeroKernel(const InputParameters & parameters);
protected:
virtual Real computeQpResidual() override;
const VariableSecond & _second_u;
const VariablePhiSecond & _second_phi;
};