- source_variableThe variable to transfer from.
C++ Type:std::vector<VariableName>
Controllable:No
Description:The variable to transfer from.
- variableThe auxiliary variable to store the transferred values in.
C++ Type:std::vector<AuxVariableName>
Controllable:No
Description:The auxiliary variable to store the transferred values in.
MultiAppCopyTransfer
The MultiAppCopyTransfer allows for copying variables (both nonlinear and auxiliary) between MultiApps. All types of variables, including higher order, elemental, and nodal are supported. The only limitation is that the meshes in the parent and sub application must be identical.
Siblings transfer behavior
This transfer supports sending data from a MultiApp to a MultiApp if and only if the number of subapps in the source MultiApp matches the number of subapps in the target MultiApp, and they are distributed the same way on the parallel processes. Each source app is then matched to the target app with the same subapp index.
Example Syntax
[Transfers]
[./to_sub]
type = MultiAppCopyTransfer
source_variable = u
variable = u
to_multi_app = sub
[../]
[]
(test/tests/transfers/multiapp_copy_transfer/linear_lagrange_to_sub/parent.i)Input Parameters
- check_multiapp_execute_onTrueWhen false the check between the multiapp and transfer execute on flags is not performed.
Default:True
C++ Type:bool
Controllable:No
Description:When false the check between the multiapp and transfer execute on flags is not performed.
- displaced_source_meshFalseWhether or not to use the displaced mesh for the source mesh.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not to use the displaced mesh for the source mesh.
- displaced_target_meshFalseWhether or not to use the displaced mesh for the target mesh.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not to use the displaced mesh for the target mesh.
- execute_onSAME_AS_MULTIAPPThe list of flag(s) indicating when this object should be executed, the available options include FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM, SAME_AS_MULTIAPP.
Default:SAME_AS_MULTIAPP
C++ Type:ExecFlagEnum
Options:FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM, SAME_AS_MULTIAPP
Controllable:No
Description:The list of flag(s) indicating when this object should be executed, the available options include FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM, SAME_AS_MULTIAPP.
- from_blocksSubdomain restriction to transfer from (defaults to all the origin app domain)
C++ Type:std::vector<SubdomainName>
Controllable:No
Description:Subdomain restriction to transfer from (defaults to all the origin app domain)
- from_multi_appThe name of the MultiApp to receive data from
C++ Type:MultiAppName
Controllable:No
Description:The name of the MultiApp to receive data from
- from_solution_tagThe tag of the solution vector to be transferred (default to the solution)
C++ Type:TagName
Controllable:No
Description:The tag of the solution vector to be transferred (default to the solution)
- to_blocksSubdomain restriction to transfer to, (defaults to all the target app domain)
C++ Type:std::vector<SubdomainName>
Controllable:No
Description:Subdomain restriction to transfer to, (defaults to all the target app domain)
- to_multi_appThe name of the MultiApp to transfer the data to
C++ Type:MultiAppName
Controllable:No
Description:The name of the MultiApp to transfer the data to
- to_solution_tagThe tag of the solution vector to be transferred to (default to the solution)
C++ Type:TagName
Controllable:No
Description:The tag of the solution vector to be transferred to (default to the solution)
Optional Parameters
- _called_legacy_paramsTrue
Default:True
C++ Type:bool
Controllable:No
- 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:Yes
Description:Set the enabled status of the MooseObject.
- skip_coordinate_collapsingTrueWhether to skip coordinate collapsing (translation and rotation are still performed, only XYZ, RZ etc collapsing is skipped) when performing mapping and inverse mapping coordinate transformation operations. This parameter should only be set by users who really know what they're doing.
Default:True
C++ Type:bool
Controllable:No
Description:Whether to skip coordinate collapsing (translation and rotation are still performed, only XYZ, RZ etc collapsing is skipped) when performing mapping and inverse mapping coordinate transformation operations. This parameter should only be set by users who really know what they're doing.
- 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/level_set/examples/vortex/vortex_reinit.i)
- (test/tests/transfers/multiapp_copy_transfer/third_monomial_from_sub/parent.i)
- (modules/optimization/test/tests/optimizationreporter/constant_heat_source/main_nonLinear.i)
- (test/tests/transfers/multiapp_copy_transfer/aux_to_aux/from_sub.i)
- (modules/combined/test/tests/optimization/invOpt_bc_convective/main.i)
- (test/tests/transfers/multiapp_copy_transfer/block_restriction/bi_direction.i)
- (modules/combined/test/tests/optimization/invOpt_elasticity/main.i)
- (test/tests/transfers/multiapp_copy_transfer/linear_sys_to_aux/nonlinear_main.i)
- (test/tests/transfers/transfer_on_final/parent.i)
- (modules/level_set/test/tests/reinitialization/parent.i)
- (test/tests/transfers/multiapp_copy_transfer/tagged_solution/main.i)
- (test/tests/transfers/multiapp_copy_transfer/aux_to_primary/to_sub.i)
- (modules/optimization/test/tests/outputs/exodus_optimization_steady/main.i)
- (modules/optimization/test/tests/optimizationreporter/material/main.i)
- (test/tests/transfers/multiapp_copy_transfer/constant_monomial_from_sub/parent.i)
- (modules/optimization/test/tests/optimizationreporter/bimaterial/main.i)
- (test/tests/transfers/multiapp_copy_transfer/second_lagrange_from_sub/parent.i)
- (modules/level_set/test/tests/transfers/copy_solution/parent.i)
- (modules/combined/examples/geochem-porous_flow/geotes_weber_tensleep/porous_flow.i)
- (test/tests/transfers/multiapp_copy_transfer/vector-variable-transfer/parent_L2_LagrangeVec.i)
- (test/tests/multiapps/clone_parent_mesh/main.i)
- (test/tests/transfers/errors/from_sub.i)
- (modules/combined/examples/geochem-porous_flow/geotes_2D/porous_flow.i)
- (test/tests/transfers/multiapp_copy_transfer/errors/parent.i)
- (test/tests/multiapps/relaxation/picard_relaxed_array_parent.i)
- (modules/combined/test/tests/optimization/invOpt_nonlinear/main.i)
- (modules/porous_flow/examples/multiapp_fracture_flow/diffusion_multiapp/fracture_app.i)
- (test/tests/transfers/multiapp_copy_transfer/multivariable_copy/parent.i)
- (modules/combined/examples/geochem-porous_flow/forge/porous_flow.i)
- (test/tests/transfers/multiapp_copy_transfer/array_variable_transfer/parent.i)
- (test/tests/transfers/multiapp_copy_transfer/linear_lagrange_from_sub/parent.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/multiapp-scalar-transport/fluid-flow.i)
- (test/tests/transfers/multiapp_copy_transfer/aux_to_primary/from_sub.i)
- (test/tests/transfers/multiapp_copy_transfer/aux_to_aux/to_sub.i)
- (test/tests/transfers/multiapp_copy_transfer/linear_lagrange_to_sub/parent.i)
- (modules/combined/examples/optimization/thermomechanical/thermomechanical_main.i)
- (modules/combined/examples/optimization/multi-load/square_main.i)
- (modules/combined/examples/optimization/multi-load/single_main.i)
- (test/tests/transfers/multiapp_copy_transfer/between_multiapps/main.i)
- (test/tests/transfers/multiapp_copy_transfer/third_monomial_to_sub/parent.i)
- (modules/geochemistry/test/tests/kinetics/bio_zoning_flow.i)
- (test/tests/transfers/multiapp_copy_transfer/second_lagrange_to_sub/parent.i)
- (test/tests/transfers/multiapp_copy_transfer/constant_monomial_to_sub/parent.i)
- (test/tests/transfers/coord_transform/both-transformed/copy/main-app.i)
- (modules/level_set/examples/rotating_circle/circle_rotate_parent.i)
- (modules/porous_flow/examples/multiapp_fracture_flow/diffusion_multiapp/fracture_app_heat.i)
Child Objects
(test/tests/transfers/multiapp_copy_transfer/linear_lagrange_to_sub/parent.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 = Transient
num_steps = 1
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = timestep_end
[../]
[]
[Transfers]
[./to_sub]
type = MultiAppCopyTransfer
source_variable = u
variable = u
to_multi_app = sub
[../]
[]
[Outputs]
exodus = true
[]
(modules/level_set/examples/vortex/vortex_reinit.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmax = 1
ymax = 1
nx = 16
ny = 16
uniform_refine = 2
elem_type = QUAD9
second_order = true
[]
[AuxVariables]
[./velocity]
family = LAGRANGE_VEC
[../]
[]
[AuxKernels]
[./vec]
type = VectorFunctionAux
variable = velocity
function = velocity_func
execute_on = 'INITIAL TIMESTEP_END'
[../]
[]
[Variables]
[phi]
family = LAGRANGE
[]
[]
[Functions]
[phi_exact]
type = LevelSetOlssonBubble
epsilon = 0.03
center = '0.5 0.75 0'
radius = 0.15
[]
[./velocity_func]
type = LevelSetOlssonVortex
reverse_time = 2
[../]
[]
[ICs]
[phi_ic]
type = FunctionIC
function = phi_exact
variable = phi
[]
[]
[Kernels]
[time]
type = TimeDerivative
variable = phi
[]
[advection]
type = LevelSetAdvection
velocity = velocity
variable = phi
[]
[advection_supg]
type = LevelSetAdvectionSUPG
velocity = velocity
variable = phi
[]
[time_supg]
type = LevelSetTimeDerivativeSUPG
velocity = velocity
variable = phi
[]
[]
[Postprocessors]
[area]
type = LevelSetVolume
threshold = 0.5
variable = phi
location = outside
execute_on = 'initial timestep_end'
[]
[cfl]
type = LevelSetCFLCondition
velocity = velocity
execute_on = 'initial timestep_end'
[]
[]
[Problem]
type = LevelSetProblem
[]
[Preconditioning/smp]
type = SMP
full = true
[]
[Executioner]
type = Transient
solve_type = NEWTON
start_time = 0
end_time = 2
scheme = crank-nicolson
[TimeStepper]
type = PostprocessorDT
postprocessor = cfl
scale = 0.8
[]
[]
[MultiApps]
[reinit]
type = LevelSetReinitializationMultiApp
input_files = 'vortex_reinit_sub.i'
execute_on = TIMESTEP_END
[]
[]
[Transfers]
[to_sub]
type = MultiAppCopyTransfer
source_variable = phi
variable = phi
to_multi_app = reinit
execute_on = 'timestep_end'
[]
[to_sub_init]
type = MultiAppCopyTransfer
source_variable = phi
variable = phi_0
to_multi_app = reinit
execute_on = 'timestep_end'
[]
[from_sub]
type = MultiAppCopyTransfer
source_variable = phi
variable = phi
from_multi_app = reinit
execute_on = 'timestep_end'
[]
[]
[Outputs]
csv = true
exodus = true
[]
(test/tests/transfers/multiapp_copy_transfer/third_monomial_from_sub/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
family = MONOMIAL
order = THIRD
[../]
[]
[Problem]
type = FEProblem
solve = false
[]
[Executioner]
type = Transient
num_steps = 1
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = initial
[../]
[]
[Transfers]
[./from_sub]
type = MultiAppCopyTransfer
source_variable = aux
variable = u
from_multi_app = sub
[../]
[]
[Outputs]
exodus = true
[]
(modules/optimization/test/tests/optimizationreporter/constant_heat_source/main_nonLinear.i)
[Optimization]
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmax = 2
ymax = 2
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'parameter_results'
num_values = '1'
initial_condition = '500'
lower_bounds = '0.1'
upper_bounds = '10000'
measurement_points = '0.2 0.2 0
0.8 0.6 0
0.2 1.4 0
0.8 1.8 0'
measurement_values = '270 339 321 221'
[]
[Executioner]
type = Optimize
tao_solver = taoblmvm
petsc_options_iname = '-tao_gatol'
petsc_options_value = '.01'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward_nonLinear.i
execute_on = FORWARD
[]
[adjoint]
type = FullSolveMultiApp
input_files = adjoint_nonLinear.i
execute_on = ADJOINT
[]
[]
[Transfers]
[toForward_measument]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/parameter_results'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
params/q'
[]
[toAdjoint]
type = MultiAppReporterTransfer
to_multi_app = adjoint
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/misfit_values
OptimizationReporter/parameter_results'
to_reporters = 'misfit/measurement_xcoord
misfit/measurement_ycoord
misfit/measurement_zcoord
misfit/measurement_time
misfit/misfit_values
params/q'
[]
[fromForward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measure_data/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
[fromadjoint]
type = MultiAppReporterTransfer
from_multi_app = adjoint
from_reporters = 'gradient_vpp/inner_product'
to_reporters = 'OptimizationReporter/grad_parameter_results'
[]
#for temperature dependent material
[fromforwardMesh]
type = MultiAppCopyTransfer
from_multi_app = forward
to_multi_app = adjoint
source_variable = 'T'
variable = 'T'
[]
[]
[Reporters]
[optInfo]
type = OptimizationInfo
[]
[]
[Outputs]
csv = true
[]
(test/tests/transfers/multiapp_copy_transfer/aux_to_aux/from_sub.i)
[Problem]
solve = false
[]
[Mesh]
type = GeneratedMesh
dim = 2
[]
[MultiApps/sub]
type = TransientMultiApp
input_files = sub.i
[]
[Transfers/from_sub]
type = MultiAppCopyTransfer
from_multi_app = sub
source_variable = aux
variable = x
[]
[AuxVariables/x]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
execute_on = 'FINAL'
exodus = true
[]
(modules/combined/test/tests/optimization/invOpt_bc_convective/main.i)
[Optimization]
[]
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 20
xmax = 1
ymax = 2
[]
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'p1'
num_values = '1'
initial_condition = '9'
upper_bounds = '10'
lower_bounds = '1'
measurement_points = '0.1 0 0
0.1 0.1 0
0.1 0.2 0
0.1 0.3 0
0.1 0.4 0
0.1 0.5 0
0.1 0.6 0
0.1 0.7 0
0.1 0.8 0
0.1 0.9 0
0.1 1 0
0.1 1.1 0
0.1 1.2 0
0.1 1.3 0
0.1 1.4 0
0.1 1.5 0
0.1 1.6 0
0.1 1.7 0
0.1 1.8 0
0.1 1.9 0
0.1 2 0'
measurement_values = '500
472.9398111
450.8117197
434.9560747
423.3061045
414.9454912
409.3219399
406.1027006
405.0865428
406.1604905
409.2772668
414.4449772
421.7253934
431.2401042
443.1862012
457.8664824
475.7450186
497.5582912
524.4966003
559.1876637
600'
[]
[Executioner]
type = Optimize
tao_solver = taoblmvm #taolmvm#taonm #taolmvm
petsc_options_iname = '-tao_gatol' # -tao_fd_gradient -tao_fd_delta'
petsc_options_value = '1e-4' #1e-1 '#true 1e-4'
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward.i
execute_on = "FORWARD"
clone_parent_mesh = true
[]
[adjoint]
type = FullSolveMultiApp
input_files = adjoint.i
execute_on = "ADJOINT"
clone_parent_mesh = true
[]
[]
[Transfers]
#these are usually the same for all input files.
[toForward]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/p1'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
params/vals'
[]
[fromForward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measure_data/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
[toAdjoint]
type = MultiAppReporterTransfer
to_multi_app = adjoint
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/misfit_values
OptimizationReporter/p1'
to_reporters = 'misfit/measurement_xcoord
misfit/measurement_ycoord
misfit/measurement_zcoord
misfit/measurement_time
misfit/misfit_values
params/vals'
[]
[fromAdjoint]
type = MultiAppReporterTransfer
from_multi_app = adjoint
from_reporters = 'adjoint_pt/inner_product'
to_reporters = 'OptimizationReporter/grad_p1'
[]
# these are transferring data from subapp to subapp because the adjoint problem
# needs the forward solution to compute the gradient. Maybe this step could be
# done on the main app. The adjoint only passes the adjoint variable (whole mesh)
# to the main app and the main app computes the gradient from this.
[fromForwardtoAdjoint_temp]
type = MultiAppCopyTransfer
from_multi_app = forward
to_multi_app = adjoint
source_variable = 'temperature'
variable = 'temperature_forward'
[]
[]
[Outputs]
csv = true
[]
(test/tests/transfers/multiapp_copy_transfer/block_restriction/bi_direction.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 2
ymin = 0
ymax = 2
nx = 4
ny = 4
# Designed to have non-complete overlap
subdomain_ids = '1 1 1 1
2 2 2 1
1 2 2 1
1 1 2 1'
[]
[]
[Variables]
[to_sub]
family = MONOMIAL
order = CONSTANT
initial_condition = 1
[]
[from_sub]
family = MONOMIAL
order = CONSTANT
initial_condition = 2
[]
[]
[Problem]
type = FEProblem
solve = false
[]
[Executioner]
type = Transient
num_steps = 2
[]
[MultiApps]
[sub]
type = TransientMultiApp
input_files = sub.i
[]
[]
[Transfers]
[to_sub]
type = MultiAppCopyTransfer
source_variable = to_sub
variable = from_main
to_multi_app = sub
[]
[from_sub]
type = MultiAppCopyTransfer
source_variable = to_main
variable = from_sub
from_multi_app = sub
[]
[]
[Outputs]
exodus = true
[]
(modules/combined/test/tests/optimization/invOpt_elasticity/main.i)
[Optimization]
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'youngs_modulus'
num_values = '3'
#initial_condition = '5 4 3'
initial_condition = '5.0 5.0 5.0'
lower_bounds = '0.1'
upper_bounds = '10.0'
measurement_points = '-1.0 -1.0 0.0
-1.0 0.0 0.0
-1.0 1.0 0.0
0.0 -1.0 0.0
0.0 0.0 0.0
0.0 1.0 0.0
1.0 -1.0 0.0
1.0 0.0 0.0
1.0 1.0 0.0'
measurement_values = '2.270471e+00 3.448233e+00 4.766029e+00
2.205754e+00 3.374848e+00 4.691352e+00
2.172435e+00 3.326780e+00 4.642104e+00'
[]
[Executioner]
type = Optimize
tao_solver = taobqnls #taobncg #taoblmvm
petsc_options_iname = '-tao_gatol -tao_ls_type -tao_max_it'
petsc_options_value = '1e-10 unit 1000'
# THESE OPTIONS ARE FOR TESTING THE ADJOINT GRADIENT
# petsc_options_iname = '-tao_max_it -tao_fd_test -tao_test_gradient -tao_fd_gradient -tao_fd_delta -tao_gatol'
# petsc_options_value = '1 true true false 1e-8 0.1'
# petsc_options = '-tao_test_gradient_view'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward.i
execute_on = FORWARD
[]
[adjoint]
type = FullSolveMultiApp
input_files = grad.i
execute_on = ADJOINT
[]
[]
[Transfers]
[toForward]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/youngs_modulus'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
parametrization/youngs_modulus'
[]
[get_misfit]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measure_data/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
[set_state_for_adjoint]
type = MultiAppCopyTransfer
from_multi_app = forward
to_multi_app = adjoint
source_variable = 'ux uy'
variable = 'state_x state_y'
[]
[setup_adjoint_run]
type = MultiAppReporterTransfer
to_multi_app = adjoint
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/misfit_values
OptimizationReporter/youngs_modulus'
to_reporters = 'misfit/measurement_xcoord
misfit/measurement_ycoord
misfit/measurement_zcoord
misfit/measurement_time
misfit/misfit_values
parametrization/youngs_modulus'
[]
[get_grad_youngs_modulus]
type = MultiAppReporterTransfer
from_multi_app = adjoint
from_reporters = 'grad_youngs_modulus/inner_product'
to_reporters = 'OptimizationReporter/grad_youngs_modulus'
[]
[]
[Reporters]
[optInfo]
type = OptimizationInfo
items = 'current_iterate function_value gnorm'
[]
[]
[Outputs]
console = false
csv = true
[]
(test/tests/transfers/multiapp_copy_transfer/linear_sys_to_aux/nonlinear_main.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 10
[]
[]
[Variables]
[u_main]
type = MooseVariableFVReal
[]
[]
[AuxVariables]
[transferred]
type = MooseLinearVariableFVReal
[]
[]
[Transfers]
[copy]
type = MultiAppCopyTransfer
from_multi_app = linear_sub
source_variable = u
variable = transferred
[]
[]
[MultiApps]
[linear_sub]
type = FullSolveMultiApp
input_files = 'linear_sub.i'
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = u_main
coeff = 2
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = u_main
boundary = left
value = 0
[]
[./right]
type = FVDirichletBC
variable = u_main
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
exodus = true
[]
(test/tests/transfers/transfer_on_final/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[u]
initial_condition = 1234
[]
[v]
initial_condition = 2458
[]
[]
[Problem]
type = FEProblem
solve = false
[]
[Executioner]
type = Transient
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 = 'INITIAL TIMESTEP_END'
[]
[]
[Transfers]
[from_sub]
type = MultiAppCopyTransfer
source_variable = u
variable = u
from_multi_app = sub
check_multiapp_execute_on = false
execute_on = 'FINAL'
[]
[to_sub]
type = MultiAppCopyTransfer
source_variable = v
variable = v
to_multi_app = sub
check_multiapp_execute_on = false
execute_on = 'FINAL'
[]
[]
[Outputs]
exodus = true
[final]
type = Exodus
execute_on = 'FINAL'
execute_input_on = 'NONE' # This is needed to avoid problems with creating a file w/o data during --recover testing
[]
[]
(modules/level_set/test/tests/reinitialization/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 8
ny = 8
uniform_refine = 3 #1/64
[]
[AuxVariables]
[./velocity]
family = LAGRANGE_VEC
[../]
[]
[Variables]
[./phi]
[../]
[]
[Functions]
[./phi_exact]
type = LevelSetOlssonBubble
epsilon = 0.05
center = '0.5 0.5 0'
radius = 0.15
[../]
[./velocity_func]
type = ParsedVectorFunction
expression_x = '1'
expression_y = '1'
[../]
[]
[BCs]
[./Periodic]
[./all]
variable = phi
auto_direction = 'x y'
[../]
[../]
[]
[ICs]
[./phi_ic]
type = FunctionIC
function = phi_exact
variable = phi
[../]
[./vel_ic]
type = VectorFunctionIC
variable = velocity
function = velocity_func
[]
[]
[Kernels]
[./time]
type = TimeDerivative
variable = phi
[../]
[./advection]
type = LevelSetAdvection
velocity = velocity
variable = phi
[../]
[]
[Postprocessors]
[./area]
type = LevelSetVolume
threshold = 0.5
variable = phi
location = outside
execute_on = 'initial timestep_end'
[../]
[./cfl]
type = LevelSetCFLCondition
velocity = velocity
execute_on = 'initial'
[../]
[]
[Executioner]
type = Transient
solve_type = PJFNK
start_time = 0
end_time = 1
nl_rel_tol = 1e-12
scheme = crank-nicolson
petsc_options_iname = '-pc_type -pc_sub_type'
petsc_options_value = 'asm ilu'
[./TimeStepper]
type = PostprocessorDT
postprocessor = cfl
scale = 1
[../]
[]
[MultiApps]
[./reinit]
type = LevelSetReinitializationMultiApp
input_files = 'reinit.i'
execute_on = 'timestep_end'
[../]
[]
[Transfers]
[./to_sub]
type = MultiAppCopyTransfer
variable = phi
source_variable = phi
to_multi_app = reinit
execute_on = 'timestep_end'
[../]
[./to_sub_init]
type = MultiAppCopyTransfer
variable = phi_0
source_variable = phi
to_multi_app = reinit
execute_on = 'timestep_end'
[../]
[./from_sub]
type = MultiAppCopyTransfer
variable = phi
source_variable = phi
from_multi_app = reinit
execute_on = timestep_end
[../]
[]
[Outputs]
exodus = true
[]
(test/tests/transfers/multiapp_copy_transfer/tagged_solution/main.i)
[Problem]
solve = false
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 4
[]
[MultiApps/sub]
type = FullSolveMultiApp
input_files = sub.i
[]
[Transfers/to_sub]
type = MultiAppCopyTransfer
to_multi_app = sub
source_variable = x
to_solution_tag = tagged_aux_sol
variable = force
[]
[AuxVariables/x]
initial_condition = 1
[]
[Executioner]
type = Steady
[]
(test/tests/transfers/multiapp_copy_transfer/aux_to_primary/to_sub.i)
[Problem]
solve = false
[]
[Mesh]
type = GeneratedMesh
dim = 2
[]
[Variables]
[main]
initial_condition = 1949
[]
[]
[MultiApps/sub]
type = TransientMultiApp
input_files = sub.i
[]
[Transfers/to_sub]
type = MultiAppCopyTransfer
to_multi_app = sub
source_variable = main
variable = sub
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
execute_on = 'FINAL'
exodus = true
[]
(modules/optimization/test/tests/outputs/exodus_optimization_steady/main.i)
[Optimization]
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmax = 2
ymax = 2
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'p1'
num_values = '1'
initial_condition = '7'
lower_bounds = '0'
upper_bounds = '10'
measurement_points = '0.2 0.2 0
0.8 0.6 0
0.2 1.4 0
0.8 1.8 0'
measurement_values = '226 254 214 146'
[]
[Executioner]
type = Optimize
tao_solver = taoblmvm
petsc_options_iname = '-tao_gatol'
petsc_options_value = '0.0001'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward.i
execute_on = "FORWARD"
clone_parent_mesh = true
[]
[adjoint]
type = FullSolveMultiApp
input_files = adjoint.i
execute_on = "ADJOINT"
clone_parent_mesh = true
[]
[]
[Transfers]
[toForward]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/p1'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
params/p1'
[]
[fromForward_mesh]
type = MultiAppCopyTransfer
from_multi_app = forward
to_multi_app = adjoint
source_variable = 'temperature'
variable = 'temperature_forward'
[]
[fromForward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measure_data/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
[toAdjoint]
type = MultiAppReporterTransfer
to_multi_app = adjoint
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/misfit_values
OptimizationReporter/p1'
to_reporters = 'misfit/measurement_xcoord
misfit/measurement_ycoord
misfit/measurement_zcoord
misfit/measurement_time
misfit/misfit_values
params/p1'
[]
[fromAdjoint]
type = MultiAppReporterTransfer
from_multi_app = adjoint
from_reporters = 'adjoint_grad/inner_product'
to_reporters = 'OptimizationReporter/grad_p1'
[]
[]
[Outputs]
csv = true
[]
(modules/optimization/test/tests/optimizationreporter/material/main.i)
[Optimization]
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmax = 2
ymax = 2
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'p1'
num_values = '1'
initial_condition = '7'
lower_bounds = '0'
upper_bounds = '10'
measurement_points = '0.2 0.2 0
0.8 0.6 0
0.2 1.4 0
0.8 1.8 0'
measurement_values = '226 254 214 146'
[]
[Executioner]
type = Optimize
tao_solver = taoblmvm
petsc_options_iname = '-tao_gatol'
petsc_options_value = '0.0001'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward.i
execute_on = "FORWARD"
clone_parent_mesh = true
[]
[adjoint]
type = FullSolveMultiApp
input_files = adjoint.i
execute_on = "ADJOINT"
clone_parent_mesh = true
[]
[]
[Transfers]
[toForward]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/p1'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
params/p1'
[]
[fromForward_mesh]
type = MultiAppCopyTransfer
from_multi_app = forward
to_multi_app = adjoint
source_variable = 'temperature'
variable = 'temperature_forward'
[]
[fromForward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measure_data/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
[toAdjoint]
type = MultiAppReporterTransfer
to_multi_app = adjoint
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/misfit_values
OptimizationReporter/p1'
to_reporters = 'misfit/measurement_xcoord
misfit/measurement_ycoord
misfit/measurement_zcoord
misfit/measurement_time
misfit/misfit_values
params/p1'
[]
[fromAdjoint]
type = MultiAppReporterTransfer
from_multi_app = adjoint
from_reporters = 'adjoint_grad/inner_product'
to_reporters = 'OptimizationReporter/grad_p1'
[]
[]
[Outputs]
csv = true
[]
(test/tests/transfers/multiapp_copy_transfer/constant_monomial_from_sub/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
family = MONOMIAL
order = CONSTANT
[../]
[]
[Problem]
type = FEProblem
solve = false
[]
[Executioner]
type = Transient
num_steps = 1
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = initial
[../]
[]
[Transfers]
[./from_sub]
type = MultiAppCopyTransfer
source_variable = aux
variable = u
from_multi_app = sub
[../]
[]
[Outputs]
exodus = true
[]
(modules/optimization/test/tests/optimizationreporter/bimaterial/main.i)
# This main.i file runs the subapps model.i and grad.i, using an FullSolveMultiApp
# The purpose of main.i is to find the two diffusivity_values
# (one in the bottom material of model.i, and one in the top material of model.i)
# such that the misfit between experimental observations (defined in model.i) and MOOSE predictions is minimised.
# The adjoint computed in grad.i is used to compute the gradient for the gradient based LMVM solver in TAO
# PETSc-TAO optimisation is used to perform this inversion
#
[Optimization]
[]
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 16
ny = 16
xmin = -4
xmax = 4
ymin = -4
ymax = 4
[]
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = diffusivity_values
num_values = 2 # diffusivity in the bottom material and in the top material of model.i
initial_condition = '15 15' # the expected result is about '1 10' so this initial condition is not too bad
lower_bounds = '1'
upper_bounds = '50'
measurement_file = 'synthetic_data.csv'
file_value = 'temperature'
[]
[Executioner]
# type = Optimize
# tao_solver = taoblmvm
# petsc_options_iname = '-tao_fd_gradient -tao_gatol'
# petsc_options_value = ' true 0.001'
type = Optimize
tao_solver = taobqnktr
petsc_options_iname = '-tao_gatol'
petsc_options_value = '1e-3'
## THESE OPTIONS ARE FOR TESTING THE ADJOINT GRADIENT
# petsc_options_iname='-tao_max_it -tao_fd_test -tao_test_gradient -tao_fd_gradient -tao_fd_delta -tao_gatol'
# petsc_options_value='1 true true false 1e-8 0.1'
# petsc_options = '-tao_test_gradient_view'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = model.i
execute_on = FORWARD
[]
[adjoint]
type = FullSolveMultiApp
input_files = grad.i #write this input file to compute the adjoint solution and the gradient
execute_on = ADJOINT
[]
[]
[Transfers]
[toForward] #pass the coordinates where we knew the measurements to the forward model to do the extraction of the simulation data at the location of the measurements to compute the misfit
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/diffusivity_values'
to_reporters = 'measure_data/measurement_xcoord
measure_data/measurement_ycoord
measure_data/measurement_zcoord
measure_data/measurement_time
measure_data/measurement_values
data/diffusivity'
[]
[from_forward] #get the simulation values
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measure_data/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
#############
#copy the temperature variable - we will need this for the computation of the gradient
[fromforwardMesh]
type = MultiAppCopyTransfer
from_multi_app = forward
to_multi_app = adjoint
source_variable = 'temperature'
variable = 'temperature_forward'
[]
#############
[toAdjoint] #pass the misfit to the adjoint
type = MultiAppReporterTransfer
to_multi_app = adjoint
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/misfit_values
OptimizationReporter/diffusivity_values'
to_reporters = 'misfit/measurement_xcoord
misfit/measurement_ycoord
misfit/measurement_zcoord
misfit/measurement_time
misfit/misfit_values
data/diffusivity'
[]
[fromadjoint]
type = MultiAppReporterTransfer
from_multi_app = adjoint
from_reporters = 'gradvec/inner_product'
to_reporters = 'OptimizationReporter/grad_diffusivity_values'
[]
[]
[Outputs]
console = false
csv = true
[]
(test/tests/transfers/multiapp_copy_transfer/second_lagrange_from_sub/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
elem_type = QUAD8
[]
[Variables]
[./u]
family = LAGRANGE
order = SECOND
[../]
[]
[Problem]
type = FEProblem
solve = false
[]
[Executioner]
type = Transient
num_steps = 1
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = initial
[../]
[]
[Transfers]
[./from_sub]
type = MultiAppCopyTransfer
source_variable = u
variable = u
from_multi_app = sub
[../]
[]
[Outputs]
exodus = true
[]
(modules/level_set/test/tests/transfers/copy_solution/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[ICs]
[./u_ic]
type = FunctionIC
function = 'x*x*y'
variable = u
[../]
[]
[Problem]
solve = false
[]
[Executioner]
type = Transient
num_steps = 1
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = 'sub.i'
execute_on = timestep_end
[../]
[]
[Transfers]
[./to_sub]
type = MultiAppCopyTransfer
variable = u
source_variable = u
to_multi_app = sub
execute_on = timestep_end
check_multiapp_execute_on = false
[../]
[]
[Outputs]
exodus = true
[]
(modules/combined/examples/geochem-porous_flow/geotes_weber_tensleep/porous_flow.i)
#########################################
# #
# File written by create_input_files.py #
# #
#########################################
# PorousFlow simulation of injection and production in a simplified GeoTES aquifer
# Much of this file is standard porous-flow stuff. The unusual aspects are:
# - transfer of the rates of changes of each species (kg.s) to the aquifer_geochemistry.i simulation. This is achieved by saving these changes from the PorousFlowMassTimeDerivative residuals
# - transfer of the temperature field to the aquifer_geochemistry.i simulation
# Interesting behaviour can be simulated by this file without its 'parent' simulation, exchanger.i. exchanger.i provides mass-fractions injected via the injection_rate_massfrac_* variables, but since these are more-or-less constant throughout the duration of the exchanger.i simulation, the initial_conditions specified below may be used. Similar, exchanger.i provides injection_temperature, but that is also constant.
injection_rate = -0.02 # kg/s/m, negative because injection as a source
production_rate = 0.02 # kg/s/m, this is about the maximum that can be sustained by the aquifer, with its fairly low permeability, without porepressure becoming negative
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 3
xmin = -75
xmax = 75
ymin = 0
ymax = 40
zmin = -25
zmax = 25
nx = 15
ny = 4
nz = 5
[]
[aquifer]
type = ParsedSubdomainMeshGenerator
input = gen
block_id = 1
block_name = aquifer
combinatorial_geometry = 'z >= -5 & z <= 5'
[]
[injection_nodes]
input = aquifer
type = ExtraNodesetGenerator
new_boundary = injection_nodes
coord = '-25 0 -5; -25 0 5'
[]
[production_nodes]
input = injection_nodes
type = ExtraNodesetGenerator
new_boundary = production_nodes
coord = '25 0 -5; 25 0 5'
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 -10'
[]
[BCs]
[injection_temperature]
type = MatchedValueBC
variable = temperature
v = injection_temperature
boundary = injection_nodes
[]
[]
[FluidProperties]
[the_simple_fluid]
type = SimpleFluidProperties
thermal_expansion = 0
bulk_modulus = 2E9
viscosity = 1E-3
density0 = 1000
cv = 4000.0
cp = 4000.0
[]
[]
[PorousFlowFullySaturated]
coupling_type = ThermoHydro
porepressure = porepressure
temperature = temperature
mass_fraction_vars = 'f_H f_Cl f_SO4 f_HCO3 f_SiO2aq f_Al f_Ca f_Mg f_Fe f_K f_Na f_Sr f_F f_BOH f_Br f_Ba f_Li f_NO3 f_O2aq '
save_component_rate_in = 'rate_H rate_Cl rate_SO4 rate_HCO3 rate_SiO2aq rate_Al rate_Ca rate_Mg rate_Fe rate_K rate_Na rate_Sr rate_F rate_BOH rate_Br rate_Ba rate_Li rate_NO3 rate_O2aq rate_H2O' # change in kg at every node / dt
fp = the_simple_fluid
temperature_unit = Celsius
[]
[Materials]
[porosity_caps]
type = PorousFlowPorosityConst # this simulation has no porosity changes from dissolution
block = 0
porosity = 0.01
[]
[porosity_aquifer]
type = PorousFlowPorosityConst # this simulation has no porosity changes from dissolution
block = aquifer
porosity = 0.063
[]
[permeability_caps]
type = PorousFlowPermeabilityConst
block = 0
permeability = '1E-18 0 0 0 1E-18 0 0 0 1E-18'
[]
[permeability_aquifer]
type = PorousFlowPermeabilityConst
block = aquifer
permeability = '1.7E-15 0 0 0 1.7E-15 0 0 0 4.1E-16'
[]
[thermal_conductivity]
type = PorousFlowThermalConductivityIdeal
dry_thermal_conductivity = '0 0 0 0 0 0 0 0 0'
[]
[rock_heat]
type = PorousFlowMatrixInternalEnergy
density = 2500.0
specific_heat_capacity = 1200.0
[]
[]
[Preconditioning]
active = typically_efficient
[typically_efficient]
type = SMP
full = true
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = ' hypre boomeramg'
[]
[strong]
type = SMP
full = true
petsc_options = '-ksp_diagonal_scale -ksp_diagonal_scale_fix'
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
petsc_options_value = ' asm ilu NONZERO 2'
[]
[probably_too_strong]
type = SMP
full = true
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = ' lu mumps'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 7.76E6 # 90 days
[TimeStepper]
type = FunctionDT
function = 'min(3E4, max(1E4, 0.2 * t))'
[]
[]
[Outputs]
exodus = true
[]
[Variables]
[f_H]
initial_condition = -2.952985071156e-06
[]
[f_Cl]
initial_condition = 0.04870664551708
[]
[f_SO4]
initial_condition = 0.0060359986852517
[]
[f_HCO3]
initial_condition = 5.0897287594019e-05
[]
[f_SiO2aq]
initial_condition = 3.0246609868421e-05
[]
[f_Al]
initial_condition = 3.268028901929e-08
[]
[f_Ca]
initial_condition = 0.00082159428184586
[]
[f_Mg]
initial_condition = 1.8546347062146e-05
[]
[f_Fe]
initial_condition = 4.3291908204093e-05
[]
[f_K]
initial_condition = 6.8434768308898e-05
[]
[f_Na]
initial_condition = 0.033298053919671
[]
[f_Sr]
initial_condition = 1.2771866652177e-05
[]
[f_F]
initial_condition = 5.5648860174073e-06
[]
[f_BOH]
initial_condition = 0.0003758574621917
[]
[f_Br]
initial_condition = 9.0315286107068e-05
[]
[f_Ba]
initial_condition = 1.5637460875161e-07
[]
[f_Li]
initial_condition = 8.3017067912701e-05
[]
[f_NO3]
initial_condition = 0.00010958455036169
[]
[f_O2aq]
initial_condition = -7.0806852373351e-05
[]
[porepressure]
initial_condition = 30E6
[]
[temperature]
initial_condition = 92
scaling = 1E-6 # fluid enthalpy is roughly 1E6
[]
[]
[DiracKernels]
[inject_H]
type = PorousFlowPolyLineSink
SumQuantityUO = injected_mass
fluxes = ${injection_rate}
p_or_t_vals = 0.0
multiplying_var = injection_rate_massfrac_H
point_file = injection.bh
variable = f_H
[]
[inject_Cl]
type = PorousFlowPolyLineSink
SumQuantityUO = injected_mass
fluxes = ${injection_rate}
p_or_t_vals = 0.0
multiplying_var = injection_rate_massfrac_Cl
point_file = injection.bh
variable = f_Cl
[]
[inject_SO4]
type = PorousFlowPolyLineSink
SumQuantityUO = injected_mass
fluxes = ${injection_rate}
p_or_t_vals = 0.0
multiplying_var = injection_rate_massfrac_SO4
point_file = injection.bh
variable = f_SO4
[]
[inject_HCO3]
type = PorousFlowPolyLineSink
SumQuantityUO = injected_mass
fluxes = ${injection_rate}
p_or_t_vals = 0.0
multiplying_var = injection_rate_massfrac_HCO3
point_file = injection.bh
variable = f_HCO3
[]
[inject_SiO2aq]
type = PorousFlowPolyLineSink
SumQuantityUO = injected_mass
fluxes = ${injection_rate}
p_or_t_vals = 0.0
multiplying_var = injection_rate_massfrac_SiO2aq
point_file = injection.bh
variable = f_SiO2aq
[]
[inject_Al]
type = PorousFlowPolyLineSink
SumQuantityUO = injected_mass
fluxes = ${injection_rate}
p_or_t_vals = 0.0
multiplying_var = injection_rate_massfrac_Al
point_file = injection.bh
variable = f_Al
[]
[inject_Ca]
type = PorousFlowPolyLineSink
SumQuantityUO = injected_mass
fluxes = ${injection_rate}
p_or_t_vals = 0.0
multiplying_var = injection_rate_massfrac_Ca
point_file = injection.bh
variable = f_Ca
[]
[inject_Mg]
type = PorousFlowPolyLineSink
SumQuantityUO = injected_mass
fluxes = ${injection_rate}
p_or_t_vals = 0.0
multiplying_var = injection_rate_massfrac_Mg
point_file = injection.bh
variable = f_Mg
[]
[inject_Fe]
type = PorousFlowPolyLineSink
SumQuantityUO = injected_mass
fluxes = ${injection_rate}
p_or_t_vals = 0.0
multiplying_var = injection_rate_massfrac_Fe
point_file = injection.bh
variable = f_Fe
[]
[inject_K]
type = PorousFlowPolyLineSink
SumQuantityUO = injected_mass
fluxes = ${injection_rate}
p_or_t_vals = 0.0
multiplying_var = injection_rate_massfrac_K
point_file = injection.bh
variable = f_K
[]
[inject_Na]
type = PorousFlowPolyLineSink
SumQuantityUO = injected_mass
fluxes = ${injection_rate}
p_or_t_vals = 0.0
multiplying_var = injection_rate_massfrac_Na
point_file = injection.bh
variable = f_Na
[]
[inject_Sr]
type = PorousFlowPolyLineSink
SumQuantityUO = injected_mass
fluxes = ${injection_rate}
p_or_t_vals = 0.0
multiplying_var = injection_rate_massfrac_Sr
point_file = injection.bh
variable = f_Sr
[]
[inject_F]
type = PorousFlowPolyLineSink
SumQuantityUO = injected_mass
fluxes = ${injection_rate}
p_or_t_vals = 0.0
multiplying_var = injection_rate_massfrac_F
point_file = injection.bh
variable = f_F
[]
[inject_BOH]
type = PorousFlowPolyLineSink
SumQuantityUO = injected_mass
fluxes = ${injection_rate}
p_or_t_vals = 0.0
multiplying_var = injection_rate_massfrac_BOH
point_file = injection.bh
variable = f_BOH
[]
[inject_Br]
type = PorousFlowPolyLineSink
SumQuantityUO = injected_mass
fluxes = ${injection_rate}
p_or_t_vals = 0.0
multiplying_var = injection_rate_massfrac_Br
point_file = injection.bh
variable = f_Br
[]
[inject_Ba]
type = PorousFlowPolyLineSink
SumQuantityUO = injected_mass
fluxes = ${injection_rate}
p_or_t_vals = 0.0
multiplying_var = injection_rate_massfrac_Ba
point_file = injection.bh
variable = f_Ba
[]
[inject_Li]
type = PorousFlowPolyLineSink
SumQuantityUO = injected_mass
fluxes = ${injection_rate}
p_or_t_vals = 0.0
multiplying_var = injection_rate_massfrac_Li
point_file = injection.bh
variable = f_Li
[]
[inject_NO3]
type = PorousFlowPolyLineSink
SumQuantityUO = injected_mass
fluxes = ${injection_rate}
p_or_t_vals = 0.0
multiplying_var = injection_rate_massfrac_NO3
point_file = injection.bh
variable = f_NO3
[]
[inject_O2aq]
type = PorousFlowPolyLineSink
SumQuantityUO = injected_mass
fluxes = ${injection_rate}
p_or_t_vals = 0.0
multiplying_var = injection_rate_massfrac_O2aq
point_file = injection.bh
variable = f_O2aq
[]
[inject_H2O]
type = PorousFlowPolyLineSink
SumQuantityUO = injected_mass
fluxes = ${injection_rate}
p_or_t_vals = 0.0
multiplying_var = injection_rate_massfrac_H2O
point_file = injection.bh
variable = porepressure
[]
[produce_H]
type = PorousFlowPolyLineSink
SumQuantityUO = produced_mass_H
fluxes = ${production_rate}
p_or_t_vals = 0.0
mass_fraction_component = 0
point_file = production.bh
variable = f_H
[]
[produce_Cl]
type = PorousFlowPolyLineSink
SumQuantityUO = produced_mass_Cl
fluxes = ${production_rate}
p_or_t_vals = 0.0
mass_fraction_component = 1
point_file = production.bh
variable = f_Cl
[]
[produce_SO4]
type = PorousFlowPolyLineSink
SumQuantityUO = produced_mass_SO4
fluxes = ${production_rate}
p_or_t_vals = 0.0
mass_fraction_component = 2
point_file = production.bh
variable = f_SO4
[]
[produce_HCO3]
type = PorousFlowPolyLineSink
SumQuantityUO = produced_mass_HCO3
fluxes = ${production_rate}
p_or_t_vals = 0.0
mass_fraction_component = 3
point_file = production.bh
variable = f_HCO3
[]
[produce_SiO2aq]
type = PorousFlowPolyLineSink
SumQuantityUO = produced_mass_SiO2aq
fluxes = ${production_rate}
p_or_t_vals = 0.0
mass_fraction_component = 4
point_file = production.bh
variable = f_SiO2aq
[]
[produce_Al]
type = PorousFlowPolyLineSink
SumQuantityUO = produced_mass_Al
fluxes = ${production_rate}
p_or_t_vals = 0.0
mass_fraction_component = 5
point_file = production.bh
variable = f_Al
[]
[produce_Ca]
type = PorousFlowPolyLineSink
SumQuantityUO = produced_mass_Ca
fluxes = ${production_rate}
p_or_t_vals = 0.0
mass_fraction_component = 6
point_file = production.bh
variable = f_Ca
[]
[produce_Mg]
type = PorousFlowPolyLineSink
SumQuantityUO = produced_mass_Mg
fluxes = ${production_rate}
p_or_t_vals = 0.0
mass_fraction_component = 7
point_file = production.bh
variable = f_Mg
[]
[produce_Fe]
type = PorousFlowPolyLineSink
SumQuantityUO = produced_mass_Fe
fluxes = ${production_rate}
p_or_t_vals = 0.0
mass_fraction_component = 8
point_file = production.bh
variable = f_Fe
[]
[produce_K]
type = PorousFlowPolyLineSink
SumQuantityUO = produced_mass_K
fluxes = ${production_rate}
p_or_t_vals = 0.0
mass_fraction_component = 9
point_file = production.bh
variable = f_K
[]
[produce_Na]
type = PorousFlowPolyLineSink
SumQuantityUO = produced_mass_Na
fluxes = ${production_rate}
p_or_t_vals = 0.0
mass_fraction_component = 10
point_file = production.bh
variable = f_Na
[]
[produce_Sr]
type = PorousFlowPolyLineSink
SumQuantityUO = produced_mass_Sr
fluxes = ${production_rate}
p_or_t_vals = 0.0
mass_fraction_component = 11
point_file = production.bh
variable = f_Sr
[]
[produce_F]
type = PorousFlowPolyLineSink
SumQuantityUO = produced_mass_F
fluxes = ${production_rate}
p_or_t_vals = 0.0
mass_fraction_component = 12
point_file = production.bh
variable = f_F
[]
[produce_BOH]
type = PorousFlowPolyLineSink
SumQuantityUO = produced_mass_BOH
fluxes = ${production_rate}
p_or_t_vals = 0.0
mass_fraction_component = 13
point_file = production.bh
variable = f_BOH
[]
[produce_Br]
type = PorousFlowPolyLineSink
SumQuantityUO = produced_mass_Br
fluxes = ${production_rate}
p_or_t_vals = 0.0
mass_fraction_component = 14
point_file = production.bh
variable = f_Br
[]
[produce_Ba]
type = PorousFlowPolyLineSink
SumQuantityUO = produced_mass_Ba
fluxes = ${production_rate}
p_or_t_vals = 0.0
mass_fraction_component = 15
point_file = production.bh
variable = f_Ba
[]
[produce_Li]
type = PorousFlowPolyLineSink
SumQuantityUO = produced_mass_Li
fluxes = ${production_rate}
p_or_t_vals = 0.0
mass_fraction_component = 16
point_file = production.bh
variable = f_Li
[]
[produce_NO3]
type = PorousFlowPolyLineSink
SumQuantityUO = produced_mass_NO3
fluxes = ${production_rate}
p_or_t_vals = 0.0
mass_fraction_component = 17
point_file = production.bh
variable = f_NO3
[]
[produce_O2aq]
type = PorousFlowPolyLineSink
SumQuantityUO = produced_mass_O2aq
fluxes = ${production_rate}
p_or_t_vals = 0.0
mass_fraction_component = 18
point_file = production.bh
variable = f_O2aq
[]
[produce_H2O]
type = PorousFlowPolyLineSink
SumQuantityUO = produced_mass_H2O
fluxes = ${production_rate}
p_or_t_vals = 0.0
mass_fraction_component = 19
point_file = production.bh
variable = porepressure
[]
[produce_heat]
type = PorousFlowPolyLineSink
SumQuantityUO = produced_heat
fluxes = ${production_rate}
p_or_t_vals = 0.0
use_enthalpy = true
point_file = production.bh
variable = temperature
[]
[]
[UserObjects]
[injected_mass]
type = PorousFlowSumQuantity
[]
[produced_mass_H]
type = PorousFlowSumQuantity
[]
[produced_mass_Cl]
type = PorousFlowSumQuantity
[]
[produced_mass_SO4]
type = PorousFlowSumQuantity
[]
[produced_mass_HCO3]
type = PorousFlowSumQuantity
[]
[produced_mass_SiO2aq]
type = PorousFlowSumQuantity
[]
[produced_mass_Al]
type = PorousFlowSumQuantity
[]
[produced_mass_Ca]
type = PorousFlowSumQuantity
[]
[produced_mass_Mg]
type = PorousFlowSumQuantity
[]
[produced_mass_Fe]
type = PorousFlowSumQuantity
[]
[produced_mass_K]
type = PorousFlowSumQuantity
[]
[produced_mass_Na]
type = PorousFlowSumQuantity
[]
[produced_mass_Sr]
type = PorousFlowSumQuantity
[]
[produced_mass_F]
type = PorousFlowSumQuantity
[]
[produced_mass_BOH]
type = PorousFlowSumQuantity
[]
[produced_mass_Br]
type = PorousFlowSumQuantity
[]
[produced_mass_Ba]
type = PorousFlowSumQuantity
[]
[produced_mass_Li]
type = PorousFlowSumQuantity
[]
[produced_mass_NO3]
type = PorousFlowSumQuantity
[]
[produced_mass_O2aq]
type = PorousFlowSumQuantity
[]
[produced_mass_H2O]
type = PorousFlowSumQuantity
[]
[produced_heat]
type = PorousFlowSumQuantity
[]
[]
[Postprocessors]
[dt]
type = TimestepSize
execute_on = TIMESTEP_BEGIN
[]
[tot_kg_injected_this_timestep]
type = PorousFlowPlotQuantity
uo = injected_mass
[]
[kg_H_produced_this_timestep]
type = PorousFlowPlotQuantity
uo = produced_mass_H
[]
[kg_Cl_produced_this_timestep]
type = PorousFlowPlotQuantity
uo = produced_mass_Cl
[]
[kg_SO4_produced_this_timestep]
type = PorousFlowPlotQuantity
uo = produced_mass_SO4
[]
[kg_HCO3_produced_this_timestep]
type = PorousFlowPlotQuantity
uo = produced_mass_HCO3
[]
[kg_SiO2aq_produced_this_timestep]
type = PorousFlowPlotQuantity
uo = produced_mass_SiO2aq
[]
[kg_Al_produced_this_timestep]
type = PorousFlowPlotQuantity
uo = produced_mass_Al
[]
[kg_Ca_produced_this_timestep]
type = PorousFlowPlotQuantity
uo = produced_mass_Ca
[]
[kg_Mg_produced_this_timestep]
type = PorousFlowPlotQuantity
uo = produced_mass_Mg
[]
[kg_Fe_produced_this_timestep]
type = PorousFlowPlotQuantity
uo = produced_mass_Fe
[]
[kg_K_produced_this_timestep]
type = PorousFlowPlotQuantity
uo = produced_mass_K
[]
[kg_Na_produced_this_timestep]
type = PorousFlowPlotQuantity
uo = produced_mass_Na
[]
[kg_Sr_produced_this_timestep]
type = PorousFlowPlotQuantity
uo = produced_mass_Sr
[]
[kg_F_produced_this_timestep]
type = PorousFlowPlotQuantity
uo = produced_mass_F
[]
[kg_BOH_produced_this_timestep]
type = PorousFlowPlotQuantity
uo = produced_mass_BOH
[]
[kg_Br_produced_this_timestep]
type = PorousFlowPlotQuantity
uo = produced_mass_Br
[]
[kg_Ba_produced_this_timestep]
type = PorousFlowPlotQuantity
uo = produced_mass_Ba
[]
[kg_Li_produced_this_timestep]
type = PorousFlowPlotQuantity
uo = produced_mass_Li
[]
[kg_NO3_produced_this_timestep]
type = PorousFlowPlotQuantity
uo = produced_mass_NO3
[]
[kg_O2aq_produced_this_timestep]
type = PorousFlowPlotQuantity
uo = produced_mass_O2aq
[]
[kg_H2O_produced_this_timestep]
type = PorousFlowPlotQuantity
uo = produced_mass_H2O
[]
[mole_rate_H_produced]
type = FunctionValuePostprocessor
function = moles_H
indirect_dependencies = 'kg_H_produced_this_timestep dt'
[]
[mole_rate_Cl_produced]
type = FunctionValuePostprocessor
function = moles_Cl
indirect_dependencies = 'kg_Cl_produced_this_timestep dt'
[]
[mole_rate_SO4_produced]
type = FunctionValuePostprocessor
function = moles_SO4
indirect_dependencies = 'kg_SO4_produced_this_timestep dt'
[]
[mole_rate_HCO3_produced]
type = FunctionValuePostprocessor
function = moles_HCO3
indirect_dependencies = 'kg_HCO3_produced_this_timestep dt'
[]
[mole_rate_SiO2aq_produced]
type = FunctionValuePostprocessor
function = moles_SiO2aq
indirect_dependencies = 'kg_SiO2aq_produced_this_timestep dt'
[]
[mole_rate_Al_produced]
type = FunctionValuePostprocessor
function = moles_Al
indirect_dependencies = 'kg_Al_produced_this_timestep dt'
[]
[mole_rate_Ca_produced]
type = FunctionValuePostprocessor
function = moles_Ca
indirect_dependencies = 'kg_Ca_produced_this_timestep dt'
[]
[mole_rate_Mg_produced]
type = FunctionValuePostprocessor
function = moles_Mg
indirect_dependencies = 'kg_Mg_produced_this_timestep dt'
[]
[mole_rate_Fe_produced]
type = FunctionValuePostprocessor
function = moles_Fe
indirect_dependencies = 'kg_Fe_produced_this_timestep dt'
[]
[mole_rate_K_produced]
type = FunctionValuePostprocessor
function = moles_K
indirect_dependencies = 'kg_K_produced_this_timestep dt'
[]
[mole_rate_Na_produced]
type = FunctionValuePostprocessor
function = moles_Na
indirect_dependencies = 'kg_Na_produced_this_timestep dt'
[]
[mole_rate_Sr_produced]
type = FunctionValuePostprocessor
function = moles_Sr
indirect_dependencies = 'kg_Sr_produced_this_timestep dt'
[]
[mole_rate_F_produced]
type = FunctionValuePostprocessor
function = moles_F
indirect_dependencies = 'kg_F_produced_this_timestep dt'
[]
[mole_rate_BOH_produced]
type = FunctionValuePostprocessor
function = moles_BOH
indirect_dependencies = 'kg_BOH_produced_this_timestep dt'
[]
[mole_rate_Br_produced]
type = FunctionValuePostprocessor
function = moles_Br
indirect_dependencies = 'kg_Br_produced_this_timestep dt'
[]
[mole_rate_Ba_produced]
type = FunctionValuePostprocessor
function = moles_Ba
indirect_dependencies = 'kg_Ba_produced_this_timestep dt'
[]
[mole_rate_Li_produced]
type = FunctionValuePostprocessor
function = moles_Li
indirect_dependencies = 'kg_Li_produced_this_timestep dt'
[]
[mole_rate_NO3_produced]
type = FunctionValuePostprocessor
function = moles_NO3
indirect_dependencies = 'kg_NO3_produced_this_timestep dt'
[]
[mole_rate_O2aq_produced]
type = FunctionValuePostprocessor
function = moles_O2aq
indirect_dependencies = 'kg_O2aq_produced_this_timestep dt'
[]
[mole_rate_H2O_produced]
type = FunctionValuePostprocessor
function = moles_H2O
indirect_dependencies = 'kg_H2O_produced_this_timestep dt'
[]
[heat_joules_extracted_this_timestep]
type = PorousFlowPlotQuantity
uo = produced_heat
[]
[production_temperature]
type = AverageNodalVariableValue
boundary = production_nodes
variable = temperature
[]
[]
[Functions]
[moles_H]
type = ParsedFunction
symbol_names = 'kg_H dt'
symbol_values = 'kg_H_produced_this_timestep dt'
expression = 'kg_H * 1000 / 1.0079 / dt'
[]
[moles_Cl]
type = ParsedFunction
symbol_names = 'kg_Cl dt'
symbol_values = 'kg_Cl_produced_this_timestep dt'
expression = 'kg_Cl * 1000 / 35.453 / dt'
[]
[moles_SO4]
type = ParsedFunction
symbol_names = 'kg_SO4 dt'
symbol_values = 'kg_SO4_produced_this_timestep dt'
expression = 'kg_SO4 * 1000 / 96.0576 / dt'
[]
[moles_HCO3]
type = ParsedFunction
symbol_names = 'kg_HCO3 dt'
symbol_values = 'kg_HCO3_produced_this_timestep dt'
expression = 'kg_HCO3 * 1000 / 61.0171 / dt'
[]
[moles_SiO2aq]
type = ParsedFunction
symbol_names = 'kg_SiO2aq dt'
symbol_values = 'kg_SiO2aq_produced_this_timestep dt'
expression = 'kg_SiO2aq * 1000 / 60.0843 / dt'
[]
[moles_Al]
type = ParsedFunction
symbol_names = 'kg_Al dt'
symbol_values = 'kg_Al_produced_this_timestep dt'
expression = 'kg_Al * 1000 / 26.9815 / dt'
[]
[moles_Ca]
type = ParsedFunction
symbol_names = 'kg_Ca dt'
symbol_values = 'kg_Ca_produced_this_timestep dt'
expression = 'kg_Ca * 1000 / 40.08 / dt'
[]
[moles_Mg]
type = ParsedFunction
symbol_names = 'kg_Mg dt'
symbol_values = 'kg_Mg_produced_this_timestep dt'
expression = 'kg_Mg * 1000 / 24.305 / dt'
[]
[moles_Fe]
type = ParsedFunction
symbol_names = 'kg_Fe dt'
symbol_values = 'kg_Fe_produced_this_timestep dt'
expression = 'kg_Fe * 1000 / 55.847 / dt'
[]
[moles_K]
type = ParsedFunction
symbol_names = 'kg_K dt'
symbol_values = 'kg_K_produced_this_timestep dt'
expression = 'kg_K * 1000 / 39.0983 / dt'
[]
[moles_Na]
type = ParsedFunction
symbol_names = 'kg_Na dt'
symbol_values = 'kg_Na_produced_this_timestep dt'
expression = 'kg_Na * 1000 / 22.9898 / dt'
[]
[moles_Sr]
type = ParsedFunction
symbol_names = 'kg_Sr dt'
symbol_values = 'kg_Sr_produced_this_timestep dt'
expression = 'kg_Sr * 1000 / 87.62 / dt'
[]
[moles_F]
type = ParsedFunction
symbol_names = 'kg_F dt'
symbol_values = 'kg_F_produced_this_timestep dt'
expression = 'kg_F * 1000 / 18.9984 / dt'
[]
[moles_BOH]
type = ParsedFunction
symbol_names = 'kg_BOH dt'
symbol_values = 'kg_BOH_produced_this_timestep dt'
expression = 'kg_BOH * 1000 / 61.8329 / dt'
[]
[moles_Br]
type = ParsedFunction
symbol_names = 'kg_Br dt'
symbol_values = 'kg_Br_produced_this_timestep dt'
expression = 'kg_Br * 1000 / 79.904 / dt'
[]
[moles_Ba]
type = ParsedFunction
symbol_names = 'kg_Ba dt'
symbol_values = 'kg_Ba_produced_this_timestep dt'
expression = 'kg_Ba * 1000 / 137.33 / dt'
[]
[moles_Li]
type = ParsedFunction
symbol_names = 'kg_Li dt'
symbol_values = 'kg_Li_produced_this_timestep dt'
expression = 'kg_Li * 1000 / 6.941 / dt'
[]
[moles_NO3]
type = ParsedFunction
symbol_names = 'kg_NO3 dt'
symbol_values = 'kg_NO3_produced_this_timestep dt'
expression = 'kg_NO3 * 1000 / 62.0049 / dt'
[]
[moles_O2aq]
type = ParsedFunction
symbol_names = 'kg_O2aq dt'
symbol_values = 'kg_O2aq_produced_this_timestep dt'
expression = 'kg_O2aq * 1000 / 31.9988 / dt'
[]
[moles_H2O]
type = ParsedFunction
symbol_names = 'kg_H2O dt'
symbol_values = 'kg_H2O_produced_this_timestep dt'
expression = 'kg_H2O * 1000 / 18.01801802 / dt'
[]
[]
[AuxVariables]
[injection_temperature]
initial_condition = 92
[]
[injection_rate_massfrac_H]
initial_condition = -2.952985071156e-06
[]
[injection_rate_massfrac_Cl]
initial_condition = 0.04870664551708
[]
[injection_rate_massfrac_SO4]
initial_condition = 0.0060359986852517
[]
[injection_rate_massfrac_HCO3]
initial_condition = 5.0897287594019e-05
[]
[injection_rate_massfrac_SiO2aq]
initial_condition = 3.0246609868421e-05
[]
[injection_rate_massfrac_Al]
initial_condition = 3.268028901929e-08
[]
[injection_rate_massfrac_Ca]
initial_condition = 0.00082159428184586
[]
[injection_rate_massfrac_Mg]
initial_condition = 1.8546347062146e-05
[]
[injection_rate_massfrac_Fe]
initial_condition = 4.3291908204093e-05
[]
[injection_rate_massfrac_K]
initial_condition = 6.8434768308898e-05
[]
[injection_rate_massfrac_Na]
initial_condition = 0.033298053919671
[]
[injection_rate_massfrac_Sr]
initial_condition = 1.2771866652177e-05
[]
[injection_rate_massfrac_F]
initial_condition = 5.5648860174073e-06
[]
[injection_rate_massfrac_BOH]
initial_condition = 0.0003758574621917
[]
[injection_rate_massfrac_Br]
initial_condition = 9.0315286107068e-05
[]
[injection_rate_massfrac_Ba]
initial_condition = 1.5637460875161e-07
[]
[injection_rate_massfrac_Li]
initial_condition = 8.3017067912701e-05
[]
[injection_rate_massfrac_NO3]
initial_condition = 0.00010958455036169
[]
[injection_rate_massfrac_O2aq]
initial_condition = -7.0806852373351e-05
[]
[injection_rate_massfrac_H2O]
initial_condition = 0.91032275033842
[]
[rate_H]
[]
[rate_Cl]
[]
[rate_SO4]
[]
[rate_HCO3]
[]
[rate_SiO2aq]
[]
[rate_Al]
[]
[rate_Ca]
[]
[rate_Mg]
[]
[rate_Fe]
[]
[rate_K]
[]
[rate_Na]
[]
[rate_Sr]
[]
[rate_F]
[]
[rate_BOH]
[]
[rate_Br]
[]
[rate_Ba]
[]
[rate_Li]
[]
[rate_NO3]
[]
[rate_O2aq]
[]
[rate_H2O]
[]
[]
[MultiApps]
[react]
type = TransientMultiApp
input_files = aquifer_geochemistry.i
clone_master_mesh = true
execute_on = 'timestep_end'
[]
[]
[Transfers]
[changes_due_to_flow]
type = MultiAppCopyTransfer
source_variable = 'rate_H rate_Cl rate_SO4 rate_HCO3 rate_SiO2aq rate_Al rate_Ca rate_Mg rate_Fe rate_K rate_Na rate_Sr rate_F rate_BOH rate_Br rate_Ba rate_Li rate_NO3 rate_O2aq rate_H2O temperature'
variable = 'pf_rate_H pf_rate_Cl pf_rate_SO4 pf_rate_HCO3 pf_rate_SiO2aq pf_rate_Al pf_rate_Ca pf_rate_Mg pf_rate_Fe pf_rate_K pf_rate_Na pf_rate_Sr pf_rate_F pf_rate_BOH pf_rate_Br pf_rate_Ba pf_rate_Li pf_rate_NO3 pf_rate_O2aq pf_rate_H2O temperature'
to_multi_app = react
[]
[massfrac_from_geochem]
type = MultiAppCopyTransfer
source_variable = 'massfrac_H massfrac_Cl massfrac_SO4 massfrac_HCO3 massfrac_SiO2aq massfrac_Al massfrac_Ca massfrac_Mg massfrac_Fe massfrac_K massfrac_Na massfrac_Sr massfrac_F massfrac_BOH massfrac_Br massfrac_Ba massfrac_Li massfrac_NO3 massfrac_O2aq '
variable = 'f_H f_Cl f_SO4 f_HCO3 f_SiO2aq f_Al f_Ca f_Mg f_Fe f_K f_Na f_Sr f_F f_BOH f_Br f_Ba f_Li f_NO3 f_O2aq '
from_multi_app = react
[]
[]
(test/tests/transfers/multiapp_copy_transfer/vector-variable-transfer/parent_L2_LagrangeVec.i)
[Mesh]
type = GeneratedMesh
dim = 3
nx = 5
ny = 5
nz = 5
[]
[Problem]
solve = false
[]
[AuxVariables]
[sent_vector]
family = LAGRANGE_VEC
order = FIRST
[]
[]
[Functions]
[set_sent_vector]
type = ParsedVectorFunction
expression_x = '100*x*x'
expression_y = '100*y*y'
expression_z = '100*z*z'
[]
[]
[ICs]
# Set sent vector. We will check this in the subapp.
[set_sent_vector]
type = VectorFunctionIC
variable = sent_vector
function = set_sent_vector
[]
[]
[MultiApps]
[sub_app]
type = TransientMultiApp
positions = '0 0 0'
input_files = 'sub_L2_LagrangeVec.i'
execute_on = timestep_begin
[]
[]
[Transfers]
[push]
type = MultiAppCopyTransfer
to_multi_app = sub_app
source_variable = 'sent_vector'
variable = 'received_vector'
[]
[]
[Executioner]
type = Transient
dt = 1.0
start_time = 0.0
end_time = 1.0
[]
(test/tests/multiapps/clone_parent_mesh/main.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
[]
[]
[Variables/u]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[src]
type = BodyForce
variable = u
[]
[]
[BCs]
[dirichlet]
type = DirichletBC
variable = u
boundary = 'top right'
value = 0
[]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[AuxVariables]
[u_sub]
[]
[diff]
[]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
input_files = sub.i
clone_parent_mesh = true
[]
[]
[Transfers]
[transfer]
type = MultiAppCopyTransfer
from_multi_app = sub
variable = u_sub
source_variable = u
[]
[]
[AuxKernels]
[diff_aux]
type = ParsedAux
variable = diff
expression = 'abs(u - u_sub)'
coupled_variables = 'u u_sub'
[]
[]
[Postprocessors]
[diff_max]
type = ElementExtremeValue
variable = diff
[]
[]
[UserObjects]
[terminator]
type = Terminator
expression = 'diff_max > 1e-8'
fail_mode = HARD
error_level = ERROR
[]
[]
[Outputs]
exodus = true
[]
(test/tests/transfers/errors/from_sub.i)
[Problem]
solve = false
[]
[Mesh]
type = GeneratedMesh
dim = 2
[]
[MultiApps/sub]
type = TransientMultiApp
input_files = sub.i
[]
[Transfers/from_sub]
type = MultiAppCopyTransfer
direction = from_multiapp
source_variable = aux
variable = x
[]
[AuxVariables/x]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
execute_on = 'FINAL'
[]
(modules/combined/examples/geochem-porous_flow/geotes_2D/porous_flow.i)
# PorousFlow simulation of injection and production in a 2D aquifer
# Much of this file is standard porous-flow stuff. The unusual aspects are:
# - transfer of the rates of changes of each species (kg/s) to the aquifer_geochemistry.i simulation. This is achieved by saving these changes from the PorousFlowMassTimeDerivative residuals
# - transfer of the temperature field to the aquifer_geochemistry.i simulation
# Interesting behaviour can be simulated by this file without its "parent" simulation, exchanger.i. exchanger.i provides mass-fractions injected via the injection_rate_massfrac_* variables, but since these are more-or-less constant throughout the duration of the exchanger.i simulation, the initial_conditions specified below may be used. Similar, exchanger.i provides injection_temperature, but that is also constant.
injection_rate = -1.0 # kg/s/m, negative because injection as a source
production_rate = 1.0 # kg/s/m
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 14 # for better resolution, use 56 or 112
ny = 8 # for better resolution, use 32 or 64
xmin = -70
xmax = 70
ymin = -40
ymax = 40
[]
[injection_node]
input = gen
type = ExtraNodesetGenerator
new_boundary = injection_node
coord = '-30 0 0'
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[Variables]
[f0]
initial_condition = 0.002285946
[]
[f1]
initial_condition = 0.0035252
[]
[f2]
initial_condition = 1.3741E-05
[]
[porepressure]
initial_condition = 2E6
[]
[temperature]
initial_condition = 50
scaling = 1E-6 # fluid enthalpy is roughly 1E6
[]
[]
[BCs]
[injection_temperature]
type = MatchedValueBC
variable = temperature
v = injection_temperature
boundary = injection_node
[]
[]
[DiracKernels]
[inject_Na]
type = PorousFlowPolyLineSink
SumQuantityUO = injected_mass
fluxes = ${injection_rate}
p_or_t_vals = 0.0
line_length = 1.0
multiplying_var = injection_rate_massfrac_Na
point_file = injection.bh
variable = f0
[]
[inject_Cl]
type = PorousFlowPolyLineSink
SumQuantityUO = injected_mass
fluxes = ${injection_rate}
p_or_t_vals = 0.0
line_length = 1.0
multiplying_var = injection_rate_massfrac_Cl
point_file = injection.bh
variable = f1
[]
[inject_SiO2]
type = PorousFlowPolyLineSink
SumQuantityUO = injected_mass
fluxes = ${injection_rate}
p_or_t_vals = 0.0
line_length = 1.0
multiplying_var = injection_rate_massfrac_SiO2
point_file = injection.bh
variable = f2
[]
[inject_H2O]
type = PorousFlowPolyLineSink
SumQuantityUO = injected_mass
fluxes = ${injection_rate}
p_or_t_vals = 0.0
line_length = 1.0
multiplying_var = injection_rate_massfrac_H2O
point_file = injection.bh
variable = porepressure
[]
[produce_Na]
type = PorousFlowPolyLineSink
SumQuantityUO = produced_mass_Na
fluxes = ${production_rate}
p_or_t_vals = 0.0
line_length = 1.0
mass_fraction_component = 0
point_file = production.bh
variable = f0
[]
[produce_Cl]
type = PorousFlowPolyLineSink
SumQuantityUO = produced_mass_Cl
fluxes = ${production_rate}
p_or_t_vals = 0.0
line_length = 1.0
mass_fraction_component = 1
point_file = production.bh
variable = f1
[]
[produce_SiO2]
type = PorousFlowPolyLineSink
SumQuantityUO = produced_mass_SiO2
fluxes = ${production_rate}
p_or_t_vals = 0.0
line_length = 1.0
mass_fraction_component = 2
point_file = production.bh
variable = f2
[]
[produce_H2O]
type = PorousFlowPolyLineSink
SumQuantityUO = produced_mass_H2O
fluxes = ${production_rate}
p_or_t_vals = 0.0
line_length = 1.0
mass_fraction_component = 3
point_file = production.bh
variable = porepressure
[]
[produce_heat]
type = PorousFlowPolyLineSink
SumQuantityUO = produced_heat
fluxes = ${production_rate}
p_or_t_vals = 0.0
line_length = 1.0
use_enthalpy = true
point_file = production.bh
variable = temperature
[]
[]
[UserObjects]
[injected_mass]
type = PorousFlowSumQuantity
[]
[produced_mass_Na]
type = PorousFlowSumQuantity
[]
[produced_mass_Cl]
type = PorousFlowSumQuantity
[]
[produced_mass_SiO2]
type = PorousFlowSumQuantity
[]
[produced_mass_H2O]
type = PorousFlowSumQuantity
[]
[produced_heat]
type = PorousFlowSumQuantity
[]
[]
[Postprocessors]
[dt]
type = TimestepSize
execute_on = TIMESTEP_BEGIN
[]
[tot_kg_injected_this_timestep]
type = PorousFlowPlotQuantity
uo = injected_mass
[]
[kg_Na_produced_this_timestep]
type = PorousFlowPlotQuantity
uo = produced_mass_Na
[]
[kg_Cl_produced_this_timestep]
type = PorousFlowPlotQuantity
uo = produced_mass_Cl
[]
[kg_SiO2_produced_this_timestep]
type = PorousFlowPlotQuantity
uo = produced_mass_SiO2
[]
[kg_H2O_produced_this_timestep]
type = PorousFlowPlotQuantity
uo = produced_mass_H2O
[]
[mole_rate_Na_produced]
type = FunctionValuePostprocessor
function = moles_Na
indirect_dependencies = 'kg_Na_produced_this_timestep dt'
[]
[mole_rate_Cl_produced]
type = FunctionValuePostprocessor
function = moles_Cl
indirect_dependencies = 'kg_Cl_produced_this_timestep dt'
[]
[mole_rate_SiO2_produced]
type = FunctionValuePostprocessor
function = moles_SiO2
indirect_dependencies = 'kg_SiO2_produced_this_timestep dt'
[]
[mole_rate_H2O_produced]
type = FunctionValuePostprocessor
function = moles_H2O
indirect_dependencies = 'kg_H2O_produced_this_timestep dt'
[]
[heat_joules_extracted_this_timestep]
type = PorousFlowPlotQuantity
uo = produced_heat
[]
[production_temperature]
type = PointValue
point = '30 0 0'
variable = temperature
[]
[]
[Functions]
[moles_Na]
type = ParsedFunction
symbol_names = 'kg_Na dt'
symbol_values = 'kg_Na_produced_this_timestep dt'
expression = 'kg_Na * 1000 / 22.9898 / dt'
[]
[moles_Cl]
type = ParsedFunction
symbol_names = 'kg_Cl dt'
symbol_values = 'kg_Cl_produced_this_timestep dt'
expression = 'kg_Cl * 1000 / 35.453 / dt'
[]
[moles_SiO2]
type = ParsedFunction
symbol_names = 'kg_SiO2 dt'
symbol_values = 'kg_SiO2_produced_this_timestep dt'
expression = 'kg_SiO2 * 1000 / 60.0843 / dt'
[]
[moles_H2O]
type = ParsedFunction
symbol_names = 'kg_H2O dt'
symbol_values = 'kg_H2O_produced_this_timestep dt'
expression = 'kg_H2O * 1000 / 18.0152 / dt'
[]
[]
[FluidProperties]
[the_simple_fluid]
type = SimpleFluidProperties
thermal_expansion = 0
bulk_modulus = 2E9
viscosity = 1E-3
density0 = 1000
cv = 4000.0
cp = 4000.0
[]
[]
[PorousFlowFullySaturated]
coupling_type = ThermoHydro
porepressure = porepressure
temperature = temperature
mass_fraction_vars = 'f0 f1 f2'
save_component_rate_in = 'rate_Na rate_Cl rate_SiO2 rate_H2O' # change in kg at every node / dt
fp = the_simple_fluid
temperature_unit = Celsius
[]
[AuxVariables]
[injection_temperature]
initial_condition = 200
[]
[injection_rate_massfrac_Na]
initial_condition = 0.002285946
[]
[injection_rate_massfrac_Cl]
initial_condition = 0.0035252
[]
[injection_rate_massfrac_SiO2]
initial_condition = 1.3741E-05
[]
[injection_rate_massfrac_H2O]
initial_condition = 0.994175112
[]
[rate_H2O]
[]
[rate_Na]
[]
[rate_Cl]
[]
[rate_SiO2]
[]
[]
[Materials]
[porosity]
type = PorousFlowPorosityConst # this simulation has no porosity changes from dissolution
porosity = 0.1
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1E-12 0 0 0 1E-12 0 0 0 1E-12'
[]
[thermal_conductivity]
type = PorousFlowThermalConductivityIdeal
dry_thermal_conductivity = '0 0 0 0 0 0 0 0 0'
[]
[rock_heat]
type = PorousFlowMatrixInternalEnergy
density = 2500.0
specific_heat_capacity = 1200.0
[]
[]
[Preconditioning]
active = typically_efficient
[typically_efficient]
type = SMP
full = true
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = ' hypre boomeramg'
[]
[strong]
type = SMP
full = true
petsc_options = '-ksp_diagonal_scale -ksp_diagonal_scale_fix'
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
petsc_options_value = ' asm ilu NONZERO 2'
[]
[probably_too_strong]
type = SMP
full = true
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = ' lu mumps'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 7.76E6 # 90 days
dt = 1E5
[]
[Outputs]
exodus = true
[]
[MultiApps]
[react]
type = TransientMultiApp
input_files = aquifer_geochemistry.i
clone_master_mesh = true
execute_on = 'timestep_end'
[]
[]
[Transfers]
[changes_due_to_flow]
type = MultiAppCopyTransfer
source_variable = 'rate_H2O rate_Na rate_Cl rate_SiO2 temperature'
variable = 'pf_rate_H2O pf_rate_Na pf_rate_Cl pf_rate_SiO2 temperature'
to_multi_app = react
[]
[massfrac_from_geochem]
type = MultiAppCopyTransfer
source_variable = 'massfrac_Na massfrac_Cl massfrac_SiO2'
variable = 'f0 f1 f2'
from_multi_app = react
[]
[]
(test/tests/transfers/multiapp_copy_transfer/errors/parent.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 = Transient
num_steps = 1
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = timestep_end
[../]
[]
[Transfers]
[./to_sub]
type = MultiAppCopyTransfer
source_variable = u
variable = u
to_multi_app = sub
[../]
[]
(test/tests/multiapps/relaxation/picard_relaxed_array_parent.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
[]
[]
[Variables]
[u]
components = 2
[]
[]
[AuxVariables]
[v]
components = 2
initial_condition = '1 1'
[]
[inverse_v]
components = 2
initial_condition = '1 1'
[]
[]
[Kernels]
[diff]
type = ArrayDiffusion
variable = u
diffusion_coefficient = dc
[]
[time]
type = ArrayTimeDerivative
variable = u
time_derivative_coefficient = tc
[]
[force_u]
type = ArrayCoupledForce
variable = u
v = inverse_v
is_v_array = true
coef = '1 1'
[]
[]
[AuxKernels]
[invert_v]
type = ArrayQuotientAux
variable = inverse_v
denominator = v
numerator = '20 20'
[]
[]
[BCs]
[left]
type = ArrayDirichletBC
variable = u
boundary = left
values = '0 0'
[]
[Neumann_right]
type = ArrayNeumannBC
variable = u
boundary = right
value = '1 1'
[]
[]
[Materials]
[dc]
type = GenericConstantArray
prop_name = dc
prop_value = '0.1 0.1'
[]
[tc]
type = GenericConstantArray
prop_name = tc
prop_value = '1 1'
[]
[]
[Postprocessors]
[picard_its]
type = NumFixedPointIterations
execute_on = 'initial timestep_end'
[]
[]
[Executioner]
type = Transient
num_steps = 4
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 30
nl_abs_tol = 1e-14
relaxation_factor = 0.8
transformed_variables = u
[]
[Outputs]
exodus = true
execute_on = 'INITIAL TIMESTEP_END'
[]
[MultiApps]
[sub]
type = TransientMultiApp
execute_on = timestep_begin
input_files = picard_relaxed_array_sub.i
[]
[]
[Transfers]
[v_from_sub]
type = MultiAppCopyTransfer
from_multi_app = sub
source_variable = v
variable = v
[]
[u_to_sub]
type = MultiAppCopyTransfer
to_multi_app = sub
source_variable = u
variable = u
[]
[]
(modules/combined/test/tests/optimization/invOpt_nonlinear/main.i)
[Optimization]
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmax = 2
ymax = 2
[]
[OptimizationReporter]
type = OptimizationReporter
parameter_names = 'heat_source'
num_values = '1'
initial_condition = '0'
lower_bounds = '0.1'
upper_bounds = '10000'
measurement_points = '0.2 0.2 0
0.8 0.6 0
0.2 1.4 0
0.8 1.8 0'
measurement_values = '1.98404 1.91076 1.56488 1.23863'
[]
[Executioner]
type = Optimize
tao_solver = taonls
petsc_options_iname = '-tao_gttol -tao_max_it -tao_nls_pc_type -tao_nls_ksp_type'
petsc_options_value = ' 1e-5 5 none cg'
verbose = true
[]
[MultiApps]
[forward]
type = FullSolveMultiApp
input_files = forward.i
execute_on = FORWARD
clone_parent_mesh = true
[]
[homogeneous_forward]
type = FullSolveMultiApp
input_files = homogeneous_forward.i
execute_on = HOMOGENEOUS_FORWARD
clone_parent_mesh = true
[]
[adjoint]
type = FullSolveMultiApp
input_files = adjoint.i
execute_on = ADJOINT
clone_parent_mesh = true
[]
[]
[Transfers]
## RUN FORWARD SIMULATION WITH CURRENT PARAMETERS AS FORCE,
## AND EXTRACT SIMULATED VALUES AT MEASUREMENT POINTS
## AS WELL AS TOTAL FIELD VARIABLE FOR NONLINEAR PURPOSES
[MeasurementLocationsToForward]
type = MultiAppReporterTransfer
to_multi_app = forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/heat_source'
to_reporters = 'measurement_locations/measurement_xcoord
measurement_locations/measurement_ycoord
measurement_locations/measurement_zcoord
measurement_locations/measurement_time
measurement_locations/measurement_values
params/heat_source'
[]
[SimulatedDataFromForward]
type = MultiAppReporterTransfer
from_multi_app = forward
from_reporters = 'measurement_locations/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
### RUN THE HOMOGENEOUS_FORWARD WITH CURRENT NONLINEAR STATE, PARAMETER_STEP,
### AND EXTRACT SIMULATED DATA AT MEASURMENT POINTS
[CurrentStateFromForwardNonlinearToHomogeneousForwardNonlinear]
type = MultiAppCopyTransfer
from_multi_app = forward
to_multi_app = homogeneous_forward
source_variable = 'forwardT'
variable = 'forwardT'
[]
[MeasurementLocationsToHomogeneousForward]
type = MultiAppReporterTransfer
to_multi_app = homogeneous_forward
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/measurement_values
OptimizationReporter/heat_source'
to_reporters = 'measurement_locations/measurement_xcoord
measurement_locations/measurement_ycoord
measurement_locations/measurement_zcoord
measurement_locations/measurement_time
measurement_locations/measurement_values
params/heat_source'
[]
[SimulatedDataFromHomogeneousForward]
type = MultiAppReporterTransfer
from_multi_app = homogeneous_forward
from_reporters = 'measurement_locations/simulation_values'
to_reporters = 'OptimizationReporter/simulation_values'
[]
### RUN THE ADJOINT WITH CURRENT NONLINEAR STATE, WITH MISFIT AS EXCITATION,
### AND EXTRACT GRADIENT
[CurrentStateToAdjointNonlinear]
type = MultiAppCopyTransfer
from_multi_app = forward
to_multi_app = adjoint
source_variable = 'forwardT'
variable = 'forwardT'
[]
[MisfitToAdjoint]
type = MultiAppReporterTransfer
to_multi_app = adjoint
from_reporters = 'OptimizationReporter/measurement_xcoord
OptimizationReporter/measurement_ycoord
OptimizationReporter/measurement_zcoord
OptimizationReporter/measurement_time
OptimizationReporter/misfit_values
OptimizationReporter/heat_source'
to_reporters = 'misfit/measurement_xcoord
misfit/measurement_ycoord
misfit/measurement_zcoord
misfit/measurement_time
misfit/misfit_values
params/heat_source'
[]
[GradientFromAdjoint]
type = MultiAppReporterTransfer
from_multi_app = adjoint
from_reporters = 'gradient_vpp/inner_product'
to_reporters = 'OptimizationReporter/grad_heat_source'
[]
[]
[Reporters]
[optInfo]
type = OptimizationInfo
[]
[]
[Outputs]
csv = true
[]
(modules/porous_flow/examples/multiapp_fracture_flow/diffusion_multiapp/fracture_app.i)
# Temperature is transferred between the fracture and matrix apps
[Mesh]
[generate]
type = GeneratedMeshGenerator
dim = 1
nx = 100
xmin = 0
xmax = 50.0
[]
[]
[Variables]
[frac_T]
[]
[]
[ICs]
[frac_T]
type = FunctionIC
variable = frac_T
function = 'if(x<1E-6, 2, 0)' # delta function
[]
[]
[AuxVariables]
[transferred_matrix_T]
[]
[]
[Kernels]
[dot]
type = TimeDerivative
variable = frac_T
[]
[fracture_diffusion]
type = Diffusion
variable = frac_T
[]
[toMatrix]
type = PorousFlowHeatMassTransfer
variable = frac_T
v = transferred_matrix_T
transfer_coefficient = 0.004
[]
[]
[Preconditioning]
[entire_jacobian]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
dt = 100
end_time = 100
[]
[VectorPostprocessors]
[final_results]
type = LineValueSampler
start_point = '0 0 0'
end_point = '50 0 0'
num_points = 11
sort_by = x
variable = frac_T
outputs = final_csv
[]
[]
[Outputs]
print_linear_residuals = false
[final_csv]
type = CSV
sync_times = 100
sync_only = true
[]
[]
[MultiApps]
[matrix_app]
type = TransientMultiApp
input_files = matrix_app.i
execute_on = TIMESTEP_END
[]
[]
[Transfers]
[T_to_matrix]
type = MultiAppCopyTransfer
to_multi_app = matrix_app
source_variable = frac_T
variable = transferred_frac_T
[]
[T_from_matrix]
type = MultiAppCopyTransfer
from_multi_app = matrix_app
source_variable = matrix_T
variable = transferred_matrix_T
[]
[]
(test/tests/transfers/multiapp_copy_transfer/multivariable_copy/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
# Create two variables
[./u]
[../]
[./v]
[../]
[]
[Problem]
type = FEProblem
solve = false
[]
[Executioner]
type = Transient
num_steps = 1
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = initial
[../]
[]
[Transfers]
# Transfer both variables by inputting a vector of their names
[./from_sub]
type = MultiAppCopyTransfer
source_variable = 'u v'
variable = 'u v'
from_multi_app = sub
[../]
[]
[Outputs]
exodus = true
[]
(modules/combined/examples/geochem-porous_flow/forge/porous_flow.i)
# Input file modified from RobPodgorney version
# - 2D instead of 3D with different resolution. Effectively this means a 1m height of RobPodgorney aquifer is simulated. RobPodgorney total mass flux is 2.5kg/s meaning 0.25kg/s is appropriate here
# - Celsius instead of Kelvin
# - no use of PorousFlowPointEnthalpySourceFromPostprocessor since that is not yet merged into MOOSE: a DirichletBC is used instead
# - Use of PorousFlowFullySaturated instead of PorousFlowUnsaturated, and the save_component_rate_in feature to record the change in kg of each species at each node for passing to the Geochem simulation
# - MultiApps and Transfers to transfer information between this simulation and the aquifer_geochemistry.i simulation
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 225
ny = 200
xmin = -400
xmax = 500
ymin = -400
ymax = 400
[]
[injection_node]
input = gen
type = ExtraNodesetGenerator
new_boundary = injection_node
coord = '0 0 0'
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[Variables]
[f_H]
initial_condition = 8.201229858451E-07
[]
[f_Na]
initial_condition = 2.281094143525E-03
[]
[f_K]
initial_condition = 2.305489507836E-04
[]
[f_Ca]
initial_condition = 5.818776782059E-04
[]
[f_Mg]
initial_condition = 1.539513498238E-07
[]
[f_SiO2]
initial_condition = 2.691822196469E-04
[]
[f_Al]
initial_condition = 4.457519474122E-08
[]
[f_Cl]
initial_condition = 4.744309776594E-03
[]
[f_SO4]
initial_condition = 9.516650880811E-06
[]
[f_HCO3]
initial_condition = 5.906126982324E-05
[]
[porepressure]
initial_condition = 20E6
[]
[temperature]
initial_condition = 220 # degC
scaling = 1E-6 # fluid enthalpy is roughly 1E6
[]
[]
[BCs]
[source_temperature]
type = DirichletBC
boundary = injection_node
variable = temperature
value = 70 # degC
[]
[]
[DiracKernels]
[inject_H]
type = PorousFlowPointSourceFromPostprocessor
point = ' 0 0 0'
mass_flux = 4.790385871045E-08
variable = f_H
[]
[inject_Na]
type = PorousFlowPointSourceFromPostprocessor
point = ' 0 0 0'
mass_flux = 7.586252963780E-07
variable = f_Na
[]
[inject_K]
type = PorousFlowPointSourceFromPostprocessor
point = ' 0 0 0'
mass_flux = 2.746517625125E-07
variable = f_K
[]
[inject_Ca]
type = PorousFlowPointSourceFromPostprocessor
point = ' 0 0 0'
mass_flux = 7.775129478597E-07
variable = f_Ca
[]
[inject_Mg]
type = PorousFlowPointSourceFromPostprocessor
point = ' 0 0 0'
mass_flux = 1.749872109005E-07
variable = f_Mg
[]
[inject_SiO2]
type = PorousFlowPointSourceFromPostprocessor
point = ' 0 0 0'
mass_flux = 4.100547515915E-06
variable = f_SiO2
[]
[inject_Al]
type = PorousFlowPointSourceFromPostprocessor
point = ' 0 0 0'
mass_flux = 2.502408592080E-08
variable = f_Al
[]
[inject_Cl]
type = PorousFlowPointSourceFromPostprocessor
point = ' 0 0 0'
mass_flux = 1.997260386272E-06
variable = f_Cl
[]
[inject_SO4]
type = PorousFlowPointSourceFromPostprocessor
point = ' 0 0 0'
mass_flux = 2.497372164191E-07
variable = f_SO4
[]
[inject_HCO3]
type = PorousFlowPointSourceFromPostprocessor
point = ' 0 0 0'
mass_flux = 5.003150992902E-06
variable = f_HCO3
[]
[inject_H2O]
type = PorousFlowPointSourceFromPostprocessor
point = ' 0 0 0'
mass_flux = 2.499865905987E-01
variable = porepressure
[]
[produce_H]
type = PorousFlowPeacemanBorehole
variable = f_H
SumQuantityUO = produced_mass_H
mass_fraction_component = 0
point_file = production.bh
line_length = 1
bottom_p_or_t = 20E6
unit_weight = '0 0 0'
use_mobility = true
character = 1
[]
[produce_Na]
type = PorousFlowPeacemanBorehole
variable = f_Na
SumQuantityUO = produced_mass_Na
mass_fraction_component = 1
point_file = production.bh
line_length = 1
bottom_p_or_t = 20E6
unit_weight = '0 0 0'
use_mobility = true
character = 1
[]
[produce_K]
type = PorousFlowPeacemanBorehole
variable = f_K
SumQuantityUO = produced_mass_K
mass_fraction_component = 2
point_file = production.bh
line_length = 1
bottom_p_or_t = 20E6
unit_weight = '0 0 0'
use_mobility = true
character = 1
[]
[produce_Ca]
type = PorousFlowPeacemanBorehole
variable = f_Ca
SumQuantityUO = produced_mass_Ca
mass_fraction_component = 3
point_file = production.bh
line_length = 1
bottom_p_or_t = 20E6
unit_weight = '0 0 0'
use_mobility = true
character = 1
[]
[produce_Mg]
type = PorousFlowPeacemanBorehole
variable = f_Mg
SumQuantityUO = produced_mass_Mg
mass_fraction_component = 4
point_file = production.bh
line_length = 1
bottom_p_or_t = 20E6
unit_weight = '0 0 0'
use_mobility = true
character = 1
[]
[produce_SiO2]
type = PorousFlowPeacemanBorehole
variable = f_SiO2
SumQuantityUO = produced_mass_SiO2
mass_fraction_component = 5
point_file = production.bh
line_length = 1
bottom_p_or_t = 20E6
unit_weight = '0 0 0'
use_mobility = true
character = 1
[]
[produce_Al]
type = PorousFlowPeacemanBorehole
variable = f_Al
SumQuantityUO = produced_mass_Al
mass_fraction_component = 6
point_file = production.bh
line_length = 1
bottom_p_or_t = 20E6
unit_weight = '0 0 0'
use_mobility = true
character = 1
[]
[produce_Cl]
type = PorousFlowPeacemanBorehole
variable = f_Cl
SumQuantityUO = produced_mass_Cl
mass_fraction_component = 7
point_file = production.bh
line_length = 1
bottom_p_or_t = 20E6
unit_weight = '0 0 0'
use_mobility = true
character = 1
[]
[produce_SO4]
type = PorousFlowPeacemanBorehole
variable = f_SO4
SumQuantityUO = produced_mass_SO4
mass_fraction_component = 8
point_file = production.bh
line_length = 1
bottom_p_or_t = 20E6
unit_weight = '0 0 0'
use_mobility = true
character = 1
[]
[produce_HCO3]
type = PorousFlowPeacemanBorehole
variable = f_HCO3
SumQuantityUO = produced_mass_HCO3
mass_fraction_component = 9
point_file = production.bh
line_length = 1
bottom_p_or_t = 20E6
unit_weight = '0 0 0'
use_mobility = true
character = 1
[]
[produce_H2O]
type = PorousFlowPeacemanBorehole
variable = porepressure
SumQuantityUO = produced_mass_H2O
mass_fraction_component = 10
point_file = production.bh
line_length = 1
bottom_p_or_t = 20E6
unit_weight = '0 0 0'
use_mobility = true
character = 1
[]
[remove_heat_at_production_well]
type = PorousFlowPeacemanBorehole
variable = temperature
SumQuantityUO = produced_heat
point_file = production.bh
line_length = 1
bottom_p_or_t = 20E6
unit_weight = '0 0 0'
use_mobility = true
use_enthalpy = true
character = 1
[]
[]
[UserObjects]
[produced_mass_H]
type = PorousFlowSumQuantity
[]
[produced_mass_Na]
type = PorousFlowSumQuantity
[]
[produced_mass_K]
type = PorousFlowSumQuantity
[]
[produced_mass_Ca]
type = PorousFlowSumQuantity
[]
[produced_mass_Mg]
type = PorousFlowSumQuantity
[]
[produced_mass_SiO2]
type = PorousFlowSumQuantity
[]
[produced_mass_Al]
type = PorousFlowSumQuantity
[]
[produced_mass_Cl]
type = PorousFlowSumQuantity
[]
[produced_mass_SO4]
type = PorousFlowSumQuantity
[]
[produced_mass_HCO3]
type = PorousFlowSumQuantity
[]
[produced_mass_H2O]
type = PorousFlowSumQuantity
[]
[produced_heat]
type = PorousFlowSumQuantity
[]
[]
[Postprocessors]
[heat_extracted]
type = PorousFlowPlotQuantity
uo = produced_heat
[]
[approx_production_temperature]
type = PointValue
point = '100 0 0'
variable = temperature
[]
[mass_extracted_H]
type = PorousFlowPlotQuantity
uo = produced_mass_H
execute_on = 'initial timestep_end'
[]
[mass_extracted_Na]
type = PorousFlowPlotQuantity
uo = produced_mass_Na
execute_on = 'initial timestep_end'
[]
[mass_extracted_K]
type = PorousFlowPlotQuantity
uo = produced_mass_K
execute_on = 'initial timestep_end'
[]
[mass_extracted_Ca]
type = PorousFlowPlotQuantity
uo = produced_mass_Ca
execute_on = 'initial timestep_end'
[]
[mass_extracted_Mg]
type = PorousFlowPlotQuantity
uo = produced_mass_Mg
execute_on = 'initial timestep_end'
[]
[mass_extracted_SiO2]
type = PorousFlowPlotQuantity
uo = produced_mass_SiO2
execute_on = 'initial timestep_end'
[]
[mass_extracted_Al]
type = PorousFlowPlotQuantity
uo = produced_mass_Al
execute_on = 'initial timestep_end'
[]
[mass_extracted_Cl]
type = PorousFlowPlotQuantity
uo = produced_mass_Cl
execute_on = 'initial timestep_end'
[]
[mass_extracted_SO4]
type = PorousFlowPlotQuantity
uo = produced_mass_SO4
execute_on = 'initial timestep_end'
[]
[mass_extracted_HCO3]
type = PorousFlowPlotQuantity
uo = produced_mass_HCO3
execute_on = 'initial timestep_end'
[]
[mass_extracted_H2O]
type = PorousFlowPlotQuantity
uo = produced_mass_H2O
execute_on = 'initial timestep_end'
[]
[mass_extracted]
type = LinearCombinationPostprocessor
pp_names = 'mass_extracted_H mass_extracted_Na mass_extracted_K mass_extracted_Ca mass_extracted_Mg mass_extracted_SiO2 mass_extracted_Al mass_extracted_Cl mass_extracted_SO4 mass_extracted_HCO3 mass_extracted_H2O'
pp_coefs = '1 1 1 1 1 1 1 1 1 1 1'
execute_on = 'initial timestep_end'
[]
[dt]
type = TimestepSize
execute_on = 'timestep_begin'
[]
[]
[FluidProperties]
[the_simple_fluid]
type = SimpleFluidProperties
thermal_expansion = 2E-4
bulk_modulus = 2E9
viscosity = 1E-3
density0 = 980
cv = 4000.0
cp = 4000.0
porepressure_coefficient = 0
[]
[]
[PorousFlowFullySaturated]
coupling_type = ThermoHydro
porepressure = porepressure
temperature = temperature
mass_fraction_vars = 'f_H f_Na f_K f_Ca f_Mg f_SiO2 f_Al f_Cl f_SO4 f_HCO3'
save_component_rate_in = 'rate_H rate_Na rate_K rate_Ca rate_Mg rate_SiO2 rate_Al rate_Cl rate_SO4 rate_HCO3 rate_H2O' # change in kg at every node / dt
fp = the_simple_fluid
temperature_unit = Celsius
[]
[AuxVariables]
[rate_H]
[]
[rate_Na]
[]
[rate_K]
[]
[rate_Ca]
[]
[rate_Mg]
[]
[rate_SiO2]
[]
[rate_Al]
[]
[rate_Cl]
[]
[rate_SO4]
[]
[rate_HCO3]
[]
[rate_H2O]
[]
[]
[Materials]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.01
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1E-14 0 0 0 1E-14 0 0 0 1E-14'
[]
[thermal_conductivity]
type = PorousFlowThermalConductivityIdeal
dry_thermal_conductivity = '2.5 0 0 0 2.5 0 0 0 2.5'
[]
[rock_heat]
type = PorousFlowMatrixInternalEnergy
density = 2750.0
specific_heat_capacity = 900.0
[]
[]
[Preconditioning]
active = typically_efficient
[typically_efficient]
type = SMP
full = true
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = ' hypre boomeramg'
[]
[strong]
type = SMP
full = true
petsc_options = '-ksp_diagonal_scale -ksp_diagonal_scale_fix'
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
petsc_options_value = ' asm ilu NONZERO 2'
[]
[probably_too_strong]
type = SMP
full = true
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = ' lu mumps'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 31536000 #1 year
[TimeStepper]
type = SolutionTimeAdaptiveDT
dt = 500
[]
[]
[Outputs]
exodus = true
csv = true
[]
[MultiApps]
[react]
type = TransientMultiApp
input_files = aquifer_geochemistry.i
clone_master_mesh = true
execute_on = 'timestep_end'
[]
[]
[Transfers]
[changes_due_to_flow]
type = MultiAppCopyTransfer
source_variable = 'rate_H rate_Na rate_K rate_Ca rate_Mg rate_SiO2 rate_Al rate_Cl rate_SO4 rate_HCO3 rate_H2O temperature'
variable = 'pf_rate_H pf_rate_Na pf_rate_K pf_rate_Ca pf_rate_Mg pf_rate_SiO2 pf_rate_Al pf_rate_Cl pf_rate_SO4 pf_rate_HCO3 pf_rate_H2O temperature'
to_multi_app = react
[]
[massfrac_from_geochem]
type = MultiAppCopyTransfer
source_variable = 'massfrac_H massfrac_Na massfrac_K massfrac_Ca massfrac_Mg massfrac_SiO2 massfrac_Al massfrac_Cl massfrac_SO4 massfrac_HCO3'
variable = 'f_H f_Na f_K f_Ca f_Mg f_SiO2 f_Al f_Cl f_SO4 f_HCO3'
from_multi_app = react
[]
[]
(test/tests/transfers/multiapp_copy_transfer/array_variable_transfer/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
# Array variable with two components
[v]
order = FIRST
family = LAGRANGE
components = 2
[]
[]
[Problem]
type = FEProblem
solve = false
[]
[Executioner]
type = Transient
num_steps = 1
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = initial
[../]
[]
[Transfers]
# Transfers all components together on the same mesh.
[./from_sub]
type = MultiAppCopyTransfer
source_variable = u
variable = v
from_multi_app = sub
[../]
[]
[Outputs]
exodus = true
[]
(test/tests/transfers/multiapp_copy_transfer/linear_lagrange_from_sub/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Problem]
type = FEProblem
solve = false
[]
[Executioner]
type = Transient
num_steps = 1
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = initial
[../]
[]
[Transfers]
[./from_sub]
type = MultiAppCopyTransfer
source_variable = u
variable = u
from_multi_app = sub
[../]
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/multiapp-scalar-transport/fluid-flow.i)
mu=1
rho=1
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method='average'
velocity_interp_method='rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = -1
ymax = 1
nx = 100
ny = 20
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = 1
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1
[]
[pressure]
type = INSFVPressureVariable
[]
[]
[AuxVariables]
[ax_out]
type = MooseVariableFVReal
[]
[ay_out]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[ax_out]
type = FunctorAux
functor = ax
variable = ax_out
execute_on = timestep_end
[]
[ay_out]
type = FunctorAux
functor = ay
variable = ay_out
execute_on = timestep_end
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = ${rho}
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = u
function = '1'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = v
function = 0
[]
[walls-u]
type = INSFVNoSlipWallBC
boundary = 'top bottom'
variable = u
function = 0
[]
[walls-v]
type = INSFVNoSlipWallBC
boundary = 'top bottom'
variable = v
function = 0
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = 0
[]
[]
[MultiApps]
[scalar]
type = FullSolveMultiApp
execute_on = 'timestep_end'
input_files = 'scalar-transport.i'
[]
[]
[Transfers]
[ax]
type = MultiAppCopyTransfer
source_variable = ax_out
variable = ax
execute_on = 'timestep_end'
to_multi_app = 'scalar'
[]
[ay]
type = MultiAppCopyTransfer
source_variable = ay_out
variable = ay
execute_on = 'timestep_end'
to_multi_app = 'scalar'
[]
[u]
type = MultiAppCopyTransfer
source_variable = u
variable = u
execute_on = 'timestep_end'
to_multi_app = 'scalar'
[]
[v]
type = MultiAppCopyTransfer
source_variable = v
variable = v
execute_on = 'timestep_end'
to_multi_app = 'scalar'
[]
[pressure]
type = MultiAppCopyTransfer
source_variable = pressure
variable = pressure
execute_on = 'timestep_end'
to_multi_app = 'scalar'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
line_search = 'none'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(test/tests/transfers/multiapp_copy_transfer/aux_to_primary/from_sub.i)
[Problem]
solve = false
[]
[Mesh]
type = GeneratedMesh
dim = 2
[]
[Variables]
[main]
initial_condition = 1938
[]
[]
[MultiApps/sub]
type = TransientMultiApp
input_files = sub.i
[]
[Transfers/from_sub]
type = MultiAppCopyTransfer
from_multi_app = sub
source_variable = sub
variable = main
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
execute_on = 'FINAL'
exodus = true
[]
(test/tests/transfers/multiapp_copy_transfer/aux_to_aux/to_sub.i)
[Problem]
solve = false
[]
[Mesh]
type = GeneratedMesh
dim = 2
[]
[MultiApps/sub]
type = TransientMultiApp
input_files = sub.i
[]
[Transfers/from_sub]
type = MultiAppCopyTransfer
to_multi_app = sub
source_variable = x
variable = aux
[]
[AuxVariables/x]
initial_condition = 1949
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
execute_on = 'FINAL'
exodus = true
[]
(test/tests/transfers/multiapp_copy_transfer/linear_lagrange_to_sub/parent.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 = Transient
num_steps = 1
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = timestep_end
[../]
[]
[Transfers]
[./to_sub]
type = MultiAppCopyTransfer
source_variable = u
variable = u
to_multi_app = sub
[../]
[]
[Outputs]
exodus = true
[]
(modules/combined/examples/optimization/thermomechanical/thermomechanical_main.i)
vol_frac = 0.4
power = 2.0
E0 = 1.0e-6
E1 = 1.0
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[MeshGenerator]
type = GeneratedMeshGenerator
dim = 2
nx = 40
ny = 40
xmin = 0
xmax = 40
ymin = 0
ymax = 40
[]
[node]
type = ExtraNodesetGenerator
input = MeshGenerator
new_boundary = hold
nodes = 0
[]
[push_left]
type = ExtraNodesetGenerator
input = node
new_boundary = push_left
coord = '16 0 0'
[]
[push_center]
type = ExtraNodesetGenerator
input = push_left
new_boundary = push_center
coord = '24 0 0'
[]
[extra]
type = SideSetsFromBoundingBoxGenerator
input = push_center
bottom_left = '-0.01 17.999 0'
top_right = '5 22.001 0'
boundary_new = n1
boundaries_old = left
[]
[dirichlet_bc]
type = SideSetsFromNodeSetsGenerator
input = extra
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[AuxVariables]
[mat_den]
family = MONOMIAL
order = FIRST
initial_condition = 0.02
[]
[sensitivity_one]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[sensitivity_two]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[total_sensitivity]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[]
[]
[AuxKernels]
[total_sensitivity]
type = ParsedAux
variable = total_sensitivity
expression = '(1-1.0e-7)*sensitivity_one + 1.0e-7*sensitivity_two'
coupled_variables = 'sensitivity_one sensitivity_two'
execute_on = 'LINEAR TIMESTEP_END'
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = hold
value = 0.0
[]
[no_x_symm]
type = DirichletBC
variable = disp_x
boundary = right
value = 0.0
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'mat_den'
[]
[E_phys]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${E1} + (mat_den ^ ${power}) * (${E1}-${E0})'
coupled_variables = 'mat_den'
property_name = E_phys
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
# We do filtering in the subapps
[update]
type = DensityUpdate
density_sensitivity = total_sensitivity
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = MULTIAPP_FIXED_POINT_BEGIN
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-8
dt = 1.0
num_steps = 2
[]
[Outputs]
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
exodus = true
[]
[Postprocessors]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
expression = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralVariablePostprocessor
variable = total_sensitivity
[]
[]
[MultiApps]
[sub_app_one]
type = TransientMultiApp
input_files = structural_sub.i
[]
[sub_app_two]
type = TransientMultiApp
input_files = thermal_sub.i
[]
[]
[Transfers]
# First SUB-APP: STRUCTURAL
# To subapp densities
[subapp_one_density]
type = MultiAppCopyTransfer
to_multi_app = sub_app_one
source_variable = mat_den # Here
variable = mat_den
[]
# From subapp sensitivity
[subapp_one_sensitivity]
type = MultiAppCopyTransfer
from_multi_app = sub_app_one
source_variable = Dc # sensitivity_var
variable = sensitivity_one # Here
[]
# Second SUB-APP: HEAT CONDUCTIVITY
# To subapp densities
[subapp_two_density]
type = MultiAppCopyTransfer
to_multi_app = sub_app_two
source_variable = mat_den # Here
variable = mat_den
[]
# From subapp sensitivity
[subapp_two_sensitivity]
type = MultiAppCopyTransfer
from_multi_app = sub_app_two
source_variable = Tc # sensitivity_var
variable = sensitivity_two # Here
[]
[]
(modules/combined/examples/optimization/multi-load/square_main.i)
# This example is intended to reproduce a 2D example with opposing horizontal
# loads (see [1]). This test has an undefined solution if reguar SIMP is applied.
# Using multi-loads SIMP, on the other hand, generates a structure that optimizes
# the response to both loads individually,
# [1]. Lat. Am. j. solids struct. 12 (5), May 2015
# Topological derivative-based topology optimization of structures subject to multiple load-cases
vol_frac = 0.5
power = 1.0
E0 = 1.0
Emin = 1.0e-6
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[Bottom]
type = GeneratedMeshGenerator
dim = 2
nx = 100
ny = 100
xmin = 0
xmax = 150
ymin = 0
ymax = 150
[]
[left_load]
type = ExtraNodesetGenerator
input = Bottom
new_boundary = left_load
coord = '0 150 0'
[]
[right_load]
type = ExtraNodesetGenerator
input = left_load
new_boundary = right_load
coord = '150 150 0'
[]
[left_support]
type = ExtraNodesetGenerator
input = right_load
new_boundary = left_support
coord = '0 0 0'
[]
[right_support]
type = ExtraNodesetGenerator
input = left_support
new_boundary = right_support
coord = '150 0 0'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[AuxVariables]
[mat_den]
family = MONOMIAL
order = CONSTANT
[]
[sensitivity_one]
family = MONOMIAL
order = SECOND
initial_condition = -1.0
[]
[sensitivity_two]
family = MONOMIAL
order = SECOND
initial_condition = -1.0
[]
[total_sensitivity]
family = MONOMIAL
order = SECOND
initial_condition = -1.0
[]
[]
[ICs]
[mat_den]
type = RandomIC
seed = 7
variable = mat_den
max = '${fparse vol_frac+0.35}'
min = '${fparse vol_frac-0.35}'
[]
[]
[AuxKernels]
[total_sensitivity]
type = ParsedAux
variable = total_sensitivity
expression = '0.5*sensitivity_one + 0.5*sensitivity_two'
coupled_variables = 'sensitivity_one sensitivity_two'
execute_on = 'LINEAR TIMESTEP_END'
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = left_support
value = 0.0
[]
[no_x]
type = DirichletBC
variable = disp_x
boundary = left_support
value = 0.0
[]
[no_y_right]
type = DirichletBC
variable = disp_y
boundary = right_support
value = 0.0
[]
[no_x_right]
type = DirichletBC
variable = disp_x
boundary = right_support
value = 0.0
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'mat_den'
[]
[E_phys]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${E0}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[update]
type = DensityUpdate
density_sensitivity = total_sensitivity
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = MULTIAPP_FIXED_POINT_BEGIN
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-10
dt = 1.0
num_steps = 10
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
expression = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralVariablePostprocessor
variable = total_sensitivity
[]
[]
[MultiApps]
[sub_app_one]
type = TransientMultiApp
input_files = square_subapp_one.i
[]
[sub_app_two]
type = TransientMultiApp
input_files = square_subapp_two.i
[]
[]
[Transfers]
# First SUB-APP
# To subapp densities
[subapp_one_density]
type = MultiAppCopyTransfer
to_multi_app = sub_app_one
source_variable = mat_den # Here
variable = mat_den
[]
# From subapp sensitivity
[subapp_one_sensitivity]
type = MultiAppCopyTransfer
from_multi_app = sub_app_one
source_variable = Dc # sensitivity_var
variable = sensitivity_one # Here
[]
# Second SUB-APP
# To subapp densities
[subapp_two_density]
type = MultiAppCopyTransfer
to_multi_app = sub_app_two
source_variable = mat_den # Here
variable = mat_den
[]
# From subapp sensitivity
[subapp_two_sensitivity]
type = MultiAppCopyTransfer
from_multi_app = sub_app_two
source_variable = Dc # sensitivity_var
variable = sensitivity_two # Here
[]
[]
(modules/combined/examples/optimization/multi-load/single_main.i)
vol_frac = 0.3
power = 1.1
E0 = 1.0
Emin = 1.0e-6
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
# final_generator = 'MoveRight'
[Bottom]
type = GeneratedMeshGenerator
dim = 2
nx = 80
ny = 40
xmin = 0
xmax = 150
ymin = 0
ymax = 75
[]
[left_load]
type = ExtraNodesetGenerator
input = Bottom
new_boundary = left_load
coord = '37.5 75 0'
[]
[right_load]
type = ExtraNodesetGenerator
input = left_load
new_boundary = right_load
coord = '112.5 75 0'
[]
[left_support]
type = ExtraNodesetGenerator
input = right_load
new_boundary = left_support
coord = '0 0 0'
[]
[right_support]
type = ExtraNodesetGenerator
input = left_support
new_boundary = right_support
coord = '150 0 0'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[AuxVariables]
[mat_den]
family = MONOMIAL
order = CONSTANT
initial_condition = 0.02
[]
[sensitivity_one]
family = MONOMIAL
order = SECOND
initial_condition = -1.0
[]
[sensitivity_two]
family = MONOMIAL
order = SECOND
initial_condition = -1.0
[]
[total_sensitivity]
family = MONOMIAL
order = SECOND
initial_condition = -1.0
[]
[]
[AuxKernels]
[total_sensitivity]
type = ParsedAux
variable = total_sensitivity
expression = '0.5*sensitivity_one + 0.5*sensitivity_two'
coupled_variables = 'sensitivity_one sensitivity_two'
execute_on = 'LINEAR TIMESTEP_END'
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = left_support
value = 0.0
[]
[no_x]
type = DirichletBC
variable = disp_x
boundary = left_support
value = 0.0
[]
[no_y_right]
type = DirichletBC
variable = disp_y
boundary = right_support
value = 0.0
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys
poissons_ratio = poissons_ratio
args = 'mat_den'
[]
[E_phys]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${E0}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.0
[]
[stress]
type = ComputeLinearElasticStress
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
# We do filtering in the subapps
[update]
type = DensityUpdate
density_sensitivity = total_sensitivity
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = MULTIAPP_FIXED_POINT_BEGIN
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-10
dt = 1.0
num_steps = 25
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
expression = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralVariablePostprocessor
variable = total_sensitivity
[]
[]
[MultiApps]
[sub_app_one]
type = TransientMultiApp
input_files = single_subapp_one.i
[]
[sub_app_two]
type = TransientMultiApp
input_files = single_subapp_two.i
[]
[]
[Transfers]
# First SUB-APP
# To subapp densities
[subapp_one_density]
type = MultiAppCopyTransfer
to_multi_app = sub_app_one
source_variable = mat_den # Here
variable = mat_den
[]
# From subapp sensitivity
[subapp_one_sensitivity]
type = MultiAppCopyTransfer
from_multi_app = sub_app_one
source_variable = Dc # sensitivity_var
variable = sensitivity_one # Here
[]
# Second SUB-APP
# To subapp densities
[subapp_two_density]
type = MultiAppCopyTransfer
to_multi_app = sub_app_two
source_variable = mat_den # Here
variable = mat_den
[]
# From subapp sensitivity
[subapp_two_sensitivity]
type = MultiAppCopyTransfer
from_multi_app = sub_app_two
source_variable = Dc # sensitivity_var
variable = sensitivity_two # Here
[]
[]
(test/tests/transfers/multiapp_copy_transfer/between_multiapps/main.i)
[Problem]
solve = false
[]
[Mesh]
type = GeneratedMesh
dim = 2
[]
[MultiApps/sub1]
type = TransientMultiApp
input_files = sub1.i
[]
[MultiApps/sub2]
type = TransientMultiApp
input_files = sub2.i
[]
[Transfers/from_sub1_to_sub2]
type = MultiAppCopyTransfer
from_multi_app = sub1
to_multi_app = sub2
source_variable = x1
variable = x2
[]
[Executioner]
type = Transient
num_steps = 1
[]
(test/tests/transfers/multiapp_copy_transfer/third_monomial_to_sub/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[AuxVariables]
[./aux]
family = MONOMIAL
order = THIRD
[../]
[]
[AuxKernels]
[./aux]
type = FunctionAux
function = x*y
variable = aux
execute_on = initial
[../]
[]
[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 = Transient
num_steps = 1
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = timestep_end
[../]
[]
[Transfers]
[./to_sub]
type = MultiAppCopyTransfer
source_variable = aux
variable = u
to_multi_app = sub
[../]
[]
[Outputs]
hide = 'u'
exodus = true
[]
(modules/geochemistry/test/tests/kinetics/bio_zoning_flow.i)
# groundwater velocity is 10m.yr^-1 divided by porosity of 0.3
# The following are the mole numbers of the species in the groundwater
# The numerical values can be obtained by running the geochemistry simulation with a very small timestep so no kinetics are active (use the transported_bulk_moles values)
eqm_H2O = 55.49986252429319
eqm_CH3COO = 1e-9
eqm_CH4 = 1e-9
eqm_HS = 1e-9
eqm_Ca = 1e-3
eqm_SO4 = 4e-5
eqm_Fe = 1.386143651587732e-05
# The following are scalings used in calculating the residual. Eg, because the concentration of CH3COO is so low, its residual is always tiny, so to get better accuracy it should be scaled
scale_H2O = ${fparse 1.0 / eqm_H2O}
scale_CH3COO = ${fparse 1.0 / eqm_CH3COO}
scale_CH4 = ${fparse 1.0 / eqm_CH4}
scale_HS = ${fparse 1.0 / eqm_HS}
scale_Ca = ${fparse 1.0 / eqm_Ca}
scale_SO4 = ${fparse 1.0 / eqm_SO4}
scale_Fe = ${fparse 1.0 / eqm_Fe}
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 500
xmin = 0
xmax = 200000
[]
[]
[UserObjects]
[nodal_void_volume_uo]
type = NodalVoidVolume
porosity = 1.0
execute_on = 'initial'
[]
[]
[Variables]
[conc_H2O]
initial_condition = ${eqm_H2O}
scaling = ${scale_H2O}
[]
[conc_CH3COO]
initial_condition = ${eqm_CH3COO}
scaling = ${scale_CH3COO}
[]
[conc_CH4]
initial_condition = ${eqm_CH4}
scaling = ${scale_CH4}
[]
[conc_HS]
initial_condition = ${eqm_HS}
scaling = ${scale_HS}
[]
[conc_Ca]
initial_condition = ${eqm_Ca}
scaling = ${scale_Ca}
[]
[conc_SO4]
initial_condition = ${eqm_SO4}
scaling = ${scale_SO4}
[]
[conc_Fe]
initial_condition = ${eqm_Fe}
scaling = ${scale_Fe}
[]
[]
[Kernels]
[dot_H2O]
type = GeochemistryTimeDerivative
variable = conc_H2O
save_in = rate_H2O_times_vv
[]
[dot_CH3COO]
type = GeochemistryTimeDerivative
variable = conc_CH3COO
save_in = rate_CH3COO_times_vv
[]
[dot_CH4]
type = GeochemistryTimeDerivative
variable = conc_CH4
save_in = rate_CH4_times_vv
[]
[dot_HS]
type = GeochemistryTimeDerivative
variable = conc_HS
save_in = rate_HS_times_vv
[]
[dot_Ca]
type = GeochemistryTimeDerivative
variable = conc_Ca
save_in = rate_Ca_times_vv
[]
[dot_SO4]
type = GeochemistryTimeDerivative
variable = conc_SO4
save_in = rate_SO4_times_vv
[]
[dot_Fe]
type = GeochemistryTimeDerivative
variable = conc_Fe
save_in = rate_Fe_times_vv
[]
[adv_H2O]
type = ConservativeAdvection
velocity = velocity
upwinding_type = full
variable = conc_H2O
[]
[adv_CH3COO]
type = ConservativeAdvection
velocity = velocity
upwinding_type = full
variable = conc_CH3COO
[]
[adv_CH4]
type = ConservativeAdvection
velocity = velocity
upwinding_type = full
variable = conc_CH4
[]
[adv_HS]
type = ConservativeAdvection
velocity = velocity
upwinding_type = full
variable = conc_HS
[]
[adv_Ca]
type = ConservativeAdvection
velocity = velocity
upwinding_type = full
variable = conc_Ca
[]
[adv_SO4]
type = ConservativeAdvection
velocity = velocity
upwinding_type = full
variable = conc_SO4
[]
[adv_Fe]
type = ConservativeAdvection
velocity = velocity
upwinding_type = full
variable = conc_Fe
[]
[]
[AuxVariables]
[velocity]
family = MONOMIAL_VEC
order = CONSTANT
[]
[nodal_void_volume]
[]
[rate_H2O_times_vv]
[]
[rate_CH3COO_times_vv]
[]
[rate_CH4_times_vv]
[]
[rate_HS_times_vv]
[]
[rate_Ca_times_vv]
[]
[rate_SO4_times_vv]
[]
[rate_Fe_times_vv]
[]
[rate_H2O]
[]
[rate_CH3COO]
[]
[rate_CH4]
[]
[rate_HS]
[]
[rate_Ca]
[]
[rate_SO4]
[]
[rate_Fe]
[]
[]
[AuxKernels]
[velocity]
type = VectorFunctionAux
function = vel_fcn
variable = velocity
[]
[nodal_void_volume_auxk]
type = NodalVoidVolumeAux
variable = nodal_void_volume
nodal_void_volume_uo = nodal_void_volume_uo
execute_on = 'initial timestep_end' # "initial" to ensure it is properly evaluated for the first timestep
[]
[rate_H2O_auxk]
type = ParsedAux
variable = rate_H2O
args = 'rate_H2O_times_vv nodal_void_volume'
function = 'rate_H2O_times_vv / nodal_void_volume'
[]
[rate_CH3COO]
type = ParsedAux
variable = rate_CH3COO
args = 'rate_CH3COO_times_vv nodal_void_volume'
function = 'rate_CH3COO_times_vv / nodal_void_volume'
[]
[rate_CH4]
type = ParsedAux
variable = rate_CH4
args = 'rate_CH4_times_vv nodal_void_volume'
function = 'rate_CH4_times_vv / nodal_void_volume'
[]
[rate_HS]
type = ParsedAux
variable = rate_HS
args = 'rate_HS_times_vv nodal_void_volume'
function = 'rate_HS_times_vv / nodal_void_volume'
[]
[rate_Ca]
type = ParsedAux
variable = rate_Ca
args = 'rate_Ca_times_vv nodal_void_volume'
function = 'rate_Ca_times_vv / nodal_void_volume'
[]
[rate_SO4]
type = ParsedAux
variable = rate_SO4
args = 'rate_SO4_times_vv nodal_void_volume'
function = 'rate_SO4_times_vv / nodal_void_volume'
[]
[rate_Fe]
type = ParsedAux
variable = rate_Fe
args = 'rate_Fe_times_vv nodal_void_volume'
function = 'rate_Fe_times_vv / nodal_void_volume'
[]
[]
[Functions]
[vel_fcn]
type = ParsedVectorFunction
expression_x = 33.333333
expression_y = 0
expression_z = 0
[]
[]
[BCs]
[inject_H2O]
type = DirichletBC
boundary = 'left right'
variable = conc_H2O
value = ${eqm_H2O}
[]
[inject_CH3COO]
type = DirichletBC
boundary = 'left right'
variable = conc_CH3COO
value = ${eqm_CH3COO}
[]
[inject_CH4]
type = DirichletBC
boundary = 'left right'
variable = conc_CH4
value = ${eqm_CH4}
[]
[inject_HS]
type = DirichletBC
boundary = 'left right'
variable = conc_HS
value = ${eqm_HS}
[]
[inject_Ca]
type = DirichletBC
boundary = 'left right'
variable = conc_Ca
value = ${eqm_Ca}
[]
[inject_SO4]
type = DirichletBC
boundary = 'left right'
variable = conc_SO4
value = ${eqm_SO4}
[]
[]
[Preconditioning]
[typically_efficient]
type = SMP
full = true
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = ' hypre boomeramg'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
[TimeStepper]
type = FunctionDT
function = 'min(0.1 * (t + 1), 100)'
[]
end_time = 20000
nl_abs_tol = 1E-5
[]
[Outputs]
csv = true
[]
[MultiApps]
[react]
type = TransientMultiApp
input_files = bio_zoning_conc.i
clone_parent_mesh = true
execute_on = 'timestep_end' # This is critical
[]
[]
[Transfers]
[changes_due_to_flow]
type = MultiAppCopyTransfer
to_multi_app = react
source_variable = 'rate_H2O rate_CH3COO rate_CH4 rate_HS rate_Ca rate_SO4 rate_Fe' # change in mole number at every node / dt
variable = 'rate_H2O_per_1l rate_CH3COO_per_1l rate_CH4_per_1l rate_HS_per_1l rate_Ca_per_1l rate_SO4_per_1l rate_Fe_per_1l' # change in moles at every node / dt
[]
[transported_moles_from_geochem]
type = MultiAppCopyTransfer
from_multi_app = react
source_variable = 'transported_H2O transported_CH3COO transported_CH4 transported_HS transported_Ca transported_SO4 transported_Fe'
variable = 'conc_H2O conc_CH3COO conc_CH4 conc_HS conc_Ca conc_SO4 conc_Fe'
[]
[]
(test/tests/transfers/multiapp_copy_transfer/second_lagrange_to_sub/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
elem_type = QUAD9
[]
[Variables]
[./u]
family = LAGRANGE
order = SECOND
[../]
[]
[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 = Transient
num_steps = 1
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = timestep_end
[../]
[]
[Transfers]
[./to_sub]
type = MultiAppCopyTransfer
source_variable = u
variable = u
to_multi_app = sub
[../]
[]
[Outputs]
exodus = true
[]
(test/tests/transfers/multiapp_copy_transfer/constant_monomial_to_sub/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[AuxVariables]
[./aux]
family = MONOMIAL
order = CONSTANT
[../]
[]
[AuxKernels]
[./aux]
type = FunctionAux
function = x*y
variable = aux
execute_on = initial
[../]
[]
[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 = Transient
num_steps = 1
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[MultiApps]
[./sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = timestep_end
[../]
[]
[Transfers]
[./to_sub]
type = MultiAppCopyTransfer
source_variable = aux
variable = u
to_multi_app = sub
[../]
[]
[Outputs]
exodus = true
[]
(test/tests/transfers/coord_transform/both-transformed/copy/main-app.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = -1
ymax = 0
nx = 10
ny = 10
alpha_rotation = 90
[]
[Variables]
[u][]
[]
[AuxVariables]
[v][]
[v_elem]
order = CONSTANT
family = MONOMIAL
[]
[w][]
[w_elem]
order = CONSTANT
family = MONOMIAL
[]
[]
[ICs]
[w]
type = FunctionIC
function = 'cos(x)*sin(y)'
variable = w
[]
[w_elem]
type = FunctionIC
function = 'cos(x)*sin(y)'
variable = w_elem
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[force]
type = CoupledForce
variable = u
v = v
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
verbose = true
[]
[Outputs]
exodus = true
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
app_type = MooseTestApp
positions = '0 0 0'
input_files = 'sub-app.i'
execute_on = 'timestep_begin'
[]
[]
[Transfers]
[from_sub]
type = MultiAppCopyTransfer
from_multi_app = sub
source_variable = v
variable = v
execute_on = 'timestep_begin'
[]
[from_sub_elem]
type = MultiAppCopyTransfer
from_multi_app = sub
source_variable = v_elem
variable = v_elem
execute_on = 'timestep_begin'
[]
[to_sub]
type = MultiAppCopyTransfer
to_multi_app = sub
source_variable = w
variable = w
execute_on = 'timestep_begin'
[]
[to_sub_elem]
type = MultiAppCopyTransfer
to_multi_app = sub
source_variable = w_elem
variable = w_elem
execute_on = 'timestep_begin'
[]
[]
(modules/level_set/examples/rotating_circle/circle_rotate_parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 32
ny = 32
uniform_refine = 2
[]
[AuxVariables]
[./velocity]
family = LAGRANGE_VEC
[../]
[]
[Variables]
[./phi]
[../]
[]
[BCs]
[./all]
type = DirichletBC
variable = phi
boundary = 'top bottom left right'
value = 0
[../]
[]
[Functions]
[./phi_exact]
type = LevelSetOlssonBubble
epsilon = 0.03
center = '0 0.5 0'
radius = 0.15
[../]
[./velocity_func]
type = ParsedVectorFunction
expression_x = '4*y'
expression_y = '-4*x'
[../]
[]
[ICs]
[./phi_ic]
type = FunctionIC
function = phi_exact
variable = phi
[../]
[./vel_ic]
type = VectorFunctionIC
variable = velocity
function = velocity_func
[]
[]
[Kernels]
[./time]
type = TimeDerivative
variable = phi
[../]
[./advection]
type = LevelSetAdvection
velocity = velocity
variable = phi
[../]
[]
[Postprocessors]
[./area]
type = LevelSetVolume
threshold = 0.5
variable = phi
location = outside
execute_on = 'initial timestep_end'
[../]
[./cfl]
type = LevelSetCFLCondition
velocity = velocity
execute_on = 'initial timestep_end'
[../]
[]
[Executioner]
type = Transient
solve_type = PJFNK
start_time = 0
end_time = 1.570796
scheme = crank-nicolson
petsc_options_iname = '-pc_type -pc_sub_type'
petsc_options_value = 'asm ilu'
[./TimeStepper]
type = PostprocessorDT
postprocessor = cfl
scale = 0.8
[../]
[]
[MultiApps]
[./reinit]
type = LevelSetReinitializationMultiApp
input_files = 'circle_rotate_sub.i'
execute_on = 'timestep_end'
[../]
[]
[Transfers]
[./to_sub]
type = MultiAppCopyTransfer
source_variable = phi
variable = phi
to_multi_app = reinit
execute_on = 'timestep_end'
[../]
[./to_sub_init]
type = MultiAppCopyTransfer
source_variable = phi
variable = phi_0
to_multi_app = reinit
execute_on = 'timestep_end'
[../]
[./from_sub]
type = MultiAppCopyTransfer
source_variable = phi
variable = phi
from_multi_app = reinit
execute_on = 'timestep_end'
[../]
[]
[Outputs]
csv = true
exodus = true
[]
(modules/porous_flow/examples/multiapp_fracture_flow/diffusion_multiapp/fracture_app_heat.i)
# Heat energy from this fracture app is transferred to the matrix app
[Mesh]
[generate]
type = GeneratedMeshGenerator
dim = 1
nx = 100
xmin = 0
xmax = 50.0
[]
[]
[Variables]
[frac_T]
[]
[]
[ICs]
[frac_T]
type = FunctionIC
variable = frac_T
function = 'if(x<1E-6, 2, 0)' # delta function
[]
[]
[AuxVariables]
[transferred_matrix_T]
[]
[heat_to_matrix]
[]
[]
[Kernels]
[dot]
type = TimeDerivative
variable = frac_T
[]
[fracture_diffusion]
type = Diffusion
variable = frac_T
[]
[toMatrix]
type = PorousFlowHeatMassTransfer
variable = frac_T
v = transferred_matrix_T
transfer_coefficient = 0.004
[]
[]
[AuxKernels]
[heat_to_matrix]
type = ParsedAux
variable = heat_to_matrix
coupled_variables = 'frac_T transferred_matrix_T'
expression = '0.004 * (frac_T - transferred_matrix_T)'
[]
[]
[Preconditioning]
[entire_jacobian]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
dt = 100
end_time = 100
[]
[VectorPostprocessors]
[final_results]
type = LineValueSampler
start_point = '0 0 0'
end_point = '50 0 0'
num_points = 11
sort_by = x
variable = frac_T
outputs = final_csv
[]
[]
[Outputs]
print_linear_residuals = false
[final_csv]
type = CSV
sync_times = 100
sync_only = true
[]
[]
[MultiApps]
[matrix_app]
type = TransientMultiApp
input_files = matrix_app_heat.i
execute_on = TIMESTEP_END
[]
[]
[Transfers]
[heat_to_matrix]
type = MultiAppCopyTransfer
to_multi_app = matrix_app
source_variable = heat_to_matrix
variable = heat_from_frac
[]
[T_from_matrix]
type = MultiAppCopyTransfer
from_multi_app = matrix_app
source_variable = matrix_T
variable = transferred_matrix_T
[]
[]
(modules/level_set/include/transfers/LevelSetMeshRefinementTransfer.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 "MultiAppCopyTransfer.h"
/**
* Copies the refinement marker from the master to the sub-application.
*/
class LevelSetMeshRefinementTransfer : public MultiAppCopyTransfer
{
public:
static InputParameters validParams();
LevelSetMeshRefinementTransfer(const InputParameters & parameters);
virtual void initialSetup() override;
virtual void execute() override;
};