- expression
C++ Type:FunctionExpression
Controllable:No
- variableThe name of the variable that this object applies to
C++ Type:AuxVariableName
Controllable:No
Description:The name of the variable that this object applies to
ParsedAux
Sets a field variable value to the evaluation of a parsed expression.
The parsed expression may contain:
variables (
coupled_variables
parameter)coordinates in space and time (
use_xyzt
parameter)constants (
constant_names
for their name in the expression andconstant_expressions
for their values)
Material properties are currently not supported, but it would be really easy to add it so feel free to contact us.
Example syntax
In this example, the ParsedAux
is being used to compute the multiplication of the simulation variable, u
, by 2.
[AuxKernels]
[two_u]
type = ParsedAux
variable = two_u
coupled_variables = 'u'
expression = '2*u'
[]
[]
(test/tests/outputs/png/wedge.i)Input Parameters
- blockThe list of blocks (ids or names) that this object will be applied
C++ Type:std::vector<SubdomainName>
Controllable:No
Description:The list of blocks (ids or names) that this object will be applied
- boundaryThe list of boundaries (ids or names) from the mesh where this object applies
C++ Type:std::vector<BoundaryName>
Controllable:No
Description:The list of boundaries (ids or names) from the mesh where this object applies
- check_boundary_restrictedTrueWhether to check for multiple element sides on the boundary in the case of a boundary restricted, element aux variable. Setting this to false will allow contribution to a single element's elemental value(s) from multiple boundary sides on the same element (example: when the restricted boundary exists on two or more sides of an element, such as at a corner of a mesh
Default:True
C++ Type:bool
Controllable:No
Description:Whether to check for multiple element sides on the boundary in the case of a boundary restricted, element aux variable. Setting this to false will allow contribution to a single element's elemental value(s) from multiple boundary sides on the same element (example: when the restricted boundary exists on two or more sides of an element, such as at a corner of a mesh
- constant_expressionsVector of values for the constants in constant_names (can be an FParser expression)
C++ Type:std::vector<std::string>
Controllable:No
Description:Vector of values for the constants in constant_names (can be an FParser expression)
- constant_namesVector of constants used in the parsed function (use this for kB etc.)
C++ Type:std::vector<std::string>
Controllable:No
Description:Vector of constants used in the parsed function (use this for kB etc.)
- coupled_variables
C++ Type:std::vector<VariableName>
Controllable:No
- execute_onLINEAR TIMESTEP_ENDThe 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, PRE_DISPLACE.
Default:LINEAR TIMESTEP_END
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, PRE_DISPLACE
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, PRE_DISPLACE.
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Default:False
C++ Type:bool
Controllable:No
Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
- use_xyztFalseMake coordinate (x,y,z) and time (t) variables available in the function expression.
Default:False
C++ Type:bool
Controllable:No
Description:Make coordinate (x,y,z) and time (t) variables available in the function expression.
Optional Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- disable_fpoptimizerFalseDisable the function parser algebraic optimizer
Default:False
C++ Type:bool
Controllable:No
Description:Disable the function parser algebraic optimizer
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- enable_ad_cacheTrueEnable caching of function derivatives for faster startup time
Default:True
C++ Type:bool
Controllable:No
Description:Enable caching of function derivatives for faster startup time
- enable_auto_optimizeTrueEnable automatic immediate optimization of derivatives
Default:True
C++ Type:bool
Controllable:No
Description:Enable automatic immediate optimization of derivatives
- enable_jitTrueEnable just-in-time compilation of function expressions for faster evaluation
Default:True
C++ Type:bool
Controllable:No
Description:Enable just-in-time compilation of function expressions for faster evaluation
- evalerror_behaviornanWhat to do if evaluation error occurs. Options are to pass a nan, pass a nan with a warning, throw a error, or throw an exception
Default:nan
C++ Type:MooseEnum
Options:nan, nan_warning, error, exception
Controllable:No
Description:What to do if evaluation error occurs. Options are to pass a nan, pass a nan with a warning, throw a error, or throw an exception
- seed0The seed for the master random number generator
Default:0
C++ Type:unsigned int
Controllable:No
Description:The seed for the master random number generator
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Advanced Parameters
Input Files
- (modules/geochemistry/test/tests/kinetics/kinetic_albite.i)
- (modules/thermal_hydraulics/test/tests/components/flow_component_ns/flow_component_ns_pinc.i)
- (test/tests/transfers/general_field/user_object/duplicated_user_object_tests/restricted_node_parent.i)
- (test/tests/multiapps/clone_parent_mesh/main.i)
- (modules/functional_expansion_tools/test/tests/errors/multiapp_sub.i)
- (test/tests/userobjects/nodal_patch_recovery/nodal_patch_recovery.i)
- (modules/combined/examples/geochem-porous_flow/geotes_weber_tensleep/aquifer_geochemistry.i)
- (test/tests/transfers/multiapp_userobject_transfer/restricted_elem_sub.i)
- (modules/combined/examples/phase_field-mechanics/kks_mechanics_VTS.i)
- (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/rayleigh-bernard-two-phase.i)
- (tutorials/tutorial04_meshing/app/test/tests/base_mesh_generators/reporting_id_vpp.i)
- (modules/porous_flow/test/tests/poro_elasticity/mandel_basicthm.i)
- (modules/navier_stokes/test/tests/finite_element/cns/bump/bump.i)
- (modules/solid_mechanics/test/tests/torque/ad_torque_small.i)
- (modules/geochemistry/test/tests/time_dependent_reactions/flushing_case3.i)
- (modules/porous_flow/examples/reservoir_model/regular_grid.i)
- (modules/porous_flow/test/tests/chemistry/dissolution_limited.i)
- (modules/functional_expansion_tools/test/tests/standard_use/multiapp_sub.i)
- (test/tests/transfers/general_field/user_object/duplicated_user_object_tests/restricted_node_sub.i)
- (modules/combined/examples/geochem-porous_flow/geotes_2D/aquifer_un_quartz_geochemistry.i)
- (modules/porous_flow/test/tests/poro_elasticity/mandel_fully_saturated.i)
- (modules/phase_field/test/tests/electrochem_sintering/ElectrochemicalSintering_test.i)
- (modules/combined/examples/geochem-porous_flow/geotes_2D/exchanger.i)
- (test/tests/auxkernels/linear_combination/test.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/boussinesq/wcnsfv.i)
- (modules/combined/examples/geochem-porous_flow/geotes_weber_tensleep/eqm_model_25_to_92degC.i)
- (modules/combined/examples/geochem-porous_flow/geotes_2D/exchanger_un_quartz.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/boussinesq/transient-wcnsfv.i)
- (modules/combined/examples/geochem-porous_flow/forge/aquifer_geochemistry.i)
- (modules/optimization/test/tests/vectorpostprocessors/element_source_inner_product/element_source_inner_product.i)
- (modules/solid_mechanics/test/tests/action/material_output_order.i)
- (modules/phase_field/test/tests/KKS_system/auxkernel.i)
- (test/tests/variables/linearfv/diffusion-1d-aux.i)
- (modules/combined/examples/phase_field-mechanics/kks_mechanics_KHS.i)
- (modules/combined/test/tests/poro_mechanics/borehole_highres.i)
- (modules/functional_expansion_tools/examples/3D_volumetric_Cartesian/sub.i)
- (modules/porous_flow/examples/tutorial/11_2D.i)
- (test/tests/transfers/multiapp_userobject_transfer/restricted_node_sub.i)
- (modules/porous_flow/examples/groundwater/ex01.i)
- (modules/functional_expansion_tools/test/tests/standard_use/volume_sub.i)
- (modules/solid_mechanics/test/tests/notched_plastic_block/cmc_planar.i)
- (modules/solid_mechanics/test/tests/torque/torque_small.i)
- (modules/navier_stokes/test/tests/finite_volume/pwcns/channel-flow/2d-transient-action.i)
- (modules/functional_expansion_tools/test/tests/standard_use/volume_coupling_custom_norm_sub.i)
- (modules/geochemistry/test/tests/solubilities_and_activities/gypsum_solubility.i)
- (modules/geochemistry/test/tests/kinetics/quartz_dissolution.i)
- (modules/navier_stokes/test/tests/finite_volume/pwcns/channel-flow/2d-transient.i)
- (modules/functional_expansion_tools/examples/3D_volumetric_Cartesian_different_submesh/sub.i)
- (modules/combined/examples/optimization/multi-load/single_main.i)
- (modules/functional_expansion_tools/examples/3D_volumetric_cylindrical/sub.i)
- (modules/combined/examples/geochem-porous_flow/geotes_weber_tensleep/exchanger.i)
- (modules/geochemistry/test/tests/kernels/time_deriv_1.i)
- (modules/porous_flow/test/tests/poro_elasticity/mandel_constM.i)
- (modules/geochemistry/test/tests/sorption_and_surface_complexation/selenate.i)
- (modules/porous_flow/examples/multiapp_fracture_flow/diffusion_multiapp/fracture_app_heat.i)
- (test/tests/auxkernels/parsed_aux/parsed_aux_test.i)
- (modules/combined/test/tests/poro_mechanics/borehole_lowres.i)
- (modules/porous_flow/test/tests/chemistry/precipitation.i)
- (modules/phase_field/examples/interfacekernels/interface_fluxbc.i)
- (modules/porous_flow/examples/groundwater/ex02_abstraction.i)
- (modules/optimization/test/tests/optimizationreporter/optimizationdata/two_vars_file.i)
- (modules/porous_flow/test/tests/poro_elasticity/mandel.i)
- (modules/combined/examples/mortar/mortar_gradient.i)
- (modules/geochemistry/test/tests/time_dependent_reactions/flushing_case1.i)
- (modules/solid_mechanics/test/tests/notched_plastic_block/biaxial_planar.i)
- (modules/porous_flow/examples/fluidflower/fluidflower.i)
- (test/tests/misc/check_error/aux_kernel_with_var.i)
- (modules/porous_flow/examples/thm_example/2D_c.i)
- (modules/porous_flow/test/tests/chemistry/precipitation_2phase.i)
- (modules/functional_expansion_tools/examples/3D_volumetric_cylindrical_subapp_mesh_refine/sub.i)
- (modules/geochemistry/test/tests/kernels/time_deriv_2.i)
- (modules/combined/test/tests/poro_mechanics/mandel.i)
- (test/tests/quadrature/qweights/positive_qweights.i)
- (test/tests/functions/piecewise_multilinear/twoD_const.i)
- (test/tests/transfers/multiapp_nearest_node_transfer/cached_multiple_apps/main.i)
- (modules/solid_mechanics/examples/wave_propagation/cantilever_sweep.i)
- (test/tests/transfers/multiapp_variable_value_sample_transfer/full_domain_primary.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/natural_convection/fuel_cavity.i)
- (modules/porous_flow/test/tests/chemistry/dissolution.i)
- (test/tests/outputs/png/wedge.i)
- (modules/porous_flow/examples/tutorial/11.i)
- (modules/functional_expansion_tools/examples/1D_volumetric_Cartesian/sub.i)
- (modules/optimization/test/tests/optimizationreporter/material/adjoint_explicit.i)
- (test/tests/interfacekernels/hybrid/interface.i)
- (modules/combined/test/tests/optimization/invOpt_bc_convective/adjoint.i)
- (modules/functional_expansion_tools/examples/3D_volumetric_Cartesian_direct/sub.i)
- (modules/geochemistry/test/tests/kinetics/bio_zoning_conc.i)
- (modules/combined/examples/publications/rapid_dev/fig3.i)
- (modules/fluid_properties/test/tests/water/water.i)
- (test/tests/transfers/multiapp_userobject_transfer/restricted_elem_parent.i)
- (test/tests/meshdivisions/block_division.i)
- (modules/combined/examples/geochem-porous_flow/geotes_2D/aquifer_geochemistry.i)
- (modules/geochemistry/test/tests/time_dependent_reactions/flushing_case2.i)
- (modules/optimization/test/tests/optimizationreporter/parameter_mesh_base/parameter_mesh_boundsIC.i)
- (modules/porous_flow/examples/reservoir_model/field_model.i)
- (test/tests/auxkernels/parsed_aux/xyzt.i)
- (test/tests/transfers/multiapp_userobject_transfer/restricted_node_parent.i)
- (test/tests/kernels/hfem/robin_displaced.i)
- (modules/porous_flow/test/tests/pressure_pulse/pressure_pulse_1d_MD.i)
- (modules/geochemistry/test/tests/kernels/dispersion_1.i)
- (modules/porous_flow/test/tests/chemistry/dissolution_limited_2phase.i)
- (modules/porous_flow/examples/multiapp_fracture_flow/3dFracture/fracture_only_aperture_changing.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/natural_convection/natural_circulation_pipe.i)
- (modules/functional_expansion_tools/examples/2D_volumetric_Cartesian/sub.i)
- (modules/combined/examples/optimization/thermomechanical/thermomechanical_main.i)
- (modules/porous_flow/test/tests/poro_elasticity/mandel_fully_saturated_volume.i)
- (modules/optimization/test/tests/userobjects/adjoint_solution/forward.i)
- (modules/combined/examples/optimization/multi-load/square_main.i)
- (test/tests/functormaterials/smoother/test.i)
- (modules/geochemistry/test/tests/kinetics/bio_zoning_flow.i)
- (test/tests/transfers/general_field/user_object/duplicated_user_object_tests/restricted_elem_sub.i)
- (modules/geochemistry/test/tests/kinetics/quartz_deposition.i)
- (test/tests/transfers/general_field/user_object/duplicated_user_object_tests/restricted_elem_parent.i)
- (modules/chemical_reactions/test/tests/thermochimica/MoRu_subblock.i)
(test/tests/outputs/png/wedge.i)
[Mesh]
file = wedge.e
uniform_refine = 1
[]
[Functions]
active = 'tr_x tr_y'
[./tr_x]
type = ParsedFunction
expression = -x
[../]
[./tr_y]
type = ParsedFunction
expression = y
[../]
[]
[AuxVariables]
[two_u]
[]
[]
[AuxKernels]
[two_u]
type = ParsedAux
variable = two_u
coupled_variables = 'u'
expression = '2*u'
[]
[]
[Variables]
active = 'u'
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
active = 'diff forcing dot'
[./diff]
type = Diffusion
variable = u
[../]
[./forcing]
type = GaussContForcing
variable = u
x_center = -0.5
y_center = 3.0
x_spread = 0.2
y_spread = 0.2
[../]
[./dot]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
#active = ' '
[./Periodic]
[./x]
primary = 1
secondary = 2
transform_func = 'tr_x tr_y'
inv_transform_func = 'tr_x tr_y'
[../]
[../]
[]
[Executioner]
type = Transient
dt = 0.5
num_steps = 6
solve_type = NEWTON
[]
[Outputs]
[png]
type = PNGOutput
resolution = 25
color = RWB
variable = 'two_u'
[]
[]
(modules/geochemistry/test/tests/kinetics/kinetic_albite.i)
# Example of kinetically-controlled dissolution of albite into an acidic solution
[TimeDependentReactionSolver]
model_definition = definition
geochemistry_reactor_name = reactor
charge_balance_species = "Cl-"
constraint_species = "H2O H+ Cl- Na+ SiO2(aq) Al+++"
constraint_value = " 1.0 -1.5 0.1 0.1 1E-6 1E-6"
constraint_meaning = "kg_solvent_water log10activity bulk_composition bulk_composition free_concentration free_concentration"
constraint_unit = " kg dimensionless moles moles molal molal"
initial_temperature = 70.0
temperature = 70.0
kinetic_species_name = Albite
kinetic_species_initial_value = 250
kinetic_species_unit = g
evaluate_kinetic_rates_always = true # implicit time-marching used for stability
ramp_max_ionic_strength_initial = 0 # max_ionic_strength in such a simple problem does not need ramping
stoichiometric_ionic_str_using_Cl_only = true # for comparison with GWB
execute_console_output_on = '' # only CSV output for this example
[]
[UserObjects]
[rate_albite]
type = GeochemistryKineticRate
kinetic_species_name = Albite
intrinsic_rate_constant = 5.4432E-8 # 6.3E-13mol/s/cm^2 = 5.4432E-8mol/day/cm^2
multiply_by_mass = true
area_quantity = 1000
promoting_species_names = "H+"
promoting_indices = "1.0"
[]
[definition]
type = GeochemicalModelDefinition
database_file = "../../../database/moose_geochemdb.json"
basis_species = "H2O H+ Cl- Na+ SiO2(aq) Al+++"
kinetic_minerals = "Albite"
kinetic_rate_descriptions = "rate_albite"
[]
[]
[Executioner]
type = Transient
dt = 5
end_time = 30 # measured in days
[]
[AuxVariables]
[mole_change_albite]
[]
[]
[AuxKernels]
[mole_change_albite]
type = ParsedAux
coupled_variables = moles_Albite
expression = 'moles_Albite - 0.953387'
variable = mole_change_albite
[]
[]
[Postprocessors]
[mole_change_Albite]
type = PointValue
point = '0 0 0'
variable = "mole_change_albite"
[]
[]
[Outputs]
csv = true
[]
(modules/thermal_hydraulics/test/tests/components/flow_component_ns/flow_component_ns_pinc.i)
# Operating conditions
u_inlet = 1
p_outlet = 0
[AuxVariables]
[porosity]
type = MooseVariableFVReal
initial_condition = 0.5
[]
[velocity_norm]
type = MooseVariableFVReal
[]
[]
[Components]
[comp1]
type = FlowComponentNS
file = rectangle.e
position = '0 0 0'
compressibility = 'incompressible'
porous_medium_treatment = true
density = 'rho'
dynamic_viscosity = 'mu'
initial_velocity = '${u_inlet} 0 0'
initial_pressure = '${p_outlet}'
mass_advection_interpolation = 'upwind'
momentum_advection_interpolation = 'upwind'
inlet_boundaries = 'comp1:left'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_function = '${u_inlet} 0'
wall_boundaries = 'comp1:top comp1:bottom'
momentum_wall_types = 'noslip symmetry'
outlet_boundaries = 'comp1:right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '${p_outlet}'
[]
[comp2]
type = FlowComponentNS
file = rectangle.e
position = '0 2 0'
compressibility = 'incompressible'
porous_medium_treatment = true
density = 'rho'
dynamic_viscosity = 'mu'
initial_velocity = '${u_inlet} 0 0'
initial_pressure = '${p_outlet}'
inlet_boundaries = 'comp2:left'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_function = '${u_inlet} 0'
wall_boundaries = 'comp2:top comp2:bottom'
momentum_wall_types = 'noslip symmetry'
outlet_boundaries = 'comp2:right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '${p_outlet}'
mass_advection_interpolation = 'average'
momentum_advection_interpolation = 'average'
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'rho mu'
prop_values = '1 1'
[]
[]
[AuxKernels]
[speed]
type = ParsedAux
variable = 'velocity_norm'
coupled_variables = 'superficial_vel_x superficial_vel_y porosity'
expression = 'sqrt(superficial_vel_x*superficial_vel_x + superficial_vel_y*superficial_vel_y) / porosity'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu NONZERO mumps'
line_search = 'none'
nl_rel_tol = 1e-12
automatic_scaling = true
off_diagonals_in_auto_scaling = true
verbose = true
scaling_group_variables = 'superficial_vel_x superficial_vel_y'
[]
[Debug]
show_var_residual_norms = true
[]
# Some basic Postprocessors to examine the solution
[Postprocessors]
[inlet-p]
type = SideAverageValue
variable = pressure
boundary = 'comp1:left'
[]
[outlet-u]
type = SideAverageValue
variable = superficial_vel_x
boundary = 'comp1:right'
[]
[]
[Outputs]
exodus = true
[]
(test/tests/transfers/general_field/user_object/duplicated_user_object_tests/restricted_node_parent.i)
num_layers = 2
[Mesh]
[box]
type = GeneratedMeshGenerator
dim = 3
nx = ${num_layers}
ny = 3
nz = 3
xmin = 0.25
xmax = 1.25
[]
[]
[Variables]
[u]
[]
[]
[Kernels]
[td]
type = TimeDerivative
variable = u
[]
[diff]
type = Diffusion
variable = u
[]
[]
[AuxVariables]
[a]
[]
[s]
[]
[]
[AuxKernels]
[s_ak]
type = ParsedAux
variable = s
use_xyzt = true
expression = 'x+(z*z)'
[]
[]
[Functions]
[]
[Postprocessors]
[a_avg]
type = ElementAverageValue
variable = a
[]
[]
[UserObjects]
[S_avg_front]
type = LayeredSideAverage
boundary = front
variable = s
num_layers = ${num_layers}
direction = x
[]
[S_avg_back]
type = LayeredSideAverage
boundary = back
variable = s
num_layers = ${num_layers}
direction = x
[]
[]
[MultiApps]
[ch0]
type = TransientMultiApp
input_files = 'restricted_node_sub.i'
bounding_box_padding = '0 0.5 1'
positions = '0 0.5 -0.1'
output_in_position = true
cli_args = 'yy=0'
[]
[ch1]
type = TransientMultiApp
input_files = 'restricted_node_sub.i'
bounding_box_padding = '0 0.5 1'
positions = '0 0.5 1.1'
output_in_position = true
cli_args = 'yy=1'
[]
[]
[Transfers]
[from_ch0]
type = MultiAppGeneralFieldUserObjectTransfer
to_boundaries = back
from_multi_app = ch0
variable = a
source_user_object = A_avg
fixed_bounding_box_size = '0 1 1.5'
from_app_must_contain_point = false
[]
[from_ch1]
type = MultiAppGeneralFieldUserObjectTransfer
to_boundaries = front
from_multi_app = ch1
variable = a
source_user_object = A_avg
fixed_bounding_box_size = '0 1 1.5'
from_app_must_contain_point = false
[]
[to_ch0]
type = MultiAppGeneralFieldUserObjectTransfer
to_blocks = 20
to_multi_app = ch0
variable = S
source_user_object = S_avg_back
fixed_bounding_box_size = '1.5 1 1.5'
from_app_must_contain_point = false
[]
[to_ch1]
type = MultiAppGeneralFieldUserObjectTransfer
to_blocks = 20
to_multi_app = ch1
variable = S
source_user_object = S_avg_front
fixed_bounding_box_size = '1.5 1 1.5'
from_app_must_contain_point = false
[]
[]
[Executioner]
type = Transient
num_steps = 2
dt = 1
nl_abs_tol = 1e-7
[]
[Outputs]
exodus = true
[]
(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
[]
(modules/functional_expansion_tools/test/tests/errors/multiapp_sub.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s]
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXVolumeUserObject
function = FX_Basis_Value_Sub
variable = s
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(test/tests/userobjects/nodal_patch_recovery/nodal_patch_recovery.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
[]
[]
[UserObjects]
[u_patch]
type = NodalPatchRecoveryMaterialProperty
patch_polynomial_order = FIRST
property = 'u'
execute_on = 'TIMESTEP_END'
[]
[]
[Variables]
[v]
order = FIRST
family = LAGRANGE
[]
[]
[Kernels]
[dt]
type = TimeDerivative
variable = v
[]
[diff]
type = Diffusion
variable = v
[]
[]
[AuxVariables]
[u_recovered]
[]
[u_nodal]
[]
[u_diff]
[]
[]
[AuxKernels]
[u_recovered]
type = NodalPatchRecoveryAux
variable = u_recovered
nodal_patch_recovery_uo = u_patch
execute_on = 'TIMESTEP_END'
[]
[u_nodal]
type = ParsedAux
variable = u_nodal
expression = v^2
coupled_variables = v
[]
[u_diff]
type = ParsedAux
variable = u_diff
expression = u_nodal-u_recovered
coupled_variables = 'u_nodal u_recovered'
[]
[]
[BCs]
[fix_left]
type = FunctionDirichletBC
variable = v
boundary = 'left'
function = y+1
[]
[fix_right]
type = DirichletBC
variable = v
boundary = 'right'
value = 0
[]
[]
[Materials]
[u]
type = ParsedMaterial
expression = v^2
property_name = u
coupled_variables = v
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
automatic_scaling = true
dt = 0.4
num_steps = 5
nl_abs_tol = 1e-10
nl_rel_tol = 1e-10
[]
[Outputs]
exodus = true
print_linear_residuals = false
[]
(modules/combined/examples/geochem-porous_flow/geotes_weber_tensleep/aquifer_geochemistry.i)
#########################################
# #
# File written by create_input_files.py #
# #
#########################################
# Simulates geochemistry in the aquifer. This input file may be run in standalone fashion but it does not do anything of interest. To simulate something interesting, run the porous_flow.i simulation which couples to this input file using MultiApps.
# This file receives 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 and temperature as AuxVariables from porous_flow.i
# The pf_rate quantities are kg/s changes of fluid-component mass at each node, but the geochemistry module expects rates-of-changes of moles at every node. Secondly, since this input file considers just 1 litre of aqueous solution at every node, the nodal_void_volume is used to convert pf_rate_* into rate_*_per_1l, which is measured in mol/s/1_litre_of_aqueous_solution.
# This file sends 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 to porous_flow.i. These are computed from the corresponding transported_* quantities.
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = '../../../../geochemistry/database/moose_geochemdb.json'
basis_species = 'H2O H+ Cl- SO4-- HCO3- SiO2(aq) Al+++ Ca++ Mg++ Fe++ K+ Na+ Sr++ F- B(OH)3 Br- Ba++ Li+ NO3- O2(aq)'
equilibrium_minerals = 'Siderite Pyrrhotite Dolomite Illite Anhydrite Calcite Quartz K-feldspar Kaolinite Barite Celestite Fluorite Albite Chalcedony Goethite'
[]
[nodal_void_volume_uo]
type = NodalVoidVolume
porosity = porosity
execute_on = 'initial timestep_end' # initial means this is evaluated properly for the first timestep
[]
[]
[SpatialReactionSolver]
model_definition = definition
geochemistry_reactor_name = reactor
charge_balance_species = 'Cl-'
swap_out_of_basis = 'NO3- H+ Fe++ Ba++ SiO2(aq) Mg++ O2(aq) Al+++ K+ Ca++ HCO3-'
swap_into_basis = ' NH3 Pyrrhotite K-feldspar Barite Quartz Dolomite Siderite Calcite Illite Anhydrite Kaolinite'
# ASSUME that 1 litre of solution contains:
constraint_species = 'H2O Quartz Calcite K-feldspar Siderite Dolomite Anhydrite Pyrrhotite Illite Kaolinite Barite Na+ Cl- SO4-- Li+ B(OH)3 Br- F- Sr++ NH3'
constraint_value = ' 0.99778351 322.177447 12.111108 6.8269499 6.2844304 2.8670301 1.1912027 0.51474767 0.3732507 0.20903322 0.0001865889 1.5876606 1.5059455 0.046792579 0.013110503 0.006663119 0.001238987 0.00032108 0.000159781 0.001937302'
constraint_meaning = 'kg_solvent_water bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition'
constraint_unit = "kg moles moles moles moles moles moles moles moles moles moles moles moles moles moles moles moles moles moles moles"
prevent_precipitation = 'Fluorite Albite Goethite'
initial_temperature = 92
temperature = temperature
source_species_names = 'H+ Cl- SO4-- HCO3- SiO2(aq) Al+++ Ca++ Mg++ Fe++ K+ Na+ Sr++ F- B(OH)3 Br- Ba++ Li+ NO3- O2(aq) H2O'
source_species_rates = ' rate_H_per_1l rate_Cl_per_1l rate_SO4_per_1l rate_HCO3_per_1l rate_SiO2aq_per_1l rate_Al_per_1l rate_Ca_per_1l rate_Mg_per_1l rate_Fe_per_1l rate_K_per_1l rate_Na_per_1l rate_Sr_per_1l rate_F_per_1l rate_BOH_per_1l rate_Br_per_1l rate_Ba_per_1l rate_Li_per_1l rate_NO3_per_1l rate_O2aq_per_1l rate_H2O_per_1l'
ramp_max_ionic_strength_initial = 0 # max_ionic_strength in such a simple problem does not need ramping
execute_console_output_on = '' # only CSV and exodus output for this simulation
add_aux_molal = false # save some memory and reduce variables in output exodus
add_aux_mg_per_kg = false # save some memory and reduce variables in output exodus
add_aux_free_mg = false # save some memory and reduce variables in output exodus
add_aux_activity = false # save some memory and reduce variables in output exodus
add_aux_bulk_moles = false # save some memory and reduce variables in output exodus
adaptive_timestepping = true
[]
[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]
point = '-25 0 0'
reactor = reactor
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 7.76E6 # 90 days
[TimeStepper]
type = FunctionDT
function = 'min(3E4, max(1E4, 0.2 * t))'
[]
[]
[AuxVariables]
[temperature]
initial_condition = 92.0
[]
[porosity]
initial_condition = 0.1
[]
[nodal_void_volume]
[]
[free_cm3_Kfeldspar] # necessary because of the minus sign in K-feldspar which does not parse correctly in the porosity AuxKernel
[]
[pf_rate_H] # change in H mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Cl] # change in Cl mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_SO4] # change in SO4 mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_HCO3] # change in HCO3 mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_SiO2aq] # change in SiO2aq mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Al] # change in Al mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Ca] # change in Ca mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Mg] # change in Mg mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Fe] # change in Fe mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_K] # change in K mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Na] # change in Na mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Sr] # change in Sr mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_F] # change in F mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_BOH] # change in BOH mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Br] # change in Br mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Ba] # change in Ba mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Li] # change in Li mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_NO3] # change in NO3 mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_O2aq] # change in O2aq mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_H2O] # change in H2O mass (kg/s) at each node provided by the porous-flow simulation
[]
[rate_H_per_1l]
[]
[rate_Cl_per_1l]
[]
[rate_SO4_per_1l]
[]
[rate_HCO3_per_1l]
[]
[rate_SiO2aq_per_1l]
[]
[rate_Al_per_1l]
[]
[rate_Ca_per_1l]
[]
[rate_Mg_per_1l]
[]
[rate_Fe_per_1l]
[]
[rate_K_per_1l]
[]
[rate_Na_per_1l]
[]
[rate_Sr_per_1l]
[]
[rate_F_per_1l]
[]
[rate_BOH_per_1l]
[]
[rate_Br_per_1l]
[]
[rate_Ba_per_1l]
[]
[rate_Li_per_1l]
[]
[rate_NO3_per_1l]
[]
[rate_O2aq_per_1l]
[]
[rate_H2O_per_1l]
[]
[transported_H]
[]
[transported_Cl]
[]
[transported_SO4]
[]
[transported_HCO3]
[]
[transported_SiO2aq]
[]
[transported_Al]
[]
[transported_Ca]
[]
[transported_Mg]
[]
[transported_Fe]
[]
[transported_K]
[]
[transported_Na]
[]
[transported_Sr]
[]
[transported_F]
[]
[transported_BOH]
[]
[transported_Br]
[]
[transported_Ba]
[]
[transported_Li]
[]
[transported_NO3]
[]
[transported_O2aq]
[]
[transported_H2O]
[]
[transported_mass]
[]
[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]
[]
[massfrac_H2O]
[]
[]
[AuxKernels]
[free_cm3_Kfeldspar]
type = GeochemistryQuantityAux
variable = free_cm3_Kfeldspar
species = 'K-feldspar'
quantity = free_cm3
execute_on = 'timestep_end'
[]
[porosity_auxk]
type = ParsedAux
coupled_variables = 'free_cm3_Siderite free_cm3_Pyrrhotite free_cm3_Dolomite free_cm3_Illite free_cm3_Anhydrite free_cm3_Calcite free_cm3_Quartz free_cm3_Kfeldspar free_cm3_Kaolinite free_cm3_Barite free_cm3_Celestite free_cm3_Fluorite free_cm3_Albite free_cm3_Chalcedony free_cm3_Goethite'
expression = '1000.0 / (1000.0 + free_cm3_Siderite + free_cm3_Pyrrhotite + free_cm3_Dolomite + free_cm3_Illite + free_cm3_Anhydrite + free_cm3_Calcite + free_cm3_Quartz + free_cm3_Kfeldspar + free_cm3_Kaolinite + free_cm3_Barite + free_cm3_Celestite + free_cm3_Fluorite + free_cm3_Albite + free_cm3_Chalcedony + free_cm3_Goethite)'
variable = porosity
execute_on = 'timestep_end'
[]
[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_H_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_H nodal_void_volume'
variable = rate_H_per_1l
expression = 'pf_rate_H / 1.0079 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_Cl_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Cl nodal_void_volume'
variable = rate_Cl_per_1l
expression = 'pf_rate_Cl / 35.453 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_SO4_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_SO4 nodal_void_volume'
variable = rate_SO4_per_1l
expression = 'pf_rate_SO4 / 96.0576 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_HCO3_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_HCO3 nodal_void_volume'
variable = rate_HCO3_per_1l
expression = 'pf_rate_HCO3 / 61.0171 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_SiO2aq_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_SiO2aq nodal_void_volume'
variable = rate_SiO2aq_per_1l
expression = 'pf_rate_SiO2aq / 60.0843 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_Al_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Al nodal_void_volume'
variable = rate_Al_per_1l
expression = 'pf_rate_Al / 26.9815 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_Ca_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Ca nodal_void_volume'
variable = rate_Ca_per_1l
expression = 'pf_rate_Ca / 40.08 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_Mg_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Mg nodal_void_volume'
variable = rate_Mg_per_1l
expression = 'pf_rate_Mg / 24.305 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_Fe_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Fe nodal_void_volume'
variable = rate_Fe_per_1l
expression = 'pf_rate_Fe / 55.847 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_K_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_K nodal_void_volume'
variable = rate_K_per_1l
expression = 'pf_rate_K / 39.0983 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_Na_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Na nodal_void_volume'
variable = rate_Na_per_1l
expression = 'pf_rate_Na / 22.9898 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_Sr_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Sr nodal_void_volume'
variable = rate_Sr_per_1l
expression = 'pf_rate_Sr / 87.62 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_F_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_F nodal_void_volume'
variable = rate_F_per_1l
expression = 'pf_rate_F / 18.9984 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_BOH_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_BOH nodal_void_volume'
variable = rate_BOH_per_1l
expression = 'pf_rate_BOH / 61.8329 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_Br_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Br nodal_void_volume'
variable = rate_Br_per_1l
expression = 'pf_rate_Br / 79.904 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_Ba_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Ba nodal_void_volume'
variable = rate_Ba_per_1l
expression = 'pf_rate_Ba / 137.33 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_Li_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Li nodal_void_volume'
variable = rate_Li_per_1l
expression = 'pf_rate_Li / 6.941 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_NO3_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_NO3 nodal_void_volume'
variable = rate_NO3_per_1l
expression = 'pf_rate_NO3 / 62.0049 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_O2aq_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_O2aq nodal_void_volume'
variable = rate_O2aq_per_1l
expression = 'pf_rate_O2aq / 31.9988 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[rate_H2O_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_H2O nodal_void_volume'
variable = rate_H2O_per_1l
expression = 'pf_rate_H2O / 18.01801802 / nodal_void_volume'
execute_on = 'timestep_end'
[]
[transported_H_auxk]
type = GeochemistryQuantityAux
variable = transported_H
species = 'H+'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Cl_auxk]
type = GeochemistryQuantityAux
variable = transported_Cl
species = 'Cl-'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_SO4_auxk]
type = GeochemistryQuantityAux
variable = transported_SO4
species = 'SO4--'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_HCO3_auxk]
type = GeochemistryQuantityAux
variable = transported_HCO3
species = 'HCO3-'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_SiO2aq_auxk]
type = GeochemistryQuantityAux
variable = transported_SiO2aq
species = 'SiO2(aq)'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Al_auxk]
type = GeochemistryQuantityAux
variable = transported_Al
species = 'Al+++'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Ca_auxk]
type = GeochemistryQuantityAux
variable = transported_Ca
species = 'Ca++'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Mg_auxk]
type = GeochemistryQuantityAux
variable = transported_Mg
species = 'Mg++'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Fe_auxk]
type = GeochemistryQuantityAux
variable = transported_Fe
species = 'Fe++'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_K_auxk]
type = GeochemistryQuantityAux
variable = transported_K
species = 'K+'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Na_auxk]
type = GeochemistryQuantityAux
variable = transported_Na
species = 'Na+'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Sr_auxk]
type = GeochemistryQuantityAux
variable = transported_Sr
species = 'Sr++'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_F_auxk]
type = GeochemistryQuantityAux
variable = transported_F
species = 'F-'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_BOH_auxk]
type = GeochemistryQuantityAux
variable = transported_BOH
species = 'B(OH)3'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Br_auxk]
type = GeochemistryQuantityAux
variable = transported_Br
species = 'Br-'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Ba_auxk]
type = GeochemistryQuantityAux
variable = transported_Ba
species = 'Ba++'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Li_auxk]
type = GeochemistryQuantityAux
variable = transported_Li
species = 'Li+'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_NO3_auxk]
type = GeochemistryQuantityAux
variable = transported_NO3
species = 'NO3-'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_O2aq_auxk]
type = GeochemistryQuantityAux
variable = transported_O2aq
species = 'O2(aq)'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_H2O_auxk]
type = GeochemistryQuantityAux
variable = transported_H2O
species = 'H2O'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_mass_auxk]
type = ParsedAux
coupled_variables = ' transported_H transported_Cl transported_SO4 transported_HCO3 transported_SiO2aq transported_Al transported_Ca transported_Mg transported_Fe transported_K transported_Na transported_Sr transported_F transported_BOH transported_Br transported_Ba transported_Li transported_NO3 transported_O2aq transported_H2O'
variable = transported_mass
expression = 'transported_H * 1.0079 + transported_Cl * 35.453 + transported_SO4 * 96.0576 + transported_HCO3 * 61.0171 + transported_SiO2aq * 60.0843 + transported_Al * 26.9815 + transported_Ca * 40.08 + transported_Mg * 24.305 + transported_Fe * 55.847 + transported_K * 39.0983 + transported_Na * 22.9898 + transported_Sr * 87.62 + transported_F * 18.9984 + transported_BOH * 61.8329 + transported_Br * 79.904 + transported_Ba * 137.33 + transported_Li * 6.941 + transported_NO3 * 62.0049 + transported_O2aq * 31.9988 + transported_H2O * 18.01801802'
execute_on = 'timestep_end'
[]
[massfrac_H_auxk]
type = ParsedAux
coupled_variables = 'transported_H transported_mass'
variable = massfrac_H
expression = 'transported_H * 1.0079 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Cl_auxk]
type = ParsedAux
coupled_variables = 'transported_Cl transported_mass'
variable = massfrac_Cl
expression = 'transported_Cl * 35.453 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_SO4_auxk]
type = ParsedAux
coupled_variables = 'transported_SO4 transported_mass'
variable = massfrac_SO4
expression = 'transported_SO4 * 96.0576 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_HCO3_auxk]
type = ParsedAux
coupled_variables = 'transported_HCO3 transported_mass'
variable = massfrac_HCO3
expression = 'transported_HCO3 * 61.0171 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_SiO2aq_auxk]
type = ParsedAux
coupled_variables = 'transported_SiO2aq transported_mass'
variable = massfrac_SiO2aq
expression = 'transported_SiO2aq * 60.0843 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Al_auxk]
type = ParsedAux
coupled_variables = 'transported_Al transported_mass'
variable = massfrac_Al
expression = 'transported_Al * 26.9815 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Ca_auxk]
type = ParsedAux
coupled_variables = 'transported_Ca transported_mass'
variable = massfrac_Ca
expression = 'transported_Ca * 40.08 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Mg_auxk]
type = ParsedAux
coupled_variables = 'transported_Mg transported_mass'
variable = massfrac_Mg
expression = 'transported_Mg * 24.305 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Fe_auxk]
type = ParsedAux
coupled_variables = 'transported_Fe transported_mass'
variable = massfrac_Fe
expression = 'transported_Fe * 55.847 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_K_auxk]
type = ParsedAux
coupled_variables = 'transported_K transported_mass'
variable = massfrac_K
expression = 'transported_K * 39.0983 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Na_auxk]
type = ParsedAux
coupled_variables = 'transported_Na transported_mass'
variable = massfrac_Na
expression = 'transported_Na * 22.9898 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Sr_auxk]
type = ParsedAux
coupled_variables = 'transported_Sr transported_mass'
variable = massfrac_Sr
expression = 'transported_Sr * 87.62 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_F_auxk]
type = ParsedAux
coupled_variables = 'transported_F transported_mass'
variable = massfrac_F
expression = 'transported_F * 18.9984 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_BOH_auxk]
type = ParsedAux
coupled_variables = 'transported_BOH transported_mass'
variable = massfrac_BOH
expression = 'transported_BOH * 61.8329 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Br_auxk]
type = ParsedAux
coupled_variables = 'transported_Br transported_mass'
variable = massfrac_Br
expression = 'transported_Br * 79.904 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Ba_auxk]
type = ParsedAux
coupled_variables = 'transported_Ba transported_mass'
variable = massfrac_Ba
expression = 'transported_Ba * 137.33 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Li_auxk]
type = ParsedAux
coupled_variables = 'transported_Li transported_mass'
variable = massfrac_Li
expression = 'transported_Li * 6.941 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_NO3_auxk]
type = ParsedAux
coupled_variables = 'transported_NO3 transported_mass'
variable = massfrac_NO3
expression = 'transported_NO3 * 62.0049 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_O2aq_auxk]
type = ParsedAux
coupled_variables = 'transported_O2aq transported_mass'
variable = massfrac_O2aq
expression = 'transported_O2aq * 31.9988 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_H2O_auxk]
type = ParsedAux
coupled_variables = 'transported_H2O transported_mass'
variable = massfrac_H2O
expression = 'transported_H2O * 18.01801802 / transported_mass'
execute_on = 'timestep_end'
[]
[]
[Postprocessors]
[memory]
type = MemoryUsage
outputs = 'console'
[]
[porosity]
type = PointValue
variable = porosity
[]
[solution_temperature]
type = PointValue
variable = solution_temperature
[]
[massfrac_H]
type = PointValue
variable = massfrac_H
[]
[massfrac_Cl]
type = PointValue
variable = massfrac_Cl
[]
[massfrac_SO4]
type = PointValue
variable = massfrac_SO4
[]
[massfrac_HCO3]
type = PointValue
variable = massfrac_HCO3
[]
[massfrac_SiO2aq]
type = PointValue
variable = massfrac_SiO2aq
[]
[massfrac_Al]
type = PointValue
variable = massfrac_Al
[]
[massfrac_Ca]
type = PointValue
variable = massfrac_Ca
[]
[massfrac_Mg]
type = PointValue
variable = massfrac_Mg
[]
[massfrac_Fe]
type = PointValue
variable = massfrac_Fe
[]
[massfrac_K]
type = PointValue
variable = massfrac_K
[]
[massfrac_Na]
type = PointValue
variable = massfrac_Na
[]
[massfrac_Sr]
type = PointValue
variable = massfrac_Sr
[]
[massfrac_F]
type = PointValue
variable = massfrac_F
[]
[massfrac_BOH]
type = PointValue
variable = massfrac_BOH
[]
[massfrac_Br]
type = PointValue
variable = massfrac_Br
[]
[massfrac_Ba]
type = PointValue
variable = massfrac_Ba
[]
[massfrac_Li]
type = PointValue
variable = massfrac_Li
[]
[massfrac_NO3]
type = PointValue
variable = massfrac_NO3
[]
[massfrac_O2aq]
type = PointValue
variable = massfrac_O2aq
[]
[massfrac_H2O]
type = PointValue
variable = massfrac_H2O
[]
[free_cm3_Siderite]
type = PointValue
variable = free_cm3_Siderite
[]
[free_cm3_Pyrrhotite]
type = PointValue
variable = free_cm3_Pyrrhotite
[]
[free_cm3_Dolomite]
type = PointValue
variable = free_cm3_Dolomite
[]
[free_cm3_Illite]
type = PointValue
variable = free_cm3_Illite
[]
[free_cm3_Anhydrite]
type = PointValue
variable = free_cm3_Anhydrite
[]
[free_cm3_Calcite]
type = PointValue
variable = free_cm3_Calcite
[]
[free_cm3_Quartz]
type = PointValue
variable = free_cm3_Quartz
[]
[free_cm3_K-feldspar]
type = PointValue
variable = free_cm3_K-feldspar
[]
[free_cm3_Kaolinite]
type = PointValue
variable = free_cm3_Kaolinite
[]
[free_cm3_Barite]
type = PointValue
variable = free_cm3_Barite
[]
[free_cm3_Celestite]
type = PointValue
variable = free_cm3_Celestite
[]
[free_cm3_Fluorite]
type = PointValue
variable = free_cm3_Fluorite
[]
[free_cm3_Albite]
type = PointValue
variable = free_cm3_Albite
[]
[free_cm3_Chalcedony]
type = PointValue
variable = free_cm3_Chalcedony
[]
[free_cm3_Goethite]
type = PointValue
variable = free_cm3_Goethite
[]
[]
[Outputs]
exodus = true
csv = true
[]
(test/tests/transfers/multiapp_userobject_transfer/restricted_elem_sub.i)
# yy is passed in from the parent app
[Mesh]
[line]
type = GeneratedMeshGenerator
dim = 1
nx = 4
xmax = 2
[]
[box]
type = SubdomainBoundingBoxGenerator
input = line
bottom_left = '0 -0.1 -0.1'
top_right = '1 0.1 0.1'
# need a different block ID than what is in the parent app to make sure the transfer works properly
block_id = 20
[]
[]
[AuxVariables]
[A]
family = MONOMIAL
order = CONSTANT
[]
[S]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[A_ak]
type = ParsedAux
variable = A
use_xyzt = true
expression = '2*x+4*${yy}'
execute_on = 'TIMESTEP_BEGIN'
[]
[]
[Variables]
[u]
[]
[]
[Kernels]
[td]
type = TimeDerivative
variable = u
[]
[diff]
type = Diffusion
variable = u
[]
[]
[UserObjects]
[A_avg]
type = LayeredAverage
block = 20
num_layers = 2
direction = x
variable = A
execute_on = TIMESTEP_END
[]
[]
[Executioner]
type = Transient
[]
[Outputs]
exodus = true
[]
(modules/combined/examples/phase_field-mechanics/kks_mechanics_VTS.i)
# KKS phase-field model coupled with elasticity using the Voigt-Taylor scheme as
# described in L.K. Aagesen et al., Computational Materials Science, 140, 10-21 (2017)
# Original run #170329e
[Mesh]
type = GeneratedMesh
dim = 3
nx = 640
ny = 1
nz = 1
xmin = -10
xmax = 10
ymin = 0
ymax = 0.03125
zmin = 0
zmax = 0.03125
elem_type = HEX8
[]
[Variables]
# order parameter
[./eta]
order = FIRST
family = LAGRANGE
[../]
# solute concentration
[./c]
order = FIRST
family = LAGRANGE
[../]
# chemical potential
[./w]
order = FIRST
family = LAGRANGE
[../]
# solute phase concentration (matrix)
[./cm]
order = FIRST
family = LAGRANGE
[../]
# solute phase concentration (precipitate)
[./cp]
order = FIRST
family = LAGRANGE
[../]
[./disp_x]
order = FIRST
family = LAGRANGE
[../]
[./disp_y]
order = FIRST
family = LAGRANGE
[../]
[./disp_z]
order = FIRST
family = LAGRANGE
[../]
[]
[ICs]
[./eta_ic]
variable = eta
type = FunctionIC
function = ic_func_eta
block = 0
[../]
[./c_ic]
variable = c
type = FunctionIC
function = ic_func_c
block = 0
[../]
[./w_ic]
variable = w
type = ConstantIC
value = 0.00991
block = 0
[../]
[./cm_ic]
variable = cm
type = ConstantIC
value = 0.131
block = 0
[../]
[./cp_ic]
variable = cp
type = ConstantIC
value = 0.236
block = 0
[../]
[]
[Functions]
[./ic_func_eta]
type = ParsedFunction
expression = '0.5*(1.0+tanh((x)/delta_eta/sqrt(2.0)))'
symbol_names = 'delta_eta'
symbol_values = '0.8034'
[../]
[./ic_func_c]
type = ParsedFunction
expression = '0.2388*(0.5*(1.0+tanh(x/delta/sqrt(2.0))))^3*(6*(0.5*(1.0+tanh(x/delta/sqrt(2.0))))^2-15*(0.5*(1.0+tanh(x/delta/sqrt(2.0))))+10)+0.1338*(1-(0.5*(1.0+tanh(x/delta/sqrt(2.0))))^3*(6*(0.5*(1.0+tanh(x/delta/sqrt(2.0))))^2-15*(0.5*(1.0+tanh(x/delta/sqrt(2.0))))+10))'
symbol_names = 'delta'
symbol_values = '0.8034'
[../]
[./psi_eq_int]
type = ParsedFunction
expression = 'volume*psi_alpha'
symbol_names = 'volume psi_alpha'
symbol_values = 'volume psi_alpha'
[../]
[./gamma]
type = ParsedFunction
expression = '(psi_int - psi_eq_int) / dy / dz'
symbol_names = 'psi_int psi_eq_int dy dz'
symbol_values = 'psi_int psi_eq_int 0.03125 0.03125'
[../]
[]
[AuxVariables]
[./sigma11]
order = CONSTANT
family = MONOMIAL
[../]
[./sigma22]
order = CONSTANT
family = MONOMIAL
[../]
[./sigma33]
order = CONSTANT
family = MONOMIAL
[../]
[./e11]
order = CONSTANT
family = MONOMIAL
[../]
[./e12]
order = CONSTANT
family = MONOMIAL
[../]
[./e22]
order = CONSTANT
family = MONOMIAL
[../]
[./e33]
order = CONSTANT
family = MONOMIAL
[../]
[./e_el11]
order = CONSTANT
family = MONOMIAL
[../]
[./e_el12]
order = CONSTANT
family = MONOMIAL
[../]
[./e_el22]
order = CONSTANT
family = MONOMIAL
[../]
[./f_el]
order = CONSTANT
family = MONOMIAL
[../]
[./eigen_strain00]
order = CONSTANT
family = MONOMIAL
[../]
[./Fglobal]
order = CONSTANT
family = MONOMIAL
[../]
[./psi]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./matl_sigma11]
type = RankTwoAux
rank_two_tensor = stress
index_i = 0
index_j = 0
variable = sigma11
[../]
[./matl_sigma22]
type = RankTwoAux
rank_two_tensor = stress
index_i = 1
index_j = 1
variable = sigma22
[../]
[./matl_sigma33]
type = RankTwoAux
rank_two_tensor = stress
index_i = 2
index_j = 2
variable = sigma33
[../]
[./matl_e11]
type = RankTwoAux
rank_two_tensor = total_strain
index_i = 0
index_j = 0
variable = e11
[../]
[./matl_e12]
type = RankTwoAux
rank_two_tensor = total_strain
index_i = 0
index_j = 1
variable = e12
[../]
[./matl_e22]
type = RankTwoAux
rank_two_tensor = total_strain
index_i = 1
index_j = 1
variable = e22
[../]
[./matl_e33]
type = RankTwoAux
rank_two_tensor = total_strain
index_i = 2
index_j = 2
variable = e33
[../]
[./f_el]
type = MaterialRealAux
variable = f_el
property = f_el_mat
execute_on = timestep_end
[../]
[./GlobalFreeEnergy]
variable = Fglobal
type = KKSGlobalFreeEnergy
fa_name = fm
fb_name = fp
w = 0.0264
kappa_names = kappa
interfacial_vars = eta
[../]
[./psi_potential]
variable = psi
type = ParsedAux
coupled_variables = 'Fglobal w c f_el sigma11 e11'
expression = 'Fglobal - w*c + f_el - sigma11*e11'
[../]
[]
[BCs]
[./left_x]
type = DirichletBC
variable = disp_x
boundary = left
value = 0
[../]
[./right_x]
type = DirichletBC
variable = disp_x
boundary = right
value = 0
[../]
[./front_y]
type = DirichletBC
variable = disp_y
boundary = front
value = 0
[../]
[./back_y]
type = DirichletBC
variable = disp_y
boundary = back
value = 0
[../]
[./top_z]
type = DirichletBC
variable = disp_z
boundary = top
value = 0
[../]
[./bottom_z]
type = DirichletBC
variable = disp_z
boundary = bottom
value = 0
[../]
[]
[Materials]
# Chemical free energy of the matrix
[./fm]
type = DerivativeParsedMaterial
property_name = fm
coupled_variables = 'cm'
expression = '6.55*(cm-0.13)^2'
[../]
# Elastic energy of the matrix
[./elastic_free_energy_m]
type = ElasticEnergyMaterial
base_name = matrix
f_name = fe_m
args = ' '
outputs = exodus
[../]
# Total free energy of the matrix
[./Total_energy_matrix]
type = DerivativeSumMaterial
property_name = f_total_matrix
sum_materials = 'fm fe_m'
coupled_variables = 'cm'
[../]
# Free energy of the precipitate phase
[./fp]
type = DerivativeParsedMaterial
property_name = fp
coupled_variables = 'cp'
expression = '6.55*(cp-0.235)^2'
[../]
# Elastic energy of the precipitate
[./elastic_free_energy_p]
type = ElasticEnergyMaterial
base_name = ppt
f_name = fe_p
args = ' '
outputs = exodus
[../]
# Total free energy of the precipitate
[./Total_energy_ppt]
type = DerivativeSumMaterial
property_name = f_total_ppt
sum_materials = 'fp fe_p'
coupled_variables = 'cp'
[../]
# Total elastic energy
[./Total_elastic_energy]
type = DerivativeTwoPhaseMaterial
eta = eta
f_name = f_el_mat
fa_name = fe_m
fb_name = fe_p
outputs = exodus
W = 0
[../]
# h(eta)
[./h_eta]
type = SwitchingFunctionMaterial
h_order = HIGH
eta = eta
[../]
# g(eta)
[./g_eta]
type = BarrierFunctionMaterial
g_order = SIMPLE
eta = eta
[../]
# constant properties
[./constants]
type = GenericConstantMaterial
prop_names = 'M L kappa misfit'
prop_values = '0.7 0.7 0.01704 0.00377'
[../]
#Mechanical properties
[./Stiffness_matrix]
type = ComputeElasticityTensor
C_ijkl = '103.3 74.25 74.25 103.3 74.25 103.3 46.75 46.75 46.75'
base_name = matrix
fill_method = symmetric9
[../]
[./Stiffness_ppt]
type = ComputeElasticityTensor
C_ijkl = '100.7 71.45 71.45 100.7 71.45 100.7 50.10 50.10 50.10'
base_name = ppt
fill_method = symmetric9
[../]
[./stress_matrix]
type = ComputeLinearElasticStress
base_name = matrix
[../]
[./stress_ppt]
type = ComputeLinearElasticStress
base_name = ppt
[../]
[./strain_matrix]
type = ComputeSmallStrain
displacements = 'disp_x disp_y disp_z'
base_name = matrix
[../]
[./strain_ppt]
type = ComputeSmallStrain
displacements = 'disp_x disp_y disp_z'
base_name = ppt
eigenstrain_names = 'eigenstrain_ppt'
[../]
[./eigen_strain]
type = ComputeEigenstrain
base_name = ppt
eigen_base = '1 1 1 0 0 0'
prefactor = misfit
eigenstrain_name = 'eigenstrain_ppt'
[../]
[./global_stress]
type = TwoPhaseStressMaterial
base_A = matrix
base_B = ppt
[../]
[./global_strain]
type = ComputeSmallStrain
displacements = 'disp_x disp_y disp_z'
[../]
[]
[Kernels]
[./TensorMechanics]
displacements = 'disp_x disp_y disp_z'
[../]
# enforce c = (1-h(eta))*cm + h(eta)*cp
[./PhaseConc]
type = KKSPhaseConcentration
ca = cm
variable = cp
c = c
eta = eta
[../]
# enforce pointwise equality of chemical potentials
[./ChemPotVacancies]
type = KKSPhaseChemicalPotential
variable = cm
cb = cp
fa_name = f_total_matrix
fb_name = f_total_ppt
[../]
#
# Cahn-Hilliard Equation
#
[./CHBulk]
type = KKSSplitCHCRes
variable = c
ca = cm
fa_name = f_total_matrix
w = w
[../]
[./dcdt]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[./ckernel]
type = SplitCHWRes
mob_name = M
variable = w
[../]
#
# Allen-Cahn Equation
#
[./ACBulkF]
type = KKSACBulkF
variable = eta
fa_name = f_total_matrix
fb_name = f_total_ppt
w = 0.0264
args = 'cp cm'
[../]
[./ACBulkC]
type = KKSACBulkC
variable = eta
ca = cm
cb = cp
fa_name = f_total_matrix
[../]
[./ACInterface]
type = ACInterface
variable = eta
kappa_name = kappa
[../]
[./detadt]
type = TimeDerivative
variable = eta
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'asm ilu nonzero'
l_max_its = 30
nl_max_its = 10
l_tol = 1.0e-4
nl_rel_tol = 1.0e-8
nl_abs_tol = 1.0e-11
num_steps = 200
[./TimeStepper]
type = SolutionTimeAdaptiveDT
dt = 0.5
[../]
[]
[VectorPostprocessors]
#[./eta]
# type = LineValueSampler
# start_point = '-10 0 0'
# end_point = '10 0 0'
# variable = eta
# num_points = 321
# sort_by = id
#[../]
#[./eta_position]
# type = FindValueOnLineSample
# vectorpostprocessor = eta
# variable_name = eta
# search_value = 0.5
#[../]
# [./f_el]
# type = LineMaterialRealSampler
# start = '-20 0 0'
# end = '20 0 0'
# sort_by = id
# property = f_el
# [../]
# [./f_el_a]
# type = LineMaterialRealSampler
# start = '-20 0 0'
# end = '20 0 0'
# sort_by = id
# property = fe_m
# [../]
# [./f_el_b]
# type = LineMaterialRealSampler
# start = '-20 0 0'
# end = '20 0 0'
# sort_by = id
# property = fe_p
# [../]
# [./h_out]
# type = LineMaterialRealSampler
# start = '-20 0 0'
# end = '20 0 0'
# sort_by = id
# property = h
# [../]
# [./fm_out]
# type = LineMaterialRealSampler
# start = '-20 0 0'
# end = '20 0 0'
# sort_by = id
# property = fm
# [../]
[]
[Postprocessors]
[./f_el_int]
type = ElementIntegralMaterialProperty
mat_prop = f_el_mat
[../]
[./c_alpha]
type = SideAverageValue
boundary = left
variable = c
[../]
[./c_beta]
type = SideAverageValue
boundary = right
variable = c
[../]
[./e11_alpha]
type = SideAverageValue
boundary = left
variable = e11
[../]
[./e11_beta]
type = SideAverageValue
boundary = right
variable = e11
[../]
[./s11_alpha]
type = SideAverageValue
boundary = left
variable = sigma11
[../]
[./s22_alpha]
type = SideAverageValue
boundary = left
variable = sigma22
[../]
[./s33_alpha]
type = SideAverageValue
boundary = left
variable = sigma33
[../]
[./s11_beta]
type = SideAverageValue
boundary = right
variable = sigma11
[../]
[./s22_beta]
type = SideAverageValue
boundary = right
variable = sigma22
[../]
[./s33_beta]
type = SideAverageValue
boundary = right
variable = sigma33
[../]
[./f_el_alpha]
type = SideAverageValue
boundary = left
variable = f_el
[../]
[./f_el_beta]
type = SideAverageValue
boundary = right
variable = f_el
[../]
[./f_c_alpha]
type = SideAverageValue
boundary = left
variable = Fglobal
[../]
[./f_c_beta]
type = SideAverageValue
boundary = right
variable = Fglobal
[../]
[./chem_pot_alpha]
type = SideAverageValue
boundary = left
variable = w
[../]
[./chem_pot_beta]
type = SideAverageValue
boundary = right
variable = w
[../]
[./psi_alpha]
type = SideAverageValue
boundary = left
variable = psi
[../]
[./psi_beta]
type = SideAverageValue
boundary = right
variable = psi
[../]
[./total_energy]
type = ElementIntegralVariablePostprocessor
variable = Fglobal
[../]
# Get simulation cell size from postprocessor
[./volume]
type = ElementIntegralMaterialProperty
mat_prop = 1
[../]
[./psi_eq_int]
type = FunctionValuePostprocessor
function = psi_eq_int
[../]
[./psi_int]
type = ElementIntegralVariablePostprocessor
variable = psi
[../]
[./gamma]
type = FunctionValuePostprocessor
function = gamma
[../]
[]
#
# Precondition using handcoded off-diagonal terms
#
[Preconditioning]
[./full]
type = SMP
full = true
[../]
[]
[Outputs]
[./exodus]
type = Exodus
time_step_interval = 20
[../]
[./csv]
type = CSV
execute_on = 'final'
[../]
#[./console]
# type = Console
# output_file = true
# [../]
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/rayleigh-bernard-two-phase.i)
mu = 1.0
rho = 1e3
mu_d = 0.3
rho_d = 1.0
dp = 0.01
U_lid = 0.0
g = -9.81
[GlobalParams]
velocity_interp_method = 'rc'
advected_interp_method = 'upwind'
rhie_chow_user_object = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = .1
ymin = 0
ymax = .1
nx = 11
ny = 11
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
[]
[vel_y]
type = INSFVVelocityVariable
[]
[pressure]
type = INSFVPressureVariable
[]
[phase_2]
type = INSFVScalarFieldVariable
[]
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[pin_pressure]
type = NSPressurePin
variable = pressure
pin_type = point-value
point = '0 0 0'
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = 'rho_mixture'
[]
[u_time]
type = INSFVMomentumTimeDerivative
variable = vel_x
rho = 'rho_mixture'
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = 'rho_mixture'
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_mixture'
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[u_buoyant]
type = INSFVMomentumGravity
variable = vel_x
rho = 'rho_mixture'
momentum_component = 'x'
gravity = '0 ${g} 0'
[]
[v_time]
type = INSFVMomentumTimeDerivative
variable = vel_y
rho = 'rho_mixture'
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = 'rho_mixture'
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_mixture'
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[v_buoyant]
type = INSFVMomentumGravity
variable = vel_y
rho = 'rho_mixture'
momentum_component = 'y'
gravity = '0 ${g} 0'
[]
[phase_2_time]
type = FVFunctorTimeKernel
variable = phase_2
[]
[phase_2_advection]
type = INSFVScalarFieldAdvection
variable = phase_2
u_slip = 'vel_slip_x'
v_slip = 'vel_slip_y'
[]
[phase_2_diffusion]
type = FVDiffusion
variable = phase_2
coeff = 1e-3
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${U_lid}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[bottom_phase_2]
type = FVDirichletBC
variable = phase_2
boundary = 'bottom'
value = 1.0
[]
[top_phase_2]
type = FVDirichletBC
variable = phase_2
boundary = 'top'
value = 0.0
[]
[]
[AuxVariables]
[U]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[drag_coefficient]
type = MooseVariableFVReal
[]
[rho_mixture_var]
type = MooseVariableFVReal
[]
[mu_mixture_var]
type = MooseVariableFVReal
[]
[phase_1]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[mag]
type = VectorMagnitudeAux
variable = U
x = vel_x
y = vel_y
[]
[populate_cd]
type = FunctorAux
variable = drag_coefficient
functor = 'Darcy_coefficient'
[]
[populate_rho_mixture_var]
type = FunctorAux
variable = rho_mixture_var
functor = 'rho_mixture'
[]
[populate_mu_mixture_var]
type = FunctorAux
variable = mu_mixture_var
functor = 'mu_mixture'
[]
[compute_phase_1]
type = ParsedAux
variable = phase_1
coupled_variables = 'phase_2'
expression = '1 - phase_2'
[]
[]
[FunctorMaterials]
[CD]
type = NSFVDispersePhaseDragFunctorMaterial
rho = 'rho_mixture'
mu = mu_mixture
u = 'vel_x'
v = 'vel_y'
particle_diameter = ${dp}
[]
[mixing_material]
type = NSFVMixtureFunctorMaterial
phase_1_names = '${rho_d} ${mu_d}'
phase_2_names = '${rho} ${mu}'
prop_names = 'rho_mixture mu_mixture'
phase_1_fraction = 'phase_2'
[]
[populate_u_slip]
type = WCNSFV2PSlipVelocityFunctorMaterial
slip_velocity_name = 'vel_slip_x'
momentum_component = 'x'
u = 'vel_x'
v = 'vel_y'
rho = ${rho}
mu = 'mu_mixture'
rho_d = ${rho_d}
particle_diameter = ${dp}
linear_coef_name = 'Darcy_coefficient'
[]
[populate_v_slip]
type = WCNSFV2PSlipVelocityFunctorMaterial
slip_velocity_name = 'vel_slip_y'
momentum_component = 'y'
u = 'vel_x'
v = 'vel_y'
rho = ${rho}
mu = 'mu_mixture'
rho_d = ${rho_d}
particle_diameter = ${dp}
linear_coef_name = 'Darcy_coefficient'
[]
[]
[Postprocessors]
[average_void]
type = ElementAverageValue
variable = 'phase_2'
[]
[max_y_velocity]
type = ElementExtremeValue
variable = 'vel_y'
value_type = max
[]
[min_y_velocity]
type = ElementExtremeValue
variable = 'vel_y'
value_type = min
[]
[max_x_velocity]
type = ElementExtremeValue
variable = 'vel_x'
value_type = max
[]
[min_x_velocity]
type = ElementExtremeValue
variable = 'vel_x'
value_type = min
[]
[max_x_slip_velocity]
type = ElementExtremeFunctorValue
functor = 'vel_slip_x'
value_type = max
[]
[max_y_slip_velocity]
type = ElementExtremeFunctorValue
functor = 'vel_slip_y'
value_type = max
[]
[max_drag_coefficient]
type = ElementExtremeFunctorValue
functor = 'drag_coefficient'
value_type = max
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 10
iteration_window = 2
growth_factor = 2
cutback_factor = 0.5
dt = 1e-3
[]
nl_max_its = 20
nl_rel_tol = 1e-03
nl_abs_tol = 1e-9
l_max_its = 5
end_time = 1e8
[]
[Outputs]
exodus = false
[CSV]
type = CSV
execute_on = 'FINAL'
[]
[]
(tutorials/tutorial04_meshing/app/test/tests/base_mesh_generators/reporting_id_vpp.i)
[Mesh]
[pin]
type = PolygonConcentricCircleMeshGenerator
preserve_volumes = true
ring_radii = 0.4
ring_intervals = 2
background_intervals = 1
num_sides = 6
num_sectors_per_side = '2 2 2 2 2 2'
polygon_size = 0.5
[]
[assembly]
type = PatternedHexMeshGenerator
inputs = 'pin'
pattern_boundary = hexagon
pattern = ' 0 0 0;
0 0 0 0;
0 0 0 0 0;
0 0 0 0;
0 0 0'
hexagon_size = 2.6
duct_sizes = '2.4 2.5'
duct_intervals = '1 1'
assign_type = 'cell'
id_name = 'pin_id'
[]
[core]
type = PatternedHexMeshGenerator
inputs = 'assembly'
pattern_boundary = none
pattern = ' 0 0;
0 0 0;
0 0'
assign_type = 'cell'
id_name = 'assembly_id'
generate_core_metadata = true
[]
[]
[AuxVariables]
[variable_1]
family = LAGRANGE
order = FIRST
[]
[variable_2]
family = MONOMIAL
order = CONSTANT
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
[AuxKernels]
[set_variable1]
type = ParsedAux
use_xyzt = true
expression = 'exp(-0.05*x*x)*exp(-0.05*y*y)'
variable = variable_1
[]
[set_variable2]
type = ParsedAux
use_xyzt = true
expression = 'cos(0.1*x) * cos(0.1*y)'
variable = variable_2
block = '1 2'
[]
[]
[VectorPostprocessors]
[integral]
type = ExtraIDIntegralVectorPostprocessor
variable = 'variable_1 variable_2'
id_name = 'assembly_id pin_id'
[]
[]
[Outputs]
exodus = true
csv = true
execute_on = timestep_end
[]
(modules/porous_flow/test/tests/poro_elasticity/mandel_basicthm.i)
# using a BasicTHM Action
#
# Mandel's problem of consolodation of a drained medium
# Using the FullySaturatedDarcyBase and FullySaturatedFullySaturatedMassTimeDerivative kernels
# with multiply_by_density = false, so that this problem becomes linear
#
# A sample is in plane strain.
# -a <= x <= a
# -b <= y <= b
# It is squashed with constant force by impermeable, frictionless plattens on its top and bottom surfaces (at y=+/-b)
# Fluid is allowed to leak out from its sides (at x=+/-a)
# The porepressure within the sample is monitored.
#
# As is common in the literature, this is simulated by
# considering the quarter-sample, 0<=x<=a and 0<=y<=b, with
# impermeable, roller BCs at x=0 and y=0 and y=b.
# Porepressure is fixed at zero on x=a.
# Porepressure and displacement are initialised to zero.
# Then the top (y=b) is moved downwards with prescribed velocity,
# so that the total force that is inducing this downwards velocity
# is fixed. The velocity is worked out by solving Mandel's problem
# analytically, and the total force is monitored in the simulation
# to check that it indeed remains constant.
#
# Here are the problem's parameters, and their values:
# Soil width. a = 1
# Soil height. b = 0.1
# Soil's Lame lambda. la = 0.5
# Soil's Lame mu, which is also the Soil's shear modulus. mu = G = 0.75
# Soil bulk modulus. K = la + 2*mu/3 = 1
# Drained Poisson ratio. nu = (3K - 2G)/(6K + 2G) = 0.2
# Soil bulk compliance. 1/K = 1
# Fluid bulk modulus. Kf = 8
# Fluid bulk compliance. 1/Kf = 0.125
# Soil initial porosity. phi0 = 0.1
# Biot coefficient. alpha = 0.6
# Biot modulus. M = 1/(phi0/Kf + (alpha - phi0)(1 - alpha)/K) = 4.705882
# Undrained bulk modulus. Ku = K + alpha^2*M = 2.694118
# Undrained Poisson ratio. nuu = (3Ku - 2G)/(6Ku + 2G) = 0.372627
# Skempton coefficient. B = alpha*M/Ku = 1.048035
# Fluid mobility (soil permeability/fluid viscosity). k = 1.5
# Consolidation coefficient. c = 2*k*B^2*G*(1-nu)*(1+nuu)^2/9/(1-nuu)/(nuu-nu) = 3.821656
# Normal stress on top. F = 1
#
# The solution for porepressure and displacements is given in
# AHD Cheng and E Detournay "A direct boundary element method for plane strain poroelasticity" International Journal of Numerical and Analytical Methods in Geomechanics 12 (1988) 551-572.
# The solution involves complicated infinite series, so I shall not write it here
[Mesh]
type = GeneratedMesh
dim = 3
nx = 10
ny = 1
nz = 1
xmin = 0
xmax = 1
ymin = 0
ymax = 0.1
zmin = 0
zmax = 1
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
PorousFlowDictator = dictator
block = 0
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[porepressure]
[]
[]
[BCs]
[roller_xmin]
type = DirichletBC
variable = disp_x
value = 0
boundary = 'left'
[]
[roller_ymin]
type = DirichletBC
variable = disp_y
value = 0
boundary = 'bottom'
[]
[plane_strain]
type = DirichletBC
variable = disp_z
value = 0
boundary = 'back front'
[]
[xmax_drained]
type = DirichletBC
variable = porepressure
value = 0
boundary = right
[]
[top_velocity]
type = FunctionDirichletBC
variable = disp_y
function = top_velocity
boundary = top
[]
[]
[Functions]
[top_velocity]
type = PiecewiseLinear
x = '0 0.002 0.006 0.014 0.03 0.046 0.062 0.078 0.094 0.11 0.126 0.142 0.158 0.174 0.19 0.206 0.222 0.238 0.254 0.27 0.286 0.302 0.318 0.334 0.35 0.366 0.382 0.398 0.414 0.43 0.446 0.462 0.478 0.494 0.51 0.526 0.542 0.558 0.574 0.59 0.606 0.622 0.638 0.654 0.67 0.686 0.702'
y = '-0.041824842 -0.042730269 -0.043412712 -0.04428867 -0.045509181 -0.04645965 -0.047268246 -0.047974749 -0.048597109 -0.0491467 -0.049632388 -0.050061697 -0.050441198 -0.050776675 -0.051073238 -0.0513354 -0.051567152 -0.051772022 -0.051953128 -0.052113227 -0.052254754 -0.052379865 -0.052490464 -0.052588233 -0.052674662 -0.052751065 -0.052818606 -0.052878312 -0.052931093 -0.052977751 -0.053018997 -0.053055459 -0.053087691 -0.053116185 -0.053141373 -0.05316364 -0.053183324 -0.053200724 -0.053216106 -0.053229704 -0.053241725 -0.053252351 -0.053261745 -0.053270049 -0.053277389 -0.053283879 -0.053289615'
[]
[]
[AuxVariables]
[tot_force]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[tot_force]
type = ParsedAux
coupled_variables = 'stress_yy porepressure'
execute_on = timestep_end
variable = tot_force
expression = '-stress_yy+0.6*porepressure'
[]
[]
[FluidProperties]
[the_simple_fluid]
type = SimpleFluidProperties
thermal_expansion = 0.0
bulk_modulus = 8.0
viscosity = 1.0
density0 = 1.0
[]
[]
[PorousFlowBasicTHM]
coupling_type = HydroMechanical
displacements = 'disp_x disp_y disp_z'
multiply_by_density = false
porepressure = porepressure
biot_coefficient = 0.6
gravity = '0 0 0'
fp = the_simple_fluid
[]
[Materials]
[elasticity_tensor]
type = ComputeElasticityTensor
C_ijkl = '0.5 0.75'
# bulk modulus is lambda + 2*mu/3 = 0.5 + 2*0.75/3 = 1
fill_method = symmetric_isotropic
[]
[strain]
type = ComputeSmallStrain
[]
[stress]
type = ComputeLinearElasticStress
[]
[porosity]
type = PorousFlowPorosityConst # only the initial value of this is ever used
porosity = 0.1
[]
[biot_modulus]
type = PorousFlowConstantBiotModulus
biot_coefficient = 0.6
solid_bulk_compliance = 1
fluid_bulk_modulus = 8
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1.5 0 0 0 1.5 0 0 0 1.5'
[]
[]
[Postprocessors]
[p0]
type = PointValue
outputs = csv
point = '0.0 0 0'
variable = porepressure
[]
[p1]
type = PointValue
outputs = csv
point = '0.1 0 0'
variable = porepressure
[]
[p2]
type = PointValue
outputs = csv
point = '0.2 0 0'
variable = porepressure
[]
[p3]
type = PointValue
outputs = csv
point = '0.3 0 0'
variable = porepressure
[]
[p4]
type = PointValue
outputs = csv
point = '0.4 0 0'
variable = porepressure
[]
[p5]
type = PointValue
outputs = csv
point = '0.5 0 0'
variable = porepressure
[]
[p6]
type = PointValue
outputs = csv
point = '0.6 0 0'
variable = porepressure
[]
[p7]
type = PointValue
outputs = csv
point = '0.7 0 0'
variable = porepressure
[]
[p8]
type = PointValue
outputs = csv
point = '0.8 0 0'
variable = porepressure
[]
[p9]
type = PointValue
outputs = csv
point = '0.9 0 0'
variable = porepressure
[]
[p99]
type = PointValue
outputs = csv
point = '1 0 0'
variable = porepressure
[]
[xdisp]
type = PointValue
outputs = csv
point = '1 0.1 0'
variable = disp_x
[]
[ydisp]
type = PointValue
outputs = csv
point = '1 0.1 0'
variable = disp_y
[]
[total_downwards_force]
type = ElementAverageValue
outputs = csv
variable = tot_force
[]
[dt]
type = FunctionValuePostprocessor
outputs = console
function = if(0.15*t<0.01,0.15*t,0.01)
[]
[]
[Preconditioning]
[andy]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -snes_atol -snes_rtol -snes_max_it'
petsc_options_value = 'gmres asm lu 1E-14 1E-10 10000'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
start_time = 0
end_time = 0.7
[TimeStepper]
type = PostprocessorDT
postprocessor = dt
dt = 0.001
[]
[]
[Outputs]
execute_on = 'timestep_end'
file_base = mandel_basicthm
[csv]
time_step_interval = 3
type = CSV
[]
[]
(modules/navier_stokes/test/tests/finite_element/cns/bump/bump.i)
# Euler flow of an ideal gas over a Gaussian "bump".
#
# The inlet is a stagnation pressure and temperature BC which
# corresponds to subsonic (M=0.5) flow with a static pressure of 1 atm
# and static temperature of 300K. The outlet consists of a
# weakly-imposed static pressure BC of 1 atm. The top and bottom
# walls of the channel weakly impose the "no normal flow" BC. The
# problem is initialized with freestream flow throughout the domain.
# Although this initial condition is less physically realistic, it
# helps the problem reach steady state more quickly.
#
# There is a sequence of uniformly-refined, geometry-fitted meshes
# from Yidong Xia available for solving this classical subsonic test
# problem (see the Mesh block below). A coarse grid is used for the
# actual regression test, but changing one line in the Mesh block is
# sufficient to run this problem with different meshes. An
# entropy-based error estimate is also provided, and can be used to
# demonstrate convergence of the numerical solution (since the true
# solution should produce zero entropy). The error should converge at
# second-order in this norm.
[Mesh]
# Bi-Linear elements
# file = SmoothBump_quad_ref1_Q1.msh # 84 elems, 65 nodes
# file = SmoothBump_quad_ref2_Q1.msh # 192 elems, 225 nodes
# file = SmoothBump_quad_ref3_Q1.msh # 768 elems, 833 nodes
# file = SmoothBump_quad_ref4_Q1.msh # 3072 elems, 3201 nodes
# file = SmoothBump_quad_ref5_Q1.msh # 12288 elems, 12545 nodes
# Bi-Quadratic elements
# file = SmoothBump_quad_ref0_Q2.msh # 32 elems, 65 nodes
# file = SmoothBump_quad_ref1_Q2.msh # 84 elems, 225 nodes
file = SmoothBump_quad_ref2_Q2.msh # 260 elems, 833 nodes
# file = SmoothBump_quad_ref3_Q2.msh # 900 elems, 3201 nodes
# file = SmoothBump_quad_ref4_Q2.msh # 3332 elems, 12545 nodes
# file = SmoothBump_quad_ref5_Q2.msh # 12804 elems, 49665 nodes
[]
[FluidProperties]
[ideal_gas]
type = IdealGasFluidProperties
gamma = 1.4
molar_mass = 0.02897024320557491
[]
[]
[Modules]
[CompressibleNavierStokes]
# steady-state or transient
equation_type = transient
# fluid
fluid_properties = ideal_gas
# boundary conditions
stagnation_boundary = 1
stagnation_pressure = 120192.995549849 # Pa, Mach=0.5 at 1 atm
stagnation_temperature = 315 # K, Mach=0.5 at 1 atm
stagnation_flow_direction = '1 0'
no_penetration_boundary = '3 4'
static_pressure_boundary = 2
static_pressure = 101325 # Pa
# variable types, scalings and initial conditions
family = LAGRANGE
order = FIRST
total_energy_density_scaling = 9.869232667160121e-6
initial_pressure = 101325.
initial_temperature = 300.
initial_velocity = '173.594354746921 0 0' # Mach 0.5: = 0.5*sqrt(gamma*R*T)
pressure_variable_name = "p"
[]
[]
[Materials]
[fluid]
type = Air
block = 0 # 'MeshInterior'
rho = rho
rhou = rhou
rhov = rhov
rho_et = rho_et
vel_x = vel_x
vel_y = vel_y
temperature = temperature
ht = ht
# This value is not used in the Euler equations, but it *is* used
# by the stabilization parameter computation, which it decreases
# the amount of artificial viscosity added, so it's best to use a
# realistic value.
dynamic_viscosity = 0.0
fluid_properties = ideal_gas
[]
[]
[Postprocessors]
[entropy_error]
type = NSEntropyError
execute_on = 'initial timestep_end'
block = 0
rho_infty = 1.1768292682926829
p_infty = 101325
rho = rho
pressure = p
fluid_properties = ideal_gas
[]
[]
[Preconditioning]
[SMP_PJFNK]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
dt = 5.e-5
dtmin = 1.e-5
start_time = 0.0
num_steps = 10
nl_rel_tol = 1e-9
nl_max_its = 5
l_tol = 1e-4
l_max_its = 100
# We use trapezoidal quadrature. This improves stability by
# mimicking the "group variable" discretization approach.
[Quadrature]
type = TRAP
order = FIRST
[]
[]
[Outputs]
time_step_interval = 1
exodus = true
[]
[AuxVariables]
[rhoe][]
[enthalpy][]
[]
[AuxKernels]
[rhoe]
variable = rhoe
type = ParsedAux
expression = 'rho_et'
coupled_variables = 'rho_et'
execute_on = 'initial timestep_end'
[]
[enthalpy]
variable = enthalpy
type = ParsedAux
expression = 'ht'
coupled_variables = 'ht'
execute_on = 'initial timestep_end'
[]
[]
(modules/solid_mechanics/test/tests/torque/ad_torque_small.i)
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
origin = '0 0 2'
direction = '0 0 1'
polar_moment_of_inertia = pmi
factor = t
[]
[Mesh]
[ring]
type = AnnularMeshGenerator
nr = 1
nt = 30
rmin = 0.95
rmax = 1
[]
[extrude]
type = MeshExtruderGenerator
input = ring
extrusion_vector = '0 0 2'
bottom_sideset = 'bottom'
top_sideset = 'top'
num_layers = 5
[]
[]
[AuxVariables]
[alpha_var]
[]
[shear_stress_var]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[alpha]
type = RotationAngle
variable = alpha_var
[]
[shear_stress]
type = ParsedAux
variable = shear_stress_var
coupled_variables = 'stress_yz stress_xz'
expression = 'sqrt(stress_yz^2 + stress_xz^2)'
[]
[]
[BCs]
# fix bottom
[fix_x]
type = DirichletBC
boundary = bottom
variable = disp_x
value = 0
[]
[fix_y]
type = DirichletBC
boundary = bottom
variable = disp_y
value = 0
[]
[fix_z]
type = DirichletBC
boundary = bottom
variable = disp_z
value = 0
[]
# twist top
[twist_x]
type = ADTorque
boundary = top
variable = disp_x
[]
[twist_y]
type = ADTorque
boundary = top
variable = disp_y
[]
[twist_z]
type = ADTorque
boundary = top
variable = disp_z
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
add_variables = true
strain = SMALL
use_automatic_differentiation = true
generate_output = 'vonmises_stress stress_yz stress_xz'
[]
[]
[Postprocessors]
[pmi]
type = PolarMomentOfInertia
boundary = top
# execute_on = 'INITIAL NONLINEAR'
execute_on = 'INITIAL'
[]
[alpha]
type = SideAverageValue
variable = alpha_var
boundary = top
[]
[shear_stress]
type = ElementAverageValue
variable = shear_stress_var
[]
[]
[Materials]
[stress]
type = ADComputeLinearElasticStress
[]
[elastic]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 0.3
shear_modulus = 100
[]
[]
[Executioner]
# type = Steady
type = Transient
num_steps = 1
solve_type = NEWTON
petsc_options_iname = '-pctype'
petsc_options_value = 'lu'
nl_max_its = 150
[]
[Outputs]
exodus = true
print_linear_residuals = false
perf_graph = true
[]
(modules/geochemistry/test/tests/time_dependent_reactions/flushing_case3.i)
# Alkali flushing of a reservoir (an example of flushing): adding Na2SiO3
# To determine the initial constraint_values, run flushing_equilibrium_at70degC.i
# Note that flushing_equilibrium_at70degC.i will have to be re-run when temperature-dependence has been added to geochemistry
# Note that Dawsonite is currently not included as an equilibrium_mineral, otherwise it is supersaturated in the initial configuration, so precipitates. Bethke does not report this in Fig30.4, so I assume it is due to temperature dependence
[GlobalParams]
point = '0 0 0'
[]
[TimeDependentReactionSolver]
model_definition = definition
geochemistry_reactor_name = reactor
charge_balance_species = "Cl-"
swap_into_basis = "Calcite Dolomite-ord Muscovite Kaolinite"
swap_out_of_basis = "HCO3- Mg++ K+ Al+++"
constraint_species = "H2O H+ Cl- Na+ Ca++ Calcite Dolomite-ord Muscovite Kaolinite SiO2(aq)"
constraint_value = " 1.0 1E-5 2.1716946 1.0288941 0.21650572 10.177537 3.6826177 1.320907 1.1432682 6.318e-05"
constraint_meaning = "kg_solvent_water activity bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition free_concentration"
constraint_unit = " kg dimensionless moles moles moles moles moles moles moles molal"
initial_temperature = 70.0
temperature = 70.0
kinetic_species_name = Quartz
kinetic_species_initial_value = 226.992243
kinetic_species_unit = moles
evaluate_kinetic_rates_always = true # implicit time-marching used for stability
ramp_max_ionic_strength_initial = 0 # max_ionic_strength in such a simple problem does not need ramping
close_system_at_time = 0.0
remove_fixed_activity_name = "H+"
remove_fixed_activity_time = 0.0
mode = 3 # flush through the NaOH solution specified below:
source_species_names = "H2O H+ Na+ SiO2(aq)"
source_species_rates = "27.88 -0.25 0.25 0.125" # 1kg water/2days = 27.755moles/day. 0.25mol Na2O/2days = 0.25*(--2mol H+ + 2mol Na+ + 1mol H2O)/2days
[]
[UserObjects]
[rate_quartz]
type = GeochemistryKineticRate
kinetic_species_name = Quartz
intrinsic_rate_constant = 1.3824E-13 # 1.6E-19mol/s/cm^2 = 1.3824E-13mol/day/cm^2
multiply_by_mass = true
area_quantity = 1000
promoting_species_names = "H+"
promoting_indices = "-0.5"
[]
[definition]
type = GeochemicalModelDefinition
database_file = "../../../database/moose_geochemdb.json"
basis_species = "H2O H+ Cl- Na+ Ca++ HCO3- Mg++ K+ Al+++ SiO2(aq)"
equilibrium_minerals = "Calcite Dolomite-ord Muscovite Kaolinite Paragonite Analcime Phlogopite Tridymite" # Dawsonite
kinetic_minerals = "Quartz"
kinetic_rate_descriptions = "rate_quartz"
[]
[]
[AuxVariables]
[diss_rate]
[]
[]
[AuxKernels]
[diss_rate]
type = ParsedAux
coupled_variables = mol_change_Quartz
expression = '-mol_change_Quartz / 1.0' # 1.0 = timestep size
variable = diss_rate
[]
[]
[Postprocessors]
[pH]
type = PointValue
variable = "pH"
[]
[rate_mole_per_day]
type = PointValue
variable = diss_rate
[]
[cm3_Calcite]
type = PointValue
variable = free_cm3_Calcite
[]
[cm3_Dolomite]
type = PointValue
variable = free_cm3_Dolomite-ord
[]
[cm3_Muscovite]
type = PointValue
variable = free_cm3_Muscovite
[]
[cm3_Kaolinite]
type = PointValue
variable = free_cm3_Kaolinite
[]
[cm3_Quartz]
type = PointValue
variable = free_cm3_Quartz
[]
[cm3_Paragonite]
type = PointValue
variable = free_cm3_Paragonite
[]
[cm3_Analcime]
type = PointValue
variable = free_cm3_Analcime
[]
[cm3_Phlogopite]
type = PointValue
variable = free_cm3_Phlogopite
[]
[cm3_Tridymite]
type = PointValue
variable = free_cm3_Tridymite
[]
[]
[Executioner]
type = Transient
dt = 0.1
end_time = 20E-1 # measured in days
[]
[Outputs]
csv = true
[]
(modules/porous_flow/examples/reservoir_model/regular_grid.i)
# SPE 10 comparative problem - model 1
# Data and description from https://www.spe.org/web/csp/datasets/set01.htm
# Simple input file that just establishes gravity equilibrium in the model
#
# Heterogeneous permeability is included by reading data from an external file
# using the PiecewiseMultilinear function, and saving that data to an elemental
# AuxVariable that is then used in PorousFlowPermeabilityConstFromVar
[Mesh]
type = GeneratedMesh
dim = 2
nx = 100
ny = 20
xmax = 762
ymax = 15.24
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 -9.81 0'
temperature_unit = Celsius
[]
[Variables]
[porepressure]
initial_condition = 20e6
[]
[]
[Functions]
[perm_md_fcn]
type = PiecewiseMultilinear
data_file = spe10_case1.data
[]
[]
[BCs]
[top]
type = DirichletBC
variable = porepressure
value = 20e6
boundary = top
[]
[]
[AuxVariables]
[temperature]
initial_condition = 50
[]
[xnacl]
initial_condition = 0.1
[]
[porosity]
family = MONOMIAL
order = CONSTANT
initial_condition = 0.2
[]
[perm_md]
family = MONOMIAL
order = CONSTANT
[]
[perm]
family = MONOMIAL
order = CONSTANT
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
variable = porepressure
[]
[flux0]
type = PorousFlowFullySaturatedDarcyFlow
variable = porepressure
[]
[]
[AuxKernels]
[perm_md]
type = FunctionAux
function = perm_md_fcn
variable = perm_md
execute_on = initial
[]
[perm]
type = ParsedAux
variable = perm
coupled_variables = perm_md
expression = '9.869233e-16*perm_md'
execute_on = initial
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = porepressure
number_fluid_phases = 1
number_fluid_components = 1
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[watertab]
type = TabulatedBicubicFluidProperties
fp = water
save_file = false
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = temperature
[]
[ps]
type = PorousFlow1PhaseFullySaturated
porepressure = porepressure
[]
[massfrac]
type = PorousFlowMassFraction
[]
[brine]
type = PorousFlowBrine
compute_enthalpy = false
compute_internal_energy = false
xnacl = xnacl
phase = 0
water_fp = watertab
[]
[porosity]
type = PorousFlowPorosityConst
porosity = porosity
[]
[permeability]
type = PorousFlowPermeabilityConstFromVar
perm_xx = perm
perm_yy = perm
perm_zz = perm
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 1e5
nl_abs_tol = 1e-12
nl_rel_tol = 1e-06
steady_state_detection = true
steady_state_tolerance = 1e-12
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e2
[]
[]
[Outputs]
execute_on = 'initial timestep_end'
exodus = true
perf_graph = true
[]
(modules/porous_flow/test/tests/chemistry/dissolution_limited.i)
# The dissolution reaction, with limited initial mineral concentration
#
# a <==> mineral
#
# produces "mineral". Using mineral_density = fluid_density, theta = 1 = eta, the DE is
#
# a' = -(mineral / porosity)' = rate * surf_area * molar_vol (1 - (1 / eqm_const) * (act_coeff * a)^stoi)
#
# The following parameters are used
#
# T_ref = 0.5 K
# T = 1 K
# activation_energy = 3 J/mol
# gas_constant = 6 J/(mol K)
# kinetic_rate_at_ref_T = 0.60653 mol/(m^2 s)
# These give rate = 0.60653 * exp(1/2) = 1 mol/(m^2 s)
#
# surf_area = 0.5 m^2/L
# molar_volume = 2 L/mol
# These give rate * surf_area * molar_vol = 1 s^-1
#
# equilibrium_constant = 0.5 (dimensionless)
# primary_activity_coefficient = 2 (dimensionless)
# stoichiometry = 1 (dimensionless)
# This means that 1 - (1 / eqm_const) * (act_coeff * a)^stoi = 1 - 4 a, which is positive for a < 0.25, ie dissolution for a(t=0) < 0.25
#
# The solution of the DE is
# a = eqm_const / act_coeff + (a(t=0) - eqm_const / act_coeff) exp(-rate * surf_area * molar_vol * act_coeff * t / eqm_const)
# = 0.25 + (a(t=0) - 0.25) exp(-4 * t)
# c = c(t=0) - (a - a(t=0)) * porosity
#
# However, c(t=0) is small, so that the reaction only works until c=0, then a and c both remain fixed
#
# This test checks that (a + c / porosity) is time-independent, and that a follows the above solution, until c=0 and thereafter remains fixed.
#
# Aside:
# The exponential curve is not followed exactly because moose actually solves
# (a - a_old)/dt = rate * surf_area * molar_vol (1 - (1 / eqm_const) * (act_coeff * a)^stoi)
# which does not give an exponential exactly, except in the limit dt->0
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Variables]
[a]
initial_condition = 0.05
[]
[]
[AuxVariables]
[eqm_k]
initial_condition = 0.5
[]
[pressure]
[]
[ini_mineral_conc]
initial_condition = 0.015
[]
[mineral]
family = MONOMIAL
order = CONSTANT
[]
[should_be_static]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mineral]
type = PorousFlowPropertyAux
property = mineral_concentration
mineral_species = 0
variable = mineral
[]
[should_be_static]
type = ParsedAux
coupled_variables = 'mineral a'
expression = 'a + mineral / 0.1'
variable = should_be_static
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Kernels]
[mass_a]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = a
[]
[pre_dis]
type = PorousFlowPreDis
variable = a
mineral_density = 1000
stoichiometry = 1
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = a
number_fluid_phases = 1
number_fluid_components = 2
number_aqueous_kinetic = 1
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 2e9 # huge, so mimic chemical_reactions
density0 = 1000
thermal_expansion = 0
viscosity = 1e-3
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = 1
[]
[ppss]
type = PorousFlow1PhaseFullySaturated
porepressure = pressure
[]
[mass_frac]
type = PorousFlowMassFraction
mass_fraction_vars = a
[]
[predis]
type = PorousFlowAqueousPreDisChemistry
primary_concentrations = a
num_reactions = 1
equilibrium_constants = eqm_k
primary_activity_coefficients = 2
reactions = 1
specific_reactive_surface_area = 0.5
kinetic_rate_constant = 0.6065306597126334
activation_energy = 3
molar_volume = 2
gas_constant = 6
reference_temperature = 0.5
[]
[mineral_conc]
type = PorousFlowAqueousPreDisMineral
initial_concentrations = ini_mineral_conc
[]
[simple_fluid]
type = PorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.1
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
nl_abs_tol = 1E-10
dt = 0.01
end_time = 1
[]
[Postprocessors]
[a]
type = PointValue
point = '0 0 0'
variable = a
[]
[should_be_static]
type = PointValue
point = '0 0 0'
variable = should_be_static
[]
[]
[Outputs]
time_step_interval = 10
csv = true
perf_graph = true
[]
(modules/functional_expansion_tools/test/tests/standard_use/multiapp_sub.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s]
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXVolumeUserObject
function = FX_Basis_Value_Sub
variable = s
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(test/tests/transfers/general_field/user_object/duplicated_user_object_tests/restricted_node_sub.i)
# yy is passed in from the parent app
[Mesh]
[line]
type = GeneratedMeshGenerator
dim = 1
nx = 5
xmax = 2.5
[]
[box]
type = SubdomainBoundingBoxGenerator
input = line
bottom_left = '0 -0.1 -0.1'
top_right = '1.5 0.1 0.1'
# need a different block ID than what is in the parent app to make sure the transfer works properly
block_id = 20
[]
[]
[AuxVariables]
[A]
[]
[S]
[]
[]
[AuxKernels]
[A_ak]
type = ParsedAux
variable = A
use_xyzt = true
expression = '2*x+4*${yy}'
execute_on = 'TIMESTEP_BEGIN'
[]
[]
[Variables]
[u]
[]
[]
[Kernels]
[td]
type = TimeDerivative
variable = u
[]
[diff]
type = Diffusion
variable = u
[]
[]
[UserObjects]
[A_avg]
type = LayeredAverage
block = 20
num_layers = 2
direction = x
variable = A
execute_on = TIMESTEP_END
[]
[]
[Executioner]
type = Transient
[]
[Outputs]
exodus = true
[]
(modules/combined/examples/geochem-porous_flow/geotes_2D/aquifer_un_quartz_geochemistry.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 56
ny = 32
xmin = -70
xmax = 70
ymin = -40
ymax = 40
[]
[]
[GlobalParams]
point = '0 0 0'
reactor = reactor
[]
[SpatialReactionSolver]
model_definition = definition
geochemistry_reactor_name = reactor
charge_balance_species = "Cl-"
constraint_species = "H2O Na+ Cl- SiO2(aq)"
# ASSUME that 1 litre of solution contains:
constraint_value = " 1.0 0.1 0.1 0.00172249633"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition free_concentration"
constraint_unit = " kg moles moles molal"
initial_temperature = 50.0
kinetic_species_name = QuartzUnlike
# Per 1 litre (1000cm^3) of aqueous solution (1kg of solvent water), there is 9000cm^3 of QuartzUnlike, which means the initial porosity is 0.1.
kinetic_species_initial_value = 9000
kinetic_species_unit = cm3
temperature = temperature
source_species_names = 'H2O Na+ Cl- SiO2(aq)'
source_species_rates = 'rate_H2O_per_1l rate_Na_per_1l rate_Cl_per_1l rate_SiO2_per_1l'
ramp_max_ionic_strength_initial = 0 # max_ionic_strength in such a simple problem does not need ramping
add_aux_pH = false # there is no H+ in this system
evaluate_kinetic_rates_always = true # implicit time-marching used for stability
execute_console_output_on = '' # only CSV and exodus output used in this example
[]
[UserObjects]
[rate_quartz]
type = GeochemistryKineticRate
kinetic_species_name = QuartzUnlike
intrinsic_rate_constant = 1.0E-2
multiply_by_mass = true
area_quantity = 1
activation_energy = 72800.0
[]
[definition]
type = GeochemicalModelDefinition
database_file = "small_database.json"
basis_species = "H2O SiO2(aq) Na+ Cl-"
kinetic_minerals = "QuartzUnlike"
kinetic_rate_descriptions = "rate_quartz"
[]
[]
[Executioner]
type = Transient
dt = 1E5
end_time = 7.76E6 # 90 days
[]
[AuxVariables]
[temperature]
initial_condition = 50.0
[]
[nodal_volume]
[]
[porosity]
[]
[nodal_void_volume]
[]
[pf_rate_H2O] # change in H2O mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Na] # change in H2O mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Cl] # change in H2O mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_SiO2] # change in H2O mass (kg/s) at each node provided by the porous-flow simulation
[]
[rate_H2O_per_1l] # rate per 1 litre of aqueous solution that we consider at each node
[]
[rate_Na_per_1l]
[]
[rate_Cl_per_1l]
[]
[rate_SiO2_per_1l]
[]
[transported_H2O]
[]
[transported_Na]
[]
[transported_Cl]
[]
[transported_SiO2]
[]
[transported_mass]
[]
[massfrac_Na]
[]
[massfrac_Cl]
[]
[massfrac_SiO2]
[]
[massfrac_H2O]
[]
[]
[AuxKernels]
[nodal_volume] # TODO: change this hard-coded version once PR is merged
type = FunctionAux
variable = nodal_volume
function = 'if(abs(x) = 70 & abs(y) = 40, 2.5, if(abs(x) = 70 | abs(y) = 40, 5, 10))'
execute_on = 'initial'
[]
[porosity]
type = ParsedAux
coupled_variables = free_cm3_QuartzUnlike
expression = '1000.0 / (1000.0 + free_cm3_QuartzUnlike)'
variable = porosity
execute_on = 'timestep_begin timestep_end'
[]
[nodal_void_volume]
type = ParsedAux
coupled_variables = 'porosity nodal_volume'
variable = nodal_void_volume
expression = 'porosity * nodal_volume'
execute_on = 'timestep_begin'
[]
[rate_H2O_per_1l]
type = ParsedAux
coupled_variables = 'pf_rate_H2O nodal_void_volume'
variable = rate_H2O_per_1l
# pf_rate = change in kg at every node
# pf_rate * 1000 / molar_mass_in_g_per_mole = change in moles at every node
# pf_rate * 1000 / molar_mass / (nodal_void_volume_in_m^3 * 1000) = change in moles per litre of aqueous solution
expression = 'pf_rate_H2O / 18.0152 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_Na_per_1l]
type = ParsedAux
coupled_variables = 'pf_rate_Na nodal_void_volume'
variable = rate_Na_per_1l
expression = 'pf_rate_Na / 22.9898 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_Cl_per_1l]
type = ParsedAux
coupled_variables = 'pf_rate_Cl nodal_void_volume'
variable = rate_Cl_per_1l
expression = 'pf_rate_Cl / 35.453 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_SiO2_per_1l]
type = ParsedAux
coupled_variables = 'pf_rate_SiO2 nodal_void_volume'
variable = rate_SiO2_per_1l
expression = 'pf_rate_SiO2 / 60.0843 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[transported_H2O]
type = GeochemistryQuantityAux
variable = transported_H2O
species = H2O
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Na]
type = GeochemistryQuantityAux
variable = transported_Na
species = Na+
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Cl]
type = GeochemistryQuantityAux
variable = transported_Cl
species = Cl-
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_SiO2]
type = GeochemistryQuantityAux
variable = transported_SiO2
species = 'SiO2(aq)'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_mass]
type = ParsedAux
coupled_variables = 'transported_H2O transported_Na transported_Cl transported_SiO2'
variable = transported_mass
expression = 'transported_H2O * 18.0152 + transported_Na * 22.9898 + transported_Cl * 35.453 + transported_SiO2 * 60.0843'
execute_on = 'timestep_end'
[]
[massfrac_H2O]
type = ParsedAux
coupled_variables = 'transported_H2O transported_mass'
variable = massfrac_H2O
expression = 'transported_H2O * 18.0152 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Na]
type = ParsedAux
coupled_variables = 'transported_Na transported_mass'
variable = massfrac_Na
expression = 'transported_Na * 22.9898 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Cl]
type = ParsedAux
coupled_variables = 'transported_Cl transported_mass'
variable = massfrac_Cl
expression = 'transported_Cl * 35.453 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_SiO2]
type = ParsedAux
coupled_variables = 'transported_SiO2 transported_mass'
variable = massfrac_SiO2
expression = 'transported_SiO2 * 60.0843 / transported_mass'
execute_on = 'timestep_end'
[]
[]
[Postprocessors]
[cm3_quartz]
type = PointValue
variable = free_cm3_QuartzUnlike
[]
[porosity]
type = PointValue
variable = porosity
[]
[solution_temperature]
type = PointValue
variable = solution_temperature
[]
[massfrac_H2O]
type = PointValue
variable = massfrac_H2O
[]
[massfrac_Na]
type = PointValue
variable = massfrac_Na
[]
[massfrac_Cl]
type = PointValue
variable = massfrac_Cl
[]
[massfrac_SiO2]
type = PointValue
variable = massfrac_SiO2
[]
[]
[Outputs]
exodus = true
csv = true
[]
(modules/porous_flow/test/tests/poro_elasticity/mandel_fully_saturated.i)
# Mandel's problem of consolodation of a drained medium
# Using the FullySaturatedDarcyBase and FullySaturatedMassTimeDerivative kernels
#
# A sample is in plane strain.
# -a <= x <= a
# -b <= y <= b
# It is squashed with constant force by impermeable, frictionless plattens on its top and bottom surfaces (at y=+/-b)
# Fluid is allowed to leak out from its sides (at x=+/-a)
# The porepressure within the sample is monitored.
#
# As is common in the literature, this is simulated by
# considering the quarter-sample, 0<=x<=a and 0<=y<=b, with
# impermeable, roller BCs at x=0 and y=0 and y=b.
# Porepressure is fixed at zero on x=a.
# Porepressure and displacement are initialised to zero.
# Then the top (y=b) is moved downwards with prescribed velocity,
# so that the total force that is inducing this downwards velocity
# is fixed. The velocity is worked out by solving Mandel's problem
# analytically, and the total force is monitored in the simulation
# to check that it indeed remains constant.
#
# Here are the problem's parameters, and their values:
# Soil width. a = 1
# Soil height. b = 0.1
# Soil's Lame lambda. la = 0.5
# Soil's Lame mu, which is also the Soil's shear modulus. mu = G = 0.75
# Soil bulk modulus. K = la + 2*mu/3 = 1
# Drained Poisson ratio. nu = (3K - 2G)/(6K + 2G) = 0.2
# Soil bulk compliance. 1/K = 1
# Fluid bulk modulus. Kf = 8
# Fluid bulk compliance. 1/Kf = 0.125
# Soil initial porosity. phi0 = 0.1
# Biot coefficient. alpha = 0.6
# Biot modulus. M = 1/(phi0/Kf + (alpha - phi0)(1 - alpha)/K) = 4.705882
# Undrained bulk modulus. Ku = K + alpha^2*M = 2.694118
# Undrained Poisson ratio. nuu = (3Ku - 2G)/(6Ku + 2G) = 0.372627
# Skempton coefficient. B = alpha*M/Ku = 1.048035
# Fluid mobility (soil permeability/fluid viscosity). k = 1.5
# Consolidation coefficient. c = 2*k*B^2*G*(1-nu)*(1+nuu)^2/9/(1-nuu)/(nuu-nu) = 3.821656
# Normal stress on top. F = 1
#
# The solution for porepressure and displacements is given in
# AHD Cheng and E Detournay "A direct boundary element method for plane strain poroelasticity" International Journal of Numerical and Analytical Methods in Geomechanics 12 (1988) 551-572.
# The solution involves complicated infinite series, so I shall not write it here
[Mesh]
type = GeneratedMesh
dim = 3
nx = 10
ny = 1
nz = 1
xmin = 0
xmax = 1
ymin = 0
ymax = 0.1
zmin = 0
zmax = 1
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
PorousFlowDictator = dictator
block = 0
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'porepressure disp_x disp_y disp_z'
number_fluid_phases = 1
number_fluid_components = 1
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[porepressure]
[]
[]
[BCs]
[roller_xmin]
type = DirichletBC
variable = disp_x
value = 0
boundary = 'left'
[]
[roller_ymin]
type = DirichletBC
variable = disp_y
value = 0
boundary = 'bottom'
[]
[plane_strain]
type = DirichletBC
variable = disp_z
value = 0
boundary = 'back front'
[]
[xmax_drained]
type = DirichletBC
variable = porepressure
value = 0
boundary = right
[]
[top_velocity]
type = FunctionDirichletBC
variable = disp_y
function = top_velocity
boundary = top
[]
[]
[Functions]
[top_velocity]
type = PiecewiseLinear
x = '0 0.002 0.006 0.014 0.03 0.046 0.062 0.078 0.094 0.11 0.126 0.142 0.158 0.174 0.19 0.206 0.222 0.238 0.254 0.27 0.286 0.302 0.318 0.334 0.35 0.366 0.382 0.398 0.414 0.43 0.446 0.462 0.478 0.494 0.51 0.526 0.542 0.558 0.574 0.59 0.606 0.622 0.638 0.654 0.67 0.686 0.702'
y = '-0.041824842 -0.042730269 -0.043412712 -0.04428867 -0.045509181 -0.04645965 -0.047268246 -0.047974749 -0.048597109 -0.0491467 -0.049632388 -0.050061697 -0.050441198 -0.050776675 -0.051073238 -0.0513354 -0.051567152 -0.051772022 -0.051953128 -0.052113227 -0.052254754 -0.052379865 -0.052490464 -0.052588233 -0.052674662 -0.052751065 -0.052818606 -0.052878312 -0.052931093 -0.052977751 -0.053018997 -0.053055459 -0.053087691 -0.053116185 -0.053141373 -0.05316364 -0.053183324 -0.053200724 -0.053216106 -0.053229704 -0.053241725 -0.053252351 -0.053261745 -0.053270049 -0.053277389 -0.053283879 -0.053289615'
[]
[]
[AuxVariables]
[stress_yy]
order = CONSTANT
family = MONOMIAL
[]
[tot_force]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[stress_yy]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_yy
index_i = 1
index_j = 1
[]
[tot_force]
type = ParsedAux
coupled_variables = 'stress_yy porepressure'
execute_on = timestep_end
variable = tot_force
expression = '-stress_yy+0.6*porepressure'
[]
[]
[Kernels]
[grad_stress_x]
type = StressDivergenceTensors
variable = disp_x
component = 0
[]
[grad_stress_y]
type = StressDivergenceTensors
variable = disp_y
component = 1
[]
[grad_stress_z]
type = StressDivergenceTensors
variable = disp_z
component = 2
[]
[poro_x]
type = PorousFlowEffectiveStressCoupling
biot_coefficient = 0.6
variable = disp_x
component = 0
[]
[poro_y]
type = PorousFlowEffectiveStressCoupling
biot_coefficient = 0.6
variable = disp_y
component = 1
[]
[poro_z]
type = PorousFlowEffectiveStressCoupling
biot_coefficient = 0.6
component = 2
variable = disp_z
[]
[mass0]
type = PorousFlowFullySaturatedMassTimeDerivative
biot_coefficient = 0.6
coupling_type = HydroMechanical
variable = porepressure
[]
[flux]
type = PorousFlowFullySaturatedDarcyBase
variable = porepressure
gravity = '0 0 0'
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 8
density0 = 1
thermal_expansion = 0
viscosity = 1
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
[]
[elasticity_tensor]
type = ComputeElasticityTensor
C_ijkl = '0.5 0.75'
# bulk modulus is lambda + 2*mu/3 = 0.5 + 2*0.75/3 = 1
fill_method = symmetric_isotropic
[]
[strain]
type = ComputeSmallStrain
[]
[stress]
type = ComputeLinearElasticStress
[]
[eff_fluid_pressure_qp]
type = PorousFlowEffectiveFluidPressure
[]
[vol_strain]
type = PorousFlowVolumetricStrain
[]
[ppss]
type = PorousFlow1PhaseFullySaturated
porepressure = porepressure
[]
[massfrac]
type = PorousFlowMassFraction
[]
[simple_fluid_qp]
type = PorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[porosity]
type = PorousFlowPorosityConst # only the initial value of this is ever used
porosity = 0.1
[]
[biot_modulus]
type = PorousFlowConstantBiotModulus
biot_coefficient = 0.6
solid_bulk_compliance = 1
fluid_bulk_modulus = 8
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1.5 0 0 0 1.5 0 0 0 1.5'
[]
[]
[Postprocessors]
[p0]
type = PointValue
outputs = csv
point = '0.0 0 0'
variable = porepressure
[]
[p1]
type = PointValue
outputs = csv
point = '0.1 0 0'
variable = porepressure
[]
[p2]
type = PointValue
outputs = csv
point = '0.2 0 0'
variable = porepressure
[]
[p3]
type = PointValue
outputs = csv
point = '0.3 0 0'
variable = porepressure
[]
[p4]
type = PointValue
outputs = csv
point = '0.4 0 0'
variable = porepressure
[]
[p5]
type = PointValue
outputs = csv
point = '0.5 0 0'
variable = porepressure
[]
[p6]
type = PointValue
outputs = csv
point = '0.6 0 0'
variable = porepressure
[]
[p7]
type = PointValue
outputs = csv
point = '0.7 0 0'
variable = porepressure
[]
[p8]
type = PointValue
outputs = csv
point = '0.8 0 0'
variable = porepressure
[]
[p9]
type = PointValue
outputs = csv
point = '0.9 0 0'
variable = porepressure
[]
[p99]
type = PointValue
outputs = csv
point = '1 0 0'
variable = porepressure
[]
[xdisp]
type = PointValue
outputs = csv
point = '1 0.1 0'
variable = disp_x
[]
[ydisp]
type = PointValue
outputs = csv
point = '1 0.1 0'
variable = disp_y
[]
[total_downwards_force]
type = ElementAverageValue
outputs = csv
variable = tot_force
[]
[dt]
type = FunctionValuePostprocessor
outputs = console
function = if(0.15*t<0.01,0.15*t,0.01)
[]
[]
[Preconditioning]
[andy]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -snes_atol -snes_rtol -snes_max_it'
petsc_options_value = 'gmres asm lu 1E-14 1E-10 10000'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
start_time = 0
end_time = 0.7
[TimeStepper]
type = PostprocessorDT
postprocessor = dt
dt = 0.001
[]
[]
[Outputs]
execute_on = 'timestep_end'
file_base = mandel_fully_saturated
[csv]
time_step_interval = 3
type = CSV
[]
[]
(modules/phase_field/test/tests/electrochem_sintering/ElectrochemicalSintering_test.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 800
xmin = 0
xmax = 80
[]
[GlobalParams]
op_num = 2
var_name_base = gr
int_width = 4
[]
[Variables]
[wvy]
[]
[wvo]
[]
[phi]
[]
[PolycrystalVariables]
[]
[V]
[]
[]
[AuxVariables]
[bnds]
[]
[negative_V]
[]
[E_x]
order = CONSTANT
family = MONOMIAL
[]
[E_y]
order = CONSTANT
family = MONOMIAL
[]
[ns_cat_aux]
order = CONSTANT
family = MONOMIAL
[]
[ns_an_aux]
order = CONSTANT
family = MONOMIAL
[]
[T]
[]
[]
[Functions]
[ic_func_gr0]
type = ParsedFunction
expression = '0.5*(1.0-tanh((x)/sqrt(2.0*2.0)))'
[]
[ic_func_gr1]
type = ParsedFunction
expression = '0.5*(1.0+tanh((x)/sqrt(2.0*2.0)))'
[]
[]
[ICs]
[gr0_IC]
type = FunctionIC
variable = gr0
function = ic_func_gr0
[]
[gr1_IC]
type = FunctionIC
variable = gr1
function = ic_func_gr1
[]
[wvy_IC]
type = ConstantIC
variable = wvy
value = 2.7827
[]
[wvo_IC]
type = ConstantIC
variable = wvo
value = 2.7827
[]
[T_IC]
type = ConstantIC
variable = T
value = 1600
[]
[]
[BCs]
[v_left]
type = DirichletBC
preset = true
variable = V
boundary = left
value = 1e-2
[]
[v_right]
type = DirichletBC
preset = true
variable = V
boundary = right
value = 0
[]
[gr0_left]
type = DirichletBC
preset = true
variable = gr0
boundary = left
value = 0.5 #Grain boundary at left hand side of domain
[]
[gr1_left]
type = DirichletBC
preset = true
variable = gr1
boundary = left
value = 0.5 #Grain boundary at left hand side of domain
[]
[wvo_right]
type = DirichletBC
preset = true
variable = wvo
boundary = right
value = 2.7827
[]
[wvy_right]
type = DirichletBC
preset = true
variable = wvy
boundary = right
value = 2.7827
[]
[]
[Materials]
# Free energy coefficients for parabolic curves
[ks_cat]
type = ParsedMaterial
property_name = ks_cat
coupled_variables = 'T'
constant_names = 'a b Va'
constant_expressions = '-0.0017 140.44 0.03726'
expression = '(a*T + b) * Va^2'
[]
[ks_an]
type = ParsedMaterial
property_name = ks_an
coupled_variables = 'T'
constant_names = 'a b Va'
constant_expressions = '-0.0017 140.44 0.03726'
expression = '(a*T + b) * Va^2'
[]
[kv_cat]
type = ParsedMaterial
property_name = kv_cat
material_property_names = 'ks_cat'
expression = '10*ks_cat'
[]
[kv_an]
type = ParsedMaterial
property_name = kv_an
material_property_names = 'ks_cat'
expression = '10*ks_cat'
[]
# Diffusivity and mobilities
[chiDy]
type = GrandPotentialTensorMaterial
f_name = chiDy
diffusivity_name = Dvy
solid_mobility = L
void_mobility = Lv
chi = chi_cat
surface_energy = 6.24
c = phi
T = T
D0 = 5.9e11
GBmob0 = 1.60e12
Q = 4.14
Em = 4.25
bulkindex = 1
gbindex = 1
surfindex = 1
[]
[chiDo]
type = GrandPotentialTensorMaterial
f_name = chiDo
diffusivity_name = Dvo
solid_mobility = Lo
void_mobility = Lvo
chi = chi_an
surface_energy = 6.24
c = phi
T = T
D0 = 5.9e11
GBmob0 = 1.60e12
Q = 4.14
Em = 4.25
bulkindex = 1
gbindex = 1
surfindex = 1
[]
# Everything else
[ns_y_min]
type = DerivativeParsedMaterial
property_name = ns_y_min
coupled_variables = 'gr0 gr1 T'
constant_names = 'Ef_B Ef_GB kB Va_Y'
constant_expressions = '4.37 4.37 8.617343e-5 0.03726'
derivative_order = 2
expression = 'bnds:=gr0^2 + gr1^2; Ef:=Ef_B + 4.0 * (Ef_GB - Ef_B) * (1.0 - bnds)^2;
'
' exp(-Ef/kB/T) / Va_Y'
[]
[ns_o_min]
type = DerivativeParsedMaterial
property_name = ns_o_min
coupled_variables = 'gr0 gr1 T'
constant_names = 'Ef_B Ef_GB kB Va_O'
constant_expressions = '4.37 4.37 8.617343e-5 0.02484'
derivative_order = 2
expression = 'bnds:=gr0^2 + gr1^2; Ef:=Ef_B + 4.0 * (Ef_GB - Ef_B) * (1.0 - bnds)^2;
'
' exp(-Ef/kB/T) / Va_O'
[]
[sintering]
type = ElectrochemicalSinteringMaterial
chemical_potentials = 'wvy wvo'
electric_potential = V
void_op = phi
Temperature = T
surface_energy = 6.24
grainboundary_energy = 5.18
solid_energy_coefficients = 'kv_cat kv_cat'
void_energy_coefficients = 'kv_cat kv_an'
min_vacancy_concentrations_solid = 'ns_y_min ns_o_min'
min_vacancy_concentrations_void = '26.837 40.256'
defect_charges = '-3 2'
solid_relative_permittivity = 30
solid_energy_model = DILUTE
[]
[density_chi_y]
type = ElectrochemicalDefectMaterial
chemical_potential = wvy
void_op = phi
Temperature = T
electric_potential = V
void_density_name = nv_cat
solid_density_name = ns_cat
chi_name = chi_cat
void_energy_coefficient = kv_cat
min_vacancy_concentration_solid = ns_y_min
min_vacancy_concentration_void = 26.837
solid_energy_model = DILUTE
defect_charge = -3
solid_relative_permittivity = 30
[]
[density_chi_o]
type = ElectrochemicalDefectMaterial
chemical_potential = wvo
void_op = phi
Temperature = T
electric_potential = V
void_density_name = nv_an
solid_density_name = ns_an
chi_name = chi_an
void_energy_coefficient = kv_an
min_vacancy_concentration_solid = ns_o_min
min_vacancy_concentration_void = 40.256
solid_energy_model = DILUTE
defect_charge = 2
solid_relative_permittivity = 30
[]
[permittivity]
type = DerivativeParsedMaterial
property_name = permittivity
coupled_variables = 'phi'
material_property_names = 'hs hv'
constant_names = 'eps_rel_solid eps_void_over_e'
constant_expressions = '30 5.52e-2' #eps_void_over_e in 1/V/nm
derivative_order = 2
expression = '-hs * eps_rel_solid * eps_void_over_e - hv * eps_void_over_e'
[]
[void_pre]
type = DerivativeParsedMaterial
property_name = void_pre
material_property_names = 'hv'
constant_names = 'Z_cat Z_an nv_y_min nv_o_min'
constant_expressions = '-3 2 26.837 40.256'
derivative_order = 2
expression = '-hv * (Z_cat * nv_y_min + Z_an * nv_o_min)'
[]
[cat_mu_pre]
type = DerivativeParsedMaterial
property_name = cat_mu_pre
material_property_names = 'hv kv_cat'
constant_names = 'Z_cat'
constant_expressions = '-3'
derivative_order = 2
expression = '-hv * Z_cat / kv_cat'
[]
[an_mu_pre]
type = DerivativeParsedMaterial
property_name = an_mu_pre
material_property_names = 'hv kv_an'
constant_names = 'Z_an'
constant_expressions = '2'
derivative_order = 2
expression = '-hv * Z_an / kv_an'
[]
[cat_V_pre]
type = DerivativeParsedMaterial
property_name = cat_V_pre
material_property_names = 'hv kv_cat'
constant_names = 'Z_cat v_scale e '
constant_expressions = '-3 1 1'
derivative_order = 2
expression = 'hv * Z_cat^2 * e * v_scale / kv_cat'
[]
[an_V_pre]
type = DerivativeParsedMaterial
property_name = an_V_pre
material_property_names = 'hv kv_an'
constant_names = 'Z_an v_scale e '
constant_expressions = '2 1 1'
derivative_order = 2
expression = 'hv * Z_an^2 * e * v_scale / kv_an'
[]
[]
#This action adds most kernels needed for grand potential model
[Modules]
[PhaseField]
[GrandPotential]
switching_function_names = 'hv hs'
anisotropic = 'true true'
chemical_potentials = 'wvy wvo'
mobilities = 'chiDy chiDo'
susceptibilities = 'chi_cat chi_an'
free_energies_w = 'nv_cat ns_cat nv_an ns_an'
gamma_gr = gamma
mobility_name_gr = L
kappa_gr = kappa
free_energies_gr = 'omegav omegas'
additional_ops = 'phi'
gamma_grxop = gamma
mobility_name_op = Lv
kappa_op = kappa
free_energies_op = 'omegav omegas'
[]
[]
[]
[Kernels]
[barrier_phi]
type = ACBarrierFunction
variable = phi
v = 'gr0 gr1'
gamma = gamma
mob_name = Lv
[]
[kappa_phi]
type = ACKappaFunction
variable = phi
mob_name = Lv
kappa_name = kappa
[]
[Laplace]
type = MatDiffusion
variable = V
diffusivity = permittivity
args = 'phi'
[]
[potential_void_constants]
type = MaskedBodyForce
variable = V
coupled_variables = 'phi'
mask = void_pre
[]
[potential_cat_mu]
type = MatReaction
variable = V
v = wvy
mob_name = cat_mu_pre
[]
[potential_an_mu]
type = MatReaction
variable = V
v = wvo
mob_name = an_mu_pre
[]
[potential_cat_V]
type = MatReaction
variable = V
mob_name = cat_V_pre
[]
[potential_an_V]
type = MatReaction
variable = V
mob_name = an_V_pre
[]
[potential_solid_cat]
type = MaskedExponential
variable = V
w = wvy
T = T
coupled_variables = 'phi gr0 gr1'
mask = hs
species_charge = -3
n_eq = ns_y_min
[]
[potential_solid_an]
type = MaskedExponential
variable = V
w = wvo
T = T
coupled_variables = 'phi gr0 gr1'
mask = hs
species_charge = 2
n_eq = ns_o_min
[]
[]
[AuxKernels]
[bnds_aux]
type = BndsCalcAux
variable = bnds
execute_on = 'initial timestep_end'
[]
[negative_V]
type = ParsedAux
variable = negative_V
coupled_variables = V
expression = '-V'
[]
[E_x]
type = VariableGradientComponent
variable = E_x
gradient_variable = negative_V
component = x
[]
[E_y]
type = VariableGradientComponent
variable = E_y
gradient_variable = negative_V
component = y
[]
[ns_cat_aux]
type = MaterialRealAux
variable = ns_cat_aux
property = ns_cat
[]
[ns_an_aux]
type = MaterialRealAux
variable = ns_an_aux
property = ns_an
[]
[]
[Postprocessors]
[ns_cat_total]
type = ElementIntegralMaterialProperty
mat_prop = ns_cat
[]
[ns_an_total]
type = ElementIntegralMaterialProperty
mat_prop = ns_an
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = PJFNK
petsc_options_iname = '-pc_type -sub_pc_type -pc_asm_overlap -ksp_gmres_restart -sub_ksp_type'
petsc_options_value = ' asm lu 1 31 preonly'
nl_max_its = 40
l_max_its = 30
l_tol = 1e-4
nl_rel_tol = 1e-8
nl_abs_tol = 1e-13
start_time = 0
num_steps = 2
automatic_scaling = true
[TimeStepper]
type = IterationAdaptiveDT
dt = 1
optimal_iterations = 8
iteration_window = 2
[]
[]
[Outputs]
exodus = true
[]
(modules/combined/examples/geochem-porous_flow/geotes_2D/exchanger.i)
# Model of the heat-exchanger
# The input fluid to the heat exchanger is determined by AuxVariables called production_temperature, production_rate_Na, production_rate_Cl, production_rate_SiO2 and production_rate_H2O. These come from Postprocessors in the porous-flow simulation that measure the fluid composition at the production well.
# Given the input fluid, the exchanger cools/heats the fluid, removing any precipitates, and injects fluid back to the porous-flow simulation at temperature output_temperature and composition given by massfrac_Na, etc.
# In the absence of data concerning Quartz precipitation rates in heat exchangers, do not treat Quartz as kinetic
[GlobalParams]
point = '0 0 0'
reactor = reactor
[]
[TimeDependentReactionSolver]
model_definition = definition
include_moose_solve = false
geochemistry_reactor_name = reactor
charge_balance_species = "Cl-"
swap_out_of_basis = "SiO2(aq)"
swap_into_basis = "QuartzLike"
constraint_species = "H2O Na+ Cl- QuartzLike"
constraint_value = " 1.0E-2 0.1E-2 0.1E-2 1E-10"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition free_mineral"
constraint_unit = " kg moles moles moles"
initial_temperature = 50.0
mode = 4
temperature = 200
cold_temperature = 40.0
source_species_names = 'H2O Na+ Cl- SiO2(aq)'
source_species_rates = 'production_rate_H2O production_rate_Na production_rate_Cl production_rate_SiO2'
ramp_max_ionic_strength_initial = 0 # max_ionic_strength in such a simple problem does not need ramping
add_aux_pH = false # there is no H+ in this system
evaluate_kinetic_rates_always = true # implicit time-marching used for stability
execute_console_output_on = '' # only CSV output used in this example
[]
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "small_database.json"
basis_species = "H2O SiO2(aq) Na+ Cl-"
equilibrium_minerals = "QuartzLike"
[]
[]
[Executioner]
type = Transient
dt = 1E5
end_time = 2E6 #7.76E6 # 90 days
[]
[AuxVariables]
[production_temperature]
initial_condition = 50 # the production_T Transfer lags one timestep behind for some reason, so give this a reasonable initial condition
[]
[transported_H2O]
[]
[transported_Na]
[]
[transported_Cl]
[]
[transported_SiO2]
[]
[transported_mass]
[]
[massfrac_H2O]
[]
[massfrac_Na]
[]
[massfrac_Cl]
[]
[massfrac_SiO2]
[]
[dumped_quartz]
[]
[production_rate_H2O]
initial_condition = 5.518533e+01 # the production_H2O Transfer lags one timestep behind for some reason (when the porous_flow simulation has finished, it correctly computes mole_rate_H2O_produced, but the Transfer gets the mole_rate_H2O_produced from the previous timestep), so give this a reasonable initial condition, otherwise this will be zero at the start of the simulation!
[]
[production_rate_Na]
initial_condition = 9.943302e-02
[]
[production_rate_Cl]
initial_condition = 9.943302e-02
[]
[production_rate_SiO2]
initial_condition = 2.340931e-04
[]
[]
[AuxKernels]
[transported_H2O_auxk]
type = GeochemistryQuantityAux
variable = transported_H2O
species = H2O
quantity = transported_moles_in_original_basis
[]
[transported_Na]
type = GeochemistryQuantityAux
variable = transported_Na
species = Na+
quantity = transported_moles_in_original_basis
[]
[transported_Cl]
type = GeochemistryQuantityAux
variable = transported_Cl
species = Cl-
quantity = transported_moles_in_original_basis
[]
[transported_SiO2]
type = GeochemistryQuantityAux
variable = transported_SiO2
species = 'SiO2(aq)'
quantity = transported_moles_in_original_basis
[]
[transported_mass_auxk]
type = ParsedAux
coupled_variables = 'transported_H2O transported_Na transported_Cl transported_SiO2'
variable = transported_mass
expression = 'transported_H2O * 18.0152 + transported_Na * 22.9898 + transported_Cl * 35.453 + transported_SiO2 * 60.0843'
[]
[massfrac_H2O]
type = ParsedAux
coupled_variables = 'transported_mass transported_H2O'
variable = massfrac_H2O
expression = '18.0152 * transported_H2O / transported_mass'
[]
[massfrac_Na]
type = ParsedAux
coupled_variables = 'transported_mass transported_Na'
variable = massfrac_Na
expression = '22.9898 * transported_Na / transported_mass'
[]
[massfrac_Cl]
type = ParsedAux
coupled_variables = 'transported_mass transported_Cl'
variable = massfrac_Cl
expression = '35.453 * transported_Cl / transported_mass'
[]
[massfrac_SiO2]
type = ParsedAux
coupled_variables = 'transported_mass transported_SiO2'
variable = massfrac_SiO2
expression = '60.0843 * transported_SiO2 / transported_mass'
[]
[dumped_quartz]
type = GeochemistryQuantityAux
variable = dumped_quartz
species = QuartzLike
quantity = moles_dumped
[]
[]
[Postprocessors]
[cumulative_moles_precipitated_quartz]
type = PointValue
variable = dumped_quartz
[]
[production_temperature]
type = PointValue
variable = production_temperature
[]
[mass_heated_this_timestep]
type = PointValue
variable = transported_mass
[]
[]
[Outputs]
csv = true
[]
[MultiApps]
[porous_flow_sim]
type = TransientMultiApp
input_files = porous_flow.i
execute_on = 'timestep_end'
[]
[]
[Transfers]
[injection_T]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'solution_temperature'
variable = 'injection_temperature'
[]
[injection_Na]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Na'
variable = 'injection_rate_massfrac_Na'
[]
[injection_Cl]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Cl'
variable = 'injection_rate_massfrac_Cl'
[]
[injection_SiO2]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_SiO2'
variable = 'injection_rate_massfrac_SiO2'
[]
[injection_H2O]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_H2O'
variable = 'injection_rate_massfrac_H2O'
[]
[production_T]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = production_temperature
variable = production_temperature
[]
[production_Na]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Na_produced
variable = production_rate_Na
[]
[production_Cl]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Cl_produced
variable = production_rate_Cl
[]
[production_SiO2]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_SiO2_produced
variable = production_rate_SiO2
[]
[production_H2O]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_H2O_produced
variable = production_rate_H2O
[]
[]
(test/tests/auxkernels/linear_combination/test.i)
# All tested logic is in the aux system
# The non-linear problem is unrelated
[Mesh]
type = GeneratedMesh
dim = 1
xmin = -1
xmax = 1
nx = 10
[]
[Functions]
[./v1_func]
type = ParsedFunction
expression = (1-x)/2
[../]
[./v2_func]
type = ParsedFunction
expression = (1+x)/2
[../]
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./lc]
[../]
[./v1]
[../]
[./v2]
[../]
[./w1]
[../]
[./w2]
[../]
[]
[ICs]
[./v1_ic]
type = FunctionIC
variable = v1
function = v1_func
[../]
[./v2_ic]
type = FunctionIC
variable = v2
function = v2_func
[../]
[./w1_ic]
type = ConstantIC
variable = w1
value = 0.3
[../]
[./w2_ic]
type = ConstantIC
variable = w2
value = 0.5
[../]
[]
[AuxKernels]
[./lc-aux]
type = ParsedAux
variable = lc
expression = 'v1*w1+v2*w2'
coupled_variables = 'v1 w1 v2 w2'
execute_on = 'timestep_end'
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 1
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 2
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
[./out]
type = Exodus
[../]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/boussinesq/wcnsfv.i)
mu = 1
rho = 'rho'
k = 1
cp = 1
alpha = 1
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# rayleigh=1e3
cold_temp=300
hot_temp=310
[GlobalParams]
two_term_boundary_expansion = true
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = 0
ymax = 10
nx = 64
ny = 64
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = 1e5
[]
[T]
type = INSFVEnergyVariable
scaling = 1e-4
initial_condition = ${cold_temp}
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[AuxVariables]
[U]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[vel_x]
order = FIRST
family = MONOMIAL
[]
[vel_y]
order = FIRST
family = MONOMIAL
[]
[viz_T]
order = FIRST
family = MONOMIAL
[]
[rho_out]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[mag]
type = VectorMagnitudeAux
variable = U
x = u
y = v
execute_on = 'initial timestep_end'
[]
[vel_x]
type = ParsedAux
variable = vel_x
expression = 'u'
execute_on = 'initial timestep_end'
coupled_variables = 'u'
[]
[vel_y]
type = ParsedAux
variable = vel_y
expression = 'v'
execute_on = 'initial timestep_end'
coupled_variables = 'v'
[]
[viz_T]
type = ParsedAux
variable = viz_T
expression = 'T'
execute_on = 'initial timestep_end'
coupled_variables = 'T'
[]
[rho_out]
type = FunctorAux
functor = 'rho'
variable = 'rho_out'
execute_on = 'initial timestep_end'
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[mean_zero_pressure]
type = FVIntegralValueConstraint
variable = pressure
lambda = lambda
phi0 = 1e5
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[u_gravity]
type = INSFVMomentumGravity
variable = u
gravity = '0 -1 0'
rho = ${rho}
momentum_component = 'x'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[v_gravity]
type = INSFVMomentumGravity
variable = v
gravity = '0 -1 0'
rho = ${rho}
momentum_component = 'y'
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[]
[FVBCs]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = u
boundary = 'left right top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = v
boundary = 'left right top bottom'
function = 0
[]
[T_hot]
type = FVDirichletBC
variable = T
boundary = left
value = ${hot_temp}
[]
[T_cold]
type = FVDirichletBC
variable = T
boundary = right
value = ${cold_temp}
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[Materials]
[const]
type = ADGenericConstantMaterial
prop_names = 'alpha'
prop_values = '${alpha}'
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T'
rho = ${rho}
[]
[]
[Functions]
[lid_function]
type = ParsedFunction
expression = '4*x*(1-x)'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[]
[Outputs]
exodus = true
[]
(modules/combined/examples/geochem-porous_flow/geotes_weber_tensleep/eqm_model_25_to_92degC.i)
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "../../../../geochemistry/database/moose_geochemdb.json"
basis_species = "H2O H+ Cl- SO4-- HCO3- SiO2(aq) Al+++ Ca++ Mg++ Fe++ K+ Na+ Sr++ F- B(OH)3 Br- Ba++ Li+ NO3- O2(aq)"
equilibrium_minerals = "Siderite Pyrrhotite Dolomite Illite Anhydrite Calcite Quartz K-feldspar Kaolinite Barite Celestite Fluorite Albite Chalcedony Goethite"
[]
[]
[TimeDependentReactionSolver]
model_definition = definition
geochemistry_reactor_name = reactor
swap_out_of_basis = "NO3- O2(aq)"
swap_into_basis = " NH3 HS-"
charge_balance_species = "Cl-"
constraint_species = "H2O H+ Cl- SO4-- HCO3- HS- SiO2(aq) Al+++ Ca++ Mg++ Fe++ K+ Na+ Sr++ F- B(OH)3 Br- Ba++ Li+ NH3"
constraint_value = " 1.0 0.019675774 1.619044933 0.062774835 0.065489838 0.003840583 0.001597755 0.000129719 0.013448104 0.001851471 0.000787867 0.048851229 1.587660615 0.000159781 0.00032108 0.006663119 0.001238987 0.000101944 0.013110503 0.001937302"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition"
constraint_unit = "kg moles moles moles moles moles moles moles moles moles moles moles moles moles moles moles moles moles moles moles"
prevent_precipitation = "Celestite Fluorite Albite Chalcedony Goethite"
ramp_max_ionic_strength_initial = 0 # not needed in this simple problem
initial_temperature = 25
temperature = 95 # so final temp = 92
execute_console_output_on = 'initial timestep_end'
source_species_names = "Siderite Pyrrhotite Dolomite Illite Anhydrite Calcite Quartz K-feldspar Kaolinite Barite"
source_species_rates = "6.287111422 0.510783201 2.796550921 0.647761624 1.175446234 12.1838956 322.504833 6.613392119 5.96865E-05 8.46449E-05"
solver_info = true
stoichiometric_ionic_str_using_Cl_only = true
[]
[Executioner]
type = Transient
dt = 1
end_time = 1
[]
[AuxVariables]
[total_mineral_volume]
[]
[free_cm3_Kfeldspar] # necessary because of the minus sign in K-feldspar which does not parse correctly in the total_mineral_volume AuxKernel
[]
[]
[AuxKernels]
[free_cm3_Kfeldspar]
type = GeochemistryQuantityAux
reactor = reactor
variable = free_cm3_Kfeldspar
species = 'K-feldspar'
quantity = free_cm3
execute_on = 'timestep_begin timestep_end'
[]
[total_mineral_volume_auxk]
type = ParsedAux
coupled_variables = 'free_cm3_Siderite free_cm3_Pyrrhotite free_cm3_Dolomite free_cm3_Illite free_cm3_Anhydrite free_cm3_Calcite free_cm3_Quartz free_cm3_Kfeldspar free_cm3_Kaolinite free_cm3_Barite free_cm3_Celestite free_cm3_Fluorite free_cm3_Albite free_cm3_Chalcedony free_cm3_Goethite'
expression = 'free_cm3_Siderite + free_cm3_Pyrrhotite + free_cm3_Dolomite + free_cm3_Illite + free_cm3_Anhydrite + free_cm3_Calcite + free_cm3_Quartz + free_cm3_Kfeldspar + free_cm3_Kaolinite + free_cm3_Barite + free_cm3_Celestite + free_cm3_Fluorite + free_cm3_Albite + free_cm3_Chalcedony + free_cm3_Goethite'
variable = total_mineral_volume
execute_on = 'timestep_begin timestep_end'
[]
[]
[Postprocessors]
[total_mineral_volume]
type = PointValue
point = '0 0 0'
variable = total_mineral_volume
[]
[]
[Outputs]
csv = true
[]
(modules/combined/examples/geochem-porous_flow/geotes_2D/exchanger_un_quartz.i)
# Model of the heat-exchanger
# The input fluid to the heat exchanger is determined by AuxVariables called production_temperature, production_rate_Na, production_rate_Cl, production_rate_SiO2 and production_rate_H2O. These come from Postprocessors in the porous-flow simulation that measure the fluid composition at the production well.
# Given the input fluid, the exchanger cools/heats the fluid, removing any precipitates, and injects fluid back to the porous-flow simulation at temperature output_temperature and composition given by massfrac_Na, etc.
# In the absence of data concerning Quartz precipitation rates in heat exchangers, do not treat Quartz as kinetic
[GlobalParams]
point = '0 0 0'
reactor = reactor
[]
[TimeDependentReactionSolver]
model_definition = definition
include_moose_solve = false
geochemistry_reactor_name = reactor
charge_balance_species = "Cl-"
swap_out_of_basis = "SiO2(aq)"
swap_into_basis = "QuartzUnlike"
constraint_species = "H2O Na+ Cl- QuartzUnlike"
constraint_value = " 1.0E-2 0.1E-2 0.1E-2 1E-10"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition free_mineral"
constraint_unit = " kg moles moles moles"
initial_temperature = 50.0
mode = 4
temperature = 200
cold_temperature = 40.0
source_species_names = 'H2O Na+ Cl- SiO2(aq)'
source_species_rates = 'production_rate_H2O production_rate_Na production_rate_Cl production_rate_SiO2'
ramp_max_ionic_strength_initial = 0 # max_ionic_strength in such a simple problem does not need ramping
add_aux_pH = false # there is no H+ in this system
evaluate_kinetic_rates_always = true # implicit time-marching used for stability
execute_console_output_on = '' # only CSV output used in this example
[]
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "small_database.json"
basis_species = "H2O SiO2(aq) Na+ Cl-"
equilibrium_minerals = "QuartzUnlike"
[]
[]
[Executioner]
type = Transient
dt = 1E5
end_time = 2E6 #7.76E6 # 90 days
[]
[AuxVariables]
[production_temperature]
initial_condition = 50 # the production_T Transfer lags one timestep behind for some reason, so give this a reasonable initial condition
[]
[transported_H2O]
[]
[transported_Na]
[]
[transported_Cl]
[]
[transported_SiO2]
[]
[transported_mass]
[]
[massfrac_H2O]
[]
[massfrac_Na]
[]
[massfrac_Cl]
[]
[massfrac_SiO2]
[]
[dumped_quartz]
[]
[production_rate_H2O]
initial_condition = 5.518533e+01 # the production_H2O Transfer lags one timestep behind for some reason (when the porous_flow simulation has finished, it correctly computes mole_rate_H2O_produced, but the Transfer gets the mole_rate_H2O_produced from the previous timestep), so give this a reasonable initial condition, otherwise this will be zero at the start of the simulation!
[]
[production_rate_Na]
initial_condition = 9.943302e-02
[]
[production_rate_Cl]
initial_condition = 9.943302e-02
[]
[production_rate_SiO2]
initial_condition = 2.340931e-04
[]
[]
[AuxKernels]
[transported_H2O]
type = GeochemistryQuantityAux
variable = transported_H2O
species = H2O
quantity = transported_moles_in_original_basis
[]
[transported_Na]
type = GeochemistryQuantityAux
variable = transported_Na
species = Na+
quantity = transported_moles_in_original_basis
[]
[transported_Cl]
type = GeochemistryQuantityAux
variable = transported_Cl
species = Cl-
quantity = transported_moles_in_original_basis
[]
[transported_SiO2]
type = GeochemistryQuantityAux
variable = transported_SiO2
species = 'SiO2(aq)'
quantity = transported_moles_in_original_basis
[]
[transported_mass]
type = ParsedAux
coupled_variables = 'transported_H2O transported_Na transported_Cl transported_SiO2'
variable = transported_mass
expression = 'transported_H2O * 18.0152 + transported_Na * 22.9898 + transported_Cl * 35.453 + transported_SiO2 * 60.0843'
[]
[massfrac_H2O]
type = ParsedAux
coupled_variables = 'transported_mass transported_H2O'
variable = massfrac_H2O
expression = '18.0152 * transported_H2O / transported_mass'
[]
[massfrac_Na]
type = ParsedAux
coupled_variables = 'transported_mass transported_Na'
variable = massfrac_Na
expression = '22.9898 * transported_Na / transported_mass'
[]
[massfrac_Cl]
type = ParsedAux
coupled_variables = 'transported_mass transported_Cl'
variable = massfrac_Cl
expression = '35.453 * transported_Cl / transported_mass'
[]
[massfrac_SiO2]
type = ParsedAux
coupled_variables = 'transported_mass transported_SiO2'
variable = massfrac_SiO2
expression = '60.0843 * transported_SiO2 / transported_mass'
[]
[dumped_quartz]
type = GeochemistryQuantityAux
variable = dumped_quartz
species = QuartzUnlike
quantity = moles_dumped
[]
[]
[Postprocessors]
[cumulative_moles_precipitated_quartz]
type = PointValue
variable = dumped_quartz
[]
[production_temperature]
type = PointValue
variable = production_temperature
[]
[mass_heated_this_timestep]
type = PointValue
variable = transported_mass
[]
[]
[Outputs]
csv = true
[]
[MultiApps]
[porous_flow_sim]
type = TransientMultiApp
input_files = porous_flow.i
cli_args = 'MultiApps/react/input_files=aquifer_un_quartz_geochemistry.i'
execute_on = 'timestep_end'
[]
[]
[Transfers]
[injection_T]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'solution_temperature'
variable = 'injection_temperature'
[]
[injection_Na]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Na'
variable = 'injection_rate_massfrac_Na'
[]
[injection_Cl]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Cl'
variable = 'injection_rate_massfrac_Cl'
[]
[injection_SiO2]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_SiO2'
variable = 'injection_rate_massfrac_SiO2'
[]
[injection_H2O]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_H2O'
variable = 'injection_rate_massfrac_H2O'
[]
[production_T]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = production_temperature
variable = production_temperature
[]
[production_Na]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Na_produced
variable = production_rate_Na
[]
[production_Cl]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Cl_produced
variable = production_rate_Cl
[]
[production_SiO2]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_SiO2_produced
variable = production_rate_SiO2
[]
[production_H2O]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_H2O_produced
variable = production_rate_H2O
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/boussinesq/transient-wcnsfv.i)
mu = 1
rho = 'rho'
k = 1
cp = 1
l = 10
velocity_interp_method = 'rc'
advected_interp_method = 'average'
cold_temp=300
hot_temp=310
[GlobalParams]
two_term_boundary_expansion = true
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = ${l}
nx = 16
ny = 16
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = 1e5
[]
[T]
type = INSFVEnergyVariable
scaling = 1e-4
initial_condition = ${cold_temp}
[]
[]
[AuxVariables]
[U]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[vel_x]
order = FIRST
family = MONOMIAL
[]
[vel_y]
order = FIRST
family = MONOMIAL
[]
[viz_T]
order = FIRST
family = MONOMIAL
[]
[]
[AuxKernels]
[mag]
type = VectorMagnitudeAux
variable = U
x = u
y = v
execute_on = 'initial timestep_end'
[]
[vel_x]
type = ParsedAux
variable = vel_x
expression = 'u'
execute_on = 'initial timestep_end'
coupled_variables = 'u'
[]
[vel_y]
type = ParsedAux
variable = vel_y
expression = 'v'
execute_on = 'initial timestep_end'
coupled_variables = 'v'
[]
[viz_T]
type = ParsedAux
variable = viz_T
expression = 'T'
execute_on = 'initial timestep_end'
coupled_variables = 'T'
[]
[]
[FVKernels]
[mass_time]
type = WCNSFVMassTimeDerivative
variable = pressure
drho_dt = drho_dt
[]
[mass]
type = WCNSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = u
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[u_gravity]
type = INSFVMomentumGravity
variable = u
gravity = '0 -1 0'
rho = ${rho}
momentum_component = 'x'
[]
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = v
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[v_gravity]
type = INSFVMomentumGravity
variable = v
gravity = '0 -1 0'
rho = ${rho}
momentum_component = 'y'
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[]
[FVBCs]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = u
boundary = 'left right top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = v
boundary = 'left right top bottom'
function = 0
[]
[T_hot]
type = FVDirichletBC
variable = T
boundary = left
value = ${hot_temp}
[]
[T_cold]
type = FVDirichletBC
variable = T
boundary = right
value = ${cold_temp}
[]
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T'
rho = ${rho}
[]
[]
[Functions]
[lid_function]
type = ParsedFunction
expression = '4*x*(1-x)'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
steady_state_detection = true
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-5
optimal_iterations = 6
[]
nl_abs_tol = 1e-9
normalize_solution_diff_norm_by_dt = false
nl_max_its = 10
[]
[Outputs]
[out]
type = Exodus
[]
[]
(modules/combined/examples/geochem-porous_flow/forge/aquifer_geochemistry.i)
# Simulates geochemistry in the aquifer. This input file may be run in standalone fashion, which will study the natural kinetically-controlled mineral changes in the same way as natural_reservoir.i. To simulate the FORGE injection scenario, run the porous_flow.i simulation which couples to this input file using MultiApps.
# This file receives 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 and temperature as AuxVariables from porous_flow.i
# The pf_rate quantities are kg/s changes of fluid-component mass at each node, but the geochemistry module expects rates-of-changes of moles at every node. Secondly, since this input file considers just 1 litre of aqueous solution at every node, the nodal_void_volume is used to convert pf_rate_* into rate_*_per_1l, which is measured in mol/s/1_litre_of_aqueous_solution.
# This file sends massfrac_H massfrac_Na massfrac_K massfrac_Ca massfrac_Mg massfrac_SiO2 massfrac_Al massfrac_Cl massfrac_SO4 massfrac_HCO3 to porous_flow.i. These are computed from the corresponding transported_* quantities.
# The results depend on the kinetic rates used and these are recognised to be poorly constrained by experiment
[UserObjects]
[rate_Albite]
type = GeochemistryKineticRate
kinetic_species_name = Albite
intrinsic_rate_constant = 1E-17
multiply_by_mass = true
area_quantity = 10
activation_energy = 69.8E3
one_over_T0 = 0.003354
[]
[rate_Anhydrite]
type = GeochemistryKineticRate
kinetic_species_name = Anhydrite
intrinsic_rate_constant = 1.0E-7
multiply_by_mass = true
area_quantity = 10
activation_energy = 14.3E3
one_over_T0 = 0.003354
[]
[rate_Anorthite]
type = GeochemistryKineticRate
kinetic_species_name = Anorthite
intrinsic_rate_constant = 1.0E-13
multiply_by_mass = true
area_quantity = 10
activation_energy = 17.8E3
one_over_T0 = 0.003354
[]
[rate_Calcite]
type = GeochemistryKineticRate
kinetic_species_name = Calcite
intrinsic_rate_constant = 1.0E-10
multiply_by_mass = true
area_quantity = 10
activation_energy = 23.5E3
one_over_T0 = 0.003354
[]
[rate_Chalcedony]
type = GeochemistryKineticRate
kinetic_species_name = Chalcedony
intrinsic_rate_constant = 1.0E-18
multiply_by_mass = true
area_quantity = 10
activation_energy = 90.1E3
one_over_T0 = 0.003354
[]
[rate_Clinochl-7A]
type = GeochemistryKineticRate
kinetic_species_name = Clinochl-7A
intrinsic_rate_constant = 1.0E-17
multiply_by_mass = true
area_quantity = 10
activation_energy = 88.0E3
one_over_T0 = 0.003354
[]
[rate_Illite]
type = GeochemistryKineticRate
kinetic_species_name = Illite
intrinsic_rate_constant = 1E-17
multiply_by_mass = true
area_quantity = 10
activation_energy = 29E3
one_over_T0 = 0.003354
[]
[rate_K-feldspar]
type = GeochemistryKineticRate
kinetic_species_name = K-feldspar
intrinsic_rate_constant = 1E-17
multiply_by_mass = true
area_quantity = 10
activation_energy = 38E3
one_over_T0 = 0.003354
[]
[rate_Kaolinite]
type = GeochemistryKineticRate
kinetic_species_name = Kaolinite
intrinsic_rate_constant = 1E-18
multiply_by_mass = true
area_quantity = 10
activation_energy = 22.2E3
one_over_T0 = 0.003354
[]
[rate_Quartz]
type = GeochemistryKineticRate
kinetic_species_name = Quartz
intrinsic_rate_constant = 1E-18
multiply_by_mass = true
area_quantity = 10
activation_energy = 90.1E3
one_over_T0 = 0.003354
[]
[rate_Paragonite]
type = GeochemistryKineticRate
kinetic_species_name = Paragonite
intrinsic_rate_constant = 1E-17
multiply_by_mass = true
area_quantity = 10
activation_energy = 22E3
one_over_T0 = 0.003354
[]
[rate_Phlogopite]
type = GeochemistryKineticRate
kinetic_species_name = Phlogopite
intrinsic_rate_constant = 1E-17
multiply_by_mass = true
area_quantity = 10
activation_energy = 22E3
one_over_T0 = 0.003354
[]
[rate_Laumontite]
type = GeochemistryKineticRate
kinetic_species_name = Laumontite
intrinsic_rate_constant = 1.0E-15
multiply_by_mass = true
area_quantity = 10
activation_energy = 17.8E3
one_over_T0 = 0.003354
[]
[rate_Zoisite]
type = GeochemistryKineticRate
kinetic_species_name = Zoisite
intrinsic_rate_constant = 1E-16
multiply_by_mass = true
area_quantity = 10
activation_energy = 66.1E3
one_over_T0 = 0.003354
[]
[definition]
type = GeochemicalModelDefinition
database_file = '../../../../geochemistry/database/moose_geochemdb.json'
basis_species = 'H2O H+ Na+ K+ Ca++ Mg++ SiO2(aq) Al+++ Cl- SO4-- HCO3-'
remove_all_extrapolated_secondary_species = true
kinetic_minerals = 'Albite Anhydrite Anorthite Calcite Chalcedony Clinochl-7A Illite K-feldspar Kaolinite Quartz Paragonite Phlogopite Zoisite Laumontite'
kinetic_rate_descriptions = 'rate_Albite rate_Anhydrite rate_Anorthite rate_Calcite rate_Chalcedony rate_Clinochl-7A rate_Illite rate_K-feldspar rate_Kaolinite rate_Quartz rate_Paragonite rate_Phlogopite rate_Zoisite rate_Laumontite'
[]
[nodal_void_volume_uo]
type = NodalVoidVolume
porosity = porosity
execute_on = 'initial timestep_end' # "initial" means this is evaluated properly for the first timestep
[]
[]
[SpatialReactionSolver]
model_definition = definition
geochemistry_reactor_name = reactor
charge_balance_species = 'Cl-'
constraint_species = 'H2O H+ Na+ K+ Ca++ Mg++ SiO2(aq) Al+++ Cl- SO4-- HCO3-'
# Following numbers are from water_60_to_220degC_out.csv
constraint_value = ' 1.0006383866109 9.5165072498215e-07 0.100020379171 0.0059389061065 0.011570884507621 4.6626763057447e-06 0.0045110404925255 5.8096968688789e-17 0.13500708594394 6.6523540147676e-05 7.7361407898089e-05'
constraint_meaning = 'kg_solvent_water free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration bulk_composition free_concentration free_concentration'
constraint_unit = ' kg molal molal molal molal molal molal molal moles molal molal'
initial_temperature = 220
temperature = temperature
kinetic_species_name = ' Albite Anorthite K-feldspar Quartz Phlogopite Paragonite Calcite Anhydrite Chalcedony Illite Kaolinite Clinochl-7A Zoisite Laumontite'
kinetic_species_initial_value = '4.324073236492E+02 4.631370307325E+01 2.685015418378E+02 7.720095013956E+02 1.235192062541E+01 7.545461404965E-01 4.234651808835E-04 4.000485907930E-04 4.407616361072E+00 1.342524904876E+01 1.004823151125E+00 4.728132387707E-01 7.326007326007E-01 4.818116116598E-01'
kinetic_species_unit = ' moles moles moles moles moles moles moles moles moles moles moles moles moles moles'
evaluate_kinetic_rates_always = true # otherwise will easily "run out" of dissolving species
source_species_names = 'H2O H+ Na+ K+ Ca++ Mg++ SiO2(aq) Al+++ Cl- SO4-- HCO3-'
source_species_rates = 'rate_H2O_per_1l rate_H_per_1l rate_Na_per_1l rate_K_per_1l rate_Ca_per_1l rate_Mg_per_1l rate_SiO2_per_1l rate_Al_per_1l rate_Cl_per_1l rate_SO4_per_1l rate_HCO3_per_1l'
ramp_max_ionic_strength_initial = 0 # max_ionic_strength in such a simple problem does not need ramping
execute_console_output_on = ''
add_aux_molal = false # save some memory and reduce variables in output exodus
add_aux_mg_per_kg = false # save some memory and reduce variables in output exodus
add_aux_free_mg = false # save some memory and reduce variables in output exodus
add_aux_activity = false # save some memory and reduce variables in output exodus
add_aux_bulk_moles = false # save some memory and reduce variables in output exodus
adaptive_timestepping = true
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 15
ny = 10
xmin = -100
xmax = 200
ymin = -100
ymax = 100
[]
[injection_node]
input = gen
type = ExtraNodesetGenerator
new_boundary = injection_node
coord = '0 0 0'
[]
[]
[Executioner]
type = Transient
[TimeStepper]
type = FunctionDT
function = 'max(1E6, 0.3 * t)'
[]
end_time = 4E12
[]
[AuxVariables]
[temperature]
initial_condition = 220.0
[]
[porosity]
initial_condition = 0.01
[]
[nodal_void_volume]
[]
[free_cm3_Kfeldspar] # necessary because of the minus sign in K-feldspar which does not parse correctly in the porosity AuxKernel
[]
[free_cm3_Clinochl7A] # necessary because of the minus sign in Clinochl-7A which does not parse correctly in the porosity AuxKernel
[]
[pf_rate_H] # change in H mass (kg/s) at each node provided by the porous-flow simulation
[]
[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] # change in H2O mass (kg/s) at each node provided by the porous-flow simulation
[]
[rate_H_per_1l]
[]
[rate_Na_per_1l]
[]
[rate_K_per_1l]
[]
[rate_Ca_per_1l]
[]
[rate_Mg_per_1l]
[]
[rate_SiO2_per_1l]
[]
[rate_Al_per_1l]
[]
[rate_Cl_per_1l]
[]
[rate_SO4_per_1l]
[]
[rate_HCO3_per_1l]
[]
[rate_H2O_per_1l]
[]
[transported_H]
[]
[transported_Na]
[]
[transported_K]
[]
[transported_Ca]
[]
[transported_Mg]
[]
[transported_SiO2]
[]
[transported_Al]
[]
[transported_Cl]
[]
[transported_SO4]
[]
[transported_HCO3]
[]
[transported_H2O]
[]
[transported_mass]
[]
[massfrac_H]
[]
[massfrac_Na]
[]
[massfrac_K]
[]
[massfrac_Ca]
[]
[massfrac_Mg]
[]
[massfrac_SiO2]
[]
[massfrac_Al]
[]
[massfrac_Cl]
[]
[massfrac_SO4]
[]
[massfrac_HCO3]
[]
[massfrac_H2O]
[]
[]
[AuxKernels]
[free_cm3_Kfeldspar]
type = GeochemistryQuantityAux
variable = free_cm3_Kfeldspar
species = 'K-feldspar'
quantity = free_cm3
execute_on = 'timestep_begin timestep_end'
[]
[free_cm3_Clinochl7A]
type = GeochemistryQuantityAux
variable = free_cm3_Clinochl7A
species = 'Clinochl-7A'
quantity = free_cm3
execute_on = 'timestep_begin timestep_end'
[]
[porosity_auxk]
type = ParsedAux
coupled_variables = 'free_cm3_Albite free_cm3_Anhydrite free_cm3_Anorthite free_cm3_Calcite free_cm3_Chalcedony free_cm3_Clinochl7A free_cm3_Illite free_cm3_Kfeldspar free_cm3_Kaolinite free_cm3_Quartz free_cm3_Paragonite free_cm3_Phlogopite free_cm3_Zoisite free_cm3_Laumontite'
expression = '1000.0 / (1000.0 + free_cm3_Albite + free_cm3_Anhydrite + free_cm3_Anorthite + free_cm3_Calcite + free_cm3_Chalcedony + free_cm3_Clinochl7A + free_cm3_Illite + free_cm3_Kfeldspar + free_cm3_Kaolinite + free_cm3_Quartz + free_cm3_Paragonite + free_cm3_Phlogopite + free_cm3_Zoisite + free_cm3_Laumontite)'
variable = porosity
execute_on = 'timestep_end'
[]
[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_H_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_H nodal_void_volume'
variable = rate_H_per_1l
expression = 'pf_rate_H / 1.0079 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_Na_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Na nodal_void_volume'
variable = rate_Na_per_1l
expression = 'pf_rate_Na / 22.9898 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_K_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_K nodal_void_volume'
variable = rate_K_per_1l
expression = 'pf_rate_K / 39.0983 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_Ca_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Ca nodal_void_volume'
variable = rate_Ca_per_1l
expression = 'pf_rate_Ca / 40.08 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_Mg_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Mg nodal_void_volume'
variable = rate_Mg_per_1l
expression = 'pf_rate_Mg / 24.305 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_SiO2_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_SiO2 nodal_void_volume'
variable = rate_SiO2_per_1l
expression = 'pf_rate_SiO2 / 60.0843 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_Al_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Al nodal_void_volume'
variable = rate_Al_per_1l
expression = 'pf_rate_Al / 26.9815 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_Cl_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_Cl nodal_void_volume'
variable = rate_Cl_per_1l
expression = 'pf_rate_Cl / 35.453 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_SO4_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_SO4 nodal_void_volume'
variable = rate_SO4_per_1l
expression = 'pf_rate_SO4 / 96.0576 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_HCO3_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_HCO3 nodal_void_volume'
variable = rate_HCO3_per_1l
expression = 'pf_rate_HCO3 / 61.0171 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_H2O_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_H2O nodal_void_volume'
variable = rate_H2O_per_1l
expression = 'pf_rate_H2O / 18.01801802 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[transported_H_auxk]
type = GeochemistryQuantityAux
variable = transported_H
species = 'H+'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_begin'
[]
[transported_Na_auxk]
type = GeochemistryQuantityAux
variable = transported_Na
species = 'Na+'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_begin'
[]
[transported_K_auxk]
type = GeochemistryQuantityAux
variable = transported_K
species = 'K+'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_begin'
[]
[transported_Ca_auxk]
type = GeochemistryQuantityAux
variable = transported_Ca
species = 'Ca++'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_begin'
[]
[transported_Mg_auxk]
type = GeochemistryQuantityAux
variable = transported_Mg
species = 'Mg++'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_begin'
[]
[transported_SiO2_auxk]
type = GeochemistryQuantityAux
variable = transported_SiO2
species = 'SiO2(aq)'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_begin'
[]
[transported_Al_auxk]
type = GeochemistryQuantityAux
variable = transported_Al
species = 'Al+++'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_begin'
[]
[transported_Cl_auxk]
type = GeochemistryQuantityAux
variable = transported_Cl
species = 'Cl-'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_begin'
[]
[transported_SO4_auxk]
type = GeochemistryQuantityAux
variable = transported_SO4
species = 'SO4--'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_begin'
[]
[transported_HCO3_auxk]
type = GeochemistryQuantityAux
variable = transported_HCO3
species = 'HCO3-'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_begin'
[]
[transported_H2O_auxk]
type = GeochemistryQuantityAux
variable = transported_H2O
species = 'H2O'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_begin'
[]
[transported_mass_auxk]
type = ParsedAux
coupled_variables = ' transported_H transported_Na transported_K transported_Ca transported_Mg transported_SiO2 transported_Al transported_Cl transported_SO4 transported_HCO3 transported_H2O'
variable = transported_mass
expression = 'transported_H * 1.0079 + transported_Cl * 35.453 + transported_SO4 * 96.0576 + transported_HCO3 * 61.0171 + transported_SiO2 * 60.0843 + transported_Al * 26.9815 + transported_Ca * 40.08 + transported_Mg * 24.305 + transported_K * 39.0983 + transported_Na * 22.9898 + transported_H2O * 18.01801802'
execute_on = 'timestep_end'
[]
[massfrac_H_auxk]
type = ParsedAux
coupled_variables = 'transported_H transported_mass'
variable = massfrac_H
expression = 'transported_H * 1.0079 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Na_auxk]
type = ParsedAux
coupled_variables = 'transported_Na transported_mass'
variable = massfrac_Na
expression = 'transported_Na * 22.9898 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_K_auxk]
type = ParsedAux
coupled_variables = 'transported_K transported_mass'
variable = massfrac_K
expression = 'transported_K * 39.0983 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Ca_auxk]
type = ParsedAux
coupled_variables = 'transported_Ca transported_mass'
variable = massfrac_Ca
expression = 'transported_Ca * 40.08 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Mg_auxk]
type = ParsedAux
coupled_variables = 'transported_Mg transported_mass'
variable = massfrac_Mg
expression = 'transported_Mg * 24.305 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_SiO2_auxk]
type = ParsedAux
coupled_variables = 'transported_SiO2 transported_mass'
variable = massfrac_SiO2
expression = 'transported_SiO2 * 60.0843 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Al_auxk]
type = ParsedAux
coupled_variables = 'transported_Al transported_mass'
variable = massfrac_Al
expression = 'transported_Al * 26.9815 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Cl_auxk]
type = ParsedAux
coupled_variables = 'transported_Cl transported_mass'
variable = massfrac_Cl
expression = 'transported_Cl * 35.453 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_SO4_auxk]
type = ParsedAux
coupled_variables = 'transported_SO4 transported_mass'
variable = massfrac_SO4
expression = 'transported_SO4 * 96.0576 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_HCO3_auxk]
type = ParsedAux
coupled_variables = 'transported_HCO3 transported_mass'
variable = massfrac_HCO3
expression = 'transported_HCO3 * 61.0171 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_H2O_auxk]
type = ParsedAux
coupled_variables = 'transported_H2O transported_mass'
variable = massfrac_H2O
expression = 'transported_H2O * 18.01801802 / transported_mass'
execute_on = 'timestep_end'
[]
[]
[GlobalParams]
point = '0 0 0'
reactor = reactor
[]
[Postprocessors]
[temperature]
type = PointValue
variable = 'solution_temperature'
[]
[porosity]
type = PointValue
variable = porosity
[]
[solution_temperature]
type = PointValue
variable = solution_temperature
[]
[massfrac_H]
type = PointValue
variable = massfrac_H
[]
[massfrac_Na]
type = PointValue
variable = massfrac_Na
[]
[massfrac_K]
type = PointValue
variable = massfrac_K
[]
[massfrac_Ca]
type = PointValue
variable = massfrac_Ca
[]
[massfrac_Mg]
type = PointValue
variable = massfrac_Mg
[]
[massfrac_SiO2]
type = PointValue
variable = massfrac_SiO2
[]
[massfrac_Al]
type = PointValue
variable = massfrac_Al
[]
[massfrac_Cl]
type = PointValue
variable = massfrac_Cl
[]
[massfrac_SO4]
type = PointValue
variable = massfrac_SO4
[]
[massfrac_HCO3]
type = PointValue
variable = massfrac_HCO3
[]
[massfrac_H2O]
type = PointValue
variable = massfrac_H2O
[]
[cm3_Albite]
type = PointValue
variable = 'free_cm3_Albite'
[]
[cm3_Anhydrite]
type = PointValue
variable = 'free_cm3_Anhydrite'
[]
[cm3_Anorthite]
type = PointValue
variable = 'free_cm3_Anorthite'
[]
[cm3_Calcite]
type = PointValue
variable = 'free_cm3_Calcite'
[]
[cm3_Chalcedony]
type = PointValue
variable = 'free_cm3_Chalcedony'
[]
[cm3_Clinochl-7A]
type = PointValue
variable = 'free_cm3_Clinochl-7A'
[]
[cm3_Illite]
type = PointValue
variable = 'free_cm3_Illite'
[]
[cm3_K-feldspar]
type = PointValue
variable = 'free_cm3_K-feldspar'
[]
[cm3_Kaolinite]
type = PointValue
variable = 'free_cm3_Kaolinite'
[]
[cm3_Quartz]
type = PointValue
variable = 'free_cm3_Quartz'
[]
[cm3_Paragonite]
type = PointValue
variable = 'free_cm3_Paragonite'
[]
[cm3_Phlogopite]
type = PointValue
variable = 'free_cm3_Phlogopite'
[]
[cm3_Zoisite]
type = PointValue
variable = 'free_cm3_Zoisite'
[]
[cm3_Laumontite]
type = PointValue
variable = 'free_cm3_Laumontite'
[]
[cm3_mineral]
type = LinearCombinationPostprocessor
pp_names = 'cm3_Albite cm3_Anhydrite cm3_Anorthite cm3_Calcite cm3_Chalcedony cm3_Clinochl-7A cm3_Illite cm3_K-feldspar cm3_Kaolinite cm3_Quartz cm3_Paragonite cm3_Phlogopite cm3_Zoisite cm3_Laumontite'
pp_coefs = '1 1 1 1 1 1 1 1 1 1 1 1 1 1'
[]
[pH]
type = PointValue
variable = 'pH'
[]
[]
[Outputs]
[exo]
type = Exodus
execute_on = final
[]
csv = true
[]
(modules/optimization/test/tests/vectorpostprocessors/element_source_inner_product/element_source_inner_product.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 4
ny = 4
nz = 4
[]
[]
[AuxVariables]
[u]
initial_condition = 1
[]
[]
[AuxKernels]
[u_val]
type = ParsedAux
variable = u
use_xyzt = true
function = 't'
[]
[]
[Functions]
[xyzt]
type = NearestReporterCoordinatesFunction
x_coord_name = 'values4D/coordx'
y_coord_name = 'values4D/coordy'
z_coord_name = 'values4D/coordz'
time_name = 'values4D/time'
value_name = 'values4D/value'
[]
[]
[Reporters]
[values4D]
type = ConstantReporter
real_vector_names = 'coordx coordy coordz time value'
real_vector_values = '0.25 0.75 0.25 0.75 0.25 0.75 0.25 0.75
0.25 0.75 0.25 0.75 0.25 0.75 0.25 0.75
0.25 0.75 0.25 0.75 0.25 0.75 0.25 0.75;
0.25 0.25 0.75 0.75 0.25 0.25 0.75 0.75
0.25 0.25 0.75 0.75 0.25 0.25 0.75 0.75
0.25 0.25 0.75 0.75 0.25 0.25 0.75 0.75;
0.25 0.25 0.25 0.25 0.75 0.75 0.75 0.75
0.25 0.25 0.25 0.25 0.75 0.75 0.75 0.75
0.25 0.25 0.25 0.25 0.75 0.75 0.75 0.75;
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.50 0.50 0.50 0.50 0.50 0.50 0.50 0.50
1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00;
0.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00
8.00 9.00 10.0 11.0 12.0 13.0 14.0 15.0
16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0'
outputs = none
[]
[]
[VectorPostprocessors]
[inner_product]
type = ElementOptimizationSourceFunctionInnerProduct
variable = u
function = xyzt
execute_on = 'initial timestep_end'
[]
[]
[Problem]
solve = false
kernel_coverage_check = false
skip_nl_system_check = true
[]
[Executioner]
type = Transient
dt = 0.1
end_time = 1
[]
[Outputs]
csv = true
execute_on = final
[]
(modules/solid_mechanics/test/tests/action/material_output_order.i)
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
origin = '0 0 2'
direction = '0 0 1'
polar_moment_of_inertia = pmi
factor = t
[]
[Mesh]
[ring]
type = AnnularMeshGenerator
nr = 1
nt = 30
rmin = 0.95
rmax = 1
[]
[extrude]
type = MeshExtruderGenerator
input = ring
extrusion_vector = '0 0 2'
bottom_sideset = 'bottom'
top_sideset = 'top'
num_layers = 5
[]
[]
[AuxVariables]
[alpha_var]
[]
[shear_stress_var]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[alpha]
type = RotationAngle
variable = alpha_var
[]
[shear_stress]
type = ParsedAux
variable = shear_stress_var
coupled_variables = 'stress_yz stress_xz'
expression = 'sqrt(stress_yz^2 + stress_xz^2)'
[]
[]
[BCs]
# fix bottom
[fix_x]
type = DirichletBC
boundary = bottom
variable = disp_x
value = 0
[]
[fix_y]
type = DirichletBC
boundary = bottom
variable = disp_y
value = 0
[]
[fix_z]
type = DirichletBC
boundary = bottom
variable = disp_z
value = 0
[]
# twist top
[twist_x]
type = Torque
boundary = top
variable = disp_x
[]
[twist_y]
type = Torque
boundary = top
variable = disp_y
[]
[twist_z]
type = Torque
boundary = top
variable = disp_z
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
add_variables = true
strain = SMALL
generate_output = 'vonmises_stress stress_yz stress_xz'
[]
[]
[Postprocessors]
[pmi]
type = PolarMomentOfInertia
boundary = top
# execute_on = 'INITIAL NONLINEAR'
execute_on = 'INITIAL'
[]
[alpha]
type = SideAverageValue
variable = alpha_var
boundary = top
[]
[shear_stress]
type = ElementAverageValue
variable = shear_stress_var
[]
[]
[Materials]
[stress]
type = ComputeLinearElasticStress
[]
[elastic]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 0.3
shear_modulus = 100
[]
[]
[Executioner]
# type = Steady
type = Transient
num_steps = 1
solve_type = PJFNK
petsc_options_iname = '-pctype'
petsc_options_value = 'lu'
nl_max_its = 150
[]
[Outputs]
exodus = true
print_linear_residuals = false
perf_graph = true
[]
(modules/phase_field/test/tests/KKS_system/auxkernel.i)
#
# This test checks if the two phase and lagrange multiplier solutions can be replicated
# with a two order parameter approach, where the second order parameter eta2 is an
# auxiliary variable that is set as eta2 := 1 - eta1
# The solution is reproduced, but convergence is suboptimal, as important Jacobian
# terms for eta1 (that should come indirectly from eta2) are missing.
#
[Mesh]
type = GeneratedMesh
dim = 1
nx = 20
xmax = 5
[]
[AuxVariables]
[Fglobal]
order = CONSTANT
family = MONOMIAL
[]
# order parameter 2
[eta2]
order = FIRST
family = LAGRANGE
initial_condition = 0.5
[]
[]
#
# With this approach the derivative w.r.t. eta1 is lost in all terms depending on
# eta2 a potential fix would be to make eta2 a material property with derivatives.
# This would require a major rewrite of the phase field kernels, though.
#
[AuxKernels]
[eta2]
type = ParsedAux
variable = eta2
expression = '1-eta1'
coupled_variables = eta1
[]
[]
[Variables]
# concentration
[c]
order = FIRST
family = LAGRANGE
[InitialCondition]
type = FunctionIC
function = x/5
[]
[]
# order parameter 1
[eta1]
order = FIRST
family = LAGRANGE
initial_condition = 0.5
[]
# phase concentration 1
[c1]
order = FIRST
family = LAGRANGE
initial_condition = 0.9
[]
# phase concentration 2
[c2]
order = FIRST
family = LAGRANGE
initial_condition = 0.1
[]
[]
[Materials]
# simple toy free energies
[f1] # = fd
type = DerivativeParsedMaterial
property_name = F1
coupled_variables = 'c1'
expression = '(0.9-c1)^2'
[]
[f2] # = fm
type = DerivativeParsedMaterial
property_name = F2
coupled_variables = 'c2'
expression = '(0.1-c2)^2'
[]
# Switching functions for each phase
[h1_eta]
type = SwitchingFunctionMaterial
h_order = HIGH
eta = eta1
function_name = h1
[]
[h2_eta]
type = DerivativeParsedMaterial
material_property_names = 'h1(eta1)'
expression = '1-h1'
property_name = h2
coupled_variables = eta1
[]
# Coefficients for diffusion equation
[Dh1]
type = DerivativeParsedMaterial
material_property_names = 'D h1(eta1)'
expression = D*h1
property_name = Dh1
coupled_variables = eta1
[]
[Dh2]
type = DerivativeParsedMaterial
material_property_names = 'D h2(eta1)'
expression = 'D*h2'
property_name = Dh2
coupled_variables = eta1
[]
# Barrier functions for each phase
[g1]
type = BarrierFunctionMaterial
g_order = SIMPLE
eta = eta1
function_name = g1
[]
[g2]
type = BarrierFunctionMaterial
g_order = SIMPLE
eta = eta2
function_name = g2
[]
# constant properties
[constants]
type = GenericConstantMaterial
prop_names = 'D L kappa'
prop_values = '0.7 0.7 0.2'
[]
[]
[Kernels]
#Kernels for diffusion equation
[diff_time]
type = TimeDerivative
variable = c
[]
[diff_c1]
type = MatDiffusion
variable = c
diffusivity = Dh1
v = c1
args = eta1
[]
[diff_c2]
type = MatDiffusion
variable = c
diffusivity = Dh2
v = c2
args = eta1
[]
# Kernels for Allen-Cahn equation for eta1
[deta1dt]
type = TimeDerivative
variable = eta1
[]
[ACBulkF1]
type = KKSMultiACBulkF
variable = eta1
Fj_names = 'F1 F2'
hj_names = 'h1 h2'
gi_name = g1
eta_i = eta1
wi = 0.2
coupled_variables = 'c1 c2 eta2'
[]
[ACBulkC1]
type = KKSMultiACBulkC
variable = eta1
Fj_names = 'F1 F2'
hj_names = 'h1 h2'
cj_names = 'c1 c2'
eta_i = eta1
coupled_variables = 'eta2'
[]
[ACInterface1]
type = ACInterface
variable = eta1
kappa_name = kappa
[]
# Phase concentration constraints
[chempot12]
type = KKSPhaseChemicalPotential
variable = c1
cb = c2
fa_name = F1
fb_name = F2
[]
[phaseconcentration]
type = KKSMultiPhaseConcentration
variable = c2
cj = 'c1 c2'
hj_names = 'h1 h2'
etas = 'eta1 eta2'
c = c
[]
[]
[AuxKernels]
[Fglobal_total]
type = KKSMultiFreeEnergy
Fj_names = 'F1 F2 '
hj_names = 'h1 h2 '
gj_names = 'g1 g2 '
variable = Fglobal
w = 0.2
interfacial_vars = 'eta1 eta2 '
kappa_names = 'kappa kappa'
[]
[]
[Executioner]
type = Transient
solve_type = PJFNK
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu '
l_max_its = 30
nl_max_its = 10
l_tol = 1.0e-4
nl_rel_tol = 1.0e-10
nl_abs_tol = 1.0e-11
end_time = 350
dt = 10
[]
[Preconditioning]
[full]
type = SMP
full = true
[]
[]
[VectorPostprocessors]
[c]
type = LineValueSampler
variable = c
start_point = '0 0 0'
end_point = '5 0 0'
num_points = 21
sort_by = x
[]
[]
[Outputs]
csv = true
execute_on = FINAL
[]
(test/tests/variables/linearfv/diffusion-1d-aux.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 10
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[AuxVariables]
[v_volume]
type = MooseLinearVariableFVReal
initial_condition = 50
[]
[v_functor]
type = MooseLinearVariableFVReal
initial_condition = 25
[]
[v_parsed]
type = MooseLinearVariableFVReal
initial_condition = 12.5
[]
[]
[AuxKernels]
[volume]
type = VolumeAux
variable = v_volume
[]
[functor]
type = FunctorAux
variable = v_functor
functor = u
[]
[parsed]
type = ParsedAux
variable = v_parsed
coupled_variables = 'v_volume v_functor'
expression = '0.5*v_volume+0.5*v_functor'
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = coeff_func
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right"
functor = analytic_solution
[]
[]
[Functions]
[coeff_func]
type = ParsedFunction
expression = '0.5*x'
[]
[source_func]
type = ParsedFunction
expression = '2*x'
[]
[analytic_solution]
type = ParsedFunction
expression = '1-x*x'
[]
[]
[Executioner]
type = LinearPicardSteady
linear_systems_to_solve = u_sys
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
execute_on = TIMESTEP_END
[]
(modules/combined/examples/phase_field-mechanics/kks_mechanics_KHS.i)
# KKS phase-field model coupled with elasticity using Khachaturyan's scheme as
# described in L.K. Aagesen et al., Computational Materials Science, 140, 10-21 (2017)
# Original run #170403a
[Mesh]
type = GeneratedMesh
dim = 3
nx = 640
ny = 1
nz = 1
xmin = -10
xmax = 10
ymin = 0
ymax = 0.03125
zmin = 0
zmax = 0.03125
elem_type = HEX8
[]
[Variables]
# order parameter
[./eta]
order = FIRST
family = LAGRANGE
[../]
# solute concentration
[./c]
order = FIRST
family = LAGRANGE
[../]
# chemical potential
[./w]
order = FIRST
family = LAGRANGE
[../]
# solute phase concentration (matrix)
[./cm]
order = FIRST
family = LAGRANGE
[../]
# solute phase concentration (precipitate)
[./cp]
order = FIRST
family = LAGRANGE
[../]
[./disp_x]
order = FIRST
family = LAGRANGE
[../]
[./disp_y]
order = FIRST
family = LAGRANGE
[../]
[./disp_z]
order = FIRST
family = LAGRANGE
[../]
[]
[ICs]
[./eta_ic]
variable = eta
type = FunctionIC
function = ic_func_eta
block = 0
[../]
[./c_ic]
variable = c
type = FunctionIC
function = ic_func_c
block = 0
[../]
[./w_ic]
variable = w
type = ConstantIC
value = 0.00991
block = 0
[../]
[./cm_ic]
variable = cm
type = ConstantIC
value = 0.131
block = 0
[../]
[./cp_ic]
variable = cp
type = ConstantIC
value = 0.236
block = 0
[../]
[]
[Functions]
[./ic_func_eta]
type = ParsedFunction
expression = '0.5*(1.0+tanh((x)/delta_eta/sqrt(2.0)))'
symbol_names = 'delta_eta'
symbol_values = '0.8034'
[../]
[./ic_func_c]
type = ParsedFunction
expression = '0.2389*(0.5*(1.0+tanh(x/delta/sqrt(2.0))))^3*(6*(0.5*(1.0+tanh(x/delta/sqrt(2.0))))^2-15*(0.5*(1.0+tanh(x/delta/sqrt(2.0))))+10)+0.1339*(1-(0.5*(1.0+tanh(x/delta/sqrt(2.0))))^3*(6*(0.5*(1.0+tanh(x/delta/sqrt(2.0))))^2-15*(0.5*(1.0+tanh(x/delta/sqrt(2.0))))+10))'
symbol_names = 'delta'
symbol_values = '0.8034'
[../]
[./psi_eq_int]
type = ParsedFunction
expression = 'volume*psi_alpha'
symbol_names = 'volume psi_alpha'
symbol_values = 'volume psi_alpha'
[../]
[./gamma]
type = ParsedFunction
expression = '(psi_int - psi_eq_int) / dy / dz'
symbol_names = 'psi_int psi_eq_int dy dz'
symbol_values = 'psi_int psi_eq_int 0.03125 0.03125'
[../]
[]
[AuxVariables]
[./sigma11]
order = CONSTANT
family = MONOMIAL
[../]
[./sigma22]
order = CONSTANT
family = MONOMIAL
[../]
[./sigma33]
order = CONSTANT
family = MONOMIAL
[../]
[./e11]
order = CONSTANT
family = MONOMIAL
[../]
[./e12]
order = CONSTANT
family = MONOMIAL
[../]
[./e22]
order = CONSTANT
family = MONOMIAL
[../]
[./e33]
order = CONSTANT
family = MONOMIAL
[../]
[./e_el11]
order = CONSTANT
family = MONOMIAL
[../]
[./e_el12]
order = CONSTANT
family = MONOMIAL
[../]
[./e_el22]
order = CONSTANT
family = MONOMIAL
[../]
[./f_el]
order = CONSTANT
family = MONOMIAL
[../]
[./eigen_strain00]
order = CONSTANT
family = MONOMIAL
[../]
[./Fglobal]
order = CONSTANT
family = MONOMIAL
[../]
[./psi]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./matl_sigma11]
type = RankTwoAux
rank_two_tensor = stress
index_i = 0
index_j = 0
variable = sigma11
[../]
[./matl_sigma22]
type = RankTwoAux
rank_two_tensor = stress
index_i = 1
index_j = 1
variable = sigma22
[../]
[./matl_sigma33]
type = RankTwoAux
rank_two_tensor = stress
index_i = 2
index_j = 2
variable = sigma33
[../]
[./matl_e11]
type = RankTwoAux
rank_two_tensor = total_strain
index_i = 0
index_j = 0
variable = e11
[../]
[./f_el]
type = MaterialRealAux
variable = f_el
property = f_el_mat
execute_on = timestep_end
[../]
[./GlobalFreeEnergy]
variable = Fglobal
type = KKSGlobalFreeEnergy
fa_name = fm
fb_name = fp
w = 0.0264
kappa_names = kappa
interfacial_vars = eta
[../]
[./psi_potential]
variable = psi
type = ParsedAux
coupled_variables = 'Fglobal w c f_el sigma11 e11'
expression = 'Fglobal - w*c + f_el - sigma11*e11'
[../]
[]
[BCs]
[./left_x]
type = DirichletBC
variable = disp_x
boundary = left
value = 0
[../]
[./right_x]
type = DirichletBC
variable = disp_x
boundary = right
value = 0
[../]
[./front_y]
type = DirichletBC
variable = disp_y
boundary = front
value = 0
[../]
[./back_y]
type = DirichletBC
variable = disp_y
boundary = back
value = 0
[../]
[./top_z]
type = DirichletBC
variable = disp_z
boundary = top
value = 0
[../]
[./bottom_z]
type = DirichletBC
variable = disp_z
boundary = bottom
value = 0
[../]
[]
[Materials]
# Chemical free energy of the matrix
[./fm]
type = DerivativeParsedMaterial
property_name = fm
coupled_variables = 'cm'
expression = '6.55*(cm-0.13)^2'
[../]
# Chemical Free energy of the precipitate phase
[./fp]
type = DerivativeParsedMaterial
property_name = fp
coupled_variables = 'cp'
expression = '6.55*(cp-0.235)^2'
[../]
# Elastic energy of the precipitate
[./elastic_free_energy_p]
type = ElasticEnergyMaterial
f_name = f_el_mat
args = 'eta'
outputs = exodus
[../]
# h(eta)
[./h_eta]
type = SwitchingFunctionMaterial
h_order = HIGH
eta = eta
[../]
# 1- h(eta), putting in function explicitly
[./one_minus_h_eta_explicit]
type = DerivativeParsedMaterial
property_name = one_minus_h_explicit
coupled_variables = eta
expression = 1-eta^3*(6*eta^2-15*eta+10)
outputs = exodus
[../]
# g(eta)
[./g_eta]
type = BarrierFunctionMaterial
g_order = SIMPLE
eta = eta
[../]
# constant properties
[./constants]
type = GenericConstantMaterial
prop_names = 'M L kappa misfit'
prop_values = '0.7 0.7 0.01704 0.00377'
[../]
#Mechanical properties
[./Stiffness_matrix]
type = ComputeElasticityTensor
base_name = C_matrix
C_ijkl = '103.3 74.25 74.25 103.3 74.25 103.3 46.75 46.75 46.75'
fill_method = symmetric9
[../]
[./Stiffness_ppt]
type = ComputeElasticityTensor
C_ijkl = '100.7 71.45 71.45 100.7 71.45 100.7 50.10 50.10 50.10'
base_name = C_ppt
fill_method = symmetric9
[../]
[./C]
type = CompositeElasticityTensor
args = eta
tensors = 'C_matrix C_ppt'
weights = 'one_minus_h_explicit h'
[../]
[./stress]
type = ComputeLinearElasticStress
[../]
[./strain]
type = ComputeSmallStrain
displacements = 'disp_x disp_y disp_z'
eigenstrain_names = 'eigenstrain_ppt'
[../]
[./eigen_strain]
type = ComputeVariableEigenstrain
eigen_base = '0.00377 0.00377 0.00377 0 0 0'
prefactor = h
args = eta
eigenstrain_name = 'eigenstrain_ppt'
[../]
[]
[Kernels]
[./TensorMechanics]
displacements = 'disp_x disp_y disp_z'
[../]
# enforce c = (1-h(eta))*cm + h(eta)*cp
[./PhaseConc]
type = KKSPhaseConcentration
ca = cm
variable = cp
c = c
eta = eta
[../]
# enforce pointwise equality of chemical potentials
[./ChemPotVacancies]
type = KKSPhaseChemicalPotential
variable = cm
cb = cp
fa_name = fm
fb_name = fp
[../]
#
# Cahn-Hilliard Equation
#
[./CHBulk]
type = KKSSplitCHCRes
variable = c
ca = cm
fa_name = fm
w = w
[../]
[./dcdt]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[./ckernel]
type = SplitCHWRes
mob_name = M
variable = w
[../]
#
# Allen-Cahn Equation
#
[./ACBulkF]
type = KKSACBulkF
variable = eta
fa_name = fm
fb_name = fp
w = 0.0264
args = 'cp cm'
[../]
[./ACBulkC]
type = KKSACBulkC
variable = eta
ca = cm
cb = cp
fa_name = fm
[../]
[./ACBulk_el] #This adds df_el/deta for strain interpolation
type = AllenCahn
variable = eta
f_name = f_el_mat
[../]
[./ACInterface]
type = ACInterface
variable = eta
kappa_name = kappa
[../]
[./detadt]
type = TimeDerivative
variable = eta
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'asm ilu nonzero'
l_max_its = 30
nl_max_its = 10
l_tol = 1.0e-4
nl_rel_tol = 1.0e-8
nl_abs_tol = 1.0e-11
num_steps = 200
[./TimeStepper]
type = SolutionTimeAdaptiveDT
dt = 0.5
[../]
[]
[Postprocessors]
[./f_el_int]
type = ElementIntegralMaterialProperty
mat_prop = f_el_mat
[../]
[./c_alpha]
type = SideAverageValue
boundary = left
variable = c
[../]
[./c_beta]
type = SideAverageValue
boundary = right
variable = c
[../]
[./e11_alpha]
type = SideAverageValue
boundary = left
variable = e11
[../]
[./e11_beta]
type = SideAverageValue
boundary = right
variable = e11
[../]
[./s11_alpha]
type = SideAverageValue
boundary = left
variable = sigma11
[../]
[./s22_alpha]
type = SideAverageValue
boundary = left
variable = sigma22
[../]
[./s33_alpha]
type = SideAverageValue
boundary = left
variable = sigma33
[../]
[./s11_beta]
type = SideAverageValue
boundary = right
variable = sigma11
[../]
[./s22_beta]
type = SideAverageValue
boundary = right
variable = sigma22
[../]
[./s33_beta]
type = SideAverageValue
boundary = right
variable = sigma33
[../]
[./f_el_alpha]
type = SideAverageValue
boundary = left
variable = f_el
[../]
[./f_el_beta]
type = SideAverageValue
boundary = right
variable = f_el
[../]
[./f_c_alpha]
type = SideAverageValue
boundary = left
variable = Fglobal
[../]
[./f_c_beta]
type = SideAverageValue
boundary = right
variable = Fglobal
[../]
[./chem_pot_alpha]
type = SideAverageValue
boundary = left
variable = w
[../]
[./chem_pot_beta]
type = SideAverageValue
boundary = right
variable = w
[../]
[./psi_alpha]
type = SideAverageValue
boundary = left
variable = psi
[../]
[./psi_beta]
type = SideAverageValue
boundary = right
variable = psi
[../]
[./total_energy]
type = ElementIntegralVariablePostprocessor
variable = Fglobal
[../]
# Get simulation cell size from postprocessor
[./volume]
type = ElementIntegralMaterialProperty
mat_prop = 1
[../]
[./psi_eq_int]
type = FunctionValuePostprocessor
function = psi_eq_int
[../]
[./psi_int]
type = ElementIntegralVariablePostprocessor
variable = psi
[../]
[./gamma]
type = FunctionValuePostprocessor
function = gamma
[../]
[./int_position]
type = FindValueOnLine
start_point = '-10 0 0'
end_point = '10 0 0'
v = eta
target = 0.5
[../]
[]
#
# Precondition using handcoded off-diagonal terms
#
[Preconditioning]
[./full]
type = SMP
full = true
[../]
[]
[Outputs]
[./exodus]
type = Exodus
time_step_interval = 20
[../]
checkpoint = true
[./csv]
type = CSV
execute_on = 'final'
[../]
[]
(modules/combined/test/tests/poro_mechanics/borehole_highres.i)
# Poroelastic response of a borehole.
#
# HIGHRES VERSION: this version gives good agreement with the analytical solution, but it takes a while so is a "heavy" test
#
# A fully-saturated medium contains a fluid with a homogeneous porepressure,
# but an anisitropic insitu stress. A infinitely-long borehole aligned with
# the $$z$$ axis is instanteously excavated. The borehole boundary is
# stress-free and allowed to freely drain. This problem is analysed using
# plane-strain conditions (no $$z$$ displacement).
#
# The solution in Laplace space is found in E Detournay and AHD Cheng "Poroelastic response of a borehole in a non-hydrostatic stress field". International Journal of Rock Mechanics and Mining Sciences and Geomechanics Abstracts 25 (1988) 171-182. In the small-time limit, the Laplace transforms may be performed. There is one typo in the paper. Equation (A4)'s final term should be -(a/r)\sqrt(4ct/(a^2\pi)), and not +(a/r)\sqrt(4ct/(a^2\pi)).
#
# Because realistic parameters are chosen (below),
# the residual for porepressure is much smaller than
# the residuals for the displacements. Therefore the
# scaling parameter is chosen. Also note that the
# insitu stresses are effective stresses, not total
# stresses, but the solution in the above paper is
# expressed in terms of total stresses.
#
# Here are the problem's parameters, and their values:
# Borehole radius. a = 1
# Rock's Lame lambda. la = 0.5E9
# Rock's Lame mu, which is also the Rock's shear modulus. mu = G = 1.5E9
# Rock bulk modulus. K = la + 2*mu/3 = 1.5E9
# Drained Poisson ratio. nu = (3K - 2G)/(6K + 2G) = 0.125
# Rock bulk compliance. 1/K = 0.66666666E-9
# Fluid bulk modulus. Kf = 0.7171315E9
# Fluid bulk compliance. 1/Kf = 1.39444444E-9
# Rock initial porosity. phi0 = 0.3
# Biot coefficient. alpha = 0.65
# Biot modulus. M = 1/(phi0/Kf + (alpha - phi0)(1 - alpha)/K) = 2E9
# Undrained bulk modulus. Ku = K + alpha^2*M = 2.345E9
# Undrained Poisson ratio. nuu = (3Ku - 2G)/(6Ku + 2G) = 0.2364
# Skempton coefficient. B = alpha*M/Ku = 0.554
# Fluid mobility (rock permeability/fluid viscosity). k = 1E-12
[Mesh]
type = FileMesh
file = borehole_highres_input.e
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
porepressure = porepressure
block = 1
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[./disp_z]
[../]
[./porepressure]
scaling = 1E9 # Notice the scaling, to make porepressure's kernels roughly of same magnitude as disp's kernels
[../]
[]
[GlobalParams]
volumetric_locking_correction=true
[]
[ICs]
[./initial_p]
type = ConstantIC
variable = porepressure
value = 1E6
[../]
[]
[BCs]
[./fixed_outer_x]
type = DirichletBC
variable = disp_x
value = 0
boundary = outer
[../]
[./fixed_outer_y]
type = DirichletBC
variable = disp_y
value = 0
boundary = outer
[../]
[./plane_strain]
type = DirichletBC
variable = disp_z
value = 0
boundary = 'zmin zmax'
[../]
[./borehole_wall]
type = DirichletBC
variable = porepressure
value = 0
boundary = bh_wall
[../]
[]
[AuxVariables]
[./stress_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./tot_yy]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./stress_yy]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_yy
index_i = 1
index_j = 1
[../]
[./tot_yy]
type = ParsedAux
coupled_variables = 'stress_yy porepressure'
execute_on = timestep_end
variable = tot_yy
expression = 'stress_yy-0.65*porepressure'
[../]
[]
[Kernels]
[./grad_stress_x]
type = StressDivergenceTensors
variable = disp_x
component = 0
[../]
[./grad_stress_y]
type = StressDivergenceTensors
variable = disp_y
component = 1
[../]
[./grad_stress_z]
type = StressDivergenceTensors
variable = disp_z
component = 2
[../]
[./poro_x]
type = PoroMechanicsCoupling
variable = disp_x
component = 0
[../]
[./poro_y]
type = PoroMechanicsCoupling
variable = disp_y
component = 1
[../]
[./poro_z]
type = PoroMechanicsCoupling
variable = disp_z
component = 2
[../]
[./poro_timederiv]
type = PoroFullSatTimeDerivative
variable = porepressure
[../]
[./darcy_flow]
type = CoefDiffusion
variable = porepressure
coef = 1E-12
[../]
[]
[Materials]
[./elasticity_tensor]
type = ComputeElasticityTensor
C_ijkl = '0.5E9 1.5E9'
# bulk modulus is lambda + 2*mu/3 = 0.5 + 2*1.5/3 = 1.5E9
fill_method = symmetric_isotropic
[../]
[./strain]
type = ComputeFiniteStrain
displacements = 'disp_x disp_y disp_z'
eigenstrain_names = ini_stress
[../]
[./ini_stress]
type = ComputeEigenstrainFromInitialStress
initial_stress = '-1.35E6 0 0 0 -3.35E6 0 0 0 0' # remember this is the effective stress
eigenstrain_name = ini_stress
[../]
[./no_plasticity]
type = ComputeFiniteStrainElasticStress
[../]
[./poro_material]
type = PoroFullSatMaterial
porosity0 = 0.3
biot_coefficient = 0.65
solid_bulk_compliance = 0.6666666666667E-9
fluid_bulk_compliance = 1.3944444444444E-9
constant_porosity = false
[../]
[]
[Postprocessors]
[./p00]
type = PointValue
variable = porepressure
point = '1.00 0 0'
outputs = csv_p
[../]
[./p01]
type = PointValue
variable = porepressure
point = '1.01 0 0'
outputs = csv_p
[../]
[./p02]
type = PointValue
variable = porepressure
point = '1.02 0 0'
outputs = csv_p
[../]
[./p03]
type = PointValue
variable = porepressure
point = '1.03 0 0'
outputs = csv_p
[../]
[./p04]
type = PointValue
variable = porepressure
point = '1.04 0 0'
outputs = csv_p
[../]
[./p05]
type = PointValue
variable = porepressure
point = '1.05 0 0'
outputs = csv_p
[../]
[./p06]
type = PointValue
variable = porepressure
point = '1.06 0 0'
outputs = csv_p
[../]
[./p07]
type = PointValue
variable = porepressure
point = '1.07 0 0'
outputs = csv_p
[../]
[./p08]
type = PointValue
variable = porepressure
point = '1.08 0 0'
outputs = csv_p
[../]
[./p09]
type = PointValue
variable = porepressure
point = '1.09 0 0'
outputs = csv_p
[../]
[./p10]
type = PointValue
variable = porepressure
point = '1.10 0 0'
outputs = csv_p
[../]
[./p11]
type = PointValue
variable = porepressure
point = '1.11 0 0'
outputs = csv_p
[../]
[./p12]
type = PointValue
variable = porepressure
point = '1.12 0 0'
outputs = csv_p
[../]
[./p13]
type = PointValue
variable = porepressure
point = '1.13 0 0'
outputs = csv_p
[../]
[./p14]
type = PointValue
variable = porepressure
point = '1.14 0 0'
outputs = csv_p
[../]
[./p15]
type = PointValue
variable = porepressure
point = '1.15 0 0'
outputs = csv_p
[../]
[./p16]
type = PointValue
variable = porepressure
point = '1.16 0 0'
outputs = csv_p
[../]
[./p17]
type = PointValue
variable = porepressure
point = '1.17 0 0'
outputs = csv_p
[../]
[./p18]
type = PointValue
variable = porepressure
point = '1.18 0 0'
outputs = csv_p
[../]
[./p19]
type = PointValue
variable = porepressure
point = '1.19 0 0'
outputs = csv_p
[../]
[./p20]
type = PointValue
variable = porepressure
point = '1.20 0 0'
outputs = csv_p
[../]
[./p21]
type = PointValue
variable = porepressure
point = '1.21 0 0'
outputs = csv_p
[../]
[./p22]
type = PointValue
variable = porepressure
point = '1.22 0 0'
outputs = csv_p
[../]
[./p23]
type = PointValue
variable = porepressure
point = '1.23 0 0'
outputs = csv_p
[../]
[./p24]
type = PointValue
variable = porepressure
point = '1.24 0 0'
outputs = csv_p
[../]
[./p25]
type = PointValue
variable = porepressure
point = '1.25 0 0'
outputs = csv_p
[../]
[./s00]
type = PointValue
variable = disp_x
point = '1.00 0 0'
outputs = csv_s
[../]
[./s01]
type = PointValue
variable = disp_x
point = '1.01 0 0'
outputs = csv_s
[../]
[./s02]
type = PointValue
variable = disp_x
point = '1.02 0 0'
outputs = csv_s
[../]
[./s03]
type = PointValue
variable = disp_x
point = '1.03 0 0'
outputs = csv_s
[../]
[./s04]
type = PointValue
variable = disp_x
point = '1.04 0 0'
outputs = csv_s
[../]
[./s05]
type = PointValue
variable = disp_x
point = '1.05 0 0'
outputs = csv_s
[../]
[./s06]
type = PointValue
variable = disp_x
point = '1.06 0 0'
outputs = csv_s
[../]
[./s07]
type = PointValue
variable = disp_x
point = '1.07 0 0'
outputs = csv_s
[../]
[./s08]
type = PointValue
variable = disp_x
point = '1.08 0 0'
outputs = csv_s
[../]
[./s09]
type = PointValue
variable = disp_x
point = '1.09 0 0'
outputs = csv_s
[../]
[./s10]
type = PointValue
variable = disp_x
point = '1.10 0 0'
outputs = csv_s
[../]
[./s11]
type = PointValue
variable = disp_x
point = '1.11 0 0'
outputs = csv_s
[../]
[./s12]
type = PointValue
variable = disp_x
point = '1.12 0 0'
outputs = csv_s
[../]
[./s13]
type = PointValue
variable = disp_x
point = '1.13 0 0'
outputs = csv_s
[../]
[./s14]
type = PointValue
variable = disp_x
point = '1.14 0 0'
outputs = csv_s
[../]
[./s15]
type = PointValue
variable = disp_x
point = '1.15 0 0'
outputs = csv_s
[../]
[./s16]
type = PointValue
variable = disp_x
point = '1.16 0 0'
outputs = csv_s
[../]
[./s17]
type = PointValue
variable = disp_x
point = '1.17 0 0'
outputs = csv_s
[../]
[./s18]
type = PointValue
variable = disp_x
point = '1.18 0 0'
outputs = csv_s
[../]
[./s19]
type = PointValue
variable = disp_x
point = '1.19 0 0'
outputs = csv_s
[../]
[./s20]
type = PointValue
variable = disp_x
point = '1.20 0 0'
outputs = csv_s
[../]
[./s21]
type = PointValue
variable = disp_x
point = '1.21 0 0'
outputs = csv_s
[../]
[./s22]
type = PointValue
variable = disp_x
point = '1.22 0 0'
outputs = csv_s
[../]
[./s23]
type = PointValue
variable = disp_x
point = '1.23 0 0'
outputs = csv_s
[../]
[./s24]
type = PointValue
variable = disp_x
point = '1.24 0 0'
outputs = csv_s
[../]
[./s25]
type = PointValue
variable = disp_x
point = '1.25 0 0'
outputs = csv_s
[../]
[./t00]
type = PointValue
variable = tot_yy
point = '1.00 0 0'
outputs = csv_t
[../]
[./t01]
type = PointValue
variable = tot_yy
point = '1.01 0 0'
outputs = csv_t
[../]
[./t02]
type = PointValue
variable = tot_yy
point = '1.02 0 0'
outputs = csv_t
[../]
[./t03]
type = PointValue
variable = tot_yy
point = '1.03 0 0'
outputs = csv_t
[../]
[./t04]
type = PointValue
variable = tot_yy
point = '1.04 0 0'
outputs = csv_t
[../]
[./t05]
type = PointValue
variable = tot_yy
point = '1.05 0 0'
outputs = csv_t
[../]
[./t06]
type = PointValue
variable = tot_yy
point = '1.06 0 0'
outputs = csv_t
[../]
[./t07]
type = PointValue
variable = tot_yy
point = '1.07 0 0'
outputs = csv_t
[../]
[./t08]
type = PointValue
variable = tot_yy
point = '1.08 0 0'
outputs = csv_t
[../]
[./t09]
type = PointValue
variable = tot_yy
point = '1.09 0 0'
outputs = csv_t
[../]
[./t10]
type = PointValue
variable = tot_yy
point = '1.10 0 0'
outputs = csv_t
[../]
[./t11]
type = PointValue
variable = tot_yy
point = '1.11 0 0'
outputs = csv_t
[../]
[./t12]
type = PointValue
variable = tot_yy
point = '1.12 0 0'
outputs = csv_t
[../]
[./t13]
type = PointValue
variable = tot_yy
point = '1.13 0 0'
outputs = csv_t
[../]
[./t14]
type = PointValue
variable = tot_yy
point = '1.14 0 0'
outputs = csv_t
[../]
[./t15]
type = PointValue
variable = tot_yy
point = '1.15 0 0'
outputs = csv_t
[../]
[./t16]
type = PointValue
variable = tot_yy
point = '1.16 0 0'
outputs = csv_t
[../]
[./t17]
type = PointValue
variable = tot_yy
point = '1.17 0 0'
outputs = csv_t
[../]
[./t18]
type = PointValue
variable = tot_yy
point = '1.18 0 0'
outputs = csv_t
[../]
[./t19]
type = PointValue
variable = tot_yy
point = '1.19 0 0'
outputs = csv_t
[../]
[./t20]
type = PointValue
variable = tot_yy
point = '1.20 0 0'
outputs = csv_t
[../]
[./t21]
type = PointValue
variable = tot_yy
point = '1.21 0 0'
outputs = csv_t
[../]
[./t22]
type = PointValue
variable = tot_yy
point = '1.22 0 0'
outputs = csv_t
[../]
[./t23]
type = PointValue
variable = tot_yy
point = '1.23 0 0'
outputs = csv_t
[../]
[./t24]
type = PointValue
variable = tot_yy
point = '1.24 0 0'
outputs = csv_t
[../]
[./t25]
type = PointValue
variable = tot_yy
point = '1.25 0 0'
outputs = csv_t
[../]
[./dt]
type = FunctionValuePostprocessor
outputs = console
function = 2*t
[../]
[]
[Preconditioning]
[./andy]
type = SMP
full = true
petsc_options = '-snes_monitor -snes_linesearch_monitor'
petsc_options_iname = '-ksp_type -pc_type -snes_atol -snes_rtol -snes_max_it -ksp_max_it -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'gmres asm 1E0 1E-10 200 500 lu NONZERO'
[../]
[]
[Executioner]
type = Transient
solve_type = Newton
start_time = 0
end_time = 0.3
dt = 0.1
#[./TimeStepper]
# type = PostprocessorDT
# postprocessor = dt
# dt = 0.003
#[../]
[]
[Outputs]
execute_on = 'timestep_end'
file_base = borehole_highres
exodus = true
sync_times = '0.003 0.3'
[./csv_p]
file_base = borehole_highres_p
type = CSV
[../]
[./csv_s]
file_base = borehole_highres_s
type = CSV
[../]
[./csv_t]
file_base = borehole_highres_t
type = CSV
[../]
[]
(modules/functional_expansion_tools/examples/3D_volumetric_Cartesian/sub.i)
# Basic example coupling a master and sub app in a 3D Cartesian volume.
#
# The master app provides field values to the sub app via Functional Expansions, which then performs
# its calculations. The sub app's solution field values are then transferred back to the master app
# and coupled into the solution of the master app solution.
#
# This example couples Functional Expansions via AuxVariable.
#
# Note: this problem is not light, and may take a few minutes to solve.
[Mesh]
type = GeneratedMesh
dim = 3
xmin = 0.0
xmax = 10.0
nx = 15
ymin = 1.0
ymax = 11.0
ny = 25
zmin = 2.0
zmax = 12.0
nz = 35
[]
# Non-copy transfers only work with AuxVariable, but nothing will be solved without a variable
# defined. The solution is to define an empty variable tha does nothing, but causes MOOSE to solve
# the AuxKernels that we need.
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
# We must have a kernel for every variable, hence this null kernel to match the variable 'empty'
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s] # Something to make 's' change each time, but allow a converging solution
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '3 4 5'
physical_bounds = '0.0 10.0 1.0 11.0 2.0 12.0'
x = Legendre
y = Legendre
z = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXVolumeUserObject
function = FX_Basis_Value_Sub
variable = s
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(modules/porous_flow/examples/tutorial/11_2D.i)
# Two-phase borehole injection problem in RZ coordinates
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 10
xmin = 1.0
xmax = 10
bias_x = 1.4
ny = 3
ymin = -6
ymax = 6
[]
[aquifer]
input = gen
type = SubdomainBoundingBoxGenerator
block_id = 1
bottom_left = '0 -2 0'
top_right = '10 2 0'
[]
[injection_area]
type = ParsedGenerateSideset
combinatorial_geometry = 'x<1.0001'
included_subdomains = 1
new_sideset_name = 'injection_area'
input = 'aquifer'
[]
[rename]
type = RenameBlockGenerator
old_block = '0 1'
new_block = 'caps aquifer'
input = 'injection_area'
[]
coord_type = RZ
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pwater pgas T disp_r'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureVG
alpha = 1E-6
m = 0.6
[]
[]
[GlobalParams]
displacements = 'disp_r disp_z'
gravity = '0 0 0'
biot_coefficient = 1.0
PorousFlowDictator = dictator
[]
[Variables]
[pwater]
initial_condition = 20E6
[]
[pgas]
initial_condition = 20.1E6
[]
[T]
initial_condition = 330
scaling = 1E-5
[]
[disp_r]
scaling = 1E-5
[]
[]
[Kernels]
[mass_water_dot]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = pwater
[]
[flux_water]
type = PorousFlowAdvectiveFlux
fluid_component = 0
use_displaced_mesh = false
variable = pwater
[]
[vol_strain_rate_water]
type = PorousFlowMassVolumetricExpansion
fluid_component = 0
variable = pwater
[]
[mass_co2_dot]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = pgas
[]
[flux_co2]
type = PorousFlowAdvectiveFlux
fluid_component = 1
use_displaced_mesh = false
variable = pgas
[]
[vol_strain_rate_co2]
type = PorousFlowMassVolumetricExpansion
fluid_component = 1
variable = pgas
[]
[energy_dot]
type = PorousFlowEnergyTimeDerivative
variable = T
[]
[advection]
type = PorousFlowHeatAdvection
use_displaced_mesh = false
variable = T
[]
[conduction]
type = PorousFlowHeatConduction
use_displaced_mesh = false
variable = T
[]
[vol_strain_rate_heat]
type = PorousFlowHeatVolumetricExpansion
variable = T
[]
[grad_stress_r]
type = StressDivergenceRZTensors
temperature = T
variable = disp_r
eigenstrain_names = thermal_contribution
use_displaced_mesh = false
component = 0
[]
[poro_r]
type = PorousFlowEffectiveStressCoupling
variable = disp_r
use_displaced_mesh = false
component = 0
[]
[]
[AuxVariables]
[disp_z]
[]
[effective_fluid_pressure]
family = MONOMIAL
order = CONSTANT
[]
[mass_frac_phase0_species0]
initial_condition = 1 # all water in phase=0
[]
[mass_frac_phase1_species0]
initial_condition = 0 # no water in phase=1
[]
[sgas]
family = MONOMIAL
order = CONSTANT
[]
[swater]
family = MONOMIAL
order = CONSTANT
[]
[stress_rr]
family = MONOMIAL
order = CONSTANT
[]
[stress_tt]
family = MONOMIAL
order = CONSTANT
[]
[stress_zz]
family = MONOMIAL
order = CONSTANT
[]
[porosity]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[effective_fluid_pressure]
type = ParsedAux
coupled_variables = 'pwater pgas swater sgas'
expression = 'pwater * swater + pgas * sgas'
variable = effective_fluid_pressure
[]
[swater]
type = PorousFlowPropertyAux
variable = swater
property = saturation
phase = 0
execute_on = timestep_end
[]
[sgas]
type = PorousFlowPropertyAux
variable = sgas
property = saturation
phase = 1
execute_on = timestep_end
[]
[stress_rr_aux]
type = RankTwoAux
variable = stress_rr
rank_two_tensor = stress
index_i = 0
index_j = 0
[]
[stress_tt]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_tt
index_i = 2
index_j = 2
[]
[stress_zz]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_zz
index_i = 1
index_j = 1
[]
[porosity]
type = PorousFlowPropertyAux
variable = porosity
property = porosity
execute_on = timestep_end
[]
[]
[BCs]
[pinned_top_bottom_r]
type = DirichletBC
variable = disp_r
value = 0
boundary = 'top bottom'
[]
[cavity_pressure_r]
type = Pressure
boundary = injection_area
variable = disp_r
postprocessor = constrained_effective_fluid_pressure_at_wellbore
use_displaced_mesh = false
[]
[cold_co2]
type = DirichletBC
boundary = injection_area
variable = T
value = 290 # injection temperature
use_displaced_mesh = false
[]
[constant_co2_injection]
type = PorousFlowSink
boundary = injection_area
variable = pgas
fluid_phase = 1
flux_function = -1E-4
use_displaced_mesh = false
[]
[outer_water_removal]
type = PorousFlowPiecewiseLinearSink
boundary = right
variable = pwater
fluid_phase = 0
pt_vals = '0 1E9'
multipliers = '0 1E8'
PT_shift = 20E6
use_mobility = true
use_relperm = true
use_displaced_mesh = false
[]
[outer_co2_removal]
type = PorousFlowPiecewiseLinearSink
boundary = right
variable = pgas
fluid_phase = 1
pt_vals = '0 1E9'
multipliers = '0 1E8'
PT_shift = 20.1E6
use_mobility = true
use_relperm = true
use_displaced_mesh = false
[]
[]
[FluidProperties]
[true_water]
type = Water97FluidProperties
[]
[tabulated_water]
type = TabulatedBicubicFluidProperties
fp = true_water
temperature_min = 275
pressure_max = 1E8
fluid_property_file = water97_tabulated_11.csv
[]
[true_co2]
type = CO2FluidProperties
[]
[tabulated_co2]
type = TabulatedBicubicFluidProperties
fp = true_co2
temperature_min = 275
pressure_max = 1E8
fluid_property_file = co2_tabulated_11.csv
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = T
[]
[saturation_calculator]
type = PorousFlow2PhasePP
phase0_porepressure = pwater
phase1_porepressure = pgas
capillary_pressure = pc
[]
[massfrac]
type = PorousFlowMassFraction
mass_fraction_vars = 'mass_frac_phase0_species0 mass_frac_phase1_species0'
[]
[water]
type = PorousFlowSingleComponentFluid
fp = tabulated_water
phase = 0
[]
[co2]
type = PorousFlowSingleComponentFluid
fp = tabulated_co2
phase = 1
[]
[relperm_water]
type = PorousFlowRelativePermeabilityCorey
n = 4
s_res = 0.1
sum_s_res = 0.2
phase = 0
[]
[relperm_co2]
type = PorousFlowRelativePermeabilityBC
nw_phase = true
lambda = 2
s_res = 0.1
sum_s_res = 0.2
phase = 1
[]
[porosity]
type = PorousFlowPorosity
fluid = true
mechanical = true
thermal = true
porosity_zero = 0.1
reference_temperature = 330
reference_porepressure = 20E6
thermal_expansion_coeff = 15E-6 # volumetric
solid_bulk = 8E9 # unimportant since biot = 1
[]
[permeability_aquifer]
type = PorousFlowPermeabilityKozenyCarman
block = aquifer
poroperm_function = kozeny_carman_phi0
phi0 = 0.1
n = 2
m = 2
k0 = 1E-12
[]
[permeability_caps]
type = PorousFlowPermeabilityKozenyCarman
block = caps
poroperm_function = kozeny_carman_phi0
phi0 = 0.1
n = 2
m = 2
k0 = 1E-15
k_anisotropy = '1 0 0 0 1 0 0 0 0.1'
[]
[rock_thermal_conductivity]
type = PorousFlowThermalConductivityIdeal
dry_thermal_conductivity = '2 0 0 0 2 0 0 0 2'
[]
[rock_internal_energy]
type = PorousFlowMatrixInternalEnergy
specific_heat_capacity = 1100
density = 2300
[]
[elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 5E9
poissons_ratio = 0.0
[]
[strain]
type = ComputeAxisymmetricRZSmallStrain
eigenstrain_names = 'thermal_contribution initial_stress'
[]
[thermal_contribution]
type = ComputeThermalExpansionEigenstrain
temperature = T
thermal_expansion_coeff = 5E-6 # this is the linear thermal expansion coefficient
eigenstrain_name = thermal_contribution
stress_free_temperature = 330
[]
[initial_strain]
type = ComputeEigenstrainFromInitialStress
initial_stress = '20E6 0 0 0 20E6 0 0 0 20E6'
eigenstrain_name = initial_stress
[]
[stress]
type = ComputeLinearElasticStress
[]
[effective_fluid_pressure]
type = PorousFlowEffectiveFluidPressure
[]
[volumetric_strain]
type = PorousFlowVolumetricStrain
[]
[]
[Postprocessors]
[effective_fluid_pressure_at_wellbore]
type = PointValue
variable = effective_fluid_pressure
point = '1 0 0'
execute_on = timestep_begin
use_displaced_mesh = false
[]
[constrained_effective_fluid_pressure_at_wellbore]
type = FunctionValuePostprocessor
function = constrain_effective_fluid_pressure
execute_on = timestep_begin
[]
[]
[Functions]
[constrain_effective_fluid_pressure]
type = ParsedFunction
symbol_names = effective_fluid_pressure_at_wellbore
symbol_values = effective_fluid_pressure_at_wellbore
expression = 'max(effective_fluid_pressure_at_wellbore, 20E6)'
[]
[]
[Preconditioning]
active = basic
[basic]
type = SMP
full = true
petsc_options = '-ksp_diagonal_scale -ksp_diagonal_scale_fix'
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
petsc_options_value = ' asm lu NONZERO 2'
[]
[preferred_but_might_not_be_installed]
type = SMP
full = true
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = ' lu mumps'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 1E3
[TimeStepper]
type = IterationAdaptiveDT
dt = 1E3
growth_factor = 1.2
optimal_iterations = 10
[]
nl_abs_tol = 1E-7
[]
[Outputs]
exodus = true
[]
(test/tests/transfers/multiapp_userobject_transfer/restricted_node_sub.i)
# yy is passed in from the parent app
[Mesh]
[line]
type = GeneratedMeshGenerator
dim = 1
nx = 5
xmax = 2.5
[]
[box]
type = SubdomainBoundingBoxGenerator
input = line
bottom_left = '0 -0.1 -0.1'
top_right = '1.5 0.1 0.1'
# need a different block ID than what is in the parent app to make sure the transfer works properly
block_id = 20
[]
[]
[AuxVariables]
[A]
[]
[S]
[]
[]
[AuxKernels]
[A_ak]
type = ParsedAux
variable = A
use_xyzt = true
expression = '2*x+4*${yy}'
execute_on = 'TIMESTEP_BEGIN'
[]
[]
[Variables]
[u]
[]
[]
[Kernels]
[td]
type = TimeDerivative
variable = u
[]
[diff]
type = Diffusion
variable = u
[]
[]
[UserObjects]
[A_avg]
type = LayeredAverage
block = 20
num_layers = 2
direction = x
variable = A
execute_on = TIMESTEP_END
[]
[]
[Executioner]
type = Transient
[]
[Outputs]
exodus = true
[]
(modules/porous_flow/examples/groundwater/ex01.i)
# Groundwater extraction example.
# System consists of two confined aquifers separated by an aquitard
# There is a hydraulic gradient in the upper aquifer
# A well extracts water from the lower aquifer, and the impact on the upper aquifer is observed
# In the center of the model, the roof of the upper aquifer sits 70m below the local water table
[Mesh]
[basic_mesh]
type = GeneratedMeshGenerator
dim = 3
xmin = -50
xmax = 50
nx = 20
ymin = -25
ymax = 25
ny = 10
zmin = -100
zmax = -70
nz = 3
[]
[lower_aquifer]
type = SubdomainBoundingBoxGenerator
input = basic_mesh
block_id = 1
block_name = lower_aquifer
bottom_left = '-1000 -500 -100'
top_right = '1000 500 -90'
[]
[aquitard]
type = SubdomainBoundingBoxGenerator
input = lower_aquifer
block_id = 2
block_name = aquitard
bottom_left = '-1000 -500 -90'
top_right = '1000 500 -80'
[]
[upper_aquifer]
type = SubdomainBoundingBoxGenerator
input = aquitard
block_id = 3
block_name = upper_aquifer
bottom_left = '-1000 -500 -80'
top_right = '1000 500 -70'
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Variables]
[pp]
[]
[]
[ICs]
[pp]
type = FunctionIC
variable = pp
function = insitu_pp
[]
[]
[BCs]
[pp]
type = FunctionDirichletBC
variable = pp
function = insitu_pp
boundary = 'left right top bottom front back'
[]
[]
[Functions]
[upper_aquifer_head]
type = ParsedFunction
expression = '10 + x / 200'
[]
[lower_aquifer_head]
type = ParsedFunction
expression = '20'
[]
[insitu_head]
type = ParsedFunction
symbol_values = 'lower_aquifer_head upper_aquifer_head'
symbol_names = 'low up'
expression = 'if(z <= -90, low, if(z >= -80, up, (up * (z + 90) - low * (z + 80)) / (10.0)))'
[]
[insitu_pp]
type = ParsedFunction
symbol_values = 'insitu_head'
symbol_names = 'h'
expression = '(h - z) * 1E4'
[]
[l_rate]
type = ParsedFunction
symbol_values = 'm3_produced dt'
symbol_names = 'm3_produced dt'
expression = '1000 * m3_produced / dt'
[]
[]
[AuxVariables]
[insitu_head]
[]
[head_change]
[]
[]
[AuxKernels]
[insitu_head]
type = FunctionAux
variable = insitu_head
function = insitu_head
[]
[head_change]
type = ParsedAux
coupled_variables = 'pp insitu_head'
use_xyzt = true
expression = 'pp / 1E4 + z - insitu_head'
variable = head_change
[]
[]
[Postprocessors]
[m3_produced]
type = PorousFlowPlotQuantity
uo = volume_extracted
outputs = 'none'
[]
[dt]
type = TimestepSize
outputs = 'none'
[]
[l_per_s]
type = FunctionValuePostprocessor
function = l_rate
[]
[]
[VectorPostprocessors]
[drawdown]
type = LineValueSampler
variable = head_change
start_point = '-50 0 -75'
end_point = '50 0 -75'
num_points = 101
sort_by = x
[]
[]
[PorousFlowBasicTHM]
fp = simple_fluid
gravity = '0 0 -10'
porepressure = pp
multiply_by_density = false
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
# the following mean that density = 1000 * exp(P / 1E15) ~ 1000
thermal_expansion = 0
bulk_modulus = 1E15
[]
[]
[Materials]
[porosity_aquifers]
type = PorousFlowPorosityConst
porosity = 0.05
block = 'upper_aquifer lower_aquifer'
[]
[porosity_aquitard]
type = PorousFlowPorosityConst
porosity = 0.2
block = aquitard
[]
[biot_mod]
type = PorousFlowConstantBiotModulus
fluid_bulk_modulus = 2E9
biot_coefficient = 1.0
[]
[permeability_aquifers]
type = PorousFlowPermeabilityConst
permeability = '1E-12 0 0 0 1E-12 0 0 0 1E-12'
block = 'upper_aquifer lower_aquifer'
[]
[permeability_aquitard]
type = PorousFlowPermeabilityConst
permeability = '1E-16 0 0 0 1E-16 0 0 0 1E-17'
block = aquitard
[]
[]
[DiracKernels]
[sink]
type = PorousFlowPolyLineSink
SumQuantityUO = volume_extracted
point_file = ex01.bh_lower
line_length = 10
variable = pp
# following produces a flux of 0 m^3(water)/m(borehole length)/s if porepressure = 0, and a flux of 1 m^3/m/s if porepressure = 1E9
p_or_t_vals = '0 1E9'
fluxes = '0 1'
[]
[]
[UserObjects]
[volume_extracted]
type = PorousFlowSumQuantity
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
[TimeStepper]
type = SolutionTimeAdaptiveDT
dt = 1.1E5
[]
end_time = 3.456E5 # 4 days
nl_abs_tol = 1E-13
[]
[Outputs]
[csv]
type = CSV
file_base = ex01_lower_extraction
execute_on = final
[]
[]
(modules/functional_expansion_tools/test/tests/standard_use/volume_sub.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s]
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXVolumeUserObject
function = FX_Basis_Value_Sub
variable = s
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(modules/solid_mechanics/test/tests/notched_plastic_block/cmc_planar.i)
# Uses an unsmoothed version of capped-Mohr-Coulomb (via ComputeMultiPlasticityStress with SolidMechanicsPlasticTensileMulti and SolidMechanicsPlasticMohrCoulombMulti) to simulate the following problem.
# A cubical block is notched around its equator.
# All of its outer surfaces have roller BCs, but the notched region is free to move as needed
# The block is initialised with a high hydrostatic tensile stress
# Without the notch, the BCs do not allow contraction of the block, and this stress configuration is admissible
# With the notch, however, the interior parts of the block are free to move in order to relieve stress, and this causes plastic failure
# The top surface is then pulled upwards (the bottom is fixed because of the roller BCs)
# This causes more failure
[Mesh]
[generated_mesh]
type = GeneratedMeshGenerator
dim = 3
nx = 9
ny = 9
nz = 9
xmin = 0
xmax = 0.1
ymin = 0
ymax = 0.1
zmin = 0
zmax = 0.1
[]
[block_to_remove_xmin]
type = SubdomainBoundingBoxGenerator
bottom_left = '-0.01 -0.01 0.045'
top_right = '0.01 0.11 0.055'
location = INSIDE
block_id = 1
input = generated_mesh
[]
[block_to_remove_xmax]
type = SubdomainBoundingBoxGenerator
bottom_left = '0.09 -0.01 0.045'
top_right = '0.11 0.11 0.055'
location = INSIDE
block_id = 1
input = block_to_remove_xmin
[]
[block_to_remove_ymin]
type = SubdomainBoundingBoxGenerator
bottom_left = '-0.01 -0.01 0.045'
top_right = '0.11 0.01 0.055'
location = INSIDE
block_id = 1
input = block_to_remove_xmax
[]
[block_to_remove_ymax]
type = SubdomainBoundingBoxGenerator
bottom_left = '-0.01 0.09 0.045'
top_right = '0.11 0.11 0.055'
location = INSIDE
block_id = 1
input = block_to_remove_ymin
[]
[remove_block]
type = BlockDeletionGenerator
block = 1
input = block_to_remove_ymax
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
[./all]
add_variables = true
incremental = true
generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_zz'
eigenstrain_names = ini_stress
[../]
[]
[Postprocessors]
[./uz]
type = PointValue
point = '0 0 0.1'
use_displaced_mesh = false
variable = disp_z
[../]
[./s_zz]
type = ElementAverageValue
use_displaced_mesh = false
variable = stress_zz
[../]
[./num_res]
type = NumResidualEvaluations
[../]
[./nr_its]
type = ElementAverageValue
variable = num_iters
[../]
[./max_nr_its]
type = ElementExtremeValue
variable = num_iters
[../]
[./runtime]
type = PerfGraphData
data_type = TOTAL
section_name = 'Root'
[../]
[]
[BCs]
# back=zmin, front=zmax, bottom=ymin, top=ymax, left=xmin, right=xmax
[./xmin_xzero]
type = DirichletBC
variable = disp_x
boundary = left
value = 0.0
[../]
[./xmax_xzero]
type = DirichletBC
variable = disp_x
boundary = right
value = 0.0
[../]
[./ymin_yzero]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[../]
[./ymax_yzero]
type = DirichletBC
variable = disp_y
boundary = top
value = 0.0
[../]
[./zmin_zzero]
type = DirichletBC
variable = disp_z
boundary = back
value = '0'
[../]
[./zmax_disp]
type = FunctionDirichletBC
variable = disp_z
boundary = front
function = '1E-6*max(t,0)'
[../]
[]
[AuxVariables]
[./mc_int]
order = CONSTANT
family = MONOMIAL
[../]
[./plastic_strain]
order = CONSTANT
family = MONOMIAL
[../]
[./num_iters]
order = CONSTANT
family = MONOMIAL
[../]
[./yield_fcn]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./mc_int_auxk]
type = MaterialStdVectorAux
index = 0
property = plastic_internal_parameter
variable = mc_int
[../]
[./plastic_strain_aux]
type = MaterialRankTwoTensorAux
i = 2
j = 2
property = plastic_strain
variable = plastic_strain
[../]
[./num_iters_auxk] # cannot use plastic_NR_iterations directly as this is zero, since no NR iterations are actually used, since we use a custom algorithm to do the return
type = ParsedAux
coupled_variables = plastic_strain
expression = 'if(plastic_strain>0,1,0)'
variable = num_iters
[../]
[./yield_fcn_auxk]
type = MaterialStdVectorAux
index = 0
property = plastic_yield_function
variable = yield_fcn
[../]
[]
[UserObjects]
[./ts]
type = SolidMechanicsHardeningConstant
value = 3E6
[../]
[./tensile]
type = SolidMechanicsPlasticTensileMulti
tensile_strength = ts
yield_function_tolerance = 1
internal_constraint_tolerance = 1.0E-6
#shift = 1
use_custom_returnMap = false
use_custom_cto = false
[../]
[./mc_coh]
type = SolidMechanicsHardeningConstant
value = 5E6
[../]
[./mc_phi]
type = SolidMechanicsHardeningConstant
value = 35
convert_to_radians = true
[../]
[./mc_psi]
type = SolidMechanicsHardeningConstant
value = 10
convert_to_radians = true
[../]
[./mc]
type = SolidMechanicsPlasticMohrCoulombMulti
cohesion = mc_coh
friction_angle = mc_phi
dilation_angle = mc_psi
yield_function_tolerance = 1E-5
internal_constraint_tolerance = 1E-11
use_custom_returnMap = false
[../]
[]
[Materials]
[./elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 16E9
poissons_ratio = 0.25
[../]
[./mc]
type = ComputeMultiPlasticityStress
ep_plastic_tolerance = 1E-6
plastic_models = 'tensile mc'
max_NR_iterations = 50
specialIC = rock
deactivation_scheme = safe_to_dumb
debug_fspb = crash
[../]
[./strain_from_initial_stress]
type = ComputeEigenstrainFromInitialStress
initial_stress = '2.5E6 0 0 0 2.5E6 0 0 0 2.5E6'
eigenstrain_name = ini_stress
[../]
[]
[Preconditioning]
[./andy]
type = SMP
full = true
[../]
[]
[Executioner]
start_time = -1
end_time = 10
dt = 1
solve_type = NEWTON
type = Transient
l_tol = 1E-2
nl_abs_tol = 1E-5
nl_rel_tol = 1E-7
l_max_its = 200
nl_max_its = 400
petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
petsc_options_value = ' asm 2 lu gmres 200'
[]
[Outputs]
file_base = cmc_planar
perf_graph = true
exodus = false
csv = true
[]
(modules/solid_mechanics/test/tests/torque/torque_small.i)
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
origin = '0 0 2'
direction = '0 0 1'
polar_moment_of_inertia = pmi
factor = t
[]
[Mesh]
[ring]
type = AnnularMeshGenerator
nr = 1
nt = 30
rmin = 0.95
rmax = 1
[]
[extrude]
type = MeshExtruderGenerator
input = ring
extrusion_vector = '0 0 2'
bottom_sideset = 'bottom'
top_sideset = 'top'
num_layers = 5
[]
[]
[AuxVariables]
[alpha_var]
[]
[shear_stress_var]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[alpha]
type = RotationAngle
variable = alpha_var
[]
[shear_stress]
type = ParsedAux
variable = shear_stress_var
coupled_variables = 'stress_yz stress_xz'
expression = 'sqrt(stress_yz^2 + stress_xz^2)'
[]
[]
[BCs]
# fix bottom
[fix_x]
type = DirichletBC
boundary = bottom
variable = disp_x
value = 0
[]
[fix_y]
type = DirichletBC
boundary = bottom
variable = disp_y
value = 0
[]
[fix_z]
type = DirichletBC
boundary = bottom
variable = disp_z
value = 0
[]
# twist top
[twist_x]
type = Torque
boundary = top
variable = disp_x
[]
[twist_y]
type = Torque
boundary = top
variable = disp_y
[]
[twist_z]
type = Torque
boundary = top
variable = disp_z
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
add_variables = true
strain = SMALL
generate_output = 'vonmises_stress stress_yz stress_xz'
[]
[]
[Postprocessors]
[pmi]
type = PolarMomentOfInertia
boundary = top
# execute_on = 'INITIAL NONLINEAR'
execute_on = 'INITIAL'
[]
[alpha]
type = SideAverageValue
variable = alpha_var
boundary = top
[]
[shear_stress]
type = ElementAverageValue
variable = shear_stress_var
[]
[]
[Materials]
[stress]
type = ComputeLinearElasticStress
[]
[elastic]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 0.3
shear_modulus = 100
[]
[]
[Executioner]
# type = Steady
type = Transient
num_steps = 1
solve_type = PJFNK
petsc_options_iname = '-pctype'
petsc_options_value = 'lu'
nl_max_its = 150
[]
[Outputs]
exodus = true
print_linear_residuals = false
perf_graph = true
[]
(modules/navier_stokes/test/tests/finite_volume/pwcns/channel-flow/2d-transient-action.i)
# Solid properties
cp_s = 2
rho_s = 4
k_s = 1e-2
h_fs = 10
# Operating conditions
u_inlet = 1
T_inlet = 200
p_outlet = 10
top_side_temperature = 150
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = 0
ymax = 1
nx = 20
ny = 5
[]
[]
[Variables]
[T_solid]
type = MooseVariableFVReal
initial_condition = 100
[]
[]
[AuxVariables]
[porosity]
type = MooseVariableFVReal
initial_condition = 0.5
[]
[velocity_norm]
type = MooseVariableFVReal
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[Modules]
[NavierStokesFV]
compressibility = 'weakly-compressible'
add_energy_equation = true
porous_medium_treatment = true
density = 'rho'
dynamic_viscosity = 'mu'
thermal_conductivity = 'k'
specific_heat = 'cp'
initial_velocity = '${u_inlet} 1e-6 0'
initial_pressure = '${p_outlet}'
initial_temperature = '${T_inlet}'
inlet_boundaries = 'left'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_function = '${u_inlet} 0'
energy_inlet_types = 'fixed-temperature'
energy_inlet_function = '${T_inlet}'
wall_boundaries = 'top bottom'
momentum_wall_types = 'noslip symmetry'
energy_wall_types = 'heatflux heatflux'
energy_wall_function = '0 0'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '${p_outlet}'
ambient_convection_alpha = 'h_cv'
ambient_temperature = 'T_solid'
mass_advection_interpolation = 'average'
momentum_advection_interpolation = 'average'
energy_advection_interpolation = 'average'
[]
[]
[FVKernels]
[solid_energy_time]
type = PINSFVEnergyTimeDerivative
variable = T_solid
cp = ${cp_s}
rho = ${rho_s}
is_solid = true
porosity = 'porosity'
[]
[solid_energy_diffusion]
type = FVDiffusion
variable = T_solid
coeff = ${k_s}
[]
[solid_energy_convection]
type = PINSFVEnergyAmbientConvection
variable = T_solid
is_solid = true
T_fluid = 'T_fluid'
T_solid = 'T_solid'
h_solid_fluid = 'h_cv'
[]
[]
[FVBCs]
[heated-side]
type = FVDirichletBC
boundary = 'top'
variable = 'T_solid'
value = ${top_side_temperature}
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'h_cv'
prop_values = '${h_fs}'
[]
[fluid_props_to_mat_props]
type = GeneralFunctorFluidProps
fp = fp
pressure = 'pressure'
T_fluid = 'T_fluid'
speed = 'velocity_norm'
# To initialize with a high viscosity
mu_rampdown = 'mu_rampdown'
# For porous flow
characteristic_length = 1
porosity = 'porosity'
[]
[]
[Functions]
[mu_rampdown]
type = PiecewiseLinear
x = '1 2 3 4'
y = '1e3 1e2 1e1 1'
[]
[]
[AuxKernels]
[speed]
type = ParsedAux
variable = 'velocity_norm'
coupled_variables = 'superficial_vel_x superficial_vel_y porosity'
expression = 'sqrt(superficial_vel_x*superficial_vel_x + superficial_vel_y*superficial_vel_y) / '
'porosity'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'asm 100 lu NONZERO'
line_search = 'none'
nl_rel_tol = 1e-12
end_time = 3.0
[]
# Some basic Postprocessors to examine the solution
[Postprocessors]
[inlet-p]
type = SideAverageValue
variable = pressure
boundary = 'left'
[]
[outlet-u]
type = SideAverageValue
variable = superficial_vel_x
boundary = 'right'
[]
[outlet-temp]
type = SideAverageValue
variable = T_fluid
boundary = 'right'
[]
[solid-temp]
type = ElementAverageValue
variable = T_solid
[]
[]
[Outputs]
exodus = true
csv = false
[]
(modules/functional_expansion_tools/test/tests/standard_use/volume_coupling_custom_norm_sub.i)
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s]
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
generation_type = 'sqrt_mu'
expansion_type = 'sqrt_mu'
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXVolumeUserObject
function = FX_Basis_Value_Sub
variable = s
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(modules/geochemistry/test/tests/solubilities_and_activities/gypsum_solubility.i)
[TimeDependentReactionSolver]
model_definition = definition
swap_out_of_basis = "Ca++"
swap_into_basis = "Gypsum"
charge_balance_species = "SO4--"
constraint_species = "H2O Cl- Na+ SO4-- Gypsum"
constraint_value = " 1.0 1E-10 1E-10 1E-6 0.5814"
constraint_meaning = "kg_solvent_water free_concentration free_concentration bulk_composition free_mineral"
constraint_unit = " kg molal molal moles moles"
source_species_names = 'NaCl'
source_species_rates = '1.0'
add_aux_pH = false # there is no H+ in the problem
ramp_max_ionic_strength_initial = 0 # not needed in this simple problem
stoichiometric_ionic_str_using_Cl_only = true # for comparison with GWB
abs_tol = 1E-12
execute_console_output_on = '' # only CSV output in this example
[]
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "../../../database/moose_geochemdb.json"
basis_species = "H2O Cl- Na+ SO4-- Ca++"
equilibrium_minerals = "Gypsum"
piecewise_linear_interpolation = true # for comparison with GWB
[]
[]
[Functions]
[timestepper]
type = PiecewiseLinear
x = '0 0.1'
y = '0.01 0.1'
[]
[]
[Executioner]
type = Transient
[TimeStepper]
type = FunctionDT
function = timestepper
[]
end_time = 3
[]
[Outputs]
csv = true
[]
[AuxVariables]
[dissolved_gypsum_moles]
[]
[]
[AuxKernels]
[dissolved_gypsum_moles]
type = ParsedAux
coupled_variables = 'bulk_moles_Gypsum free_mg_Gypsum'
expression = 'bulk_moles_Gypsum - free_mg_Gypsum / 1000 / 172.168 '
variable = dissolved_gypsum_moles
execute_on = 'timestep_end'
[]
[]
[Postprocessors]
[cl_molal]
type = PointValue
point = '0 0 0'
variable = 'molal_Cl-'
[]
[dissolved_gypsum_mol]
type = PointValue
point = '0 0 0'
variable = dissolved_gypsum_moles
[]
[]
(modules/geochemistry/test/tests/kinetics/quartz_dissolution.i)
# Example of quartz dissolution.
[TimeDependentReactionSolver]
model_definition = definition
geochemistry_reactor_name = reactor
charge_balance_species = "Cl-"
constraint_species = "H2O H+ Cl- SiO2(aq)"
constraint_value = " 1.0 1E-10 1E-10 1E-9"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition free_concentration"
constraint_unit = " kg moles moles molal"
initial_temperature = 100.0
temperature = 100.0
kinetic_species_name = Quartz
kinetic_species_initial_value = 5
kinetic_species_unit = kg
ramp_max_ionic_strength_initial = 0 # max_ionic_strength in such a simple problem does not need ramping
stoichiometric_ionic_str_using_Cl_only = true # for comparison with GWB
execute_console_output_on = '' # only CSV output for this example
[]
[UserObjects]
[rate_quartz]
type = GeochemistryKineticRate
kinetic_species_name = Quartz
intrinsic_rate_constant = 1.728E-10 # 2.0E-15mol/s/cm^2 = 1.728E-10mol/day/cm^2
multiply_by_mass = true
area_quantity = 1000
[]
[definition]
type = GeochemicalModelDefinition
database_file = "../../../database/moose_geochemdb.json"
basis_species = "H2O SiO2(aq) H+ Cl-"
kinetic_minerals = "Quartz"
kinetic_rate_descriptions = "rate_quartz"
piecewise_linear_interpolation = true # for comparison with GWB
[]
[]
[Functions]
[timestepper]
type = PiecewiseLinear
x = '0 0.5 3'
y = '0.01 0.05 0.1'
[]
[]
[Executioner]
type = Transient
[TimeStepper]
type = FunctionDT
function = timestepper
[]
end_time = 5.0
[]
[AuxVariables]
[diss]
[]
[]
[AuxKernels]
[diss]
type = ParsedAux
coupled_variables = moles_Quartz
expression = '83.216414271 - moles_Quartz'
variable = diss
[]
[]
[Postprocessors]
[dissolved_moles]
type = PointValue
point = '0 0 0'
variable = diss
[]
[]
[Outputs]
csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/pwcns/channel-flow/2d-transient.i)
# Fluid properties
mu = 'mu'
rho = 'rho'
cp = 'cp'
k = 'k'
# Solid properties
cp_s = 2
rho_s = 4
k_s = 1e-2
h_fs = 10
# Operating conditions
u_inlet = 1
T_inlet = 200
p_outlet = 10
top_side_temperature = 150
# Numerical scheme
advected_interp_method = 'average'
velocity_interp_method = 'rc'
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = 0
ymax = 1
nx = 20
ny = 5
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = PINSFVRhieChowInterpolator
u = superficial_vel_x
v = superficial_vel_y
pressure = pressure
porosity = porosity
[]
[]
[Variables]
[superficial_vel_x]
type = PINSFVSuperficialVelocityVariable
initial_condition = ${u_inlet}
[]
[superficial_vel_y]
type = PINSFVSuperficialVelocityVariable
initial_condition = 1e-6
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${p_outlet}
[]
[T_fluid]
type = INSFVEnergyVariable
initial_condition = ${T_inlet}
[]
[T_solid]
type = MooseVariableFVReal
initial_condition = 100
[]
[]
[AuxVariables]
[porosity]
type = MooseVariableFVReal
initial_condition = 0.5
[]
[velocity_norm]
type = MooseVariableFVReal
[]
[]
[FVKernels]
[mass_time]
type = PWCNSFVMassTimeDerivative
variable = pressure
porosity = 'porosity'
drho_dt = 'drho_dt'
[]
[mass]
type = PWCNSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = superficial_vel_x
rho = ${rho}
drho_dt = 'drho_dt'
momentum_component = 'x'
[]
[u_advection]
type = PINSFVMomentumAdvection
variable = superficial_vel_x
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
porosity = porosity
momentum_component = 'x'
[]
[u_viscosity]
type = PINSFVMomentumDiffusion
variable = superficial_vel_x
mu = ${mu}
porosity = porosity
momentum_component = 'x'
[]
[u_pressure]
type = PINSFVMomentumPressure
variable = superficial_vel_x
momentum_component = 'x'
pressure = pressure
porosity = porosity
[]
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = superficial_vel_y
rho = ${rho}
drho_dt = 'drho_dt'
momentum_component = 'y'
[]
[v_advection]
type = PINSFVMomentumAdvection
variable = superficial_vel_y
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
porosity = porosity
momentum_component = 'y'
[]
[v_viscosity]
type = PINSFVMomentumDiffusion
variable = superficial_vel_y
mu = ${mu}
porosity = porosity
momentum_component = 'y'
[]
[v_pressure]
type = PINSFVMomentumPressure
variable = superficial_vel_y
momentum_component = 'y'
pressure = pressure
porosity = porosity
[]
[energy_time]
type = PINSFVEnergyTimeDerivative
variable = T_fluid
cp = ${cp}
rho = ${rho}
drho_dt = 'drho_dt'
is_solid = false
porosity = porosity
[]
[energy_advection]
type = PINSFVEnergyAdvection
variable = T_fluid
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[energy_diffusion]
type = PINSFVEnergyDiffusion
variable = T_fluid
k = ${k}
porosity = porosity
[]
[energy_convection]
type = PINSFVEnergyAmbientConvection
variable = T_fluid
is_solid = false
T_fluid = T_fluid
T_solid = T_solid
h_solid_fluid = 'h_cv'
[]
[solid_energy_time]
type = PINSFVEnergyTimeDerivative
variable = T_solid
cp = ${cp_s}
rho = ${rho_s}
is_solid = true
porosity = porosity
[]
[solid_energy_diffusion]
type = FVDiffusion
variable = T_solid
coeff = ${k_s}
[]
[solid_energy_convection]
type = PINSFVEnergyAmbientConvection
variable = T_solid
is_solid = true
T_fluid = T_fluid
T_solid = T_solid
h_solid_fluid = 'h_cv'
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = superficial_vel_x
function = ${u_inlet}
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = superficial_vel_y
function = 0
[]
[inlet-T]
type = FVDirichletBC
variable = T_fluid
value = ${T_inlet}
boundary = 'left'
[]
[no-slip-u]
type = INSFVNoSlipWallBC
boundary = 'top'
variable = superficial_vel_x
function = 0
[]
[no-slip-v]
type = INSFVNoSlipWallBC
boundary = 'top'
variable = superficial_vel_y
function = 0
[]
[heated-side]
type = FVDirichletBC
boundary = 'top'
variable = 'T_solid'
value = ${top_side_temperature}
[]
[symmetry-u]
type = PINSFVSymmetryVelocityBC
boundary = 'bottom'
variable = superficial_vel_x
u = superficial_vel_x
v = superficial_vel_y
mu = ${mu}
momentum_component = 'x'
[]
[symmetry-v]
type = PINSFVSymmetryVelocityBC
boundary = 'bottom'
variable = superficial_vel_y
u = superficial_vel_x
v = superficial_vel_y
mu = ${mu}
momentum_component = 'y'
[]
[symmetry-p]
type = INSFVSymmetryPressureBC
boundary = 'bottom'
variable = pressure
[]
[outlet-p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = ${p_outlet}
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[fluid_props_to_mat_props]
type = GeneralFunctorFluidProps
fp = fp
pressure = 'pressure'
T_fluid = 'T_fluid'
speed = 'velocity_norm'
# To initialize with a high viscosity
mu_rampdown = 'mu_rampdown'
# For porous flow
characteristic_length = 1
porosity = 'porosity'
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
rho = ${rho}
temperature = 'T_fluid'
[]
[constants]
type = ADGenericFunctorMaterial
prop_names = 'h_cv'
prop_values = '${h_fs}'
[]
[]
[Functions]
[mu_rampdown]
type = PiecewiseLinear
x = '1 2 3 4'
y = '1e3 1e2 1e1 1'
[]
[]
[AuxKernels]
[speed]
type = ParsedAux
variable = 'velocity_norm'
coupled_variables = 'superficial_vel_x superficial_vel_y porosity'
expression = 'sqrt(superficial_vel_x*superficial_vel_x + superficial_vel_y*superficial_vel_y) / '
'porosity'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'asm 100 lu NONZERO'
line_search = 'none'
nl_rel_tol = 1e-12
end_time = 3.0
[]
# Some basic Postprocessors to examine the solution
[Postprocessors]
[inlet-p]
type = SideAverageValue
variable = pressure
boundary = 'left'
[]
[outlet-u]
type = SideAverageValue
variable = superficial_vel_x
boundary = 'right'
[]
[outlet-temp]
type = SideAverageValue
variable = T_fluid
boundary = 'right'
[]
[solid-temp]
type = ElementAverageValue
variable = T_solid
[]
[]
[Outputs]
exodus = true
csv = false
[]
(modules/functional_expansion_tools/examples/3D_volumetric_Cartesian_different_submesh/sub.i)
# Derived from the example '3D_volumetric_Cartesian' with the following differences:
#
# 1) The number of x and y divisions in the sub app is not the same as the master app
# 2) The subapp mesh is skewed in x and z
[Mesh]
type = GeneratedMesh
dim = 3
xmin = 0.0
xmax = 10.0
nx = 23
bias_x = 1.2
ymin = 1.0
ymax = 11.0
ny = 33
zmin = 2.0
zmax = 12.0
nz = 35
bias_z = 0.8
[]
# Non-copy transfers only work with AuxVariable, but nothing will be solved without a variable
# defined. The solution is to define an empty variable tha does nothing, but causes MOOSE to solve
# the AuxKernels that we need.
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
# We must have a kernel for every variable, hence this null kernel to match the variable 'empty'
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s] # Something to make 's' change each time, but allow a converging solution
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '3 4 5'
physical_bounds = '0.0 10.0 1.0 11.0 2.0 12.0'
x = Legendre
y = Legendre
z = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXVolumeUserObject
function = FX_Basis_Value_Sub
variable = s
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(modules/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
[]
[]
(modules/functional_expansion_tools/examples/3D_volumetric_cylindrical/sub.i)
# Basic example coupling a master and sub app in a 3D cylindrical mesh from an input file
#
# The master app provides field values to the sub app via Functional Expansions, which then performs
# its calculations. The sub app's solution field values are then transferred back to the master app
# and coupled into the solution of the master app solution.
#
# This example couples Functional Expansions via AuxVariable, the recommended approach.
#
# Note: this problem is not light, and may take a few minutes to solve.
[Mesh]
type = FileMesh
file = cyl-tet.e
[]
# Non-copy transfers only work with AuxVariable, but nothing will be solved without a variable
# defined. The solution is to define an empty variable tha does nothing, but causes MOOSE to solve
# the AuxKernels that we need.
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
# We must have a kernel for every variable, hence this null kernel to match the variable 'empty'
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s] # Something to make 's' change each time, but allow a converging solution
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = CylindricalDuo
orders = '5 3' # Axial first, then (r, t) FX
physical_bounds = '-2.5 2.5 0 0 1' # z_min z_max x_center y_center radius
z = Legendre # Axial in z
disc = Zernike # (r, t) default to unit disc in x-y plane
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXVolumeUserObject
function = FX_Basis_Value_Sub
variable = s
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(modules/combined/examples/geochem-porous_flow/geotes_weber_tensleep/exchanger.i)
#########################################
# #
# File written by create_input_files.py #
# #
#########################################
# Model of the heat-exchanger
# The input fluid to the heat exchanger is determined by AuxVariables called production_temperature, production_rate_H, production_rate_Cl, production_rate_SO4, production_rate_HCO3, production_rate_SiO2aq, production_rate_Al, production_rate_Ca, production_rate_Mg, production_rate_Fe, production_rate_K, production_rate_Na, production_rate_Sr, production_rate_F, production_rate_BOH, production_rate_Br, production_rate_Ba, production_rate_Li, production_rate_NO3, production_rate_O2aq, production_rate_H2O. These come from Postprocessors in the porous_flow.i simulation that measure the fluid composition at the production well.
# Given the input fluid, the exchanger cools/heats the fluid, removing any precipitates, and injects fluid back to porous_flow.i at temperature output_temperature and composition given by massfrac_H, etc.
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = '../../../../geochemistry/database/moose_geochemdb.json'
basis_species = 'H2O H+ Cl- SO4-- HCO3- SiO2(aq) Al+++ Ca++ Mg++ Fe++ K+ Na+ Sr++ F- B(OH)3 Br- Ba++ Li+ NO3- O2(aq)'
equilibrium_minerals = 'Siderite Pyrrhotite Dolomite Illite Anhydrite Calcite Quartz K-feldspar Kaolinite Barite Celestite Fluorite Albite Chalcedony Goethite'
[]
[]
[TimeDependentReactionSolver]
model_definition = definition
include_moose_solve = false
geochemistry_reactor_name = reactor
swap_out_of_basis = 'NO3- O2(aq)'
swap_into_basis = ' NH3 HS-'
charge_balance_species = 'Cl-'
# initial conditions are unimportant because in exchanger mode all existing fluid is flushed from the system before adding the produced water
constraint_species = 'H2O H+ Cl- SO4-- HCO3- SiO2(aq) Al+++ Ca++ Mg++ Fe++ K+ Na+ Sr++ F- B(OH)3 Br- Ba++ Li+ NH3 HS-'
constraint_value = '1.0 1E-6 1E-6 1E-18 1E-18 1E-18 1E-18 1E-18 1E-18 1E-18 1E-18 1E-18 1E-18 1E-18 1E-18 1E-18 1E-18 1E-18 1E-18 1E-18'
constraint_meaning = 'kg_solvent_water bulk_composition bulk_composition free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration free_concentration'
constraint_unit = "kg moles moles molal molal molal molal molal molal molal molal molal molal molal molal molal molal molal molal molal"
prevent_precipitation = 'Fluorite Albite Goethite'
initial_temperature = 92
mode = 4
temperature = ramp_temperature # ramp up to 160degC over ~1 day so that aquifer geochemistry simulation can easily converge
cold_temperature = 92
heating_increments = 10
source_species_names = ' H+ Cl- SO4-- HCO3- SiO2(aq) Al+++ Ca++ Mg++ Fe++ K+ Na+ Sr++ F- B(OH)3 Br- Ba++ Li+ NO3- O2(aq) H2O'
source_species_rates = ' production_rate_H production_rate_Cl production_rate_SO4 production_rate_HCO3 production_rate_SiO2aq production_rate_Al production_rate_Ca production_rate_Mg production_rate_Fe production_rate_K production_rate_Na production_rate_Sr production_rate_F production_rate_BOH production_rate_Br production_rate_Ba production_rate_Li production_rate_NO3 production_rate_O2aq production_rate_H2O'
ramp_max_ionic_strength_initial = 0 # max_ionic_strength in such a simple problem does not need ramping
[]
[GlobalParams]
point = '0 0 0'
reactor = reactor
[]
[AuxVariables]
[ramp_temperature]
initial_condition = 92
[]
[production_temperature]
initial_condition = 92 # the production_T Transfer lags one timestep behind for some reason, so give this a reasonable initial condition
[]
[transported_H]
[]
[transported_Cl]
[]
[transported_SO4]
[]
[transported_HCO3]
[]
[transported_SiO2aq]
[]
[transported_Al]
[]
[transported_Ca]
[]
[transported_Mg]
[]
[transported_Fe]
[]
[transported_K]
[]
[transported_Na]
[]
[transported_Sr]
[]
[transported_F]
[]
[transported_BOH]
[]
[transported_Br]
[]
[transported_Ba]
[]
[transported_Li]
[]
[transported_NO3]
[]
[transported_O2aq]
[]
[transported_H2O]
[]
[transported_mass]
[]
[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]
[]
[massfrac_H2O]
[]
[dumped_Siderite]
[]
[dumped_Pyrrhotite]
[]
[dumped_Dolomite]
[]
[dumped_Illite]
[]
[dumped_Anhydrite]
[]
[dumped_Calcite]
[]
[dumped_Quartz]
[]
[dumped_K-feldspar]
[]
[dumped_Kaolinite]
[]
[dumped_Barite]
[]
[dumped_Celestite]
[]
[dumped_Fluorite]
[]
[dumped_Albite]
[]
[dumped_Chalcedony]
[]
[dumped_Goethite]
[]
# The production_* Transfers lag one timestep behind for some reason (when the porous_flow simulation has finished, it correctly computes mole_rate_*_produced, but the Transfer gets the mole_rate_*_produced from the previous timestep), so give the production_rate_* reasonable initial conditions, otherwise they will be zero at the start of the simulation.
[production_rate_H]
initial_condition = -0.00058596786807342
[]
[production_rate_Cl]
initial_condition = 0.274767413291287
[]
[production_rate_SO4]
initial_condition = 0.012567456786868922
[]
[production_rate_HCO3]
initial_condition = 0.0001668295857850308
[]
[production_rate_SiO2aq]
initial_condition = 0.00010068057668449495
[]
[production_rate_Al]
initial_condition = 2.4224219572143877e-07
[]
[production_rate_Ca]
initial_condition = 0.0040997718654983036
[]
[production_rate_Mg]
initial_condition = 0.00015261342984691217
[]
[production_rate_Fe]
initial_condition = 0.0001550375425863269
[]
[production_rate_K]
initial_condition = 0.0003500651859998926
[]
[production_rate_Na]
initial_condition = 0.2896767602995328
[]
[production_rate_Sr]
initial_condition = 2.915285700108879e-05
[]
[production_rate_F]
initial_condition = 5.8582680830041476e-05
[]
[production_rate_BOH]
initial_condition = 0.0012157199878760335
[]
[production_rate_Br]
initial_condition = 0.00022605948665165203
[]
[production_rate_Ba]
initial_condition = 2.2773554030672105e-07
[]
[production_rate_Li]
initial_condition = 0.0023920780265869763
[]
[production_rate_NO3]
initial_condition = 0.000353470613973057
[]
[production_rate_O2aq]
initial_condition = -0.00044255942331181803
[]
[production_rate_H2O]
initial_condition = 10.10458252764496
[]
[]
[AuxKernels]
[ramp_temperature]
type = FunctionAux
variable = ramp_temperature
function = 'min(160, max(92, 92 + (160 - 92) * t / 1E5))'
[]
[transported_H_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_H
species = 'H+'
[]
[transported_Cl_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_Cl
species = 'Cl-'
[]
[transported_SO4_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_SO4
species = 'SO4--'
[]
[transported_HCO3_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_HCO3
species = 'HCO3-'
[]
[transported_SiO2aq_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_SiO2aq
species = 'SiO2(aq)'
[]
[transported_Al_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_Al
species = 'Al+++'
[]
[transported_Ca_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_Ca
species = 'Ca++'
[]
[transported_Mg_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_Mg
species = 'Mg++'
[]
[transported_Fe_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_Fe
species = 'Fe++'
[]
[transported_K_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_K
species = 'K+'
[]
[transported_Na_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_Na
species = 'Na+'
[]
[transported_Sr_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_Sr
species = 'Sr++'
[]
[transported_F_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_F
species = 'F-'
[]
[transported_BOH_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_BOH
species = 'B(OH)3'
[]
[transported_Br_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_Br
species = 'Br-'
[]
[transported_Ba_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_Ba
species = 'Ba++'
[]
[transported_Li_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_Li
species = 'Li+'
[]
[transported_NO3_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_NO3
species = 'NO3-'
[]
[transported_O2aq_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_O2aq
species = 'O2(aq)'
[]
[transported_H2O_auxk]
type = GeochemistryQuantityAux
quantity = transported_moles_in_original_basis
variable = transported_H2O
species = 'H2O'
[]
[transported_mass_auxk]
type = ParsedAux
coupled_variables = ' transported_H transported_Cl transported_SO4 transported_HCO3 transported_SiO2aq transported_Al transported_Ca transported_Mg transported_Fe transported_K transported_Na transported_Sr transported_F transported_BOH transported_Br transported_Ba transported_Li transported_NO3 transported_O2aq transported_H2O'
variable = transported_mass
expression = ' transported_H * 1.0079 + transported_Cl * 35.453 + transported_SO4 * 96.0576 + transported_HCO3 * 61.0171 + transported_SiO2aq * 60.0843 + transported_Al * 26.9815 + transported_Ca * 40.08 + transported_Mg * 24.305 + transported_Fe * 55.847 + transported_K * 39.0983 + transported_Na * 22.9898 + transported_Sr * 87.62 + transported_F * 18.9984 + transported_BOH * 61.8329 + transported_Br * 79.904 + transported_Ba * 137.33 + transported_Li * 6.941 + transported_NO3 * 62.0049 + transported_O2aq * 31.9988 + transported_H2O * 18.01801802'
[]
[massfrac_H_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_H'
variable = massfrac_H
expression = '1.0079 * transported_H / transported_mass'
[]
[massfrac_Cl_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_Cl'
variable = massfrac_Cl
expression = '35.453 * transported_Cl / transported_mass'
[]
[massfrac_SO4_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_SO4'
variable = massfrac_SO4
expression = '96.0576 * transported_SO4 / transported_mass'
[]
[massfrac_HCO3_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_HCO3'
variable = massfrac_HCO3
expression = '61.0171 * transported_HCO3 / transported_mass'
[]
[massfrac_SiO2aq_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_SiO2aq'
variable = massfrac_SiO2aq
expression = '60.0843 * transported_SiO2aq / transported_mass'
[]
[massfrac_Al_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_Al'
variable = massfrac_Al
expression = '26.9815 * transported_Al / transported_mass'
[]
[massfrac_Ca_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_Ca'
variable = massfrac_Ca
expression = '40.08 * transported_Ca / transported_mass'
[]
[massfrac_Mg_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_Mg'
variable = massfrac_Mg
expression = '24.305 * transported_Mg / transported_mass'
[]
[massfrac_Fe_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_Fe'
variable = massfrac_Fe
expression = '55.847 * transported_Fe / transported_mass'
[]
[massfrac_K_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_K'
variable = massfrac_K
expression = '39.0983 * transported_K / transported_mass'
[]
[massfrac_Na_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_Na'
variable = massfrac_Na
expression = '22.9898 * transported_Na / transported_mass'
[]
[massfrac_Sr_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_Sr'
variable = massfrac_Sr
expression = '87.62 * transported_Sr / transported_mass'
[]
[massfrac_F_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_F'
variable = massfrac_F
expression = '18.9984 * transported_F / transported_mass'
[]
[massfrac_BOH_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_BOH'
variable = massfrac_BOH
expression = '61.8329 * transported_BOH / transported_mass'
[]
[massfrac_Br_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_Br'
variable = massfrac_Br
expression = '79.904 * transported_Br / transported_mass'
[]
[massfrac_Ba_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_Ba'
variable = massfrac_Ba
expression = '137.33 * transported_Ba / transported_mass'
[]
[massfrac_Li_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_Li'
variable = massfrac_Li
expression = '6.941 * transported_Li / transported_mass'
[]
[massfrac_NO3_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_NO3'
variable = massfrac_NO3
expression = '62.0049 * transported_NO3 / transported_mass'
[]
[massfrac_O2aq_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_O2aq'
variable = massfrac_O2aq
expression = '31.9988 * transported_O2aq / transported_mass'
[]
[massfrac_H2O_auxk]
type = ParsedAux
coupled_variables = 'transported_mass transported_H2O'
variable = massfrac_H2O
expression = '18.01801802 * transported_H2O / transported_mass'
[]
[dumped_Siderite_auxk]
type = GeochemistryQuantityAux
variable = dumped_Siderite
species = Siderite
quantity = moles_dumped
[]
[dumped_Pyrrhotite_auxk]
type = GeochemistryQuantityAux
variable = dumped_Pyrrhotite
species = Pyrrhotite
quantity = moles_dumped
[]
[dumped_Dolomite_auxk]
type = GeochemistryQuantityAux
variable = dumped_Dolomite
species = Dolomite
quantity = moles_dumped
[]
[dumped_Illite_auxk]
type = GeochemistryQuantityAux
variable = dumped_Illite
species = Illite
quantity = moles_dumped
[]
[dumped_Anhydrite_auxk]
type = GeochemistryQuantityAux
variable = dumped_Anhydrite
species = Anhydrite
quantity = moles_dumped
[]
[dumped_Calcite_auxk]
type = GeochemistryQuantityAux
variable = dumped_Calcite
species = Calcite
quantity = moles_dumped
[]
[dumped_Quartz_auxk]
type = GeochemistryQuantityAux
variable = dumped_Quartz
species = Quartz
quantity = moles_dumped
[]
[dumped_K-feldspar_auxk]
type = GeochemistryQuantityAux
variable = dumped_K-feldspar
species = K-feldspar
quantity = moles_dumped
[]
[dumped_Kaolinite_auxk]
type = GeochemistryQuantityAux
variable = dumped_Kaolinite
species = Kaolinite
quantity = moles_dumped
[]
[dumped_Barite_auxk]
type = GeochemistryQuantityAux
variable = dumped_Barite
species = Barite
quantity = moles_dumped
[]
[dumped_Celestite_auxk]
type = GeochemistryQuantityAux
variable = dumped_Celestite
species = Celestite
quantity = moles_dumped
[]
[dumped_Fluorite_auxk]
type = GeochemistryQuantityAux
variable = dumped_Fluorite
species = Fluorite
quantity = moles_dumped
[]
[dumped_Albite_auxk]
type = GeochemistryQuantityAux
variable = dumped_Albite
species = Albite
quantity = moles_dumped
[]
[dumped_Chalcedony_auxk]
type = GeochemistryQuantityAux
variable = dumped_Chalcedony
species = Chalcedony
quantity = moles_dumped
[]
[dumped_Goethite_auxk]
type = GeochemistryQuantityAux
variable = dumped_Goethite
species = Goethite
quantity = moles_dumped
[]
[]
[Postprocessors]
[cumulative_moles_precipitated_Siderite]
type = PointValue
variable = dumped_Siderite
[]
[cumulative_moles_precipitated_Pyrrhotite]
type = PointValue
variable = dumped_Pyrrhotite
[]
[cumulative_moles_precipitated_Dolomite]
type = PointValue
variable = dumped_Dolomite
[]
[cumulative_moles_precipitated_Illite]
type = PointValue
variable = dumped_Illite
[]
[cumulative_moles_precipitated_Anhydrite]
type = PointValue
variable = dumped_Anhydrite
[]
[cumulative_moles_precipitated_Calcite]
type = PointValue
variable = dumped_Calcite
[]
[cumulative_moles_precipitated_Quartz]
type = PointValue
variable = dumped_Quartz
[]
[cumulative_moles_precipitated_K-feldspar]
type = PointValue
variable = dumped_K-feldspar
[]
[cumulative_moles_precipitated_Kaolinite]
type = PointValue
variable = dumped_Kaolinite
[]
[cumulative_moles_precipitated_Barite]
type = PointValue
variable = dumped_Barite
[]
[cumulative_moles_precipitated_Celestite]
type = PointValue
variable = dumped_Celestite
[]
[cumulative_moles_precipitated_Fluorite]
type = PointValue
variable = dumped_Fluorite
[]
[cumulative_moles_precipitated_Albite]
type = PointValue
variable = dumped_Albite
[]
[cumulative_moles_precipitated_Chalcedony]
type = PointValue
variable = dumped_Chalcedony
[]
[cumulative_moles_precipitated_Goethite]
type = PointValue
variable = dumped_Goethite
[]
[production_temperature]
type = PointValue
variable = production_temperature
[]
[mass_heated_this_timestep]
type = PointValue
variable = transported_mass
[]
[]
[Outputs]
csv = true
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 7.76E6 # 90 days
[TimeStepper]
type = FunctionDT
function = 'min(3E4, max(1E4, 0.2 * t))'
[]
[]
[MultiApps]
[porous_flow_sim]
type = TransientMultiApp
input_files = porous_flow.i
execute_on = 'timestep_end'
[]
[]
[Transfers]
[injection_T]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'solution_temperature'
variable = 'injection_temperature'
[]
[injection_H]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_H'
variable = 'injection_rate_massfrac_H'
[]
[injection_Cl]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Cl'
variable = 'injection_rate_massfrac_Cl'
[]
[injection_SO4]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_SO4'
variable = 'injection_rate_massfrac_SO4'
[]
[injection_HCO3]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_HCO3'
variable = 'injection_rate_massfrac_HCO3'
[]
[injection_SiO2aq]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_SiO2aq'
variable = 'injection_rate_massfrac_SiO2aq'
[]
[injection_Al]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Al'
variable = 'injection_rate_massfrac_Al'
[]
[injection_Ca]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Ca'
variable = 'injection_rate_massfrac_Ca'
[]
[injection_Mg]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Mg'
variable = 'injection_rate_massfrac_Mg'
[]
[injection_Fe]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Fe'
variable = 'injection_rate_massfrac_Fe'
[]
[injection_K]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_K'
variable = 'injection_rate_massfrac_K'
[]
[injection_Na]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Na'
variable = 'injection_rate_massfrac_Na'
[]
[injection_Sr]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Sr'
variable = 'injection_rate_massfrac_Sr'
[]
[injection_F]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_F'
variable = 'injection_rate_massfrac_F'
[]
[injection_BOH]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_BOH'
variable = 'injection_rate_massfrac_BOH'
[]
[injection_Br]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Br'
variable = 'injection_rate_massfrac_Br'
[]
[injection_Ba]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Ba'
variable = 'injection_rate_massfrac_Ba'
[]
[injection_Li]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_Li'
variable = 'injection_rate_massfrac_Li'
[]
[injection_NO3]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_NO3'
variable = 'injection_rate_massfrac_NO3'
[]
[injection_O2aq]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_O2aq'
variable = 'injection_rate_massfrac_O2aq'
[]
[injection_H2O]
type = MultiAppNearestNodeTransfer
direction = TO_MULTIAPP
multi_app = porous_flow_sim
fixed_meshes = true
source_variable = 'massfrac_H2O'
variable = 'injection_rate_massfrac_H2O'
[]
[production_T]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = production_temperature
variable = production_temperature
[]
[production_H]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_H_produced
variable = production_rate_H
[]
[production_Cl]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Cl_produced
variable = production_rate_Cl
[]
[production_SO4]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_SO4_produced
variable = production_rate_SO4
[]
[production_HCO3]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_HCO3_produced
variable = production_rate_HCO3
[]
[production_SiO2aq]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_SiO2aq_produced
variable = production_rate_SiO2aq
[]
[production_Al]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Al_produced
variable = production_rate_Al
[]
[production_Ca]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Ca_produced
variable = production_rate_Ca
[]
[production_Mg]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Mg_produced
variable = production_rate_Mg
[]
[production_Fe]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Fe_produced
variable = production_rate_Fe
[]
[production_K]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_K_produced
variable = production_rate_K
[]
[production_Na]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Na_produced
variable = production_rate_Na
[]
[production_Sr]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Sr_produced
variable = production_rate_Sr
[]
[production_F]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_F_produced
variable = production_rate_F
[]
[production_BOH]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_BOH_produced
variable = production_rate_BOH
[]
[production_Br]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Br_produced
variable = production_rate_Br
[]
[production_Ba]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Ba_produced
variable = production_rate_Ba
[]
[production_Li]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_Li_produced
variable = production_rate_Li
[]
[production_NO3]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_NO3_produced
variable = production_rate_NO3
[]
[production_O2aq]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_O2aq_produced
variable = production_rate_O2aq
[]
[production_H2O]
type = MultiAppPostprocessorInterpolationTransfer
direction = FROM_MULTIAPP
multi_app = porous_flow_sim
postprocessor = mole_rate_H2O_produced
variable = production_rate_H2O
[]
[]
(modules/geochemistry/test/tests/kernels/time_deriv_1.i)
# An initial concentration field in a material with constant porosity is subjected to a constant source
# porosity * d(concentration)/dt = source
# The result is checked vs the expected solution, which is conc = conc_old + dt * source / porosity
[Mesh]
type = GeneratedMesh
dim = 3
nx = 2
ny = 4
nz = 2
[]
[Variables]
[conc]
[]
[]
[Kernels]
[dot]
type = GeochemistryTimeDerivative
porosity = porosity
variable = conc
[]
[source]
type = BodyForce
function = 3.0
variable = conc
[]
[]
[ICs]
[conc]
type = FunctionIC
function = 'z * z + 4 * x * x * x + y'
variable = conc
[]
[]
[AuxVariables]
[porosity]
[]
[expected]
[]
[should_be_zero]
[]
[]
[AuxKernels]
[porosity]
type = FunctionAux
function = '6.0'
variable = porosity
[]
[expected]
type = FunctionAux
function = 'z * z + 4 * x * x * x + y + 2.0 * 3.0 / 6.0'
variable = expected
[]
[should_be_zero]
type = ParsedAux
coupled_variables = 'expected conc'
expression = 'expected - conc'
variable = should_be_zero
[]
[]
[Postprocessors]
[error]
type = NodalL2Norm
variable = should_be_zero
[]
[]
[Executioner]
type = Transient
solve_type = Newton
dt = 2
end_time = 2
[]
[Outputs]
csv = true
[]
(modules/porous_flow/test/tests/poro_elasticity/mandel_constM.i)
# Mandel's problem of consolodation of a drained medium
#
# A sample is in plane strain.
# -a <= x <= a
# -b <= y <= b
# It is squashed with constant force by impermeable, frictionless plattens on its top and bottom surfaces (at y=+/-b)
# Fluid is allowed to leak out from its sides (at x=+/-a)
# The porepressure within the sample is monitored.
#
# As is common in the literature, this is simulated by
# considering the quarter-sample, 0<=x<=a and 0<=y<=b, with
# impermeable, roller BCs at x=0 and y=0 and y=b.
# Porepressure is fixed at zero on x=a.
# Porepressure and displacement are initialised to zero.
# Then the top (y=b) is moved downwards with prescribed velocity,
# so that the total force that is inducing this downwards velocity
# is fixed. The velocity is worked out by solving Mandel's problem
# analytically, and the total force is monitored in the simulation
# to check that it indeed remains constant.
#
# Here are the problem's parameters, and their values:
# Soil width. a = 1
# Soil height. b = 0.1
# Soil's Lame lambda. la = 0.5
# Soil's Lame mu, which is also the Soil's shear modulus. mu = G = 0.75
# Soil bulk modulus. K = la + 2*mu/3 = 1
# Drained Poisson ratio. nu = (3K - 2G)/(6K + 2G) = 0.2
# Soil bulk compliance. 1/K = 1
# Fluid bulk modulus. Kf = 8
# Fluid bulk compliance. 1/Kf = 0.125
# Soil initial porosity. phi0 = 0.1
# Biot coefficient. alpha = 0.6
# Biot modulus. M = 1/(phi0/Kf + (alpha - phi0)(1 - alpha)/K) = 4.705882
# Undrained bulk modulus. Ku = K + alpha^2*M = 2.694118
# Undrained Poisson ratio. nuu = (3Ku - 2G)/(6Ku + 2G) = 0.372627
# Skempton coefficient. B = alpha*M/Ku = 1.048035
# Fluid mobility (soil permeability/fluid viscosity). k = 1.5
# Consolidation coefficient. c = 2*k*B^2*G*(1-nu)*(1+nuu)^2/9/(1-nuu)/(nuu-nu) = 3.821656
# Normal stress on top. F = 1
#
# The solution for porepressure and displacements is given in
# AHD Cheng and E Detournay "A direct boundary element method for plane strain poroelasticity" International Journal of Numerical and Analytical Methods in Geomechanics 12 (1988) 551-572.
# The solution involves complicated infinite series, so I shall not write it here
[Mesh]
type = GeneratedMesh
dim = 3
nx = 10
ny = 1
nz = 1
xmin = 0
xmax = 1
ymin = 0
ymax = 0.1
zmin = 0
zmax = 1
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
PorousFlowDictator = dictator
block = 0
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'porepressure disp_x disp_y disp_z'
number_fluid_phases = 1
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureVG
m = 0.8
alpha = 1e-5
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[porepressure]
[]
[]
[BCs]
[roller_xmin]
type = DirichletBC
variable = disp_x
value = 0
boundary = 'left'
[]
[roller_ymin]
type = DirichletBC
variable = disp_y
value = 0
boundary = 'bottom'
[]
[plane_strain]
type = DirichletBC
variable = disp_z
value = 0
boundary = 'back front'
[]
[xmax_drained]
type = DirichletBC
variable = porepressure
value = 0
boundary = right
[]
[top_velocity]
type = FunctionDirichletBC
variable = disp_y
function = top_velocity
boundary = top
[]
[]
[Functions]
[top_velocity]
type = PiecewiseLinear
x = '0 0.002 0.006 0.014 0.03 0.046 0.062 0.078 0.094 0.11 0.126 0.142 0.158 0.174 0.19 0.206 0.222 0.238 0.254 0.27 0.286 0.302 0.318 0.334 0.35 0.366 0.382 0.398 0.414 0.43 0.446 0.462 0.478 0.494 0.51 0.526 0.542 0.558 0.574 0.59 0.606 0.622 0.638 0.654 0.67 0.686 0.702'
y = '-0.041824842 -0.042730269 -0.043412712 -0.04428867 -0.045509181 -0.04645965 -0.047268246 -0.047974749 -0.048597109 -0.0491467 -0.049632388 -0.050061697 -0.050441198 -0.050776675 -0.051073238 -0.0513354 -0.051567152 -0.051772022 -0.051953128 -0.052113227 -0.052254754 -0.052379865 -0.052490464 -0.052588233 -0.052674662 -0.052751065 -0.052818606 -0.052878312 -0.052931093 -0.052977751 -0.053018997 -0.053055459 -0.053087691 -0.053116185 -0.053141373 -0.05316364 -0.053183324 -0.053200724 -0.053216106 -0.053229704 -0.053241725 -0.053252351 -0.053261745 -0.053270049 -0.053277389 -0.053283879 -0.053289615'
[]
[]
[AuxVariables]
[stress_yy]
order = CONSTANT
family = MONOMIAL
[]
[tot_force]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[stress_yy]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_yy
index_i = 1
index_j = 1
[]
[tot_force]
type = ParsedAux
coupled_variables = 'stress_yy porepressure'
execute_on = timestep_end
variable = tot_force
expression = '-stress_yy+0.6*porepressure'
[]
[]
[Kernels]
[grad_stress_x]
type = StressDivergenceTensors
variable = disp_x
component = 0
[]
[grad_stress_y]
type = StressDivergenceTensors
variable = disp_y
component = 1
[]
[grad_stress_z]
type = StressDivergenceTensors
variable = disp_z
component = 2
[]
[poro_x]
type = PorousFlowEffectiveStressCoupling
biot_coefficient = 0.6
variable = disp_x
component = 0
[]
[poro_y]
type = PorousFlowEffectiveStressCoupling
biot_coefficient = 0.6
variable = disp_y
component = 1
[]
[poro_z]
type = PorousFlowEffectiveStressCoupling
biot_coefficient = 0.6
component = 2
variable = disp_z
[]
[poro_vol_exp]
type = PorousFlowMassVolumetricExpansion
variable = porepressure
fluid_component = 0
[]
[mass0]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = porepressure
[]
[flux]
type = PorousFlowAdvectiveFlux
variable = porepressure
gravity = '0 0 0'
fluid_component = 0
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 8
density0 = 1
thermal_expansion = 0
viscosity = 1
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
[]
[elasticity_tensor]
type = ComputeElasticityTensor
C_ijkl = '0.5 0.75'
# bulk modulus is lambda + 2*mu/3 = 0.5 + 2*0.75/3 = 1
fill_method = symmetric_isotropic
[]
[strain]
type = ComputeSmallStrain
[]
[stress]
type = ComputeLinearElasticStress
[]
[eff_fluid_pressure]
type = PorousFlowEffectiveFluidPressure
[]
[vol_strain]
type = PorousFlowVolumetricStrain
[]
[ppss]
type = PorousFlow1PhaseP
porepressure = porepressure
capillary_pressure = pc
[]
[massfrac]
type = PorousFlowMassFraction
[]
[simple_fluid]
type = PorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[porosity]
type = PorousFlowPorosityHMBiotModulus
porosity_zero = 0.1
biot_coefficient = 0.6
solid_bulk = 1
constant_fluid_bulk_modulus = 8
constant_biot_modulus = 4.7058823529
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1.5 0 0 0 1.5 0 0 0 1.5'
[]
[relperm]
type = PorousFlowRelativePermeabilityCorey
n = 0 # unimportant in this fully-saturated situation
phase = 0
[]
[]
[Postprocessors]
[p0]
type = PointValue
outputs = csv
point = '0.0 0 0'
variable = porepressure
[]
[p1]
type = PointValue
outputs = csv
point = '0.1 0 0'
variable = porepressure
[]
[p2]
type = PointValue
outputs = csv
point = '0.2 0 0'
variable = porepressure
[]
[p3]
type = PointValue
outputs = csv
point = '0.3 0 0'
variable = porepressure
[]
[p4]
type = PointValue
outputs = csv
point = '0.4 0 0'
variable = porepressure
[]
[p5]
type = PointValue
outputs = csv
point = '0.5 0 0'
variable = porepressure
[]
[p6]
type = PointValue
outputs = csv
point = '0.6 0 0'
variable = porepressure
[]
[p7]
type = PointValue
outputs = csv
point = '0.7 0 0'
variable = porepressure
[]
[p8]
type = PointValue
outputs = csv
point = '0.8 0 0'
variable = porepressure
[]
[p9]
type = PointValue
outputs = csv
point = '0.9 0 0'
variable = porepressure
[]
[p99]
type = PointValue
outputs = csv
point = '1 0 0'
variable = porepressure
[]
[xdisp]
type = PointValue
outputs = csv
point = '1 0.1 0'
variable = disp_x
[]
[ydisp]
type = PointValue
outputs = csv
point = '1 0.1 0'
variable = disp_y
[]
[total_downwards_force]
type = ElementAverageValue
outputs = csv
variable = tot_force
[]
[dt]
type = FunctionValuePostprocessor
outputs = console
function = if(0.15*t<0.01,0.15*t,0.01)
[]
[]
[Preconditioning]
[andy]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -snes_atol -snes_rtol -snes_max_it'
petsc_options_value = 'gmres asm lu 1E-14 1E-10 10000'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
start_time = 0
end_time = 0.7
[TimeStepper]
type = PostprocessorDT
postprocessor = dt
dt = 0.001
[]
[]
[Outputs]
execute_on = 'timestep_end'
file_base = mandel_constM
[csv]
time_step_interval = 3
type = CSV
[]
[]
(modules/geochemistry/test/tests/sorption_and_surface_complexation/selenate.i)
# Langmuir sorption of Selenate
[TimeIndependentReactionSolver]
model_definition = definition
charge_balance_species = "Na+"
constraint_species = "H2O H+ Na+ SorbingSite SeO4--"
constraint_value = " 1.0 -7.5 10E-6 310E-9 5E-6"
constraint_meaning = "kg_solvent_water log10activity bulk_composition bulk_composition free_concentration"
constraint_unit = " kg dimensionless moles moles molal"
ramp_max_ionic_strength_initial = 0 # not needed in this simple problem
execute_console_output_on = '' # only CSV output for this problem
[]
[UserObjects]
[definition]
type = GeochemicalModelDefinition
database_file = "../../database/selenate_sorption.json"
basis_species = "H2O H+ Na+ SeO4-- SorbingSite"
[]
[]
[AuxVariables]
[mol_sorbed_selenate_per_g_dry_soil]
[]
[]
[AuxKernels]
[mol_sorbed_selenate_per_g_dry_soil]
type = ParsedAux
coupled_variables = molal_SorbedSelenate
expression = 'molal_SorbedSelenate / 500.0'
variable = mol_sorbed_selenate_per_g_dry_soil
[]
[]
[Postprocessors]
[mol_sorbed_selenate_per_g_dry_soil]
type = PointValue
point = '0 0 0'
variable = mol_sorbed_selenate_per_g_dry_soil
[]
[]
[Outputs]
csv = 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
[]
[]
(test/tests/auxkernels/parsed_aux/parsed_aux_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 10
ny = 10
[]
[Variables]
[u]
order = FIRST
family = LAGRANGE
[]
[v]
order = FIRST
family = LAGRANGE
[]
[]
[AuxVariables]
[parsed]
order = FIRST
family = LAGRANGE
[]
[]
[Kernels]
[diff_u]
type = Diffusion
variable = u
[]
[diff_v]
type = Diffusion
variable = v
[]
[]
[BCs]
[left_u]
type = DirichletBC
variable = u
boundary = 2
value = 0
[]
[right_u]
type = DirichletBC
variable = u
boundary = 0
value = 1
[]
[left_v]
type = DirichletBC
variable = v
boundary = 3
value = 0
[]
[right_v]
type = DirichletBC
variable = v
boundary = 1
value = 1
[]
[]
[AuxKernels]
[set_parsed]
type = ParsedAux
variable = parsed
coupled_variables = 'u v'
expression = '(u-0.5)^3*v'
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
file_base = out
exodus = true
[]
(modules/combined/test/tests/poro_mechanics/borehole_lowres.i)
# Poroelastic response of a borehole.
#
# LOWRES VERSION: this version does not give perfect agreement with the analytical solution
#
# A fully-saturated medium contains a fluid with a homogeneous porepressure,
# but an anisitropic insitu stress. A infinitely-long borehole aligned with
# the $$z$$ axis is instanteously excavated. The borehole boundary is
# stress-free and allowed to freely drain. This problem is analysed using
# plane-strain conditions (no $$z$$ displacement).
#
# The solution in Laplace space is found in E Detournay and AHD Cheng "Poroelastic response of a borehole in a non-hydrostatic stress field". International Journal of Rock Mechanics and Mining Sciences and Geomechanics Abstracts 25 (1988) 171-182. In the small-time limit, the Laplace transforms may be performed. There is one typo in the paper. Equation (A4)'s final term should be -(a/r)\sqrt(4ct/(a^2\pi)), and not +(a/r)\sqrt(4ct/(a^2\pi)).
#
# Because realistic parameters are chosen (below),
# the residual for porepressure is much smaller than
# the residuals for the displacements. Therefore the
# scaling parameter is chosen. Also note that the
# insitu stresses are effective stresses, not total
# stresses, but the solution in the above paper is
# expressed in terms of total stresses.
#
# Here are the problem's parameters, and their values:
# Borehole radius. a = 1
# Rock's Lame lambda. la = 0.5E9
# Rock's Lame mu, which is also the Rock's shear modulus. mu = G = 1.5E9
# Rock bulk modulus. K = la + 2*mu/3 = 1.5E9
# Drained Poisson ratio. nu = (3K - 2G)/(6K + 2G) = 0.125
# Rock bulk compliance. 1/K = 0.66666666E-9
# Fluid bulk modulus. Kf = 0.7171315E9
# Fluid bulk compliance. 1/Kf = 1.39444444E-9
# Rock initial porosity. phi0 = 0.3
# Biot coefficient. alpha = 0.65
# Biot modulus. M = 1/(phi0/Kf + (alpha - phi0)(1 - alpha)/K) = 2E9
# Undrained bulk modulus. Ku = K + alpha^2*M = 2.345E9
# Undrained Poisson ratio. nuu = (3Ku - 2G)/(6Ku + 2G) = 0.2364
# Skempton coefficient. B = alpha*M/Ku = 0.554
# Fluid mobility (rock permeability/fluid viscosity). k = 1E-12
[Mesh]
type = FileMesh
file = borehole_lowres_input.e
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
porepressure = porepressure
block = 1
[]
[GlobalParams]
volumetric_locking_correction=true
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[./disp_z]
[../]
[./porepressure]
scaling = 1E9 # Notice the scaling, to make porepressure's kernels roughly of same magnitude as disp's kernels
[../]
[]
[ICs]
[./initial_p]
type = ConstantIC
variable = porepressure
value = 1E6
[../]
[]
[BCs]
[./fixed_outer_x]
type = DirichletBC
variable = disp_x
value = 0
boundary = outer
[../]
[./fixed_outer_y]
type = DirichletBC
variable = disp_y
value = 0
boundary = outer
[../]
[./plane_strain]
type = DirichletBC
variable = disp_z
value = 0
boundary = 'zmin zmax'
[../]
[./borehole_wall]
type = DirichletBC
variable = porepressure
value = 0
boundary = bh_wall
[../]
[]
[AuxVariables]
[./stress_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./tot_yy]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./stress_yy]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_yy
index_i = 1
index_j = 1
[../]
[./tot_yy]
type = ParsedAux
coupled_variables = 'stress_yy porepressure'
execute_on = timestep_end
variable = tot_yy
expression = 'stress_yy-0.65*porepressure'
[../]
[]
[Kernels]
[./grad_stress_x]
type = StressDivergenceTensors
variable = disp_x
component = 0
[../]
[./grad_stress_y]
type = StressDivergenceTensors
variable = disp_y
component = 1
[../]
[./grad_stress_z]
type = StressDivergenceTensors
variable = disp_z
component = 2
[../]
[./poro_x]
type = PoroMechanicsCoupling
variable = disp_x
component = 0
[../]
[./poro_y]
type = PoroMechanicsCoupling
variable = disp_y
component = 1
[../]
[./poro_z]
type = PoroMechanicsCoupling
variable = disp_z
component = 2
[../]
[./poro_timederiv]
type = PoroFullSatTimeDerivative
variable = porepressure
[../]
[./darcy_flow]
type = CoefDiffusion
variable = porepressure
coef = 1E-12
[../]
[]
[Materials]
[./elasticity_tensor]
type = ComputeElasticityTensor
C_ijkl = '0.5E9 1.5E9'
# bulk modulus is lambda + 2*mu/3 = 0.5 + 2*1.5/3 = 1.5E9
fill_method = symmetric_isotropic
[../]
[./strain]
type = ComputeFiniteStrain
displacements = 'disp_x disp_y disp_z'
eigenstrain_names = ini_stress
[../]
[./ini_stress]
type = ComputeEigenstrainFromInitialStress
initial_stress = '-1.35E6 0 0 0 -3.35E6 0 0 0 0' # remember this is the effective stress
eigenstrain_name = ini_stress
[../]
[./no_plasticity]
type = ComputeFiniteStrainElasticStress
[../]
[./poro_material]
type = PoroFullSatMaterial
porosity0 = 0.3
biot_coefficient = 0.65
solid_bulk_compliance = 0.6666666666667E-9
fluid_bulk_compliance = 1.3944444444444E-9
constant_porosity = false
[../]
[]
[Postprocessors]
[./p00]
type = PointValue
variable = porepressure
point = '1.00 0 0'
outputs = csv_p
[../]
[./p01]
type = PointValue
variable = porepressure
point = '1.01 0 0'
outputs = csv_p
[../]
[./p02]
type = PointValue
variable = porepressure
point = '1.02 0 0'
outputs = csv_p
[../]
[./p03]
type = PointValue
variable = porepressure
point = '1.03 0 0'
outputs = csv_p
[../]
[./p04]
type = PointValue
variable = porepressure
point = '1.04 0 0'
outputs = csv_p
[../]
[./p05]
type = PointValue
variable = porepressure
point = '1.05 0 0'
outputs = csv_p
[../]
[./p06]
type = PointValue
variable = porepressure
point = '1.06 0 0'
outputs = csv_p
[../]
[./p07]
type = PointValue
variable = porepressure
point = '1.07 0 0'
outputs = csv_p
[../]
[./p08]
type = PointValue
variable = porepressure
point = '1.08 0 0'
outputs = csv_p
[../]
[./p09]
type = PointValue
variable = porepressure
point = '1.09 0 0'
outputs = csv_p
[../]
[./p10]
type = PointValue
variable = porepressure
point = '1.10 0 0'
outputs = csv_p
[../]
[./p11]
type = PointValue
variable = porepressure
point = '1.11 0 0'
outputs = csv_p
[../]
[./p12]
type = PointValue
variable = porepressure
point = '1.12 0 0'
outputs = csv_p
[../]
[./p13]
type = PointValue
variable = porepressure
point = '1.13 0 0'
outputs = csv_p
[../]
[./p14]
type = PointValue
variable = porepressure
point = '1.14 0 0'
outputs = csv_p
[../]
[./p15]
type = PointValue
variable = porepressure
point = '1.15 0 0'
outputs = csv_p
[../]
[./p16]
type = PointValue
variable = porepressure
point = '1.16 0 0'
outputs = csv_p
[../]
[./p17]
type = PointValue
variable = porepressure
point = '1.17 0 0'
outputs = csv_p
[../]
[./p18]
type = PointValue
variable = porepressure
point = '1.18 0 0'
outputs = csv_p
[../]
[./p19]
type = PointValue
variable = porepressure
point = '1.19 0 0'
outputs = csv_p
[../]
[./p20]
type = PointValue
variable = porepressure
point = '1.20 0 0'
outputs = csv_p
[../]
[./p21]
type = PointValue
variable = porepressure
point = '1.21 0 0'
outputs = csv_p
[../]
[./p22]
type = PointValue
variable = porepressure
point = '1.22 0 0'
outputs = csv_p
[../]
[./p23]
type = PointValue
variable = porepressure
point = '1.23 0 0'
outputs = csv_p
[../]
[./p24]
type = PointValue
variable = porepressure
point = '1.24 0 0'
outputs = csv_p
[../]
[./p25]
type = PointValue
variable = porepressure
point = '1.25 0 0'
outputs = csv_p
[../]
[./s00]
type = PointValue
variable = disp_x
point = '1.00 0 0'
outputs = csv_s
[../]
[./s01]
type = PointValue
variable = disp_x
point = '1.01 0 0'
outputs = csv_s
[../]
[./s02]
type = PointValue
variable = disp_x
point = '1.02 0 0'
outputs = csv_s
[../]
[./s03]
type = PointValue
variable = disp_x
point = '1.03 0 0'
outputs = csv_s
[../]
[./s04]
type = PointValue
variable = disp_x
point = '1.04 0 0'
outputs = csv_s
[../]
[./s05]
type = PointValue
variable = disp_x
point = '1.05 0 0'
outputs = csv_s
[../]
[./s06]
type = PointValue
variable = disp_x
point = '1.06 0 0'
outputs = csv_s
[../]
[./s07]
type = PointValue
variable = disp_x
point = '1.07 0 0'
outputs = csv_s
[../]
[./s08]
type = PointValue
variable = disp_x
point = '1.08 0 0'
outputs = csv_s
[../]
[./s09]
type = PointValue
variable = disp_x
point = '1.09 0 0'
outputs = csv_s
[../]
[./s10]
type = PointValue
variable = disp_x
point = '1.10 0 0'
outputs = csv_s
[../]
[./s11]
type = PointValue
variable = disp_x
point = '1.11 0 0'
outputs = csv_s
[../]
[./s12]
type = PointValue
variable = disp_x
point = '1.12 0 0'
outputs = csv_s
[../]
[./s13]
type = PointValue
variable = disp_x
point = '1.13 0 0'
outputs = csv_s
[../]
[./s14]
type = PointValue
variable = disp_x
point = '1.14 0 0'
outputs = csv_s
[../]
[./s15]
type = PointValue
variable = disp_x
point = '1.15 0 0'
outputs = csv_s
[../]
[./s16]
type = PointValue
variable = disp_x
point = '1.16 0 0'
outputs = csv_s
[../]
[./s17]
type = PointValue
variable = disp_x
point = '1.17 0 0'
outputs = csv_s
[../]
[./s18]
type = PointValue
variable = disp_x
point = '1.18 0 0'
outputs = csv_s
[../]
[./s19]
type = PointValue
variable = disp_x
point = '1.19 0 0'
outputs = csv_s
[../]
[./s20]
type = PointValue
variable = disp_x
point = '1.20 0 0'
outputs = csv_s
[../]
[./s21]
type = PointValue
variable = disp_x
point = '1.21 0 0'
outputs = csv_s
[../]
[./s22]
type = PointValue
variable = disp_x
point = '1.22 0 0'
outputs = csv_s
[../]
[./s23]
type = PointValue
variable = disp_x
point = '1.23 0 0'
outputs = csv_s
[../]
[./s24]
type = PointValue
variable = disp_x
point = '1.24 0 0'
outputs = csv_s
[../]
[./s25]
type = PointValue
variable = disp_x
point = '1.25 0 0'
outputs = csv_s
[../]
[./t00]
type = PointValue
variable = tot_yy
point = '1.00 0 0'
outputs = csv_t
[../]
[./t01]
type = PointValue
variable = tot_yy
point = '1.01 0 0'
outputs = csv_t
[../]
[./t02]
type = PointValue
variable = tot_yy
point = '1.02 0 0'
outputs = csv_t
[../]
[./t03]
type = PointValue
variable = tot_yy
point = '1.03 0 0'
outputs = csv_t
[../]
[./t04]
type = PointValue
variable = tot_yy
point = '1.04 0 0'
outputs = csv_t
[../]
[./t05]
type = PointValue
variable = tot_yy
point = '1.05 0 0'
outputs = csv_t
[../]
[./t06]
type = PointValue
variable = tot_yy
point = '1.06 0 0'
outputs = csv_t
[../]
[./t07]
type = PointValue
variable = tot_yy
point = '1.07 0 0'
outputs = csv_t
[../]
[./t08]
type = PointValue
variable = tot_yy
point = '1.08 0 0'
outputs = csv_t
[../]
[./t09]
type = PointValue
variable = tot_yy
point = '1.09 0 0'
outputs = csv_t
[../]
[./t10]
type = PointValue
variable = tot_yy
point = '1.10 0 0'
outputs = csv_t
[../]
[./t11]
type = PointValue
variable = tot_yy
point = '1.11 0 0'
outputs = csv_t
[../]
[./t12]
type = PointValue
variable = tot_yy
point = '1.12 0 0'
outputs = csv_t
[../]
[./t13]
type = PointValue
variable = tot_yy
point = '1.13 0 0'
outputs = csv_t
[../]
[./t14]
type = PointValue
variable = tot_yy
point = '1.14 0 0'
outputs = csv_t
[../]
[./t15]
type = PointValue
variable = tot_yy
point = '1.15 0 0'
outputs = csv_t
[../]
[./t16]
type = PointValue
variable = tot_yy
point = '1.16 0 0'
outputs = csv_t
[../]
[./t17]
type = PointValue
variable = tot_yy
point = '1.17 0 0'
outputs = csv_t
[../]
[./t18]
type = PointValue
variable = tot_yy
point = '1.18 0 0'
outputs = csv_t
[../]
[./t19]
type = PointValue
variable = tot_yy
point = '1.19 0 0'
outputs = csv_t
[../]
[./t20]
type = PointValue
variable = tot_yy
point = '1.20 0 0'
outputs = csv_t
[../]
[./t21]
type = PointValue
variable = tot_yy
point = '1.21 0 0'
outputs = csv_t
[../]
[./t22]
type = PointValue
variable = tot_yy
point = '1.22 0 0'
outputs = csv_t
[../]
[./t23]
type = PointValue
variable = tot_yy
point = '1.23 0 0'
outputs = csv_t
[../]
[./t24]
type = PointValue
variable = tot_yy
point = '1.24 0 0'
outputs = csv_t
[../]
[./t25]
type = PointValue
variable = tot_yy
point = '1.25 0 0'
outputs = csv_t
[../]
[./dt]
type = FunctionValuePostprocessor
outputs = console
function = 2*t
[../]
[]
[Preconditioning]
[./andy]
type = SMP
full = true
petsc_options = '-snes_monitor -snes_linesearch_monitor'
petsc_options_iname = '-ksp_type -pc_type -snes_atol -snes_rtol -snes_max_it -ksp_max_it -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'gmres asm 1E0 1E-10 200 500 lu NONZERO'
[../]
[]
[Executioner]
type = Transient
solve_type = Newton
start_time = 0
end_time = 0.3
dt = 0.3
#[./TimeStepper]
# type = PostprocessorDT
# postprocessor = dt
# dt = 0.003
#[../]
[]
[Outputs]
execute_on = 'timestep_end'
file_base = borehole_lowres
exodus = true
sync_times = '0.003 0.3'
[./csv_p]
file_base = borehole_lowres_p
type = CSV
[../]
[./csv_s]
file_base = borehole_lowres_s
type = CSV
[../]
[./csv_t]
file_base = borehole_lowres_t
type = CSV
[../]
[]
(modules/porous_flow/test/tests/chemistry/precipitation.i)
# The precipitation reaction
#
# a <==> mineral
#
# produces "mineral". Using mineral_density = fluid_density, theta = 1 = eta, the DE is
#
# a' = -(mineral / porosity)' = rate * surf_area * molar_vol (1 - (1 / eqm_const) * (act_coeff * a)^stoi)
#
# The following parameters are used
#
# T_ref = 0.5 K
# T = 1 K
# activation_energy = 3 J/mol
# gas_constant = 6 J/(mol K)
# kinetic_rate_at_ref_T = 0.60653 mol/(m^2 s)
# These give rate = 0.60653 * exp(1/2) = 1 mol/(m^2 s)
#
# surf_area = 0.5 m^2/L
# molar_volume = 2 L/mol
# These give rate * surf_area * molar_vol = 1 s^-1
#
# equilibrium_constant = 0.5 (dimensionless)
# primary_activity_coefficient = 2 (dimensionless)
# stoichiometry = 1 (dimensionless)
# This means that 1 - (1 / eqm_const) * (act_coeff * a)^stoi = 1 - 4 a, which is negative for a > 0.25, ie precipitation for a(t=0) > 0.25
#
# The solution of the DE is
# a = eqm_const / act_coeff + (a(t=0) - eqm_const / act_coeff) exp(-rate * surf_area * molar_vol * act_coeff * t / eqm_const)
# = 0.25 + (a(t=0) - 0.25) exp(-4 * t)
# c = c(t=0) - (a - a(t=0)) * porosity
#
# This test checks that (a + c / porosity) is time-independent, and that a follows the above solution
#
# Aside:
# The exponential curve is not followed exactly because moose actually solves
# (a - a_old)/dt = rate * surf_area * molar_vol (1 - (1 / eqm_const) * (act_coeff * a)^stoi)
# which does not give an exponential exactly, except in the limit dt->0
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Variables]
[a]
initial_condition = 0.9
[]
[]
[AuxVariables]
[pressure]
[]
[ini_mineral_conc]
initial_condition = 0.2
[]
[k]
initial_condition = 0.5
[]
[mineral]
family = MONOMIAL
order = CONSTANT
[]
[should_be_static]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mineral]
type = PorousFlowPropertyAux
property = mineral_concentration
mineral_species = 0
variable = mineral
[]
[should_be_static]
type = ParsedAux
coupled_variables = 'mineral a'
expression = 'a + mineral / 0.1'
variable = should_be_static
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Kernels]
[mass_a]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = a
[]
[pre_dis]
type = PorousFlowPreDis
variable = a
mineral_density = 1000
stoichiometry = 1
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = a
number_fluid_phases = 1
number_fluid_components = 2
number_aqueous_kinetic = 1
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 2e9 # huge, so mimic chemical_reactions
density0 = 1000
thermal_expansion = 0
viscosity = 1e-3
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = 1
[]
[ppss]
type = PorousFlow1PhaseFullySaturated
porepressure = pressure
[]
[mass_frac]
type = PorousFlowMassFraction
mass_fraction_vars = a
[]
[predis]
type = PorousFlowAqueousPreDisChemistry
primary_concentrations = a
num_reactions = 1
equilibrium_constants = k
primary_activity_coefficients = 2
reactions = 1
specific_reactive_surface_area = 0.5
kinetic_rate_constant = 0.6065306597126334
activation_energy = 3
molar_volume = 2
gas_constant = 6
reference_temperature = 0.5
[]
[mineral_conc]
type = PorousFlowAqueousPreDisMineral
initial_concentrations = ini_mineral_conc
[]
[simple_fluid]
type = PorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.1
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
nl_abs_tol = 1E-10
dt = 0.01
end_time = 1
[]
[Postprocessors]
[a]
type = PointValue
point = '0 0 0'
variable = a
[]
[should_be_static]
type = PointValue
point = '0 0 0'
variable = should_be_static
[]
[]
[Outputs]
time_step_interval = 10
csv = true
perf_graph = true
[]
(modules/phase_field/examples/interfacekernels/interface_fluxbc.i)
#
# This test demonstrates an InterfaceKernel (InterfaceDiffusionFlux) that can
# replace a pair of integrated DiffusionFluxBC boundary conditions.
#
# The AuxVariable 'diff' shows the difference between the BC and the InterfaceKernel
# approach.
#
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 50
ny = 50
[]
[./box1]
input = gen
type = SubdomainBoundingBoxGenerator
block_id = 1
bottom_left = '0 0 0'
top_right = '0.51 1 0'
[../]
[./box2]
input = box1
type = SubdomainBoundingBoxGenerator
block_id = 2
bottom_left = '0.49 0 0'
top_right = '1 1 0'
[../]
[./iface_u]
type = SideSetsBetweenSubdomainsGenerator
primary_block = 1
paired_block = 2
new_boundary = 10
input = box2
[../]
[./iface_v]
type = SideSetsBetweenSubdomainsGenerator
primary_block = 2
paired_block = 1
new_boundary = 11
input = iface_u
[../]
[]
[Variables]
[./u1]
block = 1
[./InitialCondition]
type = FunctionIC
function = 'r:=sqrt((x-0.4)^2+(y-0.5)^2);if(r<0.05,5,1)'
[../]
[../]
[./v1]
block = 2
[./InitialCondition]
type = FunctionIC
function = 'r:=sqrt((x-0.7)^2+(y-0.5)^2);if(r<0.05,5,1)'
[../]
[../]
[./u2]
block = 1
[./InitialCondition]
type = FunctionIC
function = 'r:=sqrt((x-0.4)^2+(y-0.5)^2);if(r<0.05,5,1)'
[../]
[../]
[./v2]
block = 2
[./InitialCondition]
type = FunctionIC
function = 'r:=sqrt((x-0.7)^2+(y-0.5)^2);if(r<0.05,5,1)'
[../]
[../]
[]
[Kernels]
[./u1_diff]
type = Diffusion
variable = u1
block = 1
[../]
[./u1_dt]
type = TimeDerivative
variable = u1
block = 1
[../]
[./v1_diff]
type = Diffusion
variable = v1
block = 2
[../]
[./v1_dt]
type = TimeDerivative
variable = v1
block = 2
[../]
[./u2_diff]
type = Diffusion
variable = u2
block = 1
[../]
[./u2_dt]
type = TimeDerivative
variable = u2
block = 1
[../]
[./v2_diff]
type = Diffusion
variable = v2
block = 2
[../]
[./v2_dt]
type = TimeDerivative
variable = v2
block = 2
[../]
[]
[AuxVariables]
[./diff]
[../]
[]
[AuxKernels]
[./u_side]
type = ParsedAux
variable = diff
block = 1
coupled_variables = 'u1 u2'
expression = 'u1 - u2'
[../]
[./v_side]
type = ParsedAux
variable = diff
block = 2
coupled_variables = 'v1 v2'
expression = 'v1 - v2'
[../]
[]
[InterfaceKernels]
[./iface]
type = InterfaceDiffusionBoundaryTerm
boundary = 10
variable = u2
neighbor_var = v2
[../]
[]
[BCs]
[./u_boundary_term]
type = DiffusionFluxBC
variable = u1
boundary = 10
[../]
[./v_boundary_term]
type = DiffusionFluxBC
variable = v1
boundary = 11
[../]
[]
[Executioner]
type = Transient
dt = 0.001
num_steps = 20
[]
[Outputs]
exodus = true
print_linear_residuals = false
[]
(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
symbol_names = 'baseflow_kg dt'
symbol_values = 'baseflow_kg dt'
expression = 'baseflow_kg / dt * 24.0 * 3600.0 / 400.0'
[]
[abstraction_rate]
type = ParsedFunction
symbol_names = 'abstraction_kg dt'
symbol_values = 'abstraction_kg dt'
expression = '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
coupled_variables = 'pp ini_pp'
expression = 'pp - ini_pp'
[]
[]
[PorousFlowUnsaturated]
fp = simple_fluid
porepressure = pp
[]
[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
indirect_dependencies = 'baseflow_kg dt'
[]
[abstraction_kg]
type = PorousFlowPlotQuantity
uo = abstraction
outputs = 'none'
[]
[abstraction_kg_per_day]
type = FunctionValuePostprocessor
function = abstraction_rate
indirect_dependencies = 'abstraction_kg dt'
[]
[]
[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
[]
[]
(modules/optimization/test/tests/optimizationreporter/optimizationdata/two_vars_file.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
[]
[]
[Problem]
solve=false
[]
[AuxVariables]
[disp_x]
order = CONSTANT
family = MONOMIAL
[]
[disp_y]
order = CONSTANT
family = MONOMIAL
[]
[T]
order = FIRST
family = LAGRANGE
[]
[]
[AuxKernels]
[aux_disp_x]
type = ParsedAux
variable = disp_x
use_xyzt = true
expression = 'if(x<0.5,2,4)'
[]
[aux_disp_y]
type = ParsedAux
variable = disp_y
use_xyzt = true
expression = 'if(y<0.5,10,50)'
[]
[aux_T]
type = ParsedAux
variable = T
use_xyzt = true
expression = 'x'
[]
[]
[Reporters]
[measure_data]
type = OptimizationData
measurement_file = 'measurementData.csv'
file_value = 'measured_value'
variable = 'disp_x disp_y T'
file_variable_weights = 'weight_u v_weight wT'
variable_weight_names = 'weight_u v_weight wT'
[]
[]
[BCs]
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
exodus=true
[]
[Debug]
show_reporters = false
[]
(modules/porous_flow/test/tests/poro_elasticity/mandel.i)
# Mandel's problem of consolodation of a drained medium
#
# A sample is in plane strain.
# -a <= x <= a
# -b <= y <= b
# It is squashed with constant force by impermeable, frictionless plattens on its top and bottom surfaces (at y=+/-b)
# Fluid is allowed to leak out from its sides (at x=+/-a)
# The porepressure within the sample is monitored.
#
# As is common in the literature, this is simulated by
# considering the quarter-sample, 0<=x<=a and 0<=y<=b, with
# impermeable, roller BCs at x=0 and y=0 and y=b.
# Porepressure is fixed at zero on x=a.
# Porepressure and displacement are initialised to zero.
# Then the top (y=b) is moved downwards with prescribed velocity,
# so that the total force that is inducing this downwards velocity
# is fixed. The velocity is worked out by solving Mandel's problem
# analytically, and the total force is monitored in the simulation
# to check that it indeed remains constant.
#
# Here are the problem's parameters, and their values:
# Soil width. a = 1
# Soil height. b = 0.1
# Soil's Lame lambda. la = 0.5
# Soil's Lame mu, which is also the Soil's shear modulus. mu = G = 0.75
# Soil bulk modulus. K = la + 2*mu/3 = 1
# Drained Poisson ratio. nu = (3K - 2G)/(6K + 2G) = 0.2
# Soil bulk compliance. 1/K = 1
# Fluid bulk modulus. Kf = 8
# Fluid bulk compliance. 1/Kf = 0.125
# Soil initial porosity. phi0 = 0.1
# Biot coefficient. alpha = 0.6
# Biot modulus. M = 1/(phi0/Kf + (alpha - phi0)(1 - alpha)/K) = 4.705882
# Undrained bulk modulus. Ku = K + alpha^2*M = 2.694118
# Undrained Poisson ratio. nuu = (3Ku - 2G)/(6Ku + 2G) = 0.372627
# Skempton coefficient. B = alpha*M/Ku = 1.048035
# Fluid mobility (soil permeability/fluid viscosity). k = 1.5
# Consolidation coefficient. c = 2*k*B^2*G*(1-nu)*(1+nuu)^2/9/(1-nuu)/(nuu-nu) = 3.821656
# Normal stress on top. F = 1
#
# The solution for porepressure and displacements is given in
# AHD Cheng and E Detournay "A direct boundary element method for plane strain poroelasticity" International Journal of Numerical and Analytical Methods in Geomechanics 12 (1988) 551-572.
# The solution involves complicated infinite series, so I shall not write it here
#
# FINAL NOTE: The above solution assumes constant Biot Modulus.
# In porous_flow this is not true. Therefore the solution is
# a little different than in the paper. This test was therefore
# validated against MOOSE's poromechanics, which can choose either
# a constant Biot Modulus (which has been shown to agree with
# the analytic solution), or a non-constant Biot Modulus (which
# gives the same results as porous_flow).
[Mesh]
type = GeneratedMesh
dim = 3
nx = 10
ny = 1
nz = 1
xmin = 0
xmax = 1
ymin = 0
ymax = 0.1
zmin = 0
zmax = 1
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
PorousFlowDictator = dictator
block = 0
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'porepressure disp_x disp_y disp_z'
number_fluid_phases = 1
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureVG
m = 0.8
alpha = 1e-5
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[porepressure]
[]
[]
[BCs]
[roller_xmin]
type = DirichletBC
variable = disp_x
value = 0
boundary = 'left'
[]
[roller_ymin]
type = DirichletBC
variable = disp_y
value = 0
boundary = 'bottom'
[]
[plane_strain]
type = DirichletBC
variable = disp_z
value = 0
boundary = 'back front'
[]
[xmax_drained]
type = DirichletBC
variable = porepressure
value = 0
boundary = right
[]
[top_velocity]
type = FunctionDirichletBC
variable = disp_y
function = top_velocity
boundary = top
[]
[]
[Functions]
[top_velocity]
type = PiecewiseLinear
x = '0 0.002 0.006 0.014 0.03 0.046 0.062 0.078 0.094 0.11 0.126 0.142 0.158 0.174 0.19 0.206 0.222 0.238 0.254 0.27 0.286 0.302 0.318 0.334 0.35 0.366 0.382 0.398 0.414 0.43 0.446 0.462 0.478 0.494 0.51 0.526 0.542 0.558 0.574 0.59 0.606 0.622 0.638 0.654 0.67 0.686 0.702'
y = '-0.041824842 -0.042730269 -0.043412712 -0.04428867 -0.045509181 -0.04645965 -0.047268246 -0.047974749 -0.048597109 -0.0491467 -0.049632388 -0.050061697 -0.050441198 -0.050776675 -0.051073238 -0.0513354 -0.051567152 -0.051772022 -0.051953128 -0.052113227 -0.052254754 -0.052379865 -0.052490464 -0.052588233 -0.052674662 -0.052751065 -0.052818606 -0.052878312 -0.052931093 -0.052977751 -0.053018997 -0.053055459 -0.053087691 -0.053116185 -0.053141373 -0.05316364 -0.053183324 -0.053200724 -0.053216106 -0.053229704 -0.053241725 -0.053252351 -0.053261745 -0.053270049 -0.053277389 -0.053283879 -0.053289615'
[]
[]
[AuxVariables]
[stress_yy]
order = CONSTANT
family = MONOMIAL
[]
[tot_force]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[stress_yy]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_yy
index_i = 1
index_j = 1
[]
[tot_force]
type = ParsedAux
coupled_variables = 'stress_yy porepressure'
execute_on = timestep_end
variable = tot_force
expression = '-stress_yy+0.6*porepressure'
[]
[]
[Kernels]
[grad_stress_x]
type = StressDivergenceTensors
variable = disp_x
component = 0
[]
[grad_stress_y]
type = StressDivergenceTensors
variable = disp_y
component = 1
[]
[grad_stress_z]
type = StressDivergenceTensors
variable = disp_z
component = 2
[]
[poro_x]
type = PorousFlowEffectiveStressCoupling
biot_coefficient = 0.6
variable = disp_x
component = 0
[]
[poro_y]
type = PorousFlowEffectiveStressCoupling
biot_coefficient = 0.6
variable = disp_y
component = 1
[]
[poro_z]
type = PorousFlowEffectiveStressCoupling
biot_coefficient = 0.6
component = 2
variable = disp_z
[]
[poro_vol_exp]
type = PorousFlowMassVolumetricExpansion
variable = porepressure
fluid_component = 0
[]
[mass0]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = porepressure
[]
[flux]
type = PorousFlowAdvectiveFlux
variable = porepressure
gravity = '0 0 0'
fluid_component = 0
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 8
density0 = 1
thermal_expansion = 0
viscosity = 1
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
[]
[elasticity_tensor]
type = ComputeElasticityTensor
C_ijkl = '0.5 0.75'
# bulk modulus is lambda + 2*mu/3 = 0.5 + 2*0.75/3 = 1
fill_method = symmetric_isotropic
[]
[strain]
type = ComputeSmallStrain
[]
[stress]
type = ComputeLinearElasticStress
[]
[eff_fluid_pressure]
type = PorousFlowEffectiveFluidPressure
[]
[vol_strain]
type = PorousFlowVolumetricStrain
[]
[ppss]
type = PorousFlow1PhaseP
porepressure = porepressure
capillary_pressure = pc
[]
[massfrac]
type = PorousFlowMassFraction
[]
[simple_fluid]
type = PorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[porosity]
type = PorousFlowPorosity
fluid = true
mechanical = true
ensure_positive = false
porosity_zero = 0.1
biot_coefficient = 0.6
solid_bulk = 1
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1.5 0 0 0 1.5 0 0 0 1.5'
[]
[relperm]
type = PorousFlowRelativePermeabilityCorey
n = 0 # unimportant in this fully-saturated situation
phase = 0
[]
[]
[Postprocessors]
[p0]
type = PointValue
outputs = csv
point = '0.0 0 0'
variable = porepressure
[]
[p1]
type = PointValue
outputs = csv
point = '0.1 0 0'
variable = porepressure
[]
[p2]
type = PointValue
outputs = csv
point = '0.2 0 0'
variable = porepressure
[]
[p3]
type = PointValue
outputs = csv
point = '0.3 0 0'
variable = porepressure
[]
[p4]
type = PointValue
outputs = csv
point = '0.4 0 0'
variable = porepressure
[]
[p5]
type = PointValue
outputs = csv
point = '0.5 0 0'
variable = porepressure
[]
[p6]
type = PointValue
outputs = csv
point = '0.6 0 0'
variable = porepressure
[]
[p7]
type = PointValue
outputs = csv
point = '0.7 0 0'
variable = porepressure
[]
[p8]
type = PointValue
outputs = csv
point = '0.8 0 0'
variable = porepressure
[]
[p9]
type = PointValue
outputs = csv
point = '0.9 0 0'
variable = porepressure
[]
[p99]
type = PointValue
outputs = csv
point = '1 0 0'
variable = porepressure
[]
[xdisp]
type = PointValue
outputs = csv
point = '1 0.1 0'
variable = disp_x
[]
[ydisp]
type = PointValue
outputs = csv
point = '1 0.1 0'
variable = disp_y
[]
[total_downwards_force]
type = ElementAverageValue
outputs = csv
variable = tot_force
[]
[dt]
type = FunctionValuePostprocessor
outputs = console
function = if(0.15*t<0.01,0.15*t,0.01)
[]
[]
[Preconditioning]
[andy]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -snes_atol -snes_rtol -snes_max_it'
petsc_options_value = 'gmres asm lu 1E-14 1E-10 10000'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
start_time = 0
end_time = 0.7
[TimeStepper]
type = PostprocessorDT
postprocessor = dt
dt = 0.001
[]
[]
[Outputs]
execute_on = 'timestep_end'
file_base = mandel
[csv]
time_step_interval = 3
type = CSV
[]
[]
(modules/combined/examples/mortar/mortar_gradient.i)
#
# Compare a diffusion equation with (c) and without (v) periodic gradient
# constraints and a ramped sloped initial condition and value-periodic diffusion (p)
# without a slope.
#
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 40
ny = 40
[]
[secondary_x]
input = gen
type = LowerDBlockFromSidesetGenerator
sidesets = '3'
new_block_id = 10
new_block_name = "secondary_x"
[]
[primary_x]
input = secondary_x
type = LowerDBlockFromSidesetGenerator
sidesets = '1'
new_block_id = 12
new_block_name = "primary_x"
[]
[secondary_y]
input = primary_x
type = LowerDBlockFromSidesetGenerator
sidesets = '0'
new_block_id = 11
new_block_name = "secondary_y"
[]
[primary_y]
input = secondary_y
type = LowerDBlockFromSidesetGenerator
sidesets = '2'
new_block_id = 13
new_block_name = "primary_y"
[]
[]
[Functions]
[./init_slope]
# slope with a concentration spike close to the lower interface
type = ParsedFunction
expression = 'if(x>0.4 & x<0.6 & y>0.1 & y<0.3, 3+y, y)'
[../]
[./init_flat]
# no-slope and the same spike
type = ParsedFunction
expression = 'if(x>0.4 & x<0.6 & y>0.1 & y<0.3, 3, 0)'
[../]
[]
[Variables]
# gradient constrained concentration
[./c]
order = FIRST
family = LAGRANGE
block = 0
[./InitialCondition]
type = FunctionIC
function = init_slope
[../]
[../]
# unconstrained concentrarion
[./v]
order = FIRST
family = LAGRANGE
block = 0
[./InitialCondition]
type = FunctionIC
function = init_slope
[../]
[../]
# flat value periodic diffusion
[./p]
order = FIRST
family = LAGRANGE
block = 0
[./InitialCondition]
type = FunctionIC
function = init_flat
[../]
[../]
# Lagrange multipliers for gradient component in the horizontal directon
[./lm_left_right_x]
order = FIRST
family = LAGRANGE
block = "secondary_x"
[../]
[./lm_left_right_y]
order = FIRST
family = LAGRANGE
block = "secondary_x"
[../]
# Lagrange multipliers for gradient component in the vertical directon
[./lm_up_down_x]
order = FIRST
family = LAGRANGE
block = "secondary_y"
[../]
[./lm_up_down_y]
order = FIRST
family = LAGRANGE
block = "secondary_y"
[../]
[]
[Kernels]
# the gradient constrained concentration
[./diff]
type = Diffusion
variable = c
block = 0
[../]
[./dt]
type = TimeDerivative
variable = c
block = 0
[../]
# the un-constrained concentration
[./diff2]
type = Diffusion
variable = v
block = 0
[../]
[./dt2]
type = TimeDerivative
variable = v
block = 0
[../]
# the value periodic concentration
[./diff3]
type = Diffusion
variable = p
block = 0
[../]
[./dt3]
type = TimeDerivative
variable = p
block = 0
[../]
[]
[Constraints]
[./equaly_grad_x]
type = EqualGradientConstraint
variable = lm_up_down_x
component = 0
secondary_variable = c
secondary_boundary = bottom
primary_boundary = top
secondary_subdomain = secondary_y
primary_subdomain = primary_y
periodic = true
[../]
[./equaly_grad_y]
type = EqualGradientConstraint
variable = lm_up_down_y
component = 1
secondary_variable = c
secondary_boundary = bottom
primary_boundary = top
secondary_subdomain = secondary_y
primary_subdomain = primary_y
periodic = true
[../]
[./equalx_grad_x]
type = EqualGradientConstraint
variable = lm_left_right_x
component = 0
secondary_variable = c
secondary_boundary = left
primary_boundary = right
secondary_subdomain = secondary_x
primary_subdomain = primary_x
periodic = true
[../]
[./equalx_grad_y]
type = EqualGradientConstraint
variable = lm_left_right_y
component = 1
secondary_variable = c
secondary_boundary = left
primary_boundary = right
secondary_subdomain = secondary_x
primary_subdomain = primary_x
periodic = true
[../]
[]
[BCs]
# DiffusionFluxBC is the surface term in the weak form of the Diffusion equation
[./surface]
type = DiffusionFluxBC
boundary = 'top bottom left right'
variable = c
[../]
[./surface2]
type = DiffusionFluxBC
boundary = 'top bottom left right'
variable = v
[../]
# for the value periodic diffusion we skip the surface term and apply value PBCs
[./Periodic]
[./up_down]
variable = p
primary = 0
secondary = 2
translation = '0 1 0'
[../]
[./left_right]
variable = p
primary = 1
secondary = 3
translation = '-1 0 0'
[../]
[../]
[]
[AuxVariables]
[./diff_constraint]
block = 0
[../]
[./diff_periodic]
block = 0
[../]
[./diff_slope]
block = 0
[../]
[./slope]
block = 0
[./InitialCondition]
type = FunctionIC
function = y
[../]
[../]
[]
[AuxKernels]
# difference between the constrained and unconstrained sloped diffusions
[./diff_constraint]
type = ParsedAux
variable = diff_constraint
expression = 'c-v'
coupled_variables = 'c v'
block = 0
[../]
# difference between the periodic gradient constrained diffusion and the flat
# value period diffusien with a constant slope added. This should be the same,
# but they aren't quite because the gradient constraint affects the gradient in
# the entire elements (i.e. a larger volume is affected by the gradient constraint
# compared to the nodal value periodicity)
[./diff_periodic]
type = ParsedAux
variable = diff_periodic
expression = 'c-p-slope'
coupled_variables = 'c p slope'
block = 0
[../]
# subtract the constant slope from the gradient periodic simulation (should yield
# almost p - per the argument above)
[./diff_slope]
type = ParsedAux
variable = diff_slope
expression = 'c-slope'
coupled_variables = 'c slope'
block = 0
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
# the shift is necessary to facilitate the solve. The Lagrange multipliers
# introduce zero-on diaginal blocks, which make the matrix hard to invert.
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = ' lu NONZERO 1e-10'
nl_rel_tol = 1e-11
nl_abs_tol = 1e-10
l_tol = 1e-10
dt = 0.01
num_steps = 20
[]
[Outputs]
exodus = true
[]
(modules/geochemistry/test/tests/time_dependent_reactions/flushing_case1.i)
# Alkali flushing of a reservoir (an example of flushing): adding NaOH
# To determine the initial constraint_values, run flushing_equilibrium_at70degC.i
# Note that flushing_equilibrium_at70degC.i will have to be re-run when temperature-dependence has been added to geochemistry
# Note that Dawsonite is currently not included as an equilibrium_mineral, otherwise it is supersaturated in the initial configuration, so precipitates. Bethke does not report this in Fig30.4, so I assume it is due to temperature dependence
[GlobalParams]
point = '0 0 0'
[]
[TimeDependentReactionSolver]
model_definition = definition
geochemistry_reactor_name = reactor
charge_balance_species = "Cl-"
swap_into_basis = "Calcite Dolomite-ord Muscovite Kaolinite"
swap_out_of_basis = "HCO3- Mg++ K+ Al+++"
constraint_species = "H2O H+ Cl- Na+ Ca++ Calcite Dolomite-ord Muscovite Kaolinite SiO2(aq)"
constraint_value = " 1.0 1E-5 2.1716946 1.0288941 0.21650572 10.177537 3.6826177 1.320907 1.1432682 6.318e-05"
constraint_meaning = "kg_solvent_water activity bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition free_concentration"
constraint_unit = " kg dimensionless moles moles moles moles moles moles moles molal"
initial_temperature = 70.0
temperature = 70.0
kinetic_species_name = Quartz
kinetic_species_initial_value = 226.992243
kinetic_species_unit = moles
evaluate_kinetic_rates_always = true # implicit time-marching used for stability
ramp_max_ionic_strength_initial = 0 # max_ionic_strength in such a simple problem does not need ramping
close_system_at_time = 0.0
remove_fixed_activity_name = "H+"
remove_fixed_activity_time = 0.0
mode = 3 # flush through the NaOH solution specified below:
source_species_names = "H2O Na+ OH-"
source_species_rates = "27.755 0.25 0.25" # 1kg water/2days = 27.755moles/day. 0.5mol Na+/2days = 0.25mol/day
[]
[UserObjects]
[rate_quartz]
type = GeochemistryKineticRate
kinetic_species_name = Quartz
intrinsic_rate_constant = 1.3824E-13 # 1.6E-19mol/s/cm^2 = 1.3824E-13mol/day/cm^2
multiply_by_mass = true
area_quantity = 1000
promoting_species_names = "H+"
promoting_indices = "-0.5"
[]
[definition]
type = GeochemicalModelDefinition
database_file = "../../../database/moose_geochemdb.json"
basis_species = "H2O H+ Cl- Na+ Ca++ HCO3- Mg++ K+ Al+++ SiO2(aq)"
equilibrium_minerals = "Calcite Dolomite-ord Muscovite Kaolinite Paragonite Analcime Phlogopite Tridymite" # Dawsonite
kinetic_minerals = "Quartz"
kinetic_rate_descriptions = "rate_quartz"
[]
[]
[AuxVariables]
[diss_rate]
[]
[]
[AuxKernels]
[diss_rate]
type = ParsedAux
coupled_variables = mol_change_Quartz
expression = '-mol_change_Quartz / 1.0' # 1.0 = timestep size
variable = diss_rate
[]
[]
[Postprocessors]
[pH]
type = PointValue
variable = "pH"
[]
[rate_mole_per_day]
type = PointValue
variable = diss_rate
[]
[cm3_Calcite]
type = PointValue
variable = free_cm3_Calcite
[]
[cm3_Dolomite]
type = PointValue
variable = free_cm3_Dolomite-ord
[]
[cm3_Muscovite]
type = PointValue
variable = free_cm3_Muscovite
[]
[cm3_Kaolinite]
type = PointValue
variable = free_cm3_Kaolinite
[]
[cm3_Quartz]
type = PointValue
variable = free_cm3_Quartz
[]
[cm3_Paragonite]
type = PointValue
variable = free_cm3_Paragonite
[]
[cm3_Analcime]
type = PointValue
variable = free_cm3_Analcime
[]
[cm3_Phlogopite]
type = PointValue
variable = free_cm3_Phlogopite
[]
[cm3_Tridymite]
type = PointValue
variable = free_cm3_Tridymite
[]
[]
[Executioner]
type = Transient
dt = 1
end_time = 20 # measured in days
[]
[Outputs]
csv = true
[]
(modules/solid_mechanics/test/tests/notched_plastic_block/biaxial_planar.i)
# Uses non-smoothed Mohr-Coulomb (via ComputeMultiPlasticityStress and SolidMechanicsPlasticMohrCoulombMulti) to simulate the following problem.
# A cubical block is notched around its equator.
# All of its outer surfaces have roller BCs, but the notched region is free to move as needed
# The block is initialised with a high hydrostatic tensile stress
# Without the notch, the BCs do not allow contraction of the block, and this stress configuration is admissible
# With the notch, however, the interior parts of the block are free to move in order to relieve stress, and this causes plastic failure
# The top surface is then pulled upwards (the bottom is fixed because of the roller BCs)
# This causes more failure
[Mesh]
[generated_mesh]
type = GeneratedMeshGenerator
dim = 3
nx = 9
ny = 9
nz = 9
xmin = 0
xmax = 0.1
ymin = 0
ymax = 0.1
zmin = 0
zmax = 0.1
[]
[block_to_remove_xmin]
type = SubdomainBoundingBoxGenerator
bottom_left = '-0.01 -0.01 0.045'
top_right = '0.01 0.11 0.055'
location = INSIDE
block_id = 1
input = generated_mesh
[]
[block_to_remove_xmax]
type = SubdomainBoundingBoxGenerator
bottom_left = '0.09 -0.01 0.045'
top_right = '0.11 0.11 0.055'
location = INSIDE
block_id = 1
input = block_to_remove_xmin
[]
[block_to_remove_ymin]
type = SubdomainBoundingBoxGenerator
bottom_left = '-0.01 -0.01 0.045'
top_right = '0.11 0.01 0.055'
location = INSIDE
block_id = 1
input = block_to_remove_xmax
[]
[block_to_remove_ymax]
type = SubdomainBoundingBoxGenerator
bottom_left = '-0.01 0.09 0.045'
top_right = '0.11 0.11 0.055'
location = INSIDE
block_id = 1
input = block_to_remove_ymin
[]
[remove_block]
type = BlockDeletionGenerator
block = 1
input = block_to_remove_ymax
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
add_variables = true
incremental = true
generate_output = 'max_principal_stress mid_principal_stress min_principal_stress stress_zz'
eigenstrain_names = ini_stress
[]
[]
[Postprocessors]
[uz]
type = PointValue
point = '0 0 0.1'
use_displaced_mesh = false
variable = disp_z
[]
[s_zz]
type = ElementAverageValue
use_displaced_mesh = false
variable = stress_zz
[]
[num_res]
type = NumResidualEvaluations
[]
[nr_its]
type = ElementAverageValue
variable = num_iters
[]
[max_nr_its]
type = ElementExtremeValue
variable = num_iters
[]
[runtime]
type = PerfGraphData
data_type = TOTAL
section_name = 'Root'
[]
[]
[BCs]
# back=zmin, front=zmax, bottom=ymin, top=ymax, left=xmin, right=xmax
[xmin_xzero]
type = DirichletBC
variable = disp_x
boundary = left
value = 0.0
[]
[xmax_xzero]
type = DirichletBC
variable = disp_x
boundary = right
value = 0.0
[]
[ymin_yzero]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[]
[ymax_yzero]
type = DirichletBC
variable = disp_y
boundary = top
value = 0.0
[]
[zmin_zzero]
type = DirichletBC
variable = disp_z
boundary = back
value = '0'
[]
[zmax_disp]
type = FunctionDirichletBC
variable = disp_z
boundary = front
function = '1E-6*max(t,0)'
[]
[]
[AuxVariables]
[mc_int]
order = CONSTANT
family = MONOMIAL
[]
[plastic_strain]
order = CONSTANT
family = MONOMIAL
[]
[num_iters]
order = CONSTANT
family = MONOMIAL
[]
[yield_fcn]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[mc_int_auxk]
type = MaterialStdVectorAux
index = 0
property = plastic_internal_parameter
variable = mc_int
[]
[plastic_strain_aux]
type = MaterialRankTwoTensorAux
i = 2
j = 2
property = plastic_strain
variable = plastic_strain
[]
[num_iters_auxk] # cannot use plastic_NR_iterations directly as this is zero, since no NR iterations are actually used, since we use a custom algorithm to do the return
type = ParsedAux
coupled_variables = plastic_strain
expression = 'if(plastic_strain>0,1,0)'
variable = num_iters
[]
[yield_fcn_auxk]
type = MaterialStdVectorAux
index = 0
property = plastic_yield_function
variable = yield_fcn
[]
[]
[UserObjects]
[mc_coh]
type = SolidMechanicsHardeningConstant
value = 5E6
[]
[mc_phi]
type = SolidMechanicsHardeningConstant
value = 35
convert_to_radians = true
[]
[mc_psi]
type = SolidMechanicsHardeningConstant
value = 10
convert_to_radians = true
[]
[mc]
type = SolidMechanicsPlasticMohrCoulombMulti
cohesion = mc_coh
friction_angle = mc_phi
dilation_angle = mc_psi
yield_function_tolerance = 1E-5
internal_constraint_tolerance = 1E-11
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 16E9
poissons_ratio = 0.25
[]
[mc]
type = ComputeMultiPlasticityStress
ep_plastic_tolerance = 1E-11
plastic_models = mc
max_NR_iterations = 1000
debug_fspb = crash
[]
[strain_from_initial_stress]
type = ComputeEigenstrainFromInitialStress
initial_stress = '6E6 0 0 0 6E6 0 0 0 6E6'
eigenstrain_name = ini_stress
[]
[]
[Preconditioning]
[andy]
type = SMP
full = true
[]
[]
[Executioner]
start_time = -1
end_time = 10
dt = 1
dtmin = 1
solve_type = NEWTON
type = Transient
l_tol = 1E-2
nl_abs_tol = 1E-5
nl_rel_tol = 1E-7
l_max_its = 200
nl_max_its = 400
petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
petsc_options_value = ' asm 2 lu gmres 200'
[]
[Outputs]
perf_graph = true
csv = true
[]
(modules/porous_flow/examples/fluidflower/fluidflower.i)
# FluidFlower International Benchmark study model
# CSIRO 2023
#
# This example can be used to reproduce the results presented by the
# CSIRO team as part of this benchmark study. See
# Green, C., Jackson, S.J., Gunning, J., Wilkins, A. and Ennis-King, J.,
# 2023. Modelling the FluidFlower: Insights from Characterisation and
# Numerical Predictions. Transport in Porous Media.
#
# This example takes a long time to run! The large density contrast
# between the gas phase CO2 and the water makes convergence very hard,
# so small timesteps must be taken during injection.
#
# This example uses a simplified mesh in order to be run during the
# automated testing. To reproduce the results of the benchmark study,
# replace the simple layered input mesh with the one located in the
# large_media submodule.
#
# The mesh file contains:
# - porosity as given by FluidFlower description
# - permeability as given by FluidFlower description
# - subdomain ids for each sand type
#
# The nominal thickness of the FluidFlower tank is 19mm. To keep masses consistent
# with the experiment, porosity and permeability are multiplied by the thickness
thickness = 0.019
#
# Properties associated with each sand type associated with mesh block ids
#
# block 0 - ESF (very fine sand)
sandESF = '0 10 20'
sandESF_pe = 1471.5
sandESF_krg = 0.09
sandESF_swi = 0.32
sandESF_krw = 0.71
sandESF_sgi = 0.14
# block 1 - C - Coarse lower
sandC = '1 21'
sandC_pe = 294.3
sandC_krg = 0.05
sandC_swi = 0.14
sandC_krw = 0.93
sandC_sgi = 0.1
# block 2 - D - Coarse upper
sandD = '2 22'
sandD_pe = 98.1
sandD_krg = 0.02
sandD_swi = 0.12
sandD_krw = 0.95
sandD_sgi = 0.08
# block 3 - E - Very Coarse lower
sandE = '3 13 23'
sandE_pe = 10
sandE_krg = 0.1
sandE_swi = 0.12
sandE_krw = 0.93
sandE_sgi = 0.06
# block 4 - F - Very Coarse upper
sandF = '4 14 24 34'
sandF_pe = 10
sandF_krg = 0.11
sandF_swi = 0.12
sandF_krw = 0.72
sandF_sgi = 0.13
# block 5 - G - Flush Zone
sandG = '5 15 35'
sandG_pe = 10
sandG_krg = 0.16
sandG_swi = 0.1
sandG_krw = 0.75
sandG_sgi = 0.06
# block 6 - Fault 1 - Heterogeneous
fault1 = '6 26'
fault1_pe = 10
fault1_krg = 0.16
fault1_swi = 0.1
fault1_krw = 0.75
fault1_sgi = 0.06
# block 7 - Fault 2 - Impermeable
# Note: this fault has been removed from the mesh (no elements in this region)
# block 8 - Fault 3 - Homogeneous
fault3 = '8'
fault3_pe = 10
fault3_krg = 0.16
fault3_swi = 0.1
fault3_krw = 0.75
fault3_sgi = 0.06
# Top layer
top_layer = '9'
# Boxes A, B an C used to report values (sg, sgr, xco2, etc)
boxA = '10 13 14 15 34 35'
boxB = '20 21 22 23 24 26'
boxC = '34 35'
# Furthermore, the seal sand unit in boxes A and B
seal_boxA = '10'
seal_boxB = '20'
# CO2 injection details:
# CO2 density ~1.8389 kg/m3 at 293.15 K, 1.01325e5 Pa
# Injection in Port (9, 3) for 5 hours.
# Injection in Port (17, 7) for 2:45 hours.
# Injection of 10 ml/min = 0.1666 ml/s = 1.666e-7 m3/s = ~3.06e-7 kg/s.
# Total mass of CO2 injected ~ 8.5g.
inj_rate = 3.06e-7
[Mesh]
[mesh]
type = FileMeshGenerator
file = 'fluidflower_test.e'
# file = '../../../../large_media/porous_flow/examples/fluidflower/fluidflower.e'
use_for_exodus_restart = true
[]
[]
[Debug]
show_var_residual_norms = true
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 -9.81 0'
temperature = temperature
log_extension = false
[]
[Variables]
[pgas]
family = MONOMIAL
order = CONSTANT
fv = true
[]
[z]
family = MONOMIAL
order = CONSTANT
fv = true
scaling = 1e4
[]
[]
[AuxVariables]
[xnacl]
family = MONOMIAL
order = CONSTANT
fv = true
initial_condition = 0.0055
[]
[temperature]
family = MONOMIAL
order = CONSTANT
fv = true
initial_condition = 20
[]
[porosity]
family = MONOMIAL
order = CONSTANT
fv = true
initial_from_file_var = porosity
[]
[porosity_times_thickness]
family = MONOMIAL
order = CONSTANT
fv = true
[]
[permeability]
family = MONOMIAL
order = CONSTANT
fv = true
initial_from_file_var = permeability
[]
[permeability_times_thickness]
family = MONOMIAL
order = CONSTANT
fv = true
[]
[saturation_water]
family = MONOMIAL
order = CONSTANT
[]
[saturation_gas]
family = MONOMIAL
order = CONSTANT
[]
[pressure_water]
family = MONOMIAL
order = CONSTANT
[]
[pc]
family = MONOMIAL
order = CONSTANT
[]
[x0_water]
order = CONSTANT
family = MONOMIAL
[]
[x0_gas]
order = CONSTANT
family = MONOMIAL
[]
[x1_water]
order = CONSTANT
family = MONOMIAL
[]
[x1_gas]
order = CONSTANT
family = MONOMIAL
[]
[density_water]
order = CONSTANT
family = MONOMIAL
[]
[density_gas]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[porosity_times_thickness]
type = ParsedAux
variable = porosity_times_thickness
coupled_variables = porosity
expression = 'porosity * ${thickness}'
execute_on = 'initial'
[]
[permeability_times_thickness]
type = ParsedAux
variable = permeability_times_thickness
coupled_variables = permeability
expression = 'permeability * ${thickness}'
execute_on = 'initial'
[]
[pressure_water]
type = ADPorousFlowPropertyAux
variable = pressure_water
property = pressure
phase = 0
execute_on = 'initial timestep_end'
[]
[saturation_water]
type = ADPorousFlowPropertyAux
variable = saturation_water
property = saturation
phase = 0
execute_on = 'initial timestep_end'
[]
[saturation_gas]
type = ADPorousFlowPropertyAux
variable = saturation_gas
property = saturation
phase = 1
execute_on = 'initial timestep_end'
[]
[density_water]
type = ADPorousFlowPropertyAux
variable = density_water
property = density
phase = 0
execute_on = 'initial timestep_end'
[]
[density_gas]
type = ADPorousFlowPropertyAux
variable = density_gas
property = density
phase = 1
execute_on = 'initial timestep_end'
[]
[x1_water]
type = ADPorousFlowPropertyAux
variable = x1_water
property = mass_fraction
phase = 0
fluid_component = 1
execute_on = 'initial timestep_end'
[]
[x1_gas]
type = ADPorousFlowPropertyAux
variable = x1_gas
property = mass_fraction
phase = 1
fluid_component = 1
execute_on = 'initial timestep_end'
[]
[x0_water]
type = ADPorousFlowPropertyAux
variable = x0_water
property = mass_fraction
phase = 0
fluid_component = 0
execute_on = 'initial timestep_end'
[]
[x0_gas]
type = ADPorousFlowPropertyAux
variable = x0_gas
property = mass_fraction
phase = 1
fluid_component = 0
execute_on = 'initial timestep_end'
[]
[pc]
type = ADPorousFlowPropertyAux
variable = pc
property = capillary_pressure
execute_on = 'initial timestep_end'
[]
[]
[FVKernels]
[mass0]
type = FVPorousFlowMassTimeDerivative
variable = pgas
fluid_component = 0
[]
[flux0]
type = FVPorousFlowAdvectiveFlux
variable = pgas
fluid_component = 0
[]
[diff0]
type = FVPorousFlowDispersiveFlux
variable = pgas
fluid_component = 0
disp_long = '0 0'
disp_trans = '0 0'
[]
[mass1]
type = FVPorousFlowMassTimeDerivative
variable = z
fluid_component = 1
[]
[flux1]
type = FVPorousFlowAdvectiveFlux
variable = z
fluid_component = 1
[]
[diff1]
type = FVPorousFlowDispersiveFlux
variable = z
fluid_component = 1
disp_long = '0 0'
disp_trans = '0 0'
[]
[]
[DiracKernels]
[injector1]
type = ConstantPointSource
point = '0.9 0.3 0'
value = ${inj_rate}
variable = z
[]
[injector2]
type = ConstantPointSource
point = '1.7 0.7 0'
value = ${inj_rate}
variable = z
[]
[]
[Controls]
[injection1]
type = ConditionalFunctionEnableControl
enable_objects = 'DiracKernels::injector1'
conditional_function = injection_schedule1
[]
[injection2]
type = ConditionalFunctionEnableControl
enable_objects = 'DiracKernels::injector2'
conditional_function = injection_schedule2
[]
[]
[Functions]
[initial_p]
type = ParsedFunction
symbol_names = 'p0 g H rho0'
symbol_values = '101.325e3 9.81 1.5 1002'
expression = 'p0 + rho0 * g * (H - y)'
[]
[injection_schedule1]
type = ParsedFunction
expression = 'if(t >= 0 & t <= 1.8e4, 1, 0)'
[]
[injection_schedule2]
type = ParsedFunction
expression = 'if(t >= 8.1e3 & t <= 1.8e4, 1, 0)'
[]
[]
[ICs]
[p]
type = FunctionIC
variable = pgas
function = initial_p
[]
[]
[FVBCs]
[pressure_top]
type = FVPorousFlowAdvectiveFluxBC
boundary = top
porepressure_value = 1.01325e5
variable = pgas
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[watertab]
type = TabulatedBicubicFluidProperties
fp = water
save_file = false
pressure_min = 1e5
pressure_max = 1e6
temperature_min = 290
temperature_max = 300
num_p = 20
num_T = 10
[]
[co2]
type = CO2FluidProperties
[]
[co2tab]
type = TabulatedBicubicFluidProperties
fp = co2
save_file = false
pressure_min = 1e5
pressure_max = 1e6
temperature_min = 290
temperature_max = 300
num_p = 20
num_T = 10
[]
[brine]
type = BrineFluidProperties
water_fp = watertab
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pgas z'
number_fluid_phases = 2
number_fluid_components = 2
[]
[sandESF_pc]
type = PorousFlowCapillaryPressureBC
pe = ${sandESF_pe}
lambda = 2
block = ${sandESF}
pc_max = 1e4
sat_lr = ${sandESF_swi}
[]
[sandC_pc]
type = PorousFlowCapillaryPressureBC
pe = ${sandC_pe}
lambda = 2
block = ${sandC}
pc_max = 1e4
sat_lr = ${sandC_swi}
[]
[sandD_pc]
type = PorousFlowCapillaryPressureBC
pe = ${sandD_pe}
lambda = 2
block = ${sandD}
pc_max = 1e4
sat_lr = ${sandD_swi}
[]
[sandE_pc]
type = PorousFlowCapillaryPressureBC
pe = ${sandE_pe}
lambda = 2
block = ${sandE}
pc_max = 1e4
sat_lr = ${sandE_swi}
[]
[sandF_pc]
type = PorousFlowCapillaryPressureBC
pe = ${sandF_pe}
lambda = 2
block = ${sandF}
pc_max = 1e4
sat_lr = ${sandF_swi}
[]
[sandG_pc]
type = PorousFlowCapillaryPressureBC
pe = ${sandG_pe}
lambda = 2
block = ${sandG}
pc_max = 1e4
sat_lr = ${sandG_swi}
[]
[fault1_pc]
type = PorousFlowCapillaryPressureBC
pe = ${fault1_pe}
lambda = 2
block = ${fault1}
pc_max = 1e4
sat_lr = ${fault1_swi}
[]
[fault3_pc]
type = PorousFlowCapillaryPressureBC
pe = ${fault3_pe}
lambda = 2
block = ${fault3}
pc_max = 1e4
sat_lr = ${fault3_swi}
[]
[top_layer_pc]
type = PorousFlowCapillaryPressureConst
pc = 0
block = ${top_layer}
[]
[sandESF_fs]
type = PorousFlowBrineCO2
brine_fp = brine
co2_fp = co2tab
capillary_pressure = sandESF_pc
[]
[sandC_fs]
type = PorousFlowBrineCO2
brine_fp = brine
co2_fp = co2tab
capillary_pressure = sandC_pc
[]
[sandD_fs]
type = PorousFlowBrineCO2
brine_fp = brine
co2_fp = co2tab
capillary_pressure = sandD_pc
[]
[sandE_fs]
type = PorousFlowBrineCO2
brine_fp = brine
co2_fp = co2tab
capillary_pressure = sandE_pc
[]
[sandF_fs]
type = PorousFlowBrineCO2
brine_fp = brine
co2_fp = co2tab
capillary_pressure = sandF_pc
[]
[sandG_fs]
type = PorousFlowBrineCO2
brine_fp = brine
co2_fp = co2tab
capillary_pressure = sandG_pc
[]
[fault1_fs]
type = PorousFlowBrineCO2
brine_fp = brine
co2_fp = co2tab
capillary_pressure = fault1_pc
[]
[fault3_fs]
type = PorousFlowBrineCO2
brine_fp = brine
co2_fp = co2tab
capillary_pressure = fault3_pc
[]
[top_layer_fs]
type = PorousFlowBrineCO2
brine_fp = brine
co2_fp = co2tab
capillary_pressure = top_layer_pc
[]
[]
[Materials]
[temperature]
type = ADPorousFlowTemperature
temperature = temperature
[]
[sandESF_brineco2]
type = ADPorousFlowFluidState
gas_porepressure = pgas
z = z
temperature_unit = Celsius
xnacl = xnacl
fluid_state = sandESF_fs
capillary_pressure = sandESF_pc
block = ${sandESF}
[]
[sandC_brineco2]
type = ADPorousFlowFluidState
gas_porepressure = pgas
z = z
temperature_unit = Celsius
xnacl = xnacl
fluid_state = sandC_fs
capillary_pressure = sandC_pc
block = ${sandC}
[]
[sandD_brineco2]
type = ADPorousFlowFluidState
gas_porepressure = pgas
z = z
temperature_unit = Celsius
xnacl = xnacl
fluid_state = sandD_fs
capillary_pressure = sandD_pc
block = ${sandD}
[]
[sandE_brineco2]
type = ADPorousFlowFluidState
gas_porepressure = pgas
z = z
temperature_unit = Celsius
xnacl = xnacl
fluid_state = sandE_fs
capillary_pressure = sandE_pc
block = ${sandE}
[]
[sandF_brineco2]
type = ADPorousFlowFluidState
gas_porepressure = pgas
z = z
temperature_unit = Celsius
xnacl = xnacl
fluid_state = sandF_fs
capillary_pressure = sandF_pc
block = ${sandF}
[]
[sandG_brineco2]
type = ADPorousFlowFluidState
gas_porepressure = pgas
z = z
temperature_unit = Celsius
xnacl = xnacl
fluid_state = sandG_fs
capillary_pressure = sandG_pc
block = ${sandG}
[]
[fault1_brineco2]
type = ADPorousFlowFluidState
gas_porepressure = pgas
z = z
temperature_unit = Celsius
xnacl = xnacl
fluid_state = fault1_fs
capillary_pressure = fault1_pc
block = ${fault1}
[]
[fault3_brineco2]
type = ADPorousFlowFluidState
gas_porepressure = pgas
z = z
temperature_unit = Celsius
xnacl = xnacl
fluid_state = fault3_fs
capillary_pressure = fault3_pc
block = ${fault3}
[]
[top_layer_brineco2]
type = ADPorousFlowFluidState
gas_porepressure = pgas
z = z
temperature_unit = Celsius
xnacl = xnacl
fluid_state = top_layer_fs
capillary_pressure = top_layer_pc
block = ${top_layer}
[]
[porosity]
type = ADPorousFlowPorosityConst
porosity = porosity_times_thickness
[]
[permeability]
type = ADPorousFlowPermeabilityConstFromVar
perm_xx = permeability_times_thickness
perm_yy = permeability_times_thickness
perm_zz = permeability_times_thickness
[]
[diffcoeff]
type = ADPorousFlowDiffusivityConst
tortuosity = '1 1'
diffusion_coeff = '2e-9 2e-9 0 0'
[]
[sandESF_relperm0]
type = ADPorousFlowRelativePermeabilityBC
phase = 0
lambda = 2
s_res = ${sandESF_swi}
sum_s_res = ${fparse sandESF_sgi + sandESF_swi}
scaling = ${sandESF_krw}
block = ${sandESF}
[]
[sandESF_relperm1]
type = ADPorousFlowRelativePermeabilityBC
phase = 1
nw_phase = true
lambda = 2
s_res = ${sandESF_sgi}
sum_s_res = ${fparse sandESF_sgi + sandESF_swi}
scaling = ${sandESF_krg}
block = ${sandESF}
[]
[sandC_relperm0]
type = ADPorousFlowRelativePermeabilityBC
phase = 0
lambda = 2
s_res = ${sandC_swi}
sum_s_res = ${fparse sandC_sgi + sandC_swi}
scaling = ${sandC_krw}
block = ${sandC}
[]
[sandC_relperm1]
type = ADPorousFlowRelativePermeabilityBC
phase = 1
nw_phase = true
lambda = 2
s_res = ${sandC_sgi}
sum_s_res = ${fparse sandC_sgi + sandC_swi}
scaling = ${sandC_krg}
block = ${sandC}
[]
[sandD_relperm0]
type = ADPorousFlowRelativePermeabilityBC
phase = 0
lambda = 2
s_res = ${sandD_swi}
sum_s_res = ${fparse sandD_sgi + sandD_swi}
scaling = ${sandD_krw}
block = ${sandD}
[]
[sandD_relperm1]
type = ADPorousFlowRelativePermeabilityBC
phase = 1
nw_phase = true
lambda = 2
s_res = ${sandD_sgi}
sum_s_res = ${fparse sandD_sgi + sandD_swi}
scaling = ${sandD_krg}
block = ${sandD}
[]
[sandE_relperm0]
type = ADPorousFlowRelativePermeabilityBC
phase = 0
lambda = 2
s_res = ${sandE_swi}
sum_s_res = ${fparse sandE_sgi + sandE_swi}
scaling = ${sandE_krw}
block = ${sandE}
[]
[sandE_relperm1]
type = ADPorousFlowRelativePermeabilityBC
phase = 1
nw_phase = true
lambda = 2
s_res = ${sandE_sgi}
sum_s_res = ${fparse sandE_sgi + sandE_swi}
scaling = ${sandE_krg}
block = ${sandE}
[]
[sandF_relperm0]
type = ADPorousFlowRelativePermeabilityBC
phase = 0
lambda = 2
s_res = ${sandF_swi}
sum_s_res = ${fparse sandF_sgi + sandF_swi}
scaling = ${sandF_krw}
block = ${sandF}
[]
[sandF_relperm1]
type = ADPorousFlowRelativePermeabilityBC
phase = 1
nw_phase = true
lambda = 2
s_res = ${sandF_sgi}
sum_s_res = ${fparse sandF_sgi + sandF_swi}
scaling = ${sandF_krg}
block = ${sandF}
[]
[sandG_relperm0]
type = ADPorousFlowRelativePermeabilityBC
phase = 0
lambda = 2
s_res = ${sandG_swi}
sum_s_res = ${fparse sandG_sgi + sandG_swi}
scaling = ${sandG_krw}
block = ${sandG}
[]
[sandG_relperm1]
type = ADPorousFlowRelativePermeabilityBC
phase = 1
nw_phase = true
lambda = 2
s_res = ${sandG_sgi}
sum_s_res = ${fparse sandG_sgi + sandG_swi}
scaling = ${sandG_krg}
block = ${sandG}
[]
[fault1_relperm0]
type = ADPorousFlowRelativePermeabilityBC
phase = 0
lambda = 2
s_res = ${fault1_swi}
sum_s_res = ${fparse fault1_sgi + fault1_swi}
scaling = ${fault1_krw}
block = ${fault1}
[]
[fault1_relperm1]
type = ADPorousFlowRelativePermeabilityBC
phase = 1
nw_phase = true
lambda = 2
s_res = ${fault1_sgi}
sum_s_res = ${fparse fault1_sgi + fault1_swi}
scaling = ${fault1_krg}
block = ${fault1}
[]
[fault3_relperm0]
type = ADPorousFlowRelativePermeabilityBC
phase = 0
lambda = 2
s_res = ${fault3_swi}
sum_s_res = ${fparse fault3_sgi + fault3_swi}
scaling = ${fault3_krw}
block = ${fault3}
[]
[fault3_relperm1]
type = ADPorousFlowRelativePermeabilityBC
phase = 1
nw_phase = true
lambda = 2
s_res = ${fault3_sgi}
sum_s_res = ${fparse fault3_sgi + fault3_swi}
scaling = ${fault3_krg}
block = ${fault3}
[]
[top_layer_relperm0]
type = ADPorousFlowRelativePermeabilityBC
phase = 0
lambda = 2
block = ${top_layer}
[]
[top_layer_relperm1]
type = ADPorousFlowRelativePermeabilityBC
phase = 1
nw_phase = true
lambda = 2
block = ${top_layer}
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options = '-ksp_snes_ew'
petsc_options_iname = '-ksp_type -pc_type -pc_factor_mat_solver_package -sub_pc_factor_shift_type'
petsc_options_value = 'gmres lu mumps NONZERO'
# petsc_options_iname = '-ksp_type -pc_type -pc_hypre_type -sub_pc_type -sub_pc_factor_shift_type -sub_pc_factor_levels -ksp_gmres_restart'
# petsc_options_value = 'gmres hypre boomeramg lu NONZERO 4 301'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
dtmax = 60
start_time = 0
end_time = 4.32e5
nl_rel_tol = 1e-6
nl_abs_tol = 1e-8
nl_max_its = 15
l_tol = 1e-5
l_abs_tol = 1e-8
# line_search = none # Can be a useful option for this problem
[TimeSteppers]
[time]
type = FunctionDT
growth_factor = 2
cutback_factor_at_failure = 0.5
function = 'if(t<1.8e4, 2, if(t<3.6e4, 20, 60))'
[]
[]
[]
[Postprocessors]
[p_5_3]
type = PointValue
variable = pgas
point = '0.5 0.3 0'
execute_on = 'initial timestep_end'
[]
[p_5_3_w]
type = PointValue
variable = pressure_water
point = '0.5 0.3 0'
execute_on = 'initial timestep_end'
[]
[p_5_7]
type = PointValue
variable = pgas
point = '0.5 0.7 0'
execute_on = 'initial timestep_end'
[]
[p_5_7_w]
type = PointValue
variable = pressure_water
point = '0.5 0.7 0'
execute_on = 'initial timestep_end'
[]
[p_9_3]
type = PointValue
variable = pgas
point = '0.9 0.3 0'
execute_on = 'initial timestep_end'
[]
[p_9_3_w]
type = PointValue
variable = pressure_water
point = '0.9 0.3 0'
execute_on = 'initial timestep_end'
[]
[p_15_5]
type = PointValue
variable = pgas
point = '1.5 0.5 0'
execute_on = 'initial timestep_end'
[]
[p_15_5_w]
type = PointValue
variable = pressure_water
point = '1.5 0.5 0'
execute_on = 'initial timestep_end'
[]
[p_17_7]
type = PointValue
variable = pgas
point = '1.7 0.7 0'
execute_on = 'initial timestep_end'
[]
[p_17_7_w]
type = PointValue
variable = pressure_water
point = '1.7 0.7 0'
execute_on = 'initial timestep_end'
[]
[p_17_11]
type = PointValue
variable = pgas
point = '1.7 1.1 0'
execute_on = 'initial timestep_end'
[]
[p_17_11_w]
type = PointValue
variable = pressure_water
point = '1.7 1.1 0'
execute_on = 'initial timestep_end'
[]
[x0mass]
type = FVPorousFlowFluidMass
fluid_component = 0
phase = '0 1'
execute_on = 'initial timestep_end'
[]
[x1mass]
type = FVPorousFlowFluidMass
fluid_component = 1
phase = '0 1'
execute_on = 'initial timestep_end'
[]
[x1gas]
type = FVPorousFlowFluidMass
fluid_component = 1
phase = '1'
execute_on = 'initial timestep_end'
[]
[boxA]
type = FVPorousFlowFluidMass
fluid_component = 1
phase = '0 1'
block = ${boxA}
execute_on = 'initial timestep_end'
[]
[imm_A_sandESF]
type = FVPorousFlowFluidMass
fluid_component = 1
phase = 1
saturation_threshold = ${sandESF_sgi}
block = 10
execute_on = 'initial timestep_end'
[]
[imm_A_sandE]
type = FVPorousFlowFluidMass
fluid_component = 1
phase = 1
saturation_threshold = ${sandE_sgi}
block = 13
execute_on = 'initial timestep_end'
[]
[imm_A_sandF]
type = FVPorousFlowFluidMass
fluid_component = 1
phase = 1
saturation_threshold = ${sandF_sgi}
block = '14 34'
execute_on = 'initial timestep_end'
[]
[imm_A_sandG]
type = FVPorousFlowFluidMass
fluid_component = 1
phase = 1
saturation_threshold = ${sandG_sgi}
block = '15 35'
execute_on = 'initial timestep_end'
[]
[imm_A]
type = LinearCombinationPostprocessor
pp_names = 'imm_A_sandESF imm_A_sandE imm_A_sandF imm_A_sandG'
pp_coefs = '1 1 1 1'
execute_on = 'initial timestep_end'
[]
[diss_A]
type = FVPorousFlowFluidMass
fluid_component = 1
phase = 0
block = ${boxA}
execute_on = 'initial timestep_end'
[]
[seal_A]
type = FVPorousFlowFluidMass
fluid_component = 1
phase = '0 1'
block = ${seal_boxA}
execute_on = 'initial timestep_end'
[]
[boxB]
type = FVPorousFlowFluidMass
fluid_component = 1
phase = '0 1'
block = ${boxB}
execute_on = 'initial timestep_end'
[]
[imm_B_sandESF]
type = FVPorousFlowFluidMass
fluid_component = 1
phase = 1
saturation_threshold = ${sandESF_sgi}
block = 20
execute_on = 'initial timestep_end'
[]
[imm_B_sandC]
type = FVPorousFlowFluidMass
fluid_component = 1
phase = 1
saturation_threshold = ${sandC_sgi}
block = 21
execute_on = 'initial timestep_end'
[]
[imm_B_sandD]
type = FVPorousFlowFluidMass
fluid_component = 1
phase = 1
saturation_threshold = ${sandD_sgi}
block = 22
execute_on = 'initial timestep_end'
[]
[imm_B_sandE]
type = FVPorousFlowFluidMass
fluid_component = 1
phase = 1
saturation_threshold = ${sandE_sgi}
block = 23
execute_on = 'initial timestep_end'
[]
[imm_B_sandF]
type = FVPorousFlowFluidMass
fluid_component = 1
phase = 1
saturation_threshold = ${sandF_sgi}
block = 24
execute_on = 'initial timestep_end'
[]
[imm_B_fault1]
type = FVPorousFlowFluidMass
fluid_component = 1
phase = 1
saturation_threshold = ${fault1_sgi}
block = 26
execute_on = 'initial timestep_end'
[]
[imm_B]
type = LinearCombinationPostprocessor
pp_names = 'imm_B_sandESF imm_B_sandC imm_B_sandD imm_B_sandE imm_B_sandF imm_B_fault1'
pp_coefs = '1 1 1 1 1 1'
execute_on = 'initial timestep_end'
[]
[diss_B]
type = FVPorousFlowFluidMass
fluid_component = 1
phase = 0
block = ${boxB}
execute_on = 'initial timestep_end'
[]
[seal_B]
type = FVPorousFlowFluidMass
fluid_component = 1
phase = '0 1'
block = ${seal_boxB}
execute_on = 'initial timestep_end'
[]
[boxC]
type = FVPorousFlowFluidMass
fluid_component = 1
phase = '0'
block = ${boxC}
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
print_linear_residuals = false
perf_graph = true
# exodus = true
[csv]
type = CSV
[]
[]
(test/tests/misc/check_error/aux_kernel_with_var.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
[]
[Variables]
[u]
order = FIRST
family = LAGRANGE
[]
[]
[AuxVariables]
[v]
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[rea]
type = Reaction
variable = u
[]
[]
[AuxKernels]
[nope]
type = ParsedAux
variable = u
expression = '1'
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = 1
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = 2
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
file_base = out
[]
(modules/porous_flow/examples/thm_example/2D_c.i)
# Two phase, temperature-dependent, with mechanics and chemistry, radial with fine mesh, constant injection of cold co2 into a overburden-reservoir-underburden containing mostly water
# species=0 is water
# species=1 is co2
# phase=0 is liquid, and since massfrac_ph0_sp0 = 1, this is all water
# phase=1 is gas, and since massfrac_ph1_sp0 = 0, this is all co2
#
# The mesh used below has very high resolution, so the simulation takes a long time to complete.
# Some suggested meshes of different resolution:
# nx=50, bias_x=1.2
# nx=100, bias_x=1.1
# nx=200, bias_x=1.05
# nx=400, bias_x=1.02
# nx=1000, bias_x=1.01
# nx=2000, bias_x=1.003
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2000
bias_x = 1.003
xmin = 0.1
xmax = 5000
ny = 1
ymin = 0
ymax = 11
[]
[Problem]
coord_type = RZ
[]
[GlobalParams]
displacements = 'disp_r disp_z'
PorousFlowDictator = dictator
gravity = '0 0 0'
biot_coefficient = 1.0
[]
[Variables]
[pwater]
initial_condition = 18.3e6
[]
[sgas]
initial_condition = 0.0
[]
[temp]
initial_condition = 358
[]
[disp_r]
[]
[]
[AuxVariables]
[rate]
[]
[disp_z]
[]
[massfrac_ph0_sp0]
initial_condition = 1 # all H20 in phase=0
[]
[massfrac_ph1_sp0]
initial_condition = 0 # no H2O in phase=1
[]
[pgas]
family = MONOMIAL
order = FIRST
[]
[swater]
family = MONOMIAL
order = FIRST
[]
[stress_rr]
order = CONSTANT
family = MONOMIAL
[]
[stress_tt]
order = CONSTANT
family = MONOMIAL
[]
[stress_zz]
order = CONSTANT
family = MONOMIAL
[]
[mineral_conc_m3_per_m3]
family = MONOMIAL
order = CONSTANT
initial_condition = 0.1
[]
[eqm_const]
initial_condition = 0.0
[]
[porosity]
family = MONOMIAL
order = CONSTANT
[]
[]
[Kernels]
[mass_water_dot]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = pwater
[]
[flux_water]
type = PorousFlowAdvectiveFlux
fluid_component = 0
use_displaced_mesh = false
variable = pwater
[]
[mass_co2_dot]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = sgas
[]
[flux_co2]
type = PorousFlowAdvectiveFlux
fluid_component = 1
use_displaced_mesh = false
variable = sgas
[]
[energy_dot]
type = PorousFlowEnergyTimeDerivative
variable = temp
[]
[advection]
type = PorousFlowHeatAdvection
use_displaced_mesh = false
variable = temp
[]
[conduction]
type = PorousFlowExponentialDecay
use_displaced_mesh = false
variable = temp
reference = 358
rate = rate
[]
[grad_stress_r]
type = StressDivergenceRZTensors
temperature = temp
eigenstrain_names = thermal_contribution
variable = disp_r
use_displaced_mesh = false
component = 0
[]
[poro_r]
type = PorousFlowEffectiveStressCoupling
variable = disp_r
use_displaced_mesh = false
component = 0
[]
[]
[AuxKernels]
[rate]
type = FunctionAux
variable = rate
execute_on = timestep_begin
function = decay_rate
[]
[pgas]
type = PorousFlowPropertyAux
property = pressure
phase = 1
variable = pgas
[]
[swater]
type = PorousFlowPropertyAux
property = saturation
phase = 0
variable = swater
[]
[stress_rr]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_rr
index_i = 0
index_j = 0
[]
[stress_tt]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_tt
index_i = 2
index_j = 2
[]
[stress_zz]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_zz
index_i = 1
index_j = 1
[]
[mineral]
type = PorousFlowPropertyAux
property = mineral_concentration
mineral_species = 0
variable = mineral_conc_m3_per_m3
[]
[eqm_const_auxk]
type = ParsedAux
variable = eqm_const
coupled_variables = temp
expression = '(358 - temp) / (358 - 294)'
[]
[porosity_auxk]
type = PorousFlowPropertyAux
property = porosity
variable = porosity
[]
[]
[Functions]
[decay_rate]
# Eqn(26) of the first paper of LaForce et al.
# Ka * (rho C)_a = 10056886.914
# h = 11
type = ParsedFunction
expression = 'sqrt(10056886.914/t)/11.0'
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'temp pwater sgas disp_r'
number_fluid_phases = 2
number_fluid_components = 2
number_aqueous_kinetic = 1
aqueous_phase_number = 1
[]
[pc]
type = PorousFlowCapillaryPressureConst
pc = 0
[]
[]
[FluidProperties]
[water]
type = SimpleFluidProperties
bulk_modulus = 2.27e14
density0 = 970.0
viscosity = 0.3394e-3
cv = 4149.0
cp = 4149.0
porepressure_coefficient = 0.0
thermal_expansion = 0
[]
[co2]
type = SimpleFluidProperties
bulk_modulus = 2.27e14
density0 = 516.48
viscosity = 0.0393e-3
cv = 2920.5
cp = 2920.5
porepressure_coefficient = 0.0
thermal_expansion = 0
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = temp
[]
[ppss]
type = PorousFlow2PhasePS
phase0_porepressure = pwater
phase1_saturation = sgas
capillary_pressure = pc
[]
[massfrac]
type = PorousFlowMassFraction
mass_fraction_vars = 'massfrac_ph0_sp0 massfrac_ph1_sp0'
[]
[water]
type = PorousFlowSingleComponentFluid
fp = water
phase = 0
[]
[gas]
type = PorousFlowSingleComponentFluid
fp = co2
phase = 1
[]
[porosity_reservoir]
type = PorousFlowPorosity
porosity_zero = 0.2
chemical = true
reference_chemistry = 0.1
initial_mineral_concentrations = 0.1
[]
[permeability_reservoir]
type = PorousFlowPermeabilityConst
permeability = '2e-12 0 0 0 0 0 0 0 0'
[]
[relperm_liquid]
type = PorousFlowRelativePermeabilityCorey
n = 4
phase = 0
s_res = 0.200
sum_s_res = 0.405
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityBC
phase = 1
s_res = 0.205
sum_s_res = 0.405
nw_phase = true
lambda = 2
[]
[thermal_conductivity_reservoir]
type = PorousFlowThermalConductivityIdeal
dry_thermal_conductivity = '0 0 0 0 1.320 0 0 0 0'
wet_thermal_conductivity = '0 0 0 0 3.083 0 0 0 0'
[]
[internal_energy_reservoir]
type = PorousFlowMatrixInternalEnergy
specific_heat_capacity = 1100
density = 2350.0
[]
[elasticity_tensor]
type = ComputeIsotropicElasticityTensor
shear_modulus = 6.0E9
poissons_ratio = 0.2
[]
[strain]
type = ComputeAxisymmetricRZSmallStrain
eigenstrain_names = 'thermal_contribution ini_stress'
[]
[ini_strain]
type = ComputeEigenstrainFromInitialStress
initial_stress = '-12.8E6 0 0 0 -51.3E6 0 0 0 -12.8E6'
eigenstrain_name = ini_stress
[]
[thermal_contribution]
type = ComputeThermalExpansionEigenstrain
temperature = temp
stress_free_temperature = 358
thermal_expansion_coeff = 5E-6
eigenstrain_name = thermal_contribution
[]
[stress]
type = ComputeLinearElasticStress
[]
[eff_fluid_pressure]
type = PorousFlowEffectiveFluidPressure
[]
[vol_strain]
type = PorousFlowVolumetricStrain
[]
[predis]
type = PorousFlowAqueousPreDisChemistry
num_reactions = 1
primary_concentrations = 1.0 # fixed activity
equilibrium_constants_as_log10 = true
equilibrium_constants = eqm_const
primary_activity_coefficients = 1.0 # fixed activity
reactions = 1
kinetic_rate_constant = 1E-6
molar_volume = 1.0
specific_reactive_surface_area = 1.0
activation_energy = 0.0 # no Arrhenius
[]
[mineral_conc]
type = PorousFlowAqueousPreDisMineral
initial_concentrations = 0.1
[]
[predis_nodes]
type = PorousFlowAqueousPreDisChemistry
at_nodes = true
num_reactions = 1
primary_concentrations = 1.0 # fixed activity
equilibrium_constants_as_log10 = true
equilibrium_constants = eqm_const
primary_activity_coefficients = 1.0 # fixed activity
reactions = 1
kinetic_rate_constant = 1E-6
molar_volume = 1.0
specific_reactive_surface_area = 1.0
activation_energy = 0.0 # no Arrhenius
[]
[mineral_conc_nodes]
type = PorousFlowAqueousPreDisMineral
at_nodes = true
initial_concentrations = 0.1
[]
[]
[BCs]
[outer_pressure_fixed]
type = DirichletBC
boundary = right
value = 18.3e6
variable = pwater
[]
[outer_saturation_fixed]
type = DirichletBC
boundary = right
value = 0.0
variable = sgas
[]
[outer_temp_fixed]
type = DirichletBC
boundary = right
value = 358
variable = temp
[]
[fixed_outer_r]
type = DirichletBC
variable = disp_r
value = 0
boundary = right
[]
[co2_injection]
type = PorousFlowSink
boundary = left
variable = sgas
use_mobility = false
use_relperm = false
fluid_phase = 1
flux_function = 'min(t/100.0,1)*(-2.294001475)' # 5.0E5 T/year = 15.855 kg/s, over area of 2Pi*0.1*11
[]
[cold_co2]
type = DirichletBC
boundary = left
variable = temp
value = 294
[]
[cavity_pressure_x]
type = Pressure
boundary = left
variable = disp_r
component = 0
postprocessor = p_bh # note, this lags
use_displaced_mesh = false
[]
[]
[Postprocessors]
[p_bh]
type = PointValue
variable = pwater
point = '0.1 0 0'
execute_on = timestep_begin
use_displaced_mesh = false
[]
[mineral_bh] # mineral concentration (m^3(mineral)/m^3(rock)) at the borehole
type = PointValue
variable = mineral_conc_m3_per_m3
point = '0.1 0 0'
use_displaced_mesh = false
[]
[]
[VectorPostprocessors]
[ptsuss]
type = LineValueSampler
use_displaced_mesh = false
start_point = '0.1 0 0'
end_point = '5000 0 0'
sort_by = x
num_points = 50000
outputs = csv
variable = 'pwater temp sgas disp_r stress_rr stress_tt mineral_conc_m3_per_m3 porosity'
[]
[]
[Preconditioning]
active = 'smp'
[smp]
type = SMP
full = true
#petsc_options = '-snes_converged_reason -ksp_diagonal_scale -ksp_diagonal_scale_fix -ksp_gmres_modifiedgramschmidt -snes_linesearch_monitor'
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap -snes_atol -snes_rtol -snes_max_it'
petsc_options_value = 'gmres asm lu NONZERO 2 1E2 1E-5 50'
[]
[mumps]
type = SMP
full = true
petsc_options = '-snes_converged_reason -ksp_diagonal_scale -ksp_diagonal_scale_fix -ksp_gmres_modifiedgramschmidt -snes_linesearch_monitor'
petsc_options_iname = '-ksp_type -pc_type -pc_factor_mat_solver_package -pc_factor_shift_type -snes_rtol -snes_atol -snes_max_it'
petsc_options_value = 'gmres lu mumps NONZERO 1E-5 1E2 50'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 1.5768e8
#dtmax = 1e6
[TimeStepper]
type = IterationAdaptiveDT
dt = 1
growth_factor = 1.1
[]
[]
[Outputs]
print_linear_residuals = false
sync_times = '3600 86400 2.592E6 1.5768E8'
perf_graph = true
exodus = true
[csv]
type = CSV
sync_only = true
[]
[]
(modules/porous_flow/test/tests/chemistry/precipitation_2phase.i)
# Using a two-phase system (see precipitation.i for the single-phase)
# The saturation and porosity are chosen so that the results are identical to precipitation.i
#
# The precipitation reaction
#
# a <==> mineral
#
# produces "mineral". Using mineral_density = fluid_density, theta = 1 = eta, the DE is
#
# a' = -(mineral / (porosity * saturation))' = rate * surf_area * molar_vol (1 - (1 / eqm_const) * (act_coeff * a)^stoi)
#
# The following parameters are used
#
# T_ref = 0.5 K
# T = 1 K
# activation_energy = 3 J/mol
# gas_constant = 6 J/(mol K)
# kinetic_rate_at_ref_T = 0.60653 mol/(m^2 s)
# These give rate = 0.60653 * exp(1/2) = 1 mol/(m^2 s)
#
# surf_area = 0.5 m^2/L
# molar_volume = 2 L/mol
# These give rate * surf_area * molar_vol = 1 s^-1
#
# equilibrium_constant = 0.5 (dimensionless)
# primary_activity_coefficient = 2 (dimensionless)
# stoichiometry = 1 (dimensionless)
# This means that 1 - (1 / eqm_const) * (act_coeff * a)^stoi = 1 - 4 a, which is negative for a > 0.25, ie precipitation for a(t=0) > 0.25
#
# The solution of the DE is
# a = eqm_const / act_coeff + (a(t=0) - eqm_const / act_coeff) exp(-rate * surf_area * molar_vol * act_coeff * t / eqm_const)
# = 0.25 + (a(t=0) - 0.25) exp(-4 * t)
# c = c(t=0) - (a - a(t=0)) * (porosity * saturation)
#
# This test checks that (a + c / (porosity * saturation)) is time-independent, and that a follows the above solution
#
# Aside:
# The exponential curve is not followed exactly because moose actually solves
# (a - a_old)/dt = rate * surf_area * molar_vol (1 - (1 / eqm_const) * (act_coeff * a)^stoi)
# which does not give an exponential exactly, except in the limit dt->0
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Variables]
[a]
initial_condition = 0.9
[]
[]
[AuxVariables]
[eqm_k]
initial_condition = 0.5
[]
[pressure0]
[]
[saturation1]
initial_condition = 0.25
[]
[b]
initial_condition = 0.123
[]
[ini_mineral_conc]
initial_condition = 0.2
[]
[mineral]
family = MONOMIAL
order = CONSTANT
[]
[should_be_static]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mineral]
type = PorousFlowPropertyAux
property = mineral_concentration
mineral_species = 0
variable = mineral
[]
[should_be_static]
type = ParsedAux
coupled_variables = 'mineral a'
expression = 'a + mineral / 0.1'
variable = should_be_static
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Kernels]
[mass_a]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = a
[]
[pre_dis]
type = PorousFlowPreDis
variable = a
mineral_density = 1000
stoichiometry = 1
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = a
number_fluid_phases = 2
number_fluid_components = 2
number_aqueous_kinetic = 1
aqueous_phase_number = 1
[]
[pc]
type = PorousFlowCapillaryPressureConst
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 2e9 # huge, so mimic chemical_reactions
density0 = 1000
thermal_expansion = 0
viscosity = 1e-3
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = 1
[]
[ppss]
type = PorousFlow2PhasePS
capillary_pressure = pc
phase0_porepressure = pressure0
phase1_saturation = saturation1
[]
[mass_frac]
type = PorousFlowMassFraction
mass_fraction_vars = 'b a'
[]
[predis]
type = PorousFlowAqueousPreDisChemistry
primary_concentrations = a
num_reactions = 1
equilibrium_constants = eqm_k
primary_activity_coefficients = 2
reactions = 1
specific_reactive_surface_area = 0.5
kinetic_rate_constant = 0.6065306597126334
activation_energy = 3
molar_volume = 2
gas_constant = 6
reference_temperature = 0.5
[]
[mineral_conc]
type = PorousFlowAqueousPreDisMineral
initial_concentrations = ini_mineral_conc
[]
[simple_fluid0]
type = PorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[simple_fluid1]
type = PorousFlowSingleComponentFluid
fp = simple_fluid
phase = 1
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.4
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
nl_abs_tol = 1E-10
dt = 0.01
end_time = 1
[]
[Postprocessors]
[a]
type = PointValue
point = '0 0 0'
variable = a
[]
[should_be_static]
type = PointValue
point = '0 0 0'
variable = should_be_static
[]
[]
[Outputs]
time_step_interval = 10
csv = true
perf_graph = true
[]
(modules/functional_expansion_tools/examples/3D_volumetric_cylindrical_subapp_mesh_refine/sub.i)
# Derived from the example '3D_volumetric_cylindrical' with the following differences:
#
# 1) The model mesh is refined in the MasterApp by 1
# 2) Mesh adaptivity is enabled for the SubApp
# 3) Output from the SubApp is enabled so that the mesh changes can be visualized
[Mesh]
type = FileMesh
file = cyl-tet.e
[]
[Adaptivity]
marker = errorfrac
steps = 2
[./Indicators]
[./error]
type = GradientJumpIndicator
variable = s
outputs = none
[../]
[../]
[./Markers]
[./errorfrac]
type = ErrorFractionMarker
refine = 0.4
coarsen = 0.1
indicator = error
outputs = none
[../]
[../]
[]
# Non-copy transfers only work with AuxVariable, but nothing will be solved without a variable
# defined. The solution is to define an empty variable tha does nothing, but causes MOOSE to solve
# the AuxKernels that we need.
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
# We must have a kernel for every variable, hence this null kernel to match the variable 'empty'
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s] # Something to make 's' change each time, but allow a converging solution
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = CylindricalDuo
orders = '5 3' # Axial first, then (r, t) FX
physical_bounds = '-2.5 2.5 0 0 1' # z_min z_max x_center y_center radius
z = Legendre # Axial in z
disc = Zernike # (r, t) default to unit disc in x-y plane
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXVolumeUserObject
function = FX_Basis_Value_Sub
variable = s
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
file_base = sub
[]
(modules/geochemistry/test/tests/kernels/time_deriv_2.i)
# A point-source is added to fluid in a material with spatially-varying porosity
# porosity * d(concentration)/dt = 3.0 * delta(x - 1.0)
# where delta is the Dirac delta function (a ConstantPointSource DiracKernel)
# The solution, at x = 1.0 is
# concentration = concentration_old + 3 * dt / porosity
# while concentration is unchanged elsewhere.
# Note that since GeochemistryTimeDerivative is mass-lumped, it produces this solution.
# If mass lumping had not been used, concentration would have decreased at x != 1.0
[Mesh]
type = GeneratedMesh
dim = 1
nx = 2
xmax = 2
[]
[Variables]
[conc]
[]
[]
[Kernels]
[dot]
type = GeochemistryTimeDerivative
porosity = porosity
variable = conc
[]
[]
[DiracKernels]
[source]
type = ConstantPointSource
point = '1.0 0 0'
variable = conc
value = 12.0
[]
[]
[ICs]
[conc]
type = FunctionIC
function = 'x * x'
variable = conc
[]
[]
[AuxVariables]
[porosity]
[]
[expected]
[]
[should_be_zero]
[]
[]
[AuxKernels]
[porosity]
type = FunctionAux
function = '6.0 + x'
variable = porosity
[]
[expected]
type = FunctionAux
function = 'if(x > 0.5 & x < 1.5, x * x + 2.0 * 12.0 / (6.0 + x), x * x)'
variable = expected
[]
[should_be_zero]
type = ParsedAux
coupled_variables = 'expected conc'
expression = 'expected - conc'
variable = should_be_zero
[]
[]
[Postprocessors]
[error]
type = NodalL2Norm
variable = should_be_zero
[]
[]
[Executioner]
type = Transient
solve_type = Newton
dt = 2
end_time = 2
[]
[Outputs]
csv = true
[]
(modules/combined/test/tests/poro_mechanics/mandel.i)
# Mandel's problem of consolodation of a drained medium
#
# A sample is in plane strain.
# -a <= x <= a
# -b <= y <= b
# It is squashed with constant force by impermeable, frictionless plattens on its top and bottom surfaces (at y=+/-b)
# Fluid is allowed to leak out from its sides (at x=+/-a)
# The porepressure within the sample is monitored.
#
# As is common in the literature, this is simulated by
# considering the quarter-sample, 0<=x<=a and 0<=y<=b, with
# impermeable, roller BCs at x=0 and y=0 and y=b.
# Porepressure is fixed at zero on x=a.
# Porepressure and displacement are initialised to zero.
# Then the top (y=b) is moved downwards with prescribed velocity,
# so that the total force that is inducing this downwards velocity
# is fixed. The velocity is worked out by solving Mandel's problem
# analytically, and the total force is monitored in the simulation
# to check that it indeed remains constant.
#
# Here are the problem's parameters, and their values:
# Soil width. a = 1
# Soil height. b = 0.1
# Soil's Lame lambda. la = 0.5
# Soil's Lame mu, which is also the Soil's shear modulus. mu = G = 0.75
# Soil bulk modulus. K = la + 2*mu/3 = 1
# Drained Poisson ratio. nu = (3K - 2G)/(6K + 2G) = 0.2
# Soil bulk compliance. 1/K = 1
# Fluid bulk modulus. Kf = 8
# Fluid bulk compliance. 1/Kf = 0.125
# Soil initial porosity. phi0 = 0.1
# Biot coefficient. alpha = 0.6
# Biot modulus. M = 1/(phi0/Kf + (alpha - phi0)(1 - alpha)/K) = 4.705882
# Undrained bulk modulus. Ku = K + alpha^2*M = 2.694118
# Undrained Poisson ratio. nuu = (3Ku - 2G)/(6Ku + 2G) = 0.372627
# Skempton coefficient. B = alpha*M/Ku = 1.048035
# Fluid mobility (soil permeability/fluid viscosity). k = 1.5
# Consolidation coefficient. c = 2*k*B^2*G*(1-nu)*(1+nuu)^2/9/(1-nuu)/(nuu-nu) = 3.821656
# Normal stress on top. F = 1
#
# The solution for porepressure and displacements is given in
# AHD Cheng and E Detournay "A direct boundary element method for plane strain poroelasticity" International Journal of Numerical and Analytical Methods in Geomechanics 12 (1988) 551-572.
# The solution involves complicated infinite series, so I shall not write it here
[Mesh]
type = GeneratedMesh
dim = 3
nx = 10
ny = 1
nz = 1
xmin = 0
xmax = 1
ymin = 0
ymax = 0.1
zmin = 0
zmax = 1
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
porepressure = porepressure
block = 0
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[./disp_z]
[../]
[./porepressure]
[../]
[]
[BCs]
[./roller_xmin]
type = DirichletBC
variable = disp_x
value = 0
boundary = 'left'
[../]
[./roller_ymin]
type = DirichletBC
variable = disp_y
value = 0
boundary = 'bottom'
[../]
[./plane_strain]
type = DirichletBC
variable = disp_z
value = 0
boundary = 'back front'
[../]
[./xmax_drained]
type = DirichletBC
variable = porepressure
value = 0
boundary = right
[../]
[./top_velocity]
type = FunctionDirichletBC
variable = disp_y
function = top_velocity
boundary = top
[../]
[]
[Functions]
[./top_velocity]
type = PiecewiseLinear
x = '0 0.002 0.006 0.014 0.03 0.046 0.062 0.078 0.094 0.11 0.126 0.142 0.158 0.174 0.19 0.206 0.222 0.238 0.254 0.27 0.286 0.302 0.318 0.334 0.35 0.366 0.382 0.398 0.414 0.43 0.446 0.462 0.478 0.494 0.51 0.526 0.542 0.558 0.574 0.59 0.606 0.622 0.638 0.654 0.67 0.686 0.702'
y = '-0.041824842 -0.042730269 -0.043412712 -0.04428867 -0.045509181 -0.04645965 -0.047268246 -0.047974749 -0.048597109 -0.0491467 -0.049632388 -0.050061697 -0.050441198 -0.050776675 -0.051073238 -0.0513354 -0.051567152 -0.051772022 -0.051953128 -0.052113227 -0.052254754 -0.052379865 -0.052490464 -0.052588233 -0.052674662 -0.052751065 -0.052818606 -0.052878312 -0.052931093 -0.052977751 -0.053018997 -0.053055459 -0.053087691 -0.053116185 -0.053141373 -0.05316364 -0.053183324 -0.053200724 -0.053216106 -0.053229704 -0.053241725 -0.053252351 -0.053261745 -0.053270049 -0.053277389 -0.053283879 -0.053289615'
[../]
[]
[AuxVariables]
[./stress_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./tot_force]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./stress_yy]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_yy
index_i = 1
index_j = 1
[../]
[./tot_force]
type = ParsedAux
coupled_variables = 'stress_yy porepressure'
execute_on = timestep_end
variable = tot_force
expression = '-stress_yy+0.6*porepressure'
[../]
[]
[Kernels]
[./grad_stress_x]
type = StressDivergenceTensors
variable = disp_x
component = 0
[../]
[./grad_stress_y]
type = StressDivergenceTensors
variable = disp_y
component = 1
[../]
[./grad_stress_z]
type = StressDivergenceTensors
variable = disp_z
component = 2
[../]
[./poro_x]
type = PoroMechanicsCoupling
variable = disp_x
component = 0
[../]
[./poro_y]
type = PoroMechanicsCoupling
variable = disp_y
component = 1
[../]
[./poro_z]
type = PoroMechanicsCoupling
variable = disp_z
component = 2
[../]
[./poro_timederiv]
type = PoroFullSatTimeDerivative
variable = porepressure
[../]
[./darcy_flow]
type = CoefDiffusion
variable = porepressure
coef = 1.5
[../]
[]
[Materials]
[./elasticity_tensor]
type = ComputeElasticityTensor
C_ijkl = '0.5 0.75'
# bulk modulus is lambda + 2*mu/3 = 0.5 + 2*0.75/3 = 1
fill_method = symmetric_isotropic
[../]
[./strain]
type = ComputeSmallStrain
displacements = 'disp_x disp_y disp_z'
[../]
[./stress]
type = ComputeLinearElasticStress
[../]
[./poro_material]
type = PoroFullSatMaterial
porosity0 = 0.1
biot_coefficient = 0.6
solid_bulk_compliance = 1
fluid_bulk_compliance = 0.125
constant_porosity = true
[../]
[]
[Postprocessors]
[./p0]
type = PointValue
outputs = csv
point = '0.0 0 0'
variable = porepressure
[../]
[./p1]
type = PointValue
outputs = csv
point = '0.1 0 0'
variable = porepressure
[../]
[./p2]
type = PointValue
outputs = csv
point = '0.2 0 0'
variable = porepressure
[../]
[./p3]
type = PointValue
outputs = csv
point = '0.3 0 0'
variable = porepressure
[../]
[./p4]
type = PointValue
outputs = csv
point = '0.4 0 0'
variable = porepressure
[../]
[./p5]
type = PointValue
outputs = csv
point = '0.5 0 0'
variable = porepressure
[../]
[./p6]
type = PointValue
outputs = csv
point = '0.6 0 0'
variable = porepressure
[../]
[./p7]
type = PointValue
outputs = csv
point = '0.7 0 0'
variable = porepressure
[../]
[./p8]
type = PointValue
outputs = csv
point = '0.8 0 0'
variable = porepressure
[../]
[./p9]
type = PointValue
outputs = csv
point = '0.9 0 0'
variable = porepressure
[../]
[./p99]
type = PointValue
outputs = csv
point = '1 0 0'
variable = porepressure
[../]
[./xdisp]
type = PointValue
outputs = csv
point = '1 0.1 0'
variable = disp_x
[../]
[./ydisp]
type = PointValue
outputs = csv
point = '1 0.1 0'
variable = disp_y
[../]
[./total_downwards_force]
type = ElementAverageValue
outputs = csv
variable = tot_force
[../]
[./dt]
type = FunctionValuePostprocessor
outputs = console
function = if(0.15*t<0.01,0.15*t,0.01)
[../]
[]
[Preconditioning]
[./andy]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -snes_atol -snes_rtol -snes_max_it'
petsc_options_value = 'bcgs bjacobi 1E-14 1E-10 10000'
[../]
[]
[Executioner]
type = Transient
solve_type = Newton
start_time = 0
end_time = 0.7
[./TimeStepper]
type = PostprocessorDT
postprocessor = dt
dt = 0.001
[../]
[]
[Outputs]
execute_on = 'timestep_end'
file_base = mandel
[./csv]
time_step_interval = 3
type = CSV
[../]
[]
(test/tests/quadrature/qweights/positive_qweights.i)
[Mesh]
[./square]
type = FileMeshGenerator
file = cube.e
[../]
[]
[Variables]
[u][]
[]
[Kernels]
[diff]
type = Diffusion
variable = u
[]
[heat_source_fuel]
type = CoupledForce
variable = u
v = power_density
[]
[]
[BCs]
[robin]
type = RobinBC
variable = u
boundary = '1 2 3 4 5 6'
[]
[]
[AuxVariables]
[power_density]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[source]
type = ParsedAux
variable = power_density
use_xyzt = true
expression = 'if(x>0.1,100,1)'
[]
[]
[Executioner]
type = Steady
[./Quadrature]
allow_negative_qweights = false
[../]
solve_type = 'NEWTON'
petsc_options_iname = "-pc_type"
petsc_options_value = "hypre"
[]
[Outputs]
exodus = true
[]
(test/tests/functions/piecewise_multilinear/twoD_const.i)
# PiecewiseMultilinear function tests in 2D
# See [Functions] block for a description of the tests
# The functions are compared with ParsedFunctions using postprocessors
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 2
nx = 4
ymin = -1
ymax = 1
ny = 4
[]
[Variables]
[./dummy]
[../]
[]
[Kernels]
[./dummy_u]
type = TimeDerivative
variable = dummy
[../]
[]
[AuxVariables]
[./constant]
family = MONOMIAL
order = CONSTANT
[../]
[./constant_ref]
family = MONOMIAL
order = CONSTANT
[../]
[./diff]
family = MONOMIAL
order = CONSTANT
[../]
[]
[AuxKernels]
[./const_AuxK]
type = FunctionAux
variable = constant
function = const_fcn
[../]
[./const_ref_AuxK]
type = FunctionAux
variable = constant_ref
function = const_ref
[../]
[./diff]
type = ParsedAux
variable = diff
expression = 'constant - constant_ref'
coupled_variables = 'constant constant_ref'
[../]
[]
[Functions]
[./const_fcn]
type = PiecewiseMulticonstant
direction = 'left right'
data_file = twoD_const.txt
[../]
[./const_ref]
type = ParsedFunction
expression = '
ix := if(x < 0.5, 0, if(x < 1, 1, 2));
iy := if(y > 0, 2, if(y > -0.5, 1, 0));
iy * 3 + ix
'
[../]
[]
[Postprocessors]
[./diff_pp]
type = ElementIntegralVariablePostprocessor
variable = diff
[../]
[]
[Executioner]
type = Transient
dt = 1
end_time = 1
[]
[Outputs]
execute_on = 'timestep_end'
file_base = twoD_const
hide = dummy
exodus = true
[]
(test/tests/transfers/multiapp_nearest_node_transfer/cached_multiple_apps/main.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 3
dx = 2
dy = 2
dz = 2
ix = 1
iy = 5
iz = 5
[]
[translate]
type = TransformGenerator
input = cmg
transform = TRANSLATE
vector_value = '-1 -1 -1'
[]
[]
[Variables]
[dummy]
[]
[]
[AuxVariables]
[Temperature]
[]
[Layered_Average]
[]
[Layered_Average_elem]
family = MONOMIAL
order = CONSTANT
[]
[Subapp_Temp]
[]
[Subapp_Temp_elem]
family = MONOMIAL
order = CONSTANT
[]
[]
[Kernels]
[extra]
type = ADDiffusion
variable = dummy
[]
[]
[AuxKernels]
[Location_Based]
type = ParsedAux
variable = Temperature
expression = 'x+y+z'
use_xyzt = true
[]
[Layered_Average_User_Object]
type = SpatialUserObjectAux
variable = Layered_Average
user_object = Tfuel_UO
[]
[Layered_Average_User_Object_elem]
type = SpatialUserObjectAux
variable = Layered_Average_elem
user_object = Tfuel_UO
[]
[]
[UserObjects]
[Tfuel_UO]
type = NearestPointLayeredAverage
variable = Temperature
direction = x
num_layers = 1
points_file = 'locations.txt'
execute_on = 'initial timestep_end'
[]
[]
[MultiApps]
[TF_sub]
type = FullSolveMultiApp
positions_file = 'locations.txt'
input_files = 'child.i'
execute_on = 'TIMESTEP_END'
[]
[]
[GlobalParams]
bbox_factor = 2
[]
[Transfers]
[to_sub_layers]
type = MultiAppNearestNodeTransfer
to_multi_app = TF_sub
source_variable = Layered_Average
variable = Temperature
fixed_meshes = True
[]
[to_sub_layers_elem]
type = MultiAppNearestNodeTransfer
to_multi_app = TF_sub
source_variable = Layered_Average_elem
variable = Temperature_elem
[]
[from_sub_recover_layers]
type = MultiAppNearestNodeTransfer
from_multi_app = TF_sub
source_variable = Temperature
variable = Subapp_Temp
[]
[from_sub_recover_layers_elem]
type = MultiAppNearestNodeTransfer
from_multi_app = TF_sub
source_variable = Temperature_elem
variable = Subapp_Temp_elem
[]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
# First step does not use Transfers caching
# Second step does
num_steps = 2
[]
[Outputs]
[out]
type = Exodus
hide = 'dummy Temperature Layered_Average Layered_Average_elem'
[]
[]
(modules/solid_mechanics/examples/wave_propagation/cantilever_sweep.i)
# Frequency Response function for cantilever beam:
# Analytic results: 509Hz and 763Hz
# Simulation results with coarse mesh: 600Hz and 800Hz
[Mesh]
type = GeneratedMesh
elem_type = HEX8
dim = 3
xmin=0
xmax=1
nx=10
ymin=0
ymax=0.1
ny = 1
zmin=0
zmax=0.15
nz = 2
[]
[GlobalParams]
order = FIRST
family = LAGRANGE
displacements = 'disp_x disp_y disp_z'
[]
[Problem]
type = ReferenceResidualProblem
reference_vector = 'ref'
extra_tag_vectors = 'ref'
group_variables = 'disp_x disp_y disp_z'
[]
[Physics]
[SolidMechanics]
[QuasiStatic]
[all]
strain = SMALL
add_variables = true
new_system = true
formulation = TOTAL
[]
[]
[]
[]
[Kernels]
#reaction terms
[reaction_realx]
type = Reaction
variable = disp_x
rate = 0# filled by controller
extra_vector_tags = 'ref'
[]
[reaction_realy]
type = Reaction
variable = disp_y
rate = 0# filled by controller
extra_vector_tags = 'ref'
[]
[reaction_realz]
type = Reaction
variable = disp_z
rate = 0# filled by controller
extra_vector_tags = 'ref'
[]
[]
[AuxVariables]
[disp_mag]
[]
[]
[AuxKernels]
[disp_mag]
type = ParsedAux
variable = disp_mag
coupled_variables = 'disp_x disp_y disp_z'
expression = 'sqrt(disp_x^2+disp_y^2+disp_z^2)'
[]
[]
[BCs]
#Left
[disp_x_left]
type = DirichletBC
variable = disp_x
boundary = 'left'
value = 0.0
[]
[disp_y_left]
type = DirichletBC
variable = disp_y
boundary = 'left'
value = 0.0
[]
[disp_z_left]
type = DirichletBC
variable = disp_z
boundary = 'left'
value = 0.0
[]
#Right
[BC_right_yreal]
type = NeumannBC
variable = disp_y
boundary = 'right'
value = 1000
[]
[BC_right_zreal]
type = NeumannBC
variable = disp_z
boundary = 'right'
value = 1000
[]
[]
[Materials]
[elastic_tensor_Al]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 68e9
poissons_ratio = 0.36
[]
[compute_stress]
type = ComputeLagrangianLinearElasticStress
[]
[]
[Postprocessors]
[dispMag]
type = NodalExtremeValue
value_type = max
variable = disp_mag
[]
[]
[Functions]
[./freq2]
type = ParsedFunction
symbol_names = density
symbol_values = 2.7e3 #Al kg/m3
expression = '-t*t*density'
[../]
[]
[Controls]
[./func_control]
type = RealFunctionControl
parameter = 'Kernels/*/rate'
function = 'freq2'
execute_on = 'initial timestep_begin'
[../]
[]
[Executioner]
type = Transient
solve_type=LINEAR
petsc_options_iname = ' -pc_type'
petsc_options_value = 'lu'
start_time = 300 #starting frequency
end_time = 1200 #ending frequency
nl_abs_tol = 1e-6
[TimeStepper]
type = ConstantDT
dt = 50 #frequency stepsize
[]
[]
[Outputs]
csv=true
exodus=false
console = false
[]
(test/tests/transfers/multiapp_variable_value_sample_transfer/full_domain_primary.i)
[Mesh]
type = MeshGeneratorMesh
[cartesian_basic_mesh]
type = CartesianMeshGenerator
dim = 2
dx = '0.25 0.25 0.25 0.25'
ix = '1 1 1 1 '
dy = '0.25 0.25 0.25 0.25'
iy = '1 1 1 1'
subdomain_id = '1 2 2 2
1 1 2 2
1 1 2 2
1 1 1 2'
[]
[central_node]
type = ExtraNodesetGenerator
coord = '0.5 0.5'
input = cartesian_basic_mesh
new_boundary = 'central_node'
[]
[]
[Variables]
[to_subapp]
initial_condition = -1.0
[]
[]
[AuxKernels]
[discretize_to_subapp]
type = ParsedAux
variable = from_subapp_check
expression = 'to_subapp'
coupled_variables = 'to_subapp'
[]
[subapp_primary_diff]
type = ParsedAux
variable = subapp_primary_diff
expression = 'from_subapp_check - from_subapp'
coupled_variables = 'from_subapp_check from_subapp'
[]
[]
[AuxVariables]
[from_subapp]
family = MONOMIAL
order = CONSTANT
initial_condition = -2.0
[]
[from_subapp_check]
family = MONOMIAL
order = CONSTANT
initial_condition = -2.0
[]
[subapp_primary_diff]
family = MONOMIAL
order = CONSTANT
initial_condition = -2.0
[]
[array_var]
family = MONOMIAL
order = CONSTANT
components = 3
initial_condition = '-2 -1 0'
[]
[]
[Kernels]
[diff]
type = Diffusion
variable = to_subapp
[]
[]
[BCs]
[edge]
type = DirichletBC
variable = to_subapp
boundary = 'top right left bottom'
value = 1
[]
[center]
type = DirichletBC
variable = to_subapp
boundary = 'central_node'
value = 0
[]
[]
[Executioner]
type = Transient
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
num_steps = 3
dt = 1.0
nl_abs_tol = 1e-13
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
[]
[MultiApps]
[sub]
type = CentroidMultiApp
input_files = subapp.i
[]
[]
[Transfers]
[from_primary_to_sub_pp]
type = MultiAppVariableValueSamplePostprocessorTransfer
to_multi_app = sub
source_variable = to_subapp
postprocessor = from_primary_pp
[]
[primary_average]
type = MultiAppVariableValueSamplePostprocessorTransfer
from_multi_app = sub
source_variable = from_subapp
postprocessor = to_primary_pp
[]
[array_var]
type = MultiAppVariableValueSamplePostprocessorTransfer
from_multi_app = sub
source_variable = array_var
source_variable_component = 2
postprocessor = to_primary_pp
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/natural_convection/fuel_cavity.i)
# ========================================================================
# The purpose of this MOOSE scripts is to solve a 2-D axisymmetric
# problem with the following details:
# ------------------------------------------------------------------
# Physics: natural convection through a fluid and heat conduction
# in a solid and there is convective heat transfer from the
# solid to the liquid.
# ------------------------------------------------------------------
# Materials: the fluid is water and the solid is not specified.
# ------------------------------------------------------------------
# BCS: Inlet and outlet pressure with value of 0
# noslip conditions on the walls.
# Heat flux on the left wall with value of 40000 W/m^2
# ========================================================================
# ========================================================================
# Dimensions & Physical properties
# ========================================================================
Domain_length = 121.92e-2 # m
Solid_width = 0.7112e-3 # m
Liquid_width = 0.56261e-2 # m
mu = 0.00053157
rho = 987.27
k = 0.64247
k_solid = 15.0
cp = 4181.8
alpha_b = 210e-6
T_init = 300.0
input_heat_flux = 40000.0
# ========================================================================
# The main body of the script
# ========================================================================
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 2
#dx = '0.7032625e-4 0.7112e-5'
dx = '${Liquid_width} ${Solid_width}'
ix = '10 3'
dy = '${fparse 1./5.*Domain_length} ${fparse 4./5.*Domain_length}'
iy = '30 10'
subdomain_id = '0 1
0 1'
[]
[interface]
type = SideSetsBetweenSubdomainsGenerator
input = 'cmg'
primary_block = 0
paired_block = 1
new_boundary = 'interface'
[]
[fluid_side]
type = BreakBoundaryOnSubdomainGenerator
input = 'interface'
boundaries = 'top bottom'
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
block = 0
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
block = 0
initial_condition = 1e-6
[]
[vel_y]
type = INSFVVelocityVariable
block = 0
initial_condition = 1e-6
[]
[pressure]
type = INSFVPressureVariable
block = 0
[]
[T]
type = INSFVEnergyVariable
block = 0
initial_condition = ${T_init}
scaling = 1e-5
[]
[Ts]
type = INSFVEnergyVariable
block = 1
initial_condition = ${T_init}
scaling = 1e-3
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = ${rho}
[]
[u_time]
type = INSFVMomentumTimeDerivative
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[u_buoyancy]
type = INSFVMomentumBoussinesq
variable = vel_x
T_fluid = T
gravity = '0 -9.81 0'
rho = ${rho}
ref_temperature = ${T_init}
momentum_component = 'x'
#alpha_name = ${alpha_b}
[]
[v_time]
type = INSFVMomentumTimeDerivative
variable = vel_y
rho = ${rho}
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = ${rho}
momentum_component = 'y'
#alpha_name = ${alpha_b}
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[v_buoyancy]
type = INSFVMomentumBoussinesq
variable = vel_y
T_fluid = T
gravity = '0 -9.81 0'
rho = ${rho}
ref_temperature = ${T_init}
momentum_component = 'y'
[]
[temp_time]
type = INSFVEnergyTimeDerivative
variable = T
rho = '${rho}'
dh_dt = dh_dt
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T
[]
[Ts_time]
type = INSFVEnergyTimeDerivative
variable = Ts
rho = '${rho}'
dh_dt = dh_solid_dt
[]
[solid_temp_conduction]
type = FVDiffusion
coeff = 'k_solid'
variable = Ts
[]
[]
[FVInterfaceKernels]
[convection]
type = FVConvectionCorrelationInterface
variable1 = T
variable2 = Ts
boundary = 'interface'
h = htc
T_solid = Ts
T_fluid = T
subdomain1 = 0
subdomain2 = 1
wall_cell_is_bulk = true
[]
[]
[FVBCs]
[walls_u]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'interface left bottom_to_0'
function = 0
[]
[walls_v]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'interface left bottom_to_0'
function = 0
[]
[outlet]
type = INSFVOutletPressureBC
variable = pressure
boundary = 'top_to_0'
function = 0.0
[]
[outlet_T]
type = NSFVOutflowTemperatureBC
variable = T
boundary = 'top_to_0'
u = vel_x
v = vel_y
rho = ${rho}
cp = '${cp}'
backflow_T = ${T_init}
[]
[Insulator]
type = FVNeumannBC
variable = 'T'
boundary = 'left'
value = 0.0
[]
[heater]
type = FVNeumannBC
variable = 'Ts'
boundary = 'right'
value = '${fparse input_heat_flux}'
[]
[Insulator_solid]
type = FVNeumannBC
variable = 'Ts'
boundary = 'top_to_1'
value = 0.0
[]
[inlet_T_1]
type = FVDirichletBC
variable = Ts
boundary = 'bottom_to_1'
value = ${T_init}
[]
[]
[AuxVariables]
[Ra]
type = INSFVScalarFieldVariable
initial_condition = 1000.0
[]
[htc]
type = INSFVScalarFieldVariable
initial_condition = 0.0
[]
[]
[AuxKernels]
[compute_Ra]
type = ParsedAux
variable = Ra
coupled_variables = 'T'
constant_names = 'g beta T_init width nu alpha'
constant_expressions = '9.81 ${alpha_b} ${T_init} ${Liquid_width} ${fparse mu/rho} ${fparse k/(rho*cp)}'
expression = 'g * beta * (T - T_init) * pow(width, 3) / (nu*alpha) + 1.0'
block = 0
[]
[htc]
type = ParsedAux
variable = htc
coupled_variables = 'Ra'
constant_names = 'Pr'
constant_expressions = '${fparse cp*mu/k}'
expression = '${k}* (0.68 + 0.67 * pow(Ra, 0.25)/pow(1 + pow(0.437/Pr, 9/16) ,4/9) )/ ${Liquid_width} '
block = 0
[]
[]
[FunctorMaterials]
[functor_constants]
type = ADGenericFunctorMaterial
prop_names = 'cp k k_solid'
prop_values = '${cp} ${k} ${k_solid}'
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T'
rho = ${rho}
block = 0
[]
[ins_fv_solid]
type = INSFVEnthalpyFunctorMaterial
temperature = 'Ts'
rho = ${rho}
cp = ${cp}
h = h_solid
rho_h = rho_h_solid
block = 1
[]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'alpha_b'
prop_values = '${alpha_b}'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -sub_pc_factor_shift_type -ksp_gmres_restart'
petsc_options_value = ' lu NONZERO 200'
line_search = 'none'
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.01
optimal_iterations = 20
iteration_window = 2
[]
nl_max_its = 30
nl_abs_tol = 1e-10
steady_state_detection = true
steady_state_tolerance = 1e-09
[]
[Postprocessors]
[max_T]
type = ADElementExtremeFunctorValue
functor = T
block = 0
[]
[max_Ts]
type = ADElementExtremeFunctorValue
functor = Ts
block = 1
[]
[]
[Outputs]
exodus = false
csv = true
[]
(modules/porous_flow/test/tests/chemistry/dissolution.i)
# The dissolution reaction
#
# a <==> mineral
#
# produces "mineral". Using mineral_density = fluid_density, theta = 1 = eta, the DE is
#
# a' = -(mineral / porosity)' = rate * surf_area * molar_vol (1 - (1 / eqm_const) * (act_coeff * a)^stoi)
#
# The following parameters are used
#
# T_ref = 0.5 K
# T = 1 K
# activation_energy = 3 J/mol
# gas_constant = 6 J/(mol K)
# kinetic_rate_at_ref_T = 0.60653 mol/(m^2 s)
# These give rate = 0.60653 * exp(1/2) = 1 mol/(m^2 s)
#
# surf_area = 0.5 m^2/L
# molar_volume = 2 L/mol
# These give rate * surf_area * molar_vol = 1 s^-1
#
# equilibrium_constant = 0.5 (dimensionless)
# primary_activity_coefficient = 2 (dimensionless)
# stoichiometry = 1 (dimensionless)
# This means that 1 - (1 / eqm_const) * (act_coeff * a)^stoi = 1 - 4 a, which is positive for a < 0.25, ie dissolution for a(t=0) < 0.25
#
# The solution of the DE is
# a = eqm_const / act_coeff + (a(t=0) - eqm_const / act_coeff) exp(-rate * surf_area * molar_vol * act_coeff * t / eqm_const)
# = 0.25 + (a(t=0) - 0.25) exp(-4 * t)
# c = c(t=0) - (a - a(t=0)) * porosity
#
# This test checks that (a + c / porosity) is time-independent, and that a follows the above solution
#
# Aside:
# The exponential curve is not followed exactly because moose actually solves
# (a - a_old)/dt = rate * surf_area * molar_vol (1 - (1 / eqm_const) * (act_coeff * a)^stoi)
# which does not give an exponential exactly, except in the limit dt->0
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Variables]
[a]
initial_condition = 0.05
[]
[]
[AuxVariables]
[eqm_k]
initial_condition = 0.5
[]
[pressure]
[]
[ini_mineral_conc]
initial_condition = 0.3
[]
[mineral]
family = MONOMIAL
order = CONSTANT
[]
[should_be_static]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mineral]
type = PorousFlowPropertyAux
property = mineral_concentration
mineral_species = 0
variable = mineral
[]
[should_be_static]
type = ParsedAux
coupled_variables = 'mineral a'
expression = 'a + mineral / 0.1'
variable = should_be_static
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Kernels]
[mass_a]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = a
[]
[pre_dis]
type = PorousFlowPreDis
variable = a
mineral_density = 1000
stoichiometry = 1
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = a
number_fluid_phases = 1
number_fluid_components = 2
number_aqueous_kinetic = 1
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 2e9 # huge, so mimic chemical_reactions
density0 = 1000
thermal_expansion = 0
viscosity = 1e-3
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = 1
[]
[ppss]
type = PorousFlow1PhaseFullySaturated
porepressure = pressure
[]
[mass_frac]
type = PorousFlowMassFraction
mass_fraction_vars = a
[]
[predis]
type = PorousFlowAqueousPreDisChemistry
primary_concentrations = a
num_reactions = 1
equilibrium_constants = eqm_k
primary_activity_coefficients = 2
reactions = 1
specific_reactive_surface_area = 0.5
kinetic_rate_constant = 0.6065306597126334
activation_energy = 3
molar_volume = 2
gas_constant = 6
reference_temperature = 0.5
[]
[mineral_conc]
type = PorousFlowAqueousPreDisMineral
initial_concentrations = ini_mineral_conc
[]
[simple_fluid]
type = PorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.1
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
nl_abs_tol = 1E-10
dt = 0.01
end_time = 1
[]
[Postprocessors]
[a]
type = PointValue
point = '0 0 0'
variable = a
[]
[should_be_static]
type = PointValue
point = '0 0 0'
variable = should_be_static
[]
[]
[Outputs]
time_step_interval = 10
csv = true
perf_graph = true
[]
(test/tests/outputs/png/wedge.i)
[Mesh]
file = wedge.e
uniform_refine = 1
[]
[Functions]
active = 'tr_x tr_y'
[./tr_x]
type = ParsedFunction
expression = -x
[../]
[./tr_y]
type = ParsedFunction
expression = y
[../]
[]
[AuxVariables]
[two_u]
[]
[]
[AuxKernels]
[two_u]
type = ParsedAux
variable = two_u
coupled_variables = 'u'
expression = '2*u'
[]
[]
[Variables]
active = 'u'
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
active = 'diff forcing dot'
[./diff]
type = Diffusion
variable = u
[../]
[./forcing]
type = GaussContForcing
variable = u
x_center = -0.5
y_center = 3.0
x_spread = 0.2
y_spread = 0.2
[../]
[./dot]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
#active = ' '
[./Periodic]
[./x]
primary = 1
secondary = 2
transform_func = 'tr_x tr_y'
inv_transform_func = 'tr_x tr_y'
[../]
[../]
[]
[Executioner]
type = Transient
dt = 0.5
num_steps = 6
solve_type = NEWTON
[]
[Outputs]
[png]
type = PNGOutput
resolution = 25
color = RWB
variable = 'two_u'
[]
[]
(modules/porous_flow/examples/tutorial/11.i)
# Two-phase borehole injection problem
[Mesh]
[annular]
type = AnnularMeshGenerator
nr = 10
rmin = 1.0
rmax = 10
growth_r = 1.4
nt = 4
dmin = 0
dmax = 90
[]
[make3D]
input = annular
type = MeshExtruderGenerator
extrusion_vector = '0 0 12'
num_layers = 3
bottom_sideset = 'bottom'
top_sideset = 'top'
[]
[shift_down]
type = TransformGenerator
transform = TRANSLATE
vector_value = '0 0 -6'
input = make3D
[]
[aquifer]
type = SubdomainBoundingBoxGenerator
block_id = 1
bottom_left = '0 0 -2'
top_right = '10 10 2'
input = shift_down
[]
[injection_area]
type = ParsedGenerateSideset
combinatorial_geometry = 'x*x+y*y<1.01'
included_subdomains = 1
new_sideset_name = 'injection_area'
input = 'aquifer'
[]
[rename]
type = RenameBlockGenerator
old_block = '0 1'
new_block = 'caps aquifer'
input = 'injection_area'
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pwater pgas T disp_x disp_y'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureVG
alpha = 1E-6
m = 0.6
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
gravity = '0 0 0'
biot_coefficient = 1.0
PorousFlowDictator = dictator
[]
[Variables]
[pwater]
initial_condition = 20E6
[]
[pgas]
initial_condition = 20.1E6
[]
[T]
initial_condition = 330
scaling = 1E-5
[]
[disp_x]
scaling = 1E-5
[]
[disp_y]
scaling = 1E-5
[]
[]
[Kernels]
[mass_water_dot]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = pwater
[]
[flux_water]
type = PorousFlowAdvectiveFlux
fluid_component = 0
use_displaced_mesh = false
variable = pwater
[]
[vol_strain_rate_water]
type = PorousFlowMassVolumetricExpansion
fluid_component = 0
variable = pwater
[]
[mass_co2_dot]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = pgas
[]
[flux_co2]
type = PorousFlowAdvectiveFlux
fluid_component = 1
use_displaced_mesh = false
variable = pgas
[]
[vol_strain_rate_co2]
type = PorousFlowMassVolumetricExpansion
fluid_component = 1
variable = pgas
[]
[energy_dot]
type = PorousFlowEnergyTimeDerivative
variable = T
[]
[advection]
type = PorousFlowHeatAdvection
use_displaced_mesh = false
variable = T
[]
[conduction]
type = PorousFlowHeatConduction
use_displaced_mesh = false
variable = T
[]
[vol_strain_rate_heat]
type = PorousFlowHeatVolumetricExpansion
variable = T
[]
[grad_stress_x]
type = StressDivergenceTensors
temperature = T
variable = disp_x
eigenstrain_names = thermal_contribution
use_displaced_mesh = false
component = 0
[]
[poro_x]
type = PorousFlowEffectiveStressCoupling
variable = disp_x
use_displaced_mesh = false
component = 0
[]
[grad_stress_y]
type = StressDivergenceTensors
temperature = T
variable = disp_y
eigenstrain_names = thermal_contribution
use_displaced_mesh = false
component = 1
[]
[poro_y]
type = PorousFlowEffectiveStressCoupling
variable = disp_y
use_displaced_mesh = false
component = 1
[]
[]
[AuxVariables]
[disp_z]
[]
[effective_fluid_pressure]
family = MONOMIAL
order = CONSTANT
[]
[mass_frac_phase0_species0]
initial_condition = 1 # all water in phase=0
[]
[mass_frac_phase1_species0]
initial_condition = 0 # no water in phase=1
[]
[sgas]
family = MONOMIAL
order = CONSTANT
[]
[swater]
family = MONOMIAL
order = CONSTANT
[]
[stress_rr]
family = MONOMIAL
order = CONSTANT
[]
[stress_tt]
family = MONOMIAL
order = CONSTANT
[]
[stress_zz]
family = MONOMIAL
order = CONSTANT
[]
[porosity]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[effective_fluid_pressure]
type = ParsedAux
coupled_variables = 'pwater pgas swater sgas'
expression = 'pwater * swater + pgas * sgas'
variable = effective_fluid_pressure
[]
[swater]
type = PorousFlowPropertyAux
variable = swater
property = saturation
phase = 0
execute_on = timestep_end
[]
[sgas]
type = PorousFlowPropertyAux
variable = sgas
property = saturation
phase = 1
execute_on = timestep_end
[]
[stress_rr]
type = RankTwoScalarAux
variable = stress_rr
rank_two_tensor = stress
scalar_type = RadialStress
point1 = '0 0 0'
point2 = '0 0 1'
execute_on = timestep_end
[]
[stress_tt]
type = RankTwoScalarAux
variable = stress_tt
rank_two_tensor = stress
scalar_type = HoopStress
point1 = '0 0 0'
point2 = '0 0 1'
execute_on = timestep_end
[]
[stress_zz]
type = RankTwoAux
variable = stress_zz
rank_two_tensor = stress
index_i = 2
index_j = 2
execute_on = timestep_end
[]
[porosity]
type = PorousFlowPropertyAux
variable = porosity
property = porosity
execute_on = timestep_end
[]
[]
[BCs]
[roller_tmax]
type = DirichletBC
variable = disp_x
value = 0
boundary = dmax
[]
[roller_tmin]
type = DirichletBC
variable = disp_y
value = 0
boundary = dmin
[]
[pinned_top_bottom_x]
type = DirichletBC
variable = disp_x
value = 0
boundary = 'top bottom'
[]
[pinned_top_bottom_y]
type = DirichletBC
variable = disp_y
value = 0
boundary = 'top bottom'
[]
[cavity_pressure_x]
type = Pressure
boundary = injection_area
variable = disp_x
component = 0
postprocessor = constrained_effective_fluid_pressure_at_wellbore
use_displaced_mesh = false
[]
[cavity_pressure_y]
type = Pressure
boundary = injection_area
variable = disp_y
component = 1
postprocessor = constrained_effective_fluid_pressure_at_wellbore
use_displaced_mesh = false
[]
[cold_co2]
type = DirichletBC
boundary = injection_area
variable = T
value = 290 # injection temperature
use_displaced_mesh = false
[]
[constant_co2_injection]
type = PorousFlowSink
boundary = injection_area
variable = pgas
fluid_phase = 1
flux_function = -1E-4
use_displaced_mesh = false
[]
[outer_water_removal]
type = PorousFlowPiecewiseLinearSink
boundary = rmax
variable = pwater
fluid_phase = 0
pt_vals = '0 1E9'
multipliers = '0 1E8'
PT_shift = 20E6
use_mobility = true
use_relperm = true
use_displaced_mesh = false
[]
[outer_co2_removal]
type = PorousFlowPiecewiseLinearSink
boundary = rmax
variable = pgas
fluid_phase = 1
pt_vals = '0 1E9'
multipliers = '0 1E8'
PT_shift = 20.1E6
use_mobility = true
use_relperm = true
use_displaced_mesh = false
[]
[]
[FluidProperties]
[true_water]
type = Water97FluidProperties
[]
[tabulated_water]
type = TabulatedFluidProperties
fp = true_water
temperature_min = 275
pressure_max = 1E8
interpolated_properties = 'density viscosity enthalpy internal_energy'
fluid_property_file = water97_tabulated_11.csv
[]
[true_co2]
type = CO2FluidProperties
[]
[tabulated_co2]
type = TabulatedFluidProperties
fp = true_co2
temperature_min = 275
pressure_max = 1E8
interpolated_properties = 'density viscosity enthalpy internal_energy'
fluid_property_file = co2_tabulated_11.csv
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = T
[]
[saturation_calculator]
type = PorousFlow2PhasePP
phase0_porepressure = pwater
phase1_porepressure = pgas
capillary_pressure = pc
[]
[massfrac]
type = PorousFlowMassFraction
mass_fraction_vars = 'mass_frac_phase0_species0 mass_frac_phase1_species0'
[]
[water]
type = PorousFlowSingleComponentFluid
fp = tabulated_water
phase = 0
[]
[co2]
type = PorousFlowSingleComponentFluid
fp = tabulated_co2
phase = 1
[]
[relperm_water]
type = PorousFlowRelativePermeabilityCorey
n = 4
s_res = 0.1
sum_s_res = 0.2
phase = 0
[]
[relperm_co2]
type = PorousFlowRelativePermeabilityBC
nw_phase = true
lambda = 2
s_res = 0.1
sum_s_res = 0.2
phase = 1
[]
[porosity_mat]
type = PorousFlowPorosity
fluid = true
mechanical = true
thermal = true
porosity_zero = 0.1
reference_temperature = 330
reference_porepressure = 20E6
thermal_expansion_coeff = 15E-6 # volumetric
solid_bulk = 8E9 # unimportant since biot = 1
[]
[permeability_aquifer]
type = PorousFlowPermeabilityKozenyCarman
block = aquifer
poroperm_function = kozeny_carman_phi0
phi0 = 0.1
n = 2
m = 2
k0 = 1E-12
[]
[permeability_caps]
type = PorousFlowPermeabilityKozenyCarman
block = caps
poroperm_function = kozeny_carman_phi0
phi0 = 0.1
n = 2
m = 2
k0 = 1E-15
k_anisotropy = '1 0 0 0 1 0 0 0 0.1'
[]
[rock_thermal_conductivity]
type = PorousFlowThermalConductivityIdeal
dry_thermal_conductivity = '2 0 0 0 2 0 0 0 2'
[]
[rock_internal_energy]
type = PorousFlowMatrixInternalEnergy
specific_heat_capacity = 1100
density = 2300
[]
[elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 5E9
poissons_ratio = 0.0
[]
[strain]
type = ComputeSmallStrain
eigenstrain_names = 'thermal_contribution initial_stress'
[]
[thermal_contribution]
type = ComputeThermalExpansionEigenstrain
temperature = T
thermal_expansion_coeff = 5E-6 # this is the linear thermal expansion coefficient
eigenstrain_name = thermal_contribution
stress_free_temperature = 330
[]
[initial_strain]
type = ComputeEigenstrainFromInitialStress
initial_stress = '20E6 0 0 0 20E6 0 0 0 20E6'
eigenstrain_name = initial_stress
[]
[stress]
type = ComputeLinearElasticStress
[]
[effective_fluid_pressure_mat]
type = PorousFlowEffectiveFluidPressure
[]
[volumetric_strain]
type = PorousFlowVolumetricStrain
[]
[]
[Postprocessors]
[effective_fluid_pressure_at_wellbore]
type = PointValue
variable = effective_fluid_pressure
point = '1 0 0'
execute_on = timestep_begin
use_displaced_mesh = false
[]
[constrained_effective_fluid_pressure_at_wellbore]
type = FunctionValuePostprocessor
function = constrain_effective_fluid_pressure
execute_on = timestep_begin
[]
[]
[Functions]
[constrain_effective_fluid_pressure]
type = ParsedFunction
symbol_names = effective_fluid_pressure_at_wellbore
symbol_values = effective_fluid_pressure_at_wellbore
expression = 'max(effective_fluid_pressure_at_wellbore, 20E6)'
[]
[]
[Preconditioning]
active = basic
[basic]
type = SMP
full = true
petsc_options = '-ksp_diagonal_scale -ksp_diagonal_scale_fix'
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
petsc_options_value = ' asm lu NONZERO 2'
[]
[preferred_but_might_not_be_installed]
type = SMP
full = true
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = ' lu mumps'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 1E3
[TimeStepper]
type = IterationAdaptiveDT
dt = 1E3
growth_factor = 1.2
optimal_iterations = 10
[]
nl_abs_tol = 1E-7
[]
[Outputs]
exodus = true
[]
(modules/functional_expansion_tools/examples/1D_volumetric_Cartesian/sub.i)
# Basic example coupling a master and sub app in a 1D Cartesian volume.
#
# The master app provides field values to the sub app via Functional Expansions, which then performs
# its calculations. The sub app's solution field values are then transferred back to the master app
# and coupled into the solution of the master app solution.
#
# This example couples Functional Expansions via AuxVariable.
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0.0
xmax = 10.0
nx = 15
[]
# Non-copy transfers only work with AuxVariable, but nothing will be solved without a variable
# defined. The solution is to define an empty variable tha does nothing, but causes MOOSE to solve
# the AuxKernels that we need.
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
# We must have a kernel for every variable, hence this null kernel to match the variable 'empty'
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s] # Something to make 's' change each time, but allow a converging solution
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '3'
physical_bounds = '0.0 10.0'
x = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXVolumeUserObject
function = FX_Basis_Value_Sub
variable = s
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(modules/optimization/test/tests/optimizationreporter/material/adjoint_explicit.i)
[Mesh]
[]
[Variables]
[adjoint_var]
[]
[]
[Kernels]
[heat_conduction]
type = MatDiffusion
variable = adjoint_var
diffusivity = thermal_conductivity
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = adjoint_var
x_coord_name = misfit/measurement_xcoord
y_coord_name = misfit/measurement_ycoord
z_coord_name = misfit/measurement_zcoord
value_name = misfit/misfit_values
[]
[]
[Reporters]
[misfit]
type = OptimizationData
[]
[]
[AuxVariables]
[temperature_forward]
[]
[grad_Tx]
order = CONSTANT
family = MONOMIAL
[]
[grad_Ty]
order = CONSTANT
family = MONOMIAL
[]
[grad_Tz]
order = CONSTANT
family = MONOMIAL
[]
[grad_Tfx]
order = CONSTANT
family = MONOMIAL
[]
[grad_Tfy]
order = CONSTANT
family = MONOMIAL
[]
[grad_Tfz]
order = CONSTANT
family = MONOMIAL
[]
[negative_gradient]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[grad_Tx]
type = VariableGradientComponent
component = x
variable = grad_Tx
gradient_variable = adjoint_var
[]
[grad_Ty]
type = VariableGradientComponent
component = y
variable = grad_Ty
gradient_variable = adjoint_var
[]
[grad_Tz]
type = VariableGradientComponent
component = z
variable = grad_Tz
gradient_variable = adjoint_var
[]
[grad_Tfx]
type = VariableGradientComponent
component = x
variable = grad_Tfx
gradient_variable = temperature_forward
[]
[grad_Tfy]
type = VariableGradientComponent
component = y
variable = grad_Tfy
gradient_variable = temperature_forward
[]
[grad_Tfz]
type = VariableGradientComponent
component = z
variable = grad_Tfz
gradient_variable = temperature_forward
[]
[negative_gradient]
type = ParsedAux
variable = negative_gradient
args = 'grad_Tx grad_Ty grad_Tz grad_Tfx grad_Tfy grad_Tfz'
function = '-(grad_Tx*grad_Tfx+grad_Ty*grad_Tfy+grad_Tz*grad_Tfz)'
[]
[]
[BCs]
[left]
type = NeumannBC
variable = adjoint_var
boundary = left
value = 0
[]
[right]
type = NeumannBC
variable = adjoint_var
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = adjoint_var
boundary = bottom
value = 0
[]
[top]
type = DirichletBC
variable = adjoint_var
boundary = top
value = 0
[]
[]
[Functions]
[thermo_conduct]
type = ParsedFunction
value = alpha
vars = 'alpha'
vals = 'p1'
[]
[]
[Materials]
[thermalProp]
type = GenericFunctionMaterial
prop_names = 'thermal_conductivity'
prop_values = 'thermo_conduct'
[]
[thermalPropDeriv]
type = GenericFunctionMaterial
prop_names = 'thermal_conductivity_deriv'
prop_values = '1'
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
nl_abs_tol = 1e-8
nl_rel_tol = 1e-8
petsc_options_iname = '-ksp_type -pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'preonly lu superlu_dist'
[]
[Postprocessors]
[pp_adjoint_grad_parsedFunc]
type = ElementIntegralVariablePostprocessor
variable = negative_gradient
execute_on = 'initial linear'
[]
[p1]
type = ConstantValuePostprocessor
value = 10
execute_on = 'initial linear'
[]
[]
[Controls]
[parameterReceiver]
type = ControlsReceiver
[]
[]
[VectorPostprocessors]
[adjoint_grad]
type = VectorOfPostprocessors
postprocessors = 'pp_adjoint_grad_parsedFunc'
[]
[]
[Outputs]
console = false
file_base = 'adjoint'
[]
(test/tests/interfacekernels/hybrid/interface.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 40
xmax = 2
ny = 40
ymax = 2
[]
[subdomain1]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '0.5 0.5 0'
top_right = '1.5 1.5 0'
block_id = 1
[]
[interface]
type = SideSetsBetweenSubdomainsGenerator
input = subdomain1
primary_block = '1'
paired_block = '0'
new_boundary = 'primary1_interface'
[]
[]
[Variables]
[u]
block = 0
[]
[v]
block = 1
[]
[]
[Kernels]
[diff_u]
type = MatDiffusion
variable = u
diffusivity = D
block = 0
[]
[diff_v]
type = MatDiffusion
variable = v
diffusivity = D
block = 1
[]
[source_u]
type = BodyForce
variable = u
value = 1
block = 0
[]
[source_v]
type = BodyForce
variable = v
value = 1
block = 1
[]
[]
[BCs]
[u]
type = VacuumBC
variable = u
boundary = 'left bottom right top'
[]
[interface_bc]
type = ADMatchedValueBC
variable = v
v = u
boundary = primary1_interface
[]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
exodus = true
print_linear_residuals = true
[]
[InterfaceKernels]
active = 'diffusion'
[./diffusion]
type = InterfaceDiffusion
variable = v
neighbor_var = u
boundary = primary1_interface
D = 'D'
D_neighbor = 'D'
[../]
[./penalty]
type = PenaltyInterfaceDiffusion
variable = v
neighbor_var = u
boundary = primary1_interface
penalty = 1e3
[../]
[]
[Materials]
[mat0]
type = GenericConstantMaterial
prop_names = 'D'
prop_values = '1'
block = 0
[]
[mat1]
type = GenericConstantMaterial
prop_names = 'D'
prop_values = '1'
block = 1
[]
[]
[AuxVariables]
[c][]
[]
[AuxKernels]
[u]
type = ParsedAux
variable = c
coupled_variables = 'u'
expression = 'u'
block = 0
[]
[v]
type = ParsedAux
variable = c
coupled_variables = 'v'
expression = 'v'
block = 1
[]
[]
(modules/combined/test/tests/optimization/invOpt_bc_convective/adjoint.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 20
xmax = 1
ymax = 2
[]
[]
[AuxVariables]
[temperature_forward]
[]
[T2]
[]
[]
[AuxKernels]
[TT]
type = ParsedAux
args = 'temperature temperature_forward'
variable = T2
function = 'temperature*(100-temperature_forward)'
[]
[]
[Variables]
[temperature]
[]
[]
[Kernels]
[heat_conduction]
type = ADHeatConduction
variable = temperature
[]
[]
[DiracKernels]
[pt]
type = ReporterPointSource
variable = temperature
x_coord_name = misfit/measurement_xcoord
y_coord_name = misfit/measurement_ycoord
z_coord_name = misfit/measurement_zcoord
value_name = misfit/misfit_values
[]
[]
[Reporters]
[misfit]
type = OptimizationData
[]
[params]
type = ConstantReporter
real_vector_names = 'vals'
real_vector_values = '0' # Dummy value
[]
[]
[BCs]
[left]
type = ConvectiveFluxFunction
variable = temperature
boundary = 'left'
T_infinity = 0.0
coefficient = function1
[]
[right]
type = NeumannBC
variable = temperature
boundary = right
value = 0
[]
[bottom]
type = DirichletBC
variable = temperature
boundary = bottom
value = 0
[]
[top]
type = DirichletBC
variable = temperature
boundary = top
value = 0
[]
[]
[Materials]
[steel]
type = ADGenericConstantMaterial
prop_names = thermal_conductivity
prop_values = 5
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
nl_abs_tol = 1e-6
nl_rel_tol = 1e-8
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Functions]
[function1]
type = ParsedOptimizationFunction
expression = 'a'
param_symbol_names = 'a'
param_vector_name = 'params/vals'
[]
[]
[VectorPostprocessors]
[adjoint_pt]
type = SideOptimizationNeumannFunctionInnerProduct
variable = T2
function = function1
boundary = left
[]
[]
[Outputs]
console = false
exodus = false
file_base = 'adjoint'
[]
(modules/functional_expansion_tools/examples/3D_volumetric_Cartesian_direct/sub.i)
# Derived from the example '3D_volumetric_Cartesian' with the following differences:
#
# 1) The coupling is performed via BodyForce instead of the
# FunctionSeriesToAux+CoupledForce approach
[Mesh]
type = GeneratedMesh
dim = 3
xmin = 0.0
xmax = 10.0
nx = 15
ymin = 1.0
ymax = 11.0
ny = 25
zmin = 2.0
zmax = 12.0
nz = 35
[]
# Non-copy transfers only work with AuxVariable, but nothing will be solved without a variable
# defined. The solution is to define an empty variable tha does nothing, but causes MOOSE to solve
# the AuxKernels that we need.
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
# We must have a kernel for every variable, hence this null kernel to match the variable 'empty'
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s] # Something to make 's' change each time, but allow a converging solution
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '3 4 5'
physical_bounds = '0.0 10.0 1.0 11.0 2.0 12.0'
x = Legendre
y = Legendre
z = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXVolumeUserObject
function = FX_Basis_Value_Sub
variable = s
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(modules/geochemistry/test/tests/kinetics/bio_zoning_conc.i)
rate_Ca_diffuse = 6.66667E-9 # 2E-6 mol.m^-3.yr^-1 = 2E-9 mol.litre^-1.yr^-1 divided by porosity of 0.3
rate_CH3COO_diffuse = 13.3333E-9 # 4E-6 mol.m^-3.yr^-1 = 4E-9 mol.litre^-1.yr^-1 divided by porosity of 0.3
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 10
xmin = 0
xmax = 200000
[]
[]
[GlobalParams]
point = '100000 0 0'
reactor = reactor
[]
[SpatialReactionSolver]
model_definition = definition
geochemistry_reactor_name = reactor
swap_into_basis = 'Siderite'
swap_out_of_basis = 'Fe++'
prevent_precipitation = 'Pyrite Troilite'
charge_balance_species = "HCO3-"
constraint_species = "H2O Ca++ HCO3- SO4-- CH3COO- HS- CH4(aq) Siderite H+"
# ASSUME that 1 litre of solution initially contains:
constraint_value = " 1.0 1E-3 2E-3 0.04E-3 1E-9 1E-9 1E-9 1 -7.5"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition free_mineral log10activity"
constraint_unit = " kg moles moles moles moles moles moles cm3 dimensionless"
controlled_activity_name = 'H+'
controlled_activity_value = 3.16227E-8 # this is pH=7.5
kinetic_species_name = "sulfate_reducer methanogen"
kinetic_species_initial_value = '1E-6 1E-6'
kinetic_species_unit = 'mg mg'
source_species_names = "H2O Ca++ SO4-- CH3COO- HS- CH4(aq) Fe++"
source_species_rates = "rate_H2O_per_1l rate_Ca_per_1l_with_source rate_SO4_per_1l rate_CH3COO_per_1l_with_source rate_HS_per_1l rate_CH4_per_1l rate_Fe_per_1l"
ramp_max_ionic_strength_initial = 1
ramp_max_ionic_strength_subsequent = 1
execute_console_output_on = ''
solver_info = true
evaluate_kinetic_rates_always = true
adaptive_timestepping = true
abs_tol = 1E-14
precision = 16
[]
[UserObjects]
[rate_sulfate_reducer]
type = GeochemistryKineticRate
kinetic_species_name = "sulfate_reducer"
intrinsic_rate_constant = 31.536 # 1E-9 mol(acetate)/mg(biomass)/s = 31.536 mol(acetate)/g(biomass)/year
multiply_by_mass = true
promoting_species_names = 'CH3COO- SO4--'
promoting_indices = '1 1'
promoting_monod_indices = '1 1'
promoting_half_saturation = '70E-6 200E-6'
direction = dissolution
kinetic_biological_efficiency = 4.3E-3 # 4.3 g(biomass)/mol(acetate) = 4.3E-3 mol(biomass)/mol(acetate) (because sulfate_reducer has molar mass of 1E3 g/mol)
energy_captured = 45E3
theta = 0.2
eta = 1
[]
[death_sulfate_reducer]
type = GeochemistryKineticRate
kinetic_species_name = "sulfate_reducer"
intrinsic_rate_constant = 0.031536E-3 # 1E-9 g(biomass)/g(biomass)/s = 0.031536 g(biomass)/g(biomass)/year = 0.031536E-3 mol(biomass)/g(biomass)/year (because sulfate_reducer has molar mass of 1E3 g/mol)
multiply_by_mass = true
direction = death
eta = 0.0
[]
[rate_methanogen]
type = GeochemistryKineticRate
kinetic_species_name = "methanogen"
intrinsic_rate_constant = 63.072 # 2E-9 mol(acetate)/mg(biomass)/s = 63.072 mol(acetate)/g(biomass)/year
multiply_by_mass = true
promoting_species_names = 'CH3COO-'
promoting_indices = '1'
promoting_monod_indices = '1'
promoting_half_saturation = '20E-3'
direction = dissolution
kinetic_biological_efficiency = 2.0E-9 # 2 g(biomass)/mol(acetate) = 2E-9 mol(biomass)/mol(acetate) (because methanogen has molar mass of 1E9 g/mol)
energy_captured = 24E3
theta = 0.5
eta = 1
[]
[death_methanogen]
type = GeochemistryKineticRate
kinetic_species_name = "methanogen"
intrinsic_rate_constant = 0.031536E-9 # 1E-9 g(biomass)/g(biomass)/s = 0.031536 g(biomass)/g(biomass)/year = 0.031536E-9 mol(biomass)/g(biomass)/year (because methanogen has molar mass of 1E9 g/mol)
multiply_by_mass = true
direction = death
eta = 0.0
[]
[definition]
type = GeochemicalModelDefinition
database_file = "../../../database/moose_geochemdb.json"
basis_species = "H2O H+ CH3COO- CH4(aq) HS- Ca++ HCO3- SO4-- Fe++"
kinetic_minerals = "sulfate_reducer methanogen"
equilibrium_minerals = "*"
kinetic_rate_descriptions = "rate_sulfate_reducer death_sulfate_reducer rate_methanogen death_methanogen"
[]
[]
[Executioner]
type = Transient
[TimeStepper]
type = FunctionDT
function = 'min(0.1 * (t + 1), 100)'
[]
end_time = 20000
[]
[AuxVariables]
[rate_H2O_per_1l] # change in H2O per 1 litre of aqueous solution that we consider at each node
[]
[rate_CH3COO_per_1l] # change in CH3COO- per 1 litre of aqueous solution that we consider at each node
[]
[rate_CH4_per_1l] # change in CH4(aq) per 1 litre of aqueous solution that we consider at each node
[]
[rate_HS_per_1l] # change in HS- per 1 litre of aqueous solution that we consider at each node
[]
[rate_Ca_per_1l] # change in Ca++ per 1 litre of aqueous solution that we consider at each node
[]
[rate_SO4_per_1l] # change in SO4-- per 1 litre of aqueous solution that we consider at each node
[]
[rate_Fe_per_1l] # change in Fe++ per 1 litre of aqueous solution that we consider at each node
[]
[rate_CH3COO_per_1l_with_source] # change in CH3COO- per 1 litre of aqueous solution that we consider at each node, including the diffuse source
[]
[rate_Ca_per_1l_with_source] # change in Ca per 1 litre of aqueous solution that we consider at each node, including the diffuse source
[]
[transported_H2O]
[]
[transported_CH3COO]
[]
[transported_CH4]
[]
[transported_HS]
[]
[transported_Ca]
[]
[transported_SO4]
[]
[transported_Fe]
[]
[]
[AuxKernels]
[rate_CH3COO_per_1l_with_source]
type = ParsedAux
args = 'rate_CH3COO_per_1l'
variable = rate_CH3COO_per_1l_with_source
function = 'rate_CH3COO_per_1l + ${rate_CH3COO_diffuse}'
execute_on = 'timestep_begin timestep_end'
[]
[rate_Ca_per_1l_with_source]
type = ParsedAux
args = 'rate_Ca_per_1l'
variable = rate_Ca_per_1l_with_source
function = 'rate_Ca_per_1l + ${rate_Ca_diffuse}'
execute_on = 'timestep_begin timestep_end'
[]
[transported_H2O]
type = GeochemistryQuantityAux
variable = transported_H2O
species = H2O
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_CH3COO]
type = GeochemistryQuantityAux
variable = transported_CH3COO
species = "CH3COO-"
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_CH4]
type = GeochemistryQuantityAux
variable = transported_CH4
species = "CH4(aq)"
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_HS]
type = GeochemistryQuantityAux
variable = transported_HS
species = "HS-"
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Ca]
type = GeochemistryQuantityAux
variable = transported_Ca
species = "Ca++"
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_SO4]
type = GeochemistryQuantityAux
variable = transported_SO4
species = "SO4--"
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Fe]
type = GeochemistryQuantityAux
variable = transported_Fe
species = "Fe++"
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[]
[Postprocessors]
[time]
type = TimePostprocessor
[]
[]
[VectorPostprocessors]
[data]
type = LineValueSampler
start_point = '0 0 0'
end_point = '200000 0 0'
num_points = 501 # NOTE
sort_by = x
variable = 'transported_CH4 transported_CH3COO transported_SO4 free_mg_sulfate_reducer free_mg_methanogen'
[]
[]
[Outputs]
exodus = true
[csv]
type = CSV
time_step_interval = 10
execute_on = 'INITIAL TIMESTEP_END FINAL'
[]
[]
(modules/combined/examples/publications/rapid_dev/fig3.i)
#
# Fig. 3 input for 10.1016/j.commatsci.2017.02.017
# D. Schwen et al./Computational Materials Science 132 (2017) 36-45
# Comparison of an analytical (ca) and numerical (c) phase field interface
# profile. Supply the L parameter on the command line to gather the data for
# the inset plot.
#
[Mesh]
type = GeneratedMesh
dim = 1
nx = ${L}
xmin = -30
xmax = 30
[]
[Functions]
[./solution]
type = ParsedFunction
expression = 0.5*(1+tanh(x/2^0.5))
[../]
[]
[Variables]
[./c]
[./InitialCondition]
type = FunctionIC
function = solution
#type = FunctionIC
#function = if(x>0,1,0)
[../]
[../]
[./w]
[../]
[]
[AuxVariables]
[./diff]
[../]
[./ca]
[./InitialCondition]
type = FunctionIC
function = '0.5*(1+tanh(x/2^0.5))'
[../]
[../]
[]
[AuxKernels]
[./diff]
type = ParsedAux
variable = diff
expression = c-ca
coupled_variables = 'c ca'
[../]
[]
[Materials]
[./F]
type = DerivativeParsedMaterial
property_name = F
expression = 'c^2*(1-c)^2'
coupled_variables = c
[../]
[]
[Kernels]
# Split Cahn-Hilliard kernels
[./c_res]
type = SplitCHParsed
variable = c
f_name = F
kappa_name = 1
w = w
[../]
[./wres]
type = SplitCHWRes
variable = w
mob_name = 1
[../]
[./time]
type = CoupledTimeDerivative
variable = w
v = c
[../]
[]
[Postprocessors]
[./L2]
type = ElementL2Error
function = solution
variable = c
[../]
[]
[VectorPostprocessors]
[./c]
type = LineValueSampler
variable = 'c ca diff'
start_point = '-10 0 0'
end_point = '10 0 0'
num_points = 200
sort_by = x
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
nl_rel_tol = 1e-10
nl_abs_tol = 1e-12
end_time = 1e+6
[./TimeStepper]
type = IterationAdaptiveDT
dt = 1
optimal_iterations = 5
iteration_window = 1
[../]
[]
[Outputs]
csv = true
execute_on = final
[]
(modules/fluid_properties/test/tests/water/water.i)
# Example of using Water97FluidProperties module in Region 1 by recovering the values
# in Table 5 of Revised Release on the IAPWS Industrial Formulation 1997 for the
# Thermodynamic Properties of Water and Steam
[Mesh]
type = GeneratedMesh
dim = 2
nx = 3
xmax = 3
# This test uses ElementalVariableValue postprocessors on specific
# elements, so element numbering needs to stay unchanged
allow_renumbering = false
[]
[Variables]
[./dummy]
[../]
[]
[AuxVariables]
[./pressure]
order = CONSTANT
family = MONOMIAL
[../]
[./temperature]
order = CONSTANT
family = MONOMIAL
[../]
[./rho]
family = MONOMIAL
order = CONSTANT
[../]
[./v]
family = MONOMIAL
order = CONSTANT
[../]
[./e]
family = MONOMIAL
order = CONSTANT
[../]
[./h]
family = MONOMIAL
order = CONSTANT
[../]
[./s]
family = MONOMIAL
order = CONSTANT
[../]
[./cp]
family = MONOMIAL
order = CONSTANT
[../]
[./cv]
family = MONOMIAL
order = CONSTANT
[../]
[./c]
family = MONOMIAL
order = CONSTANT
[../]
[./mu]
family = MONOMIAL
order = CONSTANT
[../]
[./k]
family = MONOMIAL
order = CONSTANT
[../]
[]
[Functions]
[./tic]
type = ParsedFunction
expression = 'if(x<2, 300, 500)'
[../]
[./pic]
type = ParsedFunction
expression = 'if(x<1,3e6, if(x<2, 80e6, 3e6))'
[../]
[]
[ICs]
[./p_ic]
type = FunctionIC
function = pic
variable = pressure
[../]
[./t_ic]
type = FunctionIC
function = tic
variable = temperature
[../]
[]
[AuxKernels]
[./rho]
type = MaterialRealAux
variable = rho
property = density
[../]
[./v]
type = ParsedAux
coupled_variables = rho
expression = 1/rho
variable = v
[../]
[./e]
type = MaterialRealAux
variable = e
property = e
[../]
[./h]
type = MaterialRealAux
variable = h
property = h
[../]
[./s]
type = MaterialRealAux
variable = s
property = s
[../]
[./cp]
type = MaterialRealAux
variable = cp
property = cp
[../]
[./cv]
type = MaterialRealAux
variable = cv
property = cv
[../]
[./c]
type = MaterialRealAux
variable = c
property = c
[../]
[./mu]
type = MaterialRealAux
variable = mu
property = viscosity
[../]
[./k]
type = MaterialRealAux
variable = k
property = k
[../]
[]
[FluidProperties]
[./water]
type = Water97FluidProperties
[../]
[]
[Materials]
[./fp_mat]
type = FluidPropertiesMaterialPT
pressure = pressure
temperature = temperature
fp = water
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = dummy
[../]
[]
[Postprocessors]
[./density0]
type = ElementalVariableValue
variable = rho
elementid = 0
[../]
[./density1]
type = ElementalVariableValue
variable = rho
elementid = 1
[../]
[./density2]
type = ElementalVariableValue
variable = rho
elementid = 2
[../]
[./v0]
type = ElementalVariableValue
variable = v
elementid = 0
[../]
[./v1]
type = ElementalVariableValue
variable = v
elementid = 1
[../]
[./v2]
type = ElementalVariableValue
variable = v
elementid = 2
[../]
[./e0]
type = ElementalVariableValue
variable = e
elementid = 0
[../]
[./e1]
type = ElementalVariableValue
variable = e
elementid = 1
[../]
[./e2]
type = ElementalVariableValue
variable = e
elementid = 2
[../]
[./h0]
type = ElementalVariableValue
variable = h
elementid = 0
[../]
[./h1]
type = ElementalVariableValue
variable = h
elementid = 1
[../]
[./h2]
type = ElementalVariableValue
variable = h
elementid = 2
[../]
[./s0]
type = ElementalVariableValue
variable = s
elementid = 0
[../]
[./s1]
type = ElementalVariableValue
variable = s
elementid = 1
[../]
[./s2]
type = ElementalVariableValue
variable = s
elementid = 2
[../]
[./cp0]
type = ElementalVariableValue
variable = cp
elementid = 0
[../]
[./cp1]
type = ElementalVariableValue
variable = cp
elementid = 1
[../]
[./cp2]
type = ElementalVariableValue
variable = cp
elementid = 2
[../]
[./cv0]
type = ElementalVariableValue
variable = cv
elementid = 0
[../]
[./cv1]
type = ElementalVariableValue
variable = cv
elementid = 1
[../]
[./cv2]
type = ElementalVariableValue
variable = cv
elementid = 2
[../]
[./c0]
type = ElementalVariableValue
variable = c
elementid = 0
[../]
[./c1]
type = ElementalVariableValue
variable = c
elementid = 1
[../]
[./c2]
type = ElementalVariableValue
variable = c
elementid = 2
[../]
[./mu0]
type = ElementalVariableValue
variable = mu
elementid = 0
[../]
[./mu1]
type = ElementalVariableValue
variable = mu
elementid = 1
[../]
[./mu2]
type = ElementalVariableValue
variable = mu
elementid = 2
[../]
[./k0]
type = ElementalVariableValue
variable = k
elementid = 0
[../]
[./k1]
type = ElementalVariableValue
variable = k
elementid = 1
[../]
[./k2]
type = ElementalVariableValue
variable = k
elementid = 2
[../]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
csv = true
[]
(test/tests/transfers/multiapp_userobject_transfer/restricted_elem_parent.i)
num_layers = 2
[Mesh]
[box]
type = GeneratedMeshGenerator
dim = 3
nx = ${num_layers}
ny = 3
nz = 3
[]
# The MultiAppUserObjectTransfer object only works with ReplicatedMesh
parallel_type = replicated
[]
[Variables]
[u]
[]
[]
[Kernels]
[td]
type = TimeDerivative
variable = u
[]
[diff]
type = Diffusion
variable = u
[]
[]
[AuxVariables]
[a]
family = MONOMIAL
order = CONSTANT
[]
[s]
[]
[]
[AuxKernels]
[s_ak]
type = ParsedAux
variable = s
use_xyzt = true
expression = 'x+(z*z)'
[]
[]
[Functions]
[]
[Postprocessors]
[a_avg]
type = ElementAverageValue
variable = a
[]
[]
[UserObjects]
[S_avg_front]
type = LayeredSideAverage
boundary = front
variable = s
num_layers = ${num_layers}
direction = x
[]
[S_avg_back]
type = LayeredSideAverage
boundary = back
variable = s
num_layers = ${num_layers}
direction = x
[]
[]
[MultiApps]
[ch0]
type = TransientMultiApp
input_files = 'restricted_elem_sub.i'
bounding_box_padding = '0 0.5 1'
positions = '0 0.5 -0.1'
output_in_position = true
cli_args = 'yy=0'
[]
[ch1]
type = TransientMultiApp
input_files = 'restricted_elem_sub.i'
bounding_box_padding = '0 0.5 1'
positions = '0 0.5 1.1'
output_in_position = true
cli_args = 'yy=1'
[]
[]
[Transfers]
[from_ch0]
type = MultiAppUserObjectTransfer
boundary = back
from_multi_app = ch0
variable = a
user_object = A_avg
[]
[from_ch1]
type = MultiAppUserObjectTransfer
boundary = front
from_multi_app = ch1
variable = a
user_object = A_avg
[]
[to_ch0]
type = MultiAppUserObjectTransfer
block = 20
to_multi_app = ch0
variable = S
user_object = S_avg_back
[]
[to_ch1]
type = MultiAppUserObjectTransfer
block = 20
to_multi_app = ch1
variable = S
user_object = S_avg_front
[]
[]
[Executioner]
type = Transient
num_steps = 2
dt = 1
nl_abs_tol = 1e-7
[]
[Outputs]
exodus = true
[]
(test/tests/meshdivisions/block_division.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 3
dx = '1.5 2.4 0.1'
dy = '1.3 0.9'
dz = '0.4 0.5 0.6 0.7'
ix = '2 1 1'
iy = '2 3'
iz = '1 1 1 1'
subdomain_id = '0 1 1
2 2 2
3 4 4
5 5 5
0 1 1
2 2 2
3 4 4
5 5 5
'
[]
[]
[MeshDivisions]
[block_div]
type = SubdomainsDivision
[]
[]
[AuxVariables]
[blocks]
family = MONOMIAL
order = CONSTANT
[]
[div]
family = MONOMIAL
order = CONSTANT
[]
[diff]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'block_div'
[]
[subdomains]
type = FunctorAux
functor = 'blocks_fmat'
variable = 'blocks'
[]
[difference]
type = ParsedAux
variable = diff
expression = 'blocks - div'
coupled_variables = 'blocks div'
[]
[]
[FunctorMaterials]
[fmat]
type = PiecewiseByBlockFunctorMaterial
prop_name = 'blocks_fmat'
subdomain_to_prop_value = '0 0 1 1 2 2 3 3 4 4 5 5'
[]
[]
[Postprocessors]
[min_diff]
type = ElementExtremeValue
variable = diff
value_type = 'min'
[]
[max_diff]
type = ElementExtremeValue
variable = diff
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(modules/combined/examples/geochem-porous_flow/geotes_2D/aquifer_geochemistry.i)
# Simulates geochemistry in the aquifer. This input file may be run in standalone fashion but it does not do anything of interest. To simulate something interesting, run the porous_flow.i simulation which couples to this input file using MultiApps.
# This file receives pf_rate_H2O, pf_rate_Na, pf_rate_Cl, pf_rate_SiO2 and temperature as AuxVariables from porous_flow.i.
# The pf_rate quantities are kg/s changes of fluid-component mass at each node, but the geochemistry module expects rates-of-changes of moles at every node. Secondly, since this input file considers just 1 litre of aqueous solution at every node, the nodal_void_volume is used to convert pf_rate_* into rate_*_per_1l, which is measured in mol/s/1_litre_of_aqueous_solution.
# This file sends massfrac_Na, massfrac_Cl and massfrac_SiO2 to porous_flow.i. These are computed from the corresponding transported_* quantities.
[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
[]
[]
[GlobalParams]
point = '0 0 0'
reactor = reactor
[]
[SpatialReactionSolver]
model_definition = definition
geochemistry_reactor_name = reactor
charge_balance_species = "Cl-"
constraint_species = "H2O Na+ Cl- SiO2(aq)"
# ASSUME that 1 litre of solution contains:
constraint_value = " 1.0 0.1 0.1 0.000555052386"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition free_concentration"
constraint_unit = " kg moles moles molal"
initial_temperature = 50.0
kinetic_species_name = QuartzLike
# Per 1 litre (1000cm^3) of aqueous solution (1kg of solvent water), there is 9000cm^3 of QuartzLike, which means the initial porosity is 0.1.
kinetic_species_initial_value = 9000
kinetic_species_unit = cm3
temperature = temperature
source_species_names = 'H2O Na+ Cl- SiO2(aq)'
source_species_rates = 'rate_H2O_per_1l rate_Na_per_1l rate_Cl_per_1l rate_SiO2_per_1l'
ramp_max_ionic_strength_initial = 0 # max_ionic_strength in such a simple problem does not need ramping
add_aux_pH = false # there is no H+ in this system
evaluate_kinetic_rates_always = true # implicit time-marching used for stability
execute_console_output_on = ''
[]
[UserObjects]
[rate_quartz]
type = GeochemistryKineticRate
kinetic_species_name = QuartzLike
intrinsic_rate_constant = 1.0E-2
multiply_by_mass = true
area_quantity = 1
activation_energy = 72800.0
[]
[definition]
type = GeochemicalModelDefinition
database_file = "small_database.json"
basis_species = "H2O SiO2(aq) Na+ Cl-"
kinetic_minerals = "QuartzLike"
kinetic_rate_descriptions = "rate_quartz"
[]
[nodal_void_volume_uo]
type = NodalVoidVolume
porosity = porosity
execute_on = 'initial timestep_end' # "initial" means this is evaluated properly for the first timestep
[]
[]
[Executioner]
type = Transient
dt = 1E5
end_time = 7.76E6 # 90 days
[]
[AuxVariables]
[temperature]
initial_condition = 50.0
[]
[porosity]
initial_condition = 0.1
[]
[nodal_void_volume]
[]
[pf_rate_H2O] # change in H2O mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Na] # change in H2O mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_Cl] # change in H2O mass (kg/s) at each node provided by the porous-flow simulation
[]
[pf_rate_SiO2] # change in H2O mass (kg/s) at each node provided by the porous-flow simulation
[]
[rate_H2O_per_1l] # rate per 1 litre of aqueous solution that we consider at each node
[]
[rate_Na_per_1l]
[]
[rate_Cl_per_1l]
[]
[rate_SiO2_per_1l]
[]
[transported_H2O]
[]
[transported_Na]
[]
[transported_Cl]
[]
[transported_SiO2]
[]
[transported_mass]
[]
[massfrac_Na]
[]
[massfrac_Cl]
[]
[massfrac_SiO2]
[]
[massfrac_H2O]
[]
[]
[AuxKernels]
[porosity]
type = ParsedAux
coupled_variables = free_cm3_QuartzLike
expression = '1000.0 / (1000.0 + free_cm3_QuartzLike)'
variable = porosity
execute_on = 'timestep_end'
[]
[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_per_1l_auxk]
type = ParsedAux
coupled_variables = 'pf_rate_H2O nodal_void_volume'
variable = rate_H2O_per_1l
# pf_rate = change in kg at every node
# pf_rate * 1000 / molar_mass_in_g_per_mole = change in moles at every node
# pf_rate * 1000 / molar_mass / (nodal_void_volume_in_m^3 * 1000) = change in moles per litre of aqueous solution
expression = 'pf_rate_H2O / 18.0152 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_Na_per_1l]
type = ParsedAux
coupled_variables = 'pf_rate_Na nodal_void_volume'
variable = rate_Na_per_1l
expression = 'pf_rate_Na / 22.9898 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_Cl_per_1l]
type = ParsedAux
coupled_variables = 'pf_rate_Cl nodal_void_volume'
variable = rate_Cl_per_1l
expression = 'pf_rate_Cl / 35.453 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[rate_SiO2_per_1l]
type = ParsedAux
coupled_variables = 'pf_rate_SiO2 nodal_void_volume'
variable = rate_SiO2_per_1l
expression = 'pf_rate_SiO2 / 60.0843 / nodal_void_volume'
execute_on = 'timestep_begin'
[]
[transported_H2O_auxk]
type = GeochemistryQuantityAux
variable = transported_H2O
species = H2O
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Na]
type = GeochemistryQuantityAux
variable = transported_Na
species = Na+
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_Cl]
type = GeochemistryQuantityAux
variable = transported_Cl
species = Cl-
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_SiO2]
type = GeochemistryQuantityAux
variable = transported_SiO2
species = 'SiO2(aq)'
quantity = transported_moles_in_original_basis
execute_on = 'timestep_end'
[]
[transported_mass_auxk]
type = ParsedAux
coupled_variables = 'transported_H2O transported_Na transported_Cl transported_SiO2'
variable = transported_mass
expression = 'transported_H2O * 18.0152 + transported_Na * 22.9898 + transported_Cl * 35.453 + transported_SiO2 * 60.0843'
execute_on = 'timestep_end'
[]
[massfrac_H2O]
type = ParsedAux
coupled_variables = 'transported_H2O transported_mass'
variable = massfrac_H2O
expression = 'transported_H2O * 18.0152 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Na]
type = ParsedAux
coupled_variables = 'transported_Na transported_mass'
variable = massfrac_Na
expression = 'transported_Na * 22.9898 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_Cl]
type = ParsedAux
coupled_variables = 'transported_Cl transported_mass'
variable = massfrac_Cl
expression = 'transported_Cl * 35.453 / transported_mass'
execute_on = 'timestep_end'
[]
[massfrac_SiO2]
type = ParsedAux
coupled_variables = 'transported_SiO2 transported_mass'
variable = massfrac_SiO2
expression = 'transported_SiO2 * 60.0843 / transported_mass'
execute_on = 'timestep_end'
[]
[]
[Postprocessors]
[cm3_quartz]
type = PointValue
variable = free_cm3_QuartzLike
[]
[porosity]
type = PointValue
variable = porosity
[]
[solution_temperature]
type = PointValue
variable = solution_temperature
[]
[massfrac_H2O]
type = PointValue
variable = massfrac_H2O
[]
[massfrac_Na]
type = PointValue
variable = massfrac_Na
[]
[massfrac_Cl]
type = PointValue
variable = massfrac_Cl
[]
[massfrac_SiO2]
type = PointValue
variable = massfrac_SiO2
[]
[]
[Outputs]
exodus = true
csv = true
[]
(modules/geochemistry/test/tests/time_dependent_reactions/flushing_case2.i)
# Alkali flushing of a reservoir (an example of flushing): adding Na2CO3
# To determine the initial constraint_values, run flushing_equilibrium_at70degC.i
# Note that flushing_equilibrium_at70degC.i will have to be re-run when temperature-dependence has been added to geochemistry
# Note that Dawsonite is currently not included as an equilibrium_mineral, otherwise it is supersaturated in the initial configuration, so precipitates. Bethke does not report this in Fig30.4, so I assume it is due to temperature dependence
[GlobalParams]
point = '0 0 0'
[]
[TimeDependentReactionSolver]
model_definition = definition
geochemistry_reactor_name = reactor
charge_balance_species = "Cl-"
swap_into_basis = "Calcite Dolomite-ord Muscovite Kaolinite"
swap_out_of_basis = "HCO3- Mg++ K+ Al+++"
constraint_species = "H2O H+ Cl- Na+ Ca++ Calcite Dolomite-ord Muscovite Kaolinite SiO2(aq)"
constraint_value = " 1.0 1E-5 2.1716946 1.0288941 0.21650572 10.177537 3.6826177 1.320907 1.1432682 6.318e-05"
constraint_meaning = "kg_solvent_water activity bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition bulk_composition free_concentration"
constraint_unit = " kg dimensionless moles moles moles moles moles moles moles molal"
initial_temperature = 70.0
temperature = 70.0
kinetic_species_name = Quartz
kinetic_species_initial_value = 226.992243
kinetic_species_unit = moles
evaluate_kinetic_rates_always = true # implicit time-marching used for stability
ramp_max_ionic_strength_initial = 0 # max_ionic_strength in such a simple problem does not need ramping
close_system_at_time = 0.0
remove_fixed_activity_name = "H+"
remove_fixed_activity_time = 0.0
mode = 3 # flush through the NaOH solution specified below:
source_species_names = "H2O Na+ CO3--"
source_species_rates = "27.755 0.25 0.125" # 1kg water/2days = 27.755moles/day. 0.5mol Na+/2days = 0.25mol/day
[]
[UserObjects]
[rate_quartz]
type = GeochemistryKineticRate
kinetic_species_name = Quartz
intrinsic_rate_constant = 1.3824E-13 # 1.6E-19mol/s/cm^2 = 1.3824E-13mol/day/cm^2
multiply_by_mass = true
area_quantity = 1000
promoting_species_names = "H+"
promoting_indices = "-0.5"
[]
[definition]
type = GeochemicalModelDefinition
database_file = "../../../database/moose_geochemdb.json"
basis_species = "H2O H+ Cl- Na+ Ca++ HCO3- Mg++ K+ Al+++ SiO2(aq)"
equilibrium_minerals = "Calcite Dolomite-ord Muscovite Kaolinite Paragonite Analcime Phlogopite Tridymite" # Dawsonite
kinetic_minerals = "Quartz"
kinetic_rate_descriptions = "rate_quartz"
[]
[]
[AuxVariables]
[diss_rate]
[]
[]
[AuxKernels]
[diss_rate]
type = ParsedAux
coupled_variables = mol_change_Quartz
expression = '-mol_change_Quartz / 1.0' # 1.0 = timestep size
variable = diss_rate
[]
[]
[Postprocessors]
[pH]
type = PointValue
variable = "pH"
[]
[rate_mole_per_day]
type = PointValue
variable = diss_rate
[]
[cm3_Calcite]
type = PointValue
variable = free_cm3_Calcite
[]
[cm3_Dolomite]
type = PointValue
variable = free_cm3_Dolomite-ord
[]
[cm3_Muscovite]
type = PointValue
variable = free_cm3_Muscovite
[]
[cm3_Kaolinite]
type = PointValue
variable = free_cm3_Kaolinite
[]
[cm3_Quartz]
type = PointValue
variable = free_cm3_Quartz
[]
[cm3_Paragonite]
type = PointValue
variable = free_cm3_Paragonite
[]
[cm3_Analcime]
type = PointValue
variable = free_cm3_Analcime
[]
[cm3_Phlogopite]
type = PointValue
variable = free_cm3_Phlogopite
[]
[cm3_Tridymite]
type = PointValue
variable = free_cm3_Tridymite
[]
[]
[Executioner]
type = Transient
dt = 1
end_time = 20 # measured in days
[]
[Outputs]
csv = true
[]
(modules/optimization/test/tests/optimizationreporter/parameter_mesh_base/parameter_mesh_boundsIC.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 1
[]
second_order = true
parallel_type = REPLICATED
[]
[Problem]
solve=false
[]
[AuxVariables]
[lowerBounds]
family = LAGRANGE
order = FIRST
[]
[upperBounds]
family = LAGRANGE
order = FIRST
[]
[initialConditions]
family = LAGRANGE
order = FIRST
[]
[lowerBoundsSecond]
family = LAGRANGE
order = SECOND
[]
[upperBoundsSecond]
family = LAGRANGE
order = SECOND
[]
[initialConditionsSecond]
family = LAGRANGE
order = SECOND
[]
[elemLowerBounds]
family = MONOMIAL
order = CONSTANT
[]
[elemUpperBounds]
family = MONOMIAL
order = CONSTANT
[]
[elemInitialConditions]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[lowerBounds_aux]
type = ParsedAux
use_xyzt = true
variable = lowerBounds
expression = 't*x'
[]
[upperBounds_aux]
type = ParsedAux
use_xyzt = true
variable = upperBounds
expression = '2+t*x'
[]
[initialConditions_aux]
type = ParsedAux
use_xyzt = true
variable = initialConditions
expression = 'x'
[]
[lowerBoundsSecond_aux]
type = ParsedAux
use_xyzt = true
variable = lowerBoundsSecond
expression = 't*y'
[]
[upperBoundsSecond_aux]
type = ParsedAux
use_xyzt = true
variable = upperBoundsSecond
expression = '2+t*y'
[]
[initialConditionsSecond_aux]
type = ParsedAux
use_xyzt = true
variable = initialConditionsSecond
expression = 'y'
[]
[elemLowerBounds_aux]
type = ParsedAux
use_xyzt = true
variable = elemLowerBounds
expression = 't*x'
[]
[elemUpperBounds_aux]
type = ParsedAux
use_xyzt = true
variable = elemUpperBounds
expression = '2+t*x'
[]
[elemInitialConditions_aux]
type = ParsedAux
use_xyzt = true
variable = elemInitialConditions
expression = 'x'
[]
[]
[BCs]
[]
[Executioner]
type = Transient
# time control
start_time = 0.0
dt = 1.0
end_time = 3.0
[]
[Outputs]
exodus = true
[]
(modules/porous_flow/examples/reservoir_model/field_model.i)
# Field model generated using geophysical modelling tool
[Mesh]
type = FileMesh
file = field.e
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 -9.81'
temperature_unit = Celsius
[]
[Problem]
# Variable porepressure has an initial condition despite the restart
allow_initial_conditions_with_restart = true
[]
[Variables]
[porepressure]
initial_condition = 20e6
[]
[]
[AuxVariables]
[temperature]
initial_condition = 50
[]
[xnacl]
initial_condition = 0.1
[]
[porosity]
family = MONOMIAL
order = CONSTANT
initial_from_file_var = poro
[]
[permx_md]
family = MONOMIAL
order = CONSTANT
initial_from_file_var = permX
[]
[permy_md]
family = MONOMIAL
order = CONSTANT
initial_from_file_var = permY
[]
[permz_md]
family = MONOMIAL
order = CONSTANT
initial_from_file_var = permZ
[]
[permx]
family = MONOMIAL
order = CONSTANT
[]
[permy]
family = MONOMIAL
order = CONSTANT
[]
[permz]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[permx]
type = ParsedAux
variable = permx
coupled_variables = permx_md
expression = '9.869233e-16*permx_md'
execute_on = initial
[]
[permy]
type = ParsedAux
variable = permy
coupled_variables = permy_md
expression = '9.869233e-16*permy_md'
execute_on = initial
[]
[permz]
type = ParsedAux
variable = permz
coupled_variables = permz_md
expression = '9.869233e-16*permz_md'
execute_on = initial
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
variable = porepressure
[]
[flux0]
type = PorousFlowFullySaturatedDarcyFlow
variable = porepressure
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = porepressure
number_fluid_phases = 1
number_fluid_components = 1
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[watertab]
type = TabulatedBicubicFluidProperties
fp = water
save_file = false
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = temperature
[]
[ps]
type = PorousFlow1PhaseFullySaturated
porepressure = porepressure
[]
[massfrac]
type = PorousFlowMassFraction
[]
[brine]
type = PorousFlowBrine
compute_enthalpy = false
compute_internal_energy = false
xnacl = xnacl
phase = 0
water_fp = watertab
[]
[porosity]
type = PorousFlowPorosityConst
porosity = porosity
[]
[permeability]
type = PorousFlowPermeabilityConstFromVar
perm_xx = permx
perm_yy = permy
perm_zz = permz
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
dt = 1e2
end_time = 1e2
[]
[Outputs]
execute_on = 'initial timestep_end'
exodus = true
perf_graph = true
[]
(test/tests/auxkernels/parsed_aux/xyzt.i)
[Mesh]
type = GeneratedMesh
dim = 3
nx = 4
ny = 4
nz = 4
[]
# [Variables]
# [u]
# []
# []
#
# [Kernels]
# [diff]
# type = CoefDiffusion
# variable = u
# coef = 0.1
# []
# [dt]
# type = TimeDerivative
# variable = u
# []
# []
[AuxVariables]
[xvar]
family = MONOMIAL
order = FIRST
[]
[yvar]
[]
[zvar]
family = MONOMIAL
order = CONSTANT
[]
[tvar]
[]
[]
[AuxKernels]
[xvar]
type = ParsedAux
variable = xvar
use_xyzt = true
expression = 'x+1'
[]
[yvar]
type = ParsedAux
variable = yvar
use_xyzt = true
expression = 'y+2'
[]
[zvar]
type = ParsedAux
variable = zvar
use_xyzt = true
expression = 'z+3'
[]
[tvar]
type = ParsedAux
variable = tvar
use_xyzt = true
expression = 't+0.1*(x+y+z)'
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Problem]
solve = false
kernel_coverage_check = false
[]
[Executioner]
type = Transient
num_steps = 3
[]
[Outputs]
exodus = true
[]
(test/tests/transfers/multiapp_userobject_transfer/restricted_node_parent.i)
num_layers = 2
[Mesh]
[box]
type = GeneratedMeshGenerator
dim = 3
nx = ${num_layers}
ny = 3
nz = 3
xmin = 0.25
xmax = 1.25
[]
# The MultiAppUserObjectTransfer object only works with ReplicatedMesh
parallel_type = replicated
[]
[Variables]
[u]
[]
[]
[Kernels]
[td]
type = TimeDerivative
variable = u
[]
[diff]
type = Diffusion
variable = u
[]
[]
[AuxVariables]
[a]
[]
[s]
[]
[]
[AuxKernels]
[s_ak]
type = ParsedAux
variable = s
use_xyzt = true
expression = 'x+(z*z)'
[]
[]
[Functions]
[]
[Postprocessors]
[a_avg]
type = ElementAverageValue
variable = a
[]
[]
[UserObjects]
[S_avg_front]
type = LayeredSideAverage
boundary = front
variable = s
num_layers = ${num_layers}
direction = x
[]
[S_avg_back]
type = LayeredSideAverage
boundary = back
variable = s
num_layers = ${num_layers}
direction = x
[]
[]
[MultiApps]
[ch0]
type = TransientMultiApp
input_files = 'restricted_node_sub.i'
bounding_box_padding = '0 0.5 1'
positions = '0 0.5 -0.1'
output_in_position = true
cli_args = 'yy=0'
[]
[ch1]
type = TransientMultiApp
input_files = 'restricted_node_sub.i'
bounding_box_padding = '0 0.5 1'
positions = '0 0.5 1.1'
output_in_position = true
cli_args = 'yy=1'
[]
[]
[Transfers]
[from_ch0]
type = MultiAppUserObjectTransfer
boundary = back
from_multi_app = ch0
variable = a
user_object = A_avg
[]
[from_ch1]
type = MultiAppUserObjectTransfer
boundary = front
from_multi_app = ch1
variable = a
user_object = A_avg
[]
[to_ch0]
type = MultiAppUserObjectTransfer
block = 20
to_multi_app = ch0
variable = S
user_object = S_avg_back
[]
[to_ch1]
type = MultiAppUserObjectTransfer
block = 20
to_multi_app = ch1
variable = S
user_object = S_avg_front
[]
[]
[Executioner]
type = Transient
num_steps = 2
dt = 1
nl_abs_tol = 1e-7
[]
[Outputs]
exodus = true
[]
(test/tests/kernels/hfem/robin_displaced.i)
[Mesh]
[square]
type = CartesianMeshGenerator
dx = '0.3125 0.3125 0.3125'
dy = '0.3333333333333 0.3333333333333 0.3333333333333'
dim = 2
[]
displacements = 'x_disp y_disp'
build_all_side_lowerd_mesh = true
[]
[Variables]
[u]
order = THIRD
family = MONOMIAL
block = 0
components = 2
[]
[lambda]
order = CONSTANT
family = MONOMIAL
block = INTERNAL_SIDE_LOWERD_SUBDOMAIN
components = 2
[]
[]
[AuxVariables]
[v]
order = CONSTANT
family = MONOMIAL
block = 0
initial_condition = '1'
[]
[x_disp]
block = 0
[]
[y_disp]
block = 0
initial_condition = 0
[]
[]
[AuxKernels]
[x_disp]
type = ParsedAux
variable = x_disp
use_xyzt = true
expression = 'x/15'
[]
[]
[Kernels]
[diff]
type = ArrayDiffusion
variable = u
block = 0
diffusion_coefficient = dc
use_displaced_mesh = true
[]
[source]
type = ArrayCoupledForce
variable = u
v = v
coef = '1 2'
block = 0
use_displaced_mesh = true
[]
[]
[DGKernels]
[surface]
type = ArrayHFEMDiffusion
variable = u
lowerd_variable = lambda
use_displaced_mesh = true
[]
[]
[BCs]
[all]
type = ArrayVacuumBC
boundary = 'left right top bottom'
variable = u
use_displaced_mesh = true
[]
[]
[Materials]
[dc]
type = GenericConstantArray
prop_name = dc
prop_value = '1 1'
[]
[]
[Postprocessors]
[intu]
type = ElementIntegralArrayVariablePostprocessor
variable = u
block = 0
use_displaced_mesh = true
[]
[lambdanorm]
type = ElementArrayL2Norm
variable = lambda
block = INTERNAL_SIDE_LOWERD_SUBDOMAIN
use_displaced_mesh = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -snes_linesearch_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu basic mumps'
[]
[Outputs]
[out]
# we hide lambda because it may flip sign due to element
# renumbering with distributed mesh
type = Exodus
hide = lambda
[]
[]
(modules/porous_flow/test/tests/pressure_pulse/pressure_pulse_1d_MD.i)
# Pressure pulse in 1D with 1 phase - transient
# Using the "MD" formulation (where primary variable is log(mass-density
[Mesh]
type = GeneratedMesh
dim = 1
nx = 10
xmin = 0
xmax = 100
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Variables]
[md]
# initial porepressure = 2E6
# so initial md = log(density_P0) + porepressure/bulk_modulus =
initial_condition = 6.90875527898214
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = md
[]
[flux]
type = PorousFlowAdvectiveFlux
variable = md
gravity = '0 0 0'
fluid_component = 0
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'md'
number_fluid_phases = 1
number_fluid_components = 1
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 2e9
density0 = 1000
thermal_expansion = 0
viscosity = 1e-3
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
[]
[ppss]
type = PorousFlow1PhaseMD_Gaussian
mass_density = md
al = 1E-6 # this is irrelevant in this example
density_P0 = 1000
bulk_modulus = 2E9
[]
[massfrac]
type = PorousFlowMassFraction
[]
[simple_fluid]
type = PorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.1
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1E-15 0 0 0 1E-15 0 0 0 1E-15'
[]
[relperm]
type = PorousFlowRelativePermeabilityCorey
n = 0
phase = 0
[]
[]
[BCs]
[left]
type = DirichletBC
boundary = left
# BC porepressure = 3E6
# so boundary md = log(density_P0) + porepressure/bulk_modulus =
value = 6.90925527898214
variable = md
[]
[]
[Preconditioning]
[andy]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
dt = 1E3
end_time = 1E4
[]
[AuxVariables]
[pp]
[]
[]
[AuxKernels]
[pp]
type = ParsedAux
expression = '(md-6.9077552789821)*2.0E9'
coupled_variables = 'md'
variable = pp
[]
[]
[Postprocessors]
[p000]
type = PointValue
variable = pp
point = '0 0 0'
execute_on = 'initial timestep_end'
[]
[p010]
type = PointValue
variable = pp
point = '10 0 0'
execute_on = 'initial timestep_end'
[]
[p020]
type = PointValue
variable = pp
point = '20 0 0'
execute_on = 'initial timestep_end'
[]
[p030]
type = PointValue
variable = pp
point = '30 0 0'
execute_on = 'initial timestep_end'
[]
[p040]
type = PointValue
variable = pp
point = '40 0 0'
execute_on = 'initial timestep_end'
[]
[p050]
type = PointValue
variable = pp
point = '50 0 0'
execute_on = 'initial timestep_end'
[]
[p060]
type = PointValue
variable = pp
point = '60 0 0'
execute_on = 'initial timestep_end'
[]
[p070]
type = PointValue
variable = pp
point = '70 0 0'
execute_on = 'initial timestep_end'
[]
[p080]
type = PointValue
variable = pp
point = '80 0 0'
execute_on = 'initial timestep_end'
[]
[p090]
type = PointValue
variable = pp
point = '90 0 0'
execute_on = 'initial timestep_end'
[]
[p100]
type = PointValue
variable = pp
point = '100 0 0'
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
file_base = pressure_pulse_1d_MD
print_linear_residuals = false
csv = true
[]
(modules/geochemistry/test/tests/kernels/dispersion_1.i)
# Dispersion of a step-function front of concentration
# The initial condition is such that the theoretical result is exactly
# c = erf(x/sqrt(4*t*D)), where D = hydrodynamic_dispersion
#
# The finite mesh resolution and large time-step size means this is only achieved approximately (increasing nx and decreasing results in the error decreasing, but note the series approximation to the error function means that the error should never be exactly zero)
por = 2.0 # this is the porosity. The result should not depend on por in this example since it appears in both terms of the PDE
[Mesh]
type = GeneratedMesh
dim = 1
nx = 100
xmin = -5
xmax = 5
[]
[Variables]
[conc]
[]
[]
[ICs]
[spike]
type = FunctionIC
variable = conc
function = 'if(x<=0.0, -1.0, 1.0)'
[]
[]
[Kernels]
[dot]
type = GeochemistryTimeDerivative
porosity = ${por}
variable = conc
[]
[disp]
type = GeochemistryDispersion
variable = conc
porosity = ${por}
tensor_coeff = '0.3 0 0 0 0 0 0 0 0'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
dt = 0.5
end_time = 1.0
[]
[AuxVariables]
[expected]
[]
[should_be_zero]
[]
[]
[AuxKernels]
[expected]
type = FunctionAux
variable = expected
function = erf
[]
[should_be_zero]
type = ParsedAux
coupled_variables = 'expected conc'
expression = 'expected - conc'
variable = should_be_zero
[]
[]
[Postprocessors]
[error]
type = ElementL2Norm
variable = should_be_zero
[]
[]
[Functions]
[erf]
type = ParsedFunction
# series expansion for evaluating the error function
expression = 'xi := x / sqrt(4 * t * 0.3); expxi := exp(-xi * xi); if(x < 0.0, -1.0, if(x > 0.0, 1.0, 0.0)) * 2 / sqrt(pi) * sqrt(1 - expxi) * (sqrt(pi) / 2.0 + 31.0 * expxi / 200.0 - 341.0 * expxi * expxi / 8000.0)'
[]
[]
[Outputs]
exodus = true
execute_on = final
[]
(modules/porous_flow/test/tests/chemistry/dissolution_limited_2phase.i)
# Using a two-phase system (see dissolution_limited.i for the single-phase)
# The saturation and porosity are chosen so that the results are identical to dissolution_limited.i
#
# The dissolution reaction, with limited initial mineral concentration
#
# a <==> mineral
#
# produces "mineral". Using mineral_density = fluid_density, theta = 1 = eta, the DE is
#
# a' = -(mineral / (porosity * saturation))' = rate * surf_area * molar_vol (1 - (1 / eqm_const) * (act_coeff * a)^stoi)
#
# The following parameters are used
#
# T_ref = 0.5 K
# T = 1 K
# activation_energy = 3 J/mol
# gas_constant = 6 J/(mol K)
# kinetic_rate_at_ref_T = 0.60653 mol/(m^2 s)
# These give rate = 0.60653 * exp(1/2) = 1 mol/(m^2 s)
#
# surf_area = 0.5 m^2/L
# molar_volume = 2 L/mol
# These give rate * surf_area * molar_vol = 1 s^-1
#
# equilibrium_constant = 0.5 (dimensionless)
# primary_activity_coefficient = 2 (dimensionless)
# stoichiometry = 1 (dimensionless)
# This means that 1 - (1 / eqm_const) * (act_coeff * a)^stoi = 1 - 4 a, which is positive for a < 0.25, ie dissolution for a(t=0) < 0.25
#
# The solution of the DE is
# a = eqm_const / act_coeff + (a(t=0) - eqm_const / act_coeff) exp(-rate * surf_area * molar_vol * act_coeff * t / eqm_const)
# = 0.25 + (a(t=0) - 0.25) exp(-4 * t)
# c = c(t=0) - (a - a(t=0)) * porosity * saturation
#
# However, c(t=0) is small, so that the reaction only works until c=0, then a and c both remain fixed
#
# This test checks that (a + c / (porosity * saturation)) is time-independent, and that a follows the above solution, until c=0 and thereafter remains fixed.
#
# Aside:
# The exponential curve is not followed exactly because moose actually solves
# (a - a_old)/dt = rate * surf_area * molar_vol (1 - (1 / eqm_const) * (act_coeff * a)^stoi)
# which does not give an exponential exactly, except in the limit dt->0
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Variables]
[a]
initial_condition = 0.05
[]
[]
[AuxVariables]
[eqm_k]
initial_condition = 0.5
[]
[pressure0]
[]
[saturation1]
initial_condition = 0.25
[]
[b]
initial_condition = 0.123
[]
[ini_mineral_conc]
initial_condition = 0.015
[]
[mineral]
family = MONOMIAL
order = CONSTANT
[]
[should_be_static]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mineral]
type = PorousFlowPropertyAux
property = mineral_concentration
mineral_species = 0
variable = mineral
[]
[should_be_static]
type = ParsedAux
coupled_variables = 'mineral a'
expression = 'a + mineral / 0.1'
variable = should_be_static
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Kernels]
[mass_a]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = a
[]
[pre_dis]
type = PorousFlowPreDis
variable = a
mineral_density = 1000
stoichiometry = 1
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = a
number_fluid_phases = 2
number_fluid_components = 2
number_aqueous_kinetic = 1
aqueous_phase_number = 1
[]
[pc]
type = PorousFlowCapillaryPressureConst
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 2e9 # huge, so mimic chemical_reactions
density0 = 1000
thermal_expansion = 0
viscosity = 1e-3
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = 1
[]
[ppss]
type = PorousFlow2PhasePS
capillary_pressure = pc
phase0_porepressure = pressure0
phase1_saturation = saturation1
[]
[mass_frac]
type = PorousFlowMassFraction
mass_fraction_vars = 'b a'
[]
[predis]
type = PorousFlowAqueousPreDisChemistry
primary_concentrations = a
num_reactions = 1
equilibrium_constants = eqm_k
primary_activity_coefficients = 2
reactions = 1
specific_reactive_surface_area = 0.5
kinetic_rate_constant = 0.6065306597126334
activation_energy = 3
molar_volume = 2
gas_constant = 6
reference_temperature = 0.5
[]
[mineral_conc]
type = PorousFlowAqueousPreDisMineral
initial_concentrations = ini_mineral_conc
[]
[simple_fluid0]
type = PorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[simple_fluid1]
type = PorousFlowSingleComponentFluid
fp = simple_fluid
phase = 1
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.4
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
nl_abs_tol = 1E-10
dt = 0.01
end_time = 1
[]
[Postprocessors]
[a]
type = PointValue
point = '0 0 0'
variable = a
[]
[should_be_static]
type = PointValue
point = '0 0 0'
variable = should_be_static
[]
[]
[Outputs]
time_step_interval = 10
csv = true
perf_graph = true
[]
(modules/porous_flow/examples/multiapp_fracture_flow/3dFracture/fracture_only_aperture_changing.i)
# Cold water injection into one side of the fracture network, and production from the other side
injection_rate = 10 # kg/s
[Mesh]
uniform_refine = 0
[cluster34]
type = FileMeshGenerator
file = 'Cluster_34.exo'
[]
[injection_node]
type = BoundingBoxNodeSetGenerator
input = cluster34
bottom_left = '-1000 0 -1000'
top_right = '1000 0.504 1000'
new_boundary = injection_node
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 -9.81E-6' # Note the value, because of pressure_unit
[]
[Variables]
[frac_P]
scaling = 1E6
[]
[frac_T]
initial_condition = 473
[]
[]
[ICs]
[frac_P]
type = FunctionIC
variable = frac_P
function = insitu_pp
[]
[]
[PorousFlowFullySaturated]
coupling_type = ThermoHydro
porepressure = frac_P
temperature = frac_T
fp = water
pressure_unit = MPa
[]
[Kernels]
[toMatrix]
type = PorousFlowHeatMassTransfer
variable = frac_T
v = transferred_matrix_T
transfer_coefficient = heat_transfer_coefficient
save_in = joules_per_s
[]
[]
[AuxVariables]
[heat_transfer_coefficient]
family = MONOMIAL
order = CONSTANT
initial_condition = 0.0
[]
[transferred_matrix_T]
initial_condition = 473
[]
[joules_per_s]
[]
[normal_dirn_x]
family = MONOMIAL
order = CONSTANT
[]
[normal_dirn_y]
family = MONOMIAL
order = CONSTANT
[]
[normal_dirn_z]
family = MONOMIAL
order = CONSTANT
[]
[enclosing_element_normal_length]
family = MONOMIAL
order = CONSTANT
[]
[enclosing_element_normal_thermal_cond]
family = MONOMIAL
order = CONSTANT
[]
[aperture]
family = MONOMIAL
order = CONSTANT
[]
[perm_times_app]
family = MONOMIAL
order = CONSTANT
[]
[density]
family = MONOMIAL
order = CONSTANT
[]
[viscosity]
family = MONOMIAL
order = CONSTANT
[]
[insitu_pp]
[]
[]
[AuxKernels]
[normal_dirn_x_auxk]
type = PorousFlowElementNormal
variable = normal_dirn_x
component = x
[]
[normal_dirn_y]
type = PorousFlowElementNormal
variable = normal_dirn_y
component = y
[]
[normal_dirn_z]
type = PorousFlowElementNormal
variable = normal_dirn_z
component = z
[]
[heat_transfer_coefficient_auxk]
type = ParsedAux
variable = heat_transfer_coefficient
coupled_variables = 'enclosing_element_normal_length enclosing_element_normal_thermal_cond'
constant_names = h_s
constant_expressions = 1E3 # should be much bigger than thermal_conductivity / L ~ 1
expression = 'if(enclosing_element_normal_length = 0, 0, h_s * enclosing_element_normal_thermal_cond * 2 * enclosing_element_normal_length / (h_s * enclosing_element_normal_length * enclosing_element_normal_length + enclosing_element_normal_thermal_cond * 2 * enclosing_element_normal_length))'
[]
[aperture]
type = PorousFlowPropertyAux
variable = aperture
property = porosity
[]
[perm_times_app]
type = PorousFlowPropertyAux
variable = perm_times_app
property = permeability
row = 0
column = 0
[]
[density]
type = PorousFlowPropertyAux
variable = density
property = density
phase = 0
[]
[viscosity]
type = PorousFlowPropertyAux
variable = viscosity
property = viscosity
phase = 0
[]
[insitu_pp]
type = FunctionAux
execute_on = initial
variable = insitu_pp
function = insitu_pp
[]
[]
[BCs]
[inject_heat]
type = DirichletBC
boundary = injection_node
variable = frac_T
value = 373
[]
[]
[DiracKernels]
[inject_fluid]
type = PorousFlowPointSourceFromPostprocessor
mass_flux = ${injection_rate}
point = '58.8124 0.50384 74.7838'
variable = frac_P
[]
[withdraw_fluid]
type = PorousFlowPeacemanBorehole
SumQuantityUO = kg_out_uo
bottom_p_or_t = 10.6 # 1MPa + approx insitu at production point, to prevent aperture closing due to low porepressures
character = 1
line_length = 1
point_file = production.xyz
unit_weight = '0 0 0'
fluid_phase = 0
use_mobility = true
variable = frac_P
[]
[withdraw_heat]
type = PorousFlowPeacemanBorehole
SumQuantityUO = J_out_uo
bottom_p_or_t = 10.6 # 1MPa + approx insitu at production point, to prevent aperture closing due to low porepressures
character = 1
line_length = 1
point_file = production.xyz
unit_weight = '0 0 0'
fluid_phase = 0
use_mobility = true
use_enthalpy = true
variable = frac_T
[]
[]
[UserObjects]
[kg_out_uo]
type = PorousFlowSumQuantity
[]
[J_out_uo]
type = PorousFlowSumQuantity
[]
[]
[FluidProperties]
[true_water]
type = Water97FluidProperties
[]
[water]
type = TabulatedBicubicFluidProperties
fp = true_water
temperature_min = 275 # K
temperature_max = 600
interpolated_properties = 'density viscosity enthalpy internal_energy'
fluid_property_file = water97_tabulated.csv
[]
[]
[Materials]
[porosity]
type = PorousFlowPorosityLinear
porosity_ref = 1E-4 # fracture porosity = 1.0, but must include fracture aperture of 1E-4 at P = insitu_pp
P_ref = insitu_pp
P_coeff = 1E-3 # this is in metres/MPa, ie for P_ref = 1/P_coeff, the aperture becomes 1 metre
porosity_min = 1E-5
[]
[permeability]
type = PorousFlowPermeabilityKozenyCarman
k0 = 1E-15 # fracture perm = 1E-11 m^2, but must include fracture aperture of 1E-4
poroperm_function = kozeny_carman_phi0
m = 0
n = 3
phi0 = 1E-4
[]
[internal_energy]
type = PorousFlowMatrixInternalEnergy
density = 2700 # kg/m^3
specific_heat_capacity = 0 # basically no rock inside the fracture
[]
[aq_thermal_conductivity]
type = PorousFlowThermalConductivityIdeal
dry_thermal_conductivity = '0.6E-4 0 0 0 0.6E-4 0 0 0 0.6E-4' # thermal conductivity of water times fracture aperture. This should increase linearly with aperture, but is set constant in this model
[]
[]
[Functions]
[kg_rate]
type = ParsedFunction
symbol_values = 'dt kg_out'
symbol_names = 'dt kg_out'
expression = 'kg_out/dt'
[]
[insitu_pp]
type = ParsedFunction
expression = '10 - 0.847E-2 * z' # Approximate hydrostatic in MPa
[]
[]
[Postprocessors]
[dt]
type = TimestepSize
outputs = 'none'
[]
[kg_out]
type = PorousFlowPlotQuantity
uo = kg_out_uo
[]
[kg_per_s]
type = FunctionValuePostprocessor
function = kg_rate
[]
[J_out]
type = PorousFlowPlotQuantity
uo = J_out_uo
[]
[TK_out]
type = PointValue
variable = frac_T
point = '101.705 160.459 39.5722'
[]
[P_out]
type = PointValue
variable = frac_P
point = '101.705 160.459 39.5722'
[]
[P_in]
type = PointValue
variable = frac_P
point = '58.8124 0.50384 74.7838'
[]
[]
[VectorPostprocessors]
[heat_transfer_rate]
type = NodalValueSampler
outputs = none
sort_by = id
variable = joules_per_s
[]
[]
[Preconditioning]
[entire_jacobian]
type = SMP
full = true
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
petsc_options_value = ' asm lu NONZERO 2 '
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
[TimeStepper]
type = IterationAdaptiveDT
dt = 1
optimal_iterations = 10
growth_factor = 1.5
[]
dtmax = 1E8
end_time = 1E8
nl_abs_tol = 1E-3
nl_max_its = 20
[]
[Outputs]
print_linear_residuals = false
csv = true
[ex]
type = Exodus
sync_times = '1 10 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000 2100 2200 2300 2400 2500 2600 2700 2800 2900 3000 3100 3200 3300 3400 3500 3600 3700 3800 3900 4000 4100 4200 4300 4400 4500 4600 4700 4800 4900 5000 5100 5200 5300 5400 5500 5600 5700 5800 5900 6000 6100 6200 6300 6400 6500 6600 6700 6800 6900 7000 7100 7200 7300 7400 7500 7600 7700 7800 7900 8000 8100 8200 8300 8400 8500 8600 8700 8800 8900 9000 10000 11000 12000 13000 14000 15000 16000 17000 18000 19000 20000 30000 50000 70000 100000 200000 300000 400000 500000 600000 700000 800000 900000 1000000 1100000 1200000 1300000 1400000 1500000 1600000 1700000 1800000 1900000 2000000 2100000 2200000 2300000 2400000 2500000 2600000 2700000 2800000 2900000'
sync_only = true
[]
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/natural_convection/natural_circulation_pipe.i)
# natural convection through a pipe
# Reference solution in "reference_pipe_natural_convection.py"
# Reference mdot: 0.0792 kg/s
# this input
# iy mdot
# 10 8.302364e-02
# 20 8.111192e-02
# 40 8.007924e-02
# 80 7.954403e-02
# 160 7.927201e-02
# Convergence to the analytical result is observed
height = 10.0
gravity = 9.81
p0 = 1e5
molar_mass = 29.0e-3
T0 = 328
Ru = 8.3145
Ri = '${fparse Ru / molar_mass}'
density = '${fparse p0 / (Ri * T0)}'
head = '${fparse height * density * gravity}'
k = 25.68e-3
gamma = 1.4
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '0.1'
ix = '2'
dy = '${height}'
iy = '5'
[]
[]
[GlobalParams]
rhie_chow_user_object = pins_rhie_chow_interpolator
[]
[FluidProperties]
[air]
type = IdealGasFluidProperties
molar_mass = ${molar_mass}
k = ${k}
gamma = ${gamma}
[]
[]
[Modules]
[NavierStokesFV]
compressibility = 'weakly-compressible'
add_energy_equation = true
gravity = '0 -${gravity} 0'
density = rho
dynamic_viscosity = mu
specific_heat = cp
thermal_conductivity = k
initial_velocity = '0 1e-6 0'
initial_pressure = ${p0}
initial_temperature = ${T0}
inlet_boundaries = 'bottom'
momentum_inlet_types = 'fixed-pressure'
momentum_inlet_function = '${fparse p0 + head}'
energy_inlet_types = 'fixed-temperature'
energy_inlet_function = '${T0}'
energy_scaling = 1e-5
wall_boundaries = 'left right'
momentum_wall_types = 'slip slip'
energy_wall_types = 'heatflux heatflux'
energy_wall_function = '300 300'
outlet_boundaries = 'top'
momentum_outlet_types = 'fixed-pressure'
pressure_function = '${fparse p0}'
momentum_advection_interpolation = 'upwind'
mass_advection_interpolation = 'upwind'
porous_medium_treatment = true
porosity = porosity
energy_advection_interpolation = 'average'
[]
[]
[FVKernels]
[u_friction]
type = INSFVMomentumFriction
variable = superficial_vel_x
linear_coef_name = linear_friction_coeff
momentum_component = 'x'
[]
[v_friction]
type = INSFVMomentumFriction
variable = superficial_vel_y
linear_coef_name = linear_friction_coeff
momentum_component = 'y'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-6
end_time = 1e4
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.1
growth_factor = 2
iteration_window = 2
optimal_iterations = 6
[]
[]
[Functions]
[mu_rampdown_fn]
type = PiecewiseLinear
x = '0 0.5 1 5 10 100 1000 2000'
y = '1000 1000 100 10 1 1 1 0'
[]
[]
[FunctorMaterials]
[fluid_props_to_mat_props]
type = GeneralFunctorFluidProps
fp = air
pressure = pressure
T_fluid = T_fluid
speed = speed
force_define_density = true
mu_rampdown = 'mu_rampdown_fn'
characteristic_length = 1
porosity = porosity
[]
[scalar_props]
type = ADGenericFunctorMaterial
prop_names = 'porosity loss_coeff'
prop_values = '1 1.3'
[]
[linear_friction_coeff]
type = ADParsedFunctorMaterial
property_name = 'linear_friction_coeff'
expression = 'loss_coeff * rho'
functor_names = 'loss_coeff rho'
[]
[]
[AuxVariables]
[rho_var]
type = MooseVariableFVReal
[]
[cp_var]
type = MooseVariableFVReal
[]
[rho_cp_T_fluid_var]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[rho_var_aux]
type = FunctorAux
variable = rho_var
functor = rho
[]
[cp_var_aux]
type = FunctorAux
variable = cp_var
functor = cp
[]
[rho_cp_T_fluid_var_aux]
type = ParsedAux
variable = rho_cp_T_fluid_var
coupled_variables = 'rho_var cp_var T_fluid'
expression = 'rho_var * cp_var * T_fluid'
[]
[]
[Postprocessors]
[inlet_mfr]
type = VolumetricFlowRate
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = rho
boundary = bottom
advected_interp_method = average
[]
[outlet_mfr]
type = VolumetricFlowRate
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = rho
boundary = top
advected_interp_method = average
[]
[inlet_energy]
type = VolumetricFlowRate
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = rho_cp_T_fluid_var
boundary = bottom
advected_interp_method = average
[]
[outlet_energy]
type = VolumetricFlowRate
vel_x = superficial_vel_x
vel_y = superficial_vel_y
advected_quantity = rho_cp_T_fluid_var
boundary = top
advected_interp_method = average
[]
[]
[Debug]
show_var_residual_norms = true
[]
[Outputs]
exodus = true
[]
(modules/functional_expansion_tools/examples/2D_volumetric_Cartesian/sub.i)
# Basic example coupling a master and sub app in a 2D Cartesian volume.
#
# The master app provides field values to the sub app via Functional Expansions, which then performs
# its calculations. The sub app's solution field values are then transferred back to the master app
# and coupled into the solution of the master app solution.
#
# This example couples Functional Expansions via AuxVariable.
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0.0
xmax = 10.0
nx = 15
ymin = 1.0
ymax = 11.0
ny = 25
[]
# Non-copy transfers only work with AuxVariable, but nothing will be solved without a variable
# defined. The solution is to define an empty variable tha does nothing, but causes MOOSE to solve
# the AuxKernels that we need.
[Variables]
[./empty]
[../]
[]
[AuxVariables]
[./s]
order = FIRST
family = LAGRANGE
[../]
[./m_in]
order = FIRST
family = LAGRANGE
[../]
[]
# We must have a kernel for every variable, hence this null kernel to match the variable 'empty'
[Kernels]
[./null_kernel]
type = NullKernel
variable = empty
[../]
[]
[AuxKernels]
[./reconstruct_m_in]
type = FunctionSeriesToAux
function = FX_Basis_Value_Sub
variable = m_in
[../]
[./calculate_s] # Something to make 's' change each time, but allow a converging solution
type = ParsedAux
variable = s
coupled_variables = m_in
expression = '2*exp(-m_in/0.8)'
[../]
[]
[Functions]
[./FX_Basis_Value_Sub]
type = FunctionSeries
series_type = Cartesian
orders = '3 4'
physical_bounds = '0.0 10.0 1.0 11.0'
x = Legendre
y = Legendre
[../]
[]
[UserObjects]
[./FX_Value_UserObject_Sub]
type = FXVolumeUserObject
function = FX_Basis_Value_Sub
variable = s
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 0.5
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(modules/combined/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/porous_flow/test/tests/poro_elasticity/mandel_fully_saturated_volume.i)
# Mandel's problem of consolodation of a drained medium
# Using the FullySaturatedDarcyBase and FullySaturatedFullySaturatedMassTimeDerivative kernels
# with multiply_by_density = false, so that this problem becomes linear
#
# A sample is in plane strain.
# -a <= x <= a
# -b <= y <= b
# It is squashed with constant force by impermeable, frictionless plattens on its top and bottom surfaces (at y=+/-b)
# Fluid is allowed to leak out from its sides (at x=+/-a)
# The porepressure within the sample is monitored.
#
# As is common in the literature, this is simulated by
# considering the quarter-sample, 0<=x<=a and 0<=y<=b, with
# impermeable, roller BCs at x=0 and y=0 and y=b.
# Porepressure is fixed at zero on x=a.
# Porepressure and displacement are initialised to zero.
# Then the top (y=b) is moved downwards with prescribed velocity,
# so that the total force that is inducing this downwards velocity
# is fixed. The velocity is worked out by solving Mandel's problem
# analytically, and the total force is monitored in the simulation
# to check that it indeed remains constant.
#
# Here are the problem's parameters, and their values:
# Soil width. a = 1
# Soil height. b = 0.1
# Soil's Lame lambda. la = 0.5
# Soil's Lame mu, which is also the Soil's shear modulus. mu = G = 0.75
# Soil bulk modulus. K = la + 2*mu/3 = 1
# Drained Poisson ratio. nu = (3K - 2G)/(6K + 2G) = 0.2
# Soil bulk compliance. 1/K = 1
# Fluid bulk modulus. Kf = 8
# Fluid bulk compliance. 1/Kf = 0.125
# Soil initial porosity. phi0 = 0.1
# Biot coefficient. alpha = 0.6
# Biot modulus. M = 1/(phi0/Kf + (alpha - phi0)(1 - alpha)/K) = 4.705882
# Undrained bulk modulus. Ku = K + alpha^2*M = 2.694118
# Undrained Poisson ratio. nuu = (3Ku - 2G)/(6Ku + 2G) = 0.372627
# Skempton coefficient. B = alpha*M/Ku = 1.048035
# Fluid mobility (soil permeability/fluid viscosity). k = 1.5
# Consolidation coefficient. c = 2*k*B^2*G*(1-nu)*(1+nuu)^2/9/(1-nuu)/(nuu-nu) = 3.821656
# Normal stress on top. F = 1
#
# The solution for porepressure and displacements is given in
# AHD Cheng and E Detournay "A direct boundary element method for plane strain poroelasticity" International Journal of Numerical and Analytical Methods in Geomechanics 12 (1988) 551-572.
# The solution involves complicated infinite series, so I shall not write it here
[Mesh]
type = GeneratedMesh
dim = 3
nx = 10
ny = 1
nz = 1
xmin = 0
xmax = 1
ymin = 0
ymax = 0.1
zmin = 0
zmax = 1
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
PorousFlowDictator = dictator
block = 0
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'porepressure disp_x disp_y disp_z'
number_fluid_phases = 1
number_fluid_components = 1
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[porepressure]
[]
[]
[BCs]
[roller_xmin]
type = DirichletBC
variable = disp_x
value = 0
boundary = 'left'
[]
[roller_ymin]
type = DirichletBC
variable = disp_y
value = 0
boundary = 'bottom'
[]
[plane_strain]
type = DirichletBC
variable = disp_z
value = 0
boundary = 'back front'
[]
[xmax_drained]
type = DirichletBC
variable = porepressure
value = 0
boundary = right
[]
[top_velocity]
type = FunctionDirichletBC
variable = disp_y
function = top_velocity
boundary = top
[]
[]
[Functions]
[top_velocity]
type = PiecewiseLinear
x = '0 0.002 0.006 0.014 0.03 0.046 0.062 0.078 0.094 0.11 0.126 0.142 0.158 0.174 0.19 0.206 0.222 0.238 0.254 0.27 0.286 0.302 0.318 0.334 0.35 0.366 0.382 0.398 0.414 0.43 0.446 0.462 0.478 0.494 0.51 0.526 0.542 0.558 0.574 0.59 0.606 0.622 0.638 0.654 0.67 0.686 0.702'
y = '-0.041824842 -0.042730269 -0.043412712 -0.04428867 -0.045509181 -0.04645965 -0.047268246 -0.047974749 -0.048597109 -0.0491467 -0.049632388 -0.050061697 -0.050441198 -0.050776675 -0.051073238 -0.0513354 -0.051567152 -0.051772022 -0.051953128 -0.052113227 -0.052254754 -0.052379865 -0.052490464 -0.052588233 -0.052674662 -0.052751065 -0.052818606 -0.052878312 -0.052931093 -0.052977751 -0.053018997 -0.053055459 -0.053087691 -0.053116185 -0.053141373 -0.05316364 -0.053183324 -0.053200724 -0.053216106 -0.053229704 -0.053241725 -0.053252351 -0.053261745 -0.053270049 -0.053277389 -0.053283879 -0.053289615'
[]
[]
[AuxVariables]
[stress_yy]
order = CONSTANT
family = MONOMIAL
[]
[tot_force]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[stress_yy]
type = RankTwoAux
rank_two_tensor = stress
variable = stress_yy
index_i = 1
index_j = 1
[]
[tot_force]
type = ParsedAux
coupled_variables = 'stress_yy porepressure'
execute_on = timestep_end
variable = tot_force
expression = '-stress_yy+0.6*porepressure'
[]
[]
[Kernels]
[grad_stress_x]
type = StressDivergenceTensors
variable = disp_x
component = 0
[]
[grad_stress_y]
type = StressDivergenceTensors
variable = disp_y
component = 1
[]
[grad_stress_z]
type = StressDivergenceTensors
variable = disp_z
component = 2
[]
[poro_x]
type = PorousFlowEffectiveStressCoupling
biot_coefficient = 0.6
variable = disp_x
component = 0
[]
[poro_y]
type = PorousFlowEffectiveStressCoupling
biot_coefficient = 0.6
variable = disp_y
component = 1
[]
[poro_z]
type = PorousFlowEffectiveStressCoupling
biot_coefficient = 0.6
component = 2
variable = disp_z
[]
[mass0]
type = PorousFlowFullySaturatedMassTimeDerivative
biot_coefficient = 0.6
multiply_by_density = false
coupling_type = HydroMechanical
variable = porepressure
[]
[flux]
type = PorousFlowFullySaturatedDarcyBase
multiply_by_density = false
variable = porepressure
gravity = '0 0 0'
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 8
density0 = 1
thermal_expansion = 0
viscosity = 1
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
[]
[elasticity_tensor]
type = ComputeElasticityTensor
C_ijkl = '0.5 0.75'
# bulk modulus is lambda + 2*mu/3 = 0.5 + 2*0.75/3 = 1
fill_method = symmetric_isotropic
[]
[strain]
type = ComputeSmallStrain
[]
[stress]
type = ComputeLinearElasticStress
[]
[eff_fluid_pressure_qp]
type = PorousFlowEffectiveFluidPressure
[]
[vol_strain]
type = PorousFlowVolumetricStrain
[]
[ppss]
type = PorousFlow1PhaseFullySaturated
porepressure = porepressure
[]
[massfrac]
type = PorousFlowMassFraction
[]
[simple_fluid_qp]
type = PorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[porosity]
type = PorousFlowPorosityConst # only the initial value of this is ever used
porosity = 0.1
[]
[biot_modulus]
type = PorousFlowConstantBiotModulus
biot_coefficient = 0.6
solid_bulk_compliance = 1
fluid_bulk_modulus = 8
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1.5 0 0 0 1.5 0 0 0 1.5'
[]
[]
[Postprocessors]
[p0]
type = PointValue
outputs = csv
point = '0.0 0 0'
variable = porepressure
[]
[p1]
type = PointValue
outputs = csv
point = '0.1 0 0'
variable = porepressure
[]
[p2]
type = PointValue
outputs = csv
point = '0.2 0 0'
variable = porepressure
[]
[p3]
type = PointValue
outputs = csv
point = '0.3 0 0'
variable = porepressure
[]
[p4]
type = PointValue
outputs = csv
point = '0.4 0 0'
variable = porepressure
[]
[p5]
type = PointValue
outputs = csv
point = '0.5 0 0'
variable = porepressure
[]
[p6]
type = PointValue
outputs = csv
point = '0.6 0 0'
variable = porepressure
[]
[p7]
type = PointValue
outputs = csv
point = '0.7 0 0'
variable = porepressure
[]
[p8]
type = PointValue
outputs = csv
point = '0.8 0 0'
variable = porepressure
[]
[p9]
type = PointValue
outputs = csv
point = '0.9 0 0'
variable = porepressure
[]
[p99]
type = PointValue
outputs = csv
point = '1 0 0'
variable = porepressure
[]
[xdisp]
type = PointValue
outputs = csv
point = '1 0.1 0'
variable = disp_x
[]
[ydisp]
type = PointValue
outputs = csv
point = '1 0.1 0'
variable = disp_y
[]
[total_downwards_force]
type = ElementAverageValue
outputs = csv
variable = tot_force
[]
[dt]
type = FunctionValuePostprocessor
outputs = console
function = if(0.15*t<0.01,0.15*t,0.01)
[]
[]
[Preconditioning]
[andy]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -snes_atol -snes_rtol -snes_max_it'
petsc_options_value = 'gmres asm lu 1E-14 1E-10 10000'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
start_time = 0
end_time = 0.7
[TimeStepper]
type = PostprocessorDT
postprocessor = dt
dt = 0.001
[]
[]
[Outputs]
execute_on = 'timestep_end'
file_base = mandel_fully_saturated_volume
[csv]
time_step_interval = 3
type = CSV
[]
[]
(modules/optimization/test/tests/userobjects/adjoint_solution/forward.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
[]
[]
[AuxVariables/u]
[]
[AuxKernels]
[u_aux]
type = ParsedAux
variable = u
expression = '(x + y) * t'
use_xyzt = true
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Transient
dt = 1
end_time = 10
[]
[Outputs]
exodus = true
[]
(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
[]
[]
(test/tests/functormaterials/smoother/test.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 100
ny = 1
xmax = 10
ymax = 1
[]
[]
[AuxVariables]
[checkerboard]
type = MooseVariableFVReal
[]
[smooth]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[checker]
type = ParsedAux
variable = checkerboard
# nonlinear growth to challenge the smoother a bit
expression = '2 + x * x * sin(PI * 10 * x)'
constant_names = 'PI'
constant_expressions = '3.14159265359'
use_xyzt = true
execute_on = 'TIMESTEP_BEGIN'
[]
[smooth]
type = FunctorAux
variable = smooth
functor = 'smoothed_functor'
execute_on = 'TIMESTEP_END'
[]
[]
[FunctorMaterials]
[smooth]
type = FunctorSmoother
functors_in = 'checkerboard'
functors_out = 'smoothed_functor'
# Using the face values will not smooth a checkerboard because the 'extreme' neighbor value are
# mixed with the element value
# Using the layered element average will smooth a checkerboard in 2D inside the volume, and fail to do so
# near the boundaries. In 1D it wont fix a checkboard as it does not average with the local value
# smoothing_technique = 'layered_elem_average'
smoothing_technique = 'remove_checkerboard'
# smoothing_technique = 'face_average'
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
[VectorPostprocessors]
[line]
type = LineValueSampler
variable = 'smooth'
num_points = 100
start_point = '0.05 0.5 0'
end_point = '9.95 0.5 0'
sort_by = 'x'
[]
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
[]
(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/general_field/user_object/duplicated_user_object_tests/restricted_elem_sub.i)
# yy is passed in from the parent app
[Mesh]
[line]
type = GeneratedMeshGenerator
dim = 1
nx = 4
xmax = 2
[]
[box]
type = SubdomainBoundingBoxGenerator
input = line
bottom_left = '0 -0.1 -0.1'
top_right = '1 0.1 0.1'
# need a different block ID than what is in the parent app to make sure the transfer works properly
block_id = 20
[]
[]
[AuxVariables]
[A]
family = MONOMIAL
order = CONSTANT
[]
[S]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[A_ak]
type = ParsedAux
variable = A
use_xyzt = true
expression = '2*x+4*${yy}'
execute_on = 'TIMESTEP_BEGIN'
[]
[]
[Variables]
[u]
[]
[]
[Kernels]
[td]
type = TimeDerivative
variable = u
[]
[diff]
type = Diffusion
variable = u
[]
[]
[UserObjects]
[A_avg]
type = LayeredAverage
block = 20
num_layers = 2
direction = x
variable = A
execute_on = TIMESTEP_END
[]
[]
[Executioner]
type = Transient
[]
[Outputs]
exodus = true
[]
(modules/geochemistry/test/tests/kinetics/quartz_deposition.i)
# Example of quartz deposition in a fracture, as the temperature is reduced from 300degC to 25degC
# The initial free molality of SiO2(aq) is determined using quartz_equilibrium_at300degC
[GlobalParams]
point = '0 0 0'
[]
[TimeDependentReactionSolver]
model_definition = definition
geochemistry_reactor_name = reactor
charge_balance_species = "Cl-"
constraint_species = "H2O Na+ Cl- SiO2(aq)"
constraint_value = " 1.0 1E-10 1E-10 0.009722905"
constraint_meaning = "kg_solvent_water bulk_composition bulk_composition free_concentration"
constraint_unit = " kg moles moles molal"
initial_temperature = 300.0
temperature = temp_controller
kinetic_species_name = Quartz
kinetic_species_initial_value = 400
kinetic_species_unit = g
ramp_max_ionic_strength_initial = 0 # max_ionic_strength in such a simple problem does not need ramping
add_aux_pH = false # there is no H+ in this system
evaluate_kinetic_rates_always = true # implicit time-marching used for stability
execute_console_output_on = '' # only CSV output used in this example
[]
[UserObjects]
[rate_quartz]
type = GeochemistryKineticRate
kinetic_species_name = Quartz
intrinsic_rate_constant = 7.4112E2 # 2.35E-5mol/s/cm^2 = 7.411E2mol/yr/cm^2
multiply_by_mass = true
area_quantity = 1
activation_energy = 72800.0
[]
[definition]
type = GeochemicalModelDefinition
database_file = "../../../database/moose_geochemdb.json"
basis_species = "H2O SiO2(aq) Na+ Cl-"
kinetic_minerals = "Quartz"
kinetic_rate_descriptions = "rate_quartz"
[]
[]
[Executioner]
type = Transient
dt = 0.02
end_time = 1 # measured in years
[]
[AuxVariables]
[temp_controller]
[]
[diss_rate]
[]
[]
[AuxKernels]
[temp_controller_auxk]
type = FunctionAux
function = '300 - 275 * t'
variable = temp_controller
execute_on = 'timestep_begin'
[]
[diss_rate]
type = ParsedAux
coupled_variables = mol_change_Quartz
expression = '-mol_change_Quartz / 0.02' # 0.02 = timestep size
variable = diss_rate
[]
[]
[Postprocessors]
[mg_per_kg_sio2]
type = PointValue
variable = "mg_per_kg_SiO2(aq)"
[]
[rate_mole_per_year]
type = PointValue
variable = diss_rate
[]
[temperature]
type = PointValue
variable = "solution_temperature"
[]
[]
[Outputs]
csv = true
[]
(test/tests/transfers/general_field/user_object/duplicated_user_object_tests/restricted_elem_parent.i)
num_layers = 2
[Mesh]
[box]
type = GeneratedMeshGenerator
dim = 3
nx = ${num_layers}
ny = 3
nz = 3
[]
[]
[Variables]
[u]
[]
[]
[Kernels]
[td]
type = TimeDerivative
variable = u
[]
[diff]
type = Diffusion
variable = u
[]
[]
[AuxVariables]
[a]
family = MONOMIAL
order = CONSTANT
[]
[s]
[]
[]
[AuxKernels]
[s_ak]
type = ParsedAux
variable = s
use_xyzt = true
expression = 'x+(z*z)'
[]
[]
[Functions]
[]
[Postprocessors]
[a_avg]
type = ElementAverageValue
variable = a
[]
[]
[UserObjects]
[S_avg_front]
type = LayeredSideAverage
boundary = front
variable = s
num_layers = ${num_layers}
direction = x
[]
[S_avg_back]
type = LayeredSideAverage
boundary = back
variable = s
num_layers = ${num_layers}
direction = x
[]
[]
[MultiApps]
[ch0]
type = TransientMultiApp
input_files = 'restricted_elem_sub.i'
bounding_box_padding = '0 0.5 1'
positions = '0 0.5 -0.1'
output_in_position = true
cli_args = 'yy=0'
[]
[ch1]
type = TransientMultiApp
input_files = 'restricted_elem_sub.i'
bounding_box_padding = '0 0.5 1'
positions = '0 0.5 1.1'
output_in_position = true
cli_args = 'yy=1'
[]
[]
[Transfers]
[from_ch0]
type = MultiAppGeneralFieldUserObjectTransfer
to_boundaries = back
from_multi_app = ch0
variable = a
source_user_object = A_avg
# Bounding box padding is not obeyed
fixed_bounding_box_size = '0 1 1.5'
from_app_must_contain_point = false
[]
[from_ch1]
type = MultiAppGeneralFieldUserObjectTransfer
to_boundaries = front
from_multi_app = ch1
variable = a
source_user_object = A_avg
fixed_bounding_box_size = '0 1 1.5'
from_app_must_contain_point = false
[]
[to_ch0]
type = MultiAppGeneralFieldUserObjectTransfer
to_blocks = 20
to_multi_app = ch0
variable = S
source_user_object = S_avg_back
fixed_bounding_box_size = '0 1 1.5'
from_app_must_contain_point = false
[]
[to_ch1]
type = MultiAppGeneralFieldUserObjectTransfer
to_blocks = 20
to_multi_app = ch1
variable = S
source_user_object = S_avg_front
fixed_bounding_box_size = '0 1 1.5'
from_app_must_contain_point = false
[]
[]
[Executioner]
type = Transient
num_steps = 2
dt = 1
nl_abs_tol = 1e-7
[]
[Outputs]
exodus = true
[]
(modules/chemical_reactions/test/tests/thermochimica/MoRu_subblock.i)
[Mesh]
[two_blocks]
type = CartesianMeshGenerator
dim = 2
dx = '0.5 1.0'
dy = '1.0'
ix = '5 5'
iy = '5'
subdomain_id = '0 1'
[]
[]
[ChemicalComposition]
tunit = K
punit = atm
munit = moles
is_fv = true
temperature = T
[block_0]
block = '0'
elements = 'Mo Ru'
thermofile = Kaye_NobleMetals.dat
output_phases = 'BCCN HCPN'
output_species = 'BCCN:Mo'
is_fv = false
output_species_unit = mole_fraction
[]
[block_1]
block = '1'
elements = 'Fe O'
thermofile = FeTiVO.dat
output_phases = 'gas_ideal'
output_species = 'SlagBsoln:Fe2O3'
output_species_unit = moles
[]
[]
[ICs]
[Mo]
type = FunctionIC
variable = Mo
function = '0.8*(1-x)+4.3*x'
block = '0'
[]
[Ru]
type = FunctionIC
variable = Ru
function = '0.2*(1-x)+4.5*x'
block = '0'
[]
[O]
type = FunctionIC
variable = O
function = '2.0*(1-x)+1.6*x'
block = '1'
[]
[Fe]
type = FunctionIC
variable = Fe
function = '0.5*(1-x)+0.25*x'
block = '1'
[]
[]
[AuxVariables]
[T]
type = MooseVariable
[]
[]
[AuxKernels]
[T]
type = ParsedAux
variable = T
use_xyzt = true
expression = '1250.0+1000.0*(x/1.5)'
execute_on = 'INITIAL'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
[]