- inputsThe input MeshGenerators.
C++ Type:std::vector<MeshGeneratorName>
Controllable:No
Description:The input MeshGenerators.
- stitch_boundaries_pairsPairs of boundaries to be stitched together between the 1st mesh in inputs and each consecutive mesh
C++ Type:std::vector<std::vector<std::string>>
Controllable:No
Description:Pairs of boundaries to be stitched together between the 1st mesh in inputs and each consecutive mesh
StitchMeshGenerator
Allows multiple mesh files to be stitched together to form a single mesh.
Example
Consider the following three meshes.

Fig. 1: Left portion of "stitched" mesh (left.e).

Fig. 2: Center portion of "stitched" mesh (center.e).

Fig. 3: Right portion of "stitched" mesh (right.e).
Using the StitchMeshGenerator object from within the Mesh block of the input file, as shown in the input file snippet below, these three square meshes are joined into a single mesh as shown in Figure 4.
Note that the way that the meshes are merged gives precedence to the left-most mesh listed in terms of sidesets: the sidesets of the second, third, etc meshes will be subsumed into the sidesets of the first mesh. The names of the sidesets in the first mesh are what the names that will remain in the outputted mesh.
[Mesh<<<{"href": "../../syntax/Mesh/index.html"}>>>]
[./fmg_left]
type = FileMeshGenerator<<<{"description": "Read a mesh from a file.", "href": "FileMeshGenerator.html"}>>>
file<<<{"description": "The filename to read."}>>> = left.e
[]
[./fmg_center]
type = FileMeshGenerator<<<{"description": "Read a mesh from a file.", "href": "FileMeshGenerator.html"}>>>
file<<<{"description": "The filename to read."}>>> = center.e
[]
[./fmg_right]
type = FileMeshGenerator<<<{"description": "Read a mesh from a file.", "href": "FileMeshGenerator.html"}>>>
file<<<{"description": "The filename to read."}>>> = right.e
[]
[./smg]
type = StitchMeshGenerator<<<{"description": "Allows multiple mesh files to be stitched together to form a single mesh.", "href": "StitchMeshGenerator.html"}>>>
inputs<<<{"description": "The input MeshGenerators."}>>> = 'fmg_left fmg_center fmg_right'
clear_stitched_boundary_ids<<<{"description": "Whether or not to clear the stitched boundary IDs"}>>> = true
stitch_boundaries_pairs<<<{"description": "Pairs of boundaries to be stitched together between the 1st mesh in inputs and each consecutive mesh"}>>> = 'right left;
right left'
merge_boundaries_with_same_name<<<{"description": "If the input meshes have boundaries with the same name (but different IDs), merge them"}>>> = false
[]
[](test/tests/meshgenerators/stitch_mesh_generator/stitched_mesh_generator.i)
Fig. 4: Resulting "stitched" mesh from combination of three square meshes.
Input Parameters
- algorithmBINARYControl the use of binary search for the nodes of the stitched surfaces.
Default:BINARY
C++ Type:MooseEnum
Options:BINARY, EXHAUSTIVE
Controllable:No
Description:Control the use of binary search for the nodes of the stitched surfaces.
- clear_stitched_boundary_idsTrueWhether or not to clear the stitched boundary IDs
Default:True
C++ Type:bool
Controllable:No
Description:Whether or not to clear the stitched boundary IDs
- enforce_all_nodes_match_on_boundariesFalseWhether to have the stitcher be very picky about the nodes being stitched.
Default:False
C++ Type:bool
Controllable:No
Description:Whether to have the stitcher be very picky about the nodes being stitched.
- merge_boundaries_with_same_nameTrueIf the input meshes have boundaries with the same name (but different IDs), merge them
Default:True
C++ Type:bool
Controllable:No
Description:If the input meshes have boundaries with the same name (but different IDs), merge them
- merge_boundary_nodes_all_or_nothingFalseWhether the stitcher is set to merge all nodes or none.
Default:False
C++ Type:bool
Controllable:No
Description:Whether the stitcher is set to merge all nodes or none.
- prevent_boundary_ids_overlapTrueWhether to re-number boundaries in stitched meshes to prevent merging of unrelated boundaries
Default:True
C++ Type:bool
Controllable:No
Description:Whether to re-number boundaries in stitched meshes to prevent merging of unrelated boundaries
- stitching_hmin_tolerance_factor1e-06Factor multiplied by the elements hmin to form a tolerance to use when stitching nodes
Default:1e-06
C++ Type:Real
Unit:(no unit assumed)
Controllable:No
Description:Factor multiplied by the elements hmin to form a tolerance to use when stitching nodes
- subdomain_remappingTrueTreat input subdomain names as primary, preserving them and remapping IDs as needed
Default:True
C++ Type:bool
Controllable:No
Description:Treat input subdomain names as primary, preserving them and remapping IDs as needed
- verbose_stitchingFalseWhether mesh stitching should have verbose output.
Default:False
C++ Type:bool
Controllable:No
Description:Whether mesh stitching should have verbose output.
Optional Parameters
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:No
Description:Set the enabled status of the MooseObject.
- save_with_nameKeep the mesh from this mesh generator in memory with the name specified
C++ Type:std::string
Controllable:No
Description:Keep the mesh from this mesh generator in memory with the name specified
Advanced Parameters
- nemesisFalseWhether or not to output the mesh file in the nemesisformat (only if output = true)
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not to output the mesh file in the nemesisformat (only if output = true)
- outputFalseWhether or not to output the mesh file after generating the mesh
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not to output the mesh file after generating the mesh
- show_infoFalseWhether or not to show mesh info after generating the mesh (bounding box, element types, sidesets, nodesets, subdomains, etc)
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not to show mesh info after generating the mesh (bounding box, element types, sidesets, nodesets, subdomains, etc)
Debugging Parameters
Input Files
- (test/tests/meshgenerators/stitch_mesh_generator/stitch_block_names.i)
- (test/tests/meshgenerators/manifold_subdomain/cone.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/radiation_participating_media/p1_radiation_cht_SIMPLE.i)
- (test/tests/meshgenerators/boundary_2d_delaunay_generator/cylinder.i)
- (test/tests/meshgenerators/stitch_mesh_generator/stitched_mesh_generator2.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/cht/conjugate_heat_transfer/cht_thermal_resistance.i)
- (test/tests/meshgenerators/mesh_diagnostics_generator/nonconforming_faces.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/channel/linear-segregated/header_and_mesh.i)
- (test/tests/meshgenerators/stitch_mesh_generator/stitched_mesh_generator_sameid.i)
- (test/tests/meshgenerators/stitch_mesh_generator/stitched_mesh_generator.i)
- (modules/porous_flow/examples/ates/ates.i)
Child Objects
(test/tests/meshgenerators/stitch_mesh_generator/stitched_mesh_generator.i)
[Mesh]
[./fmg_left]
type = FileMeshGenerator
file = left.e
[]
[./fmg_center]
type = FileMeshGenerator
file = center.e
[]
[./fmg_right]
type = FileMeshGenerator
file = right.e
[]
[./smg]
type = StitchMeshGenerator
inputs = 'fmg_left fmg_center fmg_right'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'right left;
right left'
merge_boundaries_with_same_name = false
[]
[]
[Outputs]
exodus = true
[]
(test/tests/meshgenerators/stitch_mesh_generator/stitch_block_names.i)
[Mesh]
[mesh1]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
subdomain_ids = '0 0
0 0'
[]
[mesh2]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
subdomain_ids = '1 1
1 1'
[]
[shift]
type = TransformGenerator
input = mesh2
transform = translate
vector_value = '1 0 0'
[]
[give_name]
type = RenameBlockGenerator
input = shift
old_block = 1
new_block = 'a_nice_name'
[]
[stitch]
type = StitchMeshGenerator
inputs = 'mesh1 give_name'
stitch_boundaries_pairs = 'right left'
[]
[]
(test/tests/meshgenerators/manifold_subdomain/cone.i)
expected = '2975'
!include check.i
[Mesh]
[disk]
type = ConcentricCircleMeshGenerator
num_sectors = 6
radii = '0.9'
rings = '10'
has_outer_square = false
preserve_volumes = false
[]
[cone]
type = ParsedNodeTransformGenerator
input = disk
z_function = '0.9 - sqrt(x * x + y * y)'
[]
[surface_quads]
type = StitchMeshGenerator
inputs = 'cone disk'
stitch_boundaries_pairs = 'outer outer'
clear_stitched_boundary_ids = true
[]
[background]
type = GeneratedMeshGenerator
dim = 3
nx = 25
ny = 25
nz = 25
xmin = -1
xmax = 1
ymin = -1
ymax = 1
zmax = 1
[]
[surface]
type = ElementsToSimplicesConverter
input = surface_quads
[]
[tag]
type = ManifoldSubdomainGenerator
input = background
manifold = surface
block_id = 1
[]
[remove]
type = BlockDeletionGenerator
input = tag
block = '0'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/radiation_participating_media/p1_radiation_cht_SIMPLE.i)
# Coupled conduction and radiative heat transfer test in the linear FV system using the SIMPLE executioner.
# A 1D P1 radiation model is solved in the fluid region. Energy is solved in the
# fluid and solid region using two different variables. The radiative and conductive flux
# is maintained at the fluid-solid interface using conjugate heat transfer, Robin BCs for
# the solid side and Dirichlet BCs for the fluid side. Fixed temperatures are set at the solid and
# fluid external boundaries.
### Benchmark sources:
### https://hal.science/hal-02070285/document
nx = 10
Tw_left = 1.0
Tw_right = 0.0
sigma = 5.670374419e-8
sigma_a = 1.0
N = 0.1 # Stark number N = k sigma_a / (4*sigma*pow(T_w,3))
k_salt = ${fparse N*4*sigma*pow(Tw_left,3)/sigma_a}
k_solid = ${fparse 4.0*k_salt}
diffusion_coef = ${fparse 1/(3*sigma_a)}
b_eps = 1.0
rho = 1.
mu = 5.
h_s = 0.0
advected_interp_method = 'upwind'
[Mesh]
[salt_mesh]
type = GeneratedMeshGenerator
dim = 1
nx = ${nx}
xmin = 0
xmax = 1
subdomain_ids = 0
[]
[solid_mesh]
type = GeneratedMeshGenerator
dim = 1
nx = ${nx}
xmin = 1
xmax = 2
subdomain_ids = 1
[]
[give_name_solid]
type = RenameBlockGenerator
input = solid_mesh
old_block = 1
new_block = 'solid'
[]
[give_name_salt]
type = RenameBlockGenerator
input = salt_mesh
old_block = 0
new_block = 'salt'
[]
[stitch]
type = StitchMeshGenerator
inputs = 'give_name_salt give_name_solid'
stitch_boundaries_pairs = 'right left'
[]
[interface]
input = stitch
type = SideSetsBetweenSubdomainsGenerator
primary_block = 'solid'
paired_block = 'salt'
new_boundary = interface
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
[Problem]
linear_sys_names = 'u_system pressure_system energy_system solid_energy_system radiation_system '
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
block = 'salt'
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = 1e-6
solver_sys = 'u_system'
block = 'salt'
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = 'pressure_system'
initial_condition = 1e-6
block = 'salt'
[]
[T_fluid]
type = MooseLinearVariableFVReal
solver_sys = 'energy_system'
initial_condition = ${fparse Tw_left/2}
block = 'salt'
[]
[G]
type = MooseLinearVariableFVReal
solver_sys = 'radiation_system'
initial_condition = ${fparse 4*sigma*pow(Tw_left/2,4)}
block = 'salt'
[]
[T_solid]
type = MooseLinearVariableFVReal
solver_sys = 'solid_energy_system'
initial_condition = ${fparse Tw_left/2}
block = 'solid'
[]
[]
[Postprocessors]
[T_fluid_iface]
type = ElementalVariableValue
variable = T_fluid
elementid = ${fparse nx-1}
[]
[T_solid_iface]
type = ElementalVariableValue
variable = T_solid
elementid = ${fparse nx}
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method_name = ${advected_interp_method}
mu = ${mu}
u = vel_x
momentum_component = 'x'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[fluid_conduction]
type = LinearFVDiffusion
variable = T_fluid
diffusion_coeff = ${k_salt}
use_nonorthogonal_correction = false
block = salt
[]
[fluid_radiation]
type = LinearFVP1TemperatureSourceSink
variable = T_fluid
G = 'G'
absorption_coeff = ${sigma_a}
block = salt
[]
[G_diffusion]
type = LinearFVDiffusion
variable = G
diffusion_coeff = ${diffusion_coef}
block = salt
[]
[G_source_and_sink]
type = LinearFVP1RadiationSourceSink
variable = G
temperature_radiation = 'T_fluid'
absorption_coeff = ${sigma_a}
block = salt
[]
[solid_conduction]
type = LinearFVDiffusion
variable = T_solid
diffusion_coeff = ${k_solid}
use_nonorthogonal_correction = false
block = solid
[]
[]
[LinearFVBCs]
# velocity BCs
[walls-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left interface'
variable = vel_x
functor = 0.0
[]
# temperature BCs
[left_bc_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T_fluid
boundary = 'left'
functor = ${Tw_left}
[]
[right_bc_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T_solid
boundary = 'right'
functor = ${Tw_right}
[]
# G
[right_bc_G]
type = LinearFVP1RadiationMarshakBC
boundary = 'interface'
variable = G
temperature_radiation = 'T_fluid'
coeff_diffusion = ${diffusion_coef}
boundary_emissivity = ${b_eps}
[]
[left_bc_G]
type = LinearFVP1RadiationMarshakBC
boundary = 'left'
variable = G
temperature_radiation = ${Tw_left}
coeff_diffusion = ${diffusion_coef}
boundary_emissivity = ${b_eps}
[]
# cht
[fluid_solid]
type = LinearFVDirichletCHTBC
variable = T_fluid
boundary = interface
functor = interface_temperature_to_fluid_interface
[]
[solid_fluid]
type = LinearFVRobinCHTBC
variable = T_solid
boundary = interface
h = ${h_s}
thermal_conductivity = ${k_solid}
incoming_flux = heat_flux_to_solid_interface
surface_temperature = interface_temperature_to_solid_interface
[]
[]
[Executioner]
type = SIMPLE
num_iterations = 2000
momentum_systems = 'u_system '
pressure_system = 'pressure_system'
rhie_chow_user_object = 'rc'
momentum_l_abs_tol = 1e-8
pressure_l_abs_tol = 1e-7
momentum_l_tol = 0
pressure_l_tol = 0
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
momentum_absolute_tolerance = 1e-5
pressure_absolute_tolerance = 1e-5
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
#active_scalar_systems = 'radiation_system'
pm_radiation_systems = 'radiation_system'
energy_system = 'energy_system'
solid_energy_system = 'solid_energy_system'
#active_scalar_l_abs_tol = 1e-14
pm_radiation_l_abs_tol = 1e-11
energy_l_abs_tol = 1e-11
solid_energy_l_abs_tol = 1e-11
#active_scalar_l_tol = 0
pm_radiation_l_tol = 0
energy_l_tol = 0
solid_energy_l_tol = 0
#active_scalar_equation_relaxation = 0.95
pm_radiation_equation_relaxation = 1.0
energy_equation_relaxation = 0.9
energy_absolute_tolerance = 1e-10
solid_energy_absolute_tolerance = 1e-10
#active_scalar_absolute_tolerance = 1e-14
#active_scalar_petsc_options_iname = '-pc_type -pc_hypre_type'
#active_scalar_petsc_options_value = 'hypre boomeramg'
pm_radiation_absolute_tolerance = 1e-10
pm_radiation_petsc_options_iname = '-pc_type -pc_hypre_type'
pm_radiation_petsc_options_value = 'hypre boomeramg'
energy_petsc_options_iname = '-pc_type -pc_hypre_type'
energy_petsc_options_value = 'hypre boomeramg'
solid_energy_petsc_options_iname = '-pc_type -pc_hypre_type'
solid_energy_petsc_options_value = 'hypre boomeramg'
cht_interfaces = 'interface'
cht_solid_flux_relaxation = 0.3
cht_fluid_flux_relaxation = 0.3
cht_solid_temperature_relaxation = 0.3
cht_fluid_temperature_relaxation = 0.3
cht_heat_flux_tolerance = 1e-4
max_cht_fpi = 10
print_fields = false
continue_on_max_its = true
[]
[Outputs]
csv = true
execute_on = timestep_end
exodus = true
[]
(test/tests/meshgenerators/boundary_2d_delaunay_generator/cylinder.i)
[Mesh]
[circle]
type = ConcentricCircleMeshGenerator
has_outer_square = false
radii = 1
num_sectors = 4
rings = 1
preserve_volumes = false
[]
[side]
type = SideSetsAroundSubdomainGenerator
input = circle
new_boundary = side
block = 1
[]
[extrude]
type = AdvancedExtruderGenerator
input = side
heights = '2'
num_layers = '3'
direction = '0 0 1'
[]
[side_1]
type = ParsedGenerateSideset
combinatorial_geometry = 'x>=0&y>=0'
new_sideset_name = 'side_1'
input = 'extrude'
included_boundaries = 'side'
[]
[bd_1]
type = Boundary2DDelaunayGenerator
input = side_1
boundary_names = 'side_1'
use_auto_area_func = true
[]
[side_2]
type = ParsedGenerateSideset
combinatorial_geometry = 'x<0&y>=0'
new_sideset_name = 'side_2'
input = 'extrude'
included_boundaries = 'side'
[]
[bd_2]
type = Boundary2DDelaunayGenerator
input = side_2
boundary_names = 'side_2'
use_auto_area_func = true
[]
[side_3]
type = ParsedGenerateSideset
combinatorial_geometry = 'x<0&y<0'
new_sideset_name = 'side_3'
input = 'extrude'
included_boundaries = 'side'
[]
[bd_3]
type = Boundary2DDelaunayGenerator
input = side_3
boundary_names = 'side_3'
use_auto_area_func = true
[]
[side_4]
type = ParsedGenerateSideset
combinatorial_geometry = 'x>=0&y<0'
new_sideset_name = 'side_4'
input = 'extrude'
included_boundaries = 'side'
[]
[bd_4]
type = Boundary2DDelaunayGenerator
input = side_4
boundary_names = 'side_4'
use_auto_area_func = true
[]
[bd_bot]
type = Boundary2DDelaunayGenerator
input = extrude
boundary_names = '2'
use_auto_area_func = true
[]
[bd_top]
type = Boundary2DDelaunayGenerator
input = extrude
boundary_names = '3'
use_auto_area_func = true
[]
[smg]
type = StitchMeshGenerator
inputs = 'bd_1 bd_2 bd_3 bd_4 bd_top bd_bot'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = '0 0;0 0;0 0;0 0;0 0'
merge_boundaries_with_same_name = true
prevent_boundary_ids_overlap = false
[]
[xyzd]
type = XYZDelaunayGenerator
boundary = smg
desired_volume = 1
output_subdomain_name = 'matrix'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Postprocessors]
[area]
type = VolumePostprocessor
[]
[]
[Outputs]
[csv]
type = CSV
execute_on = 'FINAL'
[]
[]
(test/tests/meshgenerators/stitch_mesh_generator/stitched_mesh_generator2.i)
[Mesh]
[./fmg_left]
type = FileMeshGenerator
file = left.e
[]
[./fmg_center]
type = FileMeshGenerator
file = center.e
[]
[./fmg_right]
type = FileMeshGenerator
file = right.e
[]
[./smg]
type = StitchMeshGenerator
inputs = 'fmg_left fmg_center fmg_right'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'right left;
right left'
[]
[]
[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
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/cht/conjugate_heat_transfer/cht_thermal_resistance.i)
# One-dimensional conjugate heat-transfer validation with an area-normalized
# interface thermal resistance. The four mms.run_spatial levels refine the
# initial 10 + 10 element mesh to a final 80 + 80 element mesh.
rho_salt = 2000
cp_salt = 2000
k_salt = 0.6
rho_solid = 2000
cp_solid = 900
k_solid = 10
T_hot = 400
T_cold = 300
R_interface = 0.1
L_solid = 0.5
L_salt = 0.5
nx_solid = 10
nx_salt = 10
# Exact 1D steady conduction solution for comparison.
q_exact = ${fparse (T_hot - T_cold) / (L_solid / k_solid + R_interface + L_salt / k_salt)}
T_solid_interface_exact = ${fparse T_cold + q_exact * L_solid / k_solid}
T_salt_interface_exact = ${fparse T_solid_interface_exact + q_exact * R_interface}
[Problem]
kernel_coverage_check = false
material_coverage_check = false
previous_nl_solution_required = true
linear_sys_names = 'energy_system p_system u_system solid_energy_system'
[]
[FVInterpolationMethods]
[harm]
type = FVHarmonicAverage
[]
[]
[Mesh]
[solid_mesh]
type = GeneratedMeshGenerator
dim = 1
nx = ${nx_solid}
xmin = 0.0
xmax = ${L_solid}
subdomain_ids = 0
bias_x = 1.0
[]
[fluid_mesh]
type = GeneratedMeshGenerator
dim = 1
nx = ${nx_salt}
xmin = ${L_solid}
xmax = ${fparse L_solid + L_salt}
subdomain_ids = 1
bias_x = 1.0
[]
[name_solid]
type = RenameBlockGenerator
input = solid_mesh
old_block = 0
new_block = 'solid'
[]
[name_salt]
type = RenameBlockGenerator
input = fluid_mesh
old_block = 1
new_block = 'salt'
[]
[stitch]
type = StitchMeshGenerator
inputs = 'name_solid name_salt'
stitch_boundaries_pairs = 'right left'
[]
[interface]
type = SideSetsBetweenSubdomainsGenerator
input = stitch
primary_block = 'solid'
paired_block = 'salt'
new_boundary = interface
[]
[]
[Functions]
[T_solid_exact]
type = ParsedFunction
expression = '${T_cold} + ${q_exact} * x / ${k_solid}'
[]
[T_salt_exact]
type = ParsedFunction
expression = '${T_salt_interface_exact} + ${q_exact} * (x - ${L_solid}) / ${k_salt}'
[]
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
w = vel_z
pressure = pressure
rho = 1
p_diffusion_kernel = p_diffusion
block = salt
[]
[]
[Variables]
[temp_salt]
type = MooseLinearVariableFVReal
solver_sys = energy_system
block = salt
[]
[temp_solid]
type = MooseLinearVariableFVReal
solver_sys = solid_energy_system
block = solid
[]
[vel_x]
type = MooseLinearVariableFVReal
solver_sys = 'u_system'
initial_condition = 0
block = salt
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = 'p_system'
initial_condition = 0
block = salt
[]
[]
[FVICs]
[solid_exact_ic]
type = FVFunctionIC
variable = temp_solid
function = T_solid_exact
block = solid
[]
[salt_exact_ic]
type = FVFunctionIC
variable = temp_salt
function = T_salt_exact
block = salt
[]
[]
[LinearFVKernels]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusion
variable = pressure
diffusion_tensor = Ainv
block = salt
use_nonorthogonal_correction = false
[]
[h_time]
type = LinearFVTimeDerivative
variable = temp_salt
factor = ${fparse rho_salt * cp_salt}
block = salt
[]
[h_conduction]
type = LinearFVDiffusion
variable = temp_salt
diffusion_coeff = ${k_salt}
use_nonorthogonal_correction = false
block = salt
coeff_interp_method = harm
[]
[solid_time]
type = LinearFVTimeDerivative
variable = temp_solid
factor = ${fparse rho_solid * cp_solid}
block = solid
[]
[solid_conduction]
type = LinearFVDiffusion
variable = temp_solid
diffusion_coeff = ${k_solid}
use_nonorthogonal_correction = false
block = solid
coeff_interp_method = harm
[]
[]
[FunctorMaterials]
[]
[LinearFVBCs]
[solid_left]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = temp_solid
boundary = left
functor = ${T_cold}
[]
[fluid_right]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = temp_salt
boundary = right
functor = ${T_hot}
[]
# Neumann-Dirichlet CHT pair. The Robin BC emulates a Neumann BC because h = 0.
# This avoids adding an unrelated heat-transfer coefficient to the accuracy test.
[fluid_solid]
type = LinearFVRobinCHTBC
variable = temp_salt
boundary = interface
h = 0
thermal_conductivity = ${k_salt}
incoming_flux = heat_flux_to_fluid_interface
surface_temperature = interface_temperature_to_fluid_interface
[]
[solid_fluid]
type = LinearFVDirichletCHTBC
variable = temp_solid
boundary = interface
functor = interface_temperature_to_solid_interface
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
outputs = csv
[]
# Numerical interface quantities
[q]
type = SideAverageFunctorPostprocessor
boundary = interface
functor = heat_flux_to_solid_interface
functor_argument = face
[]
[t_solid]
type = SideAverageFunctorPostprocessor
boundary = interface
functor = interface_temperature_to_solid_interface
functor_argument = face
[]
[t_fluid]
type = SideAverageFunctorPostprocessor
boundary = interface
functor = interface_temperature_to_fluid_interface
functor_argument = face
[]
# Analytical interface quantities
[q_analytical]
type = ParsedPostprocessor
expression = '${q_exact}'
[]
[t_solid_analytical]
type = ParsedPostprocessor
expression = '${T_solid_interface_exact}'
[]
[t_fluid_analytical]
type = ParsedPostprocessor
expression = '${T_salt_interface_exact}'
[]
[q_relative_error]
type = ParsedPostprocessor
pp_names = 'q q_analytical'
expression = 'abs(q-q_analytical)/abs(q_analytical)'
[]
[t_solid_relative_error]
type = ParsedPostprocessor
pp_names = 't_solid t_solid_analytical'
expression = 'abs(t_solid-t_solid_analytical)/abs(t_solid_analytical)'
[]
[t_fluid_relative_error]
type = ParsedPostprocessor
pp_names = 't_fluid t_fluid_analytical'
expression = 'abs(t_fluid-t_fluid_analytical)/abs(t_fluid_analytical)'
[]
[]
[Executioner]
type = PIMPLE
# Large dt makes this effectively a steady-state conduction test in one step.
dt = 1e6
end_time = 1e6
num_iterations = 2
continue_on_max_its = true
print_fields = false
energy_system = energy_system
solid_energy_system = solid_energy_system
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system'
pressure_system = 'p_system'
should_solve_momentum = false
should_solve_pressure = false
energy_l_abs_tol = 1e-14
energy_l_tol = 1e-14
solid_energy_l_abs_tol = 1e-14
solid_energy_l_tol = 1e-14
energy_absolute_tolerance = 1e-14
solid_energy_absolute_tolerance = 1e-14
energy_equation_relaxation = 1.0
energy_petsc_options_iname = '-pc_type -pc_hypre_type'
energy_petsc_options_value = 'hypre boomeramg'
solid_energy_petsc_options_iname = '-pc_type -pc_hypre_type'
solid_energy_petsc_options_value = 'hypre boomeramg'
cht_interfaces = interface
thermal_resistance = ${R_interface}
cht_solid_flux_relaxation = 0.3
cht_fluid_flux_relaxation = 0.3
cht_solid_temperature_relaxation = 0.3
cht_fluid_temperature_relaxation = 0.3
cht_heat_flux_tolerance = 1e-10
max_cht_fpi = 500
[]
[Outputs]
execute_on = TIMESTEP_END
csv = true
[]
(test/tests/meshgenerators/mesh_diagnostics_generator/nonconforming_faces.i)
# A HEX8 (block 0) sharing a face with a tetrahedralized box (block 1). The shared face is a
# single quad on the hex side but two triangles on the tet side: a non-conforming interface.
# All four corner nodes are shared, so there is NO hanging node and 'examine_non_conformality'
# reports 0; 'examine_nonconforming_faces' detects it (the quad face and the two triangle faces,
# 3 faces total).
[Mesh]
[hexbox]
type = GeneratedMeshGenerator
dim = 3
nx = 1
ny = 1
nz = 1
xmin = 0
xmax = 1
[]
[tetbox0]
type = GeneratedMeshGenerator
dim = 3
nx = 1
ny = 1
nz = 1
xmin = 1
xmax = 2
[]
[tetbox_blk]
type = SubdomainBoundingBoxGenerator
input = tetbox0
block_id = 1
bottom_left = '0.9 -0.1 -0.1'
top_right = '2.1 1.1 1.1'
[]
[tetbox]
type = ElementsToTetrahedronsConverter
input = tetbox_blk
[]
[stitch]
type = StitchMeshGenerator
inputs = 'hexbox tetbox'
stitch_boundaries_pairs = 'right left'
clear_stitched_boundary_ids = true
[]
[diag]
type = MeshDiagnosticsGenerator
input = stitch
examine_nonconforming_faces = INFO
examine_non_conformality = INFO
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/channel/linear-segregated/header_and_mesh.i)
H = 1 #halfwidth of the channel
L = 100
Re = 13700
rho = 1
bulk_u = 1
mu = '${fparse rho * bulk_u * 2 * H / Re}'
advected_interp_method = 'upwind'
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Initial and Boundary Conditions ###
intensity = ${fparse 0.16*Re^(-1./8.)}
k_init = '${fparse 1.5*(intensity * bulk_u)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / (2*H)}'
### Modeling parameters ###
bulk_wall_treatment = false
walls = 'top bottom'
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
[Mesh]
[block_1]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${L}
ymin = 0
ymax = ${H}
nx = 4
ny = 4
bias_y = 0.7
[]
[block_2]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${L}
ymin = ${fparse -H}
ymax = 0
nx = 4
ny = 4
bias_y = ${fparse 1/0.7}
[]
[smg]
type = StitchMeshGenerator
inputs = 'block_1 block_2'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'bottom top'
merge_boundaries_with_same_name = true
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
(test/tests/meshgenerators/stitch_mesh_generator/stitched_mesh_generator_sameid.i)
[Mesh]
[fmg_left]
type = FileMeshGenerator
file = left.e
[]
[fmg_center]
type = FileMeshGenerator
file = center.e
[]
[rename_center]
type = RenameBoundaryGenerator
input = fmg_center
old_boundary = 'right'
new_boundary = 'bazinga'
[]
[smg]
type = StitchMeshGenerator
inputs = 'fmg_left rename_center'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'right left'
parallel_type = 'replicated'
prevent_boundary_ids_overlap = false
[]
[]
[Outputs]
exodus = true
[]
(test/tests/meshgenerators/stitch_mesh_generator/stitched_mesh_generator.i)
[Mesh]
[./fmg_left]
type = FileMeshGenerator
file = left.e
[]
[./fmg_center]
type = FileMeshGenerator
file = center.e
[]
[./fmg_right]
type = FileMeshGenerator
file = right.e
[]
[./smg]
type = StitchMeshGenerator
inputs = 'fmg_left fmg_center fmg_right'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'right left;
right left'
merge_boundaries_with_same_name = false
[]
[]
[Outputs]
exodus = true
[]
(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 = StitchMeshGenerator
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 = StitchMeshGenerator
inputs = 'aq_bottom_fine cap_bottom_fine'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'bottom top'
[]
[aq_and_cap_fine]
type = StitchMeshGenerator
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 = StitchMeshGenerator
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 = StitchMeshGenerator
inputs = 'aq_bottom cap_bottom'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'bottom top'
[]
[aq_and_cap]
type = StitchMeshGenerator
inputs = 'aq_and_cap_bottom aq_and_cap_top'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'top bottom'
[]
[aq_and_cap_all]
type = StitchMeshGenerator
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 = TabulatedBicubicFluidProperties
input_fp = true_water
temperature_min = 275 # K
temperature_max = 600
interpolated_properties = 'density viscosity enthalpy internal_energy'
fluid_property_output_file = water97_tabulated_modified.csv
# Comment out the fp parameter and uncomment below to use the newly generated tabulation
# 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]
active = basic
[mumps]
type = SMP
full = true
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu mumps'
[]
[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
nl_max_its = 20
[]
[Outputs]
sync_times = ${synctimes}
[ex]
type = Exodus
time_step_interval = 20
[]
[csv]
type = CSV
execute_postprocessors_on = 'initial timestep_end'
[]
print_linear_residuals = false
[]
(test/include/meshgenerators/TestSubgenerators.h)
// This file is part of the MOOSE framework
// https://mooseframework.inl.gov
//
// All rights reserved, see COPYRIGHT for full restrictions
// https://github.com/idaholab/moose/blob/master/COPYRIGHT
//
// Licensed under LGPL 2.1, please see LICENSE for details
// https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "StitchMeshGenerator.h"
/**
* Allows multiple mesh files to be "stitched" together to form a single mesh.
*/
class TestSubgenerators : public StitchMeshGenerator
{
public:
static InputParameters validParams();
TestSubgenerators(const InputParameters & parameters);
protected:
/// The mesh generator input filenames to read
const std::vector<std::string> & _input_filenames;
};