- meshThe name of the mesh file (must be xda or exodusII file).
C++ Type:MeshFileName
Controllable:No
Description:The name of the mesh file (must be xda or exodusII file).
SolutionUserObject
Reads a variable from a mesh in one simulation to another
Description
A solution user object reads a variable from a mesh in one simulation to another. In order to use a SolutionUserObject
three additional parameters are required, an AuxVariable , a Function and an AuxKernel. The AuxVariable
represents the variable to be read by the solution user object. The SolutionUserObject
is set up to read the old output file. A SolutionFunction
is required to interpolate in time and space the data from the SolutionUserObject
. Finally, the Function
is required that will query the function and write the value into the AuxVariable
.
Example Input Syntax
[UserObjects]
[./soln]
type = SolutionUserObject
mesh = cubesource.e
system_variables = source_nodal
[../]
[]
(test/tests/auxkernels/solution_aux/solution_aux_exodus_interp.i)Input Parameters
- es
The name of the file holding the equation system info in xda format (xda only). Default:
C++ Type:FileName
Controllable:No
Description:The name of the file holding the equation system info in xda format (xda only).
- execute_onTIMESTEP_ENDThe list of flag(s) indicating when this object should be executed, the available options include NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, FINAL, CUSTOM, ALWAYS.
Default:TIMESTEP_END
C++ Type:ExecFlagEnum
Options:NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, FINAL, CUSTOM, ALWAYS
Controllable:No
Description:The list of flag(s) indicating when this object should be executed, the available options include NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, FINAL, CUSTOM, ALWAYS.
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
- rotation0_angle0Anticlockwise rotation angle (in degrees) to use for rotation about rotation0_vector.
Default:0
C++ Type:double
Controllable:No
Description:Anticlockwise rotation angle (in degrees) to use for rotation about rotation0_vector.
- rotation0_vector0 0 1Vector about which to rotate points of the simulation.
Default:0 0 1
C++ Type:libMesh::VectorValue<double>
Controllable:No
Description:Vector about which to rotate points of the simulation.
- rotation1_angle0Anticlockwise rotation angle (in degrees) to use for rotation about rotation1_vector.
Default:0
C++ Type:double
Controllable:No
Description:Anticlockwise rotation angle (in degrees) to use for rotation about rotation1_vector.
- rotation1_vector0 0 1Vector about which to rotate points of the simulation.
Default:0 0 1
C++ Type:libMesh::VectorValue<double>
Controllable:No
Description:Vector about which to rotate points of the simulation.
- scale1 1 1 Scale factor for points in the simulation
Default:1 1 1
C++ Type:std::vector<double>
Controllable:No
Description:Scale factor for points in the simulation
- scale_multiplier1 1 1 Scale multiplying factor for points in the simulation
Default:1 1 1
C++ Type:std::vector<double>
Controllable:No
Description:Scale multiplying factor for points in the simulation
- systemnl0The name of the system to pull values out of (xda only).
Default:nl0
C++ Type:std::string
Controllable:No
Description:The name of the system to pull values out of (xda only).
- system_variablesThe name of the nodal and elemental variables from the file you want to use for values
C++ Type:std::vector<std::string>
Controllable:No
Description:The name of the nodal and elemental variables from the file you want to use for values
- timestepIndex of the single timestep used or "LATEST" for the last timestep (exodusII only). If not supplied, time interpolation will occur.
C++ Type:std::string
Controllable:No
Description:Index of the single timestep used or "LATEST" for the last timestep (exodusII only). If not supplied, time interpolation will occur.
- transformation_ordertranslation scaleThe order to perform the operations in. Define R0 to be the rotation matrix encoded by rotation0_vector and rotation0_angle. Similarly for R1. Denote the scale by s, the scale_multiplier by m, and the translation by t. Then, given a point x in the simulation, if transformation_order = 'rotation0 scale_multiplier translation scale rotation1' then form p = R1*(R0*x*m - t)/s. Then the values provided by the SolutionUserObject at point x in the simulation are the variable values at point p in the mesh.
Default:translation scale
C++ Type:MultiMooseEnum
Options:rotation0, translation, scale, rotation1, scale_multiplier
Controllable:No
Description:The order to perform the operations in. Define R0 to be the rotation matrix encoded by rotation0_vector and rotation0_angle. Similarly for R1. Denote the scale by s, the scale_multiplier by m, and the translation by t. Then, given a point x in the simulation, if transformation_order = 'rotation0 scale_multiplier translation scale rotation1' then form p = R1*(R0*x*m - t)/s. Then the values provided by the SolutionUserObject at point x in the simulation are the variable values at point p in the mesh.
- translation0 0 0 Translation factors for x,y,z coordinates of the simulation
Default:0 0 0
C++ Type:std::vector<double>
Controllable:No
Description:Translation factors for x,y,z coordinates of the simulation
Optional Parameters
- allow_duplicate_execution_on_initialFalseIn the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
Default:False
C++ Type:bool
Controllable:No
Description:In the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
- 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.
- force_postauxFalseForces the UserObject to be executed in POSTAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in POSTAUX
- force_preauxFalseForces the UserObject to be executed in PREAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREAUX
- force_preicFalseForces the UserObject to be executed in PREIC during initial setup
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREIC during initial setup
- 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
- (test/tests/auxkernels/solution_aux/thread_xda.i)
- (test/tests/auxkernels/solution_aux/solution_aux_multi_var.i)
- (test/tests/auxkernels/solution_aux/solution_aux_exodus_file_extension.i)
- (test/tests/auxkernels/solution_aux/solution_aux_exodus.i)
- (test/tests/auxkernels/solution_aux/solution_aux_exodus_elem_map.i)
- (test/tests/auxkernels/solution_aux/solution_aux_exodus_interp.i)
- (test/tests/functions/solution_function/solution_function_exodus_interp_test.i)
- (modules/porous_flow/examples/groundwater/ex02_abstraction.i)
- (test/tests/auxkernels/solution_aux/aux_nonlinear_solution_xda.i)
- (test/tests/auxkernels/solution_scalar_aux/solution_scalar_aux.i)
- (test/tests/functions/solution_function/solution_function_scale_transl.i)
- (modules/porous_flow/examples/groundwater/ex02_steady_state.i)
- (test/tests/auxkernels/solution_aux/solution_aux_exodus_interp_direct.i)
- (test/tests/auxkernels/solution_aux/aux_nonlinear_solution_adapt_xda.i)
- (test/tests/functions/solution_function/solution_function_rot3.i)
- (test/tests/functions/solution_function/solution_function_rot4.i)
- (test/tests/auxkernels/solution_aux/solution_aux.i)
- (test/tests/functions/solution_function/solution_function_scale_mult.i)
- (test/tests/auxkernels/solution_aux/solution_aux_direct.i)
- (test/tests/auxkernels/solution_aux/solution_aux_exodus_interp_restart2.i)
- (test/tests/auxkernels/solution_aux/solution_aux_scale.i)
- (test/tests/functions/solution_function/solution_function_rot1.i)
- (test/tests/auxkernels/solution_aux/solution_aux_exodus_elemental.i)
- (modules/combined/test/tests/axisymmetric_2d3d_solution_function/3dy.i)
- (test/tests/auxkernels/solution_aux/solution_aux_exodus_elemental_only.i)
- (test/tests/functions/solution_function/solution_function_grad_p2.i)
- (modules/thermal_hydraulics/test/tests/misc/surrogate_power_profile/surrogate_power_profile.i)
- (examples/ex14_pps/ex14_compare_solutions_2.i)
- (test/tests/auxkernels/solution_aux/output_error.i)
- (test/tests/functions/solution_function/solution_function_rot2.i)
- (test/tests/functions/solution_function/solution_function_test.i)
- (test/tests/auxkernels/solution_aux/solution_aux_exodus_direct.i)
- (test/tests/functions/solution_function/solution_function_exodus_test.i)
- (test/tests/userobjects/solution_user_object/discontinuous_value_solution_uo_p2.i)
- (test/tests/auxkernels/solution_aux/solution_aux_multi_err.i)
- (test/tests/auxkernels/solution_aux/aux_nonlinear_solution_xdr.i)
- (modules/porous_flow/examples/restart/gas_injection_new_mesh.i)
- (test/tests/auxkernels/solution_aux/solution_aux_exodus_interp_restart1.i)
Child Objects
(test/tests/auxkernels/solution_aux/solution_aux_exodus_interp.i)
[Mesh]
type = FileMesh
file = cubesource.e
# This test uses SolutionUserObject which doesn't work with DistributedMesh.
parallel_type = replicated
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
initial_condition = 0.0
[../]
[]
[AuxVariables]
[./nn]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./nn]
type = SolutionAux
variable = nn
solution = soln
[../]
[]
[UserObjects]
[./soln]
type = SolutionUserObject
mesh = cubesource.e
system_variables = source_nodal
[../]
[]
[BCs]
[./stuff]
type = DirichletBC
variable = u
boundary = '1 2'
value = 0.0
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
l_max_its = 800
nl_rel_tol = 1e-10
num_steps = 50
end_time = 5
dt = 0.5
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/auxkernels/solution_aux/thread_xda.i)
[Mesh]
# This test uses SolutionUserObject which doesn't work with ParallelMesh.
type = GeneratedMesh
parallel_type = REPLICATED
dim = 2
nx = 2
ny = 2
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Functions]
[./u_xda_func]
type = SolutionFunction
solution = xda_u
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = 1
value = 1
[../]
[./right]
type = DirichletBC
variable = u
boundary = 2
value = 2
[../]
[]
[UserObjects]
[./xda_u]
type = SolutionUserObject
system = nl0
mesh = aux_nonlinear_solution_out_0001_mesh.xda
es = aux_nonlinear_solution_out_0001.xda
system_variables = u
execute_on = initial
[../]
[]
[Executioner]
type = Steady
solve_type = PJFNK
nl_rel_tol = 1e-10
[]
[Postprocessors]
[./unorm]
type = ElementL2Norm
variable = u
[../]
[./uerror]
type = ElementL2Error
variable = u
function = u_xda_func
[../]
[]
[Outputs]
csv = true
[]
(test/tests/auxkernels/solution_aux/solution_aux_multi_var.i)
[Mesh]
file = cubesource.e
# The SolutionUserObject uses the copy_nodal_solution() capability
# of the Exodus reader, and therefore won't work if the initial mesh
# has been renumbered (it will be reunumbered if you are running with
# DistributedMesh in parallel). Hence, we restrict this test to run with
# ReplicatedMesh only.
parallel_type = replicated
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
initial_condition = 0.0
[../]
[]
[AuxVariables]
[./nn]
order = FIRST
family = LAGRANGE
[../]
[./en]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./nn]
type = SolutionAux
solution = soln
variable = nn
scale_factor = 2.0
from_variable = nodal_10
add_factor = -20
[../]
[./en]
type = SolutionAux
solution = soln
variable = en
scale_factor = 2.0
from_variable = source_nodal
[../]
[]
[UserObjects]
[./soln]
type = SolutionUserObject
mesh = cubesource_added.e
timestep = 2
[../]
[]
[BCs]
[./stuff]
type = DirichletBC
variable = u
boundary = '1 2'
value = 0.0
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
l_max_its = 800
nl_rel_tol = 1e-10
num_steps = 50
end_time = 5
dt = 0.5
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/auxkernels/solution_aux/solution_aux_exodus_file_extension.i)
[Mesh]
file = cubesource.e
# The SolutionUserObject uses the copy_nodal_solution() capability
# of the Exodus reader, and therefore won't work if the initial mesh
# has been renumbered (it will be reunumbered if you are running with
# DistributedMesh in parallel). Hence, we restrict this test to run with
# ReplicatedMesh only.
parallel_type = replicated
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
initial_condition = 0.0
[../]
[]
[AuxVariables]
[./nn]
order = FIRST
family = LAGRANGE
[../]
[./en]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./nn]
type = SolutionAux
solution = soln
variable = nn
scale_factor = 2.0
[../]
[./en]
type = SolutionAux
solution = soln
variable = en
scale_factor = 2.0
[../]
[]
[UserObjects]
[./soln]
type = SolutionUserObject
mesh = cubesource.e-s003
system_variables = source_nodal
timestep = 2
[../]
[]
[BCs]
[./stuff]
type = DirichletBC
variable = u
boundary = '1 2'
value = 0.0
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
l_max_its = 800
nl_rel_tol = 1e-10
num_steps = 50
end_time = 5
dt = 0.5
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/auxkernels/solution_aux/solution_aux_exodus.i)
[Mesh]
file = cubesource.e
# The SolutionUserObject uses the copy_nodal_solution() capability
# of the Exodus reader, and therefore won't work if the initial mesh
# has been renumbered (it will be reunumbered if you are running with
# DistributedMesh in parallel). Hence, we restrict this test to run with
# ReplicatedMesh only.
parallel_type = replicated
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
initial_condition = 0.0
[../]
[]
[AuxVariables]
[./nn]
order = FIRST
family = LAGRANGE
[../]
[./en]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./nn]
type = SolutionAux
solution = soln
variable = nn
scale_factor = 2.0
[../]
[./en]
type = SolutionAux
solution = soln
variable = en
scale_factor = 2.0
[../]
[]
[UserObjects]
[./soln]
type = SolutionUserObject
mesh = cubesource.e
system_variables = source_nodal
timestep = 2
[../]
[]
[BCs]
[./stuff]
type = DirichletBC
variable = u
boundary = '1 2'
value = 0.0
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
l_max_its = 800
nl_rel_tol = 1e-10
num_steps = 50
end_time = 5
dt = 0.5
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/auxkernels/solution_aux/solution_aux_exodus_elem_map.i)
[Mesh]
file = elem_map.e
# The SolutionUserObject uses the copy_nodal_solution() capability
# of the Exodus reader, and therefore won't work if the initial mesh
# has been renumbered (it will be reunumbered if you are running with
# DistributedMesh in parallel). Hence, we restrict this test to run with
# ReplicatedMesh only.
parallel_type = replicated
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
initial_condition = 0.0
[../]
[]
[AuxVariables]
[./matid]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./matid]
type = SolutionAux
solution = soln
variable = matid
scale_factor = 1.0
[../]
[]
[UserObjects]
[./soln]
type = SolutionUserObject
mesh = elem_map.e
system_variables = MatID
timestep = LATEST
[../]
[]
[BCs]
[./stuff]
type = DirichletBC
variable = u
boundary = '1'
value = 1.0
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/auxkernels/solution_aux/solution_aux_exodus_interp.i)
[Mesh]
type = FileMesh
file = cubesource.e
# This test uses SolutionUserObject which doesn't work with DistributedMesh.
parallel_type = replicated
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
initial_condition = 0.0
[../]
[]
[AuxVariables]
[./nn]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./nn]
type = SolutionAux
variable = nn
solution = soln
[../]
[]
[UserObjects]
[./soln]
type = SolutionUserObject
mesh = cubesource.e
system_variables = source_nodal
[../]
[]
[BCs]
[./stuff]
type = DirichletBC
variable = u
boundary = '1 2'
value = 0.0
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
l_max_its = 800
nl_rel_tol = 1e-10
num_steps = 50
end_time = 5
dt = 0.5
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/functions/solution_function/solution_function_exodus_interp_test.i)
[Mesh]
file = cubesource.e
# This test uses SolutionUserObject which doesn't work with DistributedMesh.
parallel_type = replicated
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
initial_condition = 0.0
[../]
[]
[AuxVariables]
[./nn]
order = FIRST
family = LAGRANGE
[../]
# [./ne]
# order = FIRST
# family = LAGRANGE
# [../]
[./en]
order = CONSTANT
family = MONOMIAL
[../]
# [./ee]
# order = CONSTANT
# family = MONOMIAL
# [../]
[]
[Functions]
[./sourcen]
type = SolutionFunction
solution = cube_soln
[../]
# [./sourcee]
# type = SolutionFunction
# file_type = exodusII
# mesh = cubesource.e
# variable = source_element
# [../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./nn]
type = FunctionAux
variable = nn
function = sourcen
[../]
# [./ne]
# type = FunctionAux
# variable = ne
# function = sourcee
# [../]
[./en]
type = FunctionAux
variable = en
function = sourcen
[../]
# [./ee]
# type = FunctionAux
# variable = ee
# function = sourcee
# [../]
[]
[BCs]
[./stuff]
type = DirichletBC
variable = u
boundary = '1 2'
value = 0.0
[../]
[]
[UserObjects]
[./cube_soln]
type = SolutionUserObject
mesh = cubesource.e
system_variables = source_nodal
[../]
[]
#[Executioner]
# type = Steady
# petsc_options = '-snes'
# l_max_its = 800
# nl_rel_tol = 1e-10
#[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
l_max_its = 800
nl_rel_tol = 1e-10
num_steps = 50
end_time = 5
dt = 0.5
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(modules/porous_flow/examples/groundwater/ex02_abstraction.i)
# Abstraction groundwater model. See groundwater_models.md for a detailed description
[Mesh]
[from_steady_state]
type = FileMeshGenerator
file = gold/ex02_steady_state_ex.e
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Variables]
[pp]
[]
[]
[ICs]
[pp]
type = FunctionIC
variable = pp
function = steady_state_pp
[]
[]
[BCs]
[rainfall_recharge]
type = PorousFlowSink
boundary = zmax
variable = pp
flux_function = -1E-6 # recharge of 0.1mm/day = 1E-4m3/m2/day = 0.1kg/m2/day ~ 1E-6kg/m2/s
[]
[evapotranspiration]
type = PorousFlowHalfCubicSink
boundary = zmax
variable = pp
center = 0.0
cutoff = -5E4 # roots of depth 5m. 5m of water = 5E4 Pa
use_mobility = true
fluid_phase = 0
# Assume pan evaporation of 4mm/day = 4E-3m3/m2/day = 4kg/m2/day ~ 4E-5kg/m2/s
# Assume that if permeability was 1E-10m^2 and water table at topography then ET acts as pan strength
# Because use_mobility = true, then 4E-5 = maximum_flux = max * perm * density / visc = max * 1E-4, so max = 40
max = 40
[]
[]
[DiracKernels]
inactive = polyline_sink_borehole
[river]
type = PorousFlowPolyLineSink
SumQuantityUO = baseflow
point_file = ex02_river.bh
# Assume a perennial river.
# Assume the river has an incision depth of 1m and a stage height of 1.5m, and these are constant in time and uniform over the whole model. Hence, if groundwater head is 0.5m (5000Pa) there will be no baseflow and leakage.
p_or_t_vals = '-999995000 5000 1000005000'
# Assume the riverbed conductance, k_zz*density*river_segment_length*river_width/riverbed_thickness/viscosity = 1E-6*river_segment_length kg/Pa/s
fluxes = '-1E3 0 1E3'
variable = pp
[]
[horizontal_borehole]
type = PorousFlowPeacemanBorehole
SumQuantityUO = abstraction
bottom_p_or_t = -1E5
unit_weight = '0 0 -1E4'
character = 1.0
point_file = ex02.bh
variable = pp
[]
[polyline_sink_borehole]
type = PorousFlowPolyLineSink
SumQuantityUO = abstraction
fluxes = '-0.4 0 0.4'
p_or_t_vals = '-1E8 0 1E8'
point_file = ex02.bh
variable = pp
[]
[]
[Functions]
[steady_state_pp]
type = SolutionFunction
from_variable = pp
solution = steady_state_solution
[]
[baseflow_rate]
type = ParsedFunction
vars = 'baseflow_kg dt'
vals = 'baseflow_kg dt'
value = 'baseflow_kg / dt * 24.0 * 3600.0 / 400.0'
[]
[abstraction_rate]
type = ParsedFunction
vars = 'abstraction_kg dt'
vals = 'abstraction_kg dt'
value = 'abstraction_kg / dt * 24.0 * 3600.0'
[]
[]
[AuxVariables]
[ini_pp]
[]
[pp_change]
[]
[]
[AuxKernels]
[ini_pp]
type = FunctionAux
variable = ini_pp
function = steady_state_pp
execute_on = INITIAL
[]
[pp_change]
type = ParsedAux
variable = pp_change
args = 'pp ini_pp'
function = 'pp - ini_pp'
[]
[]
[PorousFlowUnsaturated]
fp = simple_fluid
porepressure = pp
[]
[Modules]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
[]
[]
[]
[Materials]
[porosity_everywhere]
type = PorousFlowPorosityConst
porosity = 0.05
[]
[permeability_aquifers]
type = PorousFlowPermeabilityConst
block = 'top_aquifer bot_aquifer'
permeability = '1E-12 0 0 0 1E-12 0 0 0 1E-13'
[]
[permeability_aquitard]
type = PorousFlowPermeabilityConst
block = aquitard
permeability = '1E-16 0 0 0 1E-16 0 0 0 1E-17'
[]
[]
[UserObjects]
[steady_state_solution]
type = SolutionUserObject
execute_on = INITIAL
mesh = gold/ex02_steady_state_ex.e
timestep = LATEST
system_variables = pp
[]
[baseflow]
type = PorousFlowSumQuantity
[]
[abstraction]
type = PorousFlowSumQuantity
[]
[]
[Postprocessors]
[baseflow_kg]
type = PorousFlowPlotQuantity
uo = baseflow
outputs = 'none'
[]
[dt]
type = TimestepSize
outputs = 'none'
[]
[baseflow_l_per_m_per_day]
type = FunctionValuePostprocessor
function = baseflow_rate
[]
[abstraction_kg]
type = PorousFlowPlotQuantity
uo = abstraction
outputs = 'none'
[]
[abstraction_kg_per_day]
type = FunctionValuePostprocessor
function = abstraction_rate
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
# following 2 lines are not mandatory, but illustrate a popular preconditioner choice in groundwater models
petsc_options_iname = '-pc_type -sub_pc_type -pc_asm_overlap'
petsc_options_value = ' asm ilu 2 '
[]
[]
[Executioner]
type = Transient
solve_type = Newton
dt = 100
[TimeStepper]
type = FunctionDT
function = 'max(100, t)'
[]
end_time = 8.64E5 # 10 days
nl_abs_tol = 1E-11
[]
[Outputs]
print_linear_residuals = false
[ex]
type = Exodus
execute_on = final
[]
[csv]
type = CSV
[]
[]
(test/tests/auxkernels/solution_aux/aux_nonlinear_solution_xda.i)
[Mesh]
# This test uses SolutionUserObject which doesn't work with DistributedMesh.
type = GeneratedMesh
parallel_type = replicated
dim = 2
nx = 2
ny = 2
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./u_aux]
[../]
[]
[Functions]
[./u_xda_func]
type = SolutionFunction
solution = xda_u
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./aux_xda_kernel]
type = SolutionAux
variable = u_aux
solution = xda_u_aux
execute_on = initial
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = 1
value = 1
[../]
[./right]
type = DirichletBC
variable = u
boundary = 2
value = 2
[../]
[]
[UserObjects]
[./xda_u_aux]
type = SolutionUserObject
system = aux0
mesh = aux_nonlinear_solution_out_0001_mesh.xda
es = aux_nonlinear_solution_out_0001.xda
system_variables = u_aux
execute_on = initial
[../]
[./xda_u]
type = SolutionUserObject
system = nl0
mesh = aux_nonlinear_solution_out_0001_mesh.xda
es = aux_nonlinear_solution_out_0001.xda
system_variables = u
execute_on = initial
[../]
[]
[Executioner]
type = Steady
solve_type = PJFNK
nl_rel_tol = 1e-10
[]
[Outputs]
exodus = true
[]
[ICs]
[./u_func_ic]
function = u_xda_func
variable = u
type = FunctionIC
[../]
[]
(test/tests/auxkernels/solution_scalar_aux/solution_scalar_aux.i)
[Mesh]
# This test uses SolutionUserObject which doesn't work with DistributedMesh.
type = GeneratedMesh
dim = 1
nx = 1
parallel_type = replicated
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./a]
family = SCALAR
order = FIRST
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxScalarKernels]
[./a_sk]
type = SolutionScalarAux
variable = a
solution = solution_uo
from_variable = a
execute_on = 'initial timestep_begin'
[../]
[]
[UserObjects]
[./solution_uo]
type = SolutionUserObject
mesh = build_out.e
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 2
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 3
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
nl_rel_tol = 1e-10
dt = 1
num_steps = 3
[]
[Outputs]
csv = true
[]
(test/tests/functions/solution_function/solution_function_scale_transl.i)
# checking scale and translation, with ordering scale first, then translation second
[Mesh]
type = GeneratedMesh
dim = 3
xmin = -1
xmax = 1
nx = 3
ymin = -1
ymax = 1
ny = 3
zmin = -1
zmax = 1
nz = 3
[]
[UserObjects]
[./solution_uo]
type = SolutionUserObject
mesh = cube_with_u_equals_x.e
timestep = 1
system_variables = u
scale = '0.5 1 1'
translation = '2 0 0'
transformation_order = 'scale translation'
[../]
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[ICs]
[./u_init]
type = FunctionIC
variable = u
function = solution_fcn
[../]
[]
[Functions]
[./solution_fcn]
type = SolutionFunction
from_variable = u
solution = solution_uo
[../]
[]
[Kernels]
[./diff]
type = TimeDerivative
variable = u
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
l_max_its = 800
nl_rel_tol = 1e-10
num_steps = 1
end_time = 1
dt = 1
[]
[Outputs]
execute_on = 'timestep_end'
file_base = solution_function_scale_transl
exodus = true
[]
(modules/porous_flow/examples/groundwater/ex02_steady_state.i)
# Steady-state groundwater model. See groundwater_models.md for a detailed description
[Mesh]
[basic_mesh]
# mesh create by external program: lies within -500<=x<=500 and -200<=y<=200, with varying z
type = FileMeshGenerator
file = ex02_mesh.e
[]
[name_blocks]
type = RenameBlockGenerator
input = basic_mesh
old_block = '2 3 4'
new_block = 'bot_aquifer aquitard top_aquifer'
[]
[zmax]
type = SideSetsFromNormalsGenerator
input = name_blocks
new_boundary = zmax
normals = '0 0 1'
[]
[xmin_bot_aquifer]
type = ParsedGenerateSideset
input = zmax
included_subdomain_ids = 2
normal = '-1 0 0'
combinatorial_geometry = 'x <= -500.0'
new_sideset_name = xmin_bot_aquifer
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Variables]
[pp]
[]
[]
[ICs]
[pp]
type = FunctionIC
variable = pp
function = initial_pp
[]
[]
[BCs]
[rainfall_recharge]
type = PorousFlowSink
boundary = zmax
variable = pp
flux_function = -1E-6 # recharge of 0.1mm/day = 1E-4m3/m2/day = 0.1kg/m2/day ~ 1E-6kg/m2/s
[]
[evapotranspiration]
type = PorousFlowHalfCubicSink
boundary = zmax
variable = pp
center = 0.0
cutoff = -5E4 # roots of depth 5m. 5m of water = 5E4 Pa
use_mobility = true
fluid_phase = 0
# Assume pan evaporation of 4mm/day = 4E-3m3/m2/day = 4kg/m2/day ~ 4E-5kg/m2/s
# Assume that if permeability was 1E-10m^2 and water table at topography then ET acts as pan strength
# Because use_mobility = true, then 4E-5 = maximum_flux = max * perm * density / visc = max * 1E-4, so max = 40
max = 40
[]
[]
[DiracKernels]
[river]
type = PorousFlowPolyLineSink
SumQuantityUO = baseflow
point_file = ex02_river.bh
# Assume a perennial river.
# Assume the river has an incision depth of 1m and a stage height of 1.5m, and these are constant in time and uniform over the whole model. Hence, if groundwater head is 0.5m (5000Pa) there will be no baseflow and leakage.
p_or_t_vals = '-999995000 5000 1000005000'
# Assume the riverbed conductance, k_zz*density*river_segment_length*river_width/riverbed_thickness/viscosity = 1E-6*river_segment_length kg/Pa/s
fluxes = '-1E3 0 1E3'
variable = pp
[]
[]
[Functions]
[initial_pp]
type = SolutionFunction
scale_factor = 1E4
from_variable = cosflow_depth
solution = initial_mesh
[]
[baseflow_rate]
type = ParsedFunction
vars = 'baseflow_kg dt'
vals = 'baseflow_kg dt'
value = 'baseflow_kg / dt * 24.0 * 3600.0 / 400.0'
[]
[]
[PorousFlowUnsaturated]
fp = simple_fluid
porepressure = pp
[]
[Modules]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
[]
[]
[]
[Materials]
[porosity_everywhere]
type = PorousFlowPorosityConst
porosity = 0.05
[]
[permeability_aquifers]
type = PorousFlowPermeabilityConst
block = 'top_aquifer bot_aquifer'
permeability = '1E-12 0 0 0 1E-12 0 0 0 1E-13'
[]
[permeability_aquitard]
type = PorousFlowPermeabilityConst
block = aquitard
permeability = '1E-16 0 0 0 1E-16 0 0 0 1E-17'
[]
[]
[UserObjects]
[initial_mesh]
type = SolutionUserObject
execute_on = INITIAL
mesh = ex02_mesh.e
timestep = LATEST
system_variables = cosflow_depth
[]
[baseflow]
type = PorousFlowSumQuantity
[]
[]
[Postprocessors]
[baseflow_kg]
type = PorousFlowPlotQuantity
uo = baseflow
outputs = 'none'
[]
[dt]
type = TimestepSize
outputs = 'none'
[]
[baseflow_l_per_m_per_day]
type = FunctionValuePostprocessor
function = baseflow_rate
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
# following 2 lines are not mandatory, but illustrate a popular preconditioner choice in groundwater models
petsc_options_iname = '-pc_type -sub_pc_type -pc_asm_overlap'
petsc_options_value = ' asm ilu 2 '
[]
[]
[Executioner]
type = Transient
solve_type = Newton
dt = 1E6
[TimeStepper]
type = FunctionDT
function = 'max(1E6, t)'
[]
end_time = 1E12
nl_abs_tol = 1E-13
[]
[Outputs]
print_linear_residuals = false
[ex]
type = Exodus
execute_on = final
[]
[csv]
type = CSV
[]
[]
(test/tests/auxkernels/solution_aux/solution_aux_exodus_interp_direct.i)
[Mesh]
type = FileMesh
file = cubesource.e
# The SolutionUserObject uses the copy_nodal_solution() capability
# of the Exodus reader, and therefore won't work if the initial mesh
# has been renumbered (it will be reunumbered if you are running with
# DistributedMesh in parallel). Hence, we restrict this test to run with
# ReplicatedMesh only.
parallel_type = replicated
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
initial_condition = 0.0
[../]
[]
[AuxVariables]
[./nn]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./nn]
type = SolutionAux
variable = nn
solution = soln
direct = true
from_variable = source_nodal
[../]
[]
[UserObjects]
[./soln]
type = SolutionUserObject
mesh = cubesource.e
system_variables = source_nodal
[../]
[]
[BCs]
[./stuff]
type = DirichletBC
variable = u
boundary = '1 2'
value = 0.0
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
l_max_its = 800
nl_rel_tol = 1e-10
num_steps = 50
end_time = 5
dt = 0.5
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/auxkernels/solution_aux/aux_nonlinear_solution_adapt_xda.i)
[Mesh]
# This test uses SolutionUserObject which doesn't work with DistributedMesh.
type = FileMesh
file = aux_nonlinear_solution_adapt_out_0004_mesh.xda
parallel_type = replicated
[]
[Adaptivity]
marker = error_frac
steps = 2
[./Indicators]
[./jump_indicator]
type = GradientJumpIndicator
variable = u
[../]
[../]
[./Markers]
[./error_frac]
type = ErrorFractionMarker
indicator = jump_indicator
refine = 0.7
[../]
[../]
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./u_aux]
[../]
[]
[Functions]
[./u_xda_func]
type = SolutionFunction
solution = xda_u
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./aux_xda_kernel]
type = SolutionAux
variable = u_aux
solution = xda_u_aux
execute_on = initial
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = 1
value = 1
[../]
[./right]
type = DirichletBC
variable = u
boundary = 2
value = 2
[../]
[]
[UserObjects]
[./xda_u_aux]
type = SolutionUserObject
system = aux0
mesh = aux_nonlinear_solution_adapt_out_0004_mesh.xda
es = aux_nonlinear_solution_adapt_out_0004.xda
system_variables = u_aux
execute_on = initial
[../]
[./xda_u]
type = SolutionUserObject
system = nl0
mesh = aux_nonlinear_solution_adapt_out_0004_mesh.xda
es = aux_nonlinear_solution_adapt_out_0004.xda
system_variables = u
execute_on = initial
[../]
[]
[Executioner]
type = Steady
solve_type = PJFNK
nl_rel_tol = 1e-10
[]
[Outputs]
exodus = true
[]
[ICs]
[./u_func_ic]
function = u_xda_func
variable = u
type = FunctionIC
[../]
[]
(test/tests/functions/solution_function/solution_function_rot3.i)
# checking rotation of points by 90 deg about z axis, then 45 deg about x axis in a SolutionUserObject
[Mesh]
# this is chosen so when i rotate through 45deg i get a length of "1" along the x or y or z direction
type = GeneratedMesh
dim = 3
xmin = -0.70710678
xmax = 0.70710678
nx = 3
ymin = -0.70710678
ymax = 0.70710678
ny = 3
zmin = -0.70710678
zmax = 0.70710678
nz = 3
[]
[UserObjects]
[./solution_uo]
type = SolutionUserObject
mesh = cube_with_u_equals_x.e
timestep = 1
system_variables = u
# the following takes:
# (0.7, 0.7, +/-0.7) -> (-0.7, 0.7, +/-0.7)
# (-0.7, 0.7, +/-0.7) -> (-0.7, -0.7, +/-0.7)
# (0.7, -0.7, +/-0.7) -> (0.7, 0.7, +/-0.7)
# (-0.7, -0.7, +/-0.7) -> (0.7, -0.7, +/-0.7)
rotation0_vector = '0 0 1'
rotation0_angle = 90
# then the following takes:
# (+/-0.7, 0.7, 0.7) -> (+/-0.7, 0, 1)
# (+/-0.7, 0.7, -0.7) -> (+/-0.7, 1, 0)
# (+/-0.7, -0.7, 0.7) -> (+/-0.7, -1, 0)
# (+/-0.7, -0.7, -0.7) -> (+/-0.7, 0, -1)
rotation1_vector = '1 0 0'
rotation1_angle = 45
# so, in total: a point y = +/-0.7 takes values from x = -/+0.7, so solution_function_rot3 should have u = -y
transformation_order = 'rotation0 rotation1'
[../]
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[ICs]
[./u_init]
type = FunctionIC
variable = u
function = solution_fcn
[../]
[]
[Functions]
[./solution_fcn]
type = SolutionFunction
from_variable = u
solution = solution_uo
[../]
[]
[Kernels]
[./diff]
type = TimeDerivative
variable = u
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
l_max_its = 800
nl_rel_tol = 1e-10
num_steps = 1
end_time = 1
dt = 1
[]
[Outputs]
execute_on = 'timestep_end'
file_base = solution_function_rot3
exodus = true
[]
(test/tests/functions/solution_function/solution_function_rot4.i)
# checking rotation of points by 45 deg about z axis in a SolutionUserObject for a 2D situation
[Mesh]
# this is chosen so when i rotate through 45deg i get a length of "1" along the x or y direction
type = GeneratedMesh
dim = 2
xmin = -0.70710678
xmax = 0.70710678
nx = 3
ymin = -0.70710678
ymax = 0.70710678
ny = 3
[]
[UserObjects]
[./solution_uo]
type = SolutionUserObject
mesh = square_with_u_equals_x.e
timestep = 1
system_variables = u
rotation0_vector = '0 0 1'
rotation0_angle = 45
transformation_order = rotation0
[../]
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[ICs]
[./u_init]
type = FunctionIC
variable = u
function = solution_fcn
[../]
[]
[Functions]
[./solution_fcn]
type = SolutionFunction
from_variable = u
solution = solution_uo
[../]
[]
[Kernels]
[./diff]
type = TimeDerivative
variable = u
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
l_max_its = 800
nl_rel_tol = 1e-10
num_steps = 1
end_time = 1
dt = 1
[]
[Outputs]
execute_on = 'timestep_end'
file_base = solution_function_rot4
exodus = true
[]
(test/tests/auxkernels/solution_aux/solution_aux.i)
[Mesh]
[./square]
type = GeneratedMeshGenerator
nx = 2
ny = 2
dim = 2
[../]
# This test uses SolutionUserObject which doesn't work with DistributedMesh.
parallel_type = replicated
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./u_aux]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./initial_cond_aux]
type = SolutionAux
solution = xda_soln
execute_on = initial
variable = u_aux
[../]
[]
[UserObjects]
[./xda_soln]
type = SolutionUserObject
mesh = build_out_0001_mesh.xda
es = build_out_0001.xda
system_variables = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = 3
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = 1
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
nl_rel_tol = 1e-10
[]
[Outputs]
exodus = true
[./xda]
type = XDA
[../]
[]
(test/tests/functions/solution_function/solution_function_scale_mult.i)
# checking scale_multiplier
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
nx = 3
ymin = -1
ymax = 1
ny = 3
[]
[UserObjects]
[./solution_uo]
type = SolutionUserObject
mesh = square_with_u_equals_x.e
timestep = 1
system_variables = u
scale_multiplier = '2 2 0'
transformation_order = scale_multiplier
[../]
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[ICs]
[./u_init]
type = FunctionIC
variable = u
function = solution_fcn
[../]
[]
[Functions]
[./solution_fcn]
type = SolutionFunction
from_variable = u
solution = solution_uo
[../]
[]
[Kernels]
[./diff]
type = TimeDerivative
variable = u
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
l_max_its = 800
nl_rel_tol = 1e-10
num_steps = 1
end_time = 1
dt = 1
[]
[Outputs]
execute_on = 'timestep_end'
file_base = solution_function_scale_mult
exodus = true
[]
(test/tests/auxkernels/solution_aux/solution_aux_direct.i)
[Mesh]
type = FileMesh
file = build_out_0001_mesh.xda
# This test uses SolutionUserObject which doesn't work with DistributedMesh.
parallel_type = replicated
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./u_aux]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./initial_cond_aux]
type = SolutionAux
solution = soln
variable = u_aux
execute_on = initial
direct = true
[../]
[]
[UserObjects]
[./soln]
type = SolutionUserObject
mesh = build_out_0001_mesh.xda
es = build_out_0001.xda
system_variables = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = 3
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = 1
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
nl_rel_tol = 1e-10
[]
[Outputs]
exodus = true
[]
(test/tests/auxkernels/solution_aux/solution_aux_exodus_interp_restart2.i)
[Mesh]
# This test uses SolutionUserObject which doesn't work with DistributedMesh.
type = FileMesh
file = cubesource.e
parallel_type = replicated
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
initial_condition = 0.0
[../]
[]
[AuxVariables]
[./nn]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./nn]
type = SolutionAux
variable = nn
solution = soln
[../]
[]
[UserObjects]
[./soln]
type = SolutionUserObject
mesh = cubesource.e
system_variables = source_nodal
[../]
[]
[BCs]
[./stuff]
type = DirichletBC
variable = u
boundary = '1 2'
value = 0.0
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
l_max_its = 800
nl_rel_tol = 1e-10
num_steps = 5
start_time = 2.5
end_time = 5
dt = 0.5
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
[Problem]
restart_file_base = solution_aux_exodus_interp_restart1_out_cp/0005
[]
(test/tests/auxkernels/solution_aux/solution_aux_scale.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
xmin = 1
xmax = 4
ymin = 1
ymax = 3
# This test uses SolutionUserObject which doesn't work with DistributedMesh.
parallel_type = replicated
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./u_aux]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./initial_cond_aux]
type = SolutionAux
solution = xda_soln
execute_on = initial
variable = u_aux
[../]
[]
[UserObjects]
[./xda_soln]
type = SolutionUserObject
mesh = build_out_0001_mesh.xda
es = build_out_0001.xda
system_variables = u
scale = '3 2 1'
translation = '1 1 0'
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
nl_rel_tol = 1e-10
[]
[Outputs]
exodus = true
xda = true
[]
(test/tests/functions/solution_function/solution_function_rot1.i)
# checking rotation of points by 45 deg about z axis in a SolutionUserObject
[Mesh]
# this is chosen so when i rotate through 45deg i get a length of "1" along the x or y or z direction
type = GeneratedMesh
dim = 3
xmin = -0.70710678
xmax = 0.70710678
nx = 3
ymin = -0.70710678
ymax = 0.70710678
ny = 3
zmin = -0.70710678
zmax = 0.70710678
nz = 3
[]
[UserObjects]
[./solution_uo]
type = SolutionUserObject
mesh = cube_with_u_equals_x.e
timestep = LATEST
system_variables = u
rotation0_vector = '0 0 1'
rotation0_angle = 45
transformation_order = rotation0
[../]
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[ICs]
[./u_init]
type = FunctionIC
variable = u
function = solution_fcn
[../]
[]
[Functions]
[./solution_fcn]
type = SolutionFunction
from_variable = u
solution = solution_uo
[../]
[]
[Kernels]
[./diff]
type = TimeDerivative
variable = u
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
l_max_its = 800
nl_rel_tol = 1e-10
num_steps = 1
end_time = 1
dt = 1
[]
[Outputs]
execute_on = 'timestep_end'
file_base = solution_function_rot1
exodus = true
[]
(test/tests/auxkernels/solution_aux/solution_aux_exodus_elemental.i)
[Mesh]
file = cubesource.e
# The SolutionUserObject uses the copy_nodal_solution() capability
# of the Exodus reader, and therefore won't work if the initial mesh
# has been renumbered (it will be reunumbered if you are running with
# DistributedMesh in parallel). Hence, we restrict this test to run with
# ReplicatedMesh only.
parallel_type = replicated
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
initial_condition = 0.0
[../]
[]
[AuxVariables]
[./nn]
order = FIRST
family = LAGRANGE
[../]
[./en]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./nn]
type = SolutionAux
solution = soln
variable = nn
scale_factor = 2.0
from_variable = source_nodal
[../]
[./en]
type = SolutionAux
solution = soln
variable = en
scale_factor = 2.0
from_variable = source_element
[../]
[]
[UserObjects]
[./soln]
type = SolutionUserObject
mesh = cubesource.e
system_variables = 'source_nodal source_element'
timestep = 2
[../]
[]
[BCs]
[./stuff]
type = DirichletBC
variable = u
boundary = '1 2'
value = 0.0
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
l_max_its = 800
nl_rel_tol = 1e-10
num_steps = 50
end_time = 5
dt = 0.5
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(modules/combined/test/tests/axisymmetric_2d3d_solution_function/3dy.i)
[GlobalParams]
order = FIRST
family = LAGRANGE
displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
file = 3dy.e
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[./disp_z]
[../]
[]
[AuxVariables]
[./temp]
[../]
[./hoop_stress]
order = CONSTANT
family = MONOMIAL
[../]
[]
[UserObjects]
[./soln]
type = SolutionUserObject
mesh = 2d_out.e
system_variables = 'disp_x disp_y temp'
[../]
[]
[Functions]
[./soln_func_temp]
type = Axisymmetric2D3DSolutionFunction
solution = soln
from_variables = 'temp'
[../]
[./soln_func_disp_x]
type = Axisymmetric2D3DSolutionFunction
solution = soln
from_variables = 'disp_x disp_y'
component = 0
[../]
[./soln_func_disp_y]
type = Axisymmetric2D3DSolutionFunction
solution = soln
from_variables = 'disp_x disp_y'
component = 1
[../]
[./soln_func_disp_z]
type = Axisymmetric2D3DSolutionFunction
solution = soln
from_variables = 'disp_x disp_y'
component = 2
[../]
[]
[Modules/TensorMechanics/Master]
[./all]
volumetric_locking_correction = true
add_variables = true
incremental = true
strain = FINITE
eigenstrain_names = thermal_expansion
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress'
[../]
[]
[AuxKernels]
[./t_soln_aux]
type = FunctionAux
variable = temp
block = '1 2'
function = soln_func_temp
[../]
[./hoop_stress]
type = RankTwoScalarAux
rank_two_tensor = stress
variable = hoop_stress
scalar_type = HoopStress
execute_on = timestep_end
[../]
[]
[BCs]
[./x_soln_bc]
type = FunctionDirichletBC
variable = disp_x
preset = false
boundary = '1 2'
function = soln_func_disp_x
[../]
[./y_soln_bc]
type = FunctionDirichletBC
variable = disp_y
preset = false
boundary = '1 2'
function = soln_func_disp_y
[../]
[./z_soln_bc]
type = FunctionDirichletBC
variable = disp_z
preset = false
boundary = '1 2'
function = soln_func_disp_z
[../]
[]
[Materials]
[./elasticity_tensor]
type = ComputeIsotropicElasticityTensor
block = '1 2'
youngs_modulus = 193.05e9
poissons_ratio = 0.3
[../]
[./stress]
type = ComputeFiniteStrainElasticStress
block = '1 2'
[../]
[./thermal_expansion]
type = ComputeThermalExpansionEigenstrain
block = '1 2'
thermal_expansion_coeff = 13e-6
stress_free_temperature = 295.00
temperature = temp
eigenstrain_name = thermal_expansion
[../]
[./density]
type = Density
block = '1'
density = 8000.0
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options = '-ksp_snes_ew'
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
petsc_options_value = ' 201 hypre boomeramg 4'
line_search = 'none'
l_max_its = 25
nl_max_its = 20
nl_rel_tol = 1e-10
l_tol = 1e-2
start_time = 0.0
dt = 1
end_time = 1
dtmin = 1
[]
[Outputs]
file_base = 3dy_out
exodus = true
[./console]
type = Console
max_rows = 25
[../]
[]
(test/tests/auxkernels/solution_aux/solution_aux_exodus_elemental_only.i)
[Mesh]
file = cubesource.e
# The SolutionUserObject uses the copy_nodal_solution() capability
# of the Exodus reader, and therefore won't work if the initial mesh
# has been renumbered (it will be reunumbered if you are running with
# DistributedMesh in parallel). Hence, we restrict this test to run with
# ReplicatedMesh only.
parallel_type = replicated
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
initial_condition = 0.0
[../]
[]
[AuxVariables]
[./en]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./en]
type = SolutionAux
solution = soln
variable = en
scale_factor = 2.0
from_variable = source_element
[../]
[]
[UserObjects]
[./soln]
type = SolutionUserObject
mesh = cubesource.e
system_variables = 'source_element'
timestep = 2
[../]
[]
[BCs]
[./stuff]
type = DirichletBC
variable = u
boundary = '1 2'
value = 0.0
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
l_max_its = 800
nl_rel_tol = 1e-10
num_steps = 50
end_time = 5
dt = 0.5
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/functions/solution_function/solution_function_grad_p2.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
parallel_type = replicated
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./test_variable_x]
order = FIRST
family = LAGRANGE
[../]
[./test_variable_y]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxKernels]
[./test_variable_x_aux]
type = FunctionDerivativeAux
variable = test_variable_x
component = x
function = solution_function
[../]
[./test_variable_y_aux]
type = FunctionDerivativeAux
variable = test_variable_y
component = y
function = solution_function
[../]
[]
[UserObjects]
[./ex_soln]
type = SolutionUserObject
system_variables = test_variable
mesh = solution_function_grad_p1.e
[../]
[]
[Functions]
[./solution_function]
type = SolutionFunction
solution = ex_soln
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = 2
value = 1
[../]
[]
[Executioner]
type = Steady
nl_rel_tol = 1e-10
[]
[Outputs]
file_base = solution_function_grad_p2
exodus = true
[]
(modules/thermal_hydraulics/test/tests/misc/surrogate_power_profile/surrogate_power_profile.i)
# This takes an exodus file with a power profile and uses that in a heat structure
# of a core channel as power density. This tests the capability of taking a
# rattlesnake generated power profile and using it in RELAP-7.
[GlobalParams]
initial_p = 15.5e6
initial_vel = 0.
initial_T = 559.15
gravity_vector = '0 -9.8 0'
scaling_factor_1phase = '1 1 1e-4'
scaling_factor_temperature = 1e-2
closures = simple_closures
[]
[Modules/FluidProperties]
[water]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1.e9
cv = 1816
[]
[]
[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]
[HeatStructureMaterials]
[fuel-mat]
type = SolidMaterialProperties
k = 2.5
cp = 300.
rho = 1.032e4
[]
[gap-mat]
type = SolidMaterialProperties
k = 0.6
cp = 1.
rho = 1.
[]
[clad-mat]
type = SolidMaterialProperties
k = 21.5
cp = 350.
rho = 6.55e3
[]
[]
[Components]
[CCH1:pipe]
type = FlowChannel1Phase
position = '0.02 0 0'
orientation = '0 1 0'
length = 3.865
n_elems = 20
A = 8.78882e-5
D_h = 0.01179
f = 0.01
fp = water
[]
[CCH1:solid]
type = HeatStructureCylindrical
position = '0.024748 0 0'
orientation = '0 1 0'
length = 3.865
n_elems = 20
initial_T = 559.15
names = 'fuel gap clad'
widths = '0.004096 0.0001 0.000552'
n_part_elems = '5 1 2'
materials = 'fuel-mat gap-mat clad-mat'
[]
[CCH1:hx]
type = HeatTransferFromHeatStructure1Phase
flow_channel = CCH1:pipe
hs = CCH1:solid
hs_side = outer
Hw = 5.33e4
P_hf = 2.9832563838489e-2
[]
[inlet]
type = InletMassFlowRateTemperature1Phase
input = 'CCH1:pipe:in'
m_dot = 0.1
T = 559.15
[]
[outlet]
type = Outlet1Phase
input = 'CCH1:pipe:out'
p = 15.5e6
[]
[]
[UserObjects]
[reactor_power_density_uo]
type = SolutionUserObject
mesh = 'power_profile.e'
system_variables = power_density
translation = '0. 0. 0.'
[]
[]
[Functions]
[power_density_fn]
type = SolutionFunction
from_variable = power_density
solution = reactor_power_density_uo
[]
[]
[AuxVariables]
[power_density]
family = MONOMIAL
order = CONSTANT
block = 'CCH1:solid:fuel'
[]
[]
[AuxKernels]
[power_density_aux]
type = FunctionAux
variable = power_density
function = power_density_fn
block = 'CCH1:solid:fuel'
execute_on = 'timestep_begin'
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0.0
num_steps = 10
dt = 1e-2
abort_on_solve_fail = true
solve_type = 'PJFNK'
line_search = 'basic'
nl_rel_tol = 1e-12
nl_abs_tol = 1e-9
nl_max_its = 10
l_tol = 1e-3
l_max_its = 100
[Quadrature]
type = GAUSS
order = SECOND
[]
[]
[Outputs]
[out]
type = Exodus
[]
velocity_as_vector = false
[]
(examples/ex14_pps/ex14_compare_solutions_2.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 11
ny = 11
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
[]
[Variables]
[./forced]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = forced
[../]
[./forcing]
type = BodyForce
variable = forced
function = 'x*x+y*y' # Any object expecting a function name can also receive a ParsedFunction string
[../]
[]
[BCs]
[./all]
type = DirichletBC
variable = forced
boundary = 'bottom right top left'
value = 0
[../]
[]
[UserObjects]
[./fine_solution]
# Read in the fine grid solution
type = SolutionUserObject
system_variables = forced
mesh = ex14_compare_solutions_1_out_0000_mesh.xda
es = ex14_compare_solutions_1_out_0000.xda
[../]
[]
[Functions]
[./fine_function]
# Create a Function out of the fine grid solution
# Note: This references the SolutionUserObject above
type = SolutionFunction
solution = fine_solution
[../]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[./Quadrature]
# The integration of the error happens on the coarse mesh
# To reduce integration error of the finer solution we can
# raise the integration order.
# Note: This will slow down the calculation a bit
order = SIXTH
[../]
[]
[Postprocessors]
[./error]
# Compute the error between the computed solution and the fine-grid solution
type = ElementL2Error
variable = forced
function = fine_function
[../]
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/auxkernels/solution_aux/output_error.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
xmin = 1
xmax = 4
ymin = 1
ymax = 3
# This test uses SolutionUserObject which doesn't work with DistributedMesh.
parallel_type = replicated
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./u_aux]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./initial_cond_aux]
type = SolutionAux
solution = xda_soln
execute_on = initial
variable = u_aux
direct = false
[../]
[]
[UserObjects]
[./xda_soln]
type = SolutionUserObject
mesh = build_out_0001_mesh.xda
es = build_out_0001.xda
system_variables = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
nl_rel_tol = 1e-10
[]
[Outputs]
exodus = true
xda = true
[]
(test/tests/functions/solution_function/solution_function_rot2.i)
# checking rotation of points by 45 deg about y axis in a SolutionUserObject
[Mesh]
# this is chosen so when i rotate through 45deg i get a length of "1" along the x or y or z direction
type = GeneratedMesh
dim = 3
xmin = -0.70710678
xmax = 0.70710678
nx = 3
ymin = -0.70710678
ymax = 0.70710678
ny = 3
zmin = -0.70710678
zmax = 0.70710678
nz = 3
[]
[UserObjects]
[./solution_uo]
type = SolutionUserObject
mesh = cube_with_u_equals_x.e
timestep = 1
system_variables = u
rotation0_vector = '0 1 0'
rotation0_angle = 45
transformation_order = rotation0
[../]
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[ICs]
[./u_init]
type = FunctionIC
variable = u
function = solution_fcn
[../]
[]
[Functions]
[./solution_fcn]
type = SolutionFunction
from_variable = u
solution = solution_uo
[../]
[]
[Kernels]
[./diff]
type = TimeDerivative
variable = u
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
l_max_its = 800
nl_rel_tol = 1e-10
num_steps = 1
end_time = 1
dt = 1
[]
[Outputs]
execute_on = 'timestep_end'
file_base = solution_function_rot2
exodus = true
[]
(test/tests/functions/solution_function/solution_function_test.i)
[Mesh]
[./square]
type = GeneratedMeshGenerator
nx = 2
ny = 2
dim = 2
[../]
# This test uses SolutionUserObject which doesn't work with DistributedMesh.
parallel_type = replicated
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = FunctionIC
function = initial_cond_func
[../]
[../]
[]
[AuxVariables]
[./u_aux]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = FunctionIC
function = initial_cond_func
[../]
[../]
[]
[Functions]
[./initial_cond_func]
type = SolutionFunction
solution = ex_soln
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = 3
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = 1
value = 1
[../]
[]
[UserObjects]
[./ex_soln]
type = SolutionUserObject
system_variables = u
mesh = build_out_0001_mesh.xda
es = build_out_0001.xda
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
nl_rel_tol = 1e-10
[]
[Outputs]
file_base = out
exodus = true
[]
(test/tests/auxkernels/solution_aux/solution_aux_exodus_direct.i)
[Mesh]
type = FileMesh
file = cubesource.e
# The SolutionUserObject uses the copy_nodal_solution() capability
# of the Exodus reader, and therefore won't work if the initial mesh
# has been renumbered (it will be reunumbered if you are running with
# DistributedMesh in parallel). Hence, we restrict this test to run with
# ReplicatedMesh only.
parallel_type = replicated
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
initial_condition = 0.0
[../]
[]
[AuxVariables]
[./nn]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./nn]
type = SolutionAux
solution = soln
variable = nn
scale_factor = 2.0
direct = true
[../]
[]
[UserObjects]
[./soln]
type = SolutionUserObject
mesh = cubesource.e
system_variables = source_nodal
timestep = 2
[../]
[]
[BCs]
[./stuff]
type = DirichletBC
variable = u
boundary = '1 2'
value = 0.0
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
l_max_its = 800
nl_rel_tol = 1e-10
num_steps = 50
end_time = 5
dt = 0.5
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/functions/solution_function/solution_function_exodus_test.i)
# [Executioner]
# type = Steady
# petsc_options = '-snes'
# l_max_its = 800
# nl_rel_tol = 1e-10
# []
[Mesh]
type = FileMesh
file = cubesource.e
# This test uses SolutionUserObject which doesn't work with DistributedMesh.
parallel_type = replicated
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
initial_condition = 0.0
[../]
[]
[AuxVariables]
# [./ne]
# order = FIRST
# family = LAGRANGE
# [../]
# [./ee]
# order = CONSTANT
# family = MONOMIAL
# [../]
[./nn]
order = FIRST
family = LAGRANGE
[../]
[./en]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Functions]
# [./sourcee]
# type = SolutionFunction
# file_type = exodusII
# mesh = cubesource.e
# variable = source_element
# [../]
[./sourcen]
type = SolutionFunction
scale_factor = 2.0
solution = cube_soln
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
# [./ne]
# type = FunctionAux
# variable = ne
# function = sourcee
# [../]
# [./ee]
# type = FunctionAux
# variable = ee
# function = sourcee
# [../]
[./nn]
type = FunctionAux
variable = nn
function = sourcen
[../]
[./en]
type = FunctionAux
variable = en
function = sourcen
[../]
[]
[BCs]
[./stuff]
type = DirichletBC
variable = u
boundary = '1 2'
value = 0.0
[../]
[]
[UserObjects]
[./cube_soln]
type = SolutionUserObject
timestep = 2
system_variables = source_nodal
mesh = cubesource.e
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
l_max_its = 800
nl_rel_tol = 1e-10
num_steps = 50
end_time = 5
dt = 0.5
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/userobjects/solution_user_object/discontinuous_value_solution_uo_p2.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 2
ny = 2
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./one]
type = DirichletBC
variable = u
boundary = 'right top bottom'
value = 1
[../]
[]
[UserObjects]
[./soln]
type = SolutionUserObject
mesh = discontinuous_value_solution_uo_p1.e
system_variables = 'discontinuous_variable continuous_variable'
[../]
[]
[Postprocessors]
[./discontinuous_value_left]
type = TestDiscontinuousValuePP
variable = discontinuous_variable
point = '0.25 0.25 0.0'
solution = soln
[../]
[./discontinuous_value_face]
type = TestDiscontinuousValuePP
variable = discontinuous_variable
point = '0.5 0.25 0.0'
solution = soln
[../]
[./discontinuous_value_right]
type = TestDiscontinuousValuePP
variable = discontinuous_variable
point = '0.75 0.25 0.0'
solution = soln
[../]
[./continuous_gradient_left]
type = TestDiscontinuousValuePP
variable = continuous_variable
evaluate_gradient = true
gradient_component = x
point = '0.25 0.25 0.0'
solution = soln
[../]
[./continuous_gradient_value_face]
type = TestDiscontinuousValuePP
variable = continuous_variable
evaluate_gradient = true
gradient_component = x
point = '0.5 0.25 0.0'
solution = soln
[../]
[./continuous_gradient_right]
type = TestDiscontinuousValuePP
variable = continuous_variable
evaluate_gradient = true
gradient_component = x
point = '0.75 0.25 0.0'
solution = soln
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
file_base = discontinuous_value_solution_uo_p2
exodus = false
csv = true
[]
(test/tests/auxkernels/solution_aux/solution_aux_multi_err.i)
[Mesh]
file = cubesource.e
# This test uses SolutionUserObject which doesn't work with DistributedMesh.
parallel_type = replicated
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
initial_condition = 0.0
[../]
[]
[AuxVariables]
[./nn]
order = FIRST
family = LAGRANGE
[../]
[./en]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./nn]
type = SolutionAux
solution = soln
variable = nn
scale_factor = 2.0
#from_variable = source_nodal
#add_factor = -10teg
[../]
[./en]
type = SolutionAux
solution = soln
variable = en
scale_factor = 2.0
#from_variable = source_nodal
[../]
[]
[UserObjects]
[./soln]
type = SolutionUserObject
mesh = cubesource_added.e
system_variables = 'source_nodal nodal_10'
timestep = 2
[../]
[]
[BCs]
[./stuff]
type = DirichletBC
variable = u
boundary = '1 2'
value = 0.0
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
l_max_its = 800
nl_rel_tol = 1e-10
num_steps = 50
end_time = 5
dt = 0.5
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/auxkernels/solution_aux/aux_nonlinear_solution_xdr.i)
[Mesh]
# This test uses SolutionUserObject which doesn't work with DistributedMesh.
type = GeneratedMesh
parallel_type = replicated
dim = 2
nx = 2
ny = 2
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./u_aux]
[../]
[]
[Functions]
[./u_xdr_func]
type = SolutionFunction
solution = xdr_u
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./aux_xdr_kernel]
type = SolutionAux
variable = u_aux
solution = xdr_u_aux
execute_on = initial
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = 1
value = 1
[../]
[./right]
type = DirichletBC
variable = u
boundary = 2
value = 2
[../]
[]
[UserObjects]
[./xdr_u_aux]
type = SolutionUserObject
system = aux0
mesh = aux_nonlinear_solution_xdr_0001_mesh.xdr
es = aux_nonlinear_solution_xdr_0001.xdr
execute_on = initial
[../]
[./xdr_u]
type = SolutionUserObject
system = nl0
mesh = aux_nonlinear_solution_xdr_0001_mesh.xdr
es = aux_nonlinear_solution_xdr_0001.xdr
execute_on = initial
[../]
[]
[Executioner]
type = Steady
solve_type = PJFNK
nl_rel_tol = 1e-10
[]
[Outputs]
exodus = true
[]
[ICs]
[./u_func_ic]
function = u_xdr_func
variable = u
type = FunctionIC
[../]
[]
(modules/porous_flow/examples/restart/gas_injection_new_mesh.i)
# Using the results from the equilibrium run to provide the initial condition for
# porepressure, we now inject a gas phase into the brine-saturated reservoir. In this
# example, the mesh is not identical to the mesh used in gravityeq.i. Rather, it is
# generated so that it is more refined near the injection boundary and at the top of
# the model, as that is where the gas plume will be present.
#
# To use the hydrostatic pressure calculated using the gravity equilibrium run as the initial
# condition for the pressure, a SolutionUserObject is used, along with a SolutionFunction to
# interpolate the pressure from the gravity equilibrium run to the initial condition for liqiud
# porepressure in this example.
#
# Even though the gravity equilibrium is established using a 2D mesh, in this example,
# we use a mesh shifted 0.1 m to the right and rotate it about the Y axis to make a 2D radial
# model.
#
# Methane injection takes place over the surface of the hole created by rotating the mesh,
# and hence the injection area is 2 pi r h. We can calculate this using an AreaPostprocessor,
# and then use this in a ParsedFunction to calculate the injection rate so that 10 kg/s of
# methane is injected.
#
# Note: as this example uses the results from a previous simulation, gravityeq.i MUST be
# run before running this input file.
[Mesh]
type = GeneratedMesh
dim = 2
ny = 25
nx = 50
ymax = 100
xmin = 0.1
xmax = 5000
bias_x = 1.05
bias_y = 0.95
[]
[Problem]
coord_type = RZ
rz_coord_axis = Y
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 -9.81 0'
temperature_unit = Celsius
[]
[Variables]
[pp_liq]
[]
[sat_gas]
initial_condition = 0
[]
[]
[ICs]
[ppliq_ic]
type = FunctionIC
variable = pp_liq
function = ppliq_ic
[]
[]
[AuxVariables]
[temperature]
initial_condition = 50
[]
[xnacl]
initial_condition = 0.1
[]
[brine_density]
family = MONOMIAL
order = CONSTANT
[]
[methane_density]
family = MONOMIAL
order = CONSTANT
[]
[massfrac_ph0_sp0]
initial_condition = 1
[]
[massfrac_ph1_sp0]
initial_condition = 0
[]
[pp_gas]
family = MONOMIAL
order = CONSTANT
[]
[sat_liq]
family = MONOMIAL
order = CONSTANT
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
variable = pp_liq
[]
[flux0]
type = PorousFlowAdvectiveFlux
variable = pp_liq
[]
[mass1]
type = PorousFlowMassTimeDerivative
variable = sat_gas
fluid_component = 1
[]
[flux1]
type = PorousFlowAdvectiveFlux
variable = sat_gas
fluid_component = 1
[]
[]
[AuxKernels]
[brine_density]
type = PorousFlowPropertyAux
property = density
variable = brine_density
execute_on = 'initial timestep_end'
[]
[methane_density]
type = PorousFlowPropertyAux
property = density
variable = methane_density
phase = 1
execute_on = 'initial timestep_end'
[]
[pp_gas]
type = PorousFlowPropertyAux
property = pressure
phase = 1
variable = pp_gas
execute_on = 'initial timestep_end'
[]
[sat_liq]
type = PorousFlowPropertyAux
property = saturation
variable = sat_liq
execute_on = 'initial timestep_end'
[]
[]
[BCs]
[gas_injection]
type = PorousFlowSink
boundary = left
variable = sat_gas
flux_function = injection_rate
fluid_phase = 1
[]
[brine_out]
type = PorousFlowPiecewiseLinearSink
boundary = right
variable = pp_liq
multipliers = '0 1e9'
pt_vals = '0 1e9'
fluid_phase = 0
flux_function = 1e-6
use_mobility = true
use_relperm = true
mass_fraction_component = 0
[]
[]
[Functions]
[injection_rate]
type = ParsedFunction
vals = injection_area
vars = area
value = '-1/area'
[]
[ppliq_ic]
type = SolutionFunction
solution = soln
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pp_liq sat_gas'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureVG
alpha = 1e-5
m = 0.5
sat_lr = 0.2
pc_max = 1e7
[]
[soln]
type = SolutionUserObject
mesh = gravityeq_out.e
system_variables = porepressure
[]
[]
[Modules]
[FluidProperties]
[brine]
type = BrineFluidProperties
[]
[methane]
type = MethaneFluidProperties
[]
[methane_tab]
type = TabulatedFluidProperties
fp = methane
save_file = false
[]
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = temperature
[]
[ps]
type = PorousFlow2PhasePS
phase0_porepressure = pp_liq
phase1_saturation = sat_gas
capillary_pressure = pc
[]
[massfrac]
type = PorousFlowMassFraction
mass_fraction_vars = 'massfrac_ph0_sp0 massfrac_ph1_sp0'
[]
[brine]
type = PorousFlowBrine
compute_enthalpy = false
compute_internal_energy = false
xnacl = xnacl
phase = 0
[]
[methane]
type = PorousFlowSingleComponentFluid
compute_enthalpy = false
compute_internal_energy = false
fp = methane_tab
phase = 1
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.1
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-13 0 0 0 5e-14 0 0 0 1e-13'
[]
[relperm_liq]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
s_res = 0.2
sum_s_res = 0.3
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 1
s_res = 0.1
sum_s_res = 0.3
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = ' asm lu NONZERO'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 1e8
nl_abs_tol = 1e-12
nl_rel_tol = 1e-06
nl_max_its = 20
dtmax = 1e6
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e1
growth_factor = 1.5
[]
[]
[Postprocessors]
[mass_ph0]
type = PorousFlowFluidMass
fluid_component = 0
execute_on = 'initial timestep_end'
[]
[mass_ph1]
type = PorousFlowFluidMass
fluid_component = 1
execute_on = 'initial timestep_end'
[]
[injection_area]
type = AreaPostprocessor
boundary = left
execute_on = initial
[]
[]
[Outputs]
execute_on = 'initial timestep_end'
exodus = true
perf_graph = true
[]
(test/tests/auxkernels/solution_aux/solution_aux_exodus_interp_restart1.i)
[Mesh]
# This test uses SolutionUserObject which doesn't work with DistributedMesh.
type = FileMesh
file = cubesource.e
parallel_type = replicated
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
initial_condition = 0.0
[../]
[]
[AuxVariables]
[./nn]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[AuxKernels]
[./nn]
type = SolutionAux
variable = nn
solution = soln
[../]
[]
[UserObjects]
[./soln]
type = SolutionUserObject
mesh = cubesource.e
system_variables = source_nodal
execute_on = 'initial timestep_begin'
[../]
[]
[BCs]
[./stuff]
type = DirichletBC
variable = u
boundary = '1 2'
value = 0.0
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
l_max_its = 800
nl_rel_tol = 1e-10
num_steps = 5
end_time = 5
dt = 0.5
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
checkpoint = true
[]
(modules/phase_field/include/userobjects/SolutionRasterizer.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 "SolutionUserObject.h"
// Forward Declarations
/**
* This Userobject is the base class of Userobjects that generate one
* random number per timestep and quadrature point in a way that the integral
* over all random numbers is zero. This can be used for a concentration fluctuation
* kernel such as ConservedLangevinNoise, that keeps the total concenration constant.
*
* \see ConservedUniformNoise
*/
class SolutionRasterizer : public SolutionUserObject
{
public:
static InputParameters validParams();
SolutionRasterizer(const InputParameters & parameters);
virtual ~SolutionRasterizer() {}
/// Initialize the System and Mesh objects for the solution being read
virtual void initialSetup();
protected:
FileName _xyz_input;
FileName _xyz_output;
std::string _variable;
MooseEnum _raster_mode;
Real _threshold;
};