- sort_byWhat to sort the samples by
C++ Type:MooseEnum
Controllable:No
Description:What to sort the samples by
- variableThe names of the variables that this VectorPostprocessor operates on
C++ Type:std::vector<VariableName>
Controllable:No
Description:The names of the variables that this VectorPostprocessor operates on
ElementValueSampler
Samples values of elemental variable(s).
This VectorPostprocessor
is similar to NodalValueSampler, but is used for sampling elemental variables instead of nodal variables. The coordinate used for each sampling point is the centroid of the associated element.
ElementValueSampler
declares a vector for each spatial coordinate, (x
, y
, z
), of the centroid of the element along with its ID as well as a vector named after each variable sampled, containing the variable values.
Input Parameters
- _auto_broadcastFalse
Default:False
C++ Type:bool
Controllable:No
- 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
- contains_complete_historyFalseSet this flag to indicate that the values in all vectors declared by this VPP represent a time history (e.g. with each invocation, new values are added and old values are never removed). This changes the output so that only a single file is output and updated with each invocation
Default:False
C++ Type:bool
Controllable:No
Description:Set this flag to indicate that the values in all vectors declared by this VPP represent a time history (e.g. with each invocation, new values are added and old values are never removed). This changes the output so that only a single file is output and updated with each invocation
- execute_onTIMESTEP_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.
Default: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
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.
- parallel_typeREPLICATEDSet how the data is represented within the VectorPostprocessor (VPP); 'distributed' indicates that data within the VPP is distributed and no auto communication is performed, this setting will result in parallel output within the CSV output; 'replicated' indicates that the data within the VPP is correct on processor 0, the data will automatically be broadcast to all processors unless the '_auto_broadcast' param is set to false within the validParams function.
Default:REPLICATED
C++ Type:MooseEnum
Options:DISTRIBUTED, REPLICATED
Controllable:No
Description:Set how the data is represented within the VectorPostprocessor (VPP); 'distributed' indicates that data within the VPP is distributed and no auto communication is performed, this setting will result in parallel output within the CSV output; 'replicated' indicates that the data within the VPP is correct on processor 0, the data will automatically be broadcast to all processors unless the '_auto_broadcast' param is set to false within the validParams function.
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Default:False
C++ Type:bool
Controllable:No
Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Optional Parameters
- allow_duplicate_execution_on_initialFalseIn the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
Default:False
C++ Type:bool
Controllable:No
Description:In the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- execution_order_group0Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
Default:0
C++ Type:int
Controllable:No
Description:Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
- force_postauxFalseForces the UserObject to be executed in POSTAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in POSTAUX
- force_preauxFalseForces the UserObject to be executed in PREAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREAUX
- force_preicFalseForces the UserObject to be executed in PREIC during initial setup
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREIC during initial setup
- implicitTrueDetermines whether this object is calculated using an implicit or explicit form
Default:True
C++ Type:bool
Controllable:No
Description:Determines whether this object is calculated using an implicit or explicit form
- outputsVector of output names where you would like to restrict the output of variables(s) associated with this object
C++ Type:std::vector<OutputName>
Controllable:No
Description:Vector of output names where you would like to restrict the output of variables(s) associated with this object
- 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
- (test/tests/meshdivisions/extra_elem_id_division.i)
- (test/tests/meshdivisions/cylindrical_division.i)
- (modules/reactor/test/tests/meshdivisions/hexagonal_division_positions.i)
- (test/tests/meshdivisions/nested_division.i)
- (modules/thermal_hydraulics/test/tests/problems/natural_circulation/natural_circulation.i)
- (modules/porous_flow/test/tests/fluidstate/coldwater_injection.i)
- (test/tests/meshdivisions/cartesian_division.i)
- (test/tests/meshdivisions/functor_values_division.i)
- (test/tests/vectorpostprocessors/element_value_sampler/element_value_sampler.i)
- (test/tests/physics/diffusion_fv.i)
- (test/tests/vectorpostprocessors/element_value_sampler/mixed_fe_fv_sampler.i)
- (modules/porous_flow/test/tests/heat_advection/heat_advection_1d_fv.i)
- (modules/porous_flow/test/tests/dispersion/diff01_fv.i)
- (test/tests/vectorpostprocessors/element_value_sampler/fv_element_value_sampler.i)
- (test/tests/outputs/debug/show_execution_userobjects.i)
- (modules/optimization/test/tests/functions/parameter_mesh/create_mesh_dg.i)
- (modules/porous_flow/test/tests/dispersion/disp01_fv.i)
- (modules/porous_flow/examples/co2_intercomparison/1Dradial/properties.i)
- (modules/porous_flow/examples/co2_intercomparison/1Dradial/1Dradial.i)
- (modules/porous_flow/test/tests/pressure_pulse/pressure_pulse_1d_2phasePS_fv.i)
- (modules/reactor/test/tests/meshdivisions/hexagonal_division.i)
- (test/tests/meshdivisions/nearest_position_division.i)
- (modules/porous_flow/test/tests/fluidstate/coldwater_injection_radial.i)
- (modules/porous_flow/test/tests/gravity/grav02e_fv.i)
- (test/tests/meshdivisions/spherical_division.i)
(test/tests/meshdivisions/extra_elem_id_division.i)
[Mesh]
[fmg]
type = FileMeshGenerator
file = '../positions/depletion_id_in.e'
exodus_extra_element_integers = 'material_id pin_id assembly_id'
[]
# To keep VPP output consistently ordered
allow_renumbering = false
[]
[MeshDivisions]
[extra_id_div]
type = ExtraElementIntegerDivision
extra_id_name = 'pin_id'
[]
[]
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'extra_id_div'
[]
[]
[VectorPostprocessors]
[div_out]
type = ElementValueSampler
variable = 'div'
sort_by = 'id'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(test/tests/meshdivisions/cylindrical_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'
[]
# To keep VPP output consistently ordered
allow_renumbering = false
[]
[MeshDivisions]
active = 'cylindrical_div'
[cylindrical_div]
type = CylindricalGridDivision
axis_direction = '0 0 1'
center = '1 1 0'
azimuthal_start = '1 0 0'
# Number of bins
n_radial = 3
n_azimuthal = 4
n_axial = 8
# Extent of the cylinder
cylinder_axial_min = 0.5
cylinder_axial_max = 2
r_min = 0.5
r_max = 4
[]
[cylindrical_div_positions]
type = CylindricalGridDivision
axis_direction = '0 0 1'
center_positions = center
azimuthal_start = '1 0 0'
# Number of bins
n_radial = 3
n_azimuthal = 4
n_axial = 8
# Extent of the cylinder
cylinder_axial_min = 0.5
cylinder_axial_max = 2
r_min = 0.5
r_max = 4
[]
[]
[Positions]
[center]
type = InputPositions
positions = '1 1 0'
[]
[]
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'cylindrical_div'
[]
[]
[VectorPostprocessors]
[div_out]
type = ElementValueSampler
variable = 'div'
sort_by = 'id'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(modules/reactor/test/tests/meshdivisions/hexagonal_division_positions.i)
pin_hex_size = 5
n_rings = 2
hex_size = '${fparse (2*n_rings - 1) * pin_hex_size}'
[Mesh]
[hex_pin]
type = PolygonConcentricCircleMeshGenerator
num_sides = 6
num_sectors_per_side = '2 2 2 2 2 2'
# Two position rings
ring_radii = '${fparse pin_hex_size / 2}'
ring_intervals = 1
polygon_size = ${pin_hex_size}
preserve_volumes = on
[]
[pattern_assembly]
type = PatternedHexMeshGenerator
inputs = 'hex_pin'
pattern = '0 0;
0 0 0;
0 0'
hexagon_size = ${hex_size}
background_intervals = 1
# If we deform the pin mesh to ease the transition with the background,
# we can get the wrong index for the hexagonal division
deform_non_circular_region = false
[]
[pattern_core]
type = PatternedHexMeshGenerator
inputs = 'pattern_assembly'
pattern = '0 0;
0 0 0;
0 0'
generate_core_metadata = true
pattern_boundary = none
# If we deform the pin mesh to ease the transition with the background,
# we can get the wrong index for the hexagonal division
deform_non_circular_region = false
[]
# To keep VPP output consistently ordered
allow_renumbering = false
[]
[Positions]
[assembly_centers]
type = InputPositions
# Assembly centers
positions = '0 0 0
${fparse -tan(pi/3) * hex_size} ${fparse -hex_size} 0
${fparse -tan(pi/3) * hex_size} ${fparse hex_size} 0
0 ${fparse -2 * hex_size} 0
0 ${fparse 2 * hex_size} 0
${fparse tan(pi/3) * hex_size} ${fparse -hex_size} 0
${fparse tan(pi/3) * hex_size} ${fparse hex_size} 0'
[]
[]
[MeshDivisions]
[hexagonal_div]
type = HexagonalGridDivision
nr = ${n_rings}
nz = 1
lattice_flat_to_flat = '${fparse 2 * hex_size}'
pin_pitch = '${fparse 2 * pin_hex_size}'
z_min = 0
z_max = 0
center_positions = assembly_centers
[]
[]
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'hexagonal_div'
[]
[]
[VectorPostprocessors]
[div_out]
type = ElementValueSampler
variable = 'div'
sort_by = 'id'
outputs = csv
[]
[]
[Postprocessors]
[npos]
type = NumMeshDivisions
mesh_division = 'hexagonal_div'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(test/tests/meshdivisions/nested_division.i)
[Mesh]
[fmg]
type = FileMeshGenerator
file = '../positions/depletion_id_in.e'
exodus_extra_element_integers = 'material_id pin_id assembly_id'
[]
# To keep VPP output consistently ordered
allow_renumbering = false
[]
[MeshDivisions]
[extra_id_div_1]
type = ExtraElementIntegerDivision
extra_id_name = 'material_id'
[]
[extra_id_div_2]
type = ExtraElementIntegerDivision
extra_id_name = 'pin_id'
[]
[nested_div]
type = NestedDivision
divisions = 'extra_id_div_2 extra_id_div_1'
[]
[]
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'nested_div'
[]
[]
[VectorPostprocessors]
[div_out]
type = ElementValueSampler
variable = 'div'
sort_by = 'id'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(modules/thermal_hydraulics/test/tests/problems/natural_circulation/natural_circulation.i)
# Natural circulation loop
#
# The setup consists of 4 connected 1-m pipes, forming a square:
#
# top_pipe
# *--------------* (1,1)
# | |
# | <- <- | | g
# heated_pipe | <- <- | cooled_pipe V
# | <- <- |
# | |
# (0,0) *--------------*
# bottom_pipe
#
# Heating and cooling occurs in the range z = (0.2 m, 0.8 m) with uniform heat fluxes.
n_elems = 50
diam = 0.1
length = 1.0
heated_length = 0.6
power = 1e3
p_initial = 100e3
T_ambient = 300
htc = 25.0
area = ${fparse 0.25 * pi * diam^2}
S_heated = ${fparse pi * diam * heated_length}
S_cooled = ${fparse pi * diam * heated_length}
output_variables = 'rho p T vel rhouA'
[GlobalParams]
gravity_vector = '0 0 -9.81'
length = ${length}
n_elems = ${n_elems}
A = ${area}
initial_T = ${T_ambient}
initial_p = ${p_initial}
initial_vel = 0
fp = fp
closures = closures
f = 0
Hw = ${htc}
rdg_slope_reconstruction = full
scaling_factor_1phase = '1 1 1e-5'
[]
[FluidProperties]
[fp]
type = IdealGasFluidProperties
emit_on_nan = none
[]
[]
[Closures]
[closures]
type = Closures1PhaseSimple
[]
[]
[Functions]
[heating_flux_fn]
type = PiecewiseConstant
axis = z
x = '0 0.2 0.8'
y = '0 ${fparse power / (S_heated)} 0'
[]
[cooling_flux_fn]
type = PiecewiseConstant
axis = z
x = '0 0.2 0.8'
y = '0 ${fparse -power / (S_cooled)} 0'
[]
[]
[Components]
[heated_pipe]
type = FlowChannel1Phase
position = '0 0 0'
orientation = '0 0 1'
[]
[top_pipe]
type = FlowChannel1Phase
position = '0 0 1'
orientation = '1 0 0'
[]
[cooled_pipe]
type = FlowChannel1Phase
position = '1 0 1'
orientation = '0 0 -1'
[]
[bottom_pipe]
type = FlowChannel1Phase
position = '1 0 0'
orientation = '-1 0 0'
[]
[junction_heated_top]
type = JunctionOneToOne1Phase
connections = 'heated_pipe:out top_pipe:in'
[]
[junction_top_cooled]
type = JunctionOneToOne1Phase
connections = 'top_pipe:out cooled_pipe:in'
[]
[junction_cooled_bottom]
type = JunctionOneToOne1Phase
connections = 'cooled_pipe:out bottom_pipe:in'
[]
[junction_bottom_heated]
type = JunctionOneToOne1Phase
connections = 'bottom_pipe:out heated_pipe:in'
[]
[heating]
type = HeatTransferFromHeatFlux1Phase
flow_channel = 'heated_pipe'
q_wall = heating_flux_fn
[]
[cooling]
type = HeatTransferFromHeatFlux1Phase
flow_channel = 'cooled_pipe'
q_wall = cooling_flux_fn
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Functions]
# Time step size function. NaN gets into residual for debug mode on first step,
# so that step gets cut to 0.5 s, but the rest of the transient can take 1 s time steps.
[dt_fn]
type = ParsedFunction
expression = 'if(t < 1e-10, 0.5, 1.0)'
[]
[]
[Executioner]
type = Transient
scheme = bdf2
start_time = 0
end_time = 50
[TimeStepper]
type = FunctionDT
function = dt_fn
[]
steady_state_detection = true
petsc_options_iname = '-pc_type'
petsc_options_value = ' lu '
nl_rel_tol = 1e-10
nl_abs_tol = 1e-10
nl_max_its = 15
l_tol = 1e-4
l_max_its = 10
[]
[VectorPostprocessors]
[heated_pipe_vpp]
type = ElementValueSampler
block = 'heated_pipe'
variable = ${output_variables}
sort_by = z
execute_on = 'FINAL'
[]
[top_pipe_vpp]
type = ElementValueSampler
block = 'top_pipe'
variable = ${output_variables}
sort_by = x
execute_on = 'FINAL'
[]
[cooled_pipe_vpp]
type = ElementValueSampler
block = 'cooled_pipe'
variable = ${output_variables}
sort_by = z
execute_on = 'FINAL'
[]
[bottom_pipe_vpp]
type = ElementValueSampler
block = 'bottom_pipe'
variable = ${output_variables}
sort_by = x
execute_on = 'FINAL'
[]
[]
[Outputs]
xml = true
velocity_as_vector = false
execute_on = 'FINAL'
[]
(modules/porous_flow/test/tests/fluidstate/coldwater_injection.i)
# Cold water injection into 1D hot reservoir (Avdonin, 1964)
#
# To generate results presented in documentation for this problem,
# set xmax = 50 and nx = 250 in the Mesh block, and dtmax = 100 and
# end_time = 1.3e5 in the Executioner block.
[Mesh]
type = GeneratedMesh
dim = 1
nx = 25
xmax = 20
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[AuxVariables]
[temperature]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[temperature]
type = PorousFlowPropertyAux
variable = temperature
property = temperature
execute_on = 'initial timestep_end'
[]
[]
[Variables]
[pliquid]
initial_condition = 5e6
[]
[h]
scaling = 1e-6
[]
[]
[ICs]
[hic]
type = PorousFlowFluidPropertyIC
variable = h
porepressure = pliquid
property = enthalpy
temperature = 170
temperature_unit = Celsius
fp = water
[]
[]
[BCs]
[pleft]
type = DirichletBC
variable = pliquid
value = 5.05e6
boundary = left
[]
[pright]
type = DirichletBC
variable = pliquid
value = 5e6
boundary = right
[]
[hleft]
type = DirichletBC
variable = h
value = 678.52e3
boundary = left
[]
[hright]
type = DirichletBC
variable = h
value = 721.4e3
boundary = right
[]
[]
[Kernels]
[mass]
type = PorousFlowMassTimeDerivative
variable = pliquid
[]
[massflux]
type = PorousFlowAdvectiveFlux
variable = pliquid
[]
[heat]
type = PorousFlowEnergyTimeDerivative
variable = h
[]
[heatflux]
type = PorousFlowHeatAdvection
variable = h
[]
[heatcond]
type = PorousFlowHeatConduction
variable = h
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pliquid h'
number_fluid_phases = 2
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureVG
pc_max = 1e6
sat_lr = 0.1
m = 0.5
alpha = 1e-5
[]
[fs]
type = PorousFlowWaterVapor
water_fp = water
capillary_pressure = pc
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[Materials]
[watervapor]
type = PorousFlowFluidStateSingleComponent
porepressure = pliquid
enthalpy = h
temperature_unit = Celsius
capillary_pressure = pc
fluid_state = fs
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.2
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1.8e-11 0 0 0 1.8e-11 0 0 0 1.8e-11'
[]
[relperm_water]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
s_res = 0.1
sum_s_res = 0.1
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 1
sum_s_res = 0.1
[]
[internal_energy]
type = PorousFlowMatrixInternalEnergy
density = 2900
specific_heat_capacity = 740
[]
[rock_thermal_conductivity]
type = PorousFlowThermalConductivityIdeal
dry_thermal_conductivity = '20 0 0 0 20 0 0 0 20'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 5e3
nl_abs_tol = 1e-10
[TimeStepper]
type = IterationAdaptiveDT
dt = 100
[]
[]
[VectorPostprocessors]
[line]
type = ElementValueSampler
sort_by = x
variable = temperature
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
perf_graph = true
[csv]
type = CSV
execute_on = final
[]
[]
(test/tests/meshdivisions/cartesian_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'
[]
# To keep VPP output consistently ordered
allow_renumbering = false
[]
[MeshDivisions]
active = 'cartesian_div'
[cartesian_div]
type = CartesianGridDivision
bottom_left = '0.1 0.5 0.5'
top_right = '5 2 1'
nx = '3'
ny = '4'
nz = '1'
[]
[cartesian_div_center]
type = CartesianGridDivision
center = '2.55 1.25 0.75'
widths = '4.9 1.5 0.5'
nx = '3'
ny = '4'
nz = '1'
[]
[cartesian_div_center_pos]
type = CartesianGridDivision
center_positions = 'center'
widths = '4.9 1.5 0.5'
nx = '3'
ny = '4'
nz = '1'
[]
[]
[Positions]
[center]
type = InputPositions
positions = '2.55 1.25 0.75'
[]
[]
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'cartesian_div'
[]
[]
[VectorPostprocessors]
[div_out]
type = ElementValueSampler
variable = 'div'
sort_by = 'id'
outputs = csv
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(test/tests/meshdivisions/functor_values_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'
[]
# To keep VPP output consistently ordered
allow_renumbering = false
[]
[MeshDivisions]
[functor_div]
type = FunctorBinnedValuesDivision
min_value = 0.1
max_value = 2
num_bins = 3
functor = 'xf'
[]
[]
[Functions]
[xf]
type = ParsedFunction
expression = 'x'
[]
[]
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'functor_div'
[]
[]
[VectorPostprocessors]
[div_out]
type = ElementValueSampler
variable = 'div'
sort_by = 'id'
[]
[]
[Postprocessors]
[ndiv]
type = NumMeshDivisions
mesh_division = functor_div
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(test/tests/vectorpostprocessors/element_value_sampler/element_value_sampler.i)
# Tests the ElementValueSampler vector post-processor. In this test, 2 constant
# monomial variables are given distributions by a function and are output to a CSV file.
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
[]
[Functions]
[./u_fn]
type = ParsedFunction
expression = '2 * x + 3 * y'
[../]
[./v_fn]
type = ParsedFunction
expression = 'x + y'
[../]
[]
[AuxVariables]
[./u]
family = MONOMIAL
order = CONSTANT
[../]
[./v]
family = MONOMIAL
order = CONSTANT
[../]
[]
[ICs]
[./u_ic]
type = FunctionIC
variable = u
function = u_fn
[../]
[./v_ic]
type = FunctionIC
variable = v
function = v_fn
[../]
[]
[VectorPostprocessors]
[./element_value_sampler]
type = ElementValueSampler
variable = 'u v'
sort_by = id
execute_on = 'initial'
[../]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
file_base = 'element_value_sampler'
csv = true
execute_on = 'initial'
[]
(test/tests/physics/diffusion_fv.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '1 2'
dy = '2 1'
ix = '2 3'
iy = '3 2'
subdomain_id = '0 1
1 0'
[]
[split_boundaries]
type = BreakBoundaryOnSubdomainGenerator
input = cmg
[]
allow_renumbering = false
[]
[Physics]
[Diffusion]
[FiniteVolume]
[diff]
source_functor = 2
# Test all the ways of setting the boundary conditions
neumann_boundaries = 'left_to_0 right_to_0 top_to_0 bottom_to_0'
boundary_fluxes = '1 flux_pp flux_function flux_variable'
dirichlet_boundaries = 'left_to_1 right_to_1 top_to_1 bottom_to_1'
boundary_values = '2 value_pp value_function value_variable'
[]
[]
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
num_steps = 10
# Output the setup
verbose = true
[]
# To test setting up a boundary condition with a postprocessor
[Postprocessors]
[flux_pp]
type = Receiver
default = 1
outputs = 'none'
[]
[value_pp]
type = Receiver
default = 2
outputs = 'none'
[]
[]
# To test setting up a boundary condition with a function
[Functions]
[flux_function]
type = ConstantFunction
value = 1
[]
[value_function]
type = ConstantFunction
value = 2
[]
[]
# To test setting up a boundary condition with a variable
[AuxVariables]
[flux_variable]
type = MooseVariableFVReal
initial_condition = 1
[]
[value_variable]
type = MooseVariableFVReal
initial_condition = 2
[]
[]
# Form output for testing
[VectorPostprocessors]
[sample]
type = ElementValueSampler
variable = 'u'
sort_by = 'id'
[]
[]
[Outputs]
csv = true
[]
(test/tests/vectorpostprocessors/element_value_sampler/mixed_fe_fv_sampler.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 1
dx = 3
ix = 10
[]
[]
[AuxVariables]
[T]
type = MooseVariableFVReal
[FVInitialCondition]
type = FVFunctionIC
function = '10 * x*x'
[]
[]
[grad_T]
order = CONSTANT
family = MONOMIAL_VEC
[]
[auxGrad_T_x]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[grad_T_aux]
type = FunctorElementalGradientAux
variable = grad_T
functor = T
[]
[grad_T_x_aux]
type = VectorVariableComponentAux
variable = auxGrad_T_x
vector_variable = grad_T
component = 'x'
[]
[]
[VectorPostprocessors]
[element_value_sampler]
type = ElementValueSampler
variable = 'T auxGrad_T_x'
sort_by = id
[]
[]
[Outputs]
csv = true
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
(modules/porous_flow/test/tests/heat_advection/heat_advection_1d_fv.i)
# 1phase, heat advecting with a moving fluid using FV
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
nx = 50
xmin = 0
xmax = 1
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[Variables]
[temp]
type = MooseVariableFVReal
[]
[pp]
type = MooseVariableFVReal
[]
[]
[FVICs]
[pp]
type = FVFunctionIC
variable = pp
function = '1-x'
[]
[temp]
type = FVFunctionIC
variable = temp
function = 'if(x<0.02, 300, 200)'
[]
[]
[FVBCs]
[pp0]
type = FVDirichletBC
variable = pp
boundary = left
value = 1
[]
[pp1]
type = FVDirichletBC
variable = pp
boundary = right
value = 0
[]
[hot]
type = FVDirichletBC
variable = temp
boundary = left
value = 300
[]
[cold]
type = FVDirichletBC
variable = temp
boundary = right
value = 200
[]
[]
[FVKernels]
[mass_dot]
type = FVPorousFlowMassTimeDerivative
fluid_component = 0
variable = pp
[]
[advection]
type = FVPorousFlowAdvectiveFlux
fluid_component = 0
variable = pp
[]
[energy_dot]
type = FVPorousFlowEnergyTimeDerivative
variable = temp
[]
[heat_advection]
type = FVPorousFlowHeatAdvection
variable = temp
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'temp pp'
number_fluid_phases = 1
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureVG
m = 0.6
alpha = 1.3
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 100
density0 = 1000
viscosity = 4.4
thermal_expansion = 0
cv = 2
[]
[]
[Materials]
[temperature]
type = ADPorousFlowTemperature
temperature = temp
[]
[porosity]
type = ADPorousFlowPorosityConst
porosity = 0.2
[]
[rock_heat]
type = ADPorousFlowMatrixInternalEnergy
specific_heat_capacity = 1.0
density = 125
[]
[simple_fluid]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[permeability]
type = ADPorousFlowPermeabilityConst
permeability = '1.1 0 0 0 2 0 0 0 3'
[]
[relperm]
type = ADPorousFlowRelativePermeabilityCorey
n = 2
phase = 0
[]
[massfrac]
type = ADPorousFlowMassFraction
[]
[PS]
type = ADPorousFlow1PhaseP
porepressure = pp
capillary_pressure = pc
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
dt = 0.01
end_time = 0.6
[]
[VectorPostprocessors]
[T]
type = ElementValueSampler
sort_by = x
variable = 'temp'
[]
[]
[Outputs]
[csv]
type = CSV
execute_vector_postprocessors_on = final
[]
[]
(modules/porous_flow/test/tests/dispersion/diff01_fv.i)
# Test diffusive part of FVPorousFlowDispersiveFlux kernel by setting dispersion
# coefficients to zero. Pressure is held constant over the mesh, and gravity is
# set to zero so that no advective transport of mass takes place.
# Mass fraction is set to 1 on the left hand side and 0 on the right hand side.
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
nx = 20
xmax = 10
bias_x = 1.2
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[Variables]
[pp]
type = MooseVariableFVReal
[]
[massfrac0]
type = MooseVariableFVReal
[]
[]
[AuxVariables]
[velocity]
family = MONOMIAL
order = FIRST
[]
[]
[AuxKernels]
[velocity]
type = ADPorousFlowDarcyVelocityComponent
variable = velocity
component = x
[]
[]
[ICs]
[pp]
type = ConstantIC
variable = pp
value = 1e5
[]
[massfrac0]
type = ConstantIC
variable = massfrac0
value = 0
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
value = 1
variable = massfrac0
boundary = left
[]
[right]
type = FVDirichletBC
value = 0
variable = massfrac0
boundary = right
[]
[pright]
type = FVDirichletBC
variable = pp
boundary = right
value = 1e5
[]
[pleft]
type = FVDirichletBC
variable = pp
boundary = left
value = 1e5
[]
[]
[FVKernels]
[mass0]
type = FVPorousFlowMassTimeDerivative
fluid_component = 0
variable = pp
[]
[diff0_pp]
type = FVPorousFlowDispersiveFlux
fluid_component = 0
variable = pp
disp_trans = 0
disp_long = 0
[]
[mass1]
type = FVPorousFlowMassTimeDerivative
fluid_component = 1
variable = massfrac0
[]
[diff1_x]
type = FVPorousFlowDispersiveFlux
fluid_component = 1
variable = massfrac0
disp_trans = 0
disp_long = 0
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pp massfrac0'
number_fluid_phases = 1
number_fluid_components = 2
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 1e7
density0 = 1000
viscosity = 0.001
thermal_expansion = 0
[]
[]
[Materials]
[temperature]
type = ADPorousFlowTemperature
[]
[ppss]
type = ADPorousFlow1PhaseFullySaturated
porepressure = pp
[]
[massfrac]
type = ADPorousFlowMassFraction
mass_fraction_vars = massfrac0
[]
[simple_fluid]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[poro]
type = ADPorousFlowPorosityConst
porosity = 0.3
[]
[diff]
type = ADPorousFlowDiffusivityConst
diffusion_coeff = '1 1'
tortuosity = 0.1
[]
[relp]
type = ADPorousFlowRelativePermeabilityConst
phase = 0
[]
[permeability]
type = ADPorousFlowPermeabilityConst
permeability = '1e-9 0 0 0 1e-9 0 0 0 1e-9'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
petsc_options_value = 'gmres asm lu NONZERO 2 '
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
dt = 1
end_time = 20
[]
[VectorPostprocessors]
[xmass]
type = ElementValueSampler
sort_by = id
variable = massfrac0
[]
[]
[Outputs]
[out]
type = CSV
execute_on = final
[]
[]
(test/tests/vectorpostprocessors/element_value_sampler/fv_element_value_sampler.i)
# Tests the ElementValueSampler vector post-processor. In this test, 2 FV
# variables are given distributions by a function and are output to a CSV file.
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
[]
[Functions]
[./u_fn]
type = ParsedFunction
expression = '2 * x + 3 * y'
[../]
[./v_fn]
type = ParsedFunction
expression = 'x + y'
[../]
[]
[AuxVariables]
[./u]
family = MONOMIAL
order = CONSTANT
fv = true
[../]
[./v]
family = MONOMIAL
order = CONSTANT
fv = true
[../]
[]
[ICs]
[./u_ic]
type = FunctionIC
variable = u
function = u_fn
[../]
[./v_ic]
type = FunctionIC
variable = v
function = v_fn
[../]
[]
[VectorPostprocessors]
[./element_value_sampler]
type = ElementValueSampler
variable = 'u v'
sort_by = id
execute_on = 'initial'
[../]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
file_base = 'element_value_sampler'
csv = true
execute_on = 'initial'
[]
(test/tests/outputs/debug/show_execution_userobjects.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '1.5 2.4'
dy = '1.3 0.9'
ix = '3 2'
iy = '2 3'
subdomain_id = '0 1
1 0'
[]
[add_interface]
type = SideSetsBetweenSubdomainsGenerator
input = 'cmg'
primary_block = 0
paired_block = 1
new_boundary = 'interface'
[]
second_order = true
[]
[Functions]
[forcing_fnu]
type = ParsedFunction
expression = -5.8*(x+y)+x*x*x-x+y*y*y-y
[]
[forcing_fnv]
type = ParsedFunction
expression = -4
[]
[slnu]
type = ParsedGradFunction
expression = x*x*x-x+y*y*y-y
grad_x = 3*x*x-1
grad_y = 3*y*y-1
[]
[slnv]
type = ParsedGradFunction
expression = x*x+y*y
grad_x = 2*x
grad_y = 2*y
[]
# NeumannBC functions
[bc_fnut]
type = ParsedFunction
expression = 3*y*y-1
[]
[bc_fnub]
type = ParsedFunction
expression = -3*y*y+1
[]
[bc_fnul]
type = ParsedFunction
expression = -3*x*x+1
[]
[bc_fnur]
type = ParsedFunction
expression = 3*x*x-1
[]
[]
[Variables]
[u]
order = SECOND
family = HIERARCHIC
[]
[v]
order = SECOND
family = LAGRANGE
initial_condition = 1
[]
[]
[AuxVariables]
[v_elem]
order = CONSTANT
family = MONOMIAL
[]
[]
[Kernels]
active = 'diff1 diff2 test1 forceu forcev react'
[diff1]
type = Diffusion
variable = u
[]
[test1]
type = CoupledConvection
variable = u
velocity_vector = v
[]
[diff2]
type = Diffusion
variable = v
[]
[react]
type = Reaction
variable = u
[]
[forceu]
type = BodyForce
variable = u
function = forcing_fnu
[]
[forcev]
type = BodyForce
variable = v
function = forcing_fnv
[]
[]
[AuxKernels]
[set_v_elem]
type = FunctionAux
variable = v_elem
# selected not to be the solution for no particular reason
function = forcing_fnv
[]
[]
[BCs]
[bc_v]
type = FunctionDirichletBC
variable = v
function = slnv
boundary = 'left right top bottom'
[]
[bc_u_tb]
type = CoupledKernelGradBC
variable = u
var2 = v
vel = '0.1 0.1'
boundary = 'top bottom left right'
[]
[bc_ul]
type = FunctionNeumannBC
variable = u
function = bc_fnul
boundary = 'left'
[]
[bc_ur]
type = FunctionNeumannBC
variable = u
function = bc_fnur
boundary = 'right'
[]
[bc_ut]
type = FunctionNeumannBC
variable = u
function = bc_fnut
boundary = 'top'
[]
[bc_ub]
type = FunctionNeumannBC
variable = u
function = bc_fnub
boundary = 'bottom'
[]
[]
[Postprocessors]
# Global user objects
[dofs]
type = NumDOFs
[]
[h]
type = AverageElementSize
[]
# Elemental user objects
[L2u]
type = ElementL2Error
variable = u
function = slnu
# Testing an option
force_preic = true
[]
[L2v]
type = ElementL2Error
variable = v
function = slnv
# Testing an option
force_preaux = true
[]
[H1error]
type = ElementH1Error
variable = u
function = slnu
[]
[H1Semierror]
type = ElementH1SemiError
variable = u
function = slnu
[]
[L2v_elem]
type = ElementL2Error
variable = v_elem
function = slnv
[]
[f_integral]
type = FunctionElementIntegral
function = slnv
[]
[int_v]
type = ElementIntegralVariablePostprocessor
variable = v
block = 1
execute_on = 'TIMESTEP_END transfer'
[]
[int_v_elem]
type = ElementIntegralVariablePostprocessor
variable = v_elem
block = 1
execute_on = 'TIMESTEP_END transfer'
[]
# Side user objects
[integral_v]
type = SideIntegralVariablePostprocessor
variable = v
boundary = 0
[]
[]
[VectorPostprocessors]
# General UOs
[memory]
type = VectorMemoryUsage
[]
[line]
type = LineValueSampler
variable = v
num_points = 10
start_point = '0 0 0'
end_point = '0.5 0.5 0'
sort_by = 'x'
[]
# Nodal UOs
[nodal_sampler_y]
type = NodalValueSampler
variable = v
sort_by = 'y'
[]
[nodal_sampler_x]
type = NodalValueSampler
variable = v
sort_by = 'x'
[]
# Element UO
[elem_sample]
type = ElementValueSampler
variable = v_elem
sort_by = 'x'
[]
[]
[UserObjects]
# Nodal user objects
[find_node]
type = NearestNodeNumberUO
point = '0.5 0.5 0'
[]
# Side user objects
[side_int]
type = LayeredSideIntegral
variable = v
boundary = 0
direction = y
num_layers = 4
[]
[side_int_2]
type = NearestPointLayeredSideIntegral
variable = v
boundary = 0
direction = x
num_layers = 3
points = '1 1 0'
[]
# Interface user objects
[values]
type = InterfaceQpValueUserObject
var = v
boundary = interface
[]
inactive = 'prime_1 prime_2'
# Threaded general user objects
[prime_2]
type = PrimeProductUserObject
[]
[prime_1]
type = PrimeProductUserObject
[]
# Domain user objects
[domain_2]
type = InterfaceDomainUserObject
u = u
v = v
block = '0'
robin_boundaries = 'left'
interface_boundaries = 'interface'
interface_penalty = 1e-10
nl_abs_tol = 1e1
[]
[domain_1]
type = InterfaceDomainUserObject
u = u
v = v
block = '0 1'
robin_boundaries = 'left'
interface_boundaries = 'interface'
interface_penalty = 1e-10
nl_abs_tol = 1e1
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
nl_rel_tol = 1e-10
nl_abs_tol = 1e-10
l_tol = 1e-5
[]
[Problem]
kernel_coverage_check = false
[]
[MultiApps]
active = ''
[full_solve]
type = FullSolveMultiApp
execute_on = 'initial timestep_end final'
input_files = show_execution_userobjects.i
cli_args = 'Problem/solve=false'
[]
[]
[Transfers]
active = ''
[conservative]
type = MultiAppNearestNodeTransfer
from_multi_app = full_solve
source_variable = v
variable = v_elem
from_postprocessors_to_be_preserved = int_v
to_postprocessors_to_be_preserved = int_v_elem
[]
[]
[Debug]
show_execution_order = 'ALWAYS INITIAL NONLINEAR LINEAR TIMESTEP_BEGIN TIMESTEP_END FINAL'
[]
(modules/optimization/test/tests/functions/parameter_mesh/create_mesh_dg.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 4
ny = 4
[]
parallel_type = REPLICATED
[]
[AuxVariables/params]
family = MONOMIAL
order = CONSTANT
[]
[ICs/params_ic]
type = FunctionIC
function = params_fun
variable = params
[]
[Functions]
[params_fun]
type = ParsedFunction
value = 'x*(x-1)*y*(y-1)'
[]
[]
[VectorPostprocessors]
[param_vec]
type = ElementValueSampler
sort_by = id
variable = params
[]
[]
[Outputs]
csv = true
exodus = true
execute_on = timestep_end
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
(modules/porous_flow/test/tests/dispersion/disp01_fv.i)
# Test dispersive part of FVPorousFlowDispersiveFlux kernel by setting diffusion
# coefficients to zero. A pressure gradient is applied over the mesh to give a
# uniform velocity. Gravity is set to zero.
# Mass fraction is set to 1 on the left hand side and 0 on the right hand side.
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
xmax = 10
bias_x = 1.1
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[Variables]
[pp]
type = MooseVariableFVReal
[]
[massfrac0]
type = MooseVariableFVReal
[]
[]
[AuxVariables]
[velocity]
family = MONOMIAL
order = FIRST
[]
[]
[AuxKernels]
[velocity]
type = ADPorousFlowDarcyVelocityComponent
variable = velocity
component = x
[]
[]
[ICs]
[pp]
type = FunctionIC
variable = pp
function = pic
[]
[massfrac0]
type = ConstantIC
variable = massfrac0
value = 0
[]
[]
[Functions]
[pic]
type = ParsedFunction
expression = '1.1e5-x*1e3'
[]
[]
[FVBCs]
[xleft]
type = FVDirichletBC
value = 1
variable = massfrac0
boundary = left
[]
[xright]
type = FVDirichletBC
value = 0
variable = massfrac0
boundary = right
[]
[pright]
type = FVDirichletBC
variable = pp
boundary = right
value = 1e5
[]
[pleft]
type = FVDirichletBC
variable = pp
boundary = left
value = 1.1e5
[]
[]
[FVKernels]
[mass0]
type = FVPorousFlowMassTimeDerivative
fluid_component = 0
variable = pp
[]
[adv0]
type = FVPorousFlowAdvectiveFlux
fluid_component = 0
variable = pp
[]
[diff0]
type = FVPorousFlowDispersiveFlux
variable = pp
disp_trans = 0
disp_long = 0.2
[]
[mass1]
type = FVPorousFlowMassTimeDerivative
fluid_component = 1
variable = massfrac0
[]
[adv1]
type = FVPorousFlowAdvectiveFlux
fluid_component = 1
variable = massfrac0
[]
[diff1]
type = FVPorousFlowDispersiveFlux
fluid_component = 1
variable = massfrac0
disp_trans = 0
disp_long = 0.2
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pp massfrac0'
number_fluid_phases = 1
number_fluid_components = 2
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 1e9
density0 = 1000
viscosity = 0.001
thermal_expansion = 0
[]
[]
[Materials]
[temperature]
type = ADPorousFlowTemperature
[]
[ppss]
type = ADPorousFlow1PhaseFullySaturated
porepressure = pp
[]
[massfrac]
type = ADPorousFlowMassFraction
mass_fraction_vars = massfrac0
[]
[simple_fluid]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[poro]
type = ADPorousFlowPorosityConst
porosity = 0.3
[]
[diff]
type = ADPorousFlowDiffusivityConst
diffusion_coeff = '0 0'
tortuosity = 0.1
[]
[relp]
type = ADPorousFlowRelativePermeabilityConst
phase = 0
[]
[permeability]
type = ADPorousFlowPermeabilityConst
permeability = '1e-9 0 0 0 1e-9 0 0 0 1e-9'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'gmres asm lu NONZERO'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 3e2
dtmax = 100
nl_abs_tol = 1e-12
[TimeStepper]
type = IterationAdaptiveDT
growth_factor = 2
cutback_factor = 0.5
dt = 10
[]
[]
[VectorPostprocessors]
[xmass]
type = ElementValueSampler
sort_by = id
variable = 'massfrac0 velocity'
[]
[]
[Outputs]
[out]
type = CSV
execute_on = final
[]
[]
(modules/porous_flow/examples/co2_intercomparison/1Dradial/properties.i)
# Liquid and gas properties for code intercomparison problem 3
#
# From Pruess et al, Code intercomparison builds confidence in
# numerical simulation models for geologic disposal of CO2, Energy 29 (2004)
#
# This test simply calculates density and viscosity of each phase for
# various pressures and salinities, as well as mass fractions of CO2 in the
# liquid phase and H2O in the gas phase.
#
# Four versions of this are run:
# 1) No CO2, 0 salt mass fraction (pure water)
# 2) Enough CO2 to form gas phase, 0 salt mass fraction (pure water)
# 3) No CO2, 0.15 salt mass fraction
# 4) Enough CO2 to form gas phase, 0.15 salt mass fraction
#
# These results compare well with detailed results presented in Pruess et al,
# Intercomparison of numerical simulation codes for geologic disposal of CO2,
# LBNL-51813 (2002)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
xmax = 4
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[AuxVariables]
[density_liquid]
order = CONSTANT
family = MONOMIAL
[]
[density_gas]
order = CONSTANT
family = MONOMIAL
[]
[viscosity_liquid]
order = CONSTANT
family = MONOMIAL
[]
[viscosity_gas]
order = CONSTANT
family = MONOMIAL
[]
[x1]
order = CONSTANT
family = MONOMIAL
[]
[y0]
order = CONSTANT
family = MONOMIAL
[]
[xnacl]
initial_condition = 0.0
[]
[]
[AuxKernels]
[density_liquid]
type = PorousFlowPropertyAux
variable = density_liquid
property = density
phase = 0
execute_on = timestep_end
[]
[density_gas]
type = PorousFlowPropertyAux
variable = density_gas
property = density
phase = 1
execute_on = timestep_end
[]
[viscosity_liquid]
type = PorousFlowPropertyAux
variable = viscosity_liquid
property = viscosity
phase = 0
execute_on = timestep_end
[]
[viscosity_gas]
type = PorousFlowPropertyAux
variable = viscosity_gas
property = viscosity
phase = 1
execute_on = timestep_end
[]
[x1]
type = PorousFlowPropertyAux
variable = x1
property = mass_fraction
phase = 0
fluid_component = 1
execute_on = timestep_end
[]
[y0]
type = PorousFlowPropertyAux
variable = y0
property = mass_fraction
phase = 1
fluid_component = 0
execute_on = timestep_end
[]
[]
[Variables]
[pgas]
order = CONSTANT
family = MONOMIAL
[]
[zi]
initial_condition = 0.0
[]
[]
[Functions]
[pic]
type = ParsedFunction
expression = 'if(x<1,12e6,if(x<2,16e6,if(x<3,20e6,24e6)))'
[]
[]
[ICs]
[pic]
type = FunctionIC
function = pic
variable = pgas
[]
[]
[Kernels]
[diffusionp]
type = NullKernel
variable = pgas
[]
[diffusionz]
type = NullKernel
variable = zi
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pgas zi'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureConst
pc = 0
[]
[fs]
type = PorousFlowBrineCO2
brine_fp = brine
co2_fp = co2
capillary_pressure = pc
[]
[]
[FluidProperties]
[co2]
type = CO2FluidProperties
[]
[brine]
type = BrineFluidProperties
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = 45
[]
[brineco2]
type = PorousFlowFluidState
gas_porepressure = pgas
z = zi
temperature_unit = Celsius
xnacl = xnacl
capillary_pressure = pc
fluid_state = fs
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type -pc_asm_overlap'
petsc_options_value = 'gmres asm lu NONZERO 2 '
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
perf_graph = true
csv = true
execute_on = timestep_end
file_base = properties_water
[]
[VectorPostprocessors]
[vpp]
type = ElementValueSampler
variable = 'pgas density_liquid density_gas viscosity_liquid viscosity_gas x1 y0'
sort_by = x
[]
[]
(modules/porous_flow/examples/co2_intercomparison/1Dradial/1Dradial.i)
# Intercomparison problem 3: Radial flow from an injection well
#
# From Pruess et al, Code intercomparison builds confidence in
# numerical simulation models for geologic disposal of CO2, Energy 29 (2004)
#
# A variation with zero salinity can be run by changing the initial condition
# of the AuxVariable xnacl
[Mesh]
type = GeneratedMesh
dim = 1
nx = 500
xmax = 10000
bias_x = 1.01
coord_type = 'RZ'
rz_coord_axis = Y
[]
[GlobalParams]
PorousFlowDictator = 'dictator'
gravity = '0 0 0'
[]
[AuxVariables]
[pressure_liquid]
order = CONSTANT
family = MONOMIAL
[]
[saturation_gas]
order = CONSTANT
family = MONOMIAL
[]
[x1]
order = CONSTANT
family = MONOMIAL
[]
[y0]
order = CONSTANT
family = MONOMIAL
[]
[xnacl]
initial_condition = 0.15
[]
[]
[AuxKernels]
[pressure_liquid]
type = PorousFlowPropertyAux
variable = pressure_liquid
property = pressure
phase = 0
execute_on = 'timestep_end'
[]
[saturation_gas]
type = PorousFlowPropertyAux
variable = saturation_gas
property = saturation
phase = 1
execute_on = 'timestep_end'
[]
[x1]
type = PorousFlowPropertyAux
variable = x1
property = mass_fraction
phase = 0
fluid_component = 1
execute_on = 'timestep_end'
[]
[y0]
type = PorousFlowPropertyAux
variable = y0
property = mass_fraction
phase = 1
fluid_component = 0
execute_on = 'timestep_end'
[]
[]
[Variables]
[pgas]
initial_condition = 12e6
[]
[zi]
initial_condition = 0
scaling = 1e4
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = pgas
[]
[flux0]
type = PorousFlowAdvectiveFlux
fluid_component = 0
variable = pgas
[]
[mass1]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = zi
[]
[flux1]
type = PorousFlowAdvectiveFlux
fluid_component = 1
variable = zi
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pgas zi'
number_fluid_phases = 2
number_fluid_components = 3
[]
[pc]
type = PorousFlowCapillaryPressureVG
alpha = 5.099e-5
m = 0.457
sat_lr = 0.0
pc_max = 1e7
[]
[fs]
type = PorousFlowBrineCO2
brine_fp = brine
co2_fp = co2
capillary_pressure = pc
[]
[]
[FluidProperties]
[co2sw]
type = CO2FluidProperties
[]
[co2]
type = TabulatedBicubicFluidProperties
fp = co2sw
[]
[water]
type = Water97FluidProperties
[]
[watertab]
type = TabulatedBicubicFluidProperties
fp = water
temperature_min = 273.15
temperature_max = 573.15
fluid_property_file = water_fluid_properties.csv
save_file = false
[]
[brine]
type = BrineFluidProperties
water_fp = watertab
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = '45'
[]
[brineco2]
type = PorousFlowFluidState
gas_porepressure = 'pgas'
z = 'zi'
temperature_unit = Celsius
xnacl = 'xnacl'
capillary_pressure = pc
fluid_state = fs
[]
[porosity]
type = PorousFlowPorosityConst
porosity = '0.12'
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-13 0 0 0 1e-13 0 0 0 1e-13'
[]
[relperm_water]
type = PorousFlowRelativePermeabilityVG
m = 0.457
phase = 0
s_res = 0.3
sum_s_res = 0.35
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 1
s_res = 0.05
sum_s_res = 0.35
[]
[]
[BCs]
[rightwater]
type = PorousFlowPiecewiseLinearSink
boundary = 'right'
variable = pgas
use_mobility = true
PorousFlowDictator = dictator
fluid_phase = 0
multipliers = '0 1e9'
PT_shift = '12e6'
pt_vals = '0 1e9'
mass_fraction_component = 0
use_relperm = true
[]
[rightco2]
type = PorousFlowPiecewiseLinearSink
variable = zi
boundary = 'right'
use_mobility = true
PorousFlowDictator = dictator
fluid_phase = 1
multipliers = '0 1e9'
PT_shift = '12e6'
pt_vals = '0 1e9'
mass_fraction_component = 1
use_relperm = true
[]
[]
[DiracKernels]
[source]
type = PorousFlowSquarePulsePointSource
point = '0 0 0'
mass_flux = 1
variable = zi
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'gmres bjacobi lu NONZERO'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 8.64e8
nl_max_its = 25
l_max_its = 100
dtmax = 5e6
[TimeStepper]
type = IterationAdaptiveDT
dt = 100
[]
[]
[VectorPostprocessors]
[vars]
type = NodalValueSampler
sort_by = x
variable = 'pgas zi xnacl'
execute_on = 'timestep_end'
outputs = spatial
[]
[auxvars]
type = ElementValueSampler
sort_by = x
variable = 'saturation_gas x1 y0'
execute_on = 'timestep_end'
outputs = spatial
[]
[]
[Postprocessors]
[pgas]
type = PointValue
point = '25.25 0 0'
variable = pgas
outputs = time
[]
[sgas]
type = PointValue
point = '25.25 0 0'
variable = saturation_gas
outputs = time
[]
[zi]
type = PointValue
point = '25.25 0 0'
variable = zi
outputs = time
[]
[massgas]
type = PorousFlowFluidMass
fluid_component = 1
outputs = time
[]
[x1]
type = PointValue
point = '25.25 0 0'
variable = x1
outputs = time
[]
[y0]
type = PointValue
point = '25.25 0 0'
variable = y0
outputs = time
[]
[xnacl]
type = PointValue
point = '25.25 0 0'
variable = xnacl
outputs = time
[]
[]
[Outputs]
print_linear_residuals = false
perf_graph = true
sync_times = '2.592e6 8.64e6 8.64e7 8.64e8'
[time]
type = CSV
[]
[spatial]
type = CSV
sync_only = true
[]
[]
(modules/porous_flow/test/tests/pressure_pulse/pressure_pulse_1d_2phasePS_fv.i)
# Pressure pulse in 1D with 2 phases, 2components - transient using FV
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
nx = 10
xmin = 0
xmax = 100
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[Variables]
[ppwater]
type = MooseVariableFVReal
initial_condition = 2e6
[]
[sgas]
type = MooseVariableFVReal
initial_condition = 0.3
[]
[]
[AuxVariables]
[massfrac_ph0_sp0]
type = MooseVariableFVReal
initial_condition = 1
[]
[massfrac_ph1_sp0]
type = MooseVariableFVReal
initial_condition = 0
[]
[ppgas]
family = MONOMIAL
order = CONSTANT
[]
[]
[FVKernels]
[mass0]
type = FVPorousFlowMassTimeDerivative
fluid_component = 0
variable = ppwater
[]
[flux0]
type = FVPorousFlowAdvectiveFlux
variable = ppwater
fluid_component = 0
[]
[mass1]
type = FVPorousFlowMassTimeDerivative
fluid_component = 1
variable = sgas
[]
[flux1]
type = FVPorousFlowAdvectiveFlux
variable = sgas
fluid_component = 1
[]
[]
[AuxKernels]
[ppgas]
type = ADPorousFlowPropertyAux
property = pressure
phase = 1
variable = ppgas
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'ppwater sgas'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureConst
pc = 1e5
[]
[]
[FluidProperties]
[simple_fluid0]
type = SimpleFluidProperties
bulk_modulus = 2e9
density0 = 1000
thermal_expansion = 0
viscosity = 1e-3
[]
[simple_fluid1]
type = SimpleFluidProperties
bulk_modulus = 2e7
density0 = 1
thermal_expansion = 0
viscosity = 1e-5
[]
[]
[Materials]
[temperature]
type = ADPorousFlowTemperature
[]
[ppss]
type = ADPorousFlow2PhasePS
phase0_porepressure = ppwater
phase1_saturation = sgas
capillary_pressure = pc
[]
[massfrac]
type = ADPorousFlowMassFraction
mass_fraction_vars = 'massfrac_ph0_sp0 massfrac_ph1_sp0'
[]
[simple_fluid0]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid0
phase = 0
[]
[simple_fluid1]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid1
phase = 1
[]
[porosity]
type = ADPorousFlowPorosityConst
porosity = 0.1
[]
[permeability]
type = ADPorousFlowPermeabilityConst
permeability = '1e-15 0 0 0 1e-15 0 0 0 1e-15'
[]
[relperm_water]
type = ADPorousFlowRelativePermeabilityCorey
n = 1
phase = 0
[]
[relperm_gas]
type = ADPorousFlowRelativePermeabilityCorey
n = 1
phase = 1
[]
[]
[FVBCs]
[leftwater]
type = FVDirichletBC
boundary = left
value = 3e6
variable = ppwater
[]
[rightwater]
type = FVDirichletBC
boundary = right
value = 2e6
variable = ppwater
[]
[sgas]
type = FVDirichletBC
boundary = 'left right'
value = 0.3
variable = sgas
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
dt = 1e3
end_time = 1e4
[]
[VectorPostprocessors]
[pp]
type = ElementValueSampler
sort_by = x
variable = 'ppwater ppgas'
[]
[]
[Outputs]
file_base = pressure_pulse_1d_2phasePS_fv
print_linear_residuals = false
[csv]
type = CSV
execute_on = final
[]
exodus = true
[]
(modules/reactor/test/tests/meshdivisions/hexagonal_division.i)
# Increase resolution to check results visually
resolution = 3
z_resolution = 3
[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 = '${fparse 2 * resolution} ${fparse resolution} ${fparse z_resolution}'
iy = '${fparse 2 * resolution} ${fparse 3 * z_resolution}'
iz = '${fparse resolution} ${fparse resolution} ${fparse resolution} ${fparse z_resolution}'
[]
# To keep VPP output consistently ordered
allow_renumbering = false
[]
[MeshDivisions]
[hexagonal_div]
type = HexagonalGridDivision
nr = 4
nz = 2
lattice_flat_to_flat = 4
pin_pitch = 0.6
z_min = 0
z_max = 3
center = '1 1 0'
[]
[]
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'hexagonal_div'
[]
[]
[VectorPostprocessors]
[div_out]
type = ElementValueSampler
variable = 'div'
sort_by = 'id'
outputs = csv
[]
[]
[Postprocessors]
[npos]
type = NumMeshDivisions
mesh_division = 'hexagonal_div'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(test/tests/meshdivisions/nearest_position_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'
[]
# To keep VPP output consistently ordered
allow_renumbering = false
[]
[Positions]
[input]
type = InputPositions
# avoid indetermination
positions = '0.0001 0 0
1 0 0
1.46543 2.1233 3.1211'
[]
[]
[MeshDivisions]
[nearest_pos_div]
type = NearestPositionsDivision
positions = input
[]
[]
[Functions]
[xf]
type = ParsedFunction
expression = 'x'
[]
[]
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'nearest_pos_div'
[]
[]
[VectorPostprocessors]
[div_out]
type = ElementValueSampler
variable = 'div'
sort_by = 'id'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(modules/porous_flow/test/tests/fluidstate/coldwater_injection_radial.i)
# Cold water injection into 1D radial hot reservoir (Avdonin, 1964)
#
# To generate results presented in documentation for this problem,
# set xmax = 1000 and nx = 200 in the Mesh block, and dtmax = 1e4
# and end_time = 1e6 in the Executioner block.
[Mesh]
type = GeneratedMesh
dim = 1
nx = 50
xmin = 0.1
xmax = 5
bias_x = 1.05
rz_coord_axis = Y
coord_type = RZ
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[AuxVariables]
[temperature]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[temperature]
type = PorousFlowPropertyAux
variable = temperature
property = temperature
execute_on = 'initial timestep_end'
[]
[]
[Variables]
[pliquid]
initial_condition = 5e6
[]
[h]
scaling = 1e-6
[]
[]
[ICs]
[hic]
type = PorousFlowFluidPropertyIC
variable = h
porepressure = pliquid
property = enthalpy
temperature = 170
temperature_unit = Celsius
fp = water
[]
[]
[Functions]
[injection_rate]
type = ParsedFunction
symbol_values = injection_area
symbol_names = area
expression = '-0.1/area'
[]
[]
[BCs]
[source]
type = PorousFlowSink
variable = pliquid
flux_function = injection_rate
boundary = left
[]
[pright]
type = DirichletBC
variable = pliquid
value = 5e6
boundary = right
[]
[hleft]
type = DirichletBC
variable = h
value = 678.52e3
boundary = left
[]
[hright]
type = DirichletBC
variable = h
value = 721.4e3
boundary = right
[]
[]
[Kernels]
[mass]
type = PorousFlowMassTimeDerivative
variable = pliquid
[]
[massflux]
type = PorousFlowAdvectiveFlux
variable = pliquid
[]
[heat]
type = PorousFlowEnergyTimeDerivative
variable = h
[]
[heatflux]
type = PorousFlowHeatAdvection
variable = h
[]
[heatcond]
type = PorousFlowHeatConduction
variable = h
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pliquid h'
number_fluid_phases = 2
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureVG
pc_max = 1e6
sat_lr = 0.1
m = 0.5
alpha = 1e-5
[]
[fs]
type = PorousFlowWaterVapor
water_fp = water
capillary_pressure = pc
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[Materials]
[watervapor]
type = PorousFlowFluidStateSingleComponent
porepressure = pliquid
enthalpy = h
temperature_unit = Celsius
capillary_pressure = pc
fluid_state = fs
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.2
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1.8e-11 0 0 0 1.8e-11 0 0 0 1.8e-11'
[]
[relperm_water]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
s_res = 0.1
sum_s_res = 0.1
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 1
sum_s_res = 0.1
[]
[internal_energy]
type = PorousFlowMatrixInternalEnergy
density = 2900
specific_heat_capacity = 740
[]
[rock_thermal_conductivity]
type = PorousFlowThermalConductivityIdeal
dry_thermal_conductivity = '20 0 0 0 20 0 0 0 20'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 1e3
nl_abs_tol = 1e-8
[TimeStepper]
type = IterationAdaptiveDT
dt = 100
[]
[]
[Postprocessors]
[injection_area]
type = AreaPostprocessor
boundary = left
execute_on = initial
[]
[]
[VectorPostprocessors]
[line]
type = ElementValueSampler
sort_by = x
variable = temperature
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
perf_graph = true
[csv]
type = CSV
execute_on = final
[]
[]
(modules/porous_flow/test/tests/gravity/grav02e_fv.i)
# Checking that gravity head is established in the transient situation when 0<=saturation<=1 (note the less-than-or-equal-to).
# 2phase (PS), 2components, constant capillary pressure, constant fluid bulk-moduli for each phase, constant viscosity,
# constant permeability, Corey relative permeabilities with no residual saturation
[Mesh]
type = GeneratedMesh
dim = 1
nx = 10
xmax = 100
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '-10 0 0'
[]
[Variables]
[ppwater]
type = MooseVariableFVReal
initial_condition = 1.5e6
[]
[sgas]
type = MooseVariableFVReal
initial_condition = 0.3
[]
[]
[AuxVariables]
[massfrac_ph0_sp0]
type = MooseVariableFVReal
initial_condition = 1
[]
[massfrac_ph1_sp0]
type = MooseVariableFVReal
initial_condition = 0
[]
[ppgas]
type = MooseVariableFVReal
[]
[swater]
type = MooseVariableFVReal
[]
[relpermwater]
type = MooseVariableFVReal
[]
[relpermgas]
type = MooseVariableFVReal
[]
[]
[FVKernels]
[mass0]
type = FVPorousFlowMassTimeDerivative
fluid_component = 0
variable = ppwater
[]
[flux0]
type = FVPorousFlowAdvectiveFlux
fluid_component = 0
variable = ppwater
[]
[mass1]
type = FVPorousFlowMassTimeDerivative
fluid_component = 1
variable = sgas
[]
[flux1]
type = FVPorousFlowAdvectiveFlux
fluid_component = 1
variable = sgas
[]
[]
[AuxKernels]
[ppgas]
type = ADPorousFlowPropertyAux
property = pressure
phase = 1
variable = ppgas
execute_on = 'initial timestep_end'
[]
[swater]
type = ADPorousFlowPropertyAux
property = saturation
phase = 0
variable = swater
execute_on = 'initial timestep_end'
[]
[relpermwater]
type = ADPorousFlowPropertyAux
property = relperm
phase = 0
variable = relpermwater
execute_on = 'initial timestep_end'
[]
[relpermgas]
type = ADPorousFlowPropertyAux
property = relperm
phase = 1
variable = relpermgas
execute_on = 'initial timestep_end'
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'ppwater sgas'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureConst
pc = 1e5
[]
[]
[FluidProperties]
[simple_fluid0]
type = SimpleFluidProperties
bulk_modulus = 2e9
density0 = 1000
viscosity = 1e-3
thermal_expansion = 0
[]
[simple_fluid1]
type = SimpleFluidProperties
bulk_modulus = 2e9
density0 = 10
viscosity = 1e-5
thermal_expansion = 0
[]
[]
[Materials]
[temperature]
type = ADPorousFlowTemperature
[]
[ppss]
type = ADPorousFlow2PhasePS
phase0_porepressure = ppwater
phase1_saturation = sgas
capillary_pressure = pc
[]
[massfrac]
type = ADPorousFlowMassFraction
mass_fraction_vars = 'massfrac_ph0_sp0 massfrac_ph1_sp0'
[]
[simple_fluid0]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid0
phase = 0
[]
[simple_fluid1]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid1
phase = 1
[]
[porosity]
type = ADPorousFlowPorosityConst
porosity = 0.1
[]
[permeability]
type = ADPorousFlowPermeabilityConst
permeability = '1e-11 0 0 0 1e-11 0 0 0 1e-11'
[]
[relperm_water]
type = ADPorousFlowRelativePermeabilityCorey
n = 2
phase = 0
[]
[relperm_gas]
type = ADPorousFlowRelativePermeabilityCorey
n = 2
phase = 1
[]
[]
[VectorPostprocessors]
[vars]
type = ElementValueSampler
variable = 'ppgas ppwater sgas swater'
sort_by = x
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 5e3
nl_abs_tol = 1e-12
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e3
[]
[]
[Outputs]
execute_on = 'final'
perf_graph = true
csv = true
[]
(test/tests/meshdivisions/spherical_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'
[]
# To keep VPP output consistently ordered
allow_renumbering = false
[]
[MeshDivisions]
active = 'spherical_div'
[spherical_div]
type = SphericalGridDivision
center = '1 1 0'
# Number of bins
n_radial = 3
# Extent of the sphere
r_min = 0.5
r_max = 4
[]
[spherical_div_positions]
type = SphericalGridDivision
center_positions = center
# Number of bins
n_radial = 3
# Extent of the sphere
r_min = 0.5
r_max = 4
[]
[]
[Positions]
[center]
type = InputPositions
positions = '1 1 0'
[]
[]
[AuxVariables]
[div]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[mesh_div]
type = MeshDivisionAux
variable = div
mesh_division = 'spherical_div'
[]
[]
[VectorPostprocessors]
[div_out]
type = ElementValueSampler
variable = 'div'
sort_by = 'id'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]