- 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
StitchedMeshGenerator
Allows multiple mesh files to be stitched together to form a single mesh.
Example
Consider the following three meshes.
Using the StitchedMeshGenerator
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]
[./fmg_left]
type = FileMeshGenerator
file = left.e
[]
[./fmg_center]
type = FileMeshGenerator
file = center.e
[]
[./fmg_right]
type = FileMeshGenerator
file = right.e
[]
[./smg]
type = StitchedMeshGenerator
inputs = 'fmg_left fmg_center fmg_right'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'right left;
right left'
parallel_type = 'replicated'
[]
[]
(test/tests/meshgenerators/stitched_mesh_generator/stitched_mesh_generator.i)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
- 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
Optional Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- 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/mesh_diagnostics_generator/detect_amr_tri.i)
- (test/tests/mesh/multi_elem_integers/multi_element_integer.i)
- (test/tests/mesh/preparedness/test.i)
- (tutorials/tutorial04_meshing/app/test/tests/adv_examples/oversize.i)
- (test/tests/meshgenerators/stitched_mesh_generator/stitched_mesh_generator.i)
- (test/tests/meshgenerators/stitched_mesh_generator/stitched_mesh_generator2.i)
- (modules/combined/examples/optimization/helmholtz_multimat_nostrip.i)
- (test/tests/meshgenerators/mesh_diagnostics_generator/detect_amr_tet.i)
- (test/tests/meshgenerators/symmetry_transform_generator/simple.i)
- (test/tests/meshgenerators/sideset_extruder_generator/external_generators.i)
- (test/tests/meshgenerators/mesh_diagnostics_generator/conformality_test.i)
- (test/tests/meshgenerators/mesh_diagnostics_generator/conformality_test_3d.i)
- (modules/solid_mechanics/test/tests/crystal_plasticity/stress_update_material_based/bicrystal_test.i)
- (modules/navier_stokes/examples/flow-over-circle/mesh.i)
- (test/tests/meshgenerators/cyclic/cyclic.i)
- (test/tests/meshgenerators/xy_delaunay_generator/xydelaunay_multiline.i)
- (test/tests/meshgenerators/sidesets_from_points_generator/sidesets_ambiguity.i)
- (test/tests/meshgenerators/advanced_extruder_generator/elem_flip.i)
- (modules/porous_flow/examples/ates/ates.i)
- (modules/combined/examples/optimization/helmholtz_multimat_strip.i)
Child Objects
(test/tests/meshgenerators/stitched_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 = StitchedMeshGenerator
inputs = 'fmg_left fmg_center fmg_right'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'right left;
right left'
parallel_type = 'replicated'
[]
[]
[Outputs]
exodus = true
[]
(test/tests/meshgenerators/mesh_diagnostics_generator/detect_amr_tri.i)
[Mesh]
[big_one]
type = GeneratedMeshGenerator
dim = 2
nx = 1
ny = 1
xmin = 1
xmax = 2
ymin = 0
ymax = 1
elem_type = TRI3
[]
[cut_one]
type = GeneratedMeshGenerator
dim = 2
# Actually looks the same as uniformly refined
nx = 2
ny = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
elem_type = TRI3
[]
[cmbn]
type = StitchedMeshGenerator
inputs = 'big_one cut_one'
stitch_boundaries_pairs = 'left right'
[]
[diag]
type = MeshDiagnosticsGenerator
input = cmbn
search_for_adaptivity_nonconformality = INFO
[]
[]
[Outputs]
exodus = true
[]
(test/tests/mesh/multi_elem_integers/multi_element_integer.i)
[Mesh]
type = MeshGeneratorMesh
parallel_type = 'replicated'
[gmg1]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 5
ny = 5
extra_element_integers = 'material_id'
[]
[gmg2]
type = GeneratedMeshGenerator
dim = 2
xmin = 1
xmax = 2
ymin = 0
ymax = 1
nx = 5
ny = 5
extra_element_integers = 'source_id'
[]
[stitcher]
type = StitchedMeshGenerator
inputs = 'gmg1 gmg2'
stitch_boundaries_pairs = 'right left'
[]
[set_material_id0]
type = SubdomainBoundingBoxGenerator
input = stitcher
bottom_left = '0 0 0'
top_right = '1 1 0'
block_id = 1
location = INSIDE
integer_name = material_id
[]
[set_material_id1]
type = SubdomainBoundingBoxGenerator
input = set_material_id0
bottom_left = '1 0 0'
top_right = '2 1 0'
block_id = 2
location = INSIDE
integer_name = material_id
[]
[set_material_id2]
type = SubdomainBoundingBoxGenerator
input = set_material_id1
bottom_left = '0 0 0'
top_right = '1 1 0'
block_id = 3
location = INSIDE
integer_name = source_id
[]
[set_material_id3]
type = SubdomainBoundingBoxGenerator
input = set_material_id2
bottom_left = '1 0 0'
top_right = '2 1 0'
block_id = 4
location = INSIDE
integer_name = source_id
[]
[]
[AuxVariables]
[id1]
family = MONOMIAL
order = CONSTANT
[]
[id2]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[id1]
type = ElementIntegerAux
variable = id1
integer_names = material_id
[]
[id2]
type = ElementIntegerAux
variable = id2
integer_names = source_id
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
[]
(test/tests/mesh/preparedness/test.i)
[GlobalParams]
prevent_boundary_ids_overlap = false
[]
[Mesh]
[region_2_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.065 0.13 0.305 0.17 0.196'
ix = ' 2 2 2 2 2'
dy = '0.85438 '
iy = '6'
subdomain_id = '68 68 68 68 68'
[]
[region_2_move]
type = TransformGenerator
transform = TRANSLATE
vector_value = '1.2 1.551 0'
input = region_2_gen
[]
[region_3_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.24 0.24 0.24 0.24 0.24'
ix = ' 2 2 2 2 2'
dy = '0.744166666666666 0.744166666666667 0.744166666666667'
iy = ' 2 2 2'
subdomain_id = '56 57 58 59 60
51 52 53 54 55
46 47 48 49 50'
[]
[region_3_move]
type = TransformGenerator
transform = TRANSLATE
vector_value = '0 2.40538 0'
input = region_3_gen
[]
[region_1_gen]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 6
xmin = 0
xmax = 0.26
ymin = 1.551
ymax = 1.851
subdomain_ids = '62 62 62 62 62 62 62 62 62 62
62 62 62 62 62 62 62 62 62 62
62 62 62 62 62 62 62 62 62 62
62 62 62 62 62 62 62 62 62 62
62 62 62 62 62 62 62 62 62 62
62 62 62 62 62 62 62 62 62 62'
[]
[region_1_extend_1]
type = FillBetweenSidesetsGenerator
input_mesh_1 = 'region_3_move'
input_mesh_2 = 'region_1_gen'
boundary_1 = '0'
boundary_2 = '2'
num_layers = 6
block_id= 61
use_quad_elements = true
keep_inputs = true
begin_side_boundary_id = '3'
end_side_boundary_id = '1'
[]
[region_1_extend_2]
type = FillBetweenSidesetsGenerator
input_mesh_1 = 'region_2_move'
input_mesh_2 = 'region_1_gen'
boundary_1 = 3
boundary_2 = 1
num_layers = 6
block_id= 69
use_quad_elements = true
keep_inputs = false
begin_side_boundary_id = '0'
end_side_boundary_id = '3'
input_boundary_1_id = '1'
input_boundary_2_id = '3'
[]
[region_2_2_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.065 0.13 0.305 0.17 0.196'
ix = ' 2 2 2 2 2'
dy = '0.85438 '
iy = '6'
subdomain_id = '68 68 68 68 68'
[]
[region_2_2_move]
type = TransformGenerator
transform = TRANSLATE
vector_value = '1.2 1.551 0'
input = region_2_2_gen
[]
[region_6_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.26 0.94 0.065 0.13 0.305 0.17 0.196'
ix = '10 6 2 2 2 2 2'
dy = '0.584 0.967'
iy = ' 4 6'
subdomain_id = '62 72 72 72 72 72 72
62 70 71 71 71 71 71'
[]
[stitch_1_2_6]
type = StitchedMeshGenerator
inputs = 'region_1_extend_1 region_1_extend_2 region_2_2_move region_6_gen'
stitch_boundaries_pairs = '1 3;
1 3;
0 2'
[]
[rename_boundary_stitch_1_2_6]
type = RenameBoundaryGenerator
input = stitch_1_2_6
old_boundary = '1'
new_boundary = '2'
[]
[region_4_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.065 0.13'
ix = ' 2 2 '
dy = '0.744166666666666 0.744166666666667 0.744166666666667'
iy = ' 2 2 2'
subdomain_id = '78 92
78 91
78 90'
[]
[region_4_move]
type = TransformGenerator
transform = TRANSLATE
vector_value = '1.2 2.40538 0'
input = region_4_gen
[]
[region_5_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.17 0.196'
ix = '2 2'
dy = '0.39 1.8425'
iy = '2 4'
subdomain_id = '100 104
100 104'
[]
[region_5_move]
type = TransformGenerator
transform = TRANSLATE
vector_value = '1.7 2.40538 0'
input = region_5_gen
[]
[region_5_extend]
type = FillBetweenSidesetsGenerator
input_mesh_1 = 'region_4_move'
input_mesh_2 = 'region_5_move'
boundary_1 = 1
boundary_2 = 3
num_layers = 2
block_id= 96
use_quad_elements = true
keep_inputs = true
begin_side_boundary_id = '0'
end_side_boundary_id = '2'
[]
[rename_boundary_region_5]
type = RenameBoundaryGenerator
input = region_5_extend
old_boundary = '0'
new_boundary = '3'
[]
[stitch_1_2_6_5]
type = StitchedMeshGenerator
inputs = 'rename_boundary_stitch_1_2_6 rename_boundary_region_5'
stitch_boundaries_pairs = '2 3;'
[]
[region_7_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.24 0.24 0.24 0.24 0.24 0.065 0.13 0.305 0.17 0.196'
ix = ' 2 2 2 2 2 2 2 2 2 2'
dy = '0.744166666666667 0.744166666666667 0.744166666666667 0.744166666666667
0.744166666666667 0.744166666666667 0.744166666666666 0.744166666666666
0.744166666666666 0.458 0.86002'
iy = '2 2 2 2 2 2 2 2 2 2 4'
subdomain_id = '41 42 43 44 45 77 89 95 99 103
36 37 38 39 40 77 88 95 99 103
31 32 33 34 35 77 87 95 99 103
26 27 28 29 30 76 86 94 98 102
21 22 23 24 25 76 85 94 98 102
16 17 18 19 20 76 84 94 98 102
11 12 13 14 15 75 83 93 97 101
6 7 8 9 10 75 82 93 97 101
1 2 3 4 5 75 81 93 97 101
67 67 67 67 67 74 80 65 65 66
63 63 63 63 63 73 79 64 64 64'
[]
[region_7_move]
type = TransformGenerator
transform = TRANSLATE
vector_value = '0.0 4.63788 0'
input = region_7_gen
[]
[stitch]
type = StitchedMeshGenerator
inputs = 'stitch_1_2_6_5 region_7_move'
stitch_boundaries_pairs = '2 0'
[]
[rename_boundary_1]
type = BoundaryDeletionGenerator
input = stitch
boundary_names = '0 1 2 3'
[]
[rename_boundary_2]
type = SideSetsFromPointsGenerator
input = rename_boundary_1
new_boundary = '2 4 1 3'
points = '1.2 0. 0.
2.066 1.551 0.
1.2 12.6534 0.
0. 1.551 0.'
[]
[rename_boundary_3]
type = RenameBoundaryGenerator
input = rename_boundary_2
new_boundary = 'rbottom ssright rtop ssleft'
old_boundary = '2 4 1 3'
[]
[rename_blocks]
type = RenameBlockGenerator
input = rename_boundary_3
old_block = '1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
101 102 103 104'
new_block = 'pbedfuel001 pbedfuel002 pbedfuel003 pbedfuel004 pbedfuel005
pbedfuel006 pbedfuel007 pbedfuel008 pbedfuel009 pbedfuel010
pbedfuel011 pbedfuel012 pbedfuel013 pbedfuel014 pbedfuel015
pbedfuel016 pbedfuel017 pbedfuel018 pbedfuel019 pbedfuel020
pbedfuel021 pbedfuel022 pbedfuel023 pbedfuel024 pbedfuel025
pbedfuel026 pbedfuel027 pbedfuel028 pbedfuel029 pbedfuel030
pbedfuel031 pbedfuel032 pbedfuel033 pbedfuel034 pbedfuel035
pbedfuel036 pbedfuel037 pbedfuel038 pbedfuel039 pbedfuel040
pbedfuel041 pbedfuel042 pbedfuel043 pbedfuel044 pbedfuel045
pbedfuel046 pbedfuel047 pbedfuel048 pbedfuel049 pbedfuel050
pbedfuel051 pbedfuel052 pbedfuel053 pbedfuel054 pbedfuel055
pbedfuel056 pbedfuel057 pbedfuel058 pbedfuel059 pbedfuel060
consfuel061 dischfuel062 upref063 upref064 upref065 upref066
upcvt067 lwref068 outch069 lwrpln070 htleg071 lwref072 buffr073
buffr074 buffr075 buffr076 buffr077 buffr078 crds079 crds080
crds081 crds082 crds083 crds084 crds085 crds086 crds087 crds088
crds089 crds090 crds091 crds092 radrf093 radrf094 radrf095 radrf096
risr097 risr098 risr099 risr100 radrf101 radrf102 radrf103 radrf104'
[]
[]
[Variables]
[T_solid]
type = MooseVariableFVReal
initial_condition = 100
[]
[]
[FVKernels]
[energy_storage]
type = FVTimeKernel
variable = T_solid
[]
[solid_energy_diffusion_core]
type = FVAnisotropicDiffusion
variable = T_solid
coeff = 'effective_thermal_conductivity'
[]
[]
[FVBCs]
[side_set_bc1]
type = FVDirichletBC
variable = T_solid
value = '300'
boundary = 'rtop'
[]
[side_set_bc2]
type = FVDirichletBC
variable = T_solid
value = '600'
boundary = 'rbottom'
[]
[]
[Materials]
[all_channels_porosity]
type = ADGenericFunctorMaterial
prop_names = 'porosity'
prop_values = 0.5
[]
[solid_blocks_full_density_graphite]
type = ADGenericFunctorMaterial
prop_names = 'rho_s cp_s k_s '
prop_values = '1.0 2.0 3.0'
[]
[effective_solid_thermal_conductivity_solid_only]
type = ADGenericVectorFunctorMaterial
prop_names = 'effective_thermal_conductivity'
prop_values = 'k_s k_s k_s'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_factor_shift_type'
petsc_options_value = 'lu 100 NONZERO'
# Tolerances.
nl_abs_tol = 1e-8
nl_rel_tol = 1e-9
line_search = none
nl_max_its = 15
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.05
cutback_factor = 0.5
growth_factor = 2.00
optimal_iterations = 6
[]
# Steady state detection.
steady_state_detection = true
steady_state_tolerance = 1e-13
abort_on_solve_fail = true
num_steps = 1
[]
[Outputs]
exodus = true
print_linear_residuals = false
print_linear_converged_reason = false
print_nonlinear_converged_reason = false
[]
(tutorials/tutorial04_meshing/app/test/tests/adv_examples/oversize.i)
[Mesh]
[hex_1]
type = PolygonConcentricCircleMeshGenerator
num_sides = 6
num_sectors_per_side = '4 4 4 4 4 4'
background_intervals = 2
ring_radii = 4.0
ring_intervals = 2
ring_block_ids = '10 15'
ring_block_names = 'center_tri center'
background_block_ids = 20
background_block_names = background
polygon_size = 5.0
preserve_volumes = on
[]
[hex_big]
type = PolygonConcentricCircleMeshGenerator
num_sides = 6
num_sectors_per_side = '4 4 4 4 4 4'
background_intervals = 2
ring_radii = 10.0
ring_intervals = 2
ring_block_ids = '110 115'
ring_block_names = 'center2_tri center2'
background_block_ids = 120
background_block_names = background2
polygon_size = 13.0
preserve_volumes = on
[]
[bkg_rm]
type = BlockDeletionGenerator
input = hex_big
block = 'background2'
new_boundary = 'big_pin_ext'
[]
[hex_dummy]
type = PolygonConcentricCircleMeshGenerator
num_sides = 6
num_sectors_per_side = '4 4 4 4 4 4'
background_intervals = 2
background_block_ids = '40 45'
background_block_names = 'background_dummy_tri background_dummy'
polygon_size = 5.0
preserve_volumes = on
[]
[assm]
type = PatternedHexMeshGenerator
inputs = 'hex_1 hex_dummy'
pattern = '0 0 0 0 0;
0 0 0 0 0 0;
0 0 0 0 0 0 0;
0 0 0 1 1 0 0 0;
0 0 0 1 1 1 0 0 0;
0 0 0 1 1 0 0 0;
0 0 0 0 0 0 0;
0 0 0 0 0 0;
0 0 0 0 0'
background_block_id = 25
background_block_name = "assem_block"
hexagon_size = 42
[]
[blk_del]
type = BlockDeletionGenerator
input = assm
block = 'background_dummy_tri background_dummy'
new_boundary = 'hole_bdry'
[]
[xyd]
type = XYDelaunayGenerator
boundary = 'blk_del'
input_boundary_names = 'hole_bdry'
refine_boundary = false
desired_area = 1
output_boundary = 'xyd_ext'
output_subdomain_name = '100'
holes = 'bkg_rm'
stitch_holes = 'true'
[]
[stitch]
type = StitchedMeshGenerator
inputs = 'blk_del xyd'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'hole_bdry xyd_ext'
parallel_type = 'replicated'
[]
[]
(test/tests/meshgenerators/stitched_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 = StitchedMeshGenerator
inputs = 'fmg_left fmg_center fmg_right'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'right left;
right left'
parallel_type = 'replicated'
[]
[]
[Outputs]
exodus = true
[]
(test/tests/meshgenerators/stitched_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 = StitchedMeshGenerator
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/combined/examples/optimization/helmholtz_multimat_nostrip.i)
vol_frac = 0.35
power = 1.1
Emin = 1.0e-6
Ess = 0.475 # ss
Et = 1.0 # w
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
# final_generator = 'MoveRight'
[Bottom]
type = GeneratedMeshGenerator
dim = 2
nx = 320
ny = 30
xmin = 0
xmax = 150
ymin = 0
ymax = 15
[]
[RenameBottom]
type = RenameBoundaryGenerator
input = Bottom
old_boundary = 'top bottom right left'
new_boundary = 'top_bottom bottom_bottom right_bottom left_bottom'
[]
[Top]
type = GeneratedMeshGenerator
dim = 2
nx = 320
ny = 30
xmin = 0
xmax = 150
ymin = 0
ymax = 15
[]
[MoveTop]
type = TransformGenerator
input = Top
transform = TRANSLATE
vector_value = '0 15 0'
[]
[RenameTop]
type = RenameBoundaryGenerator
input = MoveTop
old_boundary = 'top bottom right left'
new_boundary = 'top_top bottom_top right_top left_top'
[]
[bottom_gen]
type = ParsedSubdomainMeshGenerator
input = RenameBottom
combinatorial_geometry = 'y <= 15'
block_id = 1
[]
[top_gen]
type = ParsedSubdomainMeshGenerator
input = RenameTop
combinatorial_geometry = 'y > 15'
block_id = 3
[]
[stitch]
type = StitchedMeshGenerator
inputs = 'bottom_gen top_gen'
stitch_boundaries_pairs = 'top_bottom bottom_top'
[]
[left_load]
type = ExtraNodesetGenerator
input = stitch
new_boundary = left_load
coord = '37.5 30 0'
[]
[right_load]
type = ExtraNodesetGenerator
input = left_load
new_boundary = right_load
coord = '112.5 30 0'
[]
[left_support]
type = ExtraNodesetGenerator
input = right_load
new_boundary = left_support
coord = '0 0 0'
[]
[right_support]
type = ExtraNodesetGenerator
input = left_support
new_boundary = right_support
coord = '150 0 0'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[Dc]
initial_condition = -1.0
[]
[]
[AuxVariables]
[Cc]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[]
[mat_den]
family = MONOMIAL
order = CONSTANT
initial_condition = ${vol_frac}
[]
[sensitivity]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[AuxKernel]
type = MaterialRealAux
variable = sensitivity
property = sensitivity
execute_on = LINEAR
[]
[]
[mat_den_nodal]
family = L2_LAGRANGE
order = FIRST
initial_condition = ${vol_frac}
[AuxKernel]
type = SelfAux
execute_on = TIMESTEP_END
variable = mat_den_nodal
v = mat_den
[]
[]
[Dc_elem]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[AuxKernel]
type = SelfAux
variable = Dc_elem
v = Dc
execute_on = 'TIMESTEP_END'
[]
[]
[]
[Kernels]
[diffusion]
type = FunctionDiffusion
variable = Dc
function = 4.0
[]
[potential]
type = Reaction
variable = Dc
[]
[source]
type = CoupledForce
variable = Dc
v = sensitivity
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = left_support
value = 0.0
[]
[no_x]
type = DirichletBC
variable = disp_x
boundary = left_support
value = 0.0
[]
[no_y_right]
type = DirichletBC
variable = disp_y
boundary = right_support
value = 0.0
[]
[boundary_penalty]
type = ADRobinBC
variable = Dc
boundary = 'bottom_bottom right_bottom left_bottom top_top right_top left_top'
coefficient = 10
[]
[]
[NodalKernels]
[left_down]
type = NodalGravity
variable = disp_y
boundary = left_load
gravity_value = -1e-3
mass = 1
[]
[right_down]
type = NodalGravity
variable = disp_y
boundary = right_load
gravity_value = -1e-3
mass = 1
[]
[]
[Materials]
[elasticity_tensor_one]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys_one
poissons_ratio = poissons_ratio
args = 'mat_den'
block = '1'
[]
[elasticity_tensor_three]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys_three
poissons_ratio = poissons_ratio
args = 'mat_den'
block = '3'
[]
# One: Tungsten
[E_phys_one]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${Et}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys_one
block = '1'
outputs = 'exodus'
[]
# Three: SS316
[E_phys_three]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${Ess}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys_three
block = '3'
outputs = 'exodus'
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc_one]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys_one
block = '1'
[]
[dc_three]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys_three
block = '3'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[update_one]
type = DensityUpdate
density_sensitivity = Dc_elem
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = TIMESTEP_BEGIN
block = '1'
[]
[update_three]
type = DensityUpdate
density_sensitivity = Dc_elem
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = TIMESTEP_BEGIN
block = '3'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-10
dt = 1.0
num_steps = 90
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
expression = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = sensitivity
block = '1 3'
[]
[objective_one]
type = ElementIntegralMaterialProperty
mat_prop = strain_energy_density
execute_on = 'INITIAL TIMESTEP_END'
block = '1'
[]
[objective_three]
type = ElementIntegralMaterialProperty
mat_prop = strain_energy_density
execute_on = 'INITIAL TIMESTEP_END'
block = '3'
[]
[]
(test/tests/meshgenerators/mesh_diagnostics_generator/detect_amr_tet.i)
[Mesh]
[big_one]
type = GeneratedMeshGenerator
dim = 3
nx = 1
ny = 1
nz = 1
xmin = 1
xmax = 2
ymin = 0
ymax = 1
zmin = 0
zmax = 1
elem_type = TET4
[]
[cut_one]
type = GeneratedMeshGenerator
dim = 3
nx = 1
ny = 1
nz = 1
xmin = 0
xmax = 1
ymin = 0
ymax = 1
zmin = 0
zmax = 1
elem_type = TET4
[]
[refined]
type = RefineBlockGenerator
input = cut_one
refinement = 1
block = 0
[]
[cmbn]
type = StitchedMeshGenerator
inputs = 'big_one refined'
stitch_boundaries_pairs = 'left right'
[]
[diag]
type = MeshDiagnosticsGenerator
input = cmbn
search_for_adaptivity_nonconformality = INFO
[]
[]
[Outputs]
exodus = true
[]
(test/tests/meshgenerators/symmetry_transform_generator/simple.i)
[Mesh]
[file]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 3
[]
[mirror]
type = SymmetryTransformGenerator
input = file
mirror_point = "0 1 0"
mirror_normal_vector = "0 1 0"
[]
[stitch]
type = StitchedMeshGenerator
inputs = 'file mirror'
stitch_boundaries_pairs = 'top top'
[]
[]
(test/tests/meshgenerators/sideset_extruder_generator/external_generators.i)
[Mesh]
# Note: don't change the parameters without also changing extrude_square,
# as they should be using identical file(s) in gold
[square]
type = GeneratedMeshGenerator
dim = 2
[]
[lowerDblock]
type = LowerDBlockFromSidesetGenerator
input = square
new_block_name = "extrusions0"
sidesets = "right"
[]
[separateMesh]
type = BlockToMeshConverterGenerator
input = lowerDblock
target_blocks = extrusions0
[]
[extrude]
type = MeshExtruderGenerator
input = separateMesh
num_layers = 3
extrusion_vector = '1 0.5 0'
bottom_sideset = 'new_bottom'
top_sideset = 'new_top'
[]
[stitch]
type = StitchedMeshGenerator
inputs = 'square extrude'
stitch_boundaries_pairs = 'right new_bottom'
[]
[]
(test/tests/meshgenerators/mesh_diagnostics_generator/conformality_test.i)
[Mesh]
[copy1]
type = ElementGenerator
nodal_positions = '4 2 0
8 2 0
8 5 0
4 5 0'
element_connectivity = '0 1 2 3'
elem_type = 'QUAD4'
[]
[gen]
input = copy1
type = RenameBlockGenerator
old_block = "0"
new_block = "1"
[]
[copy2]
type = ElementGenerator
nodal_positions = '8.001 2 0
12 2 0
12 5 0
8.001 3.5 0'
element_connectivity = '0 1 2 3'
elem_type = 'QUAD4'
[]
[stitched]
type = StitchedMeshGenerator
inputs = 'gen copy2'
stitch_boundaries_pairs = '0 1'
[]
[diag]
type = MeshDiagnosticsGenerator
input = stitched
examine_non_conformality = INFO
nonconformal_tol = 0.1
[]
[]
[Outputs]
exodus = true
[]
(test/tests/meshgenerators/mesh_diagnostics_generator/conformality_test_3d.i)
[Mesh]
[copy1]
type = ElementGenerator
nodal_positions = '4 4 0
6 4 0
6 6 0
4 6 0
4 4 5
6 4 5
6 6 5
4 6 5'
element_connectivity = '0 1 2 3 4 5 6 7'
elem_type = 'HEX8'
[]
[gen]
input = copy1
type = RenameBlockGenerator
old_block = "0"
new_block = "1"
[]
[copy2]
type = ElementGenerator
nodal_positions = '6 6.001 0
6 8 0
5 8 0
5 6.001 0
6 6.001 5
6 8 5
5 8 5
5 6.001 5'
element_connectivity = '0 1 2 3 4 5 6 7'
elem_type = 'HEX8'
[]
[stitched]
type = StitchedMeshGenerator
inputs = 'gen copy2'
stitch_boundaries_pairs = '0 1'
[]
[diag]
type = MeshDiagnosticsGenerator
input = stitched
examine_non_conformality = INFO
nonconformal_tol = 0.01
[]
[]
[Outputs]
exodus = true
[]
(modules/solid_mechanics/test/tests/crystal_plasticity/stress_update_material_based/bicrystal_test.i)
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
[copper]
type = GeneratedMeshGenerator
dim = 3
elem_type = HEX8
[]
[copper_id]
type = SubdomainIDGenerator
input = copper
subdomain_id = 0
[]
[brass]
type = GeneratedMeshGenerator
dim = 3
zmax = 2
zmin = 1
elem_type = HEX8
[]
[brass_id]
type = SubdomainIDGenerator
input = brass
subdomain_id = 1
[]
[sticher]
type = StitchedMeshGenerator
inputs = 'copper_id brass_id'
stitch_boundaries_pairs = 'front back'
prevent_boundary_ids_overlap = false
[]
[]
[AuxVariables]
[pk2]
order = CONSTANT
family = MONOMIAL
[]
[fp_zz]
order = CONSTANT
family = MONOMIAL
[]
[e_zz]
order = CONSTANT
family = MONOMIAL
[]
[copper_gss]
order = CONSTANT
family = MONOMIAL
block = 0
[]
[copper_slip_increment]
order = CONSTANT
family = MONOMIAL
block = 0
[]
[brass_gss]
order = CONSTANT
family = MONOMIAL
block = 1
[]
[brass_slip_increment]
order = CONSTANT
family = MONOMIAL
block = 1
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[copper]
strain = FINITE
incremental = true
add_variables = true
generate_output = stress_zz
block = 0
base_name = copper
[]
[brass]
strain = FINITE
incremental = true
add_variables = true
generate_output = stress_zz
block = 1
base_name = brass
[]
[]
[AuxKernels]
[pk2]
type = RankTwoAux
variable = pk2
rank_two_tensor = second_piola_kirchhoff_stress
index_j = 2
index_i = 2
execute_on = timestep_end
[]
[fp_zz]
type = RankTwoAux
variable = fp_zz
rank_two_tensor = plastic_deformation_gradient
index_j = 2
index_i = 2
execute_on = timestep_end
[]
[e_zz]
type = RankTwoAux
variable = e_zz
rank_two_tensor = total_lagrangian_strain
index_j = 2
index_i = 2
execute_on = timestep_end
[]
[gss_copper]
type = MaterialStdVectorAux
variable = copper_gss
property = copper_slip_resistance
index = 0
block = 0
execute_on = timestep_end
[]
[slip_inc_copper]
type = MaterialStdVectorAux
variable = copper_slip_increment
property = copper_slip_increment
index = 0
block = 0
execute_on = timestep_end
[]
[gss_brass]
type = MaterialStdVectorAux
variable = brass_gss
property = brass_slip_resistance
index = 0
block = 1
execute_on = timestep_end
[]
[slip_inc_brass]
type = MaterialStdVectorAux
variable = brass_slip_increment
property = brass_slip_increment
index = 0
block = 1
execute_on = timestep_end
[]
[]
[BCs]
[symmy]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0
[]
[symmx]
type = DirichletBC
variable = disp_x
boundary = left
value = 0
[]
[symmz]
type = DirichletBC
variable = disp_z
boundary = back
value = 0
[]
[tdisp]
type = FunctionDirichletBC
variable = disp_z
boundary = front
function = '0.01*t'
[]
[]
[Materials]
[elasticity_tensor_copper]
type = ComputeElasticityTensorCP
C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
fill_method = symmetric9
base_name = copper
block = 0
[]
[stress_copper]
type = ComputeMultipleCrystalPlasticityStress
crystal_plasticity_models = 'trial_xtalpl_copper'
tan_mod_type = exact
base_name = copper
block = 0
[]
[trial_xtalpl_copper]
type = CrystalPlasticityKalidindiUpdate
number_slip_systems = 12
slip_sys_file_name = input_slip_sys.txt
base_name = copper
block = 0
[]
[elasticity_tensor_brass]
type = ComputeElasticityTensorCP
C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
fill_method = symmetric9
euler_angle_1 = 0.0
euler_angle_2 = 45.0
euler_angle_3 = 0.9
base_name = brass
block = 1
[]
[stress_brass]
type = ComputeMultipleCrystalPlasticityStress
crystal_plasticity_models = 'trial_xtalpl_brass'
tan_mod_type = exact
base_name = brass
block = 1
[]
[trial_xtalpl_brass]
type = CrystalPlasticityKalidindiUpdate
number_slip_systems = 12
slip_sys_file_name = input_slip_sys.txt
base_name = brass
block = 1
[]
[]
[Postprocessors]
[copper_stress_zz]
type = ElementAverageValue
variable = copper_stress_zz
block = 0
[]
[brass_stress_zz]
type = ElementAverageValue
variable = brass_stress_zz
block = 1
[]
[pk2]
type = ElementAverageValue
variable = pk2
[]
[fp_zz]
type = ElementAverageValue
variable = fp_zz
[]
[e_zz]
type = ElementAverageValue
variable = e_zz
[]
[copper_gss]
type = ElementAverageValue
variable = copper_gss
block = 0
[]
[copper_slip_increment]
type = ElementAverageValue
variable = copper_slip_increment
block = 0
[]
[brass_gss]
type = ElementAverageValue
variable = brass_gss
block = 1
[]
[brass_slip_increment]
type = ElementAverageValue
variable = brass_slip_increment
block = 1
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
petsc_options_value = ' asm 2 lu gmres 200'
nl_abs_tol = 1e-10
nl_rel_tol = 1e-10
nl_abs_step_tol = 1e-10
dt = 0.05
dtmin = 0.01
dtmax = 10.0
num_steps = 10
[]
[Outputs]
csv = true
perf_graph = true
[]
(modules/navier_stokes/examples/flow-over-circle/mesh.i)
[Mesh]
# ------------------------------------------
# Middle layer
# ------------------------------------------
[ccmg]
type = ConcentricCircleMeshGenerator
num_sectors = '${fparse refinement*2}'
radii = '${circle_radius} ${fparse 1.2*circle_radius}'
rings = '4 ${refinement} ${refinement}'
has_outer_square = on
pitch = ${pitch}
preserve_volumes = off
smoothing_max_it = 2
[]
[in_between]
type = SideSetsBetweenSubdomainsGenerator
input = ccmg
primary_block = 2
paired_block = 1
new_boundary = 'circle'
[]
[delete]
type = BlockDeletionGenerator
input = in_between
block = '1'
[]
[final_ccmg]
type = RenameBlockGenerator
input = delete
old_block = '2 3'
new_block = '0 0'
[]
[left]
type = GeneratedMeshGenerator
dim = 2
xmin = '${x_min}'
xmax = '${fparse -pitch/2}'
ymin = '${fparse -pitch/2}'
ymax = '${fparse pitch/2}'
nx = '${fparse refinement*2}'
ny = '${fparse refinement*4+2}'
[]
[right]
type = GeneratedMeshGenerator
dim = 2
xmin = '${fparse pitch/2}'
xmax = '${x_max}'
ymin = '${fparse -pitch/2}'
ymax = '${fparse pitch/2}'
nx = '${fparse refinement*40}'
ny = '${fparse refinement*4+2}'
[]
[combined_middle]
type = StitchedMeshGenerator
inputs = 'final_ccmg left right'
stitch_boundaries_pairs = 'left right; right left'
clear_stitched_boundary_ids = false
prevent_boundary_ids_overlap = false
[]
[middle_top_sideset]
input = combined_middle
type = ParsedGenerateSideset
combinatorial_geometry = 'y > ${fparse pitch/2-rundoff}'
normal = '0 1 0'
new_sideset_name = 'middle_top'
[]
[middle_bottom_sideset]
input = middle_top_sideset
type = ParsedGenerateSideset
combinatorial_geometry = 'y < ${fparse -pitch/2+rundoff}'
normal = '0 -1 0'
new_sideset_name = 'middle_bottom'
[]
# ------------------------------------------
# Top layer
# ------------------------------------------
[top_left_block]
type = GeneratedMeshGenerator
dim = 2
xmin = '${x_min}'
xmax = '${fparse -pitch/2}'
ymin = '${fparse pitch/2}'
ymax = '${y_max}'
nx = '${fparse refinement*2}'
ny = '${fparse refinement*2+1}'
[]
[top_middle_block]
type = GeneratedMeshGenerator
dim = 2
xmin = '${fparse -pitch/2}'
xmax = '${fparse pitch/2}'
ymin = '${fparse pitch/2}'
ymax = '${y_max}'
nx = '${fparse refinement*4+2}'
ny = '${fparse refinement*2+1}'
[]
[top_right_block]
type = GeneratedMeshGenerator
dim = 2
xmin = '${fparse pitch/2}'
xmax = '${x_max}'
ymin = '${fparse pitch/2}'
ymax = '${y_max}'
nx = '${fparse refinement*40}'
ny = '${fparse refinement*2+1}'
[]
[combined_top]
type = StitchedMeshGenerator
inputs = 'top_middle_block top_left_block top_right_block'
stitch_boundaries_pairs = 'left right; right left'
prevent_boundary_ids_overlap = false
[]
[top_bottom_sideset]
input = combined_top
type = ParsedGenerateSideset
combinatorial_geometry = 'y < ${fparse pitch/2+rundoff}'
normal = '0 -1 0'
new_sideset_name = 'top_bottom'
[]
[combined_middle_top]
type = StitchedMeshGenerator
inputs = 'top_bottom_sideset middle_bottom_sideset'
stitch_boundaries_pairs = 'top_bottom middle_top'
clear_stitched_boundary_ids = false
prevent_boundary_ids_overlap = false
[]
[create_fused_top_sideset]
input = combined_middle_top
type = ParsedGenerateSideset
combinatorial_geometry = 'y > ${fparse y_max-rundoff}'
normal = '0 1 0'
new_sideset_name = 'top_boundary'
[]
# ------------------------------------------
# Bottom layer
# ------------------------------------------
[bottom_left_block]
type = GeneratedMeshGenerator
dim = 2
xmin = '${x_min}'
xmax = '${fparse -pitch/2}'
ymin = '${y_min}'
ymax = '${fparse -pitch/2}'
nx = '${fparse refinement*2}'
ny = '${fparse refinement*2}'
[]
[bottom_middle_block]
type = GeneratedMeshGenerator
dim = 2
xmin = '${fparse -pitch/2}'
xmax = '${fparse pitch/2}'
ymin = '${y_min}'
ymax = '${fparse -pitch/2}'
nx = '${fparse refinement*4+2}'
ny = '${fparse refinement*2}'
[]
[bottom_right_block]
type = GeneratedMeshGenerator
dim = 2
xmin = '${fparse pitch/2}'
xmax = '${x_max}'
ymin = '${y_min}'
ymax = '${fparse -pitch/2}'
nx = '${fparse refinement*40}'
ny = '${fparse refinement*2}'
[]
[combined_bottom]
type = StitchedMeshGenerator
inputs = 'bottom_middle_block bottom_left_block bottom_right_block'
stitch_boundaries_pairs = 'left right; right left'
prevent_boundary_ids_overlap = false
[]
[bottom_top_sideset]
input = combined_bottom
type = ParsedGenerateSideset
combinatorial_geometry = 'y > ${fparse -pitch/2-rundoff}'
normal = '0 1 0'
new_sideset_name = 'bottom_top'
[]
[combined_final]
type = StitchedMeshGenerator
inputs = 'create_fused_top_sideset bottom_top_sideset'
stitch_boundaries_pairs = 'middle_bottom bottom_top'
clear_stitched_boundary_ids = false
prevent_boundary_ids_overlap = false
[]
[create_fused_bottom_sideset]
input = combined_final
type = ParsedGenerateSideset
combinatorial_geometry = 'y < ${fparse y_min+rundoff}'
normal = '0 -1 0'
new_sideset_name = 'bottom_boundary'
[]
# ------------------------------------------
# Left and right boundaries
# ------------------------------------------
[create_fused_left_sideset]
input = create_fused_bottom_sideset
type = ParsedGenerateSideset
combinatorial_geometry = 'x < ${fparse x_min+rundoff}'
normal = '-1 0 0'
new_sideset_name = 'left_boundary'
[]
[create_fused_right_sideset]
input = create_fused_left_sideset
type = ParsedGenerateSideset
combinatorial_geometry = 'x > ${fparse x_max-rundoff}'
normal = '1 0 0'
new_sideset_name = 'right_boundary'
[]
[]
(test/tests/meshgenerators/cyclic/cyclic.i)
[Mesh]
[ccmg]
type = ConcentricCircleMeshGenerator
num_sectors = 6
radii = '0.2546 0.3368'
rings = '4 3 4'
has_outer_square = on
pitch = 1
preserve_volumes = off
smoothing_max_it = 3
[]
[rename_left]
type = RenameBoundaryGenerator
input = ccmg
old_boundary = 'left'
new_boundary = '101'
[]
[left]
type = CartesianMeshGenerator
dim = 2
dx = '5'
dy = '1'
ix = '100'
iy = '16'
[]
[move_it]
type = TransformGenerator
input = left
transform = translate
vector_value = '-5.5 -0.5 0'
[]
[rename_middle]
type = RenameBoundaryGenerator
input = move_it
old_boundary = 'right'
new_boundary = '102'
[]
[stitch]
type = StitchedMeshGenerator
inputs = 'rename_left rename_middle'
stitch_boundaries_pairs = '101 102'
[]
[in_between]
type = SideSetsBetweenSubdomainsGenerator
input = stitch
primary_block = 2
paired_block = 1
new_boundary = 'no_circle'
[]
[delete]
type = BlockDeletionGenerator
input = in_between
block = '1'
[]
[create_fused_top_sideset_l]
input = delete
type = ParsedGenerateSideset
combinatorial_geometry = 'y > 0.49'
normal = '0 1 0'
new_sideset_name = 103
[]
[top_left_block]
type = GeneratedMeshGenerator
xmin = -5.5
xmax = -0.5
ymin = 0.5
ymax = ${fparse 0.5 + 2. / 16.}
nx = 100
ny = 2
dim = 2
[]
[rename_top_left_block]
input = top_left_block
type = RenameBlockGenerator
old_block = '0'
new_block = '100'
[]
[rename_middle_2]
input = rename_top_left_block
type = RenameBoundaryGenerator
old_boundary = 'right'
new_boundary = '104'
[]
[top_middle_block]
type = GeneratedMeshGenerator
xmin = -0.5
xmax = 0.5
ymin = 0.5
ymax = ${fparse 0.5 + 2. / 16.}
nx = 16
ny = 2
dim = 2
[]
[rename_top_middle_block]
input = top_middle_block
type = RenameBlockGenerator
old_block = '0'
new_block = '101'
[]
[rename_left_2]
input = rename_top_middle_block
type = RenameBoundaryGenerator
old_boundary = 'left'
new_boundary = '105'
[]
[stitch_2]
inputs = 'rename_middle_2 rename_left_2'
type = StitchedMeshGenerator
stitch_boundaries_pairs = '104 105'
[]
[create_fused_bottom_sideset]
input = stitch_2
type = ParsedGenerateSideset
combinatorial_geometry = 'y < 0.51'
normal = '0 -1 0'
new_sideset_name = 106
[]
[stitch_3]
inputs = 'create_fused_top_sideset_l create_fused_bottom_sideset'
type = StitchedMeshGenerator
stitch_boundaries_pairs = '103 106'
[]
[rename_extension]
type = RenameBoundaryGenerator
input = no_slip_bottom
old_boundary = 'extension'
new_boundary = '111'
[]
[extension]
type = CartesianMeshGenerator
dim = 2
dx = '5'
dy = '1'
ix = '100'
iy = '16'
[]
[move_it_2]
type = TransformGenerator
input = extension
transform = translate
vector_value = '5.5 -0.5 0'
[]
[stitch_4]
inputs = 'rename_middle rename_extension'
type = StitchedMeshGenerator
stitch_boundaries_pairs = '102 111'
[]
[create_fused_top_sideset_r]
input = stitch_4
type = ParsedGenerateSideset
combinatorial_geometry = 'y > .49'
normal = '0 1 0'
new_sideset_name = 113
[]
[top_right_block]
type = GeneratedMeshGenerator
xmin = 0.5
xmax = 5.5
ymin = 0.5
ymax = ${fparse 0.5 + 2. / 16.}
nx = 100
ny = 2
dim = 2
[]
[rename_top_right_block]
input = top_right_block
type = RenameBlockGenerator
old_block = 'top_right_block'
new_block = '110'
[]
[rename_extension_2]
input = rename_top_right_block
type = RenameBoundaryGenerator
old_boundary = 'rename_extension'
new_boundary = '115'
[]
[stitch_5]
inputs = 'rename_middle_2 rename_extension_2'
type = StitchedMeshGenerator
stitch_boundaries_pairs = '104 115'
[]
[stitch_6]
inputs = 'create_fused_bottom_sideset create_fused_top_sideset_r'
type = StitchedMeshGenerator
stitch_boundaries_pairs = '106 113'
[]
[no_slip_top]
input = stitch_6
type = ParsedGenerateSideset
combinatorial_geometry = 'y > .615'
normal = '0 1 0'
new_sideset_name = 'no_slip_top'
[]
[no_slip_bottom]
input = no_slip_top
type = ParsedGenerateSideset
combinatorial_geometry = 'y < -0.49'
normal = '0 -1 0'
new_sideset_name = 'no_slip_bottom'
[]
[inlet]
input = no_slip_bottom
type = ParsedGenerateSideset
combinatorial_geometry = 'x > 5.49'
normal = '1 0 0'
new_sideset_name = 'inlet'
[]
[outlet]
input = inlet
type = ParsedGenerateSideset
combinatorial_geometry = 'x < -5.49'
normal = '-1 0 0'
new_sideset_name = 'outlet'
[]
[]
(test/tests/meshgenerators/xy_delaunay_generator/xydelaunay_multiline.i)
[Mesh]
[line1]
type = PolyLineMeshGenerator
points = '0.0 0.0 0.0
1.0 0.0 0.0'
[]
[line2]
type = PolyLineMeshGenerator
points = '1.0 0.0 0.0
0.0 1.0 0.0'
[]
[outer_bdy]
type = StitchedMeshGenerator
inputs = "line1 line2"
stitch_boundaries_pairs = '2 1'
[]
[triang]
type = XYDelaunayGenerator
boundary = 'outer_bdy'
add_nodes_per_boundary_segment = 4
refine_boundary = false
desired_area = 0.05
[]
[]
(test/tests/meshgenerators/sidesets_from_points_generator/sidesets_ambiguity.i)
[GlobalParams]
prevent_boundary_ids_overlap = false
[]
[Mesh]
[region_2_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.065 0.13 0.305 0.17 0.196'
ix = ' 2 2 2 2 2'
dy = '0.85438 '
iy = '6'
subdomain_id = '68 68 68 68 68'
[]
[region_2_move]
type = TransformGenerator
transform = TRANSLATE
vector_value = '1.2 1.551 0'
input = region_2_gen
[]
[region_3_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.24 0.24 0.24 0.24 0.24'
ix = ' 2 2 2 2 2'
dy = '0.744166666666666 0.744166666666667 0.744166666666667'
iy = ' 2 2 2'
subdomain_id = '56 57 58 59 60
51 52 53 54 55
46 47 48 49 50'
[]
[region_3_move]
type = TransformGenerator
transform = TRANSLATE
vector_value = '0 2.40538 0'
input = region_3_gen
[]
[region_1_gen]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 6
xmin = 0
xmax = 0.26
ymin = 1.551
ymax = 1.851
subdomain_ids = '62 62 62 62 62 62 62 62 62 62
62 62 62 62 62 62 62 62 62 62
62 62 62 62 62 62 62 62 62 62
62 62 62 62 62 62 62 62 62 62
62 62 62 62 62 62 62 62 62 62
62 62 62 62 62 62 62 62 62 62'
[]
[region_1_extend_1]
type = FillBetweenSidesetsGenerator
input_mesh_1 = 'region_3_move'
input_mesh_2 = 'region_1_gen'
boundary_1 = '0'
boundary_2 = '2'
num_layers = 6
block_id= 61
use_quad_elements = true
keep_inputs = true
begin_side_boundary_id = '3'
end_side_boundary_id = '1'
[]
[region_1_extend_2]
type = FillBetweenSidesetsGenerator
input_mesh_1 = 'region_2_move'
input_mesh_2 = 'region_1_gen'
boundary_1 = 3
boundary_2 = 1
num_layers = 6
block_id= 69
use_quad_elements = true
keep_inputs = false
begin_side_boundary_id = '0'
end_side_boundary_id = '3'
input_boundary_1_id = '1'
input_boundary_2_id = '3'
[]
[region_2_2_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.065 0.13 0.305 0.17 0.196'
ix = ' 2 2 2 2 2'
dy = '0.85438 '
iy = '6'
subdomain_id = '68 68 68 68 68'
[]
[region_2_2_move]
type = TransformGenerator
transform = TRANSLATE
vector_value = '1.2 1.551 0'
input = region_2_2_gen
[]
[region_6_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.26 0.94 0.065 0.13 0.305 0.17 0.196'
ix = '10 6 2 2 2 2 2'
dy = '0.584 0.967'
iy = ' 4 6'
subdomain_id = '62 72 72 72 72 72 72
62 70 71 71 71 71 71'
[]
[stitch_1_2_6]
type = StitchedMeshGenerator
inputs = 'region_1_extend_1 region_1_extend_2 region_2_2_move region_6_gen'
stitch_boundaries_pairs = '1 3;
1 3;
0 0' # 0 0 will leave a slit mesh
[]
[rename_boundary_stitch_1_2_6]
type = RenameBoundaryGenerator
input = stitch_1_2_6
old_boundary = '1'
new_boundary = '2'
[]
[region_4_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.065 0.13'
ix = ' 2 2 '
dy = '0.744166666666666 0.744166666666667 0.744166666666667'
iy = ' 2 2 2'
subdomain_id = '78 92
78 91
78 90'
[]
[region_4_move]
type = TransformGenerator
transform = TRANSLATE
vector_value = '1.2 2.40538 0'
input = region_4_gen
[]
[region_5_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.17 0.196'
ix = '2 2'
dy = '0.39 1.8425'
iy = '2 4'
subdomain_id = '100 104
100 104'
[]
[region_5_move]
type = TransformGenerator
transform = TRANSLATE
vector_value = '1.7 2.40538 0'
input = region_5_gen
[]
[region_5_extend]
type = FillBetweenSidesetsGenerator
input_mesh_1 = 'region_4_move'
input_mesh_2 = 'region_5_move'
boundary_1 = 1
boundary_2 = 3
num_layers = 2
block_id= 96
use_quad_elements = true
keep_inputs = true
begin_side_boundary_id = '0'
end_side_boundary_id = '2'
[]
[rename_boundary_region_5]
type = RenameBoundaryGenerator
input = region_5_extend
old_boundary = '0'
new_boundary = '3'
[]
[stitch_1_2_6_5]
type = StitchedMeshGenerator
inputs = 'rename_boundary_stitch_1_2_6 rename_boundary_region_5'
stitch_boundaries_pairs = '2 3;'
[]
[region_7_gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.24 0.24 0.24 0.24 0.24 0.065 0.13 0.305 0.17 0.196'
ix = ' 2 2 2 2 2 2 2 2 2 2'
dy = '0.744166666666667 0.744166666666667 0.744166666666667 0.744166666666667
0.744166666666667 0.744166666666667 0.744166666666666 0.744166666666666
0.744166666666666 0.458 0.86002'
iy = '2 2 2 2 2 2 2 2 2 2 4'
subdomain_id = '41 42 43 44 45 77 89 95 99 103
36 37 38 39 40 77 88 95 99 103
31 32 33 34 35 77 87 95 99 103
26 27 28 29 30 76 86 94 98 102
21 22 23 24 25 76 85 94 98 102
16 17 18 19 20 76 84 94 98 102
11 12 13 14 15 75 83 93 97 101
6 7 8 9 10 75 82 93 97 101
1 2 3 4 5 75 81 93 97 101
67 67 67 67 67 74 80 65 65 66
63 63 63 63 63 73 79 64 64 64'
[]
[region_7_move]
type = TransformGenerator
transform = TRANSLATE
vector_value = '0.0 4.63788 0'
input = region_7_gen
[]
[stitch]
type = StitchedMeshGenerator
inputs = 'stitch_1_2_6_5 region_7_move'
stitch_boundaries_pairs = '2 0'
[]
[rename_boundary_1]
type = BoundaryDeletionGenerator
input = stitch
boundary_names = '0 1 2 3'
[]
[rename_boundary_2]
type = SideSetsFromPointsGenerator
input = rename_boundary_1
new_boundary = '4'
# the point here is on the slit; ambiguous.
points = '2.066 1.551 0.'
[]
[]
(test/tests/meshgenerators/advanced_extruder_generator/elem_flip.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
elem_type = QUAD4
[]
[mirror]
type = TransformGenerator
input = gmg
transform = ROTATE
vector_value = '0 180 0'
[]
[stitch]
type = StitchedMeshGenerator
inputs = 'gmg mirror'
stitch_boundaries_pairs = 'bottom bottom'
# This test was golded before the id overlap prevention was added
prevent_boundary_ids_overlap = false
[]
[feg]
type = AdvancedExtruderGenerator
input = stitch
direction = '0 0 1'
num_layers = 1
heights = 1
top_boundary = 100
bottom_boundary = 200
[]
[]
(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/combined/examples/optimization/helmholtz_multimat_strip.i)
vol_frac = 0.35
power = 1.1
Emin = 1.0e-6
Ess = 0.475 # ss
Et = 1.0 # w
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
# final_generator = 'MoveRight'
[Bottom]
type = GeneratedMeshGenerator
dim = 2
nx = 320
ny = 30
xmin = 0
xmax = 150
ymin = 0
ymax = 15
[]
[RenameBottom]
type = RenameBoundaryGenerator
input = Bottom
old_boundary = 'top bottom right left'
new_boundary = 'top_bottom bottom_bottom right_bottom left_bottom'
[]
[Middle]
type = GeneratedMeshGenerator
dim = 2
nx = 320
ny = 6
xmin = 0
xmax = 150
ymin = 0
ymax = 3
[]
[MoveMiddle]
type = TransformGenerator
input = Middle
transform = TRANSLATE
vector_value = '0 15 0'
[]
[RenameMiddle]
type = RenameBoundaryGenerator
input = MoveMiddle
old_boundary = 'top bottom right left'
new_boundary = 'top_middle bottom_middle right_middle left_middle'
[]
[Top]
type = GeneratedMeshGenerator
dim = 2
nx = 320
ny = 30
xmin = 0
xmax = 150
ymin = 0
ymax = 15
[]
[MoveTop]
type = TransformGenerator
input = Top
transform = TRANSLATE
vector_value = '0 18 0'
[]
[RenameTop]
type = RenameBoundaryGenerator
input = MoveTop
old_boundary = 'top bottom right left'
new_boundary = 'top_top bottom_top right_top left_top'
[]
[bottom_gen]
type = ParsedSubdomainMeshGenerator
input = RenameBottom
combinatorial_geometry = 'y <= 15'
block_id = 1
[]
[middle_gen]
type = ParsedSubdomainMeshGenerator
input = RenameMiddle
combinatorial_geometry = 'y <= 18 & y > 15'
block_id = 2
[]
[top_gen]
type = ParsedSubdomainMeshGenerator
input = RenameTop
combinatorial_geometry = 'y > 18'
block_id = 3
[]
[stitch]
type = StitchedMeshGenerator
inputs = 'bottom_gen middle_gen top_gen'
stitch_boundaries_pairs = 'top_bottom bottom_middle; top_middle bottom_top'
[]
[left_load]
type = ExtraNodesetGenerator
input = stitch
new_boundary = left_load
coord = '37.5 33 0'
[]
[right_load]
type = ExtraNodesetGenerator
input = left_load
new_boundary = right_load
coord = '112.5 33 0'
[]
[left_support]
type = ExtraNodesetGenerator
input = right_load
new_boundary = left_support
coord = '0 0 0'
[]
[right_support]
type = ExtraNodesetGenerator
input = left_support
new_boundary = right_support
coord = '150 0 0'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[Dc]
initial_condition = -1.0
[]
[]
[AuxVariables]
[Cc]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[]
[mat_den]
family = MONOMIAL
order = CONSTANT
initial_condition = ${vol_frac}
[]
[sensitivity]
family = MONOMIAL
order = FIRST
initial_condition = -1.0
[AuxKernel]
type = MaterialRealAux
variable = sensitivity
property = sensitivity
execute_on = LINEAR
[]
block = '1 2 3'
[]
[mat_den_nodal]
family = L2_LAGRANGE
order = FIRST
initial_condition = ${vol_frac}
[AuxKernel]
type = SelfAux
execute_on = TIMESTEP_END
variable = mat_den_nodal
v = mat_den
[]
[]
[Dc_elem]
family = MONOMIAL
order = CONSTANT
initial_condition = -1.0
[AuxKernel]
type = SelfAux
variable = Dc_elem
v = Dc
execute_on = 'TIMESTEP_END'
[]
[]
[]
[Kernels]
[diffusion]
type = FunctionDiffusion
variable = Dc
function = 4.0
[]
[potential]
type = Reaction
variable = Dc
[]
[source]
type = CoupledForce
variable = Dc
v = sensitivity
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = SMALL
add_variables = true
incremental = false
[]
[]
[BCs]
[no_y]
type = DirichletBC
variable = disp_y
boundary = left_support
value = 0.0
[]
[no_x]
type = DirichletBC
variable = disp_x
boundary = left_support
value = 0.0
[]
[no_y_right]
type = DirichletBC
variable = disp_y
boundary = right_support
value = 0.0
[]
[boundary_penalty]
type = ADRobinBC
variable = Dc
boundary = 'bottom_bottom right_bottom left_bottom top_top right_top left_top left_middle '
'right_middle'
coefficient = 10
[]
[]
[NodalKernels]
[left_down]
type = NodalGravity
variable = disp_y
boundary = left_load
gravity_value = -1e-3
mass = 1
[]
[right_down]
type = NodalGravity
variable = disp_y
boundary = right_load
gravity_value = -1e-3
mass = 1
[]
[]
[Materials]
[sensitivity]
type = ParsedMaterial
property_name = 'sensitivity'
block = '2'
expression = '0'
[]
[elasticity_tensor_one]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys_one
poissons_ratio = poissons_ratio
args = 'mat_den'
block = '1'
[]
[elasticity_tensor_three]
type = ComputeVariableIsotropicElasticityTensor
youngs_modulus = E_phys_three
poissons_ratio = poissons_ratio
args = 'mat_den'
block = '3'
[]
[elasticity_tensor_two]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1.0
poissons_ratio = 0.3
block = '2'
[]
# One: Tungsten
[E_phys_one]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${Et}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys_one
block = '1'
outputs = 'exodus'
[]
# Three: SS316
[E_phys_three]
type = DerivativeParsedMaterial
# Emin + (density^penal) * (E0 - Emin)
expression = '${Emin} + (mat_den ^ ${power}) * (${Ess}-${Emin})'
coupled_variables = 'mat_den'
property_name = E_phys_three
block = '3'
outputs = 'exodus'
[]
[poissons_ratio]
type = GenericConstantMaterial
prop_names = poissons_ratio
prop_values = 0.3
[]
[stress]
type = ComputeLinearElasticStress
[]
[dc_one]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys_one
block = '1'
[]
[dc_three]
type = ComplianceSensitivity
design_density = mat_den
youngs_modulus = E_phys_three
block = '3'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[update_one]
type = DensityUpdate
density_sensitivity = Dc_elem
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = TIMESTEP_BEGIN
block = '1'
[]
[update_three]
type = DensityUpdate
density_sensitivity = Dc_elem
design_density = mat_den
volume_fraction = ${vol_frac}
execute_on = TIMESTEP_BEGIN
block = '3'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
nl_abs_tol = 1e-10
dt = 1.0
num_steps = 90
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
print_linear_residuals = false
[]
[Postprocessors]
[mesh_volume]
type = VolumePostprocessor
execute_on = 'initial timestep_end'
[]
[total_vol]
type = ElementIntegralVariablePostprocessor
variable = mat_den
execute_on = 'INITIAL TIMESTEP_END'
[]
[vol_frac]
type = ParsedPostprocessor
expression = 'total_vol / mesh_volume'
pp_names = 'total_vol mesh_volume'
[]
[sensitivity]
type = ElementIntegralMaterialProperty
mat_prop = sensitivity
block = '1 3'
[]
[objective_one]
type = ElementIntegralMaterialProperty
mat_prop = strain_energy_density
execute_on = 'INITIAL TIMESTEP_END'
block = '1'
[]
[objective_three]
type = ElementIntegralMaterialProperty
mat_prop = strain_energy_density
execute_on = 'INITIAL TIMESTEP_END'
block = '3'
[]
[]
(test/include/meshgenerators/TestSubgenerators.h)
// This file is part of the MOOSE framework
// https://www.mooseframework.org
//
// 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 "StitchedMeshGenerator.h"
/**
* Allows multiple mesh files to be "stitched" together to form a single mesh.
*/
class TestSubgenerators : public StitchedMeshGenerator
{
public:
static InputParameters validParams();
TestSubgenerators(const InputParameters & parameters);
protected:
/// The mesh generator input filenames to read
const std::vector<std::string> & _input_filenames;
};