- allow_imperfect_jacobiansFalsetrue to allow unimplemented property derivative terms to be set to zero for the AD API
Default:False
C++ Type:bool
Description:true to allow unimplemented property derivative terms to be set to zero for the AD API
- execute_onTIMESTEP_ENDThe list of flag(s) indicating when this object should be executed, the available options include NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, FINAL, CUSTOM.
Default:TIMESTEP_END
C++ Type:ExecFlagEnum
Description:The list of flag(s) indicating when this object should be executed, the available options include NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, FINAL, CUSTOM.
- fp_typesingle-phase-fpType of the fluid property object
Default:single-phase-fp
C++ Type:FPType
Description:Type of the fluid property object
Water97FluidProperties
Fluid properties for water and steam (H2O) using IAPWS-IF97
The water implementation in Fluid Properties is the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. This formulation calculates properties of water and steam using pressure and temperature as inputs. The IAPWS-IF97 formulation is split into five different regions in the phase diagram.
All five regions are implemented in the Fluid Properties module. To avoid iteration in region 3 of the IAPWS-IF97 formulation, the backwards equations from IAPWS (2014) are implemented.
Viscosity is calculated using the IAPWS 2008 formulation (IAPWS, 2008). Note that the critical enhancement has not been implemented.
Thermal conductivity is calculated using the IAPS 1985 formulation (IAPS, 1985). Although there is a newer formulation available (IAPWS, 2011), it is significantly more complicated, so has not been implemented yet.
Dissolution of a dilute gas into water is calculated using Henry's law (IAPWS, 2004).
Properties of water
Property | value |
---|---|
Molar mass | 0.018015 kg/mol |
Critical temperature | 647.096 K |
Critical pressure | 22.064 MPa |
Critical density | 322.0 kg/m |
Triple point temperature | 273.16 K |
Triple point pressure | 611.657 Pa |
Range of validity
The Water97FluidProperties UserObject is valid for:
273.15 K T 1073.15 K for p 100 MPa
1073.15 K T 2273.15 K for p 50 MPa
Input 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
Options:
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
Options:
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Options:
Description:Set the enabled status of the MooseObject.
- force_preauxFalseForces the GeneralUserObject to be executed in PREAUX
Default:False
C++ Type:bool
Options:
Description:Forces the GeneralUserObject to be executed in PREAUX
- 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
Options:
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/porous_flow/test/tests/jacobian/brineco2_twophase.i
- modules/porous_flow/test/tests/fluidstate/coldwater_injection_radial.i
- modules/porous_flow/test/tests/ics/fluidpropic_celsius.i
- modules/porous_flow/test/tests/fluidstate/theis_brineco2.i
- modules/fluid_properties/test/tests/water/water.i
- modules/porous_flow/test/tests/recover/theis.i
- modules/porous_flow/test/tests/jacobian/waterncg_gas.i
- modules/porous_flow/test/tests/fluidstate/water_vapor_phasechange.i
- modules/porous_flow/test/tests/jacobian/waterncg_twophase.i
- modules/porous_flow/test/tests/jacobian/brineco2_liquid.i
- modules/porous_flow/test/tests/jacobian/waterncg_liquid.i
- modules/porous_flow/test/tests/fluids/brine1_tabulated.i
- modules/porous_flow/examples/tutorial/05.i
- modules/porous_flow/test/tests/jacobian/brineco2_gas.i
- modules/porous_flow/test/tests/fluidstate/waterncg_nonisothermal.i
- modules/porous_flow/test/tests/fluidstate/water_vapor.i
- modules/porous_flow/test/tests/fluidstate/theis_nonisothermal.i
- modules/porous_flow/test/tests/fluidstate/coldwater_injection.i
- modules/porous_flow/test/tests/fluidstate/theis.i
- modules/porous_flow/examples/tutorial/11.i
- modules/porous_flow/test/tests/jacobian/waterncg_twophase_nonisothermal.i
- modules/porous_flow/test/tests/fluidstate/waterncg.i
- modules/porous_flow/examples/tutorial/11_2D.i
- modules/porous_flow/test/tests/fluidstate/theis_tabulated.i
- modules/porous_flow/examples/tutorial/05_tabulated.i
- modules/porous_flow/test/tests/ics/fluidpropic.i
- modules/porous_flow/examples/reservoir_model/field_model.i
- modules/porous_flow/test/tests/fluidstate/waterncg_ic.i
- modules/porous_flow/examples/co2_intercomparison/1Dradial/1Dradial.i
- modules/porous_flow/test/tests/sinks/injection_production_eg.i
- modules/porous_flow/examples/reservoir_model/regular_grid.i
- modules/fluid_properties/test/tests/brine/brine_tabulated.i
- modules/porous_flow/test/tests/fluids/h2o.i
modules/porous_flow/test/tests/jacobian/brineco2_twophase.i
# Tests correct calculation of properties derivatives in PorousFlowFluidState
# for conditions that are appropriate for two phases
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[AuxVariables]
[./xnacl]
initial_condition = 0.05
[../]
[]
[Variables]
[./pgas]
[../]
[./zi]
[../]
[]
[ICs]
[./pgas]
type = RandomIC
min = 1e6
max = 4e6
variable = pgas
seed = 1
[../]
[./z]
type = RandomIC
min = 0.2
max = 0.8
variable = zi
seed = 2
[../]
[]
[Kernels]
[./mass0]
type = PorousFlowMassTimeDerivative
variable = pgas
fluid_component = 0
[../]
[./mass1]
type = PorousFlowMassTimeDerivative
variable = zi
fluid_component = 1
[../]
[./adv0]
type = PorousFlowAdvectiveFlux
variable = pgas
fluid_component = 0
[../]
[./adv1]
type = PorousFlowAdvectiveFlux
variable = zi
fluid_component = 1
[../]
[]
[UserObjects]
[./dictator]
type = PorousFlowDictator
porous_flow_vars = 'pgas zi'
number_fluid_phases = 2
number_fluid_components = 2
[../]
[./pc]
type = PorousFlowCapillaryPressureVG
m = 0.5
alpha = 1e1
pc_max = 1e4
[../]
[./fs]
type = PorousFlowBrineCO2
brine_fp = brine
co2_fp = co2
capillary_pressure = pc
[../]
[]
[Modules]
[./FluidProperties]
[./co2]
type = CO2FluidProperties
[../]
[./brine]
type = BrineFluidProperties
[../]
[./water]
type = Water97FluidProperties
[../]
[../]
[]
[Materials]
[./temperature]
type = PorousFlowTemperature
temperature = 50
[../]
[./brineco2]
type = PorousFlowFluidState
gas_porepressure = pgas
z = zi
temperature_unit = Celsius
xnacl = xnacl
capillary_pressure = pc
fluid_state = fs
[../]
[./permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-12 0 0 0 1e-12 0 0 0 1e-12'
[../]
[./relperm0]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
[../]
[./relperm1]
type = PorousFlowRelativePermeabilityCorey
n = 3
phase = 1
[../]
[./porosity]
type = PorousFlowPorosityConst
porosity = 0.1
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
dt = 1
end_time = 1
nl_abs_tol = 1e-12
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[AuxVariables]
[./sgas]
family = MONOMIAL
order = CONSTANT
[../]
[]
[AuxKernels]
[./sgas]
type = PorousFlowPropertyAux
property = saturation
phase = 1
variable = sgas
[../]
[]
[Postprocessors]
[./sgas_min]
type = ElementExtremeValue
variable = sgas
value_type = min
[../]
[./sgas_max]
type = ElementExtremeValue
variable = sgas
value_type = max
[../]
[]
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
[]
[Problem]
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
vals = injection_area
vars = area
value = '-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
[../]
[]
[Modules]
[./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/ics/fluidpropic_celsius.i
# Test the correct calculation of fluid properties using PorousFlwoFluidPropertyIC
# when temperature is given in Celsius
#
# Variables:
# Pressure: 1 MPa
# Temperature: 50 C
#
# Fluid properties for water (reference values from NIST webbook)
# Density: 988.43 kg/m^3
# Enthalpy: 210.19 kJ/kg
# Internal energy: 2019.18 kJ/kg
[Mesh]
type = GeneratedMesh
dim = 2
[]
[Variables]
[./pressure]
initial_condition = 1e6
[../]
[./temperature]
initial_condition = 50
[../]
[]
[AuxVariables]
[./enthalpy]
[../]
[./internal_energy]
[../]
[./density]
[../]
[]
[ICs]
[./enthalpy]
type = PorousFlowFluidPropertyIC
variable = enthalpy
property = enthalpy
porepressure = pressure
temperature = temperature
temperature_unit = Celsius
fp = water
[../]
[./internal_energy]
type = PorousFlowFluidPropertyIC
variable = internal_energy
property = internal_energy
porepressure = pressure
temperature = temperature
temperature_unit = Celsius
fp = water
[../]
[./density]
type = PorousFlowFluidPropertyIC
variable = density
property = density
porepressure = pressure
temperature = temperature
temperature_unit = Celsius
fp = water
[../]
[]
[Modules]
[./FluidProperties]
[./water]
type = Water97FluidProperties
[../]
[../]
[]
[Kernels]
[./pressure]
type = Diffusion
variable = pressure
[../]
[./temperature]
type = Diffusion
variable = temperature
[../]
[]
[Executioner]
type = Steady
nl_abs_tol = 1e-12
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Postprocessors]
[./enthalpy]
type = ElementAverageValue
variable = enthalpy
execute_on = 'initial timestep_end'
[../]
[./internal_energy]
type = ElementAverageValue
variable = internal_energy
execute_on = 'initial timestep_end'
[../]
[./density]
type = ElementAverageValue
variable = density
execute_on = 'initial timestep_end'
[../]
[]
[Outputs]
csv = true
file_base = fluidpropic_out
execute_on = initial
[]
modules/porous_flow/test/tests/fluidstate/theis_brineco2.i
# Two phase Theis problem: Flow from single source.
# Constant rate injection 2 kg/s
# 1D cylindrical mesh
# Initially, system has only a liquid phase, until enough gas is injected
# to form a gas phase, in which case the system becomes two phase.
#
# This test takes a few minutes to run, so is marked heavy
[Mesh]
type = GeneratedMesh
dim = 1
nx = 2000
xmax = 2000
[]
[Problem]
type = FEProblem
coord_type = RZ
rz_coord_axis = Y
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[AuxVariables]
[./saturation_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./x1]
order = CONSTANT
family = MONOMIAL
[../]
[./y0]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./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 = 20e6
[../]
[./zi]
initial_condition = 0
[../]
[./xnacl]
initial_condition = 0.1
[../]
[]
[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
[../]
[./mass2]
type = PorousFlowMassTimeDerivative
fluid_component = 2
variable = xnacl
[../]
[./flux2]
type = PorousFlowAdvectiveFlux
fluid_component = 2
variable = xnacl
[../]
[]
[UserObjects]
[./dictator]
type = PorousFlowDictator
porous_flow_vars = 'pgas zi xnacl'
number_fluid_phases = 2
number_fluid_components = 3
[../]
[./pc]
type = PorousFlowCapillaryPressureConst
pc = 0
[../]
[./fs]
type = PorousFlowBrineCO2
brine_fp = brine
co2_fp = co2
capillary_pressure = pc
[../]
[]
[Modules]
[./FluidProperties]
[./co2sw]
type = CO2FluidProperties
[../]
[./co2]
type = TabulatedFluidProperties
fp = co2sw
[../]
[./water]
type = Water97FluidProperties
[../]
[./watertab]
type = TabulatedFluidProperties
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
[../]
[./brineco2]
type = PorousFlowFluidState
gas_porepressure = pgas
z = zi
temperature_unit = Celsius
xnacl = xnacl
capillary_pressure = pc
fluid_state = fs
[../]
[./porosity]
type = PorousFlowPorosityConst
porosity = 0.2
[../]
[./permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-12 0 0 0 1e-12 0 0 0 1e-12'
[../]
[./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
[../]
[]
[BCs]
[./rightwater]
type = DirichletBC
boundary = right
value = 20e6
variable = pgas
[../]
[]
[DiracKernels]
[./source]
type = PorousFlowSquarePulsePointSource
point = '0 0 0'
mass_flux = 2
variable = zi
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 1e5
[./TimeStepper]
type = IterationAdaptiveDT
dt = 1
growth_factor = 1.5
[../]
[]
[VectorPostprocessors]
[./line]
type = LineValueSampler
sort_by = x
start_point = '0 0 0'
end_point = '2000 0 0'
num_points = 10000
variable = 'pgas zi xnacl x1 saturation_gas'
execute_on = 'timestep_end'
[../]
[]
[Postprocessors]
[./pgas]
type = PointValue
point = '4 0 0'
variable = pgas
[../]
[./sgas]
type = PointValue
point = '4 0 0'
variable = saturation_gas
[../]
[./zi]
type = PointValue
point = '4 0 0'
variable = zi
[../]
[./massgas]
type = PorousFlowFluidMass
fluid_component = 1
[../]
[./x1]
type = PointValue
point = '4 0 0'
variable = x1
[../]
[./y0]
type = PointValue
point = '4 0 0'
variable = y0
[../]
[./xnacl]
type = PointValue
point = '4 0 0'
variable = xnacl
[../]
[]
[Outputs]
print_linear_residuals = false
perf_graph = true
[./csvout]
type = CSV
execute_on = timestep_end
execute_vector_postprocessors_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
value = 'if(x<2, 300, 500)'
[../]
[./pic]
type = ParsedFunction
value = '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
args = rho
function = 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
[../]
[]
[Modules]
[./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
[]
modules/porous_flow/test/tests/recover/theis.i
# Tests that PorousFlow can successfully recover using a checkpoint file.
# This test contains stateful material properties, adaptivity and integrated
# boundary conditions with nodal-sized materials.
#
# This test file is run three times:
# 1) The full input file is run to completion
# 2) The input file is run for half the time and checkpointing is included
# 3) The input file is run in recovery using the checkpoint data
#
# The final output of test 3 is compared to the final output of test 1 to verify
# that recovery was successful.
[Mesh]
type = GeneratedMesh
dim = 1
nx = 20
xmax = 100
bias_x = 1.05
[]
[Problem]
type = FEProblem
coord_type = RZ
rz_coord_axis = Y
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[Adaptivity]
marker = marker
max_h_level = 4
[./Indicators]
[./front]
type = GradientJumpIndicator
variable = zi
[../]
[../]
[./Markers]
[./marker]
type = ErrorFractionMarker
indicator = front
refine = 0.8
coarsen = 0.2
[../]
[../]
[]
[AuxVariables]
[./saturation_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./x1]
order = CONSTANT
family = MONOMIAL
[../]
[./y0]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./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 = 20e6
[../]
[./zi]
initial_condition = 0
[../]
[]
[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 = 2
[../]
[./pc]
type = PorousFlowCapillaryPressureConst
pc = 0
[../]
[./fs]
type = PorousFlowWaterNCG
water_fp = water
gas_fp = co2
capillary_pressure = pc
[../]
[]
[Modules]
[./FluidProperties]
[./co2]
type = CO2FluidProperties
[../]
[./water]
type = Water97FluidProperties
[../]
[../]
[]
[Materials]
[./temperature]
type = PorousFlowTemperature
[../]
[./waterncg]
type = PorousFlowFluidState
gas_porepressure = pgas
z = zi
temperature_unit = Celsius
capillary_pressure = pc
fluid_state = fs
[../]
[./porosity]
type = PorousFlowPorosityConst
porosity = 0.2
[../]
[./permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-12 0 0 0 1e-12 0 0 0 1e-12'
[../]
[./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
[../]
[]
[BCs]
[./aquifer]
type = PorousFlowPiecewiseLinearSink
variable = pgas
boundary = right
pt_vals = '0 1e8'
multipliers = '0 1e8'
flux_function = 1e-6
PT_shift = 20e6
[../]
[]
[DiracKernels]
[./source]
type = PorousFlowSquarePulsePointSource
point = '0 0 0'
mass_flux = 2
variable = zi
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 2e2
dt = 50
[]
[VectorPostprocessors]
[./line]
type = NodalValueSampler
sort_by = x
variable = 'pgas zi'
[../]
[]
[Outputs]
print_linear_residuals = false
perf_graph = true
csv = true
[]
modules/porous_flow/test/tests/jacobian/waterncg_gas.i
# Tests correct calculation of properties derivatives in PorousFlowWaterNCG
# for conditions that give a single gas phase
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[Variables]
[./pgas]
[../]
[./z]
[../]
[]
[ICs]
[./pgas]
type = RandomIC
min = 1e4
max = 4e4
variable = pgas
[../]
[./z]
type = RandomIC
min = 0.88
max = 0.98
variable = z
[../]
[]
[Kernels]
[./mass0]
type = PorousFlowMassTimeDerivative
variable = pgas
fluid_component = 0
[../]
[./mass1]
type = PorousFlowMassTimeDerivative
variable = z
fluid_component = 1
[../]
[./adv0]
type = PorousFlowAdvectiveFlux
variable = pgas
fluid_component = 0
[../]
[./adv1]
type = PorousFlowAdvectiveFlux
variable = z
fluid_component = 1
[../]
[]
[UserObjects]
[./dictator]
type = PorousFlowDictator
porous_flow_vars = 'pgas z'
number_fluid_phases = 2
number_fluid_components = 2
[../]
[./pc]
type = PorousFlowCapillaryPressureVG
m = 0.5
alpha = 1
pc_max = 1e3
[../]
[./fs]
type = PorousFlowWaterNCG
water_fp = water
gas_fp = co2
capillary_pressure = pc
[../]
[]
[Modules]
[./FluidProperties]
[./co2]
type = CO2FluidProperties
[../]
[./water]
type = Water97FluidProperties
[../]
[../]
[]
[Materials]
[./temperature]
type = PorousFlowTemperature
temperature = 50
[../]
[./waterncg]
type = PorousFlowFluidState
gas_porepressure = pgas
z = z
temperature_unit = Celsius
capillary_pressure = pc
fluid_state = fs
[../]
[./permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-12 0 0 0 1e-12 0 0 0 1e-12'
[../]
[./relperm0]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
[../]
[./relperm1]
type = PorousFlowRelativePermeabilityCorey
n = 3
phase = 1
[../]
[./porosity]
type = PorousFlowPorosityConst
porosity = 0.1
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
dt = 1
end_time = 1
nl_abs_tol = 1e-12
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[AuxVariables]
[./sgas]
family = MONOMIAL
order = CONSTANT
[../]
[]
[AuxKernels]
[./sgas]
type = PorousFlowPropertyAux
property = saturation
phase = 1
variable = sgas
[../]
[]
[Postprocessors]
[./sgas_min]
type = ElementExtremeValue
variable = sgas
value_type = min
[../]
[./sgas_max]
type = ElementExtremeValue
variable = sgas
value_type = max
[../]
[]
modules/porous_flow/test/tests/fluidstate/water_vapor_phasechange.i
# Tests correct calculation of properties in PorousFlowWaterVapor as a phase change
# from liquid to a two-phase model occurs due to a pressure drop.
# A single 10 m^3 element is used, with constant mass and heat production using
# a Dirac kernel. Initial conditions correspond to just outside the two-phase region in
# the liquid state.
#
# An identical problem can be run using TOUGH2, with the following outputs after 1,000s
# Pressure: 8.58 Mpa
# Temperature: 299.92 K
# Vapor saturation: 0.00637
[Mesh]
type = GeneratedMesh
dim = 3
xmax = 10
ymax = 10
zmax = 10
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Variables]
[./pliq]
initial_condition = 9e6
[../]
[./h]
scaling = 1e-3
[../]
[]
[ICs]
[./hic]
type = PorousFlowFluidPropertyIC
variable = h
porepressure = pliq
property = enthalpy
temperature = 300
temperature_unit = Celsius
fp = water
[../]
[]
[DiracKernels]
[./mass]
type = ConstantPointSource
point = '5 5 5'
variable = pliq
value = -1
[../]
[./heat]
type = ConstantPointSource
point = '5 5 5'
variable = h
value = -1.344269e6
[../]
[]
[AuxVariables]
[./pressure_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./pressure_water]
order = CONSTANT
family = MONOMIAL
[../]
[./enthalpy_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./enthalpy_water]
order = CONSTANT
family = MONOMIAL
[../]
[./saturation_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./saturation_water]
order = CONSTANT
family = MONOMIAL
[../]
[./density_water]
order = CONSTANT
family = MONOMIAL
[../]
[./density_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./viscosity_water]
order = CONSTANT
family = MONOMIAL
[../]
[./viscosity_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./temperature]
order = CONSTANT
family = MONOMIAL
[../]
[./e_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./e_water]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./enthalpy_water]
type = PorousFlowPropertyAux
variable = enthalpy_water
property = enthalpy
phase = 0
execute_on = 'initial timestep_end'
[../]
[./enthalpy_gas]
type = PorousFlowPropertyAux
variable = enthalpy_gas
property = enthalpy
phase = 1
execute_on = 'initial timestep_end'
[../]
[./pressure_water]
type = PorousFlowPropertyAux
variable = pressure_water
property = pressure
phase = 0
execute_on = 'initial timestep_end'
[../]
[./pressure_gas]
type = PorousFlowPropertyAux
variable = pressure_gas
property = pressure
phase = 1
execute_on = 'initial timestep_end'
[../]
[./saturation_water]
type = PorousFlowPropertyAux
variable = saturation_water
property = saturation
phase = 0
execute_on = 'initial timestep_end'
[../]
[./saturation_gas]
type = PorousFlowPropertyAux
variable = saturation_gas
property = saturation
phase = 1
execute_on = 'initial timestep_end'
[../]
[./density_water]
type = PorousFlowPropertyAux
variable = density_water
property = density
phase = 0
execute_on = 'initial timestep_end'
[../]
[./density_gas]
type = PorousFlowPropertyAux
variable = density_gas
property = density
phase = 1
execute_on = 'initial timestep_end'
[../]
[./viscosity_water]
type = PorousFlowPropertyAux
variable = viscosity_water
property = viscosity
phase = 0
execute_on = 'initial timestep_end'
[../]
[./viscosity_gas]
type = PorousFlowPropertyAux
variable = viscosity_gas
property = viscosity
phase = 1
execute_on = 'initial timestep_end'
[../]
[./temperature]
type = PorousFlowPropertyAux
variable = temperature
property = temperature
execute_on = 'initial timestep_end'
[../]
[./e_water]
type = PorousFlowPropertyAux
variable = e_water
property = internal_energy
phase = 0
execute_on = 'initial timestep_end'
[../]
[./egas]
type = PorousFlowPropertyAux
variable = e_gas
property = internal_energy
phase = 1
execute_on = 'initial timestep_end'
[../]
[]
[Kernels]
[./mass]
type = PorousFlowMassTimeDerivative
variable = pliq
[../]
[./heat]
type = PorousFlowEnergyTimeDerivative
variable = h
[../]
[]
[UserObjects]
[./dictator]
type = PorousFlowDictator
porous_flow_vars = 'pliq h'
number_fluid_phases = 2
number_fluid_components = 1
[../]
[./pc]
type = PorousFlowCapillaryPressureBC
pe = 1e5
lambda = 2
pc_max = 1e6
[../]
[./fs]
type = PorousFlowWaterVapor
water_fp = water
capillary_pressure = pc
[../]
[]
[Modules]
[./FluidProperties]
[./water]
type = Water97FluidProperties
[../]
[../]
[]
[Materials]
[./watervapor]
type = PorousFlowFluidStateSingleComponent
porepressure = pliq
enthalpy = h
temperature_unit = Celsius
capillary_pressure = pc
fluid_state = fs
[../]
[./permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-14 0 0 0 1e-14 0 0 0 1e-14'
[../]
[./relperm0]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
[../]
[./relperm1]
type = PorousFlowRelativePermeabilityCorey
n = 3
phase = 1
[../]
[./porosity]
type = PorousFlowPorosityConst
porosity = 0.2
[../]
[./internal_energy]
type = PorousFlowMatrixInternalEnergy
density = 2650
specific_heat_capacity = 1000
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 1e3
nl_abs_tol = 1e-12
[./TimeStepper]
type = IterationAdaptiveDT
dt = 10
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Postprocessors]
[./density_water]
type = ElementAverageValue
variable = density_water
execute_on = 'initial timestep_end'
[../]
[./density_gas]
type = ElementAverageValue
variable = density_gas
execute_on = 'initial timestep_end'
[../]
[./viscosity_water]
type = ElementAverageValue
variable = viscosity_water
execute_on = 'initial timestep_end'
[../]
[./viscosity_gas]
type = ElementAverageValue
variable = viscosity_gas
execute_on = 'initial timestep_end'
[../]
[./enthalpy_water]
type = ElementAverageValue
variable = enthalpy_water
execute_on = 'initial timestep_end'
[../]
[./enthalpy_gas]
type = ElementAverageValue
variable = enthalpy_gas
execute_on = 'initial timestep_end'
[../]
[./sg]
type = ElementAverageValue
variable = saturation_gas
execute_on = 'initial timestep_end'
[../]
[./sw]
type = ElementAverageValue
variable = saturation_water
execute_on = 'initial timestep_end'
[../]
[./pwater]
type = ElementAverageValue
variable = pressure_water
execute_on = 'initial timestep_end'
[../]
[./pgas]
type = ElementAverageValue
variable = pressure_gas
execute_on = 'initial timestep_end'
[../]
[./temperature]
type = ElementAverageValue
variable = temperature
execute_on = 'initial timestep_end'
[../]
[./enthalpy]
type = ElementAverageValue
variable = h
execute_on = 'initial timestep_end'
[../]
[./pliq]
type = ElementAverageValue
variable = pliq
execute_on = 'initial timestep_end'
[../]
[./liquid_mass]
type = PorousFlowFluidMass
phase = 0
execute_on = 'initial timestep_end'
[../]
[./vapor_mass]
type = PorousFlowFluidMass
phase = 1
execute_on = 'initial timestep_end'
[../]
[./liquid_heat]
type = PorousFlowHeatEnergy
phase = 0
execute_on = 'initial timestep_end'
[../]
[./vapor_heat]
type = PorousFlowHeatEnergy
phase = 1
execute_on = 'initial timestep_end'
[../]
[./e_water]
type = ElementAverageValue
variable = e_water
execute_on = 'initial timestep_end'
[../]
[./e_gas]
type = ElementAverageValue
variable = e_gas
execute_on = 'initial timestep_end'
[../]
[]
[Outputs]
csv = true
perf_graph = false
[]
modules/porous_flow/test/tests/jacobian/waterncg_twophase.i
# Tests correct calculation of properties derivatives in PorousFlowWaterNCG
# for conditions for two phases
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[Variables]
[./pgas]
[../]
[./z]
[../]
[]
[ICs]
[./pgas]
type = RandomIC
min = 1e5
max = 5e5
variable = pgas
[../]
[./z]
type = RandomIC
min = 0.01
max = 0.06
variable = z
[../]
[]
[Kernels]
[./mass0]
type = PorousFlowMassTimeDerivative
variable = pgas
fluid_component = 0
[../]
[./mass1]
type = PorousFlowMassTimeDerivative
variable = z
fluid_component = 1
[../]
[./adv0]
type = PorousFlowAdvectiveFlux
variable = pgas
fluid_component = 0
[../]
[./adv1]
type = PorousFlowAdvectiveFlux
variable = z
fluid_component = 1
[../]
[]
[UserObjects]
[./dictator]
type = PorousFlowDictator
porous_flow_vars = 'pgas z'
number_fluid_phases = 2
number_fluid_components = 2
[../]
[./pc]
type = PorousFlowCapillaryPressureVG
m = 0.5
alpha = 1e1
pc_max = 1e4
[../]
[./fs]
type = PorousFlowWaterNCG
water_fp = water
gas_fp = co2
capillary_pressure = pc
[../]
[]
[Modules]
[./FluidProperties]
[./co2]
type = CO2FluidProperties
[../]
[./water]
type = Water97FluidProperties
[../]
[../]
[]
[Materials]
[./temperature]
type = PorousFlowTemperature
temperature = 50
[../]
[./waterncg]
type = PorousFlowFluidState
gas_porepressure = pgas
z = z
temperature_unit = Celsius
capillary_pressure = pc
fluid_state = fs
[../]
[./permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-12 0 0 0 1e-12 0 0 0 1e-12'
[../]
[./relperm0]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
[../]
[./relperm1]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 1
[../]
[./porosity]
type = PorousFlowPorosityConst
porosity = 0.1
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
dt = 1
end_time = 1
nl_abs_tol = 1e-12
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[AuxVariables]
[./sgas]
family = MONOMIAL
order = CONSTANT
[../]
[]
[AuxKernels]
[./sgas]
type = PorousFlowPropertyAux
property = saturation
phase = 1
variable = sgas
[../]
[]
[Postprocessors]
[./sgas_min]
type = ElementExtremeValue
variable = sgas
value_type = min
[../]
[./sgas_max]
type = ElementExtremeValue
variable = sgas
value_type = max
[../]
[]
modules/porous_flow/test/tests/jacobian/brineco2_liquid.i
# Tests correct calculation of properties derivatives in PorousFlowFluidState
# for conditions that give a single liquid phase
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[AuxVariables]
[./xnacl]
initial_condition = 0.05
[../]
[]
[Variables]
[./pgas]
[../]
[./zi]
[../]
[]
[ICs]
[./pgas]
type = RandomIC
min = 5e6
max = 8e6
variable = pgas
[../]
[./z_liquid]
type = RandomIC
min = 0.01
max = 0.03
variable = zi
[../]
[]
[Kernels]
[./mass0]
type = PorousFlowMassTimeDerivative
variable = pgas
fluid_component = 0
[../]
[./mass1]
type = PorousFlowMassTimeDerivative
variable = zi
fluid_component = 1
[../]
[./adv0]
type = PorousFlowAdvectiveFlux
variable = pgas
fluid_component = 0
[../]
[./adv1]
type = PorousFlowAdvectiveFlux
variable = zi
fluid_component = 1
[../]
[]
[UserObjects]
[./dictator]
type = PorousFlowDictator
porous_flow_vars = 'pgas zi'
number_fluid_phases = 2
number_fluid_components = 2
[../]
[./pc]
type = PorousFlowCapillaryPressureVG
m = 0.5
alpha = 1
pc_max = 1e4
[../]
[./fs]
type = PorousFlowBrineCO2
brine_fp = brine
co2_fp = co2
capillary_pressure = pc
[../]
[]
[Modules]
[./FluidProperties]
[./co2]
type = CO2FluidProperties
[../]
[./brine]
type = BrineFluidProperties
[../]
[./water]
type = Water97FluidProperties
[../]
[../]
[]
[Materials]
[./temperature]
type = PorousFlowTemperature
temperature = 50
[../]
[./brineco2]
type = PorousFlowFluidState
gas_porepressure = pgas
z = zi
temperature_unit = Celsius
xnacl = xnacl
capillary_pressure = pc
fluid_state = fs
[../]
[./permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-12 0 0 0 1e-12 0 0 0 1e-12'
[../]
[./relperm0]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
[../]
[./relperm1]
type = PorousFlowRelativePermeabilityCorey
n = 3
phase = 1
[../]
[./porosity]
type = PorousFlowPorosityConst
porosity = 0.1
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
dt = 1
end_time = 1
nl_abs_tol = 1e-12
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[AuxVariables]
[./sgas]
family = MONOMIAL
order = CONSTANT
[../]
[]
[AuxKernels]
[./sgas]
type = PorousFlowPropertyAux
property = saturation
phase = 1
variable = sgas
[../]
[]
[Postprocessors]
[./sgas_min]
type = ElementExtremeValue
variable = sgas
value_type = min
[../]
[./sgas_max]
type = ElementExtremeValue
variable = sgas
value_type = max
[../]
[]
modules/porous_flow/test/tests/jacobian/waterncg_liquid.i
# Tests correct calculation of properties derivatives in PorousFlowWaterNCG
# for conditions that give a single liquid phase
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[Variables]
[./pgas]
[../]
[./z]
[../]
[]
[ICs]
[./pgas]
type = RandomIC
min = 6e6
max = 8e6
variable = pgas
[../]
[./z]
type = RandomIC
min = 0.01
max = 0.05
variable = z
[../]
[]
[Kernels]
[./mass0]
type = PorousFlowMassTimeDerivative
variable = pgas
fluid_component = 0
[../]
[./mass1]
type = PorousFlowMassTimeDerivative
variable = z
fluid_component = 1
[../]
[./adv0]
type = PorousFlowAdvectiveFlux
variable = pgas
fluid_component = 0
[../]
[./adv1]
type = PorousFlowAdvectiveFlux
variable = z
fluid_component = 1
[../]
[]
[UserObjects]
[./dictator]
type = PorousFlowDictator
porous_flow_vars = 'pgas z'
number_fluid_phases = 2
number_fluid_components = 2
[../]
[./pc]
type = PorousFlowCapillaryPressureVG
m = 0.5
alpha = 1
pc_max = 1e4
[../]
[./fs]
type = PorousFlowWaterNCG
water_fp = water
gas_fp = co2
capillary_pressure = pc
[../]
[]
[Modules]
[./FluidProperties]
[./co2]
type = CO2FluidProperties
[../]
[./water]
type = Water97FluidProperties
[../]
[../]
[]
[Materials]
[./temperature]
type = PorousFlowTemperature
temperature = 50
[../]
[./waterncg]
type = PorousFlowFluidState
gas_porepressure = pgas
z = z
temperature_unit = Celsius
capillary_pressure = pc
fluid_state = fs
[../]
[./permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-12 0 0 0 1e-12 0 0 0 1e-12'
[../]
[./relperm0]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
[../]
[./relperm1]
type = PorousFlowRelativePermeabilityCorey
n = 3
phase = 1
[../]
[./porosity]
type = PorousFlowPorosityConst
porosity = 0.1
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
dt = 1
end_time = 1
nl_abs_tol = 1e-12
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[AuxVariables]
[./sgas]
family = MONOMIAL
order = CONSTANT
[../]
[]
[AuxKernels]
[./sgas]
type = PorousFlowPropertyAux
property = saturation
phase = 1
variable = sgas
[../]
[]
[Postprocessors]
[./sgas_min]
type = ElementExtremeValue
variable = sgas
value_type = min
[../]
[./sgas_max]
type = ElementExtremeValue
variable = sgas
value_type = max
[../]
[]
modules/porous_flow/test/tests/fluids/brine1_tabulated.i
# Test the density and viscosity calculated by the brine material using a
# TabulatedFluidProperties userobject for water
# Pressure 20 MPa
# Temperature 50C
# xnacl = 0.1047 (equivalent to 2.0 molality)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pp'
number_fluid_phases = 1
number_fluid_components = 1
[]
[]
[Variables]
[pp]
initial_condition = 20e6
[]
[]
[Kernels]
[dummy]
type = Diffusion
variable = pp
[]
[]
[AuxVariables]
[temp]
initial_condition = 50
[]
[xnacl]
initial_condition = 0.1047
[]
[]
[Modules]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[watertab]
type = TabulatedFluidProperties
fp = water
save_file = false
[]
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = temp
[]
[ppss]
type = PorousFlow1PhaseFullySaturated
porepressure = pp
[]
[brine]
type = PorousFlowBrine
water_fp = watertab
temperature_unit = Celsius
xnacl = 0.1047
phase = 0
[]
[]
[Executioner]
type = Steady
solve_type = Newton
[]
[Postprocessors]
[pressure]
type = ElementIntegralVariablePostprocessor
variable = pp
[]
[temperature]
type = ElementIntegralVariablePostprocessor
variable = temp
[]
[xnacl]
type = ElementIntegralVariablePostprocessor
variable = xnacl
[]
[density]
type = ElementIntegralMaterialProperty
mat_prop = 'PorousFlow_fluid_phase_density_qp0'
[]
[viscosity]
type = ElementIntegralMaterialProperty
mat_prop = 'PorousFlow_viscosity_qp0'
[]
[enthalpy]
type = ElementIntegralMaterialProperty
mat_prop = 'PorousFlow_fluid_phase_enthalpy_qp0'
[]
[internal_energy]
type = ElementIntegralMaterialProperty
mat_prop = 'PorousFlow_fluid_phase_internal_energy_qp0'
[]
[]
[Outputs]
execute_on = 'timestep_end'
file_base = brine1
csv = true
[]
modules/porous_flow/examples/tutorial/05.i
# Darcy flow with heat advection and conduction, using Water97 properties
[Mesh]
[annular]
type = AnnularMeshGenerator
nr = 10
rmin = 1.0
rmax = 10
growth_r = 1.4
nt = 4
dmin = 0
dmax = 90
[]
[./make3D]
type = MeshExtruderGenerator
extrusion_vector = '0 0 12'
num_layers = 3
bottom_sideset = 'bottom'
top_sideset = 'top'
input = annular
[../]
[./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_subdomain_ids = 1
new_sideset_name = 'injection_area'
input = 'aquifer'
[../]
[./rename]
type = RenameBlockGenerator
old_block_id = '0 1'
new_block_name = 'caps aquifer'
input = 'injection_area'
[../]
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Variables]
[./porepressure]
initial_condition = 1E6
[../]
[./temperature]
initial_condition = 313
scaling = 1E-8
[../]
[]
[PorousFlowBasicTHM]
porepressure = porepressure
temperature = temperature
coupling_type = ThermoHydro
gravity = '0 0 0'
fp = the_simple_fluid
[]
[BCs]
[./constant_injection_porepressure]
type = DirichletBC
variable = porepressure
value = 2E6
boundary = injection_area
[../]
[./constant_injection_temperature]
type = DirichletBC
variable = temperature
value = 333
boundary = injection_area
[../]
[]
[Modules]
[./FluidProperties]
[./the_simple_fluid]
type = Water97FluidProperties
[../]
[../]
[]
[Materials]
[./porosity]
type = PorousFlowPorosity
porosity_zero = 0.1
[../]
[./biot_modulus]
type = PorousFlowConstantBiotModulus
biot_coefficient = 0.8
solid_bulk_compliance = 2E-7
fluid_bulk_modulus = 1E7
[../]
[./permeability_aquifer]
type = PorousFlowPermeabilityConst
block = aquifer
permeability = '1E-14 0 0 0 1E-14 0 0 0 1E-14'
[../]
[./permeability_caps]
type = PorousFlowPermeabilityConst
block = caps
permeability = '1E-15 0 0 0 1E-15 0 0 0 1E-16'
[../]
[./thermal_expansion]
type = PorousFlowConstantThermalExpansionCoefficient
biot_coefficient = 0.8
drained_coefficient = 0.003
fluid_coefficient = 0.0002
[../]
[./rock_internal_energy]
type = PorousFlowMatrixInternalEnergy
density = 2500.0
specific_heat_capacity = 1200.0
[../]
[./thermal_conductivity]
type = PorousFlowThermalConductivityIdeal
dry_thermal_conductivity = '10 0 0 0 10 0 0 0 10'
block = 'caps aquifer'
[../]
[]
[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 = 1E6
dt = 1E5
nl_abs_tol = 1E-10
[]
[Outputs]
exodus = true
[]
modules/porous_flow/test/tests/jacobian/brineco2_gas.i
# Tests correct calculation of properties derivatives in PorousFlowFluidState
# for conditions that give a single gas phase
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[AuxVariables]
[./xnacl]
initial_condition = 0.05
[../]
[]
[Variables]
[./pgas]
[../]
[./zi]
[../]
[]
[ICs]
[./pgas]
type = RandomIC
min = 5e4
max = 1e5
variable = pgas
[../]
[./z]
type = RandomIC
min = 0.9
max = 0.99
variable = zi
[../]
[]
[Kernels]
[./mass0]
type = PorousFlowMassTimeDerivative
variable = pgas
fluid_component = 0
[../]
[./mass1]
type = PorousFlowMassTimeDerivative
variable = zi
fluid_component = 1
[../]
[./adv0]
type = PorousFlowAdvectiveFlux
variable = pgas
fluid_component = 0
[../]
[./adv1]
type = PorousFlowAdvectiveFlux
variable = zi
fluid_component = 1
[../]
[]
[UserObjects]
[./dictator]
type = PorousFlowDictator
porous_flow_vars = 'pgas zi'
number_fluid_phases = 2
number_fluid_components = 2
[../]
[./pc]
type = PorousFlowCapillaryPressureVG
m = 0.5
alpha = 1
pc_max = 1e3
[../]
[./fs]
type = PorousFlowBrineCO2
brine_fp = brine
co2_fp = co2
capillary_pressure = pc
[../]
[]
[Modules]
[./FluidProperties]
[./co2]
type = CO2FluidProperties
[../]
[./brine]
type = BrineFluidProperties
[../]
[./water]
type = Water97FluidProperties
[../]
[../]
[]
[Materials]
[./temperature]
type = PorousFlowTemperature
temperature = 50
[../]
[./brineco2]
type = PorousFlowFluidState
gas_porepressure = pgas
z = zi
temperature_unit = Celsius
xnacl = xnacl
capillary_pressure = pc
fluid_state = fs
[../]
[./permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-12 0 0 0 1e-12 0 0 0 1e-12'
[../]
[./relperm0]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
[../]
[./relperm1]
type = PorousFlowRelativePermeabilityCorey
n = 3
phase = 1
[../]
[./porosity]
type = PorousFlowPorosityConst
porosity = 0.1
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
dt = 1
end_time = 1
nl_abs_tol = 1e-12
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[AuxVariables]
[./sgas]
family = MONOMIAL
order = CONSTANT
[../]
[]
[AuxKernels]
[./sgas]
type = PorousFlowPropertyAux
property = saturation
phase = 1
variable = sgas
[../]
[]
[Postprocessors]
[./sgas_min]
type = ElementExtremeValue
variable = sgas
value_type = min
[../]
[./sgas_max]
type = ElementExtremeValue
variable = sgas
value_type = max
[../]
[]
modules/porous_flow/test/tests/fluidstate/waterncg_nonisothermal.i
[Mesh]
[./mesh]
type = GeneratedMeshGenerator
dim = 2
[../]
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Variables]
[./pgas]
initial_condition = 1e6
[../]
[./z]
initial_condition = 0.25
[../]
[./temperature]
initial_condition = 70
[../]
[]
[AuxVariables]
[./pressure_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./pressure_water]
order = CONSTANT
family = MONOMIAL
[../]
[./saturation_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./saturation_water]
order = CONSTANT
family = MONOMIAL
[../]
[./density_water]
order = CONSTANT
family = MONOMIAL
[../]
[./density_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./viscosity_water]
order = CONSTANT
family = MONOMIAL
[../]
[./viscosity_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./enthalpy_water]
order = CONSTANT
family = MONOMIAL
[../]
[./enthalpy_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./internal_energy_water]
order = CONSTANT
family = MONOMIAL
[../]
[./internal_energy_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./x0_water]
order = CONSTANT
family = MONOMIAL
[../]
[./x0_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./x1_water]
order = CONSTANT
family = MONOMIAL
[../]
[./x1_gas]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./pressure_water]
type = PorousFlowPropertyAux
variable = pressure_water
property = pressure
phase = 0
execute_on = timestep_end
[../]
[./pressure_gas]
type = PorousFlowPropertyAux
variable = pressure_gas
property = pressure
phase = 1
execute_on = timestep_end
[../]
[./saturation_water]
type = PorousFlowPropertyAux
variable = saturation_water
property = saturation
phase = 0
execute_on = timestep_end
[../]
[./saturation_gas]
type = PorousFlowPropertyAux
variable = saturation_gas
property = saturation
phase = 1
execute_on = timestep_end
[../]
[./density_water]
type = PorousFlowPropertyAux
variable = density_water
property = density
phase = 0
execute_on = timestep_end
[../]
[./density_gas]
type = PorousFlowPropertyAux
variable = density_gas
property = density
phase = 1
execute_on = timestep_end
[../]
[./viscosity_water]
type = PorousFlowPropertyAux
variable = viscosity_water
property = viscosity
phase = 0
execute_on = timestep_end
[../]
[./viscosity_gas]
type = PorousFlowPropertyAux
variable = viscosity_gas
property = viscosity
phase = 1
execute_on = timestep_end
[../]
[./enthalpy_water]
type = PorousFlowPropertyAux
variable = enthalpy_water
property = enthalpy
phase = 0
execute_on = timestep_end
[../]
[./enthalpy_gas]
type = PorousFlowPropertyAux
variable = enthalpy_gas
property = enthalpy
phase = 1
execute_on = timestep_end
[../]
[./internal_energy_water]
type = PorousFlowPropertyAux
variable = internal_energy_water
property = internal_energy
phase = 0
execute_on = timestep_end
[../]
[./internal_energy_gas]
type = PorousFlowPropertyAux
variable = internal_energy_gas
property = internal_energy
phase = 1
execute_on = timestep_end
[../]
[./x1_water]
type = PorousFlowPropertyAux
variable = x1_water
property = mass_fraction
phase = 0
fluid_component = 1
execute_on = timestep_end
[../]
[./x1_gas]
type = PorousFlowPropertyAux
variable = x1_gas
property = mass_fraction
phase = 1
fluid_component = 1
execute_on = timestep_end
[../]
[./x0_water]
type = PorousFlowPropertyAux
variable = x0_water
property = mass_fraction
phase = 0
fluid_component = 0
execute_on = timestep_end
[../]
[./x0_gas]
type = PorousFlowPropertyAux
variable = x0_gas
property = mass_fraction
phase = 1
fluid_component = 0
execute_on = timestep_end
[../]
[]
[Kernels]
[./mass0]
type = PorousFlowMassTimeDerivative
variable = pgas
fluid_component = 0
[../]
[./mass1]
type = PorousFlowMassTimeDerivative
variable = z
fluid_component = 1
[../]
[./heat]
type = TimeDerivative
variable = temperature
[../]
[]
[UserObjects]
[./dictator]
type = PorousFlowDictator
porous_flow_vars = 'pgas z '
number_fluid_phases = 2
number_fluid_components = 2
[../]
[./pc]
type = PorousFlowCapillaryPressureConst
pc = 0
[../]
[./fs]
type = PorousFlowWaterNCG
water_fp = water
gas_fp = co2
capillary_pressure = pc
[../]
[]
[Modules]
[./FluidProperties]
[./co2]
type = CO2FluidProperties
[../]
[./water]
type = Water97FluidProperties
[../]
[../]
[]
[Materials]
[./temperature]
type = PorousFlowTemperature
temperature = temperature
[../]
[./waterncg]
type = PorousFlowFluidState
gas_porepressure = pgas
z = z
temperature = temperature
temperature_unit = Celsius
capillary_pressure = pc
fluid_state = fs
[../]
[./permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-12 0 0 0 1e-12 0 0 0 1e-12'
[../]
[./relperm0]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
[../]
[./relperm1]
type = PorousFlowRelativePermeabilityCorey
n = 3
phase = 1
[../]
[./porosity]
type = PorousFlowPorosityConst
porosity = 0.1
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
dt = 1
end_time = 1
nl_abs_tol = 1e-12
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Postprocessors]
[./density_water]
type = ElementIntegralVariablePostprocessor
variable = density_water
[../]
[./density_gas]
type = ElementIntegralVariablePostprocessor
variable = density_gas
[../]
[./viscosity_water]
type = ElementIntegralVariablePostprocessor
variable = viscosity_water
[../]
[./viscosity_gas]
type = ElementIntegralVariablePostprocessor
variable = viscosity_gas
[../]
[./enthalpy_water]
type = ElementIntegralVariablePostprocessor
variable = enthalpy_water
[../]
[./enthalpy_gas]
type = ElementIntegralVariablePostprocessor
variable = enthalpy_gas
[../]
[./internal_energy_water]
type = ElementIntegralVariablePostprocessor
variable = internal_energy_water
[../]
[./internal_energy_gas]
type = ElementIntegralVariablePostprocessor
variable = internal_energy_gas
[../]
[./x0_water]
type = ElementIntegralVariablePostprocessor
variable = x0_water
[../]
[./x1_gas]
type = ElementIntegralVariablePostprocessor
variable = x1_gas
[../]
[./x0_gas]
type = ElementIntegralVariablePostprocessor
variable = x0_gas
[../]
[./sg]
type = ElementIntegralVariablePostprocessor
variable = saturation_gas
[../]
[./sw]
type = ElementIntegralVariablePostprocessor
variable = saturation_water
[../]
[./pwater]
type = ElementIntegralVariablePostprocessor
variable = pressure_water
[../]
[./pgas]
type = ElementIntegralVariablePostprocessor
variable = pressure_gas
[../]
[./x0mass]
type = PorousFlowFluidMass
fluid_component = 0
phase = '0 1'
[../]
[./x1mass]
type = PorousFlowFluidMass
fluid_component = 1
phase = '0 1'
[../]
[]
[Outputs]
csv = true
execute_on = timestep_end
[]
modules/porous_flow/test/tests/fluidstate/water_vapor.i
# Tests correct calculation of properties in PorousFlowWaterVapor in the two-phase region
[Mesh]
type = GeneratedMesh
dim = 2
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Variables]
[./pliq]
initial_condition = 1e6
[../]
[./h]
initial_condition = 8e5
scaling = 1e-3
[../]
[]
[AuxVariables]
[./pressure_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./pressure_water]
order = CONSTANT
family = MONOMIAL
[../]
[./enthalpy_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./enthalpy_water]
order = CONSTANT
family = MONOMIAL
[../]
[./saturation_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./saturation_water]
order = CONSTANT
family = MONOMIAL
[../]
[./density_water]
order = CONSTANT
family = MONOMIAL
[../]
[./density_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./viscosity_water]
order = CONSTANT
family = MONOMIAL
[../]
[./viscosity_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./temperature]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./enthalpy_water]
type = PorousFlowPropertyAux
variable = enthalpy_water
property = enthalpy
phase = 0
execute_on = 'initial timestep_end'
[../]
[./enthalpy_gas]
type = PorousFlowPropertyAux
variable = enthalpy_gas
property = enthalpy
phase = 1
execute_on = 'initial timestep_end'
[../]
[./pressure_water]
type = PorousFlowPropertyAux
variable = pressure_water
property = pressure
phase = 0
execute_on = 'initial timestep_end'
[../]
[./pressure_gas]
type = PorousFlowPropertyAux
variable = pressure_gas
property = pressure
phase = 1
execute_on = 'initial timestep_end'
[../]
[./saturation_water]
type = PorousFlowPropertyAux
variable = saturation_water
property = saturation
phase = 0
execute_on = 'initial timestep_end'
[../]
[./saturation_gas]
type = PorousFlowPropertyAux
variable = saturation_gas
property = saturation
phase = 1
execute_on = 'initial timestep_end'
[../]
[./density_water]
type = PorousFlowPropertyAux
variable = density_water
property = density
phase = 0
execute_on = 'initial timestep_end'
[../]
[./density_gas]
type = PorousFlowPropertyAux
variable = density_gas
property = density
phase = 1
execute_on = 'initial timestep_end'
[../]
[./viscosity_water]
type = PorousFlowPropertyAux
variable = viscosity_water
property = viscosity
phase = 0
execute_on = 'initial timestep_end'
[../]
[./viscosity_gas]
type = PorousFlowPropertyAux
variable = viscosity_gas
property = viscosity
phase = 1
execute_on = 'initial timestep_end'
[../]
[./temperature]
type = PorousFlowPropertyAux
variable = temperature
property = temperature
execute_on = 'initial timestep_end'
[../]
[]
[Kernels]
[./mass]
type = PorousFlowMassTimeDerivative
variable = pliq
[../]
[./heat]
type = PorousFlowEnergyTimeDerivative
variable = h
[../]
[]
[UserObjects]
[./dictator]
type = PorousFlowDictator
porous_flow_vars = 'pliq h'
number_fluid_phases = 2
number_fluid_components = 1
[../]
[./pc]
type = PorousFlowCapillaryPressureBC
pe = 1e5
lambda = 2
pc_max = 1e6
[../]
[./fs]
type = PorousFlowWaterVapor
water_fp = water
capillary_pressure = pc
[../]
[]
[Modules]
[./FluidProperties]
[./water]
type = Water97FluidProperties
[../]
[../]
[]
[Materials]
[./watervapor]
type = PorousFlowFluidStateSingleComponent
porepressure = pliq
enthalpy = h
temperature_unit = Celsius
capillary_pressure = pc
fluid_state = fs
[../]
[./permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-13 0 0 0 1e-13 0 0 0 1e-13'
[../]
[./relperm0]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
[../]
[./relperm1]
type = PorousFlowRelativePermeabilityCorey
n = 3
phase = 1
[../]
[./porosity]
type = PorousFlowPorosityConst
porosity = 0.1
[../]
[./internal_energy]
type = PorousFlowMatrixInternalEnergy
density = 2500
specific_heat_capacity = 1200
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 1
nl_abs_tol = 1e-12
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Postprocessors]
[./density_water]
type = ElementAverageValue
variable = density_water
execute_on = 'initial timestep_end'
[../]
[./density_gas]
type = ElementAverageValue
variable = density_gas
execute_on = 'initial timestep_end'
[../]
[./viscosity_water]
type = ElementAverageValue
variable = viscosity_water
execute_on = 'initial timestep_end'
[../]
[./viscosity_gas]
type = ElementAverageValue
variable = viscosity_gas
execute_on = 'initial timestep_end'
[../]
[./enthalpy_water]
type = ElementAverageValue
variable = enthalpy_water
execute_on = 'initial timestep_end'
[../]
[./enthalpy_gas]
type = ElementAverageValue
variable = enthalpy_gas
execute_on = 'initial timestep_end'
[../]
[./sg]
type = ElementAverageValue
variable = saturation_gas
execute_on = 'initial timestep_end'
[../]
[./sw]
type = ElementAverageValue
variable = saturation_water
execute_on = 'initial timestep_end'
[../]
[./pwater]
type = ElementAverageValue
variable = pressure_water
execute_on = 'initial timestep_end'
[../]
[./pgas]
type = ElementAverageValue
variable = pressure_gas
execute_on = 'initial timestep_end'
[../]
[./temperature]
type = ElementAverageValue
variable = temperature
execute_on = 'initial timestep_end'
[../]
[./enthalpy]
type = ElementAverageValue
variable = h
execute_on = 'initial timestep_end'
[../]
[./liquid_mass]
type = PorousFlowFluidMass
phase = 0
execute_on = 'initial timestep_end'
[../]
[./vapor_mass]
type = PorousFlowFluidMass
phase = 1
execute_on = 'initial timestep_end'
[../]
[]
[Outputs]
file_base = water_vapor_twophase
csv = true
[]
modules/porous_flow/test/tests/fluidstate/theis_nonisothermal.i
# Two-phase nonisothermal Theis problem: Flow from single source using WaterNCG fluidstate.
# Constant rate injection 2 kg/s of cold gas into warm reservoir
# 1D cylindrical mesh
# Initially, system has only a liquid phase, until enough gas is injected
# to form a gas phase, in which case the system becomes two phase.
[Mesh]
[./mesh]
type = GeneratedMeshGenerator
dim = 1
nx = 40
xmin = 0.1
xmax = 200
bias_x = 1.05
[../]
[]
[Problem]
type = FEProblem
coord_type = RZ
rz_coord_axis = Y
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[AuxVariables]
[./saturation_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./x1]
order = CONSTANT
family = MONOMIAL
[../]
[./y0]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./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 = 20e6
[../]
[./zi]
initial_condition = 0
[../]
[./temperature]
initial_condition = 70
[../]
[]
[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
[../]
[./energy]
type = PorousFlowEnergyTimeDerivative
variable = temperature
[../]
[./heatadv]
type = PorousFlowHeatAdvection
variable = temperature
[../]
[./conduction]
type = PorousFlowHeatConduction
variable = temperature
[../]
[]
[UserObjects]
[./dictator]
type = PorousFlowDictator
porous_flow_vars = 'pgas zi temperature'
number_fluid_phases = 2
number_fluid_components = 2
[../]
[./pc]
type = PorousFlowCapillaryPressureConst
pc = 0
[../]
[./fs]
type = PorousFlowWaterNCG
water_fp = water
gas_fp = methane
capillary_pressure = pc
[../]
[]
[Modules]
[./FluidProperties]
[./methane]
type = MethaneFluidProperties
[../]
[./water]
type = Water97FluidProperties
[../]
[../]
[]
[Materials]
[./temperature]
type = PorousFlowTemperature
temperature = temperature
[../]
[./waterncg]
type = PorousFlowFluidState
gas_porepressure = pgas
z = zi
temperature = temperature
temperature_unit = Celsius
capillary_pressure = pc
fluid_state = fs
[../]
[./porosity]
type = PorousFlowPorosityConst
porosity = 0.2
[../]
[./permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-12 0 0 0 1e-12 0 0 0 1e-12'
[../]
[./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
[../]
[./rockheat]
type = PorousFlowMatrixInternalEnergy
specific_heat_capacity = 1000
density = 2500
[../]
[./rock_thermal_conductivity]
type = PorousFlowThermalConductivityIdeal
dry_thermal_conductivity = '50 0 0 0 50 0 0 0 50'
[../]
[]
[BCs]
[./cold_gas]
type = DirichletBC
boundary = left
variable = temperature
value = 20
[../]
[./gas_injecton]
type = PorousFlowSink
boundary = left
variable = zi
flux_function = -0.159155
[../]
[./rightwater]
type = DirichletBC
boundary = right
value = 20e6
variable = pgas
[../]
[./righttemp]
type = DirichletBC
boundary = right
value = 70
variable = temperature
[../]
[]
[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
end_time = 1e4
automatic_scaling = true
nl_abs_tol = 1e-7
nl_rel_tol = 1e-5
[./TimeStepper]
type = IterationAdaptiveDT
dt = 1
growth_factor = 1.5
[../]
[]
[Postprocessors]
[./pgas]
type = PointValue
point = '2 0 0'
variable = pgas
[../]
[./sgas]
type = PointValue
point = '2 0 0'
variable = saturation_gas
[../]
[./zi]
type = PointValue
point = '2 0 0'
variable = zi
[../]
[./temperature]
type = PointValue
point = '2 0 0'
variable = temperature
[../]
[./massgas]
type = PorousFlowFluidMass
fluid_component = 1
[../]
[./x1]
type = PointValue
point = '2 0 0'
variable = x1
[../]
[./y0]
type = PointValue
point = '2 0 0'
variable = y0
[../]
[]
[Outputs]
print_linear_residuals = false
perf_graph = true
csv = true
[]
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
[../]
[]
[Modules]
[./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
[../]
[]
modules/porous_flow/test/tests/fluidstate/theis.i
# Two phase Theis problem: Flow from single source using WaterNCG fluidstate.
# Constant rate injection 2 kg/s
# 1D cylindrical mesh
# Initially, system has only a liquid phase, until enough gas is injected
# to form a gas phase, in which case the system becomes two phase.
[Mesh]
type = GeneratedMesh
dim = 1
nx = 40
xmax = 200
bias_x = 1.05
[]
[Problem]
type = FEProblem
coord_type = RZ
rz_coord_axis = Y
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[AuxVariables]
[./saturation_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./x1]
order = CONSTANT
family = MONOMIAL
[../]
[./y0]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./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 = 20e6
[../]
[./zi]
initial_condition = 0
[../]
[]
[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 = 2
[../]
[./pc]
type = PorousFlowCapillaryPressureConst
pc = 0
[../]
[./fs]
type = PorousFlowWaterNCG
water_fp = water
gas_fp = co2
capillary_pressure = pc
[../]
[]
[Modules]
[./FluidProperties]
[./co2]
type = CO2FluidProperties
[../]
[./water]
type = Water97FluidProperties
[../]
[../]
[]
[Materials]
[./temperature]
type = PorousFlowTemperature
[../]
[./waterncg]
type = PorousFlowFluidState
gas_porepressure = pgas
z = zi
temperature_unit = Celsius
capillary_pressure = pc
fluid_state = fs
[../]
[./porosity]
type = PorousFlowPorosityConst
porosity = 0.2
[../]
[./permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-12 0 0 0 1e-12 0 0 0 1e-12'
[../]
[./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
[../]
[]
[BCs]
[./rightwater]
type = DirichletBC
boundary = right
value = 20e6
variable = pgas
[../]
[]
[DiracKernels]
[./source]
type = PorousFlowSquarePulsePointSource
point = '0 0 0'
mass_flux = 2
variable = zi
[../]
[]
[Preconditioning]
[./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 1E-8 1E-10 20'
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 2e2
[./TimeStepper]
type = IterationAdaptiveDT
dt = 10
growth_factor = 2
[../]
[]
[VectorPostprocessors]
[./line]
type = NodalValueSampler
sort_by = x
variable = 'pgas zi'
execute_on = 'timestep_end'
[../]
[]
[Postprocessors]
[./pgas]
type = PointValue
point = '1 0 0'
variable = pgas
[../]
[./sgas]
type = PointValue
point = '1 0 0'
variable = saturation_gas
[../]
[./zi]
type = PointValue
point = '1 0 0'
variable = zi
[../]
[./massgas]
type = PorousFlowFluidMass
fluid_component = 1
[../]
[./x1]
type = PointValue
point = '1 0 0'
variable = x1
[../]
[./y0]
type = PointValue
point = '1 0 0'
variable = y0
[../]
[]
[Outputs]
print_linear_residuals = false
perf_graph = true
[./csvout]
type = CSV
execute_on = timestep_end
execute_vector_postprocessors_on = final
[../]
[]
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_subdomain_ids = 1
new_sideset_name = 'injection_area'
input = 'aquifer'
[../]
[./rename]
type = RenameBlockGenerator
old_block_id = '0 1'
new_block_name = '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
use_displaced_mesh = false
variable = pwater
[../]
[./flux_water]
type = PorousFlowAdvectiveFlux
fluid_component = 0
use_displaced_mesh = false
variable = pwater
[../]
[./vol_strain_rate_water]
type = PorousFlowMassVolumetricExpansion
fluid_component = 0
use_displaced_mesh = false
variable = pwater
[../]
[./mass_co2_dot]
type = PorousFlowMassTimeDerivative
fluid_component = 1
use_displaced_mesh = false
variable = pgas
[../]
[./flux_co2]
type = PorousFlowAdvectiveFlux
fluid_component = 1
use_displaced_mesh = false
variable = pgas
[../]
[./vol_strain_rate_co2]
type = PorousFlowMassVolumetricExpansion
fluid_component = 1
use_displaced_mesh = false
variable = pgas
[../]
[./energy_dot]
type = PorousFlowEnergyTimeDerivative
use_displaced_mesh = false
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
use_displaced_mesh = false
variable = T
[../]
[./grad_stress_x]
type = StressDivergenceTensors
temperature = T
variable = disp_x
thermal_eigenstrain_name = 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
thermal_eigenstrain_name = 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
args = 'pwater pgas swater sgas'
function = '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
[../]
[]
[Modules]
[./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]
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]
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
vars = effective_fluid_pressure_at_wellbore
vals = effective_fluid_pressure_at_wellbore
value = '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/porous_flow/test/tests/jacobian/waterncg_twophase_nonisothermal.i
# Tests correct calculation of properties derivatives in PorousFlowWaterNCG
# for nonisothermal two phase conditions
[Mesh]
[./mesh]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
[../]
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[Variables]
[./pgas]
[../]
[./z]
[../]
[./temperature]
[../]
[]
[ICs]
[./pgas]
type = RandomIC
min = 1e5
max = 5e5
variable = pgas
[../]
[./z]
type = RandomIC
min = 0.01
max = 0.06
variable = z
[../]
[./temperature]
type = RandomIC
min = 20
max = 80
variable = temperature
[../]
[]
[Kernels]
[./mass0]
type = PorousFlowMassTimeDerivative
variable = pgas
fluid_component = 0
[../]
[./mass1]
type = PorousFlowMassTimeDerivative
variable = z
fluid_component = 1
[../]
[./adv0]
type = PorousFlowAdvectiveFlux
variable = pgas
fluid_component = 0
[../]
[./adv1]
type = PorousFlowAdvectiveFlux
variable = z
fluid_component = 1
[../]
[./energy]
type = PorousFlowEnergyTimeDerivative
variable = temperature
[../]
[./heat]
type = PorousFlowHeatAdvection
variable = temperature
[../]
[]
[UserObjects]
[./dictator]
type = PorousFlowDictator
porous_flow_vars = 'pgas z temperature'
number_fluid_phases = 2
number_fluid_components = 2
[../]
[./pc]
type = PorousFlowCapillaryPressureVG
m = 0.5
alpha = 1e1
pc_max = 1e4
[../]
[./fs]
type = PorousFlowWaterNCG
water_fp = water
gas_fp = co2
capillary_pressure = pc
[../]
[]
[Modules]
[./FluidProperties]
[./co2]
type = CO2FluidProperties
[../]
[./water]
type = Water97FluidProperties
[../]
[../]
[]
[Materials]
[./temperature]
type = PorousFlowTemperature
temperature = temperature
[../]
[./waterncg]
type = PorousFlowFluidState
gas_porepressure = pgas
z = z
temperature = temperature
temperature_unit = Celsius
capillary_pressure = pc
fluid_state = fs
[../]
[./permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-12 0 0 0 1e-12 0 0 0 1e-12'
[../]
[./relperm0]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
[../]
[./relperm1]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 1
[../]
[./porosity]
type = PorousFlowPorosityConst
porosity = 0.1
[../]
[./rock_heat]
type = PorousFlowMatrixInternalEnergy
specific_heat_capacity = 1000
density = 2500
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
dt = 1
end_time = 1
nl_abs_tol = 1e-12
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[AuxVariables]
[./sgas]
family = MONOMIAL
order = CONSTANT
[../]
[]
[AuxKernels]
[./sgas]
type = PorousFlowPropertyAux
property = saturation
phase = 1
variable = sgas
[../]
[]
[Postprocessors]
[./sgas_min]
type = ElementExtremeValue
variable = sgas
value_type = min
[../]
[./sgas_max]
type = ElementExtremeValue
variable = sgas
value_type = max
[../]
[]
modules/porous_flow/test/tests/fluidstate/waterncg.i
# Tests correct calculation of properties in PorousFlowWaterNCG.
# This test is run three times, with the initial condition of z (the total mass
# fraction of NCG in all phases) varied to give either a single phase liquid, a
# single phase gas, or two phases.
[Mesh]
[./mesh]
type = GeneratedMeshGenerator
dim = 2
[../]
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Variables]
[./pgas]
initial_condition = 1e6
[../]
[./z]
initial_condition = 0.005
[../]
[]
[AuxVariables]
[./pressure_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./pressure_water]
order = CONSTANT
family = MONOMIAL
[../]
[./saturation_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./saturation_water]
order = CONSTANT
family = MONOMIAL
[../]
[./density_water]
order = CONSTANT
family = MONOMIAL
[../]
[./density_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./viscosity_water]
order = CONSTANT
family = MONOMIAL
[../]
[./viscosity_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./enthalpy_water]
order = CONSTANT
family = MONOMIAL
[../]
[./enthalpy_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./internal_energy_water]
order = CONSTANT
family = MONOMIAL
[../]
[./internal_energy_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./x0_water]
order = CONSTANT
family = MONOMIAL
[../]
[./x0_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./x1_water]
order = CONSTANT
family = MONOMIAL
[../]
[./x1_gas]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./pressure_water]
type = PorousFlowPropertyAux
variable = pressure_water
property = pressure
phase = 0
execute_on = timestep_end
[../]
[./pressure_gas]
type = PorousFlowPropertyAux
variable = pressure_gas
property = pressure
phase = 1
execute_on = timestep_end
[../]
[./saturation_water]
type = PorousFlowPropertyAux
variable = saturation_water
property = saturation
phase = 0
execute_on = timestep_end
[../]
[./saturation_gas]
type = PorousFlowPropertyAux
variable = saturation_gas
property = saturation
phase = 1
execute_on = timestep_end
[../]
[./density_water]
type = PorousFlowPropertyAux
variable = density_water
property = density
phase = 0
execute_on = timestep_end
[../]
[./density_gas]
type = PorousFlowPropertyAux
variable = density_gas
property = density
phase = 1
execute_on = timestep_end
[../]
[./viscosity_water]
type = PorousFlowPropertyAux
variable = viscosity_water
property = viscosity
phase = 0
execute_on = timestep_end
[../]
[./viscosity_gas]
type = PorousFlowPropertyAux
variable = viscosity_gas
property = viscosity
phase = 1
execute_on = timestep_end
[../]
[./enthalpy_water]
type = PorousFlowPropertyAux
variable = enthalpy_water
property = enthalpy
phase = 0
execute_on = timestep_end
[../]
[./enthalpy_gas]
type = PorousFlowPropertyAux
variable = enthalpy_gas
property = enthalpy
phase = 1
execute_on = timestep_end
[../]
[./internal_energy_water]
type = PorousFlowPropertyAux
variable = internal_energy_water
property = internal_energy
phase = 0
execute_on = timestep_end
[../]
[./internal_energy_gas]
type = PorousFlowPropertyAux
variable = internal_energy_gas
property = internal_energy
phase = 1
execute_on = timestep_end
[../]
[./x1_water]
type = PorousFlowPropertyAux
variable = x1_water
property = mass_fraction
phase = 0
fluid_component = 1
execute_on = timestep_end
[../]
[./x1_gas]
type = PorousFlowPropertyAux
variable = x1_gas
property = mass_fraction
phase = 1
fluid_component = 1
execute_on = timestep_end
[../]
[./x0_water]
type = PorousFlowPropertyAux
variable = x0_water
property = mass_fraction
phase = 0
fluid_component = 0
execute_on = timestep_end
[../]
[./x0_gas]
type = PorousFlowPropertyAux
variable = x0_gas
property = mass_fraction
phase = 1
fluid_component = 0
execute_on = timestep_end
[../]
[]
[Kernels]
[./mass0]
type = PorousFlowMassTimeDerivative
variable = pgas
fluid_component = 0
[../]
[./mass1]
type = PorousFlowMassTimeDerivative
variable = z
fluid_component = 1
[../]
[]
[UserObjects]
[./dictator]
type = PorousFlowDictator
porous_flow_vars = 'pgas z'
number_fluid_phases = 2
number_fluid_components = 2
[../]
[./pc]
type = PorousFlowCapillaryPressureConst
pc = 0
[../]
[./fs]
type = PorousFlowWaterNCG
water_fp = water
gas_fp = co2
capillary_pressure = pc
[../]
[]
[Modules]
[./FluidProperties]
[./co2]
type = CO2FluidProperties
[../]
[./water]
type = Water97FluidProperties
[../]
[../]
[]
[Materials]
[./temperature]
type = PorousFlowTemperature
temperature = 50
[../]
[./waterncg]
type = PorousFlowFluidState
gas_porepressure = pgas
z = z
temperature_unit = Celsius
capillary_pressure = pc
fluid_state = fs
[../]
[./permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-12 0 0 0 1e-12 0 0 0 1e-12'
[../]
[./relperm0]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
[../]
[./relperm1]
type = PorousFlowRelativePermeabilityCorey
n = 3
phase = 1
[../]
[./porosity]
type = PorousFlowPorosityConst
porosity = 0.1
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
dt = 1
end_time = 1
nl_abs_tol = 1e-12
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Postprocessors]
[./density_water]
type = ElementIntegralVariablePostprocessor
variable = density_water
[../]
[./density_gas]
type = ElementIntegralVariablePostprocessor
variable = density_gas
[../]
[./viscosity_water]
type = ElementIntegralVariablePostprocessor
variable = viscosity_water
[../]
[./viscosity_gas]
type = ElementIntegralVariablePostprocessor
variable = viscosity_gas
[../]
[./enthalpy_water]
type = ElementIntegralVariablePostprocessor
variable = enthalpy_water
[../]
[./enthalpy_gas]
type = ElementIntegralVariablePostprocessor
variable = enthalpy_gas
[../]
[./internal_energy_water]
type = ElementIntegralVariablePostprocessor
variable = internal_energy_water
[../]
[./internal_energy_gas]
type = ElementIntegralVariablePostprocessor
variable = internal_energy_gas
[../]
[./x1_water]
type = ElementIntegralVariablePostprocessor
variable = x1_water
[../]
[./x0_water]
type = ElementIntegralVariablePostprocessor
variable = x0_water
[../]
[./x1_gas]
type = ElementIntegralVariablePostprocessor
variable = x1_gas
[../]
[./x0_gas]
type = ElementIntegralVariablePostprocessor
variable = x0_gas
[../]
[./sg]
type = ElementIntegralVariablePostprocessor
variable = saturation_gas
[../]
[./sw]
type = ElementIntegralVariablePostprocessor
variable = saturation_water
[../]
[./pwater]
type = ElementIntegralVariablePostprocessor
variable = pressure_water
[../]
[./pgas]
type = ElementIntegralVariablePostprocessor
variable = pressure_gas
[../]
[./x0mass]
type = PorousFlowFluidMass
fluid_component = 0
phase = '0 1'
[../]
[./x1mass]
type = PorousFlowFluidMass
fluid_component = 1
phase = '0 1'
[../]
[]
[Outputs]
exodus = true
file_base = waterncg_liquid
[]
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_subdomain_ids = 1
new_sideset_name = 'injection_area'
input = 'aquifer'
[../]
[./rename]
type = RenameBlockGenerator
old_block_id = '0 1'
new_block_name = 'caps aquifer'
input = 'injection_area'
[../]
[]
[Problem]
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
use_displaced_mesh = false
variable = pwater
[../]
[./flux_water]
type = PorousFlowAdvectiveFlux
fluid_component = 0
use_displaced_mesh = false
variable = pwater
[../]
[./vol_strain_rate_water]
type = PorousFlowMassVolumetricExpansion
fluid_component = 0
use_displaced_mesh = false
variable = pwater
[../]
[./mass_co2_dot]
type = PorousFlowMassTimeDerivative
fluid_component = 1
use_displaced_mesh = false
variable = pgas
[../]
[./flux_co2]
type = PorousFlowAdvectiveFlux
fluid_component = 1
use_displaced_mesh = false
variable = pgas
[../]
[./vol_strain_rate_co2]
type = PorousFlowMassVolumetricExpansion
fluid_component = 1
use_displaced_mesh = false
variable = pgas
[../]
[./energy_dot]
type = PorousFlowEnergyTimeDerivative
use_displaced_mesh = false
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
use_displaced_mesh = false
variable = T
[../]
[./grad_stress_r]
type = StressDivergenceRZTensors
temperature = T
variable = disp_r
thermal_eigenstrain_name = 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
args = 'pwater pgas swater sgas'
function = '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
component = 0
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
[../]
[]
[Modules]
[./FluidProperties]
[./true_water]
type = Water97FluidProperties
[../]
[./tabulated_water]
type = TabulatedFluidProperties
fp = true_water
temperature_min = 275
pressure_max = 1E8
fluid_property_file = water97_tabulated_11.csv
[../]
[./true_co2]
type = CO2FluidProperties
[../]
[./tabulated_co2]
type = TabulatedFluidProperties
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
vars = effective_fluid_pressure_at_wellbore
vals = effective_fluid_pressure_at_wellbore
value = '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/porous_flow/test/tests/fluidstate/theis_tabulated.i
# Two phase Theis problem: Flow from single source using WaterNCG fluidstate.
# Constant rate injection 2 kg/s
# 1D cylindrical mesh
# Initially, system has only a liquid phase, until enough gas is injected
# to form a gas phase, in which case the system becomes two phase.
# Note: this test is the same as theis.i, but uses the tabulated version of the CO2FluidProperties
[Mesh]
type = GeneratedMesh
dim = 1
nx = 80
xmax = 200
bias_x = 1.05
[]
[Problem]
type = FEProblem
coord_type = RZ
rz_coord_axis = Y
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[AuxVariables]
[./saturation_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./x1]
order = CONSTANT
family = MONOMIAL
[../]
[./y0]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./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 = 20e6
[../]
[./zi]
initial_condition = 0
[../]
[]
[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 = 2
[../]
[./pc]
type = PorousFlowCapillaryPressureConst
pc = 0
[../]
[./fs]
type = PorousFlowWaterNCG
water_fp = water
gas_fp = tabulated
capillary_pressure = pc
[../]
[]
[Modules]
[./FluidProperties]
[./co2]
type = CO2FluidProperties
[../]
[./tabulated]
type = TabulatedFluidProperties
fp = co2
fluid_property_file = fluid_properties.csv
[../]
[./water]
type = Water97FluidProperties
[../]
[../]
[]
[Materials]
[./temperature]
type = PorousFlowTemperature
[../]
[./waterncg]
type = PorousFlowFluidState
gas_porepressure = pgas
z = zi
temperature_unit = Celsius
capillary_pressure = pc
fluid_state = fs
[../]
[./porosity]
type = PorousFlowPorosityConst
porosity = 0.2
[../]
[./permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-12 0 0 0 1e-12 0 0 0 1e-12'
[../]
[./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
[../]
[]
[BCs]
[./rightwater]
type = DirichletBC
boundary = right
value = 20e6
variable = pgas
[../]
[]
[DiracKernels]
[./source]
type = PorousFlowSquarePulsePointSource
point = '0 0 0'
mass_flux = 2
variable = zi
[../]
[]
[Preconditioning]
[./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 1E-8 1E-10 20'
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 8e2
[./TimeStepper]
type = IterationAdaptiveDT
dt = 2
growth_factor = 2
[../]
[]
[VectorPostprocessors]
[./line]
type = LineValueSampler
sort_by = x
start_point = '0 0 0'
end_point = '200 0 0'
num_points = 1000
variable = 'pgas zi x1 saturation_gas'
execute_on = 'timestep_end'
[../]
[]
[Postprocessors]
[./pgas]
type = PointValue
point = '1 0 0'
variable = pgas
[../]
[./sgas]
type = PointValue
point = '1 0 0'
variable = saturation_gas
[../]
[./zi]
type = PointValue
point = '1 0 0'
variable = zi
[../]
[./massgas]
type = PorousFlowFluidMass
fluid_component = 1
[../]
[./x1]
type = PointValue
point = '1 0 0'
variable = x1
[../]
[./y0]
type = PointValue
point = '1 0 0'
variable = y0
[../]
[]
[Outputs]
print_linear_residuals = false
perf_graph = true
[./csvout]
type = CSV
file_base = theis_tabulated_csvout
execute_on = timestep_end
execute_vector_postprocessors_on = final
[../]
[]
modules/porous_flow/examples/tutorial/05_tabulated.i
# Darcy flow with heat advection and conduction, using Water97 properties
[Mesh]
[annular]
type = AnnularMeshGenerator
nr = 10
rmin = 1.0
rmax = 10
growth_r = 1.4
nt = 4
dmin = 0
dmax = 90
[]
[./make3D]
type = MeshExtruderGenerator
extrusion_vector = '0 0 12'
num_layers = 3
bottom_sideset = 'bottom'
top_sideset = 'top'
input = annular
[../]
[./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_subdomain_ids = 1
new_sideset_name = 'injection_area'
input = 'aquifer'
[../]
[./rename]
type = RenameBlockGenerator
old_block_id = '0 1'
new_block_name = 'caps aquifer'
input = 'injection_area'
[../]
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Variables]
[./porepressure]
initial_condition = 1E6
[../]
[./temperature]
initial_condition = 313
scaling = 1E-8
[../]
[]
[PorousFlowBasicTHM]
porepressure = porepressure
temperature = temperature
coupling_type = ThermoHydro
gravity = '0 0 0'
fp = tabulated_water
[]
[BCs]
[./constant_injection_porepressure]
type = DirichletBC
variable = porepressure
value = 2E6
boundary = injection_area
[../]
[./constant_injection_temperature]
type = DirichletBC
variable = temperature
value = 333
boundary = injection_area
[../]
[]
[Modules]
[./FluidProperties]
[./true_water]
type = Water97FluidProperties
[../]
[./tabulated_water]
type = TabulatedFluidProperties
fp = true_water
temperature_min = 275
interpolated_properties = 'density viscosity enthalpy internal_energy'
fluid_property_file = water97_tabulated.csv
[../]
[../]
[]
[Materials]
[./porosity]
type = PorousFlowPorosity
porosity_zero = 0.1
[../]
[./biot_modulus]
type = PorousFlowConstantBiotModulus
biot_coefficient = 0.8
solid_bulk_compliance = 2E-7
fluid_bulk_modulus = 1E7
[../]
[./permeability_aquifer]
type = PorousFlowPermeabilityConst
block = aquifer
permeability = '1E-14 0 0 0 1E-14 0 0 0 1E-14'
[../]
[./permeability_caps]
type = PorousFlowPermeabilityConst
block = caps
permeability = '1E-15 0 0 0 1E-15 0 0 0 1E-16'
[../]
[./thermal_expansion]
type = PorousFlowConstantThermalExpansionCoefficient
biot_coefficient = 0.8
drained_coefficient = 0.003
fluid_coefficient = 0.0002
[../]
[./rock_internal_energy]
type = PorousFlowMatrixInternalEnergy
density = 2500.0
specific_heat_capacity = 1200.0
[../]
[./thermal_conductivity]
type = PorousFlowThermalConductivityIdeal
dry_thermal_conductivity = '10 0 0 0 10 0 0 0 10'
block = 'caps aquifer'
[../]
[]
[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 = 1E6
dt = 1E5
nl_abs_tol = 1E-10
[]
[Outputs]
exodus = true
[]
modules/porous_flow/test/tests/ics/fluidpropic.i
# Test the correct calculation of fluid properties using PorousFlowFluidPropertyIC
#
# Variables:
# Pressure: 1 MPa
# Temperature: 323.15 K
#
# Fluid properties for water (reference values from NIST webbook)
# Density: 988.43 kg/m^3
# Enthalpy: 210.19 kJ/kg
# Internal energy: 2019.18 kJ/kg
[Mesh]
type = GeneratedMesh
dim = 2
[]
[Variables]
[./pressure]
initial_condition = 1e6
[../]
[./temperature]
initial_condition = 323.15
[../]
[]
[AuxVariables]
[./enthalpy]
[../]
[./internal_energy]
[../]
[./density]
[../]
[]
[ICs]
[./enthalpy]
type = PorousFlowFluidPropertyIC
variable = enthalpy
property = enthalpy
porepressure = pressure
temperature = temperature
fp = water
[../]
[./internal_energy]
type = PorousFlowFluidPropertyIC
variable = internal_energy
property = internal_energy
porepressure = pressure
temperature = temperature
fp = water
[../]
[./density]
type = PorousFlowFluidPropertyIC
variable = density
property = density
porepressure = pressure
temperature = temperature
fp = water
[../]
[]
[Modules]
[./FluidProperties]
[./water]
type = Water97FluidProperties
[../]
[../]
[]
[Kernels]
[./pressure]
type = Diffusion
variable = pressure
[../]
[./temperature]
type = Diffusion
variable = temperature
[../]
[]
[Executioner]
type = Steady
nl_abs_tol = 1e-12
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Postprocessors]
[./enthalpy]
type = ElementAverageValue
variable = enthalpy
execute_on = 'initial timestep_end'
[../]
[./internal_energy]
type = ElementAverageValue
variable = internal_energy
execute_on = 'initial timestep_end'
[../]
[./density]
type = ElementAverageValue
variable = density
execute_on = 'initial timestep_end'
[../]
[]
[Outputs]
csv = true
execute_on = initial
[]
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
[]
[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
args = permx_md
function = '9.869233e-16*permx_md'
execute_on = initial
[]
[permy]
type = ParsedAux
variable = permy
args = permy_md
function = '9.869233e-16*permy_md'
execute_on = initial
[]
[permz]
type = ParsedAux
variable = permz
args = permz_md
function = '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
[]
[]
[Modules]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[watertab]
type = TabulatedFluidProperties
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
[]
modules/porous_flow/test/tests/fluidstate/waterncg_ic.i
# Tests correct calculation of z (total mass fraction of NCG summed over all
# phases) using the PorousFlowFluidStateIC initial condition. Once z is
# calculated by the initial condition, the thermophysical properties are calculated
# and the resulting gas saturation should be equal to that given in the intial condition
[Mesh]
type = GeneratedMesh
dim = 2
[]
[GlobalParams]
PorousFlowDictator = dictator
temperature_unit = Celsius
[]
[Variables]
[./pgas]
initial_condition = 1e6
[../]
[./z]
[../]
[]
[ICs]
[./z]
type = PorousFlowFluidStateIC
saturation = 0.5
gas_porepressure = pgas
temperature = 50
variable = z
fluid_state = fs
[../]
[]
[AuxVariables]
[./saturation_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./saturation_water]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./saturation_water]
type = PorousFlowPropertyAux
variable = saturation_water
property = saturation
phase = 0
execute_on = timestep_end
[../]
[./saturation_gas]
type = PorousFlowPropertyAux
variable = saturation_gas
property = saturation
phase = 1
execute_on = timestep_end
[../]
[]
[Kernels]
[./mass0]
type = PorousFlowMassTimeDerivative
variable = pgas
fluid_component = 0
[../]
[./mass1]
type = PorousFlowMassTimeDerivative
variable = z
fluid_component = 1
[../]
[]
[UserObjects]
[./dictator]
type = PorousFlowDictator
porous_flow_vars = 'pgas z'
number_fluid_phases = 2
number_fluid_components = 2
[../]
[./pc]
type = PorousFlowCapillaryPressureConst
pc = 0
[../]
[./fs]
type = PorousFlowWaterNCG
water_fp = water
gas_fp = co2
capillary_pressure = pc
[../]
[]
[Modules]
[./FluidProperties]
[./co2]
type = CO2FluidProperties
[../]
[./water]
type = Water97FluidProperties
[../]
[../]
[]
[Materials]
[./temperature]
type = PorousFlowTemperature
temperature = 50
[../]
[./waterncg]
type = PorousFlowFluidState
gas_porepressure = pgas
z = z
fluid_state = fs
capillary_pressure = pc
[../]
[./permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-12 0 0 0 1e-12 0 0 0 1e-12'
[../]
[./relperm0]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
[../]
[./relperm1]
type = PorousFlowRelativePermeabilityCorey
n = 3
phase = 1
[../]
[./porosity]
type = PorousFlowPorosityConst
porosity = 0.1
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
dt = 1
end_time = 1
nl_abs_tol = 1e-12
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Postprocessors]
[./sg]
type = ElementIntegralVariablePostprocessor
variable = saturation_gas
execute_on = 'initial timestep_end'
[../]
[./sw]
type = ElementIntegralVariablePostprocessor
variable = saturation_water
execute_on = 'initial timestep_end'
[../]
[./z]
type = ElementIntegralVariablePostprocessor
variable = z
execute_on = 'initial timestep_end'
[../]
[]
[Outputs]
csv = true
[]
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
[]
[Problem]
type = FEProblem
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
[]
[]
[Modules]
[FluidProperties]
[co2sw]
type = CO2FluidProperties
[]
[co2]
type = TabulatedFluidProperties
fp = co2sw
[]
[water]
type = Water97FluidProperties
[]
[watertab]
type = TabulatedFluidProperties
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/sinks/injection_production_eg.i
# phase = 0 is liquid phase
# phase = 1 is gas phase
# fluid_component = 0 is water
# fluid_component = 1 is CO2
# Constant rate of CO2 injection into the left boundary
# 1D mesh
# The PorousFlowPiecewiseLinearSinks remove the correct water and CO2 from the right boundary
# Note i take pretty big timesteps here so the system is quite nonlinear
[Mesh]
type = GeneratedMesh
dim = 1
nx = 20
xmax = 20
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[AuxVariables]
[./saturation_gas]
order = CONSTANT
family = MONOMIAL
[../]
[./frac_water_in_liquid]
initial_condition = 1.0
[../]
[./frac_water_in_gas]
initial_condition = 0.0
[../]
[]
[AuxKernels]
[./saturation_gas]
type = PorousFlowPropertyAux
variable = saturation_gas
property = saturation
phase = 1
execute_on = timestep_end
[../]
[]
[Variables]
[./pwater]
initial_condition = 20E6
[../]
[./pgas]
initial_condition = 20.1E6
[../]
[]
[Kernels]
[./mass0]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = pwater
[../]
[./flux0]
type = PorousFlowAdvectiveFlux
fluid_component = 0
variable = pwater
[../]
[./mass1]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = pgas
[../]
[./flux1]
type = PorousFlowAdvectiveFlux
fluid_component = 1
variable = pgas
[../]
[]
[UserObjects]
[./dictator]
type = PorousFlowDictator
porous_flow_vars = 'pgas pwater'
number_fluid_phases = 2
number_fluid_components = 2
[../]
[./pc]
type = PorousFlowCapillaryPressureVG
alpha = 1E-6
m = 0.6
[../]
[]
[Modules]
[./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 = 293.15
[../]
[./saturation_calculator]
type = PorousFlow2PhasePP
phase0_porepressure = pwater
phase1_porepressure = pgas
capillary_pressure = pc
[../]
[./massfrac]
type = PorousFlowMassFraction
mass_fraction_vars = 'frac_water_in_liquid frac_water_in_gas'
[../]
[./water]
type = PorousFlowSingleComponentFluid
fp = tabulated_water
phase = 0
[../]
[./co2]
type = PorousFlowSingleComponentFluid
fp = tabulated_co2
phase = 1
[../]
[./porosity]
type = PorousFlowPorosityConst
porosity = 0.2
[../]
[./permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-12 0 0 0 1e-12 0 0 0 1e-12'
[../]
[./relperm_water]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
s_res = 0.1
sum_s_res = 0.2
[../]
[./relperm_gas]
type = PorousFlowRelativePermeabilityBC
nw_phase = true
lambda = 2
s_res = 0.1
sum_s_res = 0.2
phase = 1
[../]
[]
[BCs]
[./co2_injection]
type = PorousFlowSink
boundary = left
variable = pgas # pgas is associated with the CO2 mass balance (fluid_component = 1 in its Kernels)
flux_function = -1E-2 # negative means a source, rather than a sink
[../]
[./right_water]
type = PorousFlowPiecewiseLinearSink
boundary = right
# a sink of water, since the Kernels given to pwater are for fluid_component = 0 (the water)
variable = pwater
# this Sink is a function of liquid porepressure
# Also, all the mass_fraction, mobility and relperm are referenced to the liquid phase now
fluid_phase = 0
# Sink strength = (Pwater - 20E6)
pt_vals = '0 1E9'
multipliers = '0 1E9'
PT_shift = 20E6
# multiply Sink strength computed above by mass fraction of water at the boundary
mass_fraction_component = 0
# also multiply Sink strength by mobility of the liquid
use_mobility = true
# also multiply Sink strength by the relperm of the liquid
use_relperm = true
# also multiplly Sink strength by 1/L, where L is the distance to the fixed-porepressure external environment
flux_function = 10 # 1/L
[../]
[./right_co2]
type = PorousFlowPiecewiseLinearSink
boundary = right
variable = pgas
fluid_phase = 1
pt_vals = '0 1E9'
multipliers = '0 1E9'
PT_shift = 20.1E6
mass_fraction_component = 1
use_mobility = true
use_relperm = true
flux_function = 10 # 1/L
[../]
[]
[Preconditioning]
active = 'basic'
[./basic]
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'
petsc_options_value = 'gmres asm lu NONZERO 2'
[../]
[./preferred]
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
nl_abs_tol = 1E-13
nl_rel_tol = 1E-10
end_time = 1e4
[./TimeStepper]
type = IterationAdaptiveDT
dt = 1E4
growth_factor = 1.1
[../]
[]
[VectorPostprocessors]
[./pps]
type = LineValueSampler
start_point = '0 0 0'
end_point = '20 0 0'
num_points = 20
sort_by = x
variable = 'pgas pwater saturation_gas'
[../]
[]
[Outputs]
print_linear_residuals = false
perf_graph = true
[./out]
type = CSV
execute_on = final
[../]
[]
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
args = perm_md
function = '9.869233e-16*perm_md'
execute_on = initial
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = porepressure
number_fluid_phases = 1
number_fluid_components = 1
[]
[]
[Modules]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[watertab]
type = TabulatedFluidProperties
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/fluid_properties/test/tests/brine/brine_tabulated.i
# Test BrineFluidProperties calculations of density, viscosity and thermal
# conductivity with a TabulatedFluidProperties water.
#
# Experimental density values from Pitzer et al, "Thermodynamic properties
# of aqueous sodium chloride solution", Journal of Physical and Chemical
# Reference Data, 13, 1-102 (1984)
#
# Experimental viscosity values from Phillips et al, "Viscosity of NaCl and
# other solutions up to 350C and 50MPa pressures", LBL-11586 (1980)
#
# Thermal conductivity values from Ozbek and Phillips, "Thermal conductivity of
# aqueous NaCl solutions from 20C to 330C", LBL-9086 (1980)
#
# --------------------------------------------------------------
# Pressure (Mpa) | 20 | 20 | 40
# Temperature (C) | 50 | 200 | 200
# NaCl molality (mol/kg) | 2 | 2 | 5
# NaCl mass fraction (kg/kg) | 0.1047 | 0.1047 | 0.2261
# --------------------------------------------------------------
# Expected values
# --------------------------------------------------------------
# Density (kg/m^3) | 1068.52 | 959.27 | 1065.58
# Viscosity (1e-6Pa.s) | 679.8 | 180.0 | 263.1
# Thermal conductivity (W/m/K) | 0.630 | 0.649 | 0.633
# --------------------------------------------------------------
# Calculated values
# --------------------------------------------------------------
# Density (kg/m^3) | 1067.18 | 958.68 | 1065.46
# Viscosity (1e-6 Pa.s) | 681.1 | 181.98 | 266.1
# Thermal conductivity (W/m/K) | 0.637 | 0.662 | 0.658
# --------------------------------------------------------------
#
# All results are within expected accuracy
[Mesh]
type = GeneratedMesh
dim = 2
nx = 3
ny = 1
xmax = 3
# This test uses ElementalVariableValue postprocessors on specific
# elements, so element numbering needs to stay unchanged
allow_renumbering = false
[]
[Variables]
[./dummy]
[../]
[]
[AuxVariables]
[./pressure]
family = MONOMIAL
order = CONSTANT
[../]
[./temperature]
family = MONOMIAL
order = CONSTANT
[../]
[./xnacl]
family = MONOMIAL
order = CONSTANT
[../]
[./density]
family = MONOMIAL
order = CONSTANT
[../]
[./enthalpy]
family = MONOMIAL
order = CONSTANT
[../]
[./internal_energy]
family = MONOMIAL
order = CONSTANT
[../]
[]
[Functions]
[./pic]
type = ParsedFunction
value = 'if(x<2,20e6, 40e6)'
[../]
[./tic]
type = ParsedFunction
value = 'if(x<1, 323.15, 473.15)'
[../]
[./xic]
type = ParsedFunction
value = 'if(x<2,0.1047, 0.2261)'
[../]
[]
[ICs]
[./p_ic]
type = FunctionIC
function = pic
variable = pressure
[../]
[./t_ic]
type = FunctionIC
function = tic
variable = temperature
[../]
[./x_ic]
type = FunctionIC
function = xic
variable = xnacl
[../]
[]
[AuxKernels]
[./density]
type = MaterialRealAux
variable = density
property = density
[../]
[./enthalpy]
type = MaterialRealAux
variable = enthalpy
property = enthalpy
[../]
[./internal_energy]
type = MaterialRealAux
variable = internal_energy
property = e
[../]
[]
[Modules]
[./FluidProperties]
[./water]
type = Water97FluidProperties
[../]
[./water_tab]
type = TabulatedFluidProperties
fp = water
save_file = false
[../]
[./brine]
type = BrineFluidProperties
water_fp = water_tab
[../]
[../]
[]
[Materials]
[./fp_mat]
type = MultiComponentFluidPropertiesMaterialPT
pressure = pressure
temperature = temperature
xmass = xnacl
fp = brine
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = dummy
[../]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Postprocessors]
[./density0]
type = ElementalVariableValue
variable = density
elementid = 0
[../]
[./density1]
type = ElementalVariableValue
variable = density
elementid = 1
[../]
[./density2]
type = ElementalVariableValue
variable = density
elementid = 2
[../]
[./enthalpy0]
type = ElementalVariableValue
variable = enthalpy
elementid = 0
[../]
[./enthalpy1]
type = ElementalVariableValue
variable = enthalpy
elementid = 1
[../]
[./enthalpy2]
type = ElementalVariableValue
variable = enthalpy
elementid = 2
[../]
[./e0]
type = ElementalVariableValue
variable = internal_energy
elementid = 0
[../]
[./e1]
type = ElementalVariableValue
variable = internal_energy
elementid = 1
[../]
[./e2]
type = ElementalVariableValue
variable = internal_energy
elementid = 2
[../]
[]
[Outputs]
csv = true
file_base = brine_out
[]
modules/porous_flow/test/tests/fluids/h2o.i
# Test the density and viscosity calculated by the water Material
# Region 1 density
# Pressure 80 MPa
# Temperature 300K (26.85C)
# Water density should equal 1.0 / 0.971180894e-3 = 1029.7 kg/m^3 (IAPWS IF97)
# Water viscosity should equal 0.00085327 Pa.s (NIST webbook)
# Results are within expected accuracy
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[UserObjects]
[./dictator]
type = PorousFlowDictator
porous_flow_vars = 'pp'
number_fluid_phases = 1
number_fluid_components = 1
[../]
[]
[Variables]
[./pp]
initial_condition = 80e6
[../]
[]
[Kernels]
[./dummy]
type = Diffusion
variable = pp
[../]
[]
[AuxVariables]
[./temp]
initial_condition = 300.0
[../]
[]
[Materials]
[./temperature]
type = PorousFlowTemperature
temperature = temp
[../]
[./ppss]
type = PorousFlow1PhaseFullySaturated
porepressure = pp
[../]
[./water]
type = PorousFlowSingleComponentFluid
temperature_unit = Kelvin
fp = water
phase = 0
[../]
[]
[Modules]
[./FluidProperties]
[./water]
type = Water97FluidProperties
[../]
[../]
[]
[Executioner]
type = Steady
solve_type = Newton
[]
[Postprocessors]
[./pressure]
type = ElementIntegralVariablePostprocessor
variable = pp
[../]
[./temperature]
type = ElementIntegralVariablePostprocessor
variable = temp
[../]
[./density]
type = ElementIntegralMaterialProperty
mat_prop = 'PorousFlow_fluid_phase_density_qp0'
[../]
[./viscosity]
type = ElementIntegralMaterialProperty
mat_prop = 'PorousFlow_viscosity_qp0'
[../]
[]
[Outputs]
execute_on = 'timestep_end'
file_base = h2o
csv = true
[]
References
- IAPS.
Revised Release on the IAPS Formulation 1985 for the Thermal Conductivity of Ordinary Water Substance.
Technical Report, IAPWS, 1985.[BibTeX]
@techreport{iaps1985, author = "IAPS", title = "{Revised Release on the IAPS Formulation 1985 for the Thermal Conductivity of Ordinary Water Substance}", institution = "IAPWS", year = "1985" }
- IAPWS.
Guidelines on the Henry's constant and vapour liquid distribution constant for gases in H$_2$O and D$_2$O at high temperatures.
Technical Report, IAPWS, 2004.[BibTeX]
@techreport{iapws2004, author = "IAPWS", title = "{Guidelines on the Henry's constant and vapour liquid distribution constant for gases in H$\_2$O and D$\_2$O at high temperatures}", institution = "IAPWS", year = "2004" }
- IAPWS.
Release on the IAPWS Formulation 2008 for the Viscosity of Ordinary Water Substance.
Technical Report, IAPWS, 2008.
URL: www.iapws.org/relguide/visc.pdf.[BibTeX]
@techreport{iapws2008, author = "IAPWS", title = "{Release on the IAPWS Formulation 2008 for the Viscosity of Ordinary Water Substance}", institution = "IAPWS", url = "www.iapws.org/relguide/visc.pdf", year = "2008" }
- IAPWS.
Release on the IAPWS Formulation 2011 for the Thermal Conductivity of Ordinary Water Substance.
Technical Report, IAPWS, 2011.
URL: www.iapws.org/relguide/ThCond.pdf.[BibTeX]
@techreport{iapws2011, author = "IAPWS", title = "{Release on the IAPWS Formulation 2011 for the Thermal Conductivity of Ordinary Water Substance}", institution = "IAPWS", url = "www.iapws.org/relguide/ThCond.pdf", year = "2011" }
- IAPWS.
Revised Supplementary Release on Backward Equations for Specific Volume as a Function of Pressure and Temperature v(p,T) for Region 3 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam.
Technical Report, IAPWS, 2014.
URL: www.iapws.org/relguide/Supp-VPT3-2016.pdf.[BibTeX]
@techreport{iapws1997region3, author = "IAPWS", title = "{Revised Supplementary Release on Backward Equations for Specific Volume as a Function of Pressure and Temperature v(p,T) for Region 3 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam}", institution = "IAPWS", url = "www.iapws.org/relguide/Supp-VPT3-2016.pdf", type = "", year = "2014" }