- boundaryThe list of boundary IDs from the mesh where this object applies
C++ Type:std::vector<BoundaryName>
Controllable:No
Description:The list of boundary IDs from the mesh where this object applies
AreaPostprocessor
The AreaPostprocessor is a SidePostprocessor that computes the area or dimension - 1 "volume" of a given side of the mesh. This postprocessor may be applied to one or more boundaries simultaneously, the latter case produces a total area is output.
Description and Syntax
Computes the "area" or dimension - 1 "volume" of a given boundary or boundaries in your mesh.
Input Parameters
- execute_onTIMESTEP_ENDThe list of flag(s) indicating when this object should be executed, the available options include FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM.
Default:TIMESTEP_END
C++ Type:ExecFlagEnum
Options:FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM, TRANSFER
Controllable:No
Description:The list of flag(s) indicating when this object should be executed, the available options include FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM.
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Default:False
C++ Type:bool
Controllable:No
Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Optional Parameters
- allow_duplicate_execution_on_initialFalseIn the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
Default:False
C++ Type:bool
Controllable:No
Description:In the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- execution_order_group0Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
Default:0
C++ Type:int
Controllable:No
Description:Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
- force_postauxFalseForces the UserObject to be executed in POSTAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in POSTAUX
- force_preauxFalseForces the UserObject to be executed in PREAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREAUX
- force_preicFalseForces the UserObject to be executed in PREIC during initial setup
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREIC during initial setup
- outputsVector of output names where you would like to restrict the output of variables(s) associated with this object
C++ Type:std::vector<OutputName>
Controllable:No
Description:Vector of output names where you would like to restrict the output of variables(s) associated with this object
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Advanced Parameters
Input Files
- (modules/richards/test/tests/sinks/s04.i)
- (test/tests/postprocessors/geometry/3d_geometry.i)
- (test/tests/postprocessors/area_pp/area_pp.i)
- (modules/porous_flow/examples/restart/gas_injection.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_direct.i)
- (modules/navier_stokes/test/tests/finite_volume/controls/switch-pressure-bc/switch_vel_pres_bc.i)
- (modules/solid_mechanics/test/tests/postprocessors/normal_boundary_displacement.i)
- (test/tests/meshgenerators/flip_sideset_generator/flux_flip_2D.i)
- (modules/thermal_hydraulics/test/tests/components/hs_boundary_external_app_heat_flux/main.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/with-direction/errors/flux_bcs.i)
- (modules/solid_mechanics/test/tests/lagrangian/cartesian/total/special/area.i)
- (modules/solid_mechanics/test/tests/lagrangian/cartesian/updated/special/area.i)
- (modules/porous_flow/examples/restart/gas_injection_new_mesh.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/dirichlet_bcs_mdot.i)
- (modules/richards/test/tests/sinks/s_fu_04.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_mdot.i)
- (modules/porous_flow/examples/ates/ates.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_velocity.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_reversal.i)
- (test/tests/postprocessors/geometry/2d_geometry.i)
- (modules/porous_flow/test/tests/fluidstate/coldwater_injection_radial.i)
- (test/tests/meshgenerators/flip_sideset_generator/flux_flip_3D.i)
- (test/tests/interfacekernels/1d_interface/no-failed-point-inversions.i)
References
No citations exist within this document.(modules/richards/test/tests/sinks/s04.i)
# apply a total flux (in kg/s) to two boundaries
# and check that it removes the correct amount of fluid
[Mesh]
type = GeneratedMesh
dim = 2
nx = 1
ny = 3
xmin = 0
xmax = 1
ymin = 0
ymax = 4
[]
[GlobalParams]
richardsVarNames_UO = PPNames
density_UO = DensityConstBulk
relperm_UO = RelPermPower
SUPG_UO = SUPGstandard
sat_UO = Saturation
seff_UO = SeffVG
viscosity = 1E-3
gravity = '-1 0 0'
[]
[UserObjects]
[./PPNames]
type = RichardsVarNames
richards_vars = pressure
[../]
[./DensityConstBulk]
type = RichardsDensityConstBulk
dens0 = 1
bulk_mod = 1
[../]
[./SeffVG]
type = RichardsSeff1VG
m = 0.5
al = 1
[../]
[./RelPermPower]
type = RichardsRelPermPower
simm = 0.0
n = 2
[../]
[./Saturation]
type = RichardsSat
s_res = 0.1
sum_s_res = 0.2
[../]
[./SUPGstandard]
type = RichardsSUPGstandard
p_SUPG = 0.1
[../]
[]
[Variables]
[./pressure]
[../]
[]
[ICs]
[./pressure]
type = ConstantIC
variable = pressure
value = 2
[../]
[]
[Postprocessors]
[./area_left]
type = AreaPostprocessor
boundary = left
execute_on = initial
[../]
[./area_right]
type = AreaPostprocessor
boundary = right
execute_on = initial
[../]
[./mass_fin]
type = RichardsMass
variable = pressure
execute_on = 'initial timestep_end'
[../]
[./p0]
type = PointValue
point = '0 0 0'
variable = pressure
execute_on = 'initial timestep_end'
[../]
[]
[BCs]
[./left_flux]
type = RichardsPiecewiseLinearSink
boundary = left
pressures = '0'
bare_fluxes = '0.1'
variable = pressure
use_mobility = false
use_relperm = false
area_pp = area_left
[../]
[./right_flux]
type = RichardsPiecewiseLinearSink
boundary = right
pressures = '0'
bare_fluxes = '0.1'
variable = pressure
use_mobility = false
use_relperm = false
area_pp = area_right
[../]
[]
[Kernels]
active = 'richardst'
[./richardst]
type = RichardsMassChange
variable = pressure
[../]
[]
[Materials]
[./rock]
type = RichardsMaterial
block = 0
mat_porosity = 0.1
mat_permeability = '1E-5 0 0 0 1E-5 0 0 0 1E-5'
linear_shape_fcns = true
[../]
[]
[Preconditioning]
[./andy]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -snes_atol -snes_rtol -snes_max_it'
petsc_options_value = 'bcgs bjacobi 1E-12 1E-10 10000'
[../]
[]
[Executioner]
type = Transient
solve_type = Newton
dt = 1
end_time = 13
[]
[Outputs]
file_base = s04
csv = true
[]
(test/tests/postprocessors/geometry/3d_geometry.i)
radius = 0.5
inner_box_length = 2.2
outer_box_length = 3
depth = 0.4
sides = 28
alpha = ${fparse 2 * pi / ${sides}}
perimeter_correction = ${fparse ${alpha} / 2 / sin(alpha / 2)}
area_correction = ${fparse alpha / sin(alpha)}
[Mesh]
file = 3d.e
construct_side_list_from_node_list = true
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[./circle_side_area]
type = AreaPostprocessor
boundary = circle_side
[../]
[./inside_side_area]
type = AreaPostprocessor
boundary = inside_side
[../]
[./outside_side_area]
type = AreaPostprocessor
boundary = outside_side
[../]
[./circle_volume]
type = VolumePostprocessor
block = circle
[../]
[./inside_volume]
type = VolumePostprocessor
block = inside
[../]
[./outside_volume]
type = VolumePostprocessor
block = outside
[../]
[./total_volume]
type = VolumePostprocessor
block = 'circle inside outside'
[../]
[./circle_side_area_exact]
type = FunctionValuePostprocessor
function = 'circle_side_area_exact'
[../]
[./inside_side_area_exact]
type = FunctionValuePostprocessor
function = 'inside_side_area_exact'
[../]
[./outside_side_area_exact]
type = FunctionValuePostprocessor
function = 'outside_side_area_exact'
[../]
[./circle_volume_exact]
type = FunctionValuePostprocessor
function = 'circle_volume_exact'
[../]
[./inside_volume_exact]
type = FunctionValuePostprocessor
function = 'inside_volume_exact'
[../]
[./outside_volume_exact]
type = FunctionValuePostprocessor
function = 'outside_volume_exact'
[../]
[./total_volume_exact]
type = FunctionValuePostprocessor
function = 'total_volume_exact'
[../]
[]
[Functions]
[./circle_side_area_exact]
type = ParsedFunction
expression = '2 * pi * ${radius} / ${perimeter_correction} * ${depth}'
[../]
[./inside_side_area_exact]
type = ParsedFunction
expression = '${inner_box_length} * ${depth} * 4'
[../]
[./outside_side_area_exact]
type = ParsedFunction
expression = '${outer_box_length} * ${depth} * 4'
[../]
[./circle_volume_exact]
type = ParsedFunction
expression = 'pi * ${radius}^2 * ${depth} / ${area_correction}'
[../]
[./inside_volume_exact]
type = ParsedFunction
expression = '${inner_box_length}^2 * ${depth} - pi * ${radius}^2 * ${depth} / ${area_correction}'
[../]
[./outside_volume_exact]
type = ParsedFunction
expression = '${outer_box_length}^2 * ${depth} - ${inner_box_length}^2 * ${depth}'
[../]
[./total_volume_exact]
type = ParsedFunction
expression = '${outer_box_length}^2 * ${depth}'
[../]
[]
[Outputs]
csv = true
[]
(test/tests/postprocessors/area_pp/area_pp.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 4
xmax = 1.2
ymax = 2.3
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Postprocessors]
[./right]
type = AreaPostprocessor
boundary = 'right'
execute_on = 'initial timestep_end'
[../]
[./bottom]
type = AreaPostprocessor
boundary = 'bottom'
execute_on = 'initial timestep_end'
[../]
[./all]
type = AreaPostprocessor
boundary = 'left right bottom top'
execute_on = 'initial timestep_end'
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
csv = true
[]
(modules/porous_flow/examples/restart/gas_injection.i)
# Using the results from the equilibrium run to provide the initial condition for
# porepressure, we now inject a gas phase into the brine-saturated reservoir. In this
# example, where the mesh used is identical to the mesh used in gravityeq.i, we can use
# the basic restart capability by simply setting the initial condition for porepressure
# using the results from gravityeq.i.
#
# Even though the gravity equilibrium is established using a 2D mesh, in this example,
# we shift the mesh 0.1 m to the right and rotate it about the Y axis to make a 2D radial
# model.
#
# Methane injection takes place over the surface of the hole created by rotating the mesh,
# and hence the injection area is 2 pi r h. We can calculate this using an AreaPostprocessor,
# and then use this in a ParsedFunction to calculate the injection rate so that 10 kg/s of
# methane is injected.
#
# Results can be improved by uniformly refining the initial mesh.
#
# Note: as this example uses the results from a previous simulation, gravityeq.i MUST be
# run before running this input file.
[Mesh]
uniform_refine = 1
[file]
type = FileMeshGenerator
file = gravityeq_out.e
[]
[translate]
type = TransformGenerator
transform = TRANSLATE
vector_value = '0.1 0 0'
input = file
[]
coord_type = RZ
rz_coord_axis = Y
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 -9.81 0'
temperature_unit = Celsius
[]
[Variables]
[pp_liq]
initial_from_file_var = porepressure
[]
[sat_gas]
initial_condition = 0
[]
[]
[AuxVariables]
[temperature]
initial_condition = 50
[]
[xnacl]
initial_condition = 0.1
[]
[brine_density]
family = MONOMIAL
order = CONSTANT
[]
[methane_density]
family = MONOMIAL
order = CONSTANT
[]
[massfrac_ph0_sp0]
initial_condition = 1
[]
[massfrac_ph1_sp0]
initial_condition = 0
[]
[pp_gas]
family = MONOMIAL
order = CONSTANT
[]
[sat_liq]
family = MONOMIAL
order = CONSTANT
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
variable = pp_liq
[]
[flux0]
type = PorousFlowAdvectiveFlux
variable = pp_liq
[]
[mass1]
type = PorousFlowMassTimeDerivative
variable = sat_gas
fluid_component = 1
[]
[flux1]
type = PorousFlowAdvectiveFlux
variable = sat_gas
fluid_component = 1
[]
[]
[AuxKernels]
[brine_density]
type = PorousFlowPropertyAux
property = density
variable = brine_density
execute_on = 'initial timestep_end'
[]
[methane_density]
type = PorousFlowPropertyAux
property = density
variable = methane_density
phase = 1
execute_on = 'initial timestep_end'
[]
[pp_gas]
type = PorousFlowPropertyAux
property = pressure
phase = 1
variable = pp_gas
execute_on = 'initial timestep_end'
[]
[sat_liq]
type = PorousFlowPropertyAux
property = saturation
variable = sat_liq
execute_on = 'initial timestep_end'
[]
[]
[BCs]
[gas_injection]
type = PorousFlowSink
boundary = left
variable = sat_gas
flux_function = injection_rate
fluid_phase = 1
[]
[brine_out]
type = PorousFlowPiecewiseLinearSink
boundary = right
variable = pp_liq
multipliers = '0 1e9'
pt_vals = '0 1e9'
fluid_phase = 0
flux_function = 1e-6
use_mobility = true
[]
[]
[Functions]
[injection_rate]
type = ParsedFunction
symbol_values = injection_area
symbol_names = area
expression = '-10/area'
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pp_liq sat_gas'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureVG
alpha = 1e-5
m = 0.5
sat_lr = 0.2
[]
[]
[FluidProperties]
[brine]
type = BrineFluidProperties
[]
[methane]
type = MethaneFluidProperties
[]
[methane_tab]
type = TabulatedBicubicFluidProperties
fp = methane
save_file = false
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = temperature
[]
[ps]
type = PorousFlow2PhasePS
phase0_porepressure = pp_liq
phase1_saturation = sat_gas
capillary_pressure = pc
[]
[massfrac]
type = PorousFlowMassFraction
mass_fraction_vars = 'massfrac_ph0_sp0 massfrac_ph1_sp0'
[]
[brine]
type = PorousFlowBrine
compute_enthalpy = false
compute_internal_energy = false
xnacl = xnacl
phase = 0
[]
[methane]
type = PorousFlowSingleComponentFluid
compute_enthalpy = false
compute_internal_energy = false
fp = methane_tab
phase = 1
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.1
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-13 0 0 0 1e-13 0 0 0 1e-13'
[]
[relperm_liq]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
s_res = 0.2
sum_s_res = 0.3
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 1
s_res = 0.1
sum_s_res = 0.3
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = ' asm lu NONZERO'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 1e8
nl_abs_tol = 1e-12
nl_rel_tol = 1e-06
nl_max_its = 20
dtmax = 1e6
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e1
[]
[]
[Postprocessors]
[mass_ph0]
type = PorousFlowFluidMass
fluid_component = 0
execute_on = 'initial timestep_end'
[]
[mass_ph1]
type = PorousFlowFluidMass
fluid_component = 1
execute_on = 'initial timestep_end'
[]
[injection_area]
type = AreaPostprocessor
boundary = left
execute_on = initial
[]
[]
[Outputs]
execute_on = 'initial timestep_end'
exodus = true
perf_graph = true
checkpoint = true
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_direct.i)
rho = 'rho'
l = 10
inlet_area = 1
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 10
ny = 5
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = ${inlet_velocity}
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[scalar]
type = MooseVariableFVReal
initial_condition = 0.1
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FVKernels]
[mass_time]
type = WCNSFVMassTimeDerivative
variable = pressure
drho_dt = drho_dt
[]
[mass]
type = WCNSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = u
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = v
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T
rho = rho
drho_dt = drho_dt
h = h
dh_dt = dh_dt
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T
v = power_density
[]
# Scalar concentration equation
[scalar_time]
type = FVFunctorTimeKernel
variable = scalar
[]
[scalar_advection]
type = INSFVScalarFieldAdvection
variable = scalar
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[scalar_diffusion]
type = FVDiffusion
variable = scalar
coeff = 1.1
[]
[scalar_source]
type = FVBodyForce
variable = scalar
function = 2.1
[]
[]
[FVBCs]
# Inlet
[inlet_mass]
type = WCNSFVMassFluxBC
variable = pressure
boundary = 'left'
mdot_pp = 'inlet_mdot'
area_pp = 'surface_inlet'
vel_x = u
vel_y = v
rho = 'rho'
[]
[inlet_u]
type = WCNSFVMomentumFluxBC
variable = u
boundary = 'left'
mdot_pp = 'inlet_mdot'
area_pp = 'surface_inlet'
rho = 'rho'
momentum_component = 'x'
vel_x = u
vel_y = v
[]
[inlet_v]
type = WCNSFVMomentumFluxBC
variable = v
boundary = 'left'
mdot_pp = 0
area_pp = 'surface_inlet'
rho = 'rho'
momentum_component = 'y'
vel_x = u
vel_y = v
[]
[inlet_T]
type = WCNSFVEnergyFluxBC
variable = T
T_fluid = T
boundary = 'left'
energy_pp = 'inlet_Edot'
area_pp = 'surface_inlet'
vel_x = u
vel_y = v
rho = 'rho'
cp = cp
[]
[inlet_scalar]
type = WCNSFVScalarFluxBC
variable = scalar
boundary = 'left'
scalar_flux_pp = 'inlet_scalar_flux'
area_pp = 'surface_inlet'
vel_x = u
vel_y = v
rho = 'rho'
passive_scalar = scalar
[]
[outlet_p]
type = INSFVOutletPressureBC
variable = pressure
boundary = 'right'
function = ${outlet_pressure}
[]
# Walls
[no_slip_x]
type = INSFVNoSlipWallBC
variable = u
boundary = 'top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = v
boundary = 'top bottom'
function = 0
[]
[]
# used for the boundary conditions in this example
[Postprocessors]
[inlet_mdot]
type = Receiver
default = ${fparse 1980 * inlet_velocity * inlet_area}
[]
[surface_inlet]
type = AreaPostprocessor
boundary = 'left'
execute_on = 'INITIAL'
[]
[inlet_Edot]
type = Receiver
default = ${fparse 1980 * inlet_velocity * 2530 * inlet_temp * inlet_area}
[]
[inlet_scalar_flux]
type = Receiver
default = ${fparse inlet_velocity * 0.2 * inlet_area}
[]
[]
[FluidProperties]
[fp]
type = SimpleFluidProperties
density0 = 1980
cp = 2530
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T'
rho = ${rho}
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-2
optimal_iterations = 6
[]
end_time = 1
nl_abs_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
exodus = true
execute_on = FINAL
[]
(modules/navier_stokes/test/tests/finite_volume/controls/switch-pressure-bc/switch_vel_pres_bc.i)
rho = 'rho'
l = 10
inlet_area = 1
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.001
end_time = 3.0
switch_time = 1.0
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 10
ny = 5
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = ${inlet_velocity}
[]
[v]
type = INSFVVelocityVariable
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FVKernels]
[mass_time]
type = WCNSFVMassTimeDerivative
variable = pressure
drho_dt = drho_dt
[]
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = u
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = v
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T
rho = rho
drho_dt = drho_dt
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T
v = power_density
[]
[]
[FVBCs]
# Inlet
[inlet_u]
type = WCNSFVSwitchableInletVelocityBC
variable = u
boundary = 'left'
mdot_pp = 'inlet_mdot'
area_pp = 'surface_inlet'
rho = 'rho'
switch_bc = true
face_limiter = 1.0
[]
[outlet_u]
type = WCNSFVSwitchableInletVelocityBC
variable = u
boundary = 'right'
mdot_pp = 'inlet_mdot'
area_pp = 'surface_inlet'
rho = 'rho'
switch_bc = false
scaling_factor = -1.0
face_limiter = 1.0
[]
[inlet_v]
type = WCNSFVInletVelocityBC
variable = v
boundary = 'left'
mdot_pp = 0
area_pp = 'surface_inlet'
rho = 'rho'
[]
[inlet_T]
type = WCNSFVInletTemperatureBC
variable = T
boundary = 'left'
temperature_pp = 'inlet_T'
[]
[outlet_T]
type = NSFVOutflowTemperatureBC
variable = T
boundary = 'right'
u = u
v = v
rho = 'rho'
cp = 'cp'
backflow_T = ${inlet_temp}
[]
[outlet_p]
type = INSFVSwitchableOutletPressureBC
variable = pressure
boundary = 'right'
function = ${outlet_pressure}
switch_bc = true
face_limiter = 1.0
[]
[inlet_p]
type = INSFVSwitchableOutletPressureBC
variable = pressure
boundary = 'left'
function = ${outlet_pressure}
switch_bc = false
face_limiter = 1.0
[]
# Walls
[no_slip_x]
type = INSFVNoSlipWallBC
variable = u
boundary = 'top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = v
boundary = 'top bottom'
function = 0
[]
[]
[Functions]
[func_coef]
type = ParsedFunction
expression = 'if(t<${switch_time} | t>2.0*${switch_time}, 1, 0)'
[]
[func_coef_comp]
type = ParsedFunction
expression = 'if(t<${switch_time} | t>2.0*${switch_time}, 0, 1)'
[]
[mass_flux_and_pressure_test_scaling]
type = ParsedFunction
expression = 'if(t<${switch_time} | t>2.0*${switch_time}, 0.1, 0.2)'
[]
[]
[Controls]
[func_control_u_inlet]
type = BoolFunctionControl
parameter = 'FVBCs/inlet_u/switch_bc'
function = 'func_coef'
execute_on = 'initial timestep_begin'
[]
[func_control_u_outlet]
type = BoolFunctionControl
parameter = 'FVBCs/outlet_u/switch_bc'
function = 'func_coef_comp'
execute_on = 'initial timestep_begin'
[]
[func_control_p_outlet]
type = BoolFunctionControl
parameter = 'FVBCs/outlet_p/switch_bc'
function = 'func_coef'
execute_on = 'initial timestep_begin'
[]
[func_control_p_inlet]
type = BoolFunctionControl
parameter = 'FVBCs/inlet_p/switch_bc'
function = 'func_coef_comp'
execute_on = 'initial timestep_begin'
[]
[func_control_limiter_u_inlet]
type = RealFunctionControl
parameter = 'FVBCs/inlet_u/face_limiter'
function = 'mass_flux_and_pressure_test_scaling'
execute_on = 'initial timestep_begin'
[]
[func_control_limiter_u_outlet]
type = RealFunctionControl
parameter = 'FVBCs/outlet_u/face_limiter'
function = 'mass_flux_and_pressure_test_scaling'
execute_on = 'initial timestep_begin'
[]
[func_control_limiter_p_outlet]
type = RealFunctionControl
parameter = 'FVBCs/outlet_p/face_limiter'
function = 'mass_flux_and_pressure_test_scaling'
execute_on = 'initial timestep_begin'
[]
[func_control_limiter_p_inlet]
type = RealFunctionControl
parameter = 'FVBCs/inlet_p/face_limiter'
function = 'mass_flux_and_pressure_test_scaling'
execute_on = 'initial timestep_begin'
[]
[]
# used for the boundary conditions in this example
[Postprocessors]
[inlet_mdot]
type = Receiver
default = '${fparse 1980 * inlet_velocity * inlet_area}'
[]
[surface_inlet]
type = AreaPostprocessor
boundary = 'left'
execute_on = 'INITIAL'
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
[]
[outlet_mfr]
type = VolumetricFlowRate
boundary = 'right'
advected_quantity = 1.0
vel_x = u
vel_y = v
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T'
rho = ${rho}
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
dt = 0.1
end_time = ${end_time}
nl_abs_tol = 1e-12
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
csv = true
execute_on = 'TIMESTEP_END'
[]
(modules/solid_mechanics/test/tests/postprocessors/normal_boundary_displacement.i)
[GlobalParams]
displacements = 'dx dy'
[]
[Problem]
solve = false
[]
[Mesh]
[generated_mesh]
type = FileMeshGenerator
file = inclined_geom.e
[]
[]
[AuxVariables]
[dx]
[]
[dy]
[]
[]
[ICs]
[dx_ic]
type = FunctionIC
variable = dx
function = 'r := sqrt(x*x+y*y); phi := 2 * pi * r; 0.8660254037844408 * cos(phi) - 0.5 * sin(phi)'
[]
[dy_ic]
type = FunctionIC
variable = dy
function = 'r := sqrt(x*x+y*y); phi := 2 * pi * r; 0.8660254037844408 * sin(phi) + 0.5 * cos(phi)'
[]
[]
[Postprocessors]
[top_area]
type = AreaPostprocessor
boundary = top
[]
[top_0]
type = NormalBoundaryDisplacement
value_type = average
boundary = top
[]
[top_1]
type = NormalBoundaryDisplacement
value_type = absolute_average
boundary = top
[]
[top_2]
type = NormalBoundaryDisplacement
value_type = max
boundary = top
[]
[top_3]
type = NormalBoundaryDisplacement
value_type = absolute_max
boundary = top
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
[]
(test/tests/meshgenerators/flip_sideset_generator/flux_flip_2D.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 3
ny = 3
xmax = 3
ymax = 3
[]
[s1]
type = ParsedGenerateSideset
input = gmg
combinatorial_geometry = 'x > 0.9 & x < 1.1 & y > -0.1 & y < 1.1'
normal = '1 0 0'
new_sideset_name = s1
[]
[s2]
type = ParsedGenerateSideset
input = s1
combinatorial_geometry = 'x > 0.9 & x < 2.1 & y > 0.9 & y < 1.1'
normal = '0 1 0'
new_sideset_name = s2
[]
[s3]
type = ParsedGenerateSideset
input = s2
combinatorial_geometry = 'x > 1.9 & x < 2.1 & y > 0.9 & y < 2.1'
normal = '1 0 0'
new_sideset_name = s3
[]
[s4]
type = ParsedGenerateSideset
input = s3
combinatorial_geometry = 'x > 1.9 & x < 3.1 & y > 1.9 & y < 2.1'
normal = '0 1 0'
new_sideset_name = s4
[]
[sideset]
type = SideSetsFromBoundingBoxGenerator
input = s4
bottom_left = '0 0 0'
top_right = '3 3 3'
included_boundaries = 's1 s2 s3 s4'
boundary_new = 's_combined'
[]
[flip]
type = FlipSidesetGenerator
input = sideset
boundary = s_combined
[]
[]
[AuxVariables]
[u]
[]
[]
[AuxKernels]
[diffusion]
type = FunctionAux
variable = u
function = func
[]
[]
[Functions]
[func]
type = ParsedFunction
expression = x+y
[]
[]
[Problem]
type = FEProblem
solve = false
[]
[Postprocessors]
[flux]
type = SideDiffusiveFluxIntegral
variable = u
boundary = s_combined
diffusivity = 1
[]
[area]
type = AreaPostprocessor
boundary = s_combined
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(modules/thermal_hydraulics/test/tests/components/hs_boundary_external_app_heat_flux/main.i)
# Main input file.
#
# Run mesh.i first to produce a mesh file that this input uses:
#
# thermal_hydraulics-opt -i mesh.i --mesh-only mesh.e
length = 5.0
n_elems_axial = 10
rho_name = density
cp_name = specific_heat
k_name = thermal_conductivity
rho = 8000.0
cp = 500.0
k = 15.0
T_initial = 500.0
power = 1000.0
[Mesh]
type = FileMesh
file = mesh.e
[]
[Variables]
[T_solid]
[]
[]
[ICs]
[T_ic]
type = ConstantIC
variable = T_solid
value = ${T_initial}
[]
[]
[Kernels]
[time_derivative]
type = ADHeatConductionTimeDerivative
variable = T_solid
density_name = ${rho_name}
specific_heat = ${cp_name}
[]
[heat_conduction]
type = ADHeatConduction
variable = T_solid
thermal_conductivity = ${k_name}
[]
[]
[BCs]
[bc]
type = FunctorNeumannBC
variable = T_solid
boundary = 'inner'
functor = heat_flux_fn
flux_is_inward = false
[]
[]
[Materials]
[ad_constant_mat]
type = ADGenericConstantMaterial
prop_names = '${rho_name} ${cp_name} ${k_name}'
prop_values = '${rho} ${cp} ${k}'
[]
[]
[Functions]
[heat_flux_fn]
type = ParsedFunction
symbol_names = 'S'
symbol_values = 'inner_surface_area'
expression = '${power} / S'
[]
[]
[Postprocessors]
[inner_surface_area]
type = AreaPostprocessor
boundary = 'inner'
execute_on = 'INITIAL'
[]
[inner_perimeter]
type = ParsedPostprocessor
pp_names = 'inner_surface_area'
expression = 'inner_surface_area / ${length}'
execute_on = 'INITIAL'
[]
[]
[MultiApps]
[sub]
type = TransientMultiApp
app_type = ThermalHydraulicsApp
input_files = 'sub.i'
positions = '0 0 0'
max_procs_per_app = 1
output_in_position = true
execute_on = 'TIMESTEP_END'
[]
[]
[UserObjects]
[layered_average_heat_flux]
type = NearestPointLayeredSideAverageFunctor
direction = z
points='0 0 0'
num_layers = ${n_elems_axial}
functor = heat_flux_fn
boundary = 'inner'
execute_on = 'TIMESTEP_END'
[]
[]
[Transfers]
[heat_flux_transfer]
type = MultiAppGeneralFieldUserObjectTransfer
to_multi_app = sub
source_user_object = layered_average_heat_flux
variable = q_ext
error_on_miss = true
[]
[perimeter_transfer]
type = MultiAppPostprocessorTransfer
to_multi_app = sub
from_postprocessor = inner_perimeter
to_postprocessor = P_ext
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
dt = 10.0
num_steps = 1
abort_on_solve_fail = true
solve_type = NEWTON
nl_abs_tol = 1e-10
nl_rel_tol = 1e-8
nl_max_its = 10
l_tol = 1e-3
l_max_its = 10
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/with-direction/errors/flux_bcs.i)
l = 5
inlet_area = 2
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
rho = 1000
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.001
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '${l} ${l}'
dy = '${inlet_area}'
ix = '5 5'
iy = '2'
subdomain_id = '1 2'
[]
[side_set]
type = SideSetsBetweenSubdomainsGenerator
input = gen
primary_block = '1'
paired_block = '2'
new_boundary = 'mid-inlet'
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
block = 2
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = ${inlet_velocity}
block = 2
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1e-15
block = 2
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
block = 2
[]
[T_fluid]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
block = 2
[]
[scalar]
type = MooseVariableFVReal
initial_condition = 0.1
block = 2
[]
[T_solid]
type = MooseVariableFVReal
initial_condition = ${inlet_temp}
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FVKernels]
# Mass equation
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
# X component momentum equation
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
# Y component momentum equation
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
# Energy equation
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T_fluid
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T_fluid
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T_fluid
v = power_density
[]
# Scalar concentration equation
[scalar_advection]
type = INSFVScalarFieldAdvection
variable = scalar
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[scalar_diffusion]
type = FVDiffusion
variable = scalar
coeff = 1.1
[]
[scalar_source]
type = FVBodyForce
variable = scalar
function = 2.1
[]
# Solid temperature
[solid_temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T_solid
[]
[]
[FVBCs]
# Inlet
[inlet_mass]
type = WCNSFVMassFluxBC
variable = pressure
boundary = 'mid-inlet'
velocity_pp = 'inlet_velocity'
area_pp = 'area_pp_left'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_u]
type = WCNSFVMomentumFluxBC
variable = vel_x
boundary = 'mid-inlet'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
momentum_component = 'x'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_v]
type = WCNSFVMomentumFluxBC
variable = vel_y
boundary = 'mid-inlet'
mdot_pp = 0
area_pp = 'area_pp_left'
rho = 'rho'
momentum_component = 'y'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_T]
type = WCNSFVEnergyFluxBC
variable = T_fluid
T_fluid = T_fluid
boundary = 'mid-inlet'
temperature_pp = 'inlet_T'
velocity_pp = 'inlet_velocity'
area_pp = 'area_pp_left'
rho = 'rho'
cp = 'cp'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_scalar]
type = WCNSFVScalarFluxBC
variable = scalar
boundary = 'mid-inlet'
scalar_value_pp = 'inlet_scalar_value'
velocity_pp = 'inlet_velocity'
area_pp = 'area_pp_left'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
passive_scalar = scalar
[]
[outlet_p]
type = INSFVOutletPressureBC
variable = pressure
boundary = 'right'
function = ${outlet_pressure}
[]
# Walls
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'top bottom'
function = 0
[]
[]
# used for the boundary conditions in this example
[Postprocessors]
[inlet_mdot]
type = Receiver
default = '${fparse 1980 * inlet_velocity * inlet_area}'
[]
[inlet_velocity]
type = Receiver
default = ${inlet_velocity}
[]
[area_pp_left]
type = AreaPostprocessor
boundary = 'left'
execute_on = 'INITIAL'
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
[]
[inlet_scalar_value]
type = Receiver
default = 0.2
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k rho'
prop_values = '${cp} ${k} ${rho}'
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T_fluid'
rho = ${rho}
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_abs_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
(modules/solid_mechanics/test/tests/lagrangian/cartesian/total/special/area.i)
# Simple 3D test
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
large_kinematics = true
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[]
[Mesh]
[msh]
type = GeneratedMeshGenerator
dim = 3
nx = 1
ny = 1
nz = 1
[]
[]
[Kernels]
[sdx]
type = TotalLagrangianStressDivergence
variable = disp_x
component = 0
[]
[sdy]
type = TotalLagrangianStressDivergence
variable = disp_y
component = 1
[]
[sdz]
type = TotalLagrangianStressDivergence
variable = disp_z
component = 2
[]
[]
[AuxVariables]
[stress_zz]
order = CONSTANT
family = MONOMIAL
[]
[]
[Functions]
[zstress]
type = PiecewiseLinear
x = '0 1'
y = '0 500'
[]
[constant]
type = ConstantFunction
value = 1.0
[]
[ratio]
type = ParsedFunction
symbol_names = 'sd su'
symbol_values = 's_def s_undef'
expression = 'sd / su'
[]
[]
[BCs]
[leftx]
type = DirichletBC
preset = true
boundary = left
variable = disp_x
value = 0.0
[]
[boty]
type = DirichletBC
preset = true
boundary = bottom
variable = disp_y
value = 0.0
[]
[backz]
type = DirichletBC
preset = true
boundary = back
variable = disp_z
value = 0.0
[]
[pull_z]
type = FunctionNeumannBC
boundary = front
variable = disp_z
function = zstress
[]
[]
[AuxKernels]
[stress_zz]
type = RankTwoAux
rank_two_tensor = cauchy_stress
variable = stress_zz
index_i = 2
index_j = 2
execute_on = timestep_end
[]
[]
[Materials]
[elastic_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1000.0
poissons_ratio = 0.25
[]
[compute_stress]
type = ComputeLagrangianLinearElasticStress
[]
[compute_strain]
type = ComputeLagrangianStrain
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Postprocessors]
[s_undef]
type = SideIntegralVariablePostprocessor
variable = stress_zz
boundary = front
[]
[s_def]
type = SideIntegralVariablePostprocessor
variable = stress_zz
boundary = front
use_displaced_mesh = true
[]
[area_calc]
type = FunctionValuePostprocessor
function = ratio
[]
[area]
type = AreaPostprocessor
boundary = front
use_displaced_mesh = true
[]
[]
[Executioner]
type = Transient
solve_type = 'newton'
line_search = none
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
l_max_its = 2
l_tol = 1e-14
nl_max_its = 15
nl_rel_tol = 1e-8
nl_abs_tol = 1e-10
start_time = 0.0
dt = 1.0
dtmin = 1.0
end_time = 1.0
[]
[Outputs]
exodus = false
csv = true
[]
(modules/solid_mechanics/test/tests/lagrangian/cartesian/updated/special/area.i)
# Simple 3D test
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
large_kinematics = true
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[]
[Mesh]
[msh]
type = GeneratedMeshGenerator
dim = 3
nx = 1
ny = 1
nz = 1
[]
[]
[Kernels]
[sdx]
type = UpdatedLagrangianStressDivergence
variable = disp_x
component = 0
use_displaced_mesh = true
[]
[sdy]
type = UpdatedLagrangianStressDivergence
variable = disp_y
component = 1
use_displaced_mesh = true
[]
[sdz]
type = UpdatedLagrangianStressDivergence
variable = disp_z
component = 2
use_displaced_mesh = true
[]
[]
[AuxVariables]
[stress_zz]
order = CONSTANT
family = MONOMIAL
[]
[]
[Functions]
[zstress]
type = PiecewiseLinear
x = '0 1'
y = '0 500'
[]
[constant]
type = ConstantFunction
value = 1.0
[]
[ratio]
type = ParsedFunction
symbol_names = 'sd su'
symbol_values = 's_def s_undef'
expression = 'sd / su'
[]
[]
[BCs]
[leftx]
type = DirichletBC
preset = true
boundary = left
variable = disp_x
value = 0.0
[]
[boty]
type = DirichletBC
preset = true
boundary = bottom
variable = disp_y
value = 0.0
[]
[backz]
type = DirichletBC
preset = true
boundary = back
variable = disp_z
value = 0.0
[]
[pull_z]
type = FunctionNeumannBC
boundary = front
variable = disp_z
function = zstress
[]
[]
[AuxKernels]
[stress_zz]
type = RankTwoAux
rank_two_tensor = cauchy_stress
variable = stress_zz
index_i = 2
index_j = 2
execute_on = timestep_end
[]
[]
[Materials]
[elastic_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1000.0
poissons_ratio = 0.25
[]
[compute_stress]
type = ComputeLagrangianLinearElasticStress
[]
[compute_strain]
type = ComputeLagrangianStrain
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Postprocessors]
[s_undef]
type = SideIntegralVariablePostprocessor
variable = stress_zz
boundary = front
[]
[s_def]
type = SideIntegralVariablePostprocessor
variable = stress_zz
boundary = front
use_displaced_mesh = true
[]
[area_calc]
type = FunctionValuePostprocessor
function = ratio
[]
[area]
type = AreaPostprocessor
boundary = front
use_displaced_mesh = true
[]
[]
[Executioner]
type = Transient
solve_type = 'newton'
line_search = none
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
l_max_its = 2
l_tol = 1e-14
nl_max_its = 15
nl_rel_tol = 1e-8
nl_abs_tol = 1e-10
start_time = 0.0
dt = 1.0
dtmin = 1.0
end_time = 1.0
[]
[Outputs]
exodus = false
csv = true
[]
(modules/porous_flow/examples/restart/gas_injection_new_mesh.i)
# Using the results from the equilibrium run to provide the initial condition for
# porepressure, we now inject a gas phase into the brine-saturated reservoir. In this
# example, the mesh is not identical to the mesh used in gravityeq.i. Rather, it is
# generated so that it is more refined near the injection boundary and at the top of
# the model, as that is where the gas plume will be present.
#
# To use the hydrostatic pressure calculated using the gravity equilibrium run as the initial
# condition for the pressure, a SolutionUserObject is used, along with a SolutionFunction to
# interpolate the pressure from the gravity equilibrium run to the initial condition for liqiud
# porepressure in this example.
#
# Even though the gravity equilibrium is established using a 2D mesh, in this example,
# we use a mesh shifted 0.1 m to the right and rotate it about the Y axis to make a 2D radial
# model.
#
# Methane injection takes place over the surface of the hole created by rotating the mesh,
# and hence the injection area is 2 pi r h. We can calculate this using an AreaPostprocessor,
# and then use this in a ParsedFunction to calculate the injection rate so that 10 kg/s of
# methane is injected.
#
# Note: as this example uses the results from a previous simulation, gravityeq.i MUST be
# run before running this input file.
[Mesh]
type = GeneratedMesh
dim = 2
ny = 25
nx = 50
ymax = 100
xmin = 0.1
xmax = 5000
bias_x = 1.05
bias_y = 0.95
coord_type = RZ
rz_coord_axis = Y
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 -9.81 0'
temperature_unit = Celsius
[]
[Variables]
[pp_liq]
[]
[sat_gas]
initial_condition = 0
[]
[]
[ICs]
[ppliq_ic]
type = FunctionIC
variable = pp_liq
function = ppliq_ic
[]
[]
[AuxVariables]
[temperature]
initial_condition = 50
[]
[xnacl]
initial_condition = 0.1
[]
[brine_density]
family = MONOMIAL
order = CONSTANT
[]
[methane_density]
family = MONOMIAL
order = CONSTANT
[]
[massfrac_ph0_sp0]
initial_condition = 1
[]
[massfrac_ph1_sp0]
initial_condition = 0
[]
[pp_gas]
family = MONOMIAL
order = CONSTANT
[]
[sat_liq]
family = MONOMIAL
order = CONSTANT
[]
[]
[Kernels]
[mass0]
type = PorousFlowMassTimeDerivative
variable = pp_liq
[]
[flux0]
type = PorousFlowAdvectiveFlux
variable = pp_liq
[]
[mass1]
type = PorousFlowMassTimeDerivative
variable = sat_gas
fluid_component = 1
[]
[flux1]
type = PorousFlowAdvectiveFlux
variable = sat_gas
fluid_component = 1
[]
[]
[AuxKernels]
[brine_density]
type = PorousFlowPropertyAux
property = density
variable = brine_density
execute_on = 'initial timestep_end'
[]
[methane_density]
type = PorousFlowPropertyAux
property = density
variable = methane_density
phase = 1
execute_on = 'initial timestep_end'
[]
[pp_gas]
type = PorousFlowPropertyAux
property = pressure
phase = 1
variable = pp_gas
execute_on = 'initial timestep_end'
[]
[sat_liq]
type = PorousFlowPropertyAux
property = saturation
variable = sat_liq
execute_on = 'initial timestep_end'
[]
[]
[BCs]
[gas_injection]
type = PorousFlowSink
boundary = left
variable = sat_gas
flux_function = injection_rate
fluid_phase = 1
[]
[brine_out]
type = PorousFlowPiecewiseLinearSink
boundary = right
variable = pp_liq
multipliers = '0 1e9'
pt_vals = '0 1e9'
fluid_phase = 0
flux_function = 1e-6
use_mobility = true
use_relperm = true
mass_fraction_component = 0
[]
[]
[Functions]
[injection_rate]
type = ParsedFunction
symbol_values = injection_area
symbol_names = area
expression = '-1/area'
[]
[ppliq_ic]
type = SolutionFunction
solution = soln
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pp_liq sat_gas'
number_fluid_phases = 2
number_fluid_components = 2
[]
[pc]
type = PorousFlowCapillaryPressureVG
alpha = 1e-5
m = 0.5
sat_lr = 0.2
pc_max = 1e7
[]
[soln]
type = SolutionUserObject
mesh = gravityeq_out.e
system_variables = porepressure
[]
[]
[FluidProperties]
[brine]
type = BrineFluidProperties
[]
[methane]
type = MethaneFluidProperties
[]
[methane_tab]
type = TabulatedBicubicFluidProperties
fp = methane
save_file = false
[]
[]
[Materials]
[temperature]
type = PorousFlowTemperature
temperature = temperature
[]
[ps]
type = PorousFlow2PhasePS
phase0_porepressure = pp_liq
phase1_saturation = sat_gas
capillary_pressure = pc
[]
[massfrac]
type = PorousFlowMassFraction
mass_fraction_vars = 'massfrac_ph0_sp0 massfrac_ph1_sp0'
[]
[brine]
type = PorousFlowBrine
compute_enthalpy = false
compute_internal_energy = false
xnacl = xnacl
phase = 0
[]
[methane]
type = PorousFlowSingleComponentFluid
compute_enthalpy = false
compute_internal_energy = false
fp = methane_tab
phase = 1
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.1
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1e-13 0 0 0 5e-14 0 0 0 1e-13'
[]
[relperm_liq]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
s_res = 0.2
sum_s_res = 0.3
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 1
s_res = 0.1
sum_s_res = 0.3
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = ' asm lu NONZERO'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = 1e8
nl_abs_tol = 1e-12
nl_rel_tol = 1e-06
nl_max_its = 20
dtmax = 1e6
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e1
growth_factor = 1.5
[]
[]
[Postprocessors]
[mass_ph0]
type = PorousFlowFluidMass
fluid_component = 0
execute_on = 'initial timestep_end'
[]
[mass_ph1]
type = PorousFlowFluidMass
fluid_component = 1
execute_on = 'initial timestep_end'
[]
[injection_area]
type = AreaPostprocessor
boundary = left
execute_on = initial
[]
[]
[Outputs]
execute_on = 'initial timestep_end'
exodus = true
perf_graph = true
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/dirichlet_bcs_mdot.i)
rho = 'rho'
l = 10
inlet_area = 1
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 10
ny = 5
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = ${inlet_velocity}
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FVKernels]
[mass_time]
type = WCNSFVMassTimeDerivative
variable = pressure
drho_dt = drho_dt
[]
[mass]
type = WCNSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = u
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = v
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T
rho = rho
drho_dt = drho_dt
h = h
dh_dt = dh_dt
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T
v = power_density
[]
[]
[FVBCs]
# Inlet
[inlet_u]
type = WCNSFVInletVelocityBC
variable = u
boundary = 'left'
mdot_pp = 'inlet_mdot'
area_pp = 'surface_inlet'
rho = 'rho'
[]
[inlet_v]
type = WCNSFVInletVelocityBC
variable = v
boundary = 'left'
mdot_pp = 0
area_pp = 'surface_inlet'
rho = 'rho'
[]
[inlet_T]
type = WCNSFVInletTemperatureBC
variable = T
boundary = 'left'
temperature_pp = 'inlet_T'
[]
[outlet_p]
type = INSFVOutletPressureBC
variable = pressure
boundary = 'right'
function = ${outlet_pressure}
[]
# Walls
[no_slip_x]
type = INSFVNoSlipWallBC
variable = u
boundary = 'top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = v
boundary = 'top bottom'
function = 0
[]
[]
# used for the boundary conditions in this example
[Postprocessors]
[inlet_mdot]
type = Receiver
default = ${fparse 1980 * inlet_velocity * inlet_area}
[]
[surface_inlet]
type = AreaPostprocessor
boundary = 'left'
execute_on = 'INITIAL'
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T'
rho = ${rho}
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-2
optimal_iterations = 6
[]
end_time = 1
nl_abs_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
exodus = true
execute_on = 'FINAL'
[]
(modules/richards/test/tests/sinks/s_fu_04.i)
# apply a total flux (in kg/s) to two boundaries
# and check that it removes the correct amount of fluid
# fully-upwind sink
[Mesh]
type = GeneratedMesh
dim = 2
nx = 1
ny = 3
xmin = 0
xmax = 1
ymin = 0
ymax = 4
[]
[GlobalParams]
richardsVarNames_UO = PPNames
density_UO = DensityConstBulk
relperm_UO = RelPermPower
SUPG_UO = SUPGstandard
sat_UO = Saturation
seff_UO = SeffVG
viscosity = 1E-3
gravity = '-1 0 0'
[]
[UserObjects]
[./PPNames]
type = RichardsVarNames
richards_vars = pressure
[../]
[./DensityConstBulk]
type = RichardsDensityConstBulk
dens0 = 1
bulk_mod = 1
[../]
[./SeffVG]
type = RichardsSeff1VG
m = 0.5
al = 1 # same deal with PETSc constant state
[../]
[./RelPermPower]
type = RichardsRelPermPower
simm = 0.0
n = 2
[../]
[./Saturation]
type = RichardsSat
s_res = 0.1
sum_s_res = 0.2
[../]
[./SUPGstandard]
type = RichardsSUPGstandard
p_SUPG = 0.1
[../]
[]
[Variables]
[./pressure]
[../]
[]
[ICs]
[./pressure]
type = ConstantIC
variable = pressure
value = 2
[../]
[]
[Postprocessors]
[./area_left]
type = AreaPostprocessor
boundary = left
execute_on = initial
[../]
[./area_right]
type = AreaPostprocessor
boundary = right
execute_on = initial
[../]
[./mass_fin]
type = RichardsMass
variable = pressure
execute_on = 'initial timestep_end'
[../]
[./p0]
type = PointValue
point = '0 0 0'
variable = pressure
execute_on = 'initial timestep_end'
[../]
[]
[BCs]
[./left_flux]
type = RichardsPiecewiseLinearSink
boundary = left
pressures = '0'
bare_fluxes = '0.1'
variable = pressure
use_mobility = false
use_relperm = false
area_pp = area_left
fully_upwind = true
[../]
[./right_flux]
type = RichardsPiecewiseLinearSink
boundary = right
pressures = '0'
bare_fluxes = '0.1'
variable = pressure
use_mobility = false
use_relperm = false
area_pp = area_right
fully_upwind = true
[../]
[]
[Kernels]
active = 'richardst'
[./richardst]
type = RichardsMassChange
variable = pressure
[../]
[]
[Materials]
[./rock]
type = RichardsMaterial
block = 0
mat_porosity = 0.1
mat_permeability = '1E-5 0 0 0 1E-5 0 0 0 1E-5'
linear_shape_fcns = true
[../]
[]
[Preconditioning]
[./andy]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -snes_atol -snes_rtol -snes_max_it'
petsc_options_value = 'bcgs bjacobi 1E-12 1E-10 10000'
[../]
[]
[Executioner]
type = Transient
solve_type = Newton
dt = 1
end_time = 13
[]
[Outputs]
file_base = s_fu_04
csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_mdot.i)
rho = 'rho'
l = 10
inlet_area = 1
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 10
ny = 5
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = ${inlet_velocity}
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T_fluid]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[scalar]
type = MooseVariableFVReal
initial_condition = 0.1
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FVKernels]
# Mass equation
[mass_time]
type = WCNSFVMassTimeDerivative
variable = pressure
drho_dt = drho_dt
[]
[mass]
type = WCNSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
# X component momentum equation
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = vel_x
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
# Y component momentum equation
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = vel_y
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
# Energy equation
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T_fluid
rho = rho
drho_dt = drho_dt
h = h
dh_dt = dh_dt
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T_fluid
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T_fluid
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T_fluid
v = power_density
[]
# Scalar concentration equation
[scalar_time]
type = FVFunctorTimeKernel
variable = scalar
[]
[scalar_advection]
type = INSFVScalarFieldAdvection
variable = scalar
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[scalar_diffusion]
type = FVDiffusion
variable = scalar
coeff = 1.1
[]
[scalar_source]
type = FVBodyForce
variable = scalar
function = 2.1
[]
[]
[FVBCs]
# Inlet
[inlet_mass]
type = WCNSFVMassFluxBC
variable = pressure
boundary = 'left'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_u]
type = WCNSFVMomentumFluxBC
variable = vel_x
boundary = 'left'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
momentum_component = 'x'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_v]
type = WCNSFVMomentumFluxBC
variable = vel_y
boundary = 'left'
mdot_pp = 0
area_pp = 'area_pp_left'
rho = 'rho'
momentum_component = 'y'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_T]
type = WCNSFVEnergyFluxBC
variable = T_fluid
T_fluid = T_fluid
boundary = 'left'
temperature_pp = 'inlet_T'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
cp = 'cp'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_scalar]
type = WCNSFVScalarFluxBC
variable = scalar
boundary = 'left'
scalar_value_pp = 'inlet_scalar_value'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
passive_scalar = scalar
[]
[outlet_p]
type = INSFVOutletPressureBC
variable = pressure
boundary = 'right'
function = ${outlet_pressure}
[]
# Walls
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'top bottom'
function = 0
[]
[]
# used for the boundary conditions in this example
[Postprocessors]
[inlet_mdot]
type = Receiver
default = ${fparse 1980 * inlet_velocity * inlet_area}
[]
[area_pp_left]
type = AreaPostprocessor
boundary = 'left'
execute_on = 'INITIAL'
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
[]
[inlet_scalar_value]
type = Receiver
default = 0.2
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T_fluid
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T_fluid'
rho = ${rho}
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-2
optimal_iterations = 6
[]
end_time = 1
nl_abs_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
exodus = true
execute_on = FINAL
[]
(modules/porous_flow/examples/ates/ates.i)
# Simulation designed to assess the recovery efficiency of a single-well ATES system
# Using KT stabilisation
# Boundary conditions: fixed porepressure and temperature at top, bottom and far end of model.
#####################################
flux_limiter = minmod # minmod, vanleer, mc, superbee, none
# depth of top of aquifer (m)
depth = 400
inject_fluid_mass = 1E8 # kg
produce_fluid_mass = ${inject_fluid_mass} # kg
inject_temp = 90 # degC
inject_time = 91 # days
store_time = 91 # days
produce_time = 91 # days
rest_time = 91 # days
num_cycles = 5 # Currently needs to be <= 10
cycle_length = ${fparse inject_time + store_time + produce_time + rest_time}
end_simulation = ${fparse cycle_length * num_cycles}
# Note: I have setup 10 cycles but you can set num_cycles less than 10.
start_injection1 = 0
start_injection2 = ${cycle_length}
start_injection3 = ${fparse cycle_length * 2}
start_injection4 = ${fparse cycle_length * 3}
start_injection5 = ${fparse cycle_length * 4}
start_injection6 = ${fparse cycle_length * 5}
start_injection7 = ${fparse cycle_length * 6}
start_injection8 = ${fparse cycle_length * 7}
start_injection9 = ${fparse cycle_length * 8}
start_injection10 = ${fparse cycle_length * 9}
end_injection1 = ${fparse start_injection1 + inject_time}
end_injection2 = ${fparse start_injection2 + inject_time}
end_injection3 = ${fparse start_injection3 + inject_time}
end_injection4 = ${fparse start_injection4 + inject_time}
end_injection5 = ${fparse start_injection5 + inject_time}
end_injection6 = ${fparse start_injection6 + inject_time}
end_injection7 = ${fparse start_injection7 + inject_time}
end_injection8 = ${fparse start_injection8 + inject_time}
end_injection9 = ${fparse start_injection9 + inject_time}
end_injection10 = ${fparse start_injection10 + inject_time}
start_production1 = ${fparse end_injection1 + store_time}
start_production2 = ${fparse end_injection2 + store_time}
start_production3 = ${fparse end_injection3 + store_time}
start_production4 = ${fparse end_injection4 + store_time}
start_production5 = ${fparse end_injection5 + store_time}
start_production6 = ${fparse end_injection6 + store_time}
start_production7 = ${fparse end_injection7 + store_time}
start_production8 = ${fparse end_injection8 + store_time}
start_production9 = ${fparse end_injection9 + store_time}
start_production10 = ${fparse end_injection10 + store_time}
end_production1 = ${fparse start_production1 + produce_time}
end_production2 = ${fparse start_production2 + produce_time}
end_production3 = ${fparse start_production3 + produce_time}
end_production4 = ${fparse start_production4 + produce_time}
end_production5 = ${fparse start_production5 + produce_time}
end_production6 = ${fparse start_production6 + produce_time}
end_production7 = ${fparse start_production7 + produce_time}
end_production8 = ${fparse start_production8 + produce_time}
end_production9 = ${fparse start_production9 + produce_time}
end_production10 = ${fparse start_production10 + produce_time}
synctimes = '${start_injection1} ${end_injection1} ${start_production1} ${end_production1}
${start_injection2} ${end_injection2} ${start_production2} ${end_production2}
${start_injection3} ${end_injection3} ${start_production3} ${end_production3}
${start_injection4} ${end_injection4} ${start_production4} ${end_production4}
${start_injection5} ${end_injection5} ${start_production5} ${end_production5}
${start_injection6} ${end_injection6} ${start_production6} ${end_production6}
${start_injection7} ${end_injection7} ${start_production7} ${end_production7}
${start_injection8} ${end_injection8} ${start_production8} ${end_production8}
${start_injection9} ${end_injection9} ${start_production9} ${end_production9}
${start_injection10} ${end_injection10} ${start_production10} ${end_production10}'
#####################################
# Geometry in RZ coordinates
# borehole radius (m)
bh_r = 0.1
# model radius (m)
max_r = 1000
# aquifer thickness (m)
aq_thickness = 20
# cap thickness (m)
cap_thickness = 40
# injection region top and bottom (m). Note, the mesh is created with the aquifer in y = (-0.5 * aq_thickness, 0.5 * aq_thickness), irrespective of depth (depth only sets the insitu porepressure and temperature)
screen_top = ${fparse 0.5 * aq_thickness}
screen_bottom = ${fparse -0.5 * aq_thickness}
# number of elements in radial direction
num_r = 25
# number of elements across half height of aquifer
num_y_aq = 10
# number of elements across height of cap
num_y_cap = 8
# mesh bias in radial direction
bias_r = 1.22
# mesh bias in vertical direction in aquifer top
bias_y_aq_top = 0.9
# mesh bias in vertical direction in cap top
bias_y_cap_top = 1.3
# mesh bias in vertical direction in aquifer bottom
bias_y_aq_bottom = ${fparse 1.0 / bias_y_aq_top}
# mesh bias in vertical direction in cap bottom
bias_y_cap_bottom = ${fparse 1.0 / bias_y_cap_top}
depth_centre = ${fparse depth + aq_thickness/2}
#####################################
# temperature at ground surface (degC)
temp0 = 20
# Vertical geothermal gradient (K/m). A positive number means temperature increases downwards.
geothermal_gradient = 20E-3
#####################################
# Gravity
gravity = -9.81
#####################################
half_aq_thickness = ${fparse aq_thickness * 0.5}
half_height = ${fparse half_aq_thickness + cap_thickness}
approx_screen_length = ${fparse screen_top - screen_bottom}
# Thermal radius (note this is not strictly correct, it should use the bulk specific heat
# capacity as defined below, but it doesn't matter here because this is purely for
# defining the region of refined mesh)
th_r = ${fparse sqrt(inject_fluid_mass / 1000 * 4.12e6 / (approx_screen_length * 3.1416 * aq_specific_heat_cap * aq_density))}
# radius of fine mesh
fine_r = ${fparse th_r * 2}
bias_r_fine = 1
num_r_fine = ${fparse int(fine_r/1)}
######################################
# aquifer properties
aq_porosity = 0.25
aq_hor_perm = 1E-11 # m^2
aq_ver_perm = 2E-12 # m^2
aq_density = 2650 # kg/m^3
aq_specific_heat_cap = 800 # J/Kg/K
aq_hor_thermal_cond = 3 # W/m/K
aq_ver_thermal_cond = 3 # W/m/K
aq_disp_parallel = 0 # m
aq_disp_perp = 0 # m
# Bulk volumetric heat capacity of aquifer:
aq_vol_cp = ${fparse aq_specific_heat_cap * aq_density * (1 - aq_porosity) + 4180 * 1000 * aq_porosity}
# Thermal radius (correct version using bulk cp):
R_th = ${fparse sqrt(inject_fluid_mass * 4180 / (approx_screen_length * 3.1416 * aq_vol_cp))}
aq_lambda_eff_hor = ${fparse aq_hor_thermal_cond + 0.3 * aq_disp_parallel * R_th * aq_vol_cp / (inject_time * 60 * 60 * 24)}
aq_lambda_eff_ver = ${fparse aq_ver_thermal_cond + 0.3 * aq_disp_perp * R_th * aq_vol_cp / (inject_time * 60 * 60 * 24)}
aq_hor_dry_thermal_cond = ${fparse aq_lambda_eff_hor * 60 * 60 * 24} # J/day/m/K
aq_ver_dry_thermal_cond = ${fparse aq_lambda_eff_ver * 60 * 60 * 24} # J/day/m/K
aq_hor_wet_thermal_cond = ${fparse aq_lambda_eff_hor * 60 * 60 * 24} # J/day/m/K
aq_ver_wet_thermal_cond = ${fparse aq_lambda_eff_ver * 60 * 60 * 24} # J/day/m/K
# cap-rock properties
cap_porosity = 0.25
cap_hor_perm = 1E-16 # m^2
cap_ver_perm = 1E-17 # m^2
cap_density = 2650 # kg/m^3
cap_specific_heat_cap = 800 # J/kg/K
cap_hor_thermal_cond = 3 # W/m/K
cap_ver_thermal_cond = 3 # W/m/K
cap_hor_dry_thermal_cond = ${fparse cap_hor_thermal_cond * 60 * 60 * 24} # J/day/m/K
cap_ver_dry_thermal_cond = ${fparse cap_ver_thermal_cond * 60 * 60 * 24} # J/day/m/K
cap_hor_wet_thermal_cond = ${fparse cap_hor_thermal_cond * 60 * 60 * 24} # J/day/m/K
cap_ver_wet_thermal_cond = ${fparse cap_ver_thermal_cond * 60 * 60 * 24} # J/day/m/K
######################################
[Mesh]
coord_type = RZ
[aq_top_fine]
type = GeneratedMeshGenerator
dim = 2
nx = ${num_r_fine}
xmin = ${bh_r}
xmax = ${fine_r}
bias_x = ${bias_r_fine}
bias_y = ${bias_y_aq_top}
ny = ${num_y_aq}
ymin = 0
ymax = ${half_aq_thickness}
[]
[cap_top_fine]
type = GeneratedMeshGenerator
dim = 2
nx = ${num_r_fine}
xmin = ${bh_r}
xmax = ${fine_r}
bias_x = ${bias_r_fine}
bias_y = ${bias_y_cap_top}
ny = ${num_y_cap}
ymax = ${half_height}
ymin = ${half_aq_thickness}
[]
[aq_and_cap_top_fine]
type = StitchedMeshGenerator
inputs = 'aq_top_fine cap_top_fine'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'top bottom'
[]
[aq_bottom_fine]
type = GeneratedMeshGenerator
dim = 2
nx = ${num_r_fine}
xmin = ${bh_r}
xmax = ${fine_r}
bias_x = ${bias_r_fine}
bias_y = ${bias_y_aq_bottom}
ny = ${num_y_aq}
ymax = 0
ymin = -${half_aq_thickness}
[]
[cap_bottom_fine]
type = GeneratedMeshGenerator
dim = 2
nx = ${num_r_fine}
xmin = ${bh_r}
xmax = ${fine_r}
bias_x = ${bias_r_fine}
bias_y = ${bias_y_cap_bottom}
ny = ${num_y_cap}
ymin = -${half_height}
ymax = -${half_aq_thickness}
[]
[aq_and_cap_bottom_fine]
type = StitchedMeshGenerator
inputs = 'aq_bottom_fine cap_bottom_fine'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'bottom top'
[]
[aq_and_cap_fine]
type = StitchedMeshGenerator
inputs = 'aq_and_cap_bottom_fine aq_and_cap_top_fine'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'top bottom'
[]
[aq_top]
type = GeneratedMeshGenerator
dim = 2
nx = ${num_r}
xmin = ${fine_r}
xmax = ${max_r}
bias_x = ${bias_r}
bias_y = ${bias_y_aq_top}
ny = ${num_y_aq}
ymin = 0
ymax = ${half_aq_thickness}
[]
[cap_top]
type = GeneratedMeshGenerator
dim = 2
nx = ${num_r}
xmin = ${fine_r}
xmax = ${max_r}
bias_x = ${bias_r}
bias_y = ${bias_y_cap_top}
ny = ${num_y_cap}
ymax = ${half_height}
ymin = ${half_aq_thickness}
[]
[aq_and_cap_top]
type = StitchedMeshGenerator
inputs = 'aq_top cap_top'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'top bottom'
[]
[aq_bottom]
type = GeneratedMeshGenerator
dim = 2
nx = ${num_r}
xmin = ${fine_r}
xmax = ${max_r}
bias_x = ${bias_r}
bias_y = ${bias_y_aq_bottom}
ny = ${num_y_aq}
ymax = 0
ymin = -${half_aq_thickness}
[]
[cap_bottom]
type = GeneratedMeshGenerator
dim = 2
nx = ${num_r}
xmin = ${fine_r}
xmax = ${max_r}
bias_x = ${bias_r}
bias_y = ${bias_y_cap_bottom}
ny = ${num_y_cap}
ymin = -${half_height}
ymax = -${half_aq_thickness}
[]
[aq_and_cap_bottom]
type = StitchedMeshGenerator
inputs = 'aq_bottom cap_bottom'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'bottom top'
[]
[aq_and_cap]
type = StitchedMeshGenerator
inputs = 'aq_and_cap_bottom aq_and_cap_top'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'top bottom'
[]
[aq_and_cap_all]
type = StitchedMeshGenerator
inputs = 'aq_and_cap_fine aq_and_cap'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'right left'
[]
[aquifer]
type = ParsedSubdomainMeshGenerator
input = aq_and_cap_all
combinatorial_geometry = 'y >= -${half_aq_thickness} & y <= ${half_aq_thickness}'
block_id = 1
[]
[top_cap]
type = ParsedSubdomainMeshGenerator
input = aquifer
combinatorial_geometry = 'y >= ${half_aq_thickness}'
block_id = 2
[]
[bottom_cap]
type = ParsedSubdomainMeshGenerator
input = top_cap
combinatorial_geometry = 'y <= -${half_aq_thickness}'
block_id = 3
[]
[injection_area]
type = ParsedGenerateSideset
combinatorial_geometry = 'x<=${bh_r}*1.000001 & y >= ${screen_bottom} & y <= ${screen_top}'
included_subdomains = 1
new_sideset_name = 'injection_area'
input = 'bottom_cap'
[]
[rename]
type = RenameBlockGenerator
old_block = '1 2 3'
new_block = 'aquifer caps caps'
input = 'injection_area'
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 ${gravity} 0'
[]
[Variables]
[porepressure]
[]
[temperature]
scaling = 1E-5
[]
[]
[PorousFlowFullySaturated]
coupling_type = ThermoHydro
porepressure = porepressure
temperature = temperature
fp = tabulated_water
stabilization = KT
flux_limiter_type = ${flux_limiter}
use_displaced_mesh = false
temperature_unit = Celsius
pressure_unit = Pa
time_unit = days
[]
[ICs]
[porepressure]
type = FunctionIC
variable = porepressure
function = insitu_pressure
[]
[temperature]
type = FunctionIC
variable = temperature
function = insitu_temperature
[]
[]
[BCs]
[outer_boundary_porepressure]
type = FunctionDirichletBC
preset = true
variable = porepressure
function = insitu_pressure
boundary = 'bottom right top'
[]
[outer_boundary_temperature]
type = FunctionDirichletBC
preset = true
variable = temperature
function = insitu_temperature
boundary = 'bottom right top'
[]
[inject_heat]
type = FunctionDirichletBC
variable = temperature
function = ${inject_temp}
boundary = 'injection_area'
[]
[inject_fluid]
type = PorousFlowSink
variable = porepressure
boundary = injection_area
flux_function = injection_rate_value
[]
[produce_heat]
type = PorousFlowSink
variable = temperature
boundary = injection_area
flux_function = production_rate_value
fluid_phase = 0
use_enthalpy = true
save_in = heat_flux_out
[]
[produce_fluid]
type = PorousFlowSink
variable = porepressure
boundary = injection_area
flux_function = production_rate_value
[]
[]
[Controls]
[inject_on]
type = ConditionalFunctionEnableControl
enable_objects = 'BCs::inject_heat BCs::inject_fluid'
conditional_function = inject
implicit = false
execute_on = 'initial timestep_begin'
[]
[produce_on]
type = ConditionalFunctionEnableControl
enable_objects = 'BCs::produce_heat BCs::produce_fluid'
conditional_function = produce
implicit = false
execute_on = 'initial timestep_begin'
[]
[]
[Functions]
[insitu_pressure]
type = ParsedFunction
expression = '(y - ${depth_centre}) * 1000 * ${gravity} + 1E5' # approx insitu pressure in Pa
[]
[insitu_temperature]
type = ParsedFunction
expression = '${temp0} + (${depth_centre} - y) * ${geothermal_gradient}'
[]
[inject]
type = ParsedFunction
expression = 'if(t >= ${start_injection1} & t < ${end_injection1}, 1,
if(t >= ${start_injection2} & t < ${end_injection2}, 1,
if(t >= ${start_injection3} & t < ${end_injection3}, 1,
if(t >= ${start_injection4} & t < ${end_injection4}, 1,
if(t >= ${start_injection5} & t < ${end_injection5}, 1,
if(t >= ${start_injection6} & t < ${end_injection6}, 1,
if(t >= ${start_injection7} & t < ${end_injection7}, 1,
if(t >= ${start_injection8} & t < ${end_injection8}, 1,
if(t >= ${start_injection9} & t < ${end_injection9}, 1,
if(t >= ${start_injection10} & t < ${end_injection10}, 1, 0))))))))))'
[]
[produce]
type = ParsedFunction
expression = 'if(t >= ${start_production1} & t < ${end_production1}, 1,
if(t >= ${start_production2} & t < ${end_production2}, 1,
if(t >= ${start_production3} & t < ${end_production3}, 1,
if(t >= ${start_production4} & t < ${end_production4}, 1,
if(t >= ${start_production5} & t < ${end_production5}, 1,
if(t >= ${start_production6} & t < ${end_production6}, 1,
if(t >= ${start_production7} & t < ${end_production7}, 1,
if(t >= ${start_production8} & t < ${end_production8}, 1,
if(t >= ${start_production9} & t < ${end_production9}, 1,
if(t >= ${start_production10} & t < ${end_production10}, 1, 0))))))))))'
[]
[injection_rate_value]
type = ParsedFunction
symbol_names = true_screen_area
symbol_values = true_screen_area
expression = '-${inject_fluid_mass}/(true_screen_area * ${inject_time})'
[]
[production_rate_value]
type = ParsedFunction
symbol_names = true_screen_area
symbol_values = true_screen_area
expression = '${produce_fluid_mass}/(true_screen_area * ${produce_time})'
[]
[heat_out_in_timestep]
type = ParsedFunction
symbol_names = 'dt heat_out'
symbol_values = 'dt heat_out_fromBC'
expression = 'dt*heat_out'
[]
[produced_T_time_integrated]
type = ParsedFunction
symbol_names = 'dt produced_T'
symbol_values = 'dt produced_T'
expression = 'dt*produced_T / ${produce_time}'
[]
[]
[AuxVariables]
[density]
family = MONOMIAL
order = CONSTANT
[]
[porosity]
family = MONOMIAL
order = CONSTANT
[]
[heat_flux_out]
outputs = none
[]
[]
[AuxKernels]
[density]
type = PorousFlowPropertyAux
variable = density
property = density
[]
[porosity]
type = PorousFlowPropertyAux
variable = porosity
property = porosity
[]
[]
[FluidProperties]
[true_water]
type = Water97FluidProperties
[]
[tabulated_water]
type = TabulatedFluidProperties
fp = true_water
temperature_min = 275 # K
temperature_max = 600
interpolated_properties = 'density viscosity enthalpy internal_energy'
fluid_property_file = water97_tabulated_modified.csv
[]
[]
[Materials]
[porosity_aq]
type = PorousFlowPorosityConst
porosity = ${aq_porosity}
block = aquifer
[]
[porosity_caps]
type = PorousFlowPorosityConst
porosity = ${cap_porosity}
block = caps
[]
[permeability_aquifer]
type = PorousFlowPermeabilityConst
block = aquifer
permeability = '${aq_hor_perm} 0 0 0 ${aq_ver_perm} 0 0 0 0'
[]
[permeability_caps]
type = PorousFlowPermeabilityConst
block = caps
permeability = '${cap_hor_perm} 0 0 0 ${cap_ver_perm} 0 0 0 0'
[]
[aq_internal_energy]
type = PorousFlowMatrixInternalEnergy
block = aquifer
density = ${aq_density}
specific_heat_capacity = ${aq_specific_heat_cap}
[]
[caps_internal_energy]
type = PorousFlowMatrixInternalEnergy
block = caps
density = ${cap_density}
specific_heat_capacity = ${cap_specific_heat_cap}
[]
[aq_thermal_conductivity]
type = PorousFlowThermalConductivityIdeal
block = aquifer
dry_thermal_conductivity = '${aq_hor_dry_thermal_cond} 0 0 0 ${aq_ver_dry_thermal_cond} 0 0 0 0'
wet_thermal_conductivity = '${aq_hor_wet_thermal_cond} 0 0 0 ${aq_ver_wet_thermal_cond} 0 0 0 0'
[]
[caps_thermal_conductivity]
type = PorousFlowThermalConductivityIdeal
block = caps
dry_thermal_conductivity = '${cap_hor_dry_thermal_cond} 0 0 0 ${cap_ver_dry_thermal_cond} 0 0 0 0'
wet_thermal_conductivity = '${cap_hor_wet_thermal_cond} 0 0 0 ${cap_ver_wet_thermal_cond} 0 0 0 0'
[]
[]
[Postprocessors]
[true_screen_area] # this accounts for meshes that do not match screen_top and screen_bottom exactly
type = AreaPostprocessor
boundary = injection_area
execute_on = 'initial'
outputs = 'none'
[]
[dt]
type = TimestepSize
[]
[heat_out_fromBC]
type = NodalSum
variable = heat_flux_out
boundary = injection_area
execute_on = 'initial timestep_end'
outputs = 'none'
[]
[heat_out_per_timestep]
type = FunctionValuePostprocessor
function = heat_out_in_timestep
execute_on = 'timestep_end'
outputs = 'none'
[]
[heat_out_cumulative]
type = CumulativeValuePostprocessor
postprocessor = heat_out_per_timestep
execute_on = 'timestep_end'
outputs = 'csv console'
[]
[produced_T]
type = SideAverageValue
boundary = injection_area
variable = temperature
execute_on = 'initial timestep_end'
outputs = 'csv console'
[]
[produced_T_time_integrated]
type = FunctionValuePostprocessor
function = produced_T_time_integrated
execute_on = 'timestep_end'
outputs = 'none'
[]
[produced_T_cumulative]
type = CumulativeValuePostprocessor
postprocessor = produced_T_time_integrated
execute_on = 'timestep_end'
outputs = 'csv console'
[]
[]
[Preconditioning]
[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'
[]
[]
[Executioner]
type = Transient
solve_type = Newton
end_time = ${end_simulation}
timestep_tolerance = 1e-5
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-3
growth_factor = 2
[]
dtmax = 1
dtmin = 1e-5
# rough calc for fluid, |R| ~ V*k*1E6 ~ V*1E-5
# rough calc for heat, |R| ~ V*(lam*1E-3 + h*1E-5) ~ V*(1E3 + 1E-2)
# so scale heat by 1E-7 and go for nl_abs_tol = 1E-4, which should give a max error of
# ~1Pa and ~0.1K in the first metre around the borehole
nl_abs_tol = 1E-4
nl_rel_tol = 1E-5
[]
[Outputs]
sync_times = ${synctimes}
[ex]
type = Exodus
time_step_interval = 20
[]
[csv]
type = CSV
execute_postprocessors_on = 'initial timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_velocity.i)
rho = 'rho'
l = 10
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.001
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 10
ny = 5
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = ${inlet_velocity}
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T_fluid]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[scalar]
type = MooseVariableFVReal
initial_condition = 0.1
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e4
[]
[]
[FVKernels]
[mass_time]
type = WCNSFVMassTimeDerivative
variable = pressure
drho_dt = drho_dt
[]
[mass]
type = WCNSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = vel_x
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = vel_y
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T_fluid
rho = rho
drho_dt = drho_dt
h = h
dh_dt = dh_dt
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T_fluid
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T_fluid
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T_fluid
v = power_density
[]
# Scalar concentration equation
[scalar_time]
type = FVFunctorTimeKernel
variable = scalar
[]
[scalar_advection]
type = INSFVScalarFieldAdvection
variable = scalar
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[scalar_diffusion]
type = FVDiffusion
variable = scalar
coeff = 1.1
[]
[scalar_source]
type = FVBodyForce
variable = scalar
function = 2.1
[]
[]
[FVBCs]
# Inlet
[inlet_mass]
type = WCNSFVMassFluxBC
variable = pressure
boundary = 'left'
velocity_pp = 'inlet_u'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_u]
type = WCNSFVMomentumFluxBC
variable = vel_x
boundary = 'left'
velocity_pp = 'inlet_u'
rho = 'rho'
momentum_component = 'x'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_v]
type = WCNSFVMomentumFluxBC
variable = vel_y
boundary = 'left'
velocity_pp = 0
rho = 'rho'
momentum_component = 'y'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_T]
type = WCNSFVEnergyFluxBC
variable = T_fluid
T_fluid = T_fluid
boundary = 'left'
velocity_pp = 'inlet_u'
temperature_pp = 'inlet_T'
rho = 'rho'
cp = 'cp'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_scalar]
type = WCNSFVScalarFluxBC
variable = scalar
boundary = 'left'
scalar_value_pp = 'inlet_scalar_value'
velocity_pp = 'inlet_u'
vel_x = vel_x
vel_y = vel_y
rho = rho
passive_scalar = scalar
[]
[outlet_p]
type = INSFVOutletPressureBC
variable = pressure
boundary = 'right'
function = ${outlet_pressure}
[]
# Walls
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'top bottom'
function = 0
[]
[]
# used for the boundary conditions in this example
[Postprocessors]
[inlet_u]
type = Receiver
default = ${inlet_velocity}
[]
[area_pp_left]
type = AreaPostprocessor
boundary = 'left'
execute_on = 'INITIAL'
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
[]
[inlet_scalar_value]
type = Receiver
default = 0.2
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T_fluid
pressure = pressure
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T_fluid'
rho = ${rho}
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-2
optimal_iterations = 6
[]
end_time = 1
nl_abs_tol = 1e-9
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
exodus = true
execute_on = FINAL
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/boundary_conditions/flux_bcs_reversal.i)
rho = 'rho'
l = 10
inlet_area = 1
velocity_interp_method = 'rc'
advected_interp_method = 'average'
# Artificial fluid properties
# For a real case, use a GeneralFluidFunctorProperties and a viscosity rampdown
# or initialize very well!
k = 1
cp = 1000
mu = 1e2
# Operating conditions
inlet_temp = 300
outlet_pressure = 1e5
inlet_velocity = 0.1
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = 1
nx = 6
ny = 3
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = ${inlet_velocity}
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1e-15
[]
[pressure]
type = INSFVPressureVariable
initial_condition = ${outlet_pressure}
[]
[T_fluid]
type = INSFVEnergyVariable
initial_condition = ${inlet_temp}
[]
[scalar]
type = MooseVariableFVReal
initial_condition = 0.1
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[AuxVariables]
[power_density]
type = MooseVariableFVReal
initial_condition = 1e6
[]
[]
[FVKernels]
# Mass equation
[mass]
type = INSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
[]
[mean_zero_pressure]
type = FVIntegralValueConstraint
variable = pressure
lambda = lambda
phi0 = 0.0
[]
# X component momentum equation
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = vel_x
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
# Y component momentum equation
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = vel_y
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
# Energy equation
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T_fluid
rho = rho
drho_dt = drho_dt
dh_dt = dh_dt
h = h
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T_fluid
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T_fluid
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[heat_source]
type = FVCoupledForce
variable = T_fluid
v = power_density
[]
# Scalar concentration equation
[scalar_time]
type = FVFunctorTimeKernel
variable = scalar
[]
[scalar_advection]
type = INSFVScalarFieldAdvection
variable = scalar
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[scalar_diffusion]
type = FVDiffusion
variable = scalar
coeff = 1.1
[]
[scalar_source]
type = FVBodyForce
variable = scalar
function = 2.1
[]
[]
[FVBCs]
# Inlet
[inlet_mass]
type = WCNSFVMassFluxBC
variable = pressure
boundary = 'left'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_u]
type = WCNSFVMomentumFluxBC
variable = vel_x
boundary = 'left'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
momentum_component = 'x'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_v]
type = WCNSFVMomentumFluxBC
variable = vel_y
boundary = 'left'
mdot_pp = 0
area_pp = 'area_pp_left'
rho = 'rho'
momentum_component = 'y'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_T]
type = WCNSFVEnergyFluxBC
variable = T_fluid
T_fluid = T_fluid
boundary = 'left'
temperature_pp = 'inlet_T'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
cp = 'cp'
vel_x = vel_x
vel_y = vel_y
[]
[inlet_scalar]
type = WCNSFVScalarFluxBC
variable = scalar
boundary = 'left'
scalar_value_pp = 'inlet_scalar_value'
mdot_pp = 'inlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
passive_scalar = scalar
[]
[outlet_mass]
type = WCNSFVMassFluxBC
variable = pressure
boundary = 'right'
mdot_pp = 'outlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
[]
[outlet_u]
type = WCNSFVMomentumFluxBC
variable = vel_x
boundary = 'right'
mdot_pp = 'outlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
momentum_component = 'x'
vel_x = vel_x
vel_y = vel_y
[]
[outlet_v]
type = WCNSFVMomentumFluxBC
variable = vel_y
boundary = 'right'
mdot_pp = 0
area_pp = 'area_pp_left'
rho = 'rho'
momentum_component = 'y'
vel_x = vel_x
vel_y = vel_y
[]
[outlet_T]
type = WCNSFVEnergyFluxBC
variable = T_fluid
T_fluid = T_fluid
boundary = 'right'
temperature_pp = 'inlet_T'
mdot_pp = 'outlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
cp = 'cp'
vel_x = vel_x
vel_y = vel_y
[]
[outlet_scalar]
type = WCNSFVScalarFluxBC
variable = scalar
boundary = 'right'
scalar_value_pp = 'inlet_scalar_value'
mdot_pp = 'outlet_mdot'
area_pp = 'area_pp_left'
rho = 'rho'
vel_x = vel_x
vel_y = vel_y
passive_scalar = scalar
[]
# Walls
[no_slip_x]
type = INSFVNaturalFreeSlipBC
variable = vel_x
momentum_component = x
boundary = 'top bottom'
[]
[no_slip_y]
type = INSFVNaturalFreeSlipBC
variable = vel_y
momentum_component = y
boundary = 'top bottom'
[]
[]
# used for the boundary conditions in this example
[Postprocessors]
[inlet_mdot]
type = Receiver
default = ${fparse 1980 * inlet_velocity * inlet_area}
#outputs = none
[]
[outlet_mdot]
type = Receiver
default = ${fparse -1980 * inlet_velocity * inlet_area}
outputs = none
[]
[area_pp_left]
type = AreaPostprocessor
boundary = 'left'
execute_on = 'INITIAL'
outputs = none
[]
[inlet_T]
type = Receiver
default = ${inlet_temp}
outputs = none
[]
[inlet_scalar_value]
type = Receiver
default = 0.2
outputs = none
[]
[left_mdot]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
advected_quantity = rho
boundary = left
#advected_interp_method = ${advected_interp_method}
[]
[right_mdot]
type = VolumetricFlowRate
vel_x = vel_x
vel_y = vel_y
advected_quantity = rho
boundary = right
advected_interp_method = upwind #${advected_interp_method}
[]
[]
[FluidProperties]
[fp]
type = FlibeFluidProperties
[]
[]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'cp k rho'
prop_values = '${cp} ${k} 1980'
[]
#[rho]
# type = RhoFromPTFunctorMaterial
# fp = fp
# temperature = T_fluid
# pressure = pressure
#[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T_fluid'
rho = ${rho}
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
dt = 1e-1
optimal_iterations = 6
growth_factor = 4
[]
end_time = 500000
nl_abs_tol = 1e-7
nl_max_its = 50
line_search = 'none'
automatic_scaling = true
[]
[Outputs]
exodus = true
execute_on = FINAL
[]
(test/tests/postprocessors/geometry/2d_geometry.i)
radius = 0.5
inner_box_length = 2.2
outer_box_length = 3
sides = 16
alpha = ${fparse 2 * pi / ${sides}}
perimeter_correction = ${fparse alpha / 2 / sin(alpha / 2)}
area_correction = ${fparse alpha / sin(alpha)}
[Mesh]
file = 2d.e
construct_side_list_from_node_list = true
[]
[Variables]
[./u]
initial_condition = 1
block = circle
[../]
[./v]
initial_condition = 2
block = 'inside outside'
[../]
[]
[Kernels]
[./diff_u]
type = Diffusion
variable = u
[../]
[./diff_v]
type = Diffusion
variable = v
[../]
[]
[BCs]
[./circle]
type = DirichletBC
variable = u
boundary = circle_side_wrt_inside
value = 2
[../]
[./inner]
type = DirichletBC
variable = v
boundary = circle_side_wrt_circle
value = 4
[../]
[./outer]
type = DirichletBC
variable = v
boundary = outside_side
value = 6
[../]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[./u_avg]
type = ElementAverageValue
variable = u
block = circle
[../]
[./v_avg]
type = ElementAverageValue
variable = v
block = 'inside outside'
[../]
[./circle_perimeter_wrt_circle]
type = AreaPostprocessor
boundary = circle_side_wrt_circle
[../]
[./circle_perimeter_wrt_inside]
type = AreaPostprocessor
boundary = circle_side_wrt_inside
[../]
[./inside_perimeter_wrt_inside]
type = AreaPostprocessor
boundary = inside_side_wrt_inside
[../]
[./inside_perimeter_wrt_outside]
type = AreaPostprocessor
boundary = inside_side_wrt_outside
[../]
[./outside_perimeter]
type = AreaPostprocessor
boundary = outside_side
[../]
[./circle_area]
type = VolumePostprocessor
block = circle
[../]
[./inside_area]
type = VolumePostprocessor
block = inside
[../]
[./outside_area]
type = VolumePostprocessor
block = outside
[../]
[./total_area]
type = VolumePostprocessor
block = 'circle inside outside'
[../]
[./circle_perimeter_exact]
type = FunctionValuePostprocessor
function = 'circle_perimeter_exact'
[../]
[./inside_perimeter_exact]
type = FunctionValuePostprocessor
function = 'inside_perimeter_exact'
[../]
[./outside_perimeter_exact]
type = FunctionValuePostprocessor
function = 'outside_perimeter_exact'
[../]
[./circle_area_exact]
type = FunctionValuePostprocessor
function = 'circle_area_exact'
[../]
[./inside_area_exact]
type = FunctionValuePostprocessor
function = 'inside_area_exact'
[../]
[./outside_area_exact]
type = FunctionValuePostprocessor
function = 'outside_area_exact'
[../]
[./total_area_exact]
type = FunctionValuePostprocessor
function = 'total_area_exact'
[../]
[]
[Functions]
[./circle_perimeter_exact]
type = ParsedFunction
expression = '2 * pi * ${radius} / ${perimeter_correction}'
[../]
[./inside_perimeter_exact]
type = ParsedFunction
expression = '${inner_box_length} * 4'
[../]
[./outside_perimeter_exact]
type = ParsedFunction
expression = '${outer_box_length} * 4'
[../]
[./circle_area_exact]
type = ParsedFunction
expression = 'pi * ${radius}^2 / ${area_correction}'
[../]
[./inside_area_exact]
type = ParsedFunction
expression = '${inner_box_length}^2 - pi * ${radius}^2 / ${area_correction}'
[../]
[./outside_area_exact]
type = ParsedFunction
expression = '${outer_box_length}^2 - ${inner_box_length}^2'
[../]
[./total_area_exact]
type = ParsedFunction
expression = '${outer_box_length}^2'
[../]
[]
[Outputs]
csv = true
[]
(modules/porous_flow/test/tests/fluidstate/coldwater_injection_radial.i)
# Cold water injection into 1D radial hot reservoir (Avdonin, 1964)
#
# To generate results presented in documentation for this problem,
# set xmax = 1000 and nx = 200 in the Mesh block, and dtmax = 1e4
# and end_time = 1e6 in the Executioner block.
[Mesh]
type = GeneratedMesh
dim = 1
nx = 50
xmin = 0.1
xmax = 5
bias_x = 1.05
rz_coord_axis = Y
coord_type = RZ
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[AuxVariables]
[temperature]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[temperature]
type = PorousFlowPropertyAux
variable = temperature
property = temperature
execute_on = 'initial timestep_end'
[]
[]
[Variables]
[pliquid]
initial_condition = 5e6
[]
[h]
scaling = 1e-6
[]
[]
[ICs]
[hic]
type = PorousFlowFluidPropertyIC
variable = h
porepressure = pliquid
property = enthalpy
temperature = 170
temperature_unit = Celsius
fp = water
[]
[]
[Functions]
[injection_rate]
type = ParsedFunction
symbol_values = injection_area
symbol_names = area
expression = '-0.1/area'
[]
[]
[BCs]
[source]
type = PorousFlowSink
variable = pliquid
flux_function = injection_rate
boundary = left
[]
[pright]
type = DirichletBC
variable = pliquid
value = 5e6
boundary = right
[]
[hleft]
type = DirichletBC
variable = h
value = 678.52e3
boundary = left
[]
[hright]
type = DirichletBC
variable = h
value = 721.4e3
boundary = right
[]
[]
[Kernels]
[mass]
type = PorousFlowMassTimeDerivative
variable = pliquid
[]
[massflux]
type = PorousFlowAdvectiveFlux
variable = pliquid
[]
[heat]
type = PorousFlowEnergyTimeDerivative
variable = h
[]
[heatflux]
type = PorousFlowHeatAdvection
variable = h
[]
[heatcond]
type = PorousFlowHeatConduction
variable = h
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'pliquid h'
number_fluid_phases = 2
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureVG
pc_max = 1e6
sat_lr = 0.1
m = 0.5
alpha = 1e-5
[]
[fs]
type = PorousFlowWaterVapor
water_fp = water
capillary_pressure = pc
[]
[]
[FluidProperties]
[water]
type = Water97FluidProperties
[]
[]
[Materials]
[watervapor]
type = PorousFlowFluidStateSingleComponent
porepressure = pliquid
enthalpy = h
temperature_unit = Celsius
capillary_pressure = pc
fluid_state = fs
[]
[porosity]
type = PorousFlowPorosityConst
porosity = 0.2
[]
[permeability]
type = PorousFlowPermeabilityConst
permeability = '1.8e-11 0 0 0 1.8e-11 0 0 0 1.8e-11'
[]
[relperm_water]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 0
s_res = 0.1
sum_s_res = 0.1
[]
[relperm_gas]
type = PorousFlowRelativePermeabilityCorey
n = 2
phase = 1
sum_s_res = 0.1
[]
[internal_energy]
type = PorousFlowMatrixInternalEnergy
density = 2900
specific_heat_capacity = 740
[]
[rock_thermal_conductivity]
type = PorousFlowThermalConductivityIdeal
dry_thermal_conductivity = '20 0 0 0 20 0 0 0 20'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
end_time = 1e3
nl_abs_tol = 1e-8
[TimeStepper]
type = IterationAdaptiveDT
dt = 100
[]
[]
[Postprocessors]
[injection_area]
type = AreaPostprocessor
boundary = left
execute_on = initial
[]
[]
[VectorPostprocessors]
[line]
type = ElementValueSampler
sort_by = x
variable = temperature
execute_on = 'initial timestep_end'
[]
[]
[Outputs]
perf_graph = true
[csv]
type = CSV
execute_on = final
[]
[]
(test/tests/meshgenerators/flip_sideset_generator/flux_flip_3D.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 3
ny = 3
nz = 3
xmax = 3
ymax = 3
zmax = 3
[]
[subdomains]
type = ParsedSubdomainMeshGenerator
input = gmg
combinatorial_geometry = 'x < 1 & y > 1 & y < 2'
block_id = 1
[]
[sideset]
type = ParsedGenerateSideset
input = subdomains
combinatorial_geometry = 'z < 1'
included_subdomains = '1'
normal = '1 0 0'
new_sideset_name = interior
[]
[flip]
type = FlipSidesetGenerator
input = sideset
boundary = interior
[]
[]
[AuxVariables]
[u]
[]
[]
[AuxKernels]
[diffusion]
type = FunctionAux
variable = u
function = func
[]
[]
[Functions]
[func]
type = ParsedFunction
expression = x+y+z
[]
[]
[Problem]
type = FEProblem
solve = false
[]
[Postprocessors]
[flux]
type = SideDiffusiveFluxIntegral
variable = u
boundary = interior
diffusivity = 1
[]
[area]
type = AreaPostprocessor
boundary = interior
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(test/tests/interfacekernels/1d_interface/no-failed-point-inversions.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 10
xmax = 2
[]
[subdomain1]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '1.0 0 0'
block_id = 1
top_right = '2.0 1.0 0'
[]
[interface]
input = subdomain1
type = SideSetsBetweenSubdomainsGenerator
primary_block = '0'
paired_block = '1'
new_boundary = 'primary0_interface'
[]
[break]
type = BreakMeshByBlockGenerator
input = interface
[]
displacements = 'disp_x'
[]
[AuxVariables]
[disp_x][]
[]
[ICs]
[right]
type = ConstantIC
variable = disp_x
block = 1
value = 1
[]
[]
[Variables]
[u]
order = FIRST
family = LAGRANGE
block = '0'
[]
[v]
order = FIRST
family = LAGRANGE
block = '1'
[]
[]
[Kernels]
[diff_u]
type = CoeffParamDiffusion
variable = u
D = 4
block = 0
[]
[diff_v]
type = CoeffParamDiffusion
variable = v
D = 2
block = 1
[]
[]
[InterfaceKernels]
[penalty_interface]
type = PenaltyInterfaceDiffusion
variable = u
neighbor_var = v
boundary = primary0_interface
penalty = 1e6
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = 'left'
value = 1
[]
[right]
type = DirichletBC
variable = v
boundary = 'right'
value = 0
[]
[]
[Materials]
[block0]
type = GenericConstantMaterial
block = '0'
prop_names = 'D'
prop_values = '4'
[]
[block1]
type = GenericConstantMaterial
block = '1'
prop_names = 'D'
prop_values = '2'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
exodus = true
print_linear_residuals = true
[]
[Debug]
show_var_residual_norms = true
[]
[Postprocessors]
[area]
type = AreaPostprocessor
use_displaced_mesh = true
boundary = 'right'
[]
[]