diff --git a/modules/combined/test/tests/subchannel_thm_coupling/3D.i b/modules/combined/test/tests/subchannel_thm_coupling/3D.i index 3c914286dd67..338b2fbf99a2 100644 --- a/modules/combined/test/tests/subchannel_thm_coupling/3D.i +++ b/modules/combined/test/tests/subchannel_thm_coupling/3D.i @@ -10,7 +10,7 @@ heated_length = 1.0 ################################################### [TriSubChannelMesh] [subchannel] - type = SCMDetailedTriSubChannelMeshGenerator + type = SCMDetailedTriAssemblyMeshGenerator nrings = ${n_rings} n_cells = ${n_cells} flat_to_flat = ${inner_duct_in} @@ -18,16 +18,6 @@ heated_length = 1.0 pin_diameter = ${fuel_pin_diameter} pitch = ${fuel_pin_pitch} [] - - [fuel_pins] - type = SCMDetailedTriPinMeshGenerator - input = subchannel - nrings = ${n_rings} - n_cells = ${n_cells} - pin_diameter = ${fuel_pin_diameter} - heated_length = ${heated_length} - pitch = ${fuel_pin_pitch} - [] [] [AuxVariables] diff --git a/modules/combined/test/tests/subchannel_thm_coupling/subchannel.i b/modules/combined/test/tests/subchannel_thm_coupling/subchannel.i index 80f5a751d6cd..aa29c60eb024 100644 --- a/modules/combined/test/tests/subchannel_thm_coupling/subchannel.i +++ b/modules/combined/test/tests/subchannel_thm_coupling/subchannel.i @@ -17,7 +17,7 @@ heated_length = 1.0 ################################################### [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = ${n_rings} n_cells = ${n_cells} flat_to_flat = ${inner_duct_in} @@ -29,15 +29,6 @@ heated_length = 1.0 spacer_z = '0.0' spacer_k = '0.0' [] - - [fuel_pins] - type = SCMTriPinMeshGenerator - input = subchannel - nrings = ${n_rings} - n_cells = ${n_cells} - heated_length = ${heated_length} - pitch = ${fuel_pin_pitch} - [] [] [AuxVariables] @@ -273,12 +264,14 @@ heated_length = 1.0 [Transfers] [subchannel_transfer] type = SCMSolutionTransfer + transfer_type = subchannel to_multi_app = viz variable = 'mdot SumWij P DP h T rho mu S' [] [pin_transfer] - type = SCMPinSolutionTransfer + type = SCMSolutionTransfer + transfer_type = pin to_multi_app = viz - variable = 'Dpin Tpin q_prime' + variable = 'Tpin q_prime Dpin' [] [] diff --git a/modules/subchannel/doc/content/modules/subchannel/v&v/ornl_19_pin.md b/modules/subchannel/doc/content/modules/subchannel/v&v/ornl_19_pin.md index b9b9c8088fa8..3f26ce367b9e 100644 --- a/modules/subchannel/doc/content/modules/subchannel/v&v/ornl_19_pin.md +++ b/modules/subchannel/doc/content/modules/subchannel/v&v/ornl_19_pin.md @@ -66,7 +66,7 @@ The general parameters on the experimental conditions are described here. The pu ### Mesh -The meshing in SCM uses a custom *SCMTriSubChannelMeshGenerator*. +The meshing in SCM uses a custom *SCMTriAssemblyMeshGenerator*. This one generates a mesh of 1D channel segments connected in 3D. The subchannel positions are automatically generated by specifying the number of radial rings, the flat to flat distance of the duct, and the pin pitch. The number of axial cells in which the domain is discretrized is specified by *n_cells*. @@ -121,7 +121,7 @@ A custom transfer, *SCMSolutionTransfer*, is used for this purpose. !listing /validation/ORNL_19_pin/test_ORNL_19.i block=Transfers language=moose -The detailed mesh uses a *SCMDetailedTriSubChannelMeshGenerator* and the solution variables are populated by the transfer. +The detailed mesh uses a *SCMDetailedTriAssemblyMeshGenerator* and the solution variables are populated by the transfer. !listing /validation/ORNL_19_pin/test_ORNL_19.i language=moose diff --git a/modules/subchannel/doc/content/modules/subchannel/v&v/toshiba_37_pin.md b/modules/subchannel/doc/content/modules/subchannel/v&v/toshiba_37_pin.md index 4cd87ba3cdee..8b374b6f7d0a 100644 --- a/modules/subchannel/doc/content/modules/subchannel/v&v/toshiba_37_pin.md +++ b/modules/subchannel/doc/content/modules/subchannel/v&v/toshiba_37_pin.md @@ -65,7 +65,7 @@ P_out = 2.0e5 # Pa ### Mesh -The meshing in SCM uses a custom [SCMTriSubChannelMeshGenerator](source/meshgenerators/SCMTriSubChannelMeshGenerator.md). +The meshing in SCM uses a custom [SCMTriAssemblyMeshGenerator](source/meshgenerators/SCMTriAssemblyMeshGenerator.md). This one generates a mesh of 1D channel segments connected in 3D. The subchannel positions are automatically generated by specifying the number of radial rings, the flat to flat distance of the duct, and the pin pitch. The number of axial cells in which the domain is discretrized is specified by *n_cells*. For more information about the mesh generator, pelase consult the website documentation on SCM. @@ -121,7 +121,7 @@ A custom transfer, *MultiAppDetailedSolutionTransfer*, is used for this purpose. !listing /validation/Toshiba_37_pin/toshiba_37_pin.i block=Transfers language=moose -The detailed mesh uses a *SCMDetailedTriSubChannelMeshGenerator* and the solution variables are populated by the transfer. +The detailed mesh uses a *SCMDetailedTriAssemblyMeshGenerator* and the solution variables are populated by the transfer. !listing /validation/Toshiba_37_pin/toshiba_37_pin.i block=viz language=moose diff --git a/modules/subchannel/doc/content/source/auxkernels/SCMQuadPowerAux.md b/modules/subchannel/doc/content/source/auxkernels/SCMQuadPowerAux.md index e18f6eac9374..ee3abdabab0c 100644 --- a/modules/subchannel/doc/content/source/auxkernels/SCMQuadPowerAux.md +++ b/modules/subchannel/doc/content/source/auxkernels/SCMQuadPowerAux.md @@ -12,8 +12,7 @@ This AuxKernel does the same thing as the [SCMQuadPowerIC](SCMQuadPowerIC.md) IC !! Intentional comment to provide extra spacing -If the user has created a mesh for the pins, the axial heat rate `q_prime` will be assigned to the nodes of the pin mesh. If the user hasn't created a pin mesh the appropriate heat rate `q_prime` will be assigned to -the nodes of the subchannel mesh. +This AuxKernel requires a pin mesh. The axial heat rate `q_prime` is assigned only to the nodes of the pin mesh. If the subchannel mesh has no pin mesh, this object reports an error. !syntax parameters /AuxKernels/SCMQuadPowerAux diff --git a/modules/subchannel/doc/content/source/auxkernels/SCMTriPowerAux.md b/modules/subchannel/doc/content/source/auxkernels/SCMTriPowerAux.md index a81cf1854ca3..a80482d9e224 100644 --- a/modules/subchannel/doc/content/source/auxkernels/SCMTriPowerAux.md +++ b/modules/subchannel/doc/content/source/auxkernels/SCMTriPowerAux.md @@ -12,8 +12,7 @@ This AuxKernel does the same thing as the [SCMTriPowerIC](SCMTriPowerIC.md) IC k !! Intentional comment to provide extra spacing -If the user has created a mesh for the pins, the axial heat rate `q_prime` will be assigned to the nodes of the pin mesh. If the user hasn't created a pin mesh the appropriate heat rate `q_prime` will be assigned to -the nodes of the subchannel mesh. +This AuxKernel requires a pin mesh. The axial heat rate `q_prime` is assigned only to the nodes of the pin mesh. If the subchannel mesh has no pin mesh, this object reports an error. !syntax parameters /AuxKernels/SCMTriPowerAux diff --git a/modules/subchannel/doc/content/source/ics/SCMQuadPowerIC.md b/modules/subchannel/doc/content/source/ics/SCMQuadPowerIC.md index 88a79bb3086f..95c2d2fe271e 100644 --- a/modules/subchannel/doc/content/source/ics/SCMQuadPowerIC.md +++ b/modules/subchannel/doc/content/source/ics/SCMQuadPowerIC.md @@ -6,7 +6,7 @@ !! Intentional comment to provide extra spacing -This IC assigns the axial heat rate ([!param](/ICs/SCMQuadPowerIC/variable) = `q_prime`) on the subchannels or pins in the case of a problem with subchannels/pins in a square lattice arrangement. +This IC assigns the axial heat rate ([!param](/ICs/SCMQuadPowerIC/variable) = `q_prime`) to the fuel pins in a square lattice arrangement. The user must provide the total power of the subassembly [!param](/ICs/SCMQuadPowerIC/power), the axial shape of the power profile and the radial power distribution (power per pin). The axial power profile is given as a function over the -z direction, which integral over the length of the heated portion of the pin, is equal to the length of the heated portion of the pin. The radial power distribution is given as a column of numbers in a .txt file [!param](/ICs/SCMQuadPowerIC/filename) that has as many entries as the number of pins. @@ -24,8 +24,7 @@ The axial heat rate at a specific height is the product of the total power of th !! Intentional comment to provide extra spacing -If the user has created a mesh for the pins, the axial heat rate will be assigned to the nodes of the pin mesh. If the user hasn't created a pin mesh the appropriate heat rate will be assigned to -the nodes of the subchannel mesh. When the user has defined a fuel-pin mesh, the axial heat rate ([!param](/ICs/SCMTriPowerIC/variable) = `q_prime`) is the heat rate at the surface of the fuels pins and it is distributed equally to each neighboring subchannel. +This IC requires a pin mesh. The axial heat rate ([!param](/ICs/SCMQuadPowerIC/variable) = `q_prime`) is assigned only to the nodes of the pin mesh. If the subchannel mesh has no pin mesh, this object reports an error. The subchannel solver distributes this pin heat to neighboring subchannels when computing the heat added to the coolant. !syntax parameters /ICs/SCMQuadPowerIC diff --git a/modules/subchannel/doc/content/source/ics/SCMTriPowerIC.md b/modules/subchannel/doc/content/source/ics/SCMTriPowerIC.md index 38a482d4f5fe..908ca0b6e025 100644 --- a/modules/subchannel/doc/content/source/ics/SCMTriPowerIC.md +++ b/modules/subchannel/doc/content/source/ics/SCMTriPowerIC.md @@ -6,7 +6,7 @@ !! Intentional comment to provide extra spacing -This IC assigns the axial heat rate ([!param](/ICs/SCMTriPowerIC/variable) = `q_prime`) on the subchannels or pins in the case of a problem with subchannels/pins in a triangular lattice arrangement. +This IC assigns the axial heat rate ([!param](/ICs/SCMTriPowerIC/variable) = `q_prime`) to the fuel pins in a triangular lattice arrangement. The user must provide the total power of the subassembly [!param](/ICs/SCMTriPowerIC/power), the axial shape of the power profile and the radial power distribution (power per pin). The axial power profile is given as a function, which integral over the length of the heated portion of the pin, is equal @@ -26,8 +26,7 @@ The axial heat rate at a specific height is the product of the total power of th !! Intentional comment to provide extra spacing -If the user has created a mesh for the pins, the axial hear rate will be assigned to the nodes of the pin mesh. If the user hasn't created a pin mesh the appropiate heat rate will be assigned to -the nodes of the subchannel mesh. When the user has defined a fuel-pin mesh, the axial heat rate ([!param](/ICs/SCMTriPowerIC/variable) = `q_prime`) is the heat rate at the surface of the fuels pins and it is distributed equally to each neighboring subchannel. +This IC requires a pin mesh. The axial heat rate ([!param](/ICs/SCMTriPowerIC/variable) = `q_prime`) is assigned only to the nodes of the pin mesh. If the subchannel mesh has no pin mesh, this object reports an error. The subchannel solver distributes this pin heat to neighboring subchannels when computing the heat added to the coolant. !syntax parameters /ICs/SCMTriPowerIC diff --git a/modules/subchannel/doc/content/source/meshgenerators/SCMDetailedQuadAssemblyMeshGenerator.md b/modules/subchannel/doc/content/source/meshgenerators/SCMDetailedQuadAssemblyMeshGenerator.md new file mode 100644 index 000000000000..5bc4c9b7d75a --- /dev/null +++ b/modules/subchannel/doc/content/source/meshgenerators/SCMDetailedQuadAssemblyMeshGenerator.md @@ -0,0 +1,17 @@ +# SCMDetailedQuadAssemblyMeshGenerator + +!syntax description /Mesh/SCMDetailedQuadAssemblyMeshGenerator + +## Overview + +!! Intentional comment to provide extra spacing + +This mesh generator creates one detailed 3D visualization mesh containing both the subchannel +volume and the fuel pin volume for a square lattice arrangement. The generated subdomains are named +`subchannel` and `fuel_pins`. + +!syntax parameters /Mesh/SCMDetailedQuadAssemblyMeshGenerator + +!syntax inputs /Mesh/SCMDetailedQuadAssemblyMeshGenerator + +!syntax children /Mesh/SCMDetailedQuadAssemblyMeshGenerator diff --git a/modules/subchannel/doc/content/source/meshgenerators/SCMDetailedQuadPinMeshGenerator.md b/modules/subchannel/doc/content/source/meshgenerators/SCMDetailedQuadPinMeshGenerator.md deleted file mode 100644 index ebda75fdc7b7..000000000000 --- a/modules/subchannel/doc/content/source/meshgenerators/SCMDetailedQuadPinMeshGenerator.md +++ /dev/null @@ -1,18 +0,0 @@ -# SCMDetailedQuadPinMeshGenerator - -!syntax description /Mesh/SCMDetailedQuadPinMeshGenerator - -## Overview - -!! Intentional comment to provide extra spacing - -This is a mesh generator used for visualization purposes only. It is part of an input file that creates -a 3D realistic mesh of the pins in a square lattice arrangement. This input file has a Problem block -with the [NoSolveProblem.md] because it is not used to perform any calculations. It is used to create a detailed 3D mesh that the `SCM` solution gets projected on. Last, [!param](/Mesh/SCMDetailedQuadPinMeshGenerator/input) is a parameter that takes the name of an object of type [SCMDetailedQuadSubChannelMeshGenerator](SCMDetailedQuadSubChannelMeshGenerator.md) so the user must be careful to define consistent -parameters across both `MeshGenerators`. The center of the mesh is the origin. - -!syntax parameters /Mesh/SCMDetailedQuadPinMeshGenerator - -!syntax inputs /Mesh/SCMDetailedQuadPinMeshGenerator - -!syntax children /Mesh/SCMDetailedQuadPinMeshGenerator diff --git a/modules/subchannel/doc/content/source/meshgenerators/SCMDetailedQuadSubChannelMeshGenerator.md b/modules/subchannel/doc/content/source/meshgenerators/SCMDetailedQuadSubChannelMeshGenerator.md deleted file mode 100644 index 55045ec96fce..000000000000 --- a/modules/subchannel/doc/content/source/meshgenerators/SCMDetailedQuadSubChannelMeshGenerator.md +++ /dev/null @@ -1,27 +0,0 @@ -# SCMDetailedQuadSubChannelMeshGenerator - -!syntax description /Mesh/SCMDetailedQuadSubChannelMeshGenerator - -## Overview - -!! Intentional comment to provide extra spacing - -This is a mesh generator used for visualization purposes only. It is part of an input file that creates a 3D realistic mesh of the subchannels in a square lattice arrangement. This input file has a Problem block with the [NoSolveProblem.md] because it is not used to perform any calculations. It is used to create a detailed 3D mesh that the `SCM` solution gets projected on. The center of the mesh is the origin. Last the [!param](/Mesh/SCMDetailedQuadSubChannelMeshGenerator/side_gap) is an added distance between a perimetric pin and the duct, such that: distance(edge/corner pin center, duct wall) = pitch / 2 + side_gap. - -Note that: - -- the vector (in the XY plane) from a corner pin center to the corner subchannel centroid is $Pitch/2 \vec{i} + Pitch/2 \vec{j}$. -- the vector (in the XY plane) from a corner pin center to the corner of the duct is $(Pitch/2 + side\_gap) \vec{i} + (Pitch/2 + side\_gap) \vec{j}$. - -[side_gap] presents a sketch of the SCM geometry nomenclature near the duct corner. - -!media subchannel/misc/side_gap.png - style=width:90%;margin-bottom:2%;margin:auto; - id=side_gap - caption=Geometric features of the quadrilateral SCM mesh - -!syntax parameters /Mesh/SCMDetailedQuadSubChannelMeshGenerator - -!syntax inputs /Mesh/SCMDetailedQuadSubChannelMeshGenerator - -!syntax children /Mesh/SCMDetailedQuadSubChannelMeshGenerator diff --git a/modules/subchannel/doc/content/source/meshgenerators/SCMDetailedTriAssemblyMeshGenerator.md b/modules/subchannel/doc/content/source/meshgenerators/SCMDetailedTriAssemblyMeshGenerator.md new file mode 100644 index 000000000000..fac4b26c536d --- /dev/null +++ b/modules/subchannel/doc/content/source/meshgenerators/SCMDetailedTriAssemblyMeshGenerator.md @@ -0,0 +1,17 @@ +# SCMDetailedTriAssemblyMeshGenerator + +!syntax description /Mesh/SCMDetailedTriAssemblyMeshGenerator + +## Overview + +!! Intentional comment to provide extra spacing + +This mesh generator creates one detailed 3D visualization mesh containing both the subchannel +volume and the fuel pin volume for a triangular lattice arrangement. The generated subdomains are +named `subchannel` and `fuel_pins`. + +!syntax parameters /Mesh/SCMDetailedTriAssemblyMeshGenerator + +!syntax inputs /Mesh/SCMDetailedTriAssemblyMeshGenerator + +!syntax children /Mesh/SCMDetailedTriAssemblyMeshGenerator diff --git a/modules/subchannel/doc/content/source/meshgenerators/SCMDetailedTriPinMeshGenerator.md b/modules/subchannel/doc/content/source/meshgenerators/SCMDetailedTriPinMeshGenerator.md deleted file mode 100644 index 8eed16cb0fa7..000000000000 --- a/modules/subchannel/doc/content/source/meshgenerators/SCMDetailedTriPinMeshGenerator.md +++ /dev/null @@ -1,17 +0,0 @@ -# SCMDetailedTriPinMeshGenerator - -!syntax description /Mesh/SCMDetailedTriPinMeshGenerator - -## Overview - -!! Intentional comment to provide extra spacing - -This is a mesh generator used for visualization purposes only. It is part of an input file that creates -a 3D realistic mesh of the pins in a triangular lattice arrangement. This input file has a Problem block -with the [NoSolveProblem.md] because it is not used to perform any calculations. It is used to create a detailed 3D mesh that the `SCM` solution gets projected on. Last, [!param](/Mesh/SCMDetailedTriPinMeshGenerator/input) is a parameter that takes the name of an object of type [SCMDetailedTriSubChannelMeshGenerator](SCMDetailedTriSubChannelMeshGenerator.md) so the user must be careful to define consistent parameters across both `MeshGenerators`. The center of the mesh is the origin. - -!syntax parameters /Mesh/SCMDetailedTriPinMeshGenerator - -!syntax inputs /Mesh/SCMDetailedTriPinMeshGenerator - -!syntax children /Mesh/SCMDetailedTriPinMeshGenerator diff --git a/modules/subchannel/doc/content/source/meshgenerators/SCMDetailedTriSubChannelMeshGenerator.md b/modules/subchannel/doc/content/source/meshgenerators/SCMDetailedTriSubChannelMeshGenerator.md deleted file mode 100644 index 33ea222043f2..000000000000 --- a/modules/subchannel/doc/content/source/meshgenerators/SCMDetailedTriSubChannelMeshGenerator.md +++ /dev/null @@ -1,21 +0,0 @@ -# SCMDetailedTriSubChannelMeshGenerator - -!syntax description /Mesh/SCMDetailedTriSubChannelMeshGenerator - -## Overview - -!! Intentional comment to provide extra spacing - -This is a mesh generator used for visualization purposes only. It is part of an input file that creates -a 3D realistic mesh of the subchannels in a triangular lattice arrangement. This input file has a Problem block -with the [NoSolveProblem.md] because it is not used to perform any calculations. It is used to create a detailed 3D mesh that the `SCM` solution gets projected on. The center of the mesh is the origin. - -## Example Input File Syntax - -!listing /test/tests/problems/Lead-LBE-19pin/3D_LBE-19pin.i block=Mesh language=moose - -!syntax parameters /Mesh/SCMDetailedTriSubChannelMeshGenerator - -!syntax inputs /Mesh/SCMDetailedTriSubChannelMeshGenerator - -!syntax children /Mesh/SCMDetailedTriSubChannelMeshGenerator diff --git a/modules/subchannel/doc/content/source/meshgenerators/SCMQuadAssemblyMeshGenerator.md b/modules/subchannel/doc/content/source/meshgenerators/SCMQuadAssemblyMeshGenerator.md new file mode 100644 index 000000000000..fde1981f95db --- /dev/null +++ b/modules/subchannel/doc/content/source/meshgenerators/SCMQuadAssemblyMeshGenerator.md @@ -0,0 +1,21 @@ +# SCMQuadAssemblyMeshGenerator + +!syntax description /Mesh/SCMQuadAssemblyMeshGenerator + +## Overview + +!! Intentional comment to provide extra spacing + +This mesh generator creates the 1D subchannel and pin meshes for a square lattice arrangement. +The generated subdomains are named `subchannel` and `fuel_pins`. +The center of the mesh is the origin. + +## Example Input File Syntax + +!listing /test/tests/problems/psbt/psbt_explicit.i block=QuadSubChannelMesh language=moose + +!syntax parameters /Mesh/SCMQuadAssemblyMeshGenerator + +!syntax inputs /Mesh/SCMQuadAssemblyMeshGenerator + +!syntax children /Mesh/SCMQuadAssemblyMeshGenerator diff --git a/modules/subchannel/doc/content/source/meshgenerators/SCMQuadPinMeshGenerator.md b/modules/subchannel/doc/content/source/meshgenerators/SCMQuadPinMeshGenerator.md deleted file mode 100644 index a5402be446f6..000000000000 --- a/modules/subchannel/doc/content/source/meshgenerators/SCMQuadPinMeshGenerator.md +++ /dev/null @@ -1,21 +0,0 @@ -# SCMQuadPinMeshGenerator - -!syntax description /Mesh/SCMQuadPinMeshGenerator - -## Overview - -!! Intentional comment to provide extra spacing - -This mesh generator creates the mesh were the `SCM` solution variables associated with the fuel pins live. -The user needs to provide the number of subchannels [!param](/Mesh/SCMQuadPinMeshGenerator/nx) in the -x direction and [!param](/Mesh/SCMQuadPinMeshGenerator/ny) in the -y direction. -The number of cells in the -z direction is given by [!param](/Mesh/SCMQuadPinMeshGenerator/n_cells). The distance of the pins from eachother is given by the [!param](/Mesh/SCMQuadPinMeshGenerator/pitch) parameter and the total length of the pins in the -z direction is defined by the parameters: [!param](/Mesh/SCMQuadPinMeshGenerator/heated_length),[!param](/Mesh/SCMQuadPinMeshGenerator/unheated_length_entry),[!param](/Mesh/SCMQuadPinMeshGenerator/unheated_length_exit). Last, [!param](/Mesh/SCMQuadPinMeshGenerator/input) is a parameter that takes the name of an object of type [SCMQuadSubChannelMeshGenerator](SCMQuadSubChannelMeshGenerator.md) so the user must be careful to define consistent parameters across both `MeshGenerators`. The center of the mesh is the origin. - -## Example Input File Syntax - -!listing /validation/psbt/psbt_ss/psbt.i block=QuadSubChannelMesh language=moose - -!syntax parameters /Mesh/SCMQuadPinMeshGenerator - -!syntax inputs /Mesh/SCMQuadPinMeshGenerator - -!syntax children /Mesh/SCMQuadPinMeshGenerator diff --git a/modules/subchannel/doc/content/source/meshgenerators/SCMQuadSubChannelMeshGenerator.md b/modules/subchannel/doc/content/source/meshgenerators/SCMQuadSubChannelMeshGenerator.md deleted file mode 100644 index 39cd9c887416..000000000000 --- a/modules/subchannel/doc/content/source/meshgenerators/SCMQuadSubChannelMeshGenerator.md +++ /dev/null @@ -1,34 +0,0 @@ -# SCMQuadSubChannelMeshGenerator - -!syntax description /Mesh/SCMQuadSubChannelMeshGenerator - -## Overview - -!! Intentional comment to provide extra spacing - -This mesh generator creates the mesh were the `SCM` solution variables associated with the subchannels live. -The user needs to provide the number of subchannels [!param](/Mesh/SCMQuadSubChannelMeshGenerator/nx) in the -x direction and [!param](/Mesh/SCMQuadSubChannelMeshGenerator/ny) in the -y direction. -The number of cells in the -z direction is given by [!param](/Mesh/SCMQuadSubChannelMeshGenerator/n_cells). The distance of the pins from eachother is given by the [!param](/Mesh/SCMQuadSubChannelMeshGenerator/pitch) parameter and the total length of the sub-assembly is defined by the parameters: -[!param](/Mesh/SCMQuadSubChannelMeshGenerator/heated_length),[!param](/Mesh/SCMQuadSubChannelMeshGenerator/unheated_length_entry),[!param](/Mesh/SCMQuadSubChannelMeshGenerator/unheated_length_entry). The fuel pin diameter is given by [!param](/Mesh/SCMQuadSubChannelMeshGenerator/pin_diameter). The user also has the ability to define the effect of spacers or mixing vanes on the subassembly by defining their axial location [!param](/Mesh/SCMQuadSubChannelMeshGenerator/spacer_z) and a local presure form loss coefficient [!param](/Mesh/SCMQuadSubChannelMeshGenerator/spacer_k). The center of the mesh is the origin. Last the [!param](/Mesh/SCMQuadSubChannelMeshGenerator/side_gap) is an added distance between a perimetric pin and the duct, such that: distance(edge/corner pin center, duct wall) = pitch / 2 + side_gap. - -Note that: - -- the vector (in the XY plane) from a corner pin center to the corner subchannel centroid is $Pitch/2 \vec{i} + Pitch/2 \vec{j}$. -- the vector (in the XY plane) from a corner pin center to the corner of the duct is $(Pitch/2 + side\_gap) \vec{i} + (Pitch/2 + side\_gap) \vec{j}$. - -[side_gap] presents a sketch of the SCM geometry nomenclature near the duct corner. - -!media subchannel/misc/side_gap.png - style=width:90%;margin-bottom:2%;margin:auto; - id=side_gap - caption=Geometric features of the quadrilateral SCM mesh - -## Example Input File Syntax - -!listing /test/tests/problems/psbt/psbt_explicit.i block=QuadSubChannelMesh language=moose - -!syntax parameters /Mesh/SCMQuadSubChannelMeshGenerator - -!syntax inputs /Mesh/SCMQuadSubChannelMeshGenerator - -!syntax children /Mesh/SCMQuadSubChannelMeshGenerator diff --git a/modules/subchannel/doc/content/source/meshgenerators/SCMTriAssemblyMeshGenerator.md b/modules/subchannel/doc/content/source/meshgenerators/SCMTriAssemblyMeshGenerator.md new file mode 100644 index 000000000000..a6e63dfd4b79 --- /dev/null +++ b/modules/subchannel/doc/content/source/meshgenerators/SCMTriAssemblyMeshGenerator.md @@ -0,0 +1,21 @@ +# SCMTriAssemblyMeshGenerator + +!syntax description /Mesh/SCMTriAssemblyMeshGenerator + +## Overview + +!! Intentional comment to provide extra spacing + +This mesh generator creates the 1D subchannel and pin meshes for a triangular lattice arrangement. +The generated subdomains are named `subchannel` and `fuel_pins`. +The center of the mesh is the origin. + +## Example Input File Syntax + +!listing /test/tests/problems/SFR/sodium-19pin/test19_monolithic.i block=TriSubChannelMesh language=moose + +!syntax parameters /Mesh/SCMTriAssemblyMeshGenerator + +!syntax inputs /Mesh/SCMTriAssemblyMeshGenerator + +!syntax children /Mesh/SCMTriAssemblyMeshGenerator diff --git a/modules/subchannel/doc/content/source/meshgenerators/SCMTriPinMeshGenerator.md b/modules/subchannel/doc/content/source/meshgenerators/SCMTriPinMeshGenerator.md deleted file mode 100644 index 7a2cf1ad73ad..000000000000 --- a/modules/subchannel/doc/content/source/meshgenerators/SCMTriPinMeshGenerator.md +++ /dev/null @@ -1,22 +0,0 @@ -# SCMTriPinMeshGenerator - -!syntax description /Mesh/SCMTriPinMeshGenerator - -## Overview - -!! Intentional comment to provide extra spacing - -This mesh generator creates the mesh were the `SCM` solution variables associated with the pins live. -The user needs to provide the [!param](/Mesh/SCMTriPinMeshGenerator/nrings) parameter which defines the number of fuel pin rings. For triangular sub-assemblies, one nring means that there is one central pin in the (0 0 0) -position and six neighboring ones on the the vertices of a normal hexagon. The number of cells in the -z direction is given by [!param](/Mesh/SCMTriPinMeshGenerator/n_cells). The distance of the pins from eachother is given by the [!param](/Mesh/SCMTriPinMeshGenerator/pitch) parameter and the total length of the pins in the -z direction is defined by the parameters: [!param](/Mesh/SCMTriPinMeshGenerator/heated_length),[!param](/Mesh/SCMTriPinMeshGenerator/unheated_length_entry),[!param](/Mesh/SCMTriPinMeshGenerator/unheated_length_entry). -Last, [!param](/Mesh/SCMTriPinMeshGenerator/input) is a parameter that takes the name of an object of type [SCMTriSubChannelMeshGenerator](SCMQuadSubChannelMeshGenerator.md) so the user must be careful to define consistent parameters across both `MeshGenerators`. The center of the mesh is the origin. - -## Example Input File Syntax - -!listing /test/tests/problems/SFR/sodium-19pin/test19_monolithic.i block=TriSubChannelMesh language=moose - -!syntax parameters /Mesh/SCMTriPinMeshGenerator - -!syntax inputs /Mesh/SCMTriPinMeshGenerator - -!syntax children /Mesh/SCMTriPinMeshGenerator diff --git a/modules/subchannel/doc/content/source/meshgenerators/SCMTriSubChannelMeshGenerator.md b/modules/subchannel/doc/content/source/meshgenerators/SCMTriSubChannelMeshGenerator.md deleted file mode 100644 index 5ac256b36516..000000000000 --- a/modules/subchannel/doc/content/source/meshgenerators/SCMTriSubChannelMeshGenerator.md +++ /dev/null @@ -1,24 +0,0 @@ -# SCMTriSubChannelMeshGenerator - -!syntax description /Mesh/SCMTriSubChannelMeshGenerator - -## Overview - -!! Intentional comment to provide extra spacing - -This mesh generator creates the mesh were the `SCM` solution variables associated with the subchannels live. -The user needs to provide the [!param](/Mesh/SCMTriSubChannelMeshGenerator/nrings) parameter which defines the number of fuel pin rings. For triangular sub-assemblies, one nring means that there is one central pin in the (0 0 0) position and six neighboring ones on the the vertices of a normal hexagon. The number of cells in the -z direction is given by [!param](/Mesh/SCMTriSubChannelMeshGenerator/n_cells). The distance of the pins from eachother is given by the [!param](/Mesh/SCMTriSubChannelMeshGenerator/pitch) parameter and the total length of the sub-assembly in the -z direction is defined by the parameters: -[!param](/Mesh/SCMTriSubChannelMeshGenerator/heated_length),[!param](/Mesh/SCMTriSubChannelMeshGenerator/unheated_length_entry),[!param](/Mesh/SCMTriSubChannelMeshGenerator/unheated_length_entry). -The fuel pin diameter is given by [!param](/Mesh/SCMTriSubChannelMeshGenerator/pin_diameter). The user also has the ability to define the effect of spacers or mixing vanes on the sub-assembly -by defining their axial location [!param](/Mesh/SCMTriSubChannelMeshGenerator/spacer_z) and a local presure from loss [!param](/Mesh/SCMTriSubChannelMeshGenerator/spacer_k). [!param](/Mesh/SCMTriSubChannelMeshGenerator/flat_to_flat) is the size of the hexagonal duct that encloses the sub-assembly. If the pins are wire wrapped then the parameters: [!param](/Mesh/SCMTriSubChannelMeshGenerator/dwire) [!param](/Mesh/SCMTriSubChannelMeshGenerator/hwire) have non zero values that describe the geometry of the wire-wrap. -The center of the mesh is the origin. - -## Example Input File Syntax - -!listing /validation/Toshiba_37_pin/toshiba_37_pin.i block=TriSubChannelMesh language=moose - -!syntax parameters /Mesh/SCMTriSubChannelMeshGenerator - -!syntax inputs /Mesh/SCMTriSubChannelMeshGenerator - -!syntax children /Mesh/SCMTriSubChannelMeshGenerator diff --git a/modules/subchannel/doc/content/source/positions/SCMPinPositions.md b/modules/subchannel/doc/content/source/positions/SCMPinPositions.md index 790fe16b3339..a9db138d2db6 100644 --- a/modules/subchannel/doc/content/source/positions/SCMPinPositions.md +++ b/modules/subchannel/doc/content/source/positions/SCMPinPositions.md @@ -2,8 +2,8 @@ !syntax description /Positions/SCMPinPositions -This object currently requires using a `SubChannel` pin mesh, such as the meshes generated by the [SCMTriPinMeshGenerator.md] -or the [SCMQuadPinMeshGenerator.md]. +This object currently requires using a `SubChannel` pin mesh, such as the meshes generated by the [SCMTriAssemblyMeshGenerator.md] +or the [SCMQuadAssemblyMeshGenerator.md]. !alert note Future development may lift this limitation. Please contact a MOOSE developer if needed. diff --git a/modules/subchannel/doc/content/source/postprocessors/SCMPinPowerPostprocessor.md b/modules/subchannel/doc/content/source/postprocessors/SCMPinPowerPostprocessor.md index f8e6b4134926..5d71790daba2 100644 --- a/modules/subchannel/doc/content/source/postprocessors/SCMPinPowerPostprocessor.md +++ b/modules/subchannel/doc/content/source/postprocessors/SCMPinPowerPostprocessor.md @@ -6,12 +6,12 @@ !! this comment introduces vertical space -The user needs to specify a subchannel problem. Either a [QuadSubChannel1PhaseProblem.md] or a [TriSubChannel1PhaseProblem.md]. The postprocessor will calculate the total heat rate $[W]$ that goes into the coolant, based on the distribution of the aux variable q_prime $[W/m]$, on the fuel pins or the subchannels. It will integrate this variable over the heated section using an axial trapezoidal rule. +The user needs to specify a subchannel problem. Either a [QuadSubChannel1PhaseProblem.md] or a [TriSubChannel1PhaseProblem.md]. The postprocessor will calculate the total heat rate $[W]$ that goes into the coolant, based on the distribution of the aux variable q_prime $[W/m]$ on the fuel pins. It will integrate this variable over the heated section using an axial trapezoidal rule. ## Example Input File Syntax -!listing /test/tests/SCMQuadPower/test.i block=Postprocessors language=moose -!listing /test/tests/SCMTriPower/test.i block=Postprocessors language=moose +!listing /test/tests/SCMQuadPower/test_with_pins.i block=Postprocessors language=moose +!listing /test/tests/SCMTriPower/test_with_pins.i block=Postprocessors language=moose !syntax parameters /Postprocessors/SCMPinPowerPostprocessor diff --git a/modules/subchannel/doc/content/source/transfers/SCMPinSolutionTransfer.md b/modules/subchannel/doc/content/source/transfers/SCMPinSolutionTransfer.md deleted file mode 100644 index 3776ed900d10..000000000000 --- a/modules/subchannel/doc/content/source/transfers/SCMPinSolutionTransfer.md +++ /dev/null @@ -1,16 +0,0 @@ -# SCMPinSolutionTransfer - -!syntax description /Transfers/SCMPinSolutionTransfer - -## Overview - -!! Intentional comment to provide extra spacing - -This class is used to transfer the pin associated variables: pin surface temperature `Tpin`, axial heat rate qprime `q_prime` and pin diameter `Dpin` -to the visualization mesh. - -!syntax parameters /Transfers/SCMPinSolutionTransfer - -!syntax inputs /Transfers/SCMPinSolutionTransfer - -!syntax children /Transfers/SCMPinSolutionTransfer diff --git a/modules/subchannel/doc/content/source/transfers/SCMSolutionTransfer.md b/modules/subchannel/doc/content/source/transfers/SCMSolutionTransfer.md index e26c6484a054..7ae80208b912 100644 --- a/modules/subchannel/doc/content/source/transfers/SCMSolutionTransfer.md +++ b/modules/subchannel/doc/content/source/transfers/SCMSolutionTransfer.md @@ -6,7 +6,9 @@ !! Intentional comment to provide extra spacing -This class is used to transfer the subchannel associated variables to the visualization mesh. +This class transfers either subchannel-associated or pin-associated variables to the visualization +mesh. Use `transfer_type = subchannel` for channel-centered fields and `transfer_type = pin` for +pin-centered fields. !syntax parameters /Transfers/SCMSolutionTransfer diff --git a/modules/subchannel/examples/MultiApp/3d.i b/modules/subchannel/examples/MultiApp/3d.i index 407200283343..88f57f711642 100644 --- a/modules/subchannel/examples/MultiApp/3d.i +++ b/modules/subchannel/examples/MultiApp/3d.i @@ -29,7 +29,7 @@ n_cells = 100 [Mesh] [subchannel] - type = SCMDetailedTriSubChannelMeshGenerator + type = SCMDetailedTriAssemblyMeshGenerator nrings = '${fparse n_rings}' n_cells = ${n_cells} flat_to_flat = '${fparse duct_inside}' @@ -40,17 +40,6 @@ n_cells = 100 pitch = '${fparse fuel_pin_pitch}' [] - [fuel_pins] - type = SCMDetailedTriPinMeshGenerator - input = subchannel - nrings = '${fparse n_rings}' - n_cells = ${n_cells} - unheated_length_entry = '${fparse length_entry_fuel}' - heated_length = '${fparse length_heated_fuel}' - unheated_length_exit = '${fparse length_outlet_fuel}' - pitch = '${fparse fuel_pin_pitch}' - pin_diameter = '${fparse fuel_pin_diameter}' - [] [] [AuxVariables] diff --git a/modules/subchannel/examples/MultiApp/fuel_assembly.i b/modules/subchannel/examples/MultiApp/fuel_assembly.i index 0aefabc503ee..b69ea41c8f84 100644 --- a/modules/subchannel/examples/MultiApp/fuel_assembly.i +++ b/modules/subchannel/examples/MultiApp/fuel_assembly.i @@ -12,9 +12,7 @@ mass_flux_in = '${fparse 2786}' # kg/(m2.s) ################################################### # Geometric parameters ################################################### - n_cells = 50 - # units are cm - do not forget to convert to meter scale_factor = 0.01 fuel_element_pitch = '${fparse 14.598*scale_factor}' @@ -37,7 +35,7 @@ duct_inside = '${fparse duct_outside - 2 * duct_thickness}' [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = '${fparse n_rings}' n_cells = ${n_cells} flat_to_flat = '${fparse duct_inside}' @@ -52,20 +50,9 @@ duct_inside = '${fparse duct_outside - 2 * duct_thickness}' spacer_k = '0.5 0.5' [] - [fuel_pins] - type = SCMTriPinMeshGenerator - input = subchannel - nrings = '${fparse n_rings}' - n_cells = ${n_cells} - unheated_length_entry = '${fparse length_entry_fuel}' - heated_length = '${fparse length_heated_fuel}' - unheated_length_exit = '${fparse length_outlet_fuel}' - pitch = '${fparse fuel_pin_pitch}' - [] - [duct] type = SCMTriDuctMeshGenerator - input = fuel_pins + input = subchannel nrings = '${fparse n_rings}' n_cells = ${n_cells} flat_to_flat = '${fparse duct_inside}' @@ -294,7 +281,8 @@ duct_inside = '${fparse duct_outside - 2 * duct_thickness}' variable = 'mdot SumWij P DP h T rho mu S' [] [pin_transfer] - type = SCMPinSolutionTransfer + type = SCMSolutionTransfer + transfer_type = pin to_multi_app = viz variable = 'Tpin q_prime' [] diff --git a/modules/subchannel/examples/MultiApp/tests b/modules/subchannel/examples/MultiApp/tests index 7158818a2f7a..28c5dee76b05 100644 --- a/modules/subchannel/examples/MultiApp/tests +++ b/modules/subchannel/examples/MultiApp/tests @@ -1,6 +1,6 @@ [Tests] issues = '#29237' - design = 'SCMSolutionTransfer.md SCMPinSolutionTransfer.md' + design = 'SCMSolutionTransfer.md' [check] type = CSVDiff input = fuel_assembly.i diff --git a/modules/subchannel/examples/coupling/thermo_mech/quad/3d.i b/modules/subchannel/examples/coupling/thermo_mech/quad/3d.i index 444986a7e5f5..f5ab222ad290 100644 --- a/modules/subchannel/examples/coupling/thermo_mech/quad/3d.i +++ b/modules/subchannel/examples/coupling/thermo_mech/quad/3d.i @@ -9,12 +9,8 @@ [] [Mesh] - [subchannel] - type = SCMDetailedQuadSubChannelMeshGenerator - [] - [fuel_pins] - type = SCMDetailedQuadPinMeshGenerator - input = subchannel + [assembly] + type = SCMDetailedQuadAssemblyMeshGenerator [] [] diff --git a/modules/subchannel/examples/coupling/thermo_mech/quad/one_pin_problem.i b/modules/subchannel/examples/coupling/thermo_mech/quad/one_pin_problem.i index 1821c3c659e6..c31b417a40d9 100644 --- a/modules/subchannel/examples/coupling/thermo_mech/quad/one_pin_problem.i +++ b/modules/subchannel/examples/coupling/thermo_mech/quad/one_pin_problem.i @@ -20,12 +20,7 @@ heated_length = 1.0 [QuadSubChannelMesh] [subchannel] - type = SCMQuadSubChannelMeshGenerator - [] - - [fuel_pins] - type = SCMQuadPinMeshGenerator - input = subchannel + type = SCMQuadAssemblyMeshGenerator [] [] @@ -98,13 +93,17 @@ heated_length = 1.0 P_out = ${P_out} verbose_subchannel = true deformation = true - friction_closure = 'MATRA' + friction_closure = 'MATRA' + pin_HTC_closure = 'Dittus-Boelter' [] [SCMClosures] [MATRA] type = SCMFrictionMATRA [] + [Dittus-Boelter] + type = SCMHTCDittusBoelter + [] [] [ICs] @@ -293,7 +292,8 @@ heated_length = 1.0 [] [pin_transfer] - type = SCMPinSolutionTransfer + type = SCMSolutionTransfer + transfer_type = pin to_multi_app = viz variable = 'Tpin Dpin q_prime' [] diff --git a/modules/subchannel/examples/duct/3d.i b/modules/subchannel/examples/duct/3d.i index bb35ad4f8150..bfe8a62f71f4 100644 --- a/modules/subchannel/examples/duct/3d.i +++ b/modules/subchannel/examples/duct/3d.i @@ -1,6 +1,6 @@ [Mesh] [subchannel] - type = SCMDetailedTriSubChannelMeshGenerator + type = SCMDetailedTriAssemblyMeshGenerator nrings = 4 n_cells = 100 flat_to_flat = 0.085 diff --git a/modules/subchannel/examples/duct/test.i b/modules/subchannel/examples/duct/test.i index 7c88bacf7360..b985fd06f73a 100644 --- a/modules/subchannel/examples/duct/test.i +++ b/modules/subchannel/examples/duct/test.i @@ -3,7 +3,7 @@ mass_flux_in = '${fparse 1e+6 * 37.00 / 36000.*0.5}' P_out = 2.0e5 # Pa [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = 4 n_cells = 100 flat_to_flat = 0.085 diff --git a/modules/subchannel/examples/heating_test/3X3_channel.i b/modules/subchannel/examples/heating_test/3X3_channel.i index b999a172b038..7e5319804f08 100644 --- a/modules/subchannel/examples/heating_test/3X3_channel.i +++ b/modules/subchannel/examples/heating_test/3X3_channel.i @@ -9,7 +9,7 @@ n_cells = 20 [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 3 ny = 3 n_cells = '${n_cells}' @@ -43,12 +43,16 @@ n_cells = 20 compute_power = true P_out = ${P_out} friction_closure = 'MATRA' + pin_HTC_closure = 'Dittus-Boelter' [] [SCMClosures] [MATRA] type = SCMFrictionMATRA [] + [Dittus-Boelter] + type = SCMHTCDittusBoelter + [] [] [ICs] @@ -87,6 +91,12 @@ n_cells = 20 value = 0.0 [] + [Dpin_ic] + type = ConstantIC + variable = Dpin + value = 0.00950 + [] + [Viscosity_ic] type = ViscosityIC variable = mu diff --git a/modules/subchannel/examples/heating_test/3d.i b/modules/subchannel/examples/heating_test/3d.i index 7a866957fc73..085ab9c8b9a1 100644 --- a/modules/subchannel/examples/heating_test/3d.i +++ b/modules/subchannel/examples/heating_test/3d.i @@ -6,8 +6,8 @@ height = ${fparse unheated_length_entry + heated_length + unheated_length_exit} n_cells = 20 [Mesh] - [subchannel] - type = SCMDetailedQuadSubChannelMeshGenerator + [assembly] + type = SCMDetailedQuadAssemblyMeshGenerator nx = 3 ny = 3 n_cells = '${n_cells}' diff --git a/modules/subchannel/examples/mesh_generator/3d.i b/modules/subchannel/examples/mesh_generator/3d.i index e353f6c4cd8e..fb0deb7e1c4f 100644 --- a/modules/subchannel/examples/mesh_generator/3d.i +++ b/modules/subchannel/examples/mesh_generator/3d.i @@ -1,6 +1,6 @@ [Mesh] - [subchannel] - type = SCMDetailedQuadSubChannelMeshGenerator + [assembly] + type = SCMDetailedQuadAssemblyMeshGenerator nx = 6 ny = 6 n_cells = 20 diff --git a/modules/subchannel/examples/mesh_generator/psbt_mesh_generator_test.i b/modules/subchannel/examples/mesh_generator/psbt_mesh_generator_test.i index d11db2535a78..9a99b98c22ef 100644 --- a/modules/subchannel/examples/mesh_generator/psbt_mesh_generator_test.i +++ b/modules/subchannel/examples/mesh_generator/psbt_mesh_generator_test.i @@ -5,7 +5,7 @@ P_out = 4.923e6 # Pa [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 6 ny = 6 n_cells = 20 @@ -16,36 +16,26 @@ P_out = 4.923e6 # Pa spacer_z = '0.5' spacer_k = '0.5' [] - - [fuel_pins] - type = SCMQuadPinMeshGenerator - input = sub_channel - nx = 6 - ny = 6 - n_cells = 20 - pitch = 0.0126 - heated_length = 1.00 - [] [] [AuxVariables] [mdot] - block = sub_channel + block = subchannel [] [SumWij] - block = sub_channel + block = subchannel [] [P] - block = sub_channel + block = subchannel [] [DP] - block = sub_channel + block = subchannel [] [h] - block = sub_channel + block = subchannel [] [T] - block = sub_channel + block = subchannel [] [Tpin] block = fuel_pins @@ -54,19 +44,19 @@ P_out = 4.923e6 # Pa block = fuel_pins [] [rho] - block = sub_channel + block = subchannel [] [mu] - block = sub_channel + block = subchannel [] [S] - block = sub_channel + block = subchannel [] [w_perim] - block = sub_channel + block = subchannel [] [q_prime] - block = sub_channel + block = subchannel [] [] diff --git a/modules/subchannel/examples/mesh_generator/tests b/modules/subchannel/examples/mesh_generator/tests index 40f7564fabaf..c5756d5755c6 100644 --- a/modules/subchannel/examples/mesh_generator/tests +++ b/modules/subchannel/examples/mesh_generator/tests @@ -1,5 +1,5 @@ [Tests] - design = 'SCMQuadSubChannelMeshGenerator.md' + design = 'SCMQuadAssemblyMeshGenerator.md' issues = '#28497' [check_syntax_psbt] type = 'RunApp' diff --git a/modules/subchannel/include/auxkernels/SCMQuadPowerAux.h b/modules/subchannel/include/auxkernels/SCMQuadPowerAux.h index c5eb296cc83e..49c567e08ab6 100644 --- a/modules/subchannel/include/auxkernels/SCMQuadPowerAux.h +++ b/modules/subchannel/include/auxkernels/SCMQuadPowerAux.h @@ -34,7 +34,7 @@ class SCMQuadPowerAux : public AuxKernel unsigned int _numberoflines; /// The name of the radial power profile file std::string _filename; - /// matrix that holds the values of the relative pin power + /// Matrix that holds the relative pin power Eigen::MatrixXd _power_dis; const Function & _axial_heat_rate; /// Average linear heat rate over the whole pin [W/m] diff --git a/modules/subchannel/include/ics/SCMQuadPowerIC.h b/modules/subchannel/include/ics/SCMQuadPowerIC.h index 99f574f10607..8de35006e6c6 100644 --- a/modules/subchannel/include/ics/SCMQuadPowerIC.h +++ b/modules/subchannel/include/ics/SCMQuadPowerIC.h @@ -30,7 +30,7 @@ class SCMQuadPowerIC : public QuadSubChannelBaseIC unsigned int _numberoflines; /// The name of the radial power profile file std::string _filename; - /// matrix that holds the values of the relative pin power + /// Matrix that holds the relative pin power Eigen::MatrixXd _power_dis; const Function & _axial_heat_rate; /// Average linear heat rate over the whole pin [W/m] diff --git a/modules/subchannel/include/mesh/QuadSubChannelMesh.h b/modules/subchannel/include/mesh/QuadSubChannelMesh.h index f4e220114fb6..1fe381e35ccf 100644 --- a/modules/subchannel/include/mesh/QuadSubChannelMesh.h +++ b/modules/subchannel/include/mesh/QuadSubChannelMesh.h @@ -151,7 +151,6 @@ class QuadSubChannelMesh : public SubChannelMesh static void generatePinCenters( unsigned int nx, unsigned int ny, Real pitch, Real elev, std::vector & pin_centers); - friend class SCMQuadSubChannelMeshGenerator; - friend class SCMQuadPinMeshGenerator; friend class QuadSubChannel1PhaseProblem; + friend class SCMQuadAssemblyMeshGenerator; }; diff --git a/modules/subchannel/include/mesh/SubChannelMesh.h b/modules/subchannel/include/mesh/SubChannelMesh.h index 8a19352b179c..ad5d60b61409 100644 --- a/modules/subchannel/include/mesh/SubChannelMesh.h +++ b/modules/subchannel/include/mesh/SubChannelMesh.h @@ -261,4 +261,6 @@ class SubChannelMesh : public MooseMesh Real unheated_length_exit, unsigned int n_cells, std::vector & z_grid); + + friend class SCMQuadAssemblyMeshGenerator; }; diff --git a/modules/subchannel/include/mesh/TriSubChannelMesh.h b/modules/subchannel/include/mesh/TriSubChannelMesh.h index 5ada5c375d0a..b66acf9a1ce5 100644 --- a/modules/subchannel/include/mesh/TriSubChannelMesh.h +++ b/modules/subchannel/include/mesh/TriSubChannelMesh.h @@ -41,7 +41,7 @@ class TriSubChannelMesh : public SubChannelMesh const Real & getDuctToPinGap() const { return _duct_to_pin_gap; } /** - * Return the number of rings + * Return the number of fuel-pin rings, counting the center pin as the first ring */ const unsigned int & getNumOfRings() const { return _n_rings; } @@ -131,7 +131,7 @@ class TriSubChannelMesh : public SubChannelMesh unsigned int pinIndex(const Point & p) const override; protected: - /// number of rings of fuel pins + /// number of fuel-pin rings, counting the center pin as the first ring unsigned int _n_rings; /// number of subchannels unsigned int _n_channels; @@ -204,10 +204,9 @@ class TriSubChannelMesh : public SubChannelMesh static void pinPositions(std::vector & positions, unsigned int nrings, Real pitch, Point center); - friend class SCMTriSubChannelMeshGenerator; + friend class SCMTriAssemblyMeshGenerator; friend class SCMTriDuctMeshGenerator; - friend class SCMTriPinMeshGenerator; - friend class SCMDetailedTriPinMeshGenerator; + friend class SCMDetailedTriAssemblyMeshGenerator; friend class TriSubChannel1PhaseProblem; /// number of corners in the duct x-sec diff --git a/modules/subchannel/include/meshgenerators/DetailedPinMeshGeneratorBase.h b/modules/subchannel/include/meshgenerators/DetailedPinMeshGeneratorBase.h deleted file mode 100644 index 77199307a679..000000000000 --- a/modules/subchannel/include/meshgenerators/DetailedPinMeshGeneratorBase.h +++ /dev/null @@ -1,48 +0,0 @@ -//* 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 "MeshGenerator.h" - -/** - * Base class for generating fuel pins - */ -class DetailedPinMeshGeneratorBase : public MeshGenerator -{ -public: - DetailedPinMeshGeneratorBase(const InputParameters & parameters); - -protected: - void generatePin(std::unique_ptr & mesh_base, const Point & center); - - /// unheated length of the fuel Pin at the entry of the assembly - const Real _unheated_length_entry; - /// heated length of the fuel Pin - const Real _heated_length; - /// unheated length of the fuel Pin at the exit of the assembly - const Real _unheated_length_exit; - /// axial location of nodes - std::vector _z_grid; - /// Distance between the neighbor fuel pins, pitch - const Real _pitch; - /// fuel Pin diameter - const Real _pin_diameter; - /// Number of cells in the axial direction - const unsigned int _n_cells; - /// Subdomain ID used for the mesh block - const unsigned int & _block_id; - /// Number of radial parts - const unsigned int & _num_radial_parts; - /// Counter for element numbering - dof_id_type _elem_id; - -public: - static InputParameters validParams(); -}; diff --git a/modules/subchannel/include/meshgenerators/SCMDetailedQuadSubChannelMeshGenerator.h b/modules/subchannel/include/meshgenerators/SCMDetailedQuadAssemblyMeshGenerator.h similarity index 75% rename from modules/subchannel/include/meshgenerators/SCMDetailedQuadSubChannelMeshGenerator.h rename to modules/subchannel/include/meshgenerators/SCMDetailedQuadAssemblyMeshGenerator.h index 5f3ec09b4fc2..c34518e2d196 100644 --- a/modules/subchannel/include/meshgenerators/SCMDetailedQuadSubChannelMeshGenerator.h +++ b/modules/subchannel/include/meshgenerators/SCMDetailedQuadAssemblyMeshGenerator.h @@ -13,17 +13,18 @@ #include "SubChannelEnums.h" /** - * Mesh generator that builds a 3D mesh representing quadrilateral subchannels + * Mesh generator that builds a detailed 3D mesh representing quadrilateral subchannels and pins */ -class SCMDetailedQuadSubChannelMeshGenerator : public MeshGenerator +class SCMDetailedQuadAssemblyMeshGenerator : public MeshGenerator { public: - SCMDetailedQuadSubChannelMeshGenerator(const InputParameters & parameters); + SCMDetailedQuadAssemblyMeshGenerator(const InputParameters & parameters); virtual std::unique_ptr generate() override; protected: EChannelType getSubchannelType(unsigned int index) const { return _subch_type[index]; } - std::vector getSubchannelPosition(unsigned int i) { return _subchannel_position[i]; } + + void generatePin(std::unique_ptr & mesh_base, const Point & center); /// unheated length of the fuel Pin at the entry of the assembly const Real _unheated_length_entry; @@ -51,12 +52,17 @@ class SCMDetailedQuadSubChannelMeshGenerator : public MeshGenerator * distance(edge pin center, duct wall) = pitch / 2 + side_gap [m]. */ const Real _side_gap; + /// Number of radial parts in each pin cross section + const unsigned int _num_radial_parts; + /// Subdomain IDs used for mesh blocks + const unsigned int _subchannel_block_id; + const unsigned int _pin_block_id; /// Subchannel type std::vector _subch_type; /// x,y coordinates of the subchannel centroids std::vector> _subchannel_position; - /// Subdomain ID used for the mesh block - const unsigned int & _block_id; + /// Counter for element numbering + dof_id_type _elem_id; public: static InputParameters validParams(); diff --git a/modules/subchannel/include/meshgenerators/SCMDetailedQuadPinMeshGenerator.h b/modules/subchannel/include/meshgenerators/SCMDetailedQuadPinMeshGenerator.h deleted file mode 100644 index 2018589cc524..000000000000 --- a/modules/subchannel/include/meshgenerators/SCMDetailedQuadPinMeshGenerator.h +++ /dev/null @@ -1,34 +0,0 @@ -//* 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 "DetailedPinMeshGeneratorBase.h" - -/** - * Mesh generator for fuel pins in a quadrilateral lattice - */ -class SCMDetailedQuadPinMeshGenerator : public DetailedPinMeshGeneratorBase -{ -public: - SCMDetailedQuadPinMeshGenerator(const InputParameters & parameters); - - virtual std::unique_ptr generate() override; - -protected: - /// Mesh that comes from another generator - std::unique_ptr & _input; - /// Number of subchannels in the x direction - const unsigned int & _nx; - /// Number of subchannels in the y direction - const unsigned int & _ny; - -public: - static InputParameters validParams(); -}; diff --git a/modules/subchannel/include/meshgenerators/SCMDetailedTriSubChannelMeshGenerator.h b/modules/subchannel/include/meshgenerators/SCMDetailedTriAssemblyMeshGenerator.h similarity index 81% rename from modules/subchannel/include/meshgenerators/SCMDetailedTriSubChannelMeshGenerator.h rename to modules/subchannel/include/meshgenerators/SCMDetailedTriAssemblyMeshGenerator.h index 8ad83ea885cc..c897854fc549 100644 --- a/modules/subchannel/include/meshgenerators/SCMDetailedTriSubChannelMeshGenerator.h +++ b/modules/subchannel/include/meshgenerators/SCMDetailedTriAssemblyMeshGenerator.h @@ -13,19 +13,19 @@ #include "SubChannelEnums.h" /** - * Mesh generator that builds a 3D mesh representing triangular subchannels + * Mesh generator that builds a 3D mesh representing triangular subchannels and pins */ -class SCMDetailedTriSubChannelMeshGenerator : public MeshGenerator +class SCMDetailedTriAssemblyMeshGenerator : public MeshGenerator { public: - SCMDetailedTriSubChannelMeshGenerator(const InputParameters & parameters); + SCMDetailedTriAssemblyMeshGenerator(const InputParameters & parameters); virtual std::unique_ptr generate() override; protected: /// returns the type of the subchannel given the index EChannelType getSubchannelType(unsigned int index) const { return _subch_type[index]; } Point rotatePoint(Point b, Real theta); - Point translatePoint(Point & b, Point & translation_vector); + void generatePin(std::unique_ptr & mesh_base, const Point & center); /// returns the position of pin given pin index Point getPinPosition(unsigned int i) { return _pin_position[i]; } /// returns the position of subchannel given pin index @@ -49,14 +49,20 @@ class SCMDetailedTriSubChannelMeshGenerator : public MeshGenerator const unsigned int _n_rings; /// Half of gap between adjacent assemblies const Real _flat_to_flat; + /// Number of radial parts in each pin cross section + const unsigned int _num_radial_parts; /// Subchannel type std::vector _subch_type; /// x,y coordinates of the fuel pins std::vector _pin_position; + /// Pin nodes + std::vector> _pin_nodes; /// x,y coordinates of the subchannels std::vector> _subchannel_position; - /// Subdomain ID used for the mesh block - const unsigned int & _block_id; + /// Subchannel subdomain ID + const unsigned int _subchannel_block_id; + /// Pin subdomain ID + const unsigned int _pin_block_id; /// Number of cells in the axial direction const unsigned int _n_cells; /// Number of pins @@ -71,6 +77,8 @@ class SCMDetailedTriSubChannelMeshGenerator : public MeshGenerator std::vector> _chan_to_pin_map; /// Flag to print out the detailed mesh assembly and coordinates const bool _verbose; + /// counter for element numbering + dof_id_type _elem_id; public: static InputParameters validParams(); diff --git a/modules/subchannel/include/meshgenerators/SCMDetailedTriPinMeshGenerator.h b/modules/subchannel/include/meshgenerators/SCMDetailedTriPinMeshGenerator.h deleted file mode 100644 index 410e7f0e2ca1..000000000000 --- a/modules/subchannel/include/meshgenerators/SCMDetailedTriPinMeshGenerator.h +++ /dev/null @@ -1,32 +0,0 @@ -//* 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 "DetailedPinMeshGeneratorBase.h" - -/** - * Mesh generator for fuel pins in a triangular lattice - */ -class SCMDetailedTriPinMeshGenerator : public DetailedPinMeshGeneratorBase -{ -public: - SCMDetailedTriPinMeshGenerator(const InputParameters & parameters); - - virtual std::unique_ptr generate() override; - -protected: - /// Mesh that comes from another generator - std::unique_ptr & _input; - /// Number of rings in the fuel assembly - const unsigned int & _n_rings; - -public: - static InputParameters validParams(); -}; diff --git a/modules/subchannel/include/meshgenerators/SCMQuadAssemblyMeshGenerator.h b/modules/subchannel/include/meshgenerators/SCMQuadAssemblyMeshGenerator.h new file mode 100644 index 000000000000..0f54c5ee4e0f --- /dev/null +++ b/modules/subchannel/include/meshgenerators/SCMQuadAssemblyMeshGenerator.h @@ -0,0 +1,72 @@ +//* 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 "MeshGenerator.h" +#include "QuadSubChannelMesh.h" + +class SCMQuadAssemblyMeshGenerator : public MeshGenerator +{ +public: + static InputParameters validParams(); + + SCMQuadAssemblyMeshGenerator(const InputParameters & params); + + virtual std::unique_ptr generate() override; + +protected: + void initializeChannelData(); + void buildSubchannelMesh(MeshBase & mesh_base, BoundaryInfo & boundary_info); + void buildPinMesh(MeshBase & mesh_base); + void transferMetadata(QuadSubChannelMesh & sch_mesh); + +protected: + Real _unheated_length_entry; + Real _heated_length; + Real _unheated_length_exit; + + std::vector _spacer_z; + std::vector _spacer_k; + std::vector _z_blockage; + std::vector _index_blockage; + std::vector _reduction_blockage; + std::vector _k_blockage; + + Real _kij; + Real _pitch; + Real _pin_diameter; + unsigned int _n_cells; + unsigned int _nx; + unsigned int _ny; + unsigned int _n_channels; + unsigned int _n_gaps; + unsigned int _n_pins; + Real _side_gap; + + unsigned int _subchannel_block_id; + unsigned int _pin_block_id; + + std::vector _z_grid; + std::vector> _k_grid; + + std::vector> _nodes; + std::vector> _pin_nodes; + std::vector> _gapnodes; + + std::vector> _gap_to_chan_map; + std::vector> _gap_to_pin_map; + std::vector> _chan_to_gap_map; + std::vector> _chan_to_pin_map; + std::vector> _pin_to_chan_map; + std::vector> _sign_id_crossflow_map; + std::vector> _gij_map; + std::vector> _subchannel_position; + std::vector _subch_type; +}; diff --git a/modules/subchannel/include/meshgenerators/SCMQuadPinMeshGenerator.h b/modules/subchannel/include/meshgenerators/SCMQuadPinMeshGenerator.h deleted file mode 100644 index caad07aca90c..000000000000 --- a/modules/subchannel/include/meshgenerators/SCMQuadPinMeshGenerator.h +++ /dev/null @@ -1,51 +0,0 @@ -//* 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 "MeshGenerator.h" -#include "libmesh/point.h" -#include "SCMQuadSubChannelMeshGenerator.h" - -/** - * Class to create Pin mesh in the square lattice geometry - */ -class SCMQuadPinMeshGenerator : public MeshGenerator -{ -public: - SCMQuadPinMeshGenerator(const InputParameters & parameters); - std::unique_ptr generate() override; - -protected: - /// Mesh that comes from another generator - std::unique_ptr & _input; - /// unheated length of the fuel Pin at the entry of the assembly - const Real _unheated_length_entry; - /// heated length of the fuel Pin - const Real _heated_length; - /// unheated length of the fuel Pin at the exit of the assembly - const Real _unheated_length_exit; - /// axial location of nodes - std::vector _z_grid; - /// Distance between the neighbor fuel pins, pitch - const Real _pitch; - /// number of subchannels in the x direction - const unsigned int _nx; - /// number of subchannels in the y direction - const unsigned int _ny; - /// number of axial cells - const unsigned int _n_cells; - /// Pin nodes - std::vector> _pin_nodes; - /// block index - const unsigned int _block_id; - -public: - static InputParameters validParams(); -}; diff --git a/modules/subchannel/include/meshgenerators/SCMQuadSubChannelMeshGenerator.h b/modules/subchannel/include/meshgenerators/SCMQuadSubChannelMeshGenerator.h deleted file mode 100644 index 04d8bfa53956..000000000000 --- a/modules/subchannel/include/meshgenerators/SCMQuadSubChannelMeshGenerator.h +++ /dev/null @@ -1,99 +0,0 @@ -//* 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 -#include "MeshGenerator.h" -#include "libmesh/point.h" -#include "SubChannelEnums.h" - -/** - * Class for Subchannel mesh generation in the square lattice geometry - */ -class SCMQuadSubChannelMeshGenerator : public MeshGenerator -{ -public: - SCMQuadSubChannelMeshGenerator(const InputParameters & parameters); - std::unique_ptr generate() override; - -protected: - /// unheated length of the fuel Pin at the entry of the assembly - const Real _unheated_length_entry; - /// heated length of the fuel Pin - const Real _heated_length; - /// unheated length of the fuel Pin at the exit of the assembly - const Real _unheated_length_exit; - /// axial location of nodes - std::vector _z_grid; - /// axial form loss coefficient per computational cell - std::vector> _k_grid; - /// axial location of the spacers - const std::vector & _spacer_z; - /// form loss coefficient of the spacers - const std::vector & _spacer_k; - /// axial location of blockage (inlet, outlet) [m] - const std::vector _z_blockage; - /// index of subchannels affected by blockage - const std::vector _index_blockage; - /// area reduction of subchannels affected by blockage - const std::vector _reduction_blockage; - /// form loss coefficient of subchannels affected by blockage - const std::vector _k_blockage; - /// Lateral form loss coefficient - const Real & _kij; - /// Distance between the neighbor fuel pins, pitch - const Real _pitch; - /// fuel Pin diameter - const Real _pin_diameter; - /// number of axial cells - const unsigned int _n_cells; - /// number of axial blocks - unsigned int _n_blocks; - /// Number of subchannels in the x direction - const unsigned int _nx; - /// Number of subchannels in the y direction - const unsigned int _ny; - /// Total number of subchannels - const unsigned int _n_channels; - /// Number of gaps per layer - const unsigned int _n_gaps; - /// Number of pins - const unsigned int _n_pins; - /** - * The side gap, not to be confused with the gap between pins, this refers to the gap - * next to the duct or else the distance between the subchannel centroid to the duct wall. - * distance(edge pin center, duct wall) = pitch / 2 + side_gap [m]. - */ - const Real _side_gap; - /// block index - const unsigned int _block_id; - /// Channel nodes - std::vector> _nodes; - /// gap nodes - std::vector> _gapnodes; - std::vector> _gap_to_chan_map; - std::vector> _gap_to_pin_map; - std::vector> _chan_to_gap_map; - std::vector> _chan_to_pin_map; - std::vector> _pin_to_chan_map; - /// Matrix used to give local sign to crossflow quantities - std::vector> _sign_id_crossflow_map; - /// Vector to store gap size - std::vector> _gij_map; - /// x,y coordinates of the subchannel centroid - std::vector> _subchannel_position; - /// Subchannel type - std::vector _subch_type; - -public: - static InputParameters validParams(); - - friend class SCMQuadPinMeshGenerator; -}; diff --git a/modules/subchannel/include/meshgenerators/SCMTriSubChannelMeshGenerator.h b/modules/subchannel/include/meshgenerators/SCMTriAssemblyMeshGenerator.h similarity index 90% rename from modules/subchannel/include/meshgenerators/SCMTriSubChannelMeshGenerator.h rename to modules/subchannel/include/meshgenerators/SCMTriAssemblyMeshGenerator.h index 8497c8c4a62e..91d7091742ed 100644 --- a/modules/subchannel/include/meshgenerators/SCMTriSubChannelMeshGenerator.h +++ b/modules/subchannel/include/meshgenerators/SCMTriAssemblyMeshGenerator.h @@ -15,22 +15,26 @@ /** * Mesh class for triangular, edge and corner subchannels for hexagonal lattice fuel assemblies */ -class SCMTriSubChannelMeshGenerator : public MeshGenerator +class SCMTriAssemblyMeshGenerator : public MeshGenerator { public: - SCMTriSubChannelMeshGenerator(const InputParameters & parameters); + SCMTriAssemblyMeshGenerator(const InputParameters & parameters); std::unique_ptr generate() override; protected: + void buildPinMesh(MeshBase & mesh_base); + /// unheated length of the fuel Pin at the entry of the assembly const Real _unheated_length_entry; /// heated length of the fuel Pin const Real _heated_length; /// unheated length of the fuel Pin at the exit of the assembly const Real _unheated_length_exit; - /// block index - const unsigned int _block_id; + /// subchannel block index + const unsigned int _subchannel_block_id; + /// pin block index + const unsigned int _pin_block_id; /// axial location of nodes std::vector _z_grid; /// axial form loss coefficient per computational cell @@ -70,6 +74,8 @@ class SCMTriSubChannelMeshGenerator : public MeshGenerator /// nodes std::vector> _nodes; + /// pin nodes + std::vector> _pin_nodes; /// stores the channel pairs for each gap std::vector> _gap_to_chan_map; /// stores the fuel pin pairs for each gap each gap @@ -105,6 +111,8 @@ class SCMTriSubChannelMeshGenerator : public MeshGenerator std::vector> _gap_pairs_sf; /// sweeping flow model channel pairs to specify directional edge flow std::vector> _chan_pairs_sf; + /// counter for element numbering + dof_id_type _elem_id; public: static InputParameters validParams(); diff --git a/modules/subchannel/include/meshgenerators/SCMTriPinMeshGenerator.h b/modules/subchannel/include/meshgenerators/SCMTriPinMeshGenerator.h deleted file mode 100644 index 0c55bd26a2d0..000000000000 --- a/modules/subchannel/include/meshgenerators/SCMTriPinMeshGenerator.h +++ /dev/null @@ -1,50 +0,0 @@ -//* 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 "MeshGenerator.h" -#include "libmesh/point.h" - -/** - * Class to create Pin mesh in the square lattice geometry - */ -class SCMTriPinMeshGenerator : public MeshGenerator -{ -public: - SCMTriPinMeshGenerator(const InputParameters & parameters); - std::unique_ptr generate() override; - -protected: - /// Mesh that comes from another generator - std::unique_ptr & _input; - /// unheated length of the fuel Pin at the entry of the assembly - const Real _unheated_length_entry; - /// heated length of the fuel Pin - const Real _heated_length; - /// unheated length of the fuel Pin at the exit of the assembly - const Real _unheated_length_exit; - /// axial location of nodes - std::vector _z_grid; - /// Distance between the neighbor fuel pins, pitch - const Real _pitch; - /// number of subchannels in the x direction - const unsigned int _n_rings; - /// number of axial cells - const unsigned int _n_cells; - /// Pin nodes - std::vector> _pin_nodes; - /// block index - const unsigned int _block_id; - /// x-y positions of the fuel pins - std::vector _pin_position; - -public: - static InputParameters validParams(); -}; diff --git a/modules/subchannel/include/transfers/SCMPinSolutionTransfer.h b/modules/subchannel/include/transfers/SCMPinSolutionTransfer.h deleted file mode 100644 index 07b0ff2d181b..000000000000 --- a/modules/subchannel/include/transfers/SCMPinSolutionTransfer.h +++ /dev/null @@ -1,27 +0,0 @@ -//* 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 "SCMSolutionTransferBase.h" - -/** - * Transfers subchannel solution from computational mesh onto visualization mesh - */ -class SCMPinSolutionTransfer : public SCMSolutionTransferBase -{ -public: - SCMPinSolutionTransfer(const InputParameters & parameters); - -protected: - virtual Node * getFromNode(const SubChannelMesh & from_mesh, const Point & src_node); - -public: - static InputParameters validParams(); -}; diff --git a/modules/subchannel/include/transfers/SCMSolutionTransfer.h b/modules/subchannel/include/transfers/SCMSolutionTransfer.h index e130a69c35f5..0c62c483114e 100644 --- a/modules/subchannel/include/transfers/SCMSolutionTransfer.h +++ b/modules/subchannel/include/transfers/SCMSolutionTransfer.h @@ -9,18 +9,32 @@ #pragma once -#include "SCMSolutionTransferBase.h" +#include "MultiAppTransfer.h" + +class SubChannelMesh; /** - * Transfers subchannel solution from computational mesh onto visualization mesh + * Transfers subchannel or pin solutions from a SubChannel mesh onto a visualization mesh */ -class SCMSolutionTransfer : public SCMSolutionTransferBase +class SCMSolutionTransfer : public MultiAppTransfer { public: SCMSolutionTransfer(const InputParameters & parameters); + virtual void execute() override; + void initialSetup() override; + protected: - Node * getFromNode(const SubChannelMesh & from_mesh, const Point & src_node) override; + void transferToMultiApps(); + void transferVarsToApp(unsigned int app_idx); + void transferNodalVars(unsigned int app_idx); + Node * getFromNode(const SubChannelMesh & from_mesh, const Point & src_node); + + /// Variable names to transfer + const std::vector & _var_names; + + /// Whether pin fields should be transferred instead of subchannel fields + const bool _pin_transfer; public: static InputParameters validParams(); diff --git a/modules/subchannel/include/transfers/SCMSolutionTransferBase.h b/modules/subchannel/include/transfers/SCMSolutionTransferBase.h deleted file mode 100644 index 9cea5d9c0702..000000000000 --- a/modules/subchannel/include/transfers/SCMSolutionTransferBase.h +++ /dev/null @@ -1,56 +0,0 @@ -//* 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 "MultiAppTransfer.h" - -class SubChannelMesh; - -/** - * Base class for transfering solutions from computational mesh onto visualization mesh - */ -class SCMSolutionTransferBase : public MultiAppTransfer -{ -public: - SCMSolutionTransferBase(const InputParameters & parameters); - - virtual void execute() override; - void initialSetup() override; - -protected: - /** - * Do the transfer into the sub-app - */ - void transferToMultiApps(); - - /** - * Transfer variables into the sub-app - * - * @param app_idx Multi-app index - */ - void transferVarsToApp(unsigned int app_idx); - - void transferNodalVars(unsigned int app_idx); - - /** - * Find node on computational mesh given the visualization point - * - * @return Node from the computational mesh - * @param from_mesh Computational mesh - * @param src_node Node from the visualization - */ - virtual Node * getFromNode(const SubChannelMesh & from_mesh, const Point & src_node) = 0; - - /// Variable names to transfer - const std::vector & _var_names; - -public: - static InputParameters validParams(); -}; diff --git a/modules/subchannel/src/auxkernels/SCMQuadPowerAux.C b/modules/subchannel/src/auxkernels/SCMQuadPowerAux.C index 19bcc102154a..53d7ed8b1678 100644 --- a/modules/subchannel/src/auxkernels/SCMQuadPowerAux.C +++ b/modules/subchannel/src/auxkernels/SCMQuadPowerAux.C @@ -20,8 +20,8 @@ SCMQuadPowerAux::validParams() { InputParameters params = AuxKernel::validParams(); params.addClassDescription( - "Computes axial power rate (W/m) that goes into the subchannel cells " - "or is assigned to the fuel pins, in a quadrilateral lattice arrangement"); + "Computes axial power rate (W/m) assigned to the fuel pins in a quadrilateral lattice " + "arrangement"); params.addRequiredParam( "power", "The postprocessor or Real to use for the total power of the subassembly [W]"); params.addRequiredParam( @@ -44,12 +44,14 @@ SCMQuadPowerAux::SCMQuadPowerAux(const InputParameters & parameters) if (processor_id() > 0) return; - auto nx = _quadMesh.getNx(); - auto ny = _quadMesh.getNy(); + if (!_quadMesh.pinMeshExist()) + mooseError(name(), ": This object requires a pin mesh."); + + auto n_pins = _quadMesh.getNumOfPins(); // Matrix sizing - _power_dis.resize((ny - 1) * (nx - 1), 1); + _power_dis.resize(n_pins, 1); _power_dis.setZero(); - _pin_power_correction.resize((ny - 1) * (nx - 1), 1); + _pin_power_correction.resize(n_pins, 1); _pin_power_correction.setOnes(); Real vin; @@ -65,8 +67,8 @@ SCMQuadPowerAux::SCMQuadPowerAux(const InputParameters & parameters) if (inFile.fail() && !inFile.eof()) mooseError(name(), " non numerical input at line : ", _numberoflines); - if (_numberoflines != (ny - 1) * (nx - 1)) - mooseError(name(), " Radial profile file doesn't have correct size : ", (ny - 1) * (nx - 1)); + if (_numberoflines != n_pins) + mooseError(name(), " Radial profile file doesn't have correct size : ", n_pins); inFile.close(); inFile.open(_filename); @@ -86,9 +88,7 @@ SCMQuadPowerAux::initialSetup() if (processor_id() > 0) return; - auto nx = _quadMesh.getNx(); - auto ny = _quadMesh.getNy(); - auto n_pins = (nx - 1) * (ny - 1); + auto n_pins = _quadMesh.getNumOfPins(); auto nz = _quadMesh.getNumOfAxialCells(); auto z_grid = _quadMesh.getZGrid(); auto heated_length = _quadMesh.getHeatedLength(); @@ -169,31 +169,13 @@ SCMQuadPowerAux::computeValue() auto unheated_length_entry = _quadMesh.getHeatedLengthEntry(); Point p1(0, 0, unheated_length_entry); Point P = p - p1; - auto pin_mesh_exist = _quadMesh.pinMeshExist(); /// assign power to the nodes located within the heated section if (MooseUtils::absoluteFuzzyGreaterEqual(p(2), unheated_length_entry) && MooseUtils::absoluteFuzzyLessEqual(p(2), unheated_length_entry + heated_length)) { - if (pin_mesh_exist) - { - // project axial heat rate on pins - auto i_pin = _quadMesh.getPinIndexFromPoint(p); - return _ref_qprime(i_pin) * _pin_power_correction(i_pin) * _axial_heat_rate.value(_t, P); - } - else - { - // project axial heat rate on subchannels - auto i_ch = _quadMesh.getSubchannelIndexFromPoint(p); - // if we are adjacent to the heated part of the fuel Pin - auto heat_rate = 0.0; - for (auto i_pin : _quadMesh.getChannelPins(i_ch)) - { - heat_rate += 0.25 * _ref_qprime(i_pin) * _pin_power_correction(i_pin) * - _axial_heat_rate.value(_t, P); - } - return heat_rate; - } + auto i_pin = _quadMesh.getPinIndexFromPoint(p); + return _ref_qprime(i_pin) * _pin_power_correction(i_pin) * _axial_heat_rate.value(_t, P); } else return 0.0; diff --git a/modules/subchannel/src/auxkernels/SCMTriPowerAux.C b/modules/subchannel/src/auxkernels/SCMTriPowerAux.C index 5f7fecabcba1..d7ffa1efc0e2 100644 --- a/modules/subchannel/src/auxkernels/SCMTriPowerAux.C +++ b/modules/subchannel/src/auxkernels/SCMTriPowerAux.C @@ -20,8 +20,8 @@ SCMTriPowerAux::validParams() { InputParameters params = AuxKernel::validParams(); params.addClassDescription( - "Computes axial power rate (W/m) that goes into the subchannel cells " - "or is assigned to the fuel pins, in a triangular lattice arrangement"); + "Computes axial power rate (W/m) assigned to the fuel pins in a triangular lattice " + "arrangement"); params.addRequiredParam( "power", "The postprocessor or Real to use for the total power of the subassembly [W]"); params.addRequiredParam( @@ -43,6 +43,9 @@ SCMTriPowerAux::SCMTriPowerAux(const InputParameters & parameters) { if (processor_id() > 0) return; + if (!_triMesh.pinMeshExist()) + mooseError(name(), ": This object requires a pin mesh."); + auto n_pins = _triMesh.getNumOfPins(); // Matrix sizing _power_dis.resize(n_pins, 1); @@ -159,53 +162,17 @@ Real SCMTriPowerAux::computeValue() { Point p = *_current_node; - auto heat_rate = 0.0; auto heated_length = _triMesh.getHeatedLength(); auto unheated_length_entry = _triMesh.getHeatedLengthEntry(); Point p1(0, 0, unheated_length_entry); Point P = p - p1; - auto pin_triMesh_exist = _triMesh.pinMeshExist(); /// assign power to the nodes located within the heated section if (MooseUtils::absoluteFuzzyGreaterEqual(p(2), unheated_length_entry) && MooseUtils::absoluteFuzzyLessEqual(p(2), unheated_length_entry + heated_length)) { - if (pin_triMesh_exist) - { - // project axial heat rate on pins - auto i_pin = _triMesh.getPinIndexFromPoint(p); - return _ref_qprime(i_pin) * _pin_power_correction(i_pin) * _axial_heat_rate.value(_t, P); - } - else - { - // Determine which subchannel this point is in. - auto i_ch = _triMesh.getSubchannelIndexFromPoint(p); - auto subch_type = _triMesh.getSubchannelType(i_ch); - // project axial heat rate on subchannels - { - double factor; - switch (subch_type) - { - case EChannelType::CENTER: - factor = 1.0 / 6.0; - break; - case EChannelType::EDGE: - factor = 1.0 / 4.0; - break; - case EChannelType::CORNER: - factor = 1.0 / 6.0; - break; - default: - return 0.0; // handle invalid subch_type if needed - } - for (auto i_pin : _triMesh.getChannelPins(i_ch)) - { - heat_rate += factor * _ref_qprime(i_pin) * _pin_power_correction(i_pin) * - _axial_heat_rate.value(_t, P); - } - return heat_rate; - } - } + auto i_pin = _triMesh.getPinIndexFromPoint(p); + return _ref_qprime(i_pin) * _pin_power_correction(i_pin) * _axial_heat_rate.value(_t, P); } else return 0.0; diff --git a/modules/subchannel/src/ics/SCMQuadPowerIC.C b/modules/subchannel/src/ics/SCMQuadPowerIC.C index 9c5bace348d8..ed5a3df2c576 100644 --- a/modules/subchannel/src/ics/SCMQuadPowerIC.C +++ b/modules/subchannel/src/ics/SCMQuadPowerIC.C @@ -21,8 +21,8 @@ InputParameters SCMQuadPowerIC::validParams() { InputParameters params = QuadSubChannelBaseIC::validParams(); - params.addClassDescription("Computes axial heat rate (W/m) that goes into the subchannel cells " - "or is assigned to the fuel pins, in a square lattice arrangement"); + params.addClassDescription("Computes axial heat rate (W/m) assigned to the fuel pins in a square " + "lattice arrangement"); // params.addRequiredParam("power", "The total power of the subassembly [W]"); params.addRequiredParam( "power", "The postprocessor or Real to use for the total power of the subassembly [W]"); @@ -46,13 +46,15 @@ SCMQuadPowerIC::SCMQuadPowerIC(const InputParameters & params) if (processor_id() > 0) return; - auto nx = _mesh.getNx(); - auto ny = _mesh.getNy(); + if (!_mesh.pinMeshExist()) + mooseError(name(), ": This object requires a pin mesh."); + + auto n_pins = _mesh.getNumOfPins(); auto heated_length = _mesh.getHeatedLength(); - _power_dis.resize((ny - 1) * (nx - 1), 1); + _power_dis.resize(n_pins, 1); _power_dis.setZero(); - _pin_power_correction.resize((ny - 1) * (nx - 1), 1); + _pin_power_correction.resize(n_pins, 1); _pin_power_correction.setOnes(); Real vin; @@ -68,8 +70,8 @@ SCMQuadPowerIC::SCMQuadPowerIC(const InputParameters & params) if (inFile.fail() && !inFile.eof()) mooseError(name(), " non numerical input at line : ", _numberoflines); - if (_numberoflines != (ny - 1) * (nx - 1)) - mooseError(name(), " Radial profile file doesn't have correct size : ", (ny - 1) * (nx - 1)); + if (_numberoflines != n_pins) + mooseError(name(), " Radial profile file doesn't have correct size : ", n_pins); inFile.close(); inFile.open(_filename); @@ -96,9 +98,7 @@ SCMQuadPowerIC::initialSetup() { if (processor_id() > 0) return; - auto nx = _mesh.getNx(); - auto ny = _mesh.getNy(); - auto n_pins = (nx - 1) * (ny - 1); + auto n_pins = _mesh.getNumOfPins(); auto nz = _mesh.getNumOfAxialCells(); auto z_grid = _mesh.getZGrid(); auto heated_length = _mesh.getHeatedLength(); @@ -169,31 +169,13 @@ SCMQuadPowerIC::value(const Point & p) auto unheated_length_entry = _mesh.getHeatedLengthEntry(); Point p1(0, 0, unheated_length_entry); Point P = p - p1; - auto pin_mesh_exist = _mesh.pinMeshExist(); /// assign power to the nodes located within the heated section if (MooseUtils::absoluteFuzzyGreaterEqual(p(2), unheated_length_entry) && MooseUtils::absoluteFuzzyLessEqual(p(2), unheated_length_entry + heated_length)) { - if (pin_mesh_exist) - { - // project axial heat rate on pins - auto i_pin = _mesh.getPinIndexFromPoint(p); - return _ref_qprime(i_pin) * _pin_power_correction(i_pin) * _axial_heat_rate.value(_t, P); - } - else - { - // project axial heat rate on subchannels - auto i_ch = _mesh.getSubchannelIndexFromPoint(p); - // if we are adjacent to the heated part of the fuel Pin - auto heat_rate = 0.0; - for (auto i_pin : _mesh.getChannelPins(i_ch)) - { - heat_rate += 0.25 * _ref_qprime(i_pin) * _pin_power_correction(i_pin) * - _axial_heat_rate.value(_t, P); - } - return heat_rate; - } + auto i_pin = _mesh.getPinIndexFromPoint(p); + return _ref_qprime(i_pin) * _pin_power_correction(i_pin) * _axial_heat_rate.value(_t, P); } else return 0.0; diff --git a/modules/subchannel/src/ics/SCMTriPowerIC.C b/modules/subchannel/src/ics/SCMTriPowerIC.C index a342e35ac0db..1730ae550597 100644 --- a/modules/subchannel/src/ics/SCMTriPowerIC.C +++ b/modules/subchannel/src/ics/SCMTriPowerIC.C @@ -19,8 +19,8 @@ SCMTriPowerIC::validParams() { InputParameters params = TriSubChannelBaseIC::validParams(); params.addClassDescription( - "Computes axial power rate (W/m) that goes into the subchannel cells " - "or is assigned to the fuel pins, in a triangular lattice arrangement"); + "Computes axial power rate (W/m) assigned to the fuel pins in a triangular lattice " + "arrangement"); params.addRequiredParam( "power", "The postprocessor or Real to use for the total power of the subassembly [W]"); params.addRequiredParam( @@ -42,6 +42,9 @@ SCMTriPowerIC::SCMTriPowerIC(const InputParameters & params) if (processor_id() > 0) return; + if (!_mesh.pinMeshExist()) + mooseError(name(), ": This object requires a pin mesh."); + auto n_pins = _mesh.getNumOfPins(); auto heated_length = _mesh.getHeatedLength(); @@ -157,53 +160,17 @@ SCMTriPowerIC::initialSetup() Real SCMTriPowerIC::value(const Point & p) { - auto heat_rate = 0.0; auto heated_length = _mesh.getHeatedLength(); auto unheated_length_entry = _mesh.getHeatedLengthEntry(); Point p1(0, 0, unheated_length_entry); Point P = p - p1; - auto pin_mesh_exist = _mesh.pinMeshExist(); /// assign power to the nodes located inside the heated section if (MooseUtils::absoluteFuzzyGreaterEqual(p(2), unheated_length_entry) && MooseUtils::absoluteFuzzyLessEqual(p(2), unheated_length_entry + heated_length)) { - if (pin_mesh_exist) - { - // project axial heat rate on pins - auto i_pin = _mesh.getPinIndexFromPoint(p); - return _ref_qprime(i_pin) * _pin_power_correction(i_pin) * _axial_heat_rate.value(_t, P); - } - else - { - // Determine which subchannel this point is in. - auto i_ch = _mesh.getSubchannelIndexFromPoint(p); - auto subch_type = _mesh.getSubchannelType(i_ch); - // project axial heat rate on subchannels - { - double factor; - switch (subch_type) - { - case EChannelType::CENTER: - factor = 1.0 / 6.0; - break; - case EChannelType::EDGE: - factor = 1.0 / 4.0; - break; - case EChannelType::CORNER: - factor = 1.0 / 6.0; - break; - default: - return 0.0; // handle invalid subch_type if needed - } - for (auto i_pin : _mesh.getChannelPins(i_ch)) - { - heat_rate += factor * _ref_qprime(i_pin) * _pin_power_correction(i_pin) * - _axial_heat_rate.value(_t, P); - } - return heat_rate; - } - } + auto i_pin = _mesh.getPinIndexFromPoint(p); + return _ref_qprime(i_pin) * _pin_power_correction(i_pin) * _axial_heat_rate.value(_t, P); } else return 0.0; diff --git a/modules/subchannel/src/mesh/QuadSubChannelMesh.C b/modules/subchannel/src/mesh/QuadSubChannelMesh.C index 4d2196ba0981..da9e645c44cc 100644 --- a/modules/subchannel/src/mesh/QuadSubChannelMesh.C +++ b/modules/subchannel/src/mesh/QuadSubChannelMesh.C @@ -97,6 +97,9 @@ QuadSubChannelMesh::channelIndex(const Point & pt) const unsigned int QuadSubChannelMesh::getPinIndexFromPoint(const Point & p) const { + if (_n_pins == 0) + mooseError(name(), ": Cannot compute a pin index because this mesh has no pins."); + Real offset_x = (_nx - 2) * _pitch / 2.0; Real offset_y = (_ny - 2) * _pitch / 2.0; unsigned int i = (p(0) + offset_x) / _pitch; @@ -107,6 +110,9 @@ QuadSubChannelMesh::getPinIndexFromPoint(const Point & p) const unsigned int QuadSubChannelMesh::pinIndex(const Point & p) const { + if (_n_pins == 0) + mooseError(name(), ": Cannot compute a pin index because this mesh has no pins."); + Real offset_x = (_nx - 2) * _pitch / 2.0; Real offset_y = (_ny - 2) * _pitch / 2.0; unsigned int i = (p(0) + offset_x) / _pitch; diff --git a/modules/subchannel/src/mesh/TriSubChannelMesh.C b/modules/subchannel/src/mesh/TriSubChannelMesh.C index 606b79548dd2..15ab8fa3bd9b 100644 --- a/modules/subchannel/src/mesh/TriSubChannelMesh.C +++ b/modules/subchannel/src/mesh/TriSubChannelMesh.C @@ -33,6 +33,7 @@ TriSubChannelMesh::TriSubChannelMesh(const TriSubChannelMesh & other_mesh) _hwire(other_mesh._hwire), _duct_to_pin_gap(other_mesh._duct_to_pin_gap), _nodes(other_mesh._nodes), + _pin_nodes(other_mesh._pin_nodes), _gap_to_chan_map(other_mesh._gap_to_chan_map), _gap_to_pin_map(other_mesh._gap_to_pin_map), _chan_to_gap_map(other_mesh._chan_to_gap_map), @@ -81,17 +82,15 @@ TriSubChannelMesh::channelIndex(const Point & p) const // subchannel Real distance_outer_ring = _flat_to_flat / 2 - _duct_to_pin_gap - _pin_diameter / 2; Real channel_distance = std::sqrt(std::pow(p(0), 2) + std::pow(p(1), 2)); - Real angle = std::abs(std::atan(p(1) / p(0))); + Real angle = std::abs(std::atan2(p(1), p(0))); Real projection_angle = angle - libMesh::pi / 6 - std::trunc(angle / (libMesh::pi / 3)) * (libMesh::pi / 3); channel_distance = channel_distance * std::cos(projection_angle); // Projecting point on top edge to determine if the point is a corner or edge subchannel by x // coordinate - Real loc_angle = std::atan(p(1) / p(0)); - if (p(0) <= 0) - loc_angle += libMesh::pi; - else if (p(0) >= 0 && p(1) <= 0) + Real loc_angle = std::atan2(p(1), p(0)); + if (loc_angle < 0.0) loc_angle += 2 * libMesh::pi; Real rem_ang = std::trunc(loc_angle / (libMesh::pi / 3)) * (libMesh::pi / 3) - libMesh::pi / 3; Real x_coord_new = (std::cos(-rem_ang) * p(0) - std::sin(-rem_ang) * p(1)); @@ -100,46 +99,36 @@ TriSubChannelMesh::channelIndex(const Point & p) const // looping over all channels for (unsigned int i = 0; i < _n_channels; i++) { + // Distance from the point to subchannel + distance1 = std::sqrt(std::pow((p(0) - _subchannel_position[i][0]), 2.0) + + std::pow((p(1) - _subchannel_position[i][1]), 2.0)); - if (_n_rings == 1) + // If subchannel belongs to center ring + if (channel_distance < distance_outer_ring) { - Real angle = std::atan(p(1) / p(0)); - if ((i * libMesh::pi / 6.0 < angle) && (angle <= (i + 1) * libMesh::pi / 6.0)) - return i; - } + if ((distance1 < distance0) && (_subch_type[i] == EChannelType::CENTER)) + { + j = i; + distance0 = distance1; + } // if + } // if + // If subchannel belongs to outer ring else { - // Distance from the point to subchannel - distance1 = std::sqrt(std::pow((p(0) - _subchannel_position[i][0]), 2.0) + - std::pow((p(1) - _subchannel_position[i][1]), 2.0)); - - // If subchannel belongs to center ring - if (channel_distance < distance_outer_ring) + if ((distance1 < distance0) && + (_subch_type[i] == EChannelType::EDGE || _subch_type[i] == EChannelType::CORNER)) { - if ((distance1 < distance0) && (_subch_type[i] == EChannelType::CENTER)) + if (((x_coord_new > x_lim) || (x_coord_new < -x_lim)) && + _subch_type[i] == EChannelType::CORNER) { j = i; distance0 = distance1; } // if - } // if - // If subchannel belongs to outer ring - else - { - if ((distance1 < distance0) && - (_subch_type[i] == EChannelType::EDGE || _subch_type[i] == EChannelType::CORNER)) + else if ((x_coord_new <= x_lim && x_coord_new >= -x_lim) && + _subch_type[i] == EChannelType::EDGE) { - if (((x_coord_new > x_lim) || (x_coord_new < -x_lim)) && - _subch_type[i] == EChannelType::CORNER) - { - j = i; - distance0 = distance1; - } // if - else if (((x_coord_new > x_lim) || (x_coord_new > -x_lim)) && - _subch_type[i] == EChannelType::EDGE) - { - j = i; - distance0 = distance1; - } + j = i; + distance0 = distance1; } } } @@ -204,7 +193,7 @@ TriSubChannelMesh::pinPositions(std::vector & positions, Real theta_corrected = 0.0; Real pi = libMesh::pi; unsigned int k = 0; - positions.emplace_back(0.0, 0.0); + positions.emplace_back(center(0), center(1)); for (unsigned int i = 1; i < nrings; i++) { dtheta = 2.0 * pi / (i * 6); diff --git a/modules/subchannel/src/meshgenerators/DetailedPinMeshGeneratorBase.C b/modules/subchannel/src/meshgenerators/DetailedPinMeshGeneratorBase.C deleted file mode 100644 index 97bb70e35b6f..000000000000 --- a/modules/subchannel/src/meshgenerators/DetailedPinMeshGeneratorBase.C +++ /dev/null @@ -1,96 +0,0 @@ -//* 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 - -#include "DetailedPinMeshGeneratorBase.h" -#include "libmesh/cell_prism6.h" - -InputParameters -DetailedPinMeshGeneratorBase::validParams() -{ - InputParameters params = MeshGenerator::validParams(); - params.addClassDescription( - "Base Class used to create the detailed pin mesh in a square lattice arrangement"); - params.addRequiredParam("pitch", "Pitch [m]"); - params.addRequiredParam("pin_diameter", "Rod diameter [m]"); - params.addParam("unheated_length_entry", 0.0, "Unheated length at entry [m]"); - params.addRequiredParam("heated_length", "Heated length [m]"); - params.addParam("unheated_length_exit", 0.0, "Unheated length at exit [m]"); - params.addRequiredParam("n_cells", "The number of cells in the axial direction"); - params.addParam("block_id", 1, "Block ID used for the mesh subdomain."); - params.addRangeCheckedParam("num_radial_parts", - 16, - "num_radial_parts>=4", - "Number of radial parts (must be at least 4)."); - return params; -} - -DetailedPinMeshGeneratorBase::DetailedPinMeshGeneratorBase(const InputParameters & parameters) - : MeshGenerator(parameters), - _unheated_length_entry(getParam("unheated_length_entry")), - _heated_length(getParam("heated_length")), - _unheated_length_exit(getParam("unheated_length_exit")), - _pitch(getParam("pitch")), - _pin_diameter(getParam("pin_diameter")), - _n_cells(getParam("n_cells")), - _block_id(getParam("block_id")), - _num_radial_parts(getParam("num_radial_parts")) -{ - Real L = _unheated_length_entry + _heated_length + _unheated_length_exit; - Real dz = L / _n_cells; - for (unsigned int i = 0; i < _n_cells + 1; i++) - _z_grid.push_back(dz * i); -} - -void -DetailedPinMeshGeneratorBase::generatePin(std::unique_ptr & mesh_base, - const Point & center) -{ - const Real dalpha = 360. / _num_radial_parts; - Real radius = _pin_diameter / 2.; - - // nodes - std::vector> nodes; - nodes.resize(_n_cells + 1); - for (unsigned int k = 0; k < _n_cells + 1; k++) - { - const Real elev = _z_grid[k]; - // center node - nodes[k].push_back(mesh_base->add_point(Point(center(0), center(1), elev))); - // ring around the center - Real alpha = 0.; - for (unsigned int i = 0; i < _num_radial_parts; i++, alpha += dalpha) - { - const Real dx = radius * std::cos(alpha * M_PI / 180.); - const Real dy = radius * std::sin(alpha * M_PI / 180.); - Point pt(center(0) + dx, center(1) + dy, elev); - nodes[k].push_back(mesh_base->add_point(pt)); - } - } - - // elements - for (unsigned int k = 0; k < _n_cells; k++) - { - for (unsigned int i = 0; i < _num_radial_parts; i++) - { - Elem * elem = new Prism6; - elem->subdomain_id() = _block_id; - elem->set_id(_elem_id++); - mesh_base->add_elem(elem); - const unsigned int ctr_idx = 0; - const unsigned int idx1 = (i % _num_radial_parts) + 1; - const unsigned int idx2 = ((i + 1) % _num_radial_parts) + 1; - elem->set_node(0, nodes[k][ctr_idx]); - elem->set_node(1, nodes[k][idx1]); - elem->set_node(2, nodes[k][idx2]); - elem->set_node(3, nodes[k + 1][ctr_idx]); - elem->set_node(4, nodes[k + 1][idx1]); - elem->set_node(5, nodes[k + 1][idx2]); - } - } -} diff --git a/modules/subchannel/src/meshgenerators/SCMDetailedQuadSubChannelMeshGenerator.C b/modules/subchannel/src/meshgenerators/SCMDetailedQuadAssemblyMeshGenerator.C similarity index 63% rename from modules/subchannel/src/meshgenerators/SCMDetailedQuadSubChannelMeshGenerator.C rename to modules/subchannel/src/meshgenerators/SCMDetailedQuadAssemblyMeshGenerator.C index c3e321508e36..43f8b29963bb 100644 --- a/modules/subchannel/src/meshgenerators/SCMDetailedQuadSubChannelMeshGenerator.C +++ b/modules/subchannel/src/meshgenerators/SCMDetailedQuadAssemblyMeshGenerator.C @@ -7,24 +7,23 @@ //* Licensed under LGPL 2.1, please see LICENSE for details //* https://www.gnu.org/licenses/lgpl-2.1.html -#include "SCMDetailedQuadSubChannelMeshGenerator.h" -#include -#include +#include "SCMDetailedQuadAssemblyMeshGenerator.h" +#include "QuadSubChannelMesh.h" + #include "libmesh/cell_prism6.h" #include "libmesh/unstructured_mesh.h" -registerMooseObject("SubChannelApp", SCMDetailedQuadSubChannelMeshGenerator); -registerMooseObjectRenamed("SubChannelApp", - DetailedQuadSubChannelMeshGenerator, - "06/30/2025 24:00", - SCMDetailedQuadSubChannelMeshGenerator); +#include +#include + +registerMooseObject("SubChannelApp", SCMDetailedQuadAssemblyMeshGenerator); InputParameters -SCMDetailedQuadSubChannelMeshGenerator::validParams() +SCMDetailedQuadAssemblyMeshGenerator::validParams() { InputParameters params = MeshGenerator::validParams(); params.addClassDescription( - "Creates a detailed mesh of subchannels in a square lattice arrangement"); + "Creates a detailed mesh of subchannels and fuel pins in a square lattice arrangement"); params.addRequiredParam("pitch", "Pitch [m]"); params.addRequiredParam("pin_diameter", "Rod diameter [m]"); params.addParam("unheated_length_entry", 0.0, "Unheated length at entry [m]"); @@ -34,16 +33,26 @@ SCMDetailedQuadSubChannelMeshGenerator::validParams() params.addRequiredParam("nx", "Number of channels in the x direction [-]"); params.addRequiredParam("ny", "Number of channels in the y direction [-]"); params.addRequiredParam( + "side_gap", + "The side gap, not to be confused with the gap between pins, this refers to the gap " + "next to the duct or else the distance between the subchannel centroid to the duct wall." + "distance(edge pin center, duct wall) = pitch / 2 + side_gap [m]"); + params.addParam( "gap", "The side gap, not to be confused with the gap between pins, this refers to the gap " "next to the duct or else the distance between the subchannel centroid to the duct wall." "distance(edge pin center, duct wall) = pitch / 2 + side_gap [m]"); params.deprecateParam("gap", "side_gap", "08/06/2026"); - params.addParam("block_id", 0, "Block ID used for the mesh subdomain."); + params.addRangeCheckedParam("num_radial_parts", + 16, + "num_radial_parts>=4", + "Number of radial parts (must be at least 4)."); + params.addParam("subchannel_block_id", 0, "Subchannel block id."); + params.addParam("pin_block_id", 1, "Fuel pin block id."); return params; } -SCMDetailedQuadSubChannelMeshGenerator::SCMDetailedQuadSubChannelMeshGenerator( +SCMDetailedQuadAssemblyMeshGenerator::SCMDetailedQuadAssemblyMeshGenerator( const InputParameters & parameters) : MeshGenerator(parameters), _unheated_length_entry(getParam("unheated_length_entry")), @@ -54,12 +63,32 @@ SCMDetailedQuadSubChannelMeshGenerator::SCMDetailedQuadSubChannelMeshGenerator( _n_cells(getParam("n_cells")), _nx(getParam("nx")), _ny(getParam("ny")), - _n_channels(_nx * _ny), - _side_gap(getParam("side_gap")), - _block_id(getParam("block_id")) + _n_channels(0), + _side_gap(isParamValid("side_gap") ? getParam("side_gap") : getParam("gap")), + _num_radial_parts(getParam("num_radial_parts")), + _subchannel_block_id(getParam("subchannel_block_id")), + _pin_block_id(getParam("pin_block_id")), + _elem_id(0) { - Real L = _unheated_length_entry + _heated_length + _unheated_length_exit; - Real dz = L / _n_cells; + const Real L = _unheated_length_entry + _heated_length + _unheated_length_exit; + + if (_n_cells == 0) + mooseError(name(), ": The number of axial cells must be greater than zero"); + + if (L <= 0.0) + mooseError(name(), ": Total bundle length must be greater than zero"); + + if (_nx == 0 || _ny == 0) + mooseError(name(), ": The number of subchannels must be greater than zero in each direction"); + + if (_nx < 2 && _ny < 2) + mooseError(name(), + ": The number of subchannels cannot be less than 2 in both directions. " + "Smallest assembly allowed is either 2X1 or 1X2."); + + _n_channels = _nx * _ny; + + const Real dz = L / _n_cells; for (unsigned int i = 0; i < _n_cells + 1; i++) _z_grid.push_back(dz * i); @@ -68,20 +97,17 @@ SCMDetailedQuadSubChannelMeshGenerator::SCMDetailedQuadSubChannelMeshGenerator( { _subchannel_position[i].reserve(3); for (unsigned int j = 0; j < 3; j++) - { _subchannel_position.at(i).push_back(0.0); - } } _subch_type.resize(_n_channels); for (unsigned int iy = 0; iy < _ny; iy++) - { for (unsigned int ix = 0; ix < _nx; ix++) { - unsigned int i_ch = _nx * iy + ix; - bool is_corner = (ix == 0 && iy == 0) || (ix == _nx - 1 && iy == 0) || - (ix == 0 && iy == _ny - 1) || (ix == _nx - 1 && iy == _ny - 1); - bool is_edge = (ix == 0 || iy == 0 || ix == _nx - 1 || iy == _ny - 1); + const unsigned int i_ch = _nx * iy + ix; + const bool is_corner = (ix == 0 && iy == 0) || (ix == _nx - 1 && iy == 0) || + (ix == 0 && iy == _ny - 1) || (ix == _nx - 1 && iy == _ny - 1); + const bool is_edge = (ix == 0 || iy == 0 || ix == _nx - 1 || iy == _ny - 1); if (is_corner) _subch_type[i_ch] = EChannelType::CORNER; @@ -90,45 +116,72 @@ SCMDetailedQuadSubChannelMeshGenerator::SCMDetailedQuadSubChannelMeshGenerator( else _subch_type[i_ch] = EChannelType::CENTER; - // set the subchannel positions so that the center of the assembly is the zero point - Real offset_x = (_nx - 1) * _pitch / 2.0; - Real offset_y = (_ny - 1) * _pitch / 2.0; + const Real offset_x = (_nx - 1) * _pitch / 2.0; + const Real offset_y = (_ny - 1) * _pitch / 2.0; _subchannel_position[i_ch][0] = _pitch * ix - offset_x; _subchannel_position[i_ch][1] = _pitch * iy - offset_y; } +} + +void +SCMDetailedQuadAssemblyMeshGenerator::generatePin(std::unique_ptr & mesh_base, + const Point & center) +{ + const Real dalpha = 360. / _num_radial_parts; + const Real radius = _pin_diameter / 2.; + + std::vector> nodes; + nodes.resize(_n_cells + 1); + for (unsigned int k = 0; k < _n_cells + 1; k++) + { + const Real elev = _z_grid[k]; + nodes[k].push_back(mesh_base->add_point(Point(center(0), center(1), elev))); + Real alpha = 0.; + for (unsigned int i = 0; i < _num_radial_parts; i++, alpha += dalpha) + { + const Real dx = radius * std::cos(alpha * M_PI / 180.); + const Real dy = radius * std::sin(alpha * M_PI / 180.); + nodes[k].push_back(mesh_base->add_point(Point(center(0) + dx, center(1) + dy, elev))); + } } + + for (unsigned int k = 0; k < _n_cells; k++) + for (unsigned int i = 0; i < _num_radial_parts; i++) + { + Elem * elem = new Prism6; + elem->subdomain_id() = _pin_block_id; + elem->set_id(_elem_id++); + mesh_base->add_elem(elem); + const unsigned int ctr_idx = 0; + const unsigned int idx1 = (i % _num_radial_parts) + 1; + const unsigned int idx2 = ((i + 1) % _num_radial_parts) + 1; + elem->set_node(0, nodes[k][ctr_idx]); + elem->set_node(1, nodes[k][idx1]); + elem->set_node(2, nodes[k][idx2]); + elem->set_node(3, nodes[k + 1][ctr_idx]); + elem->set_node(4, nodes[k + 1][idx1]); + elem->set_node(5, nodes[k + 1][idx2]); + } } std::unique_ptr -SCMDetailedQuadSubChannelMeshGenerator::generate() +SCMDetailedQuadAssemblyMeshGenerator::generate() { auto mesh_base = buildMeshBaseObject(); BoundaryInfo & boundary_info = mesh_base->get_boundary_info(); mesh_base->set_spatial_dimension(3); - // Define the resolution (the number of points used to represent a circle). - // This must be divisible by 4. - const unsigned int theta_res = 16; // TODO: parameterize - // Compute the number of points needed to represent one quarter of a circle. - const unsigned int points_per_quad = theta_res / 4 + 1; - // Compute the points needed to represent one axial cross-flow of a subchannel. - // For the center subchannel (sc) there is one center point plus the points from 4 intersecting - // circles. + const unsigned int n_pins = (_nx - 1) * (_ny - 1); + + const unsigned int theta_res = 16; + const unsigned int points_per_quad = theta_res / 4 + 1; const unsigned int points_per_center = points_per_quad * 4 + 1; - // For the corner sc there is one center point plus the points from 1 intersecting circle plus 3 - // corners const unsigned int points_per_corner = points_per_quad * 1 + 1 + 3; - // For the side sc there is one center point plus the points from 2 intersecting circles plus 2 - // corners const unsigned int points_per_side = points_per_quad * 2 + 1 + 2; - - // Compute the number of elements (Prism6) which combined base creates the sub-channel - // cross-section const unsigned int elems_per_center = theta_res + 4; const unsigned int elems_per_corner = theta_res / 4 + 4; const unsigned int elems_per_side = theta_res / 2 + 4; - // specify number and type of sub-channel unsigned int n_center, n_side, n_corner; if (_n_channels == 2) { @@ -149,16 +202,22 @@ SCMDetailedQuadSubChannelMeshGenerator::generate() n_center = _n_channels - n_side - n_corner; } - // Compute the total number of points and elements. const unsigned int points_per_level = n_corner * points_per_corner + n_side * points_per_side + n_center * points_per_center; const unsigned int elems_per_level = n_corner * elems_per_corner + n_side * elems_per_side + n_center * elems_per_center; - const unsigned int n_points = points_per_level * (_n_cells + 1); - const unsigned int n_elems = elems_per_level * _n_cells; - mesh_base->reserve_nodes(n_points); - mesh_base->reserve_elem(n_elems); - // Build an array of points arranged in a circle on the xy-plane. (last and first node overlap) + + std::vector pin_centers; + if (n_pins > 0) + QuadSubChannelMesh::generatePinCenters(_nx, _ny, _pitch, 0, pin_centers); + + const unsigned int pin_points = + n_pins > 0 ? (_n_cells + 1) * (_num_radial_parts + 1) * pin_centers.size() : 0; + const unsigned int pin_elems = n_pins > 0 ? _n_cells * _num_radial_parts * pin_centers.size() : 0; + + mesh_base->reserve_nodes(points_per_level * (_n_cells + 1) + pin_points); + mesh_base->reserve_elem(elems_per_level * _n_cells + pin_elems); + const Real radius = _pin_diameter / 2.0; std::array circle_points; { @@ -170,11 +229,7 @@ SCMDetailedQuadSubChannelMeshGenerator::generate() theta += 2 * M_PI / theta_res; } } - // Define "quadrant center" reference points. These will be the centers of - // the 4 circles that represent the fuel pins. These centers are - // offset a little bit so that in the final mesh, there is a tiny gap between - // neighboring subchannel cells. That allows us to easily map a solution to - // this detailed mesh with a nearest-neighbor search. + const Real shrink_factor = 0.99999; std::array quadrant_centers; quadrant_centers[0] = Point(_pitch * 0.5 * shrink_factor, _pitch * 0.5 * shrink_factor, 0); @@ -183,13 +238,6 @@ SCMDetailedQuadSubChannelMeshGenerator::generate() quadrant_centers[3] = Point(_pitch * 0.5 * shrink_factor, -_pitch * 0.5 * shrink_factor, 0); const unsigned int m = theta_res / 4; - // Build an array of points that represent a cross section of a center subchannel - // cell. The points are ordered in this fashion: - // 4 3 - // 6 5 2 1 - // 0 - // 7 8 * * - // 9 * std::array center_points; { unsigned int start; @@ -211,13 +259,6 @@ SCMDetailedQuadSubChannelMeshGenerator::generate() } } - // Build an array of points that represent a cross section of a top left corner subchannel - // cell. The points are ordered in this fashion: - // 5 4 - // - // 0 - // 2 3 - // 6 1 std::array tl_corner_points; { for (unsigned int ii = 0; ii < points_per_quad; ii++) @@ -230,13 +271,6 @@ SCMDetailedQuadSubChannelMeshGenerator::generate() tl_corner_points[points_per_quad + 3] = Point(-_side_gap, -_pitch * 0.5 * shrink_factor, 0); } - // Build an array of points that represent a cross section of a top right corner subchannel - // cell. The points are ordered in this fashion: - // 6 5 - // - // 0 - // 1 2 - // 3 4 std::array tr_corner_points; { for (unsigned int ii = 0; ii < points_per_quad; ii++) @@ -249,13 +283,6 @@ SCMDetailedQuadSubChannelMeshGenerator::generate() tr_corner_points[points_per_quad + 3] = Point(-_pitch * 0.5 * shrink_factor, _side_gap, 0); } - // Build an array of points that represent a cross section of a bottom left corner subchannel - // cell. The points are ordered in this fashion: - // 4 3 - // 2 1 - // 0 - // - // 5 6 std::array bl_corner_points; { for (unsigned int ii = 0; ii < points_per_quad; ii++) @@ -268,13 +295,6 @@ SCMDetailedQuadSubChannelMeshGenerator::generate() bl_corner_points[points_per_quad + 3] = Point(_pitch * 0.5 * shrink_factor, -_side_gap, 0); } - // Build an array of points that represent a cross section of a bottom right corner subchannel - // cell. The points are ordered in this fashion: - // 1 6 - // 3 2 - // 0 - // - // 4 5 std::array br_corner_points; { for (unsigned int ii = 0; ii < points_per_quad; ii++) @@ -287,13 +307,6 @@ SCMDetailedQuadSubChannelMeshGenerator::generate() br_corner_points[points_per_quad + 3] = Point(_side_gap, _pitch * 0.5 * shrink_factor, 0); } - // Build an array of points that represent a cross section of a top side subchannel - // cell. The points are ordered in this fashion: - // 8 7 - // - // 0 - // 1 2 5 6 - // 3 4 std::array top_points; { for (unsigned int ii = 0; ii < points_per_quad; ii++) @@ -310,13 +323,6 @@ SCMDetailedQuadSubChannelMeshGenerator::generate() top_points[2 * points_per_quad + 2] = Point(-_pitch * 0.5 * shrink_factor, _side_gap, 0); } - // Build an array of points that represent a cross section of a left side subchannel - // cell. The points are ordered in this fashion: - // 7 6 - // 5 4 - // 0 - // 2 3 - // 8 1 std::array left_points; { for (unsigned int ii = 0; ii < points_per_quad; ii++) @@ -333,13 +339,6 @@ SCMDetailedQuadSubChannelMeshGenerator::generate() left_points[2 * points_per_quad + 2] = Point(-_side_gap, -_pitch * 0.5 * shrink_factor, 0); } - // Build an array of points that represent a cross section of a bottom side subchannel - // cell. The points are ordered in this fashion: - // 4 3 - // 6 5 2 1 - // 0 - // - // 7 8 std::array bottom_points; { for (unsigned int ii = 0; ii < points_per_quad; ii++) @@ -356,13 +355,6 @@ SCMDetailedQuadSubChannelMeshGenerator::generate() bottom_points[2 * points_per_quad + 2] = Point(_pitch * 0.5 * shrink_factor, -_side_gap, 0); } - // Build an array of points that represent a cross section of a right side subchannel - // cell. The points are ordered in this fashion: - // 1 8 - // 3 2 - // 0 - // 4 5 - // 6 7 std::array right_points; { for (unsigned int ii = 0; ii < points_per_quad; ii++) @@ -379,12 +371,11 @@ SCMDetailedQuadSubChannelMeshGenerator::generate() right_points[2 * points_per_quad + 2] = Point(_side_gap, _pitch * 0.5 * shrink_factor, 0); } - // Add the points to the mesh. if (_n_channels == 2) { unsigned int node_id = 0; - Real offset_x = (_nx - 1) * _pitch / 2.0; - Real offset_y = (_ny - 1) * _pitch / 2.0; + const Real offset_x = (_nx - 1) * _pitch / 2.0; + const Real offset_y = (_ny - 1) * _pitch / 2.0; for (unsigned int iy = 0; iy < _ny; iy++) { Point y0 = {0, _pitch * iy - offset_y, 0}; @@ -394,26 +385,18 @@ SCMDetailedQuadSubChannelMeshGenerator::generate() for (auto z : _z_grid) { Point z0{0, 0, z}; - if (_nx == 1 && iy == 0) // vertical orientation - { + if (_nx == 1 && iy == 0) for (unsigned int i = 0; i < points_per_side; i++) mesh_base->add_point(bottom_points[i] + x0 + y0 + z0, node_id++); - } - if (_nx == 1 && iy == 1) // vertical orientation - { + if (_nx == 1 && iy == 1) for (unsigned int i = 0; i < points_per_side; i++) mesh_base->add_point(top_points[i] + x0 + y0 + z0, node_id++); - } - if (_ny == 1 && ix == 0) // horizontal orientation - { + if (_ny == 1 && ix == 0) for (unsigned int i = 0; i < points_per_side; i++) mesh_base->add_point(left_points[i] + x0 + y0 + z0, node_id++); - } - if (_ny == 1 && ix == 1) // horizontal orientation - { + if (_ny == 1 && ix == 1) for (unsigned int i = 0; i < points_per_side; i++) mesh_base->add_point(right_points[i] + x0 + y0 + z0, node_id++); - } } } } @@ -421,8 +404,8 @@ SCMDetailedQuadSubChannelMeshGenerator::generate() else if (_n_channels > 2 && (_ny == 1 || _nx == 1)) { unsigned int node_id = 0; - Real offset_x = (_nx - 1) * _pitch / 2.0; - Real offset_y = (_ny - 1) * _pitch / 2.0; + const Real offset_x = (_nx - 1) * _pitch / 2.0; + const Real offset_y = (_ny - 1) * _pitch / 2.0; for (unsigned int iy = 0; iy < _ny; iy++) { Point y0 = {0, _pitch * iy - offset_y, 0}; @@ -435,38 +418,26 @@ SCMDetailedQuadSubChannelMeshGenerator::generate() if (_nx == 1) { if (iy == 0) - { for (unsigned int i = 0; i < points_per_side; i++) mesh_base->add_point(bottom_points[i] + x0 + y0 + z0, node_id++); - } else if (iy == _ny - 1) - { for (unsigned int i = 0; i < points_per_side; i++) mesh_base->add_point(top_points[i] + x0 + y0 + z0, node_id++); - } else - { for (unsigned int i = 0; i < points_per_center; i++) mesh_base->add_point(center_points[i] + x0 + y0 + z0, node_id++); - } } else if (_ny == 1) { if (ix == 0) - { for (unsigned int i = 0; i < points_per_side; i++) mesh_base->add_point(left_points[i] + x0 + y0 + z0, node_id++); - } else if (ix == _nx - 1) - { for (unsigned int i = 0; i < points_per_side; i++) mesh_base->add_point(right_points[i] + x0 + y0 + z0, node_id++); - } else - { for (unsigned int i = 0; i < points_per_center; i++) mesh_base->add_point(center_points[i] + x0 + y0 + z0, node_id++); - } } } } @@ -475,210 +446,168 @@ SCMDetailedQuadSubChannelMeshGenerator::generate() else { unsigned int node_id = 0; - Real offset_x = (_nx - 1) * _pitch / 2.0; - Real offset_y = (_ny - 1) * _pitch / 2.0; + const Real offset_x = (_nx - 1) * _pitch / 2.0; + const Real offset_y = (_ny - 1) * _pitch / 2.0; for (unsigned int iy = 0; iy < _ny; iy++) { Point y0 = {0, _pitch * iy - offset_y, 0}; for (unsigned int ix = 0; ix < _nx; ix++) { Point x0 = {_pitch * ix - offset_x, 0, 0}; - if (ix == 0 && iy == 0) // Bottom Left corner - { + if (ix == 0 && iy == 0) for (auto z : _z_grid) { Point z0{0, 0, z}; for (unsigned int i = 0; i < points_per_corner; i++) mesh_base->add_point(bl_corner_points[i] + x0 + y0 + z0, node_id++); } - } - else if (ix == _nx - 1 && iy == 0) // Bottom right corner - { + else if (ix == _nx - 1 && iy == 0) for (auto z : _z_grid) { Point z0{0, 0, z}; for (unsigned int i = 0; i < points_per_corner; i++) mesh_base->add_point(br_corner_points[i] + x0 + y0 + z0, node_id++); } - } - else if (ix == 0 && iy == _ny - 1) // top Left corner - { + else if (ix == 0 && iy == _ny - 1) for (auto z : _z_grid) { Point z0{0, 0, z}; for (unsigned int i = 0; i < points_per_corner; i++) mesh_base->add_point(tl_corner_points[i] + x0 + y0 + z0, node_id++); } - } - else if (ix == _nx - 1 && iy == _ny - 1) // top right corner - { + else if (ix == _nx - 1 && iy == _ny - 1) for (auto z : _z_grid) { Point z0{0, 0, z}; for (unsigned int i = 0; i < points_per_corner; i++) mesh_base->add_point(tr_corner_points[i] + x0 + y0 + z0, node_id++); } - } - else if (ix == 0 && (iy != _ny - 1 || iy != 0)) // left side - { + else if (ix == 0 && (iy != _ny - 1 || iy != 0)) for (auto z : _z_grid) { Point z0{0, 0, z}; for (unsigned int i = 0; i < points_per_side; i++) mesh_base->add_point(left_points[i] + x0 + y0 + z0, node_id++); } - } - else if (ix == _nx - 1 && (iy != _ny - 1 || iy != 0)) // right side - { + else if (ix == _nx - 1 && (iy != _ny - 1 || iy != 0)) for (auto z : _z_grid) { Point z0{0, 0, z}; for (unsigned int i = 0; i < points_per_side; i++) mesh_base->add_point(right_points[i] + x0 + y0 + z0, node_id++); } - } - else if (iy == 0 && (ix != _nx - 1 || ix != 0)) // bottom side - { + else if (iy == 0 && (ix != _nx - 1 || ix != 0)) for (auto z : _z_grid) { Point z0{0, 0, z}; for (unsigned int i = 0; i < points_per_side; i++) mesh_base->add_point(bottom_points[i] + x0 + y0 + z0, node_id++); } - } - else if (iy == _ny - 1 && (ix != _nx - 1 || ix != 0)) // top side - { + else if (iy == _ny - 1 && (ix != _nx - 1 || ix != 0)) for (auto z : _z_grid) { Point z0{0, 0, z}; for (unsigned int i = 0; i < points_per_side; i++) mesh_base->add_point(top_points[i] + x0 + y0 + z0, node_id++); } - } - else // center - { + else for (auto z : _z_grid) { Point z0{0, 0, z}; for (unsigned int i = 0; i < points_per_center; i++) mesh_base->add_point(center_points[i] + x0 + y0 + z0, node_id++); } - } } } } - // Add elements to the mesh. The elements are 6-node prisms. The - // bases of these prisms form a triangulated representation of a cross-section - // of a center subchannel. if (_n_channels == 2) { - unsigned int elem_id = 0; for (unsigned int iy = 0; iy < _ny; iy++) - { for (unsigned int ix = 0; ix < _nx; ix++) { - unsigned int i_ch = _nx * iy + ix; + const unsigned int i_ch = _nx * iy + ix; for (unsigned int iz = 0; iz < _n_cells; iz++) - { for (unsigned int i = 0; i < elems_per_side; i++) { Elem * elem = new Prism6; - elem->subdomain_id() = _block_id; - elem->set_id(elem_id++); + elem->subdomain_id() = _subchannel_block_id; + elem->set_id(_elem_id++); elem = mesh_base->add_elem(elem); - // index of the central node at base of cell - unsigned int indx1 = iz * points_per_side + points_per_side * (_n_cells + 1) * i_ch; - // index of the central node at top of cell - unsigned int indx2 = + const unsigned int indx1 = + iz * points_per_side + points_per_side * (_n_cells + 1) * i_ch; + const unsigned int indx2 = (iz + 1) * points_per_side + points_per_side * (_n_cells + 1) * i_ch; - unsigned int elems_per_channel = elems_per_side; + const unsigned int elems_per_channel = elems_per_side; elem->set_node(0, mesh_base->node_ptr(indx1)); elem->set_node(1, mesh_base->node_ptr(indx1 + i + 1)); - if (i != elems_per_channel - 1) - elem->set_node(2, mesh_base->node_ptr(indx1 + i + 2)); - else - elem->set_node(2, mesh_base->node_ptr(indx1 + 1)); - + elem->set_node(2, + i != elems_per_channel - 1 ? mesh_base->node_ptr(indx1 + i + 2) + : mesh_base->node_ptr(indx1 + 1)); elem->set_node(3, mesh_base->node_ptr(indx2)); elem->set_node(4, mesh_base->node_ptr(indx2 + i + 1)); - if (i != elems_per_channel - 1) - elem->set_node(5, mesh_base->node_ptr(indx2 + i + 2)); - else - elem->set_node(5, mesh_base->node_ptr(indx2 + 1)); + elem->set_node(5, + i != elems_per_channel - 1 ? mesh_base->node_ptr(indx2 + i + 2) + : mesh_base->node_ptr(indx2 + 1)); if (iz == 0) boundary_info.add_side(elem, 0, 0); if (iz == _n_cells - 1) boundary_info.add_side(elem, 4, 1); } - } } - } - boundary_info.sideset_name(0) = "inlet"; - boundary_info.sideset_name(1) = "outlet"; - mesh_base->subdomain_name(_block_id) = name(); - mesh_base->prepare_for_use(); } else if (_n_channels > 2 && (_ny == 1 || _nx == 1)) { - unsigned int elem_id = 0; unsigned int number_of_corner = 0; unsigned int number_of_side = 0; unsigned int number_of_center = 0; unsigned int elems_per_channel = 0; unsigned int points_per_channel = 0; for (unsigned int iy = 0; iy < _ny; iy++) - { for (unsigned int ix = 0; ix < _nx; ix++) { - unsigned int i_ch = _nx * iy + ix; - auto subch_type = getSubchannelType(i_ch); - // note that in this case i use side geometry for corner subchannel + const unsigned int i_ch = _nx * iy + ix; + const auto subch_type = getSubchannelType(i_ch); if (subch_type == EChannelType::CORNER) { number_of_side++; elems_per_channel = elems_per_side; points_per_channel = points_per_side; } - // note that in this case i use center geometry for edge subchannel else if (subch_type == EChannelType::EDGE) { number_of_center++; elems_per_channel = elems_per_center; points_per_channel = points_per_center; } + for (unsigned int iz = 0; iz < _n_cells; iz++) { - unsigned int elapsed_points = number_of_corner * points_per_corner * (_n_cells + 1) + - number_of_side * points_per_side * (_n_cells + 1) + - number_of_center * points_per_center * (_n_cells + 1) - - points_per_channel * (_n_cells + 1); - // index of the central node at base of cell - unsigned int indx1 = iz * points_per_channel + elapsed_points; - // index of the central node at top of cell - unsigned int indx2 = (iz + 1) * points_per_channel + elapsed_points; + const unsigned int elapsed_points = + number_of_corner * points_per_corner * (_n_cells + 1) + + number_of_side * points_per_side * (_n_cells + 1) + + number_of_center * points_per_center * (_n_cells + 1) - + points_per_channel * (_n_cells + 1); + const unsigned int indx1 = iz * points_per_channel + elapsed_points; + const unsigned int indx2 = (iz + 1) * points_per_channel + elapsed_points; for (unsigned int i = 0; i < elems_per_channel; i++) { Elem * elem = new Prism6; - elem->subdomain_id() = _block_id; - elem->set_id(elem_id++); + elem->subdomain_id() = _subchannel_block_id; + elem->set_id(_elem_id++); elem = mesh_base->add_elem(elem); - elem->set_node(0, mesh_base->node_ptr(indx1)); elem->set_node(1, mesh_base->node_ptr(indx1 + i + 1)); - if (i != elems_per_channel - 1) - elem->set_node(2, mesh_base->node_ptr(indx1 + i + 2)); - else - elem->set_node(2, mesh_base->node_ptr(indx1 + 1)); - + elem->set_node(2, + i != elems_per_channel - 1 ? mesh_base->node_ptr(indx1 + i + 2) + : mesh_base->node_ptr(indx1 + 1)); elem->set_node(3, mesh_base->node_ptr(indx2)); elem->set_node(4, mesh_base->node_ptr(indx2 + i + 1)); - if (i != elems_per_channel - 1) - elem->set_node(5, mesh_base->node_ptr(indx2 + i + 2)); - else - elem->set_node(5, mesh_base->node_ptr(indx2 + 1)); + elem->set_node(5, + i != elems_per_channel - 1 ? mesh_base->node_ptr(indx2 + i + 2) + : mesh_base->node_ptr(indx2 + 1)); if (iz == 0) boundary_info.add_side(elem, 0, 0); @@ -687,26 +616,19 @@ SCMDetailedQuadSubChannelMeshGenerator::generate() } } } - } - boundary_info.sideset_name(0) = "inlet"; - boundary_info.sideset_name(1) = "outlet"; - mesh_base->subdomain_name(_block_id) = name(); - mesh_base->prepare_for_use(); } else { - unsigned int elem_id = 0; unsigned int number_of_corner = 0; unsigned int number_of_side = 0; unsigned int number_of_center = 0; unsigned int elems_per_channel = 0; unsigned int points_per_channel = 0; for (unsigned int iy = 0; iy < _ny; iy++) - { for (unsigned int ix = 0; ix < _nx; ix++) { - unsigned int i_ch = _nx * iy + ix; - auto subch_type = getSubchannelType(i_ch); + const unsigned int i_ch = _nx * iy + ix; + const auto subch_type = getSubchannelType(i_ch); if (subch_type == EChannelType::CORNER) { number_of_corner++; @@ -725,37 +647,33 @@ SCMDetailedQuadSubChannelMeshGenerator::generate() elems_per_channel = elems_per_center; points_per_channel = points_per_center; } + for (unsigned int iz = 0; iz < _n_cells; iz++) { - unsigned int elapsed_points = number_of_corner * points_per_corner * (_n_cells + 1) + - number_of_side * points_per_side * (_n_cells + 1) + - number_of_center * points_per_center * (_n_cells + 1) - - points_per_channel * (_n_cells + 1); - // index of the central node at base of cell - unsigned int indx1 = iz * points_per_channel + elapsed_points; - // index of the central node at top of cell - unsigned int indx2 = (iz + 1) * points_per_channel + elapsed_points; + const unsigned int elapsed_points = + number_of_corner * points_per_corner * (_n_cells + 1) + + number_of_side * points_per_side * (_n_cells + 1) + + number_of_center * points_per_center * (_n_cells + 1) - + points_per_channel * (_n_cells + 1); + const unsigned int indx1 = iz * points_per_channel + elapsed_points; + const unsigned int indx2 = (iz + 1) * points_per_channel + elapsed_points; for (unsigned int i = 0; i < elems_per_channel; i++) { Elem * elem = new Prism6; - elem->subdomain_id() = _block_id; - elem->set_id(elem_id++); + elem->subdomain_id() = _subchannel_block_id; + elem->set_id(_elem_id++); elem = mesh_base->add_elem(elem); - elem->set_node(0, mesh_base->node_ptr(indx1)); elem->set_node(1, mesh_base->node_ptr(indx1 + i + 1)); - if (i != elems_per_channel - 1) - elem->set_node(2, mesh_base->node_ptr(indx1 + i + 2)); - else - elem->set_node(2, mesh_base->node_ptr(indx1 + 1)); - + elem->set_node(2, + i != elems_per_channel - 1 ? mesh_base->node_ptr(indx1 + i + 2) + : mesh_base->node_ptr(indx1 + 1)); elem->set_node(3, mesh_base->node_ptr(indx2)); elem->set_node(4, mesh_base->node_ptr(indx2 + i + 1)); - if (i != elems_per_channel - 1) - elem->set_node(5, mesh_base->node_ptr(indx2 + i + 2)); - else - elem->set_node(5, mesh_base->node_ptr(indx2 + 1)); + elem->set_node(5, + i != elems_per_channel - 1 ? mesh_base->node_ptr(indx2 + i + 2) + : mesh_base->node_ptr(indx2 + 1)); if (iz == 0) boundary_info.add_side(elem, 0, 0); @@ -764,12 +682,18 @@ SCMDetailedQuadSubChannelMeshGenerator::generate() } } } - } - boundary_info.sideset_name(0) = "inlet"; - boundary_info.sideset_name(1) = "outlet"; - mesh_base->subdomain_name(_block_id) = name(); - mesh_base->prepare_for_use(); } + if (n_pins > 0) + for (auto & ctr : pin_centers) + generatePin(mesh_base, ctr); + + boundary_info.sideset_name(0) = "inlet"; + boundary_info.sideset_name(1) = "outlet"; + mesh_base->subdomain_name(_subchannel_block_id) = "subchannel"; + if (n_pins > 0) + mesh_base->subdomain_name(_pin_block_id) = "fuel_pins"; + mesh_base->prepare_for_use(); + return mesh_base; } diff --git a/modules/subchannel/src/meshgenerators/SCMDetailedQuadPinMeshGenerator.C b/modules/subchannel/src/meshgenerators/SCMDetailedQuadPinMeshGenerator.C deleted file mode 100644 index 062a049c2527..000000000000 --- a/modules/subchannel/src/meshgenerators/SCMDetailedQuadPinMeshGenerator.C +++ /dev/null @@ -1,59 +0,0 @@ -//* 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 - -#include "SCMDetailedQuadPinMeshGenerator.h" -#include "QuadSubChannelMesh.h" -#include "libmesh/cell_prism6.h" - -registerMooseObject("SubChannelApp", SCMDetailedQuadPinMeshGenerator); -registerMooseObjectRenamed("SubChannelApp", - DetailedQuadPinMeshGenerator, - "06/30/2025 24:00", - SCMDetailedQuadPinMeshGenerator); - -InputParameters -SCMDetailedQuadPinMeshGenerator::validParams() -{ - InputParameters params = DetailedPinMeshGeneratorBase::validParams(); - params.addClassDescription( - "Creates a detailed mesh of fuel pins in a square lattice arrangement"); - params.addRequiredParam("input", "The corresponding subchannel mesh"); - params.addRequiredParam("nx", "Number of channels in the x direction [-]"); - params.addRequiredParam("ny", "Number of channels in the y direction [-]"); - return params; -} - -SCMDetailedQuadPinMeshGenerator::SCMDetailedQuadPinMeshGenerator(const InputParameters & parameters) - : DetailedPinMeshGeneratorBase(parameters), - _input(getMesh("input")), - _nx(getParam("nx")), - _ny(getParam("ny")) -{ -} - -std::unique_ptr -SCMDetailedQuadPinMeshGenerator::generate() -{ - std::unique_ptr mesh_base = std::move(_input); - if (!mesh_base) - mesh_base = buildMeshBaseObject(); - mesh_base->set_mesh_dimension(3); - - std::vector pin_centers; - QuadSubChannelMesh::generatePinCenters(_nx, _ny, _pitch, 0, pin_centers); - - _elem_id = mesh_base->n_elem(); - for (auto & ctr : pin_centers) - generatePin(mesh_base, ctr); - - mesh_base->subdomain_name(_block_id) = name(); - mesh_base->prepare_for_use(); - - return mesh_base; -} diff --git a/modules/subchannel/src/meshgenerators/SCMDetailedTriSubChannelMeshGenerator.C b/modules/subchannel/src/meshgenerators/SCMDetailedTriAssemblyMeshGenerator.C similarity index 85% rename from modules/subchannel/src/meshgenerators/SCMDetailedTriSubChannelMeshGenerator.C rename to modules/subchannel/src/meshgenerators/SCMDetailedTriAssemblyMeshGenerator.C index a123c3f0e889..8bede4ad1097 100644 --- a/modules/subchannel/src/meshgenerators/SCMDetailedTriSubChannelMeshGenerator.C +++ b/modules/subchannel/src/meshgenerators/SCMDetailedTriAssemblyMeshGenerator.C @@ -7,40 +7,44 @@ //* Licensed under LGPL 2.1, please see LICENSE for details //* https://www.gnu.org/licenses/lgpl-2.1.html -#include "SCMDetailedTriSubChannelMeshGenerator.h" +#include "SCMDetailedTriAssemblyMeshGenerator.h" #include "TriSubChannelMesh.h" #include #include #include "libmesh/cell_prism6.h" #include "libmesh/unstructured_mesh.h" -registerMooseObject("SubChannelApp", SCMDetailedTriSubChannelMeshGenerator); -registerMooseObjectRenamed("SubChannelApp", - DetailedTriSubChannelMeshGenerator, - "06/30/2025 24:00", - SCMDetailedTriSubChannelMeshGenerator); +registerMooseObject("SubChannelApp", SCMDetailedTriAssemblyMeshGenerator); InputParameters -SCMDetailedTriSubChannelMeshGenerator::validParams() +SCMDetailedTriAssemblyMeshGenerator::validParams() { InputParameters params = MeshGenerator::validParams(); params.addClassDescription( - "Creates a detailed mesh of subchannels in a triangular lattice arrangement"); + "Creates a detailed mesh of subchannels and pins in a triangular lattice arrangement"); params.addRequiredParam("pitch", "Pitch [m]"); params.addRequiredParam("pin_diameter", "Rod diameter [m]"); params.addParam("unheated_length_entry", 0.0, "Unheated length at entry [m]"); params.addRequiredParam("heated_length", "Heated length [m]"); params.addParam("unheated_length_exit", 0.0, "Unheated length at exit [m]"); - params.addRequiredParam("nrings", "Number of fuel Pin rings per assembly [-]"); + params.addRequiredParam( + "nrings", + "Number of fuel-pin rings per assembly, counting the center pin as the first ring [-]"); params.addRequiredParam("flat_to_flat", "Flat to flat distance for the hexagonal assembly [m]"); - params.addParam("block_id", 0, "Block ID used for the mesh subdomain."); params.addRequiredParam("n_cells", "The number of cells in the axial direction"); + params.addRangeCheckedParam("num_radial_parts", + 16, + "num_radial_parts>=4", + "Number of radial parts (must be at least 4)."); + params.addParam("subchannel_block_id", 0, "Subchannel block id."); + params.addParam("pin_block_id", 1, "Fuel pin block id."); + params.addParam("block_id", 0, "Deprecated subchannel block id."); params.addParam("verbose_flag", false, "Flag to print out the mesh coordinates."); return params; } -SCMDetailedTriSubChannelMeshGenerator::SCMDetailedTriSubChannelMeshGenerator( +SCMDetailedTriAssemblyMeshGenerator::SCMDetailedTriAssemblyMeshGenerator( const InputParameters & parameters) : MeshGenerator(parameters), _unheated_length_entry(getParam("unheated_length_entry")), @@ -50,11 +54,30 @@ SCMDetailedTriSubChannelMeshGenerator::SCMDetailedTriSubChannelMeshGenerator( _pin_diameter(getParam("pin_diameter")), _n_rings(getParam("nrings")), _flat_to_flat(getParam("flat_to_flat")), - _block_id(getParam("block_id")), + _num_radial_parts(getParam("num_radial_parts")), + _subchannel_block_id(parameters.isParamSetByUser("subchannel_block_id") + ? getParam("subchannel_block_id") + : getParam("block_id")), + _pin_block_id(getParam("pin_block_id")), _n_cells(getParam("n_cells")), - _verbose(getParam("verbose_flag")) + _nrods(0), + _n_channels(0), + _verbose(getParam("verbose_flag")), + _elem_id(0) { - Real L = _unheated_length_entry + _heated_length + _unheated_length_exit; + const Real L = _unheated_length_entry + _heated_length + _unheated_length_exit; + + if (_n_rings < 2) + mooseError(name(), + ": 'nrings' must be at least 2. In this mesh generator, the center pin counts as " + "the first ring, so a 7-pin bundle uses nrings = 2."); + + if (_n_cells == 0) + mooseError(name(), ": The number of axial cells must be greater than zero"); + + if (L <= 0.0) + mooseError(name(), ": Total bundle length must be greater than zero"); + Real dz = L / _n_cells; for (unsigned int i = 0; i < _n_cells + 1; i++) _z_grid.push_back(dz * i); @@ -92,7 +115,7 @@ SCMDetailedTriSubChannelMeshGenerator::SCMDetailedTriSubChannelMeshGenerator( _pins_in_rings[i].push_back(k++); // Given the number of pins and number of fuel Pin rings, the number of subchannels can be // computed as follows: - unsigned int chancount = 0.0; + unsigned int chancount = 0; // Summing internal channels for (unsigned int j = 0; j < _n_rings - 1; j++) chancount += j * 6; @@ -284,23 +307,57 @@ SCMDetailedTriSubChannelMeshGenerator::SCMDetailedTriSubChannelMeshGenerator( _subchannel_position[i][0] = (a2 * x1 - a1 * x0) / (a2 - a1); _subchannel_position[i][1] = (a2 * y1 - a1 * y0) / (a2 - a1); } + } +} - /// Special case _n_rings == 1 - if (_n_rings == 1) +void +SCMDetailedTriAssemblyMeshGenerator::generatePin(std::unique_ptr & mesh_base, + const Point & center) +{ + const Real dalpha = 360. / _num_radial_parts; + const Real radius = _pin_diameter / 2.; + + std::vector> nodes; + nodes.resize(_n_cells + 1); + std::vector center_nodes; + center_nodes.reserve(_n_cells + 1); + for (unsigned int k = 0; k < _n_cells + 1; k++) + { + const Real elev = _z_grid[k]; + center_nodes.push_back(mesh_base->add_point(Point(center(0), center(1), elev))); + nodes[k].push_back(center_nodes.back()); + Real alpha = 0.; + for (unsigned int i = 0; i < _num_radial_parts; i++, alpha += dalpha) { - for (unsigned int i = 0; i < _n_channels; i++) - { - Real angle = (2 * i + 1) * libMesh::pi / 6.0; - _subch_type[i] = EChannelType::CORNER; - _subchannel_position[i][0] = std::cos(angle) * _flat_to_flat / 2.0; - _subchannel_position[i][1] = std::sin(angle) * _flat_to_flat / 2.0; - } + const Real dx = radius * std::cos(alpha * M_PI / 180.); + const Real dy = radius * std::sin(alpha * M_PI / 180.); + nodes[k].push_back(mesh_base->add_point(Point(center(0) + dx, center(1) + dy, elev))); } } + + for (unsigned int k = 0; k < _n_cells; k++) + for (unsigned int i = 0; i < _num_radial_parts; i++) + { + Elem * elem = new Prism6; + elem->subdomain_id() = _pin_block_id; + elem->set_id(_elem_id++); + mesh_base->add_elem(elem); + const unsigned int ctr_idx = 0; + const unsigned int idx1 = (i % _num_radial_parts) + 1; + const unsigned int idx2 = ((i + 1) % _num_radial_parts) + 1; + elem->set_node(0, nodes[k][ctr_idx]); + elem->set_node(1, nodes[k][idx1]); + elem->set_node(2, nodes[k][idx2]); + elem->set_node(3, nodes[k + 1][ctr_idx]); + elem->set_node(4, nodes[k + 1][idx1]); + elem->set_node(5, nodes[k + 1][idx2]); + } + + _pin_nodes.push_back(center_nodes); } std::unique_ptr -SCMDetailedTriSubChannelMeshGenerator::generate() +SCMDetailedTriAssemblyMeshGenerator::generate() { auto mesh_base = buildMeshBaseObject(); BoundaryInfo & boundary_info = mesh_base->get_boundary_info(); @@ -344,19 +401,9 @@ SCMDetailedTriSubChannelMeshGenerator::generate() } // specify number and type of sub-channel - unsigned int n_center, n_side, n_corner; - if (_n_rings == 1) - { - n_corner = 6; - n_side = 0; - n_center = _n_channels - n_side - n_corner; - } - else - { - n_corner = 6; - n_side = (_n_rings - 1) * 6; - n_center = _n_channels - n_side - n_corner; - } + unsigned int n_corner = 6; + unsigned int n_side = (_n_rings - 1) * 6; + unsigned int n_center = _n_channels - n_side - n_corner; if (_verbose) { _console << "Centers: " << n_center << std::endl; @@ -376,13 +423,18 @@ SCMDetailedTriSubChannelMeshGenerator::generate() } const unsigned int n_points = points_per_level * (_n_cells + 1); const unsigned int n_elems = elems_per_level * _n_cells; + const unsigned int n_pins = _pin_position.size(); + const unsigned int pin_points = + n_pins > 0 ? (_n_cells + 1) * (_num_radial_parts + 1) * n_pins : 0; + const unsigned int pin_elems = n_pins > 0 ? _n_cells * _num_radial_parts * n_pins : 0; if (_verbose) { _console << "Number of points: " << n_points << std::endl; _console << "Number of elements: " << n_elems << std::endl; } - mesh_base->reserve_nodes(n_points); - mesh_base->reserve_elem(n_elems); + mesh_base->reserve_nodes(n_points + pin_points); + mesh_base->reserve_elem(n_elems + pin_elems); + _pin_nodes.clear(); // Build an array of points arranged in a circle on the xy-plane. (last and first node overlap) // We build for both the square discretization in the edges and the triangular discretization // within the mesh @@ -444,7 +496,8 @@ SCMDetailedTriSubChannelMeshGenerator::generate() // 0 // 4 5 8 9 // 6 7 - std::array center_points; + std::array center_points{}; + center_points[0] = Point(0, 0, 0); { unsigned int start; for (unsigned int i = 0; i < 3; i++) @@ -471,7 +524,8 @@ SCMDetailedTriSubChannelMeshGenerator::generate() // 0 // 4 2 3 // 1 - std::array corner_points; + std::array corner_points{}; + corner_points[0] = Point(0, 0, 0); { for (unsigned int ii = 0; ii < points_per_sixth; ii++) { @@ -507,7 +561,8 @@ SCMDetailedTriSubChannelMeshGenerator::generate() // 0 // 1 2 5 6 // 3 4 - std::array side_points; + std::array side_points{}; + side_points[0] = Point(0, 0, 0); { for (unsigned int ii = 0; ii < points_per_quadrant; ii++) { @@ -753,7 +808,7 @@ SCMDetailedTriSubChannelMeshGenerator::generate() for (unsigned int i = 0; i < elems_per_channel; i++) { Elem * elem = new Prism6; - elem->subdomain_id() = _block_id; + elem->subdomain_id() = _subchannel_block_id; elem->set_id(elem_id++); elem = mesh_base->add_elem(elem); @@ -787,7 +842,15 @@ SCMDetailedTriSubChannelMeshGenerator::generate() _console << "Element counter: " << element_counter << std::endl; boundary_info.sideset_name(0) = "inlet"; boundary_info.sideset_name(1) = "outlet"; - mesh_base->subdomain_name(_block_id) = name(); + mesh_base->subdomain_name(_subchannel_block_id) = "subchannel"; + if (n_pins > 0) + { + _elem_id = mesh_base->n_elem(); + for (auto & ctr : _pin_position) + generatePin(mesh_base, ctr); + } + if (n_pins > 0) + mesh_base->subdomain_name(_pin_block_id) = "fuel_pins"; if (_verbose) _console << "Mesh assembly done" << std::endl; mesh_base->prepare_for_use(); @@ -796,43 +859,18 @@ SCMDetailedTriSubChannelMeshGenerator::generate() } Point -SCMDetailedTriSubChannelMeshGenerator::rotatePoint(Point b, Real theta) +SCMDetailedTriAssemblyMeshGenerator::rotatePoint(Point b, Real theta) { - - // Building rotation matrix - std::vector> A; - A.resize(3); - for (std::vector a : A) - { - a.resize(3); - } + std::vector> A(3, std::vector(3)); A[0] = {std::cos(theta), -std::sin(theta), 0.0}; A[1] = {std::sin(theta), std::cos(theta), 0.0}; A[2] = {0.0, 0.0, 1.0}; - // Rotating vector Point rotated_vector = Point(0.0, 0.0, 0.0); for (unsigned int i = 0; i < 3; i++) - { for (unsigned int j = 0; j < 3; j++) - { rotated_vector(i) += A[i][j] * b(j); - } - } return rotated_vector; } - -Point -SCMDetailedTriSubChannelMeshGenerator::translatePoint(Point & b, Point & translation_vector) -{ - // Translating point - Point translated_vector = Point(0.0, 0.0, 0.0); - for (unsigned int i = 0; i < 3; i++) - { - translated_vector(i) = b(i) + translation_vector(i); - } - - return translated_vector; -} diff --git a/modules/subchannel/src/meshgenerators/SCMDetailedTriPinMeshGenerator.C b/modules/subchannel/src/meshgenerators/SCMDetailedTriPinMeshGenerator.C deleted file mode 100644 index b2fe4b8cd751..000000000000 --- a/modules/subchannel/src/meshgenerators/SCMDetailedTriPinMeshGenerator.C +++ /dev/null @@ -1,57 +0,0 @@ -//* 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 - -#include "SCMDetailedTriPinMeshGenerator.h" -#include "TriSubChannelMesh.h" -#include "libmesh/cell_prism6.h" - -registerMooseObject("SubChannelApp", SCMDetailedTriPinMeshGenerator); -registerMooseObjectRenamed("SubChannelApp", - DetailedTriPinMeshGenerator, - "06/30/2025 24:00", - SCMDetailedTriPinMeshGenerator); - -InputParameters -SCMDetailedTriPinMeshGenerator::validParams() -{ - InputParameters params = DetailedPinMeshGeneratorBase::validParams(); - params.addClassDescription( - "Creates a detailed mesh of fuel pins in a triangular lattice arrangement"); - params.addRequiredParam("input", "The corresponding subchannel mesh"); - params.addRequiredParam("nrings", "Number of fuel Pin rings per assembly [-]"); - return params; -} - -SCMDetailedTriPinMeshGenerator::SCMDetailedTriPinMeshGenerator(const InputParameters & parameters) - : DetailedPinMeshGeneratorBase(parameters), - _input(getMesh("input")), - _n_rings(getParam("nrings")) -{ -} - -std::unique_ptr -SCMDetailedTriPinMeshGenerator::generate() -{ - std::unique_ptr mesh_base = std::move(_input); - if (!mesh_base) - mesh_base = buildMeshBaseObject(); - mesh_base->set_mesh_dimension(3); - - std::vector pin_centers; - TriSubChannelMesh::pinPositions(pin_centers, _n_rings, _pitch, Point(0, 0)); - - _elem_id = mesh_base->n_elem(); - for (auto & ctr : pin_centers) - generatePin(mesh_base, ctr); - - mesh_base->subdomain_name(_block_id) = name(); - mesh_base->prepare_for_use(); - - return mesh_base; -} diff --git a/modules/subchannel/src/meshgenerators/SCMQuadAssemblyMeshGenerator.C b/modules/subchannel/src/meshgenerators/SCMQuadAssemblyMeshGenerator.C new file mode 100644 index 000000000000..a5542a71f885 --- /dev/null +++ b/modules/subchannel/src/meshgenerators/SCMQuadAssemblyMeshGenerator.C @@ -0,0 +1,521 @@ +//* 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 + +#include "SCMQuadAssemblyMeshGenerator.h" +#include "SubChannelMesh.h" + +#include "libmesh/edge_edge2.h" + +#include +#include +#include +#include + +registerMooseObject("SubChannelApp", SCMQuadAssemblyMeshGenerator); + +InputParameters +SCMQuadAssemblyMeshGenerator::validParams() +{ + InputParameters params = MeshGenerator::validParams(); + params.addClassDescription("Creates one mesh containing both 1D subchannels and 1D pins in a " + "square lattice arrangement"); + + params.addRequiredParam("pitch", "Pitch [m]"); + params.addRequiredParam("pin_diameter", "Rod diameter [m]"); + params.addParam("unheated_length_entry", 0.0, "Unheated length at entry [m]"); + params.addRequiredParam("heated_length", "Heated length [m]"); + params.addParam("unheated_length_exit", 0.0, "Unheated length at exit [m]"); + + params.addParam>( + "spacer_z", {}, "Axial location of spacers/vanes/mixing_vanes [m]"); + params.addParam>( + "spacer_k", {}, "K-loss coefficient of spacers/vanes/mixing_vanes [-]"); + + params.addParam>("z_blockage", + std::vector({0.0, 0.0}), + "Axial location of blockage (inlet, outlet) [m]"); + params.addParam>("index_blockage", + std::vector({0}), + "Index of subchannels affected by blockage"); + params.addParam>("reduction_blockage", + std::vector({1.0}), + "Area reduction of subchannels affected by blockage"); + params.addParam>( + "k_blockage", std::vector({0.0}), "Form loss coefficient of blocked subchannels"); + + params.addParam("Kij", 0.5, "Lateral form loss coefficient [-]"); + params.addRequiredParam("n_cells", "The number of cells in the axial direction"); + params.addRequiredParam("nx", "Number of channels in the x direction [-]"); + params.addRequiredParam("ny", "Number of channels in the y direction [-]"); + + params.addRequiredParam( + "side_gap", + "The side gap, not to be confused with the gap between pins; this refers to the gap next " + "to the duct or else the distance between the subchannel centroid and the duct wall. " + "distance(edge pin center, duct wall) = pitch / 2 + side_gap [m]"); + + params.addParam("subchannel_block_id", 0, "Subchannel block id"); + params.addParam("pin_block_id", 1, "Fuel Pin block id"); + + return params; +} + +SCMQuadAssemblyMeshGenerator::SCMQuadAssemblyMeshGenerator(const InputParameters & params) + : MeshGenerator(params), + _unheated_length_entry(getParam("unheated_length_entry")), + _heated_length(getParam("heated_length")), + _unheated_length_exit(getParam("unheated_length_exit")), + _spacer_z(getParam>("spacer_z")), + _spacer_k(getParam>("spacer_k")), + _z_blockage(getParam>("z_blockage")), + _index_blockage(getParam>("index_blockage")), + _reduction_blockage(getParam>("reduction_blockage")), + _k_blockage(getParam>("k_blockage")), + _kij(getParam("Kij")), + _pitch(getParam("pitch")), + _pin_diameter(getParam("pin_diameter")), + _n_cells(getParam("n_cells")), + _nx(getParam("nx")), + _ny(getParam("ny")), + _n_channels(0), + _n_gaps(0), + _n_pins(0), + _side_gap(getParam("side_gap")), + _subchannel_block_id(getParam("subchannel_block_id")), + _pin_block_id(getParam("pin_block_id")) +{ + const Real total_length = _unheated_length_entry + _heated_length + _unheated_length_exit; + + if (_n_cells == 0) + mooseError(name(), ": The number of axial cells must be greater than zero"); + + if (total_length <= 0.0) + mooseError(name(), ": Total bundle length must be greater than zero"); + + if (_nx == 0 || _ny == 0) + mooseError(name(), ": The number of subchannels must be greater than zero in each direction"); + + if (_nx < 2 && _ny < 2) + mooseError(name(), + ": The number of subchannels cannot be less than 2 in both directions. " + "Smallest assembly allowed is either 2X1 or 1X2."); + + _n_channels = _nx * _ny; + _n_gaps = (_nx - 1) * _ny + (_ny - 1) * _nx; + _n_pins = (_nx - 1) * (_ny - 1); + + if (_spacer_z.size() != _spacer_k.size()) + mooseError(name(), ": Size of vector spacer_z should equal size of spacer_k"); + + for (const auto spacer_z : _spacer_z) + if (spacer_z < 0.0 || spacer_z > total_length) + mooseError(name(), ": Spacer locations must be between zero and total bundle length"); + + if (_z_blockage.size() != 2) + mooseError(name(), ": Size of vector z_blockage must be 2"); + + if (_z_blockage.front() > _z_blockage.back()) + mooseError(name(), ": z_blockage inlet location must not exceed outlet location"); + + if (!_index_blockage.empty() && + *std::max_element(_index_blockage.begin(), _index_blockage.end()) > (_n_channels - 1)) + mooseError(name(), ": Blocked subchannel index exceeds valid subchannel range"); + + if (!_reduction_blockage.empty() && + *std::max_element(_reduction_blockage.begin(), _reduction_blockage.end()) > 1.0) + mooseError(name(), ": Area reduction of blocked subchannels cannot exceed 1"); + + if ((_index_blockage.size() > _n_channels) || (_reduction_blockage.size() > _n_channels) || + (_k_blockage.size() > _n_channels)) + mooseError(name(), + ": Sizes of blockage-related vectors cannot exceed total number of subchannels"); + + if ((_index_blockage.size() != _reduction_blockage.size()) || + (_index_blockage.size() != _k_blockage.size()) || + (_reduction_blockage.size() != _k_blockage.size())) + mooseError(name(), ": index_blockage, reduction_blockage, and k_blockage must have equal size"); + + SubChannelMesh::generateZGrid( + _unheated_length_entry, _heated_length, _unheated_length_exit, _n_cells, _z_grid); + + initializeChannelData(); +} + +void +SCMQuadAssemblyMeshGenerator::initializeChannelData() +{ + const Real L = _unheated_length_entry + _heated_length + _unheated_length_exit; + + std::vector spacer_cell; + for (const auto & elem : _spacer_z) + spacer_cell.emplace_back(std::round(elem * _n_cells / L)); + + std::vector kgrid(_n_cells + 1, 0.0); + _k_grid.resize(_n_channels, std::vector(_n_cells + 1)); + + for (unsigned int index = 0; index < spacer_cell.size(); index++) + kgrid[spacer_cell[index]] += _spacer_k[index]; + + for (unsigned int i = 0; i < _n_channels; i++) + _k_grid[i] = kgrid; + + const Real dz = L / _n_cells; + for (unsigned int i = 0; i < _n_cells + 1; i++) + if ((dz * i >= _z_blockage.front() && dz * i <= _z_blockage.back())) + { + unsigned int index = 0; + for (const auto & i_ch : _index_blockage) + { + _k_grid[i_ch][i] += _k_blockage[index]; + index++; + } + } + + _gap_to_chan_map.resize(_n_gaps); + _gap_to_pin_map.resize(_n_gaps); + _gapnodes.resize(_n_gaps); + _chan_to_gap_map.resize(_n_channels); + _chan_to_pin_map.resize(_n_channels); + _pin_to_chan_map.resize(_n_pins); + _sign_id_crossflow_map.resize(_n_channels); + _gij_map.resize(_n_cells + 1); + _subchannel_position.resize(_n_channels); + + for (unsigned int i = 0; i < _n_channels; i++) + { + _subchannel_position[i].reserve(3); + for (unsigned int j = 0; j < 3; j++) + _subchannel_position.at(i).push_back(0.0); + } + + for (unsigned int iz = 0; iz < _n_cells + 1; iz++) + _gij_map[iz].reserve(_n_gaps); + + const Real positive_flow = 1.0; + const Real negative_flow = -1.0; + + _subch_type.resize(_n_channels); + for (unsigned int iy = 0; iy < _ny; iy++) + for (unsigned int ix = 0; ix < _nx; ix++) + { + const unsigned int i_ch = _nx * iy + ix; + const bool is_corner = (ix == 0 && iy == 0) || (ix == _nx - 1 && iy == 0) || + (ix == 0 && iy == _ny - 1) || (ix == _nx - 1 && iy == _ny - 1); + const bool is_edge = (ix == 0 || iy == 0 || ix == _nx - 1 || iy == _ny - 1); + + if (_n_channels == 2) + _subch_type[i_ch] = EChannelType::CENTER; + else if (_n_channels == 4) + _subch_type[i_ch] = EChannelType::CORNER; + else if (is_corner) + _subch_type[i_ch] = EChannelType::CORNER; + else if (is_edge) + _subch_type[i_ch] = EChannelType::EDGE; + else + _subch_type[i_ch] = EChannelType::CENTER; + } + + unsigned int i_gap = 0; + for (unsigned int iy = 0; iy < _ny; iy++) + for (unsigned int ix = 0; ix < _nx - 1; ix++) + { + const unsigned int i_ch = _nx * iy + ix; + const unsigned int j_ch = _nx * iy + (ix + 1); + _gap_to_chan_map[i_gap] = {i_ch, j_ch}; + _chan_to_gap_map[i_ch].push_back(i_gap); + _chan_to_gap_map[j_ch].push_back(i_gap); + _sign_id_crossflow_map[i_ch].push_back(positive_flow); + _sign_id_crossflow_map[j_ch].push_back(negative_flow); + + if (iy == 0 || iy == _ny - 1) + _gij_map[0].push_back((_pitch - _pin_diameter) / 2.0 + _side_gap); + else + _gij_map[0].push_back(_pitch - _pin_diameter); + + ++i_gap; + } + + for (unsigned int iy = 0; iy < _ny - 1; iy++) + for (unsigned int ix = 0; ix < _nx; ix++) + { + const unsigned int i_ch = _nx * iy + ix; + const unsigned int j_ch = _nx * (iy + 1) + ix; + _gap_to_chan_map[i_gap] = {i_ch, j_ch}; + _chan_to_gap_map[i_ch].push_back(i_gap); + _chan_to_gap_map[j_ch].push_back(i_gap); + _sign_id_crossflow_map[i_ch].push_back(positive_flow); + _sign_id_crossflow_map[j_ch].push_back(negative_flow); + + if (ix == 0 || ix == _nx - 1) + _gij_map[0].push_back((_pitch - _pin_diameter) / 2.0 + _side_gap); + else + _gij_map[0].push_back(_pitch - _pin_diameter); + + ++i_gap; + } + + for (unsigned int iz = 1; iz < _n_cells + 1; iz++) + _gij_map[iz] = _gij_map[0]; + + for (unsigned int iy = 0; iy < _ny - 1; iy++) + for (unsigned int ix = 0; ix < _nx - 1; ix++) + { + const unsigned int i_pin = (_nx - 1) * iy + ix; + const unsigned int i_chan_1 = _nx * iy + ix; + const unsigned int i_chan_2 = _nx * (iy + 1) + ix; + const unsigned int i_chan_3 = _nx * (iy + 1) + (ix + 1); + const unsigned int i_chan_4 = _nx * iy + (ix + 1); + + _pin_to_chan_map[i_pin].push_back(i_chan_1); + _pin_to_chan_map[i_pin].push_back(i_chan_2); + _pin_to_chan_map[i_pin].push_back(i_chan_3); + _pin_to_chan_map[i_pin].push_back(i_chan_4); + } + + for (unsigned int iy = 0; iy < _ny; iy++) + for (unsigned int ix = 0; ix < _nx; ix++) + { + const unsigned int i_ch = _nx * iy + ix; + const Real offset_x = (_nx - 1) * _pitch / 2.0; + const Real offset_y = (_ny - 1) * _pitch / 2.0; + _subchannel_position[i_ch][0] = _pitch * ix - offset_x; + _subchannel_position[i_ch][1] = _pitch * iy - offset_y; + } + + if (_n_pins > 0) + { + for (unsigned int iy = 0; iy < _ny; iy++) + for (unsigned int ix = 0; ix < _nx; ix++) + { + const unsigned int i_ch = _nx * iy + ix; + + if (iy == 0 && ix == 0) + _chan_to_pin_map[i_ch].push_back((_nx - 1) * iy + ix); + else if (iy == _ny - 1 && ix == 0) + _chan_to_pin_map[i_ch].push_back((_nx - 1) * (iy - 1) + ix); + else if (iy == 0 && ix == _nx - 1) + _chan_to_pin_map[i_ch].push_back((_nx - 1) * iy + ix - 1); + else if (iy == _ny - 1 && ix == _nx - 1) + _chan_to_pin_map[i_ch].push_back((_nx - 1) * (iy - 1) + ix - 1); + else if (iy == 0) + { + _chan_to_pin_map[i_ch].push_back((_nx - 1) * iy + ix); + _chan_to_pin_map[i_ch].push_back((_nx - 1) * iy + ix - 1); + } + else if (iy == _ny - 1) + { + _chan_to_pin_map[i_ch].push_back((_nx - 1) * (iy - 1) + ix); + _chan_to_pin_map[i_ch].push_back((_nx - 1) * (iy - 1) + ix - 1); + } + else if (ix == 0) + { + _chan_to_pin_map[i_ch].push_back((_nx - 1) * iy + ix); + _chan_to_pin_map[i_ch].push_back((_nx - 1) * (iy - 1) + ix); + } + else if (ix == _nx - 1) + { + _chan_to_pin_map[i_ch].push_back((_nx - 1) * iy + ix - 1); + _chan_to_pin_map[i_ch].push_back((_nx - 1) * (iy - 1) + ix - 1); + } + else + { + _chan_to_pin_map[i_ch].push_back((_nx - 1) * iy + ix); + _chan_to_pin_map[i_ch].push_back((_nx - 1) * iy + ix - 1); + _chan_to_pin_map[i_ch].push_back((_nx - 1) * (iy - 1) + ix); + _chan_to_pin_map[i_ch].push_back((_nx - 1) * (iy - 1) + ix - 1); + } + } + + for (unsigned int ig = 0; ig < _n_gaps; ig++) + { + const auto i_ch = _gap_to_chan_map[ig].first; + const auto j_ch = _gap_to_chan_map[ig].second; + const auto & i_pins = _chan_to_pin_map[i_ch]; + const auto & j_pins = _chan_to_pin_map[j_ch]; + + _gap_to_pin_map[ig] = {10000, 10000}; + + for (unsigned int i : i_pins) + for (unsigned int j : j_pins) + if (i == j) + { + if (_gap_to_pin_map[ig].first == 10000) + { + _gap_to_pin_map[ig].first = i; + _gap_to_pin_map[ig].second = i; + } + else + _gap_to_pin_map[ig].second = i; + } + } + } + + for (auto & gap : _chan_to_gap_map) + gap.shrink_to_fit(); + for (auto & pin : _chan_to_pin_map) + pin.shrink_to_fit(); + for (auto & pin : _pin_to_chan_map) + pin.shrink_to_fit(); +} + +void +SCMQuadAssemblyMeshGenerator::buildSubchannelMesh(MeshBase & mesh_base, + BoundaryInfo & boundary_info) +{ + mesh_base.reserve_elem(mesh_base.n_elem() + _n_cells * _ny * _nx); + mesh_base.reserve_nodes(mesh_base.n_nodes() + (_n_cells + 1) * _ny * _nx); + + _nodes.resize(_nx * _ny); + + const Real offset_x = (_nx - 1) * _pitch / 2.0; + const Real offset_y = (_ny - 1) * _pitch / 2.0; + + dof_id_type node_id = mesh_base.n_nodes(); + for (unsigned int iy = 0; iy < _ny; iy++) + for (unsigned int ix = 0; ix < _nx; ix++) + { + const unsigned int i_ch = _nx * iy + ix; + _nodes[i_ch].reserve(_n_cells + 1); + + for (unsigned int iz = 0; iz < _n_cells + 1; iz++) + _nodes[i_ch].push_back(mesh_base.add_point( + Point(_pitch * ix - offset_x, _pitch * iy - offset_y, _z_grid[iz]), node_id++)); + } + + dof_id_type elem_id = mesh_base.n_elem(); + for (unsigned int iy = 0; iy < _ny; iy++) + for (unsigned int ix = 0; ix < _nx; ix++) + for (unsigned int iz = 0; iz < _n_cells; iz++) + { + Elem * elem = new Edge2; + elem->subdomain_id() = _subchannel_block_id; + elem->set_id(elem_id++); + elem = mesh_base.add_elem(elem); + + const unsigned int i_ch = _nx * iy + ix; + elem->set_node(0, _nodes[i_ch][iz]); + elem->set_node(1, _nodes[i_ch][iz + 1]); + + if (iz == 0) + boundary_info.add_side(elem, 0, 0); + if (iz == _n_cells - 1) + boundary_info.add_side(elem, 1, 1); + } + + mesh_base.subdomain_name(_subchannel_block_id) = "subchannel"; +} + +void +SCMQuadAssemblyMeshGenerator::buildPinMesh(MeshBase & mesh_base) +{ + mesh_base.reserve_elem(mesh_base.n_elem() + _n_cells * (_ny - 1) * (_nx - 1)); + mesh_base.reserve_nodes(mesh_base.n_nodes() + (_n_cells + 1) * (_ny - 1) * (_nx - 1)); + + _pin_nodes.resize((_nx - 1) * (_ny - 1)); + + const Real offset_x = (_nx - 2) * _pitch / 2.0; + const Real offset_y = (_ny - 2) * _pitch / 2.0; + + dof_id_type node_id = mesh_base.n_nodes(); + for (unsigned int iy = 0; iy < _ny - 1; iy++) + for (unsigned int ix = 0; ix < _nx - 1; ix++) + { + const unsigned int i_pin = (_nx - 1) * iy + ix; + _pin_nodes[i_pin].reserve(_n_cells + 1); + + for (unsigned int iz = 0; iz < _n_cells + 1; iz++) + _pin_nodes[i_pin].push_back(mesh_base.add_point( + Point(_pitch * ix - offset_x, _pitch * iy - offset_y, _z_grid[iz]), node_id++)); + } + + dof_id_type elem_id = mesh_base.n_elem(); + for (unsigned int iy = 0; iy < _ny - 1; iy++) + for (unsigned int ix = 0; ix < _nx - 1; ix++) + for (unsigned int iz = 0; iz < _n_cells; iz++) + { + Elem * elem = new Edge2; + elem->subdomain_id() = _pin_block_id; + elem->set_id(elem_id++); + elem = mesh_base.add_elem(elem); + + const unsigned int i_pin = (_nx - 1) * iy + ix; + elem->set_node(0, _pin_nodes[i_pin][iz]); + elem->set_node(1, _pin_nodes[i_pin][iz + 1]); + } + + mesh_base.subdomain_name(_pin_block_id) = "fuel_pins"; +} + +void +SCMQuadAssemblyMeshGenerator::transferMetadata(QuadSubChannelMesh & sch_mesh) +{ + sch_mesh._unheated_length_entry = _unheated_length_entry; + sch_mesh._heated_length = _heated_length; + sch_mesh._unheated_length_exit = _unheated_length_exit; + sch_mesh._z_grid = _z_grid; + sch_mesh._k_grid = _k_grid; + sch_mesh._spacer_z = _spacer_z; + sch_mesh._spacer_k = _spacer_k; + sch_mesh._z_blockage = _z_blockage; + sch_mesh._index_blockage = _index_blockage; + sch_mesh._reduction_blockage = _reduction_blockage; + sch_mesh._kij = _kij; + sch_mesh._pitch = _pitch; + sch_mesh._pin_diameter = _pin_diameter; + sch_mesh._n_cells = _n_cells; + + sch_mesh._nx = _nx; + sch_mesh._ny = _ny; + sch_mesh._n_channels = _n_channels; + sch_mesh._n_gaps = _n_gaps; + sch_mesh._n_pins = _n_pins; + sch_mesh._side_gap = _side_gap; + + sch_mesh._nodes = _nodes; + sch_mesh._pin_nodes = _pin_nodes; + sch_mesh._gapnodes = _gapnodes; + sch_mesh._gap_to_chan_map = _gap_to_chan_map; + sch_mesh._gap_to_pin_map = _gap_to_pin_map; + sch_mesh._chan_to_gap_map = _chan_to_gap_map; + sch_mesh._chan_to_pin_map = _chan_to_pin_map; + sch_mesh._pin_to_chan_map = _pin_to_chan_map; + sch_mesh._sign_id_crossflow_map = _sign_id_crossflow_map; + sch_mesh._gij_map = _gij_map; + sch_mesh._subchannel_position = _subchannel_position; + sch_mesh._subch_type = _subch_type; + + sch_mesh._duct_mesh_exist = false; + sch_mesh._pin_mesh_exist = (_n_pins > 0); +} + +std::unique_ptr +SCMQuadAssemblyMeshGenerator::generate() +{ + auto mesh_base = buildMeshBaseObject(); + BoundaryInfo & boundary_info = mesh_base->get_boundary_info(); + + mesh_base->set_spatial_dimension(3); + + buildSubchannelMesh(*mesh_base, boundary_info); + + if (_n_pins > 0) + buildPinMesh(*mesh_base); + + boundary_info.sideset_name(0) = "inlet"; + boundary_info.sideset_name(1) = "outlet"; + boundary_info.nodeset_name(0) = "inlet"; + boundary_info.nodeset_name(1) = "outlet"; + + mesh_base->prepare_for_use(); + + auto & sch_mesh = static_cast(*_mesh); + transferMetadata(sch_mesh); + + return mesh_base; +} diff --git a/modules/subchannel/src/meshgenerators/SCMQuadPinMeshGenerator.C b/modules/subchannel/src/meshgenerators/SCMQuadPinMeshGenerator.C deleted file mode 100644 index 5cdacb66dd6d..000000000000 --- a/modules/subchannel/src/meshgenerators/SCMQuadPinMeshGenerator.C +++ /dev/null @@ -1,120 +0,0 @@ -//* 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 - -#include "SCMQuadPinMeshGenerator.h" -#include "QuadSubChannelMesh.h" -#include "libmesh/edge_edge2.h" - -registerMooseObject("SubChannelApp", SCMQuadPinMeshGenerator); -registerMooseObjectRenamed("SubChannelApp", - QuadPinMeshGenerator, - "06/30/2025 24:00", - SCMQuadPinMeshGenerator); - -InputParameters -SCMQuadPinMeshGenerator::validParams() -{ - InputParameters params = MeshGenerator::validParams(); - params.addClassDescription("Creates a mesh of 1D fuel pins in a square lattice arrangement"); - params.addRequiredParam("input", "The corresponding subchannel mesh"); - params.addParam("unheated_length_entry", 0.0, "Unheated length at entry [m]"); - params.addRequiredParam("heated_length", "Heated length [m]"); - params.addParam("unheated_length_exit", 0.0, "Unheated length at exit [m]"); - params.addRequiredParam("pitch", "Pitch [m]"); - params.addRequiredParam("nx", "Number of subchannels in the x direction [-]"); - params.addRequiredParam("ny", "Number of subchannels in the y direction [-]"); - params.addRequiredParam("n_cells", "The number of cells in the axial direction"); - params.addParam("block_id", 1, "Domain Index"); - return params; -} - -SCMQuadPinMeshGenerator::SCMQuadPinMeshGenerator(const InputParameters & params) - : MeshGenerator(params), - _input(getMesh("input")), - _unheated_length_entry(getParam("unheated_length_entry")), - _heated_length(getParam("heated_length")), - _unheated_length_exit(getParam("unheated_length_exit")), - _pitch(getParam("pitch")), - _nx(getParam("nx")), - _ny(getParam("ny")), - _n_cells(getParam("n_cells")), - _block_id(getParam("block_id")) -{ - Real dz = (_unheated_length_entry + _heated_length + _unheated_length_exit) / _n_cells; - for (unsigned int i = 0; i < _n_cells + 1; i++) - _z_grid.push_back(dz * i); -} - -std::unique_ptr -SCMQuadPinMeshGenerator::generate() -{ - std::unique_ptr mesh_base = std::move(_input); - if (!mesh_base) - mesh_base = buildMeshBaseObject(); - mesh_base->set_mesh_dimension(3); - mesh_base->reserve_elem(_n_cells * (_ny - 1) * (_nx - 1)); - mesh_base->reserve_nodes((_n_cells + 1) * (_ny - 1) * (_nx - 1)); - _pin_nodes.resize((_nx - 1) * (_ny - 1)); - // number of nodes in subchannel mesh - unsigned int node_sub = (_n_cells + 1) * _ny * _nx; - // number of elements in subchannel mesh - unsigned int elem_sub = _n_cells * _ny * _nx; - - // Add the points in the shape of a rectilinear grid. The grid is regular - // on the xy-plane with a spacing of `pitch` between points. The grid along - // z is also regular. Store pointers in the _nodes - // array so we can keep track of which points are in which pins. - Real offset_x = (_nx - 2) * _pitch / 2.0; - Real offset_y = (_ny - 2) * _pitch / 2.0; - unsigned int node_id = node_sub; - for (unsigned int iy = 0; iy < _ny - 1; iy++) - { - for (unsigned int ix = 0; ix < _nx - 1; ix++) - { - int i_node = (_nx - 1) * iy + ix; - _pin_nodes[i_node].reserve(_n_cells); - for (unsigned int iz = 0; iz < _n_cells + 1; iz++) - { - _pin_nodes[i_node].push_back(mesh_base->add_point( - Point(_pitch * ix - offset_x, _pitch * iy - offset_y, _z_grid[iz]), node_id++)); - } - } - } - - // Add the elements which in this case are 2-node edges that link each - // subchannel's nodes vertically. - unsigned int elem_id = elem_sub; - for (unsigned int iy = 0; iy < _ny - 1; iy++) - { - for (unsigned int ix = 0; ix < _nx - 1; ix++) - { - for (unsigned int iz = 0; iz < _n_cells; iz++) - { - Elem * elem = new Edge2; - elem->subdomain_id() = _block_id; - elem->set_id(elem_id++); - elem = mesh_base->add_elem(elem); - const int indx1 = ((_n_cells + 1) * (_nx - 1)) * iy + (_n_cells + 1) * ix + iz + node_sub; - const int indx2 = - ((_n_cells + 1) * (_nx - 1)) * iy + (_n_cells + 1) * ix + (iz + 1) + node_sub; - elem->set_node(0, mesh_base->node_ptr(indx1)); - elem->set_node(1, mesh_base->node_ptr(indx2)); - } - } - } - mesh_base->subdomain_name(_block_id) = name(); - mesh_base->prepare_for_use(); - - // move the meta data into QuadSubChannelMesh - auto & sch_mesh = static_cast(*_mesh); - sch_mesh._pin_nodes = _pin_nodes; - sch_mesh._pin_mesh_exist = true; - - return mesh_base; -} diff --git a/modules/subchannel/src/meshgenerators/SCMQuadSubChannelMeshGenerator.C b/modules/subchannel/src/meshgenerators/SCMQuadSubChannelMeshGenerator.C deleted file mode 100644 index 14e6e67fce9d..000000000000 --- a/modules/subchannel/src/meshgenerators/SCMQuadSubChannelMeshGenerator.C +++ /dev/null @@ -1,489 +0,0 @@ -//* 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 - -#include "SCMQuadSubChannelMeshGenerator.h" -#include "QuadSubChannelMesh.h" -#include "libmesh/edge_edge2.h" -#include - -registerMooseObject("SubChannelApp", SCMQuadSubChannelMeshGenerator); -registerMooseObjectRenamed("SubChannelApp", - QuadSubChannelMeshGenerator, - "06/30/2025 24:00", - SCMQuadSubChannelMeshGenerator); - -InputParameters -SCMQuadSubChannelMeshGenerator::validParams() -{ - InputParameters params = MeshGenerator::validParams(); - params.addClassDescription("Creates a mesh of 1D subchannels in a square lattice arrangement"); - params.addRequiredParam("pitch", "Pitch [m]"); - params.addRequiredParam("pin_diameter", "Rod diameter [m]"); - params.addParam("unheated_length_entry", 0.0, "Unheated length at entry [m]"); - params.addRequiredParam("heated_length", "Heated length [m]"); - params.addParam("unheated_length_exit", 0.0, "Unheated length at exit [m]"); - params.addParam>( - "spacer_z", {}, "Axial location of spacers/vanes/mixing_vanes [m]"); - params.addParam>( - "spacer_k", {}, "K-loss coefficient of spacers/vanes/mixing_vanes [-]"); - params.addParam>("z_blockage", - std::vector({0.0, 0.0}), - "axial location of blockage (inlet, outlet) [m]"); - params.addParam>("index_blockage", - std::vector({0}), - "index of subchannels affected by blockage"); - params.addParam>( - "reduction_blockage", - std::vector({1.0}), - "Area reduction of subchannels affected by blockage (number to muliply the area)"); - params.addParam>("k_blockage", - std::vector({0.0}), - "Form loss coefficient of subchannels affected by blockage"); - - params.addParam("Kij", 0.5, "Lateral form loss coefficient [-]"); - params.addRequiredParam("n_cells", "The number of cells in the axial direction"); - params.addRequiredParam("nx", "Number of channels in the x direction [-]"); - params.addRequiredParam("ny", "Number of channels in the y direction [-]"); - params.addRequiredParam( - "gap", - "The side gap, not to be confused with the gap between pins, this refers to the gap " - "next to the duct or else the distance between the subchannel centroid to the duct wall." - "distance(edge pin center, duct wall) = pitch / 2 + side_gap [m]"); - params.deprecateParam("gap", "side_gap", "08/06/2026"); - params.addParam("block_id", 0, "Domain Index"); - return params; -} - -SCMQuadSubChannelMeshGenerator::SCMQuadSubChannelMeshGenerator(const InputParameters & params) - : MeshGenerator(params), - _unheated_length_entry(getParam("unheated_length_entry")), - _heated_length(getParam("heated_length")), - _unheated_length_exit(getParam("unheated_length_exit")), - _spacer_z(getParam>("spacer_z")), - _spacer_k(getParam>("spacer_k")), - _z_blockage(getParam>("z_blockage")), - _index_blockage(getParam>("index_blockage")), - _reduction_blockage(getParam>("reduction_blockage")), - _k_blockage(getParam>("k_blockage")), - _kij(getParam("Kij")), - _pitch(getParam("pitch")), - _pin_diameter(getParam("pin_diameter")), - _n_cells(getParam("n_cells")), - _nx(getParam("nx")), - _ny(getParam("ny")), - _n_channels(_nx * _ny), - _n_gaps((_nx - 1) * _ny + (_ny - 1) * _nx), - _n_pins((_nx - 1) * (_ny - 1)), - _side_gap(getParam("side_gap")), - _block_id(getParam("block_id")) -{ - if (_spacer_z.size() != _spacer_k.size()) - mooseError(name(), ": Size of vector spacer_z should be equal to size of vector spacer_k"); - - if (_spacer_z.size() && - _spacer_z.back() > _unheated_length_entry + _heated_length + _unheated_length_exit) - mooseError(name(), ": Location of spacers should be less than the total bundle length"); - - if (_z_blockage.size() != 2) - mooseError(name(), ": Size of vector z_blockage must be 2"); - - if (*max_element(_index_blockage.begin(), _index_blockage.end()) > (_n_channels - 1)) - mooseError(name(), - ": The index of the blocked subchannel cannot be more than the max index of the " - "subchannels"); - - if (*max_element(_reduction_blockage.begin(), _reduction_blockage.end()) > 1) - mooseError(name(), ": The area reduction of the blocked subchannels cannot be more than 1"); - - if ((_index_blockage.size() > _nx * _ny) || (_reduction_blockage.size() > _nx * _ny) || - (_k_blockage.size() > _nx * _ny)) - mooseError(name(), - ": Size of vectors: index_blockage, reduction_blockage, k_blockage, cannot be more " - "than the total number of subchannels"); - - if ((_index_blockage.size() != _reduction_blockage.size()) || - (_index_blockage.size() != _k_blockage.size()) || - (_reduction_blockage.size() != _k_blockage.size())) - mooseError(name(), - ": Size of vectors: index_blockage, reduction_blockage, k_blockage, must be equal " - "to eachother"); - - if (_nx < 2 && _ny < 2) - mooseError(name(), - ": The number of subchannels cannot be less than 2 in both directions (x and y). " - "Smallest assembly allowed is either 2X1 or 1X2. "); - - SubChannelMesh::generateZGrid( - _unheated_length_entry, _heated_length, _unheated_length_exit, _n_cells, _z_grid); - - // Defining the total length from 3 axial sections - Real L = _unheated_length_entry + _heated_length + _unheated_length_exit; - - // Defining the position of the spacer grid in the numerical solution array - std::vector spacer_cell; - for (const auto & elem : _spacer_z) - spacer_cell.emplace_back(std::round(elem * _n_cells / L)); - - // Defining the arrays for axial resistances - std::vector kgrid; - kgrid.resize(_n_cells + 1, 0.0); - _k_grid.resize(_n_channels, std::vector(_n_cells + 1)); - - // Summing the spacer resistance to the 1D grid resistance array - for (unsigned int index = 0; index < spacer_cell.size(); index++) - kgrid[spacer_cell[index]] += _spacer_k[index]; - - // Creating the 2D grid resistance array - for (unsigned int i = 0; i < _n_channels; i++) - _k_grid[i] = kgrid; - - // Add blockage resistance to the 2D grid resistane array - Real dz = L / _n_cells; - for (unsigned int i = 0; i < _n_cells + 1; i++) - { - if ((dz * i >= _z_blockage.front() && dz * i <= _z_blockage.back())) - { - unsigned int index(0); - for (const auto & i_ch : _index_blockage) - { - _k_grid[i_ch][i] += _k_blockage[index]; - index++; - } - } - } - - // Defining the size of the maps - _gap_to_chan_map.resize(_n_gaps); - _gap_to_pin_map.resize(_n_gaps); - _gapnodes.resize(_n_gaps); - _chan_to_gap_map.resize(_n_channels); - _chan_to_pin_map.resize(_n_channels); - _pin_to_chan_map.resize(_n_pins); - _sign_id_crossflow_map.resize(_n_channels); - _gij_map.resize(_n_cells + 1); - _subchannel_position.resize(_n_channels); - - for (unsigned int i = 0; i < _n_channels; i++) - { - _subchannel_position[i].reserve(3); - for (unsigned int j = 0; j < 3; j++) - { - _subchannel_position.at(i).push_back(0.0); - } - } - - for (unsigned int iz = 0; iz < _n_cells + 1; iz++) - { - _gij_map[iz].reserve(_n_gaps); - } - - // Defining the signs for positive and negative flows - Real positive_flow = 1.0; - Real negative_flow = -1.0; - - // Defining the subchannel types - _subch_type.resize(_n_channels); - for (unsigned int iy = 0; iy < _ny; iy++) - { - for (unsigned int ix = 0; ix < _nx; ix++) - { - unsigned int i_ch = _nx * iy + ix; - bool is_corner = (ix == 0 && iy == 0) || (ix == _nx - 1 && iy == 0) || - (ix == 0 && iy == _ny - 1) || (ix == _nx - 1 && iy == _ny - 1); - bool is_edge = (ix == 0 || iy == 0 || ix == _nx - 1 || iy == _ny - 1); - - if (_n_channels == 2) - { - _subch_type[i_ch] = EChannelType::CENTER; - } - else if (_n_channels == 4) - { - _subch_type[i_ch] = EChannelType::CORNER; - } - else - { - if (is_corner) - _subch_type[i_ch] = EChannelType::CORNER; - else if (is_edge) - _subch_type[i_ch] = EChannelType::EDGE; - else - _subch_type[i_ch] = EChannelType::CENTER; - } - } - } - - // Index the east-west gaps. - unsigned int i_gap = 0; - for (unsigned int iy = 0; iy < _ny; iy++) - { - for (unsigned int ix = 0; ix < _nx - 1; ix++) - { - unsigned int i_ch = _nx * iy + ix; - unsigned int j_ch = _nx * iy + (ix + 1); - _gap_to_chan_map[i_gap] = {i_ch, j_ch}; - _chan_to_gap_map[i_ch].push_back(i_gap); - _chan_to_gap_map[j_ch].push_back(i_gap); - _sign_id_crossflow_map[i_ch].push_back(positive_flow); - _sign_id_crossflow_map[j_ch].push_back(negative_flow); - - // make a gap size map - if (iy == 0 || iy == _ny - 1) - _gij_map[0].push_back((_pitch - _pin_diameter) / 2 + _side_gap); - else - _gij_map[0].push_back(_pitch - _pin_diameter); - ++i_gap; - } - } - - // Index the north-south gaps. - for (unsigned int iy = 0; iy < _ny - 1; iy++) - { - for (unsigned int ix = 0; ix < _nx; ix++) - { - unsigned int i_ch = _nx * iy + ix; - unsigned int j_ch = _nx * (iy + 1) + ix; - _gap_to_chan_map[i_gap] = {i_ch, j_ch}; - _chan_to_gap_map[i_ch].push_back(i_gap); - _chan_to_gap_map[j_ch].push_back(i_gap); - _sign_id_crossflow_map[i_ch].push_back(positive_flow); - _sign_id_crossflow_map[j_ch].push_back(negative_flow); - - // make a gap size map - if (ix == 0 || ix == _nx - 1) - _gij_map[0].push_back((_pitch - _pin_diameter) / 2 + _side_gap); - else - _gij_map[0].push_back(_pitch - _pin_diameter); - ++i_gap; - } - } - - for (unsigned int iz = 1; iz < _n_cells + 1; iz++) - { - _gij_map[iz] = _gij_map[0]; - } - - // Make pin to channel map - for (unsigned int iy = 0; iy < _ny - 1; iy++) - { - for (unsigned int ix = 0; ix < _nx - 1; ix++) - { - unsigned int i_pin = (_nx - 1) * iy + ix; - unsigned int i_chan_1 = _nx * iy + ix; - unsigned int i_chan_2 = _nx * (iy + 1) + ix; - unsigned int i_chan_3 = _nx * (iy + 1) + (ix + 1); - unsigned int i_chan_4 = _nx * iy + (ix + 1); - _pin_to_chan_map[i_pin].push_back(i_chan_1); - _pin_to_chan_map[i_pin].push_back(i_chan_2); - _pin_to_chan_map[i_pin].push_back(i_chan_3); - _pin_to_chan_map[i_pin].push_back(i_chan_4); - } - } - - // Make channel to pin map - for (unsigned int iy = 0; iy < _ny; iy++) // row - { - for (unsigned int ix = 0; ix < _nx; ix++) // column - { - unsigned int i_ch = _nx * iy + ix; - // Corners contact 1/4 of one pin - if (iy == 0 && ix == 0) - { - _chan_to_pin_map[i_ch].push_back((_nx - 1) * iy + ix); - } - else if (iy == _ny - 1 && ix == 0) - { - _chan_to_pin_map[i_ch].push_back((_nx - 1) * (iy - 1) + ix); - } - else if (iy == 0 && ix == _nx - 1) - { - _chan_to_pin_map[i_ch].push_back((_nx - 1) * iy + ix - 1); - } - else if (iy == _ny - 1 && ix == _nx - 1) - { - _chan_to_pin_map[i_ch].push_back((_nx - 1) * (iy - 1) + ix - 1); - } - // Sides contact 1/4 of two pins - else if (iy == 0) - { - _chan_to_pin_map[i_ch].push_back((_nx - 1) * iy + ix); - _chan_to_pin_map[i_ch].push_back((_nx - 1) * iy + ix - 1); - } - else if (iy == _ny - 1) - { - _chan_to_pin_map[i_ch].push_back((_nx - 1) * (iy - 1) + ix); - _chan_to_pin_map[i_ch].push_back((_nx - 1) * (iy - 1) + ix - 1); - } - else if (ix == 0) - { - _chan_to_pin_map[i_ch].push_back((_nx - 1) * iy + ix); - _chan_to_pin_map[i_ch].push_back((_nx - 1) * (iy - 1) + ix); - } - else if (ix == _nx - 1) - { - _chan_to_pin_map[i_ch].push_back((_nx - 1) * iy + ix - 1); - _chan_to_pin_map[i_ch].push_back((_nx - 1) * (iy - 1) + ix - 1); - } - // interior contacts 1/4 of 4 pins - else - { - _chan_to_pin_map[i_ch].push_back((_nx - 1) * iy + ix); - _chan_to_pin_map[i_ch].push_back((_nx - 1) * iy + ix - 1); - _chan_to_pin_map[i_ch].push_back((_nx - 1) * (iy - 1) + ix); - _chan_to_pin_map[i_ch].push_back((_nx - 1) * (iy - 1) + ix - 1); - } - - // set the subchannel positions - Real offset_x = (_nx - 1) * _pitch / 2.0; - Real offset_y = (_ny - 1) * _pitch / 2.0; - _subchannel_position[i_ch][0] = _pitch * ix - offset_x; - _subchannel_position[i_ch][1] = _pitch * iy - offset_y; - } - } - - // Make gap to pin map - for (unsigned int i_gap = 0; i_gap < _n_gaps; i_gap++) - { - auto i_ch = _gap_to_chan_map[i_gap].first; - auto j_ch = _gap_to_chan_map[i_gap].second; - auto i_pins = _chan_to_pin_map[i_ch]; - auto j_pins = _chan_to_pin_map[j_ch]; - _gap_to_pin_map[i_gap] = {10000, 10000}; // Initialize with default values - - for (unsigned int i : i_pins) - { - for (unsigned int j : j_pins) - { - if (i == j) - { - if (_gap_to_pin_map[i_gap].first == 10000) - { - _gap_to_pin_map[i_gap].first = i; - _gap_to_pin_map[i_gap].second = i; - } - else - { - _gap_to_pin_map[i_gap].second = i; - } - } - } - } - } - - // Reduce reserved memory in the channel-to-gap map. - for (auto & gap : _chan_to_gap_map) - gap.shrink_to_fit(); - - // Reduce reserved memory in the channel-to-pin map. - for (auto & pin : _chan_to_pin_map) - pin.shrink_to_fit(); - - // Reduce reserved memory in the pin-to-channel map. - for (auto & pin : _pin_to_chan_map) - pin.shrink_to_fit(); -} - -std::unique_ptr -SCMQuadSubChannelMeshGenerator::generate() -{ - auto mesh_base = buildMeshBaseObject(); - BoundaryInfo & boundary_info = mesh_base->get_boundary_info(); - mesh_base->set_spatial_dimension(3); - mesh_base->reserve_elem(_n_cells * _ny * _nx); - mesh_base->reserve_nodes((_n_cells + 1) * _ny * _nx); - _nodes.resize(_nx * _ny); - // Add the points in the shape of a rectilinear grid. The grid is regular - // on the xy-plane with a spacing of `pitch` between points. The grid along - // z is irregular to account for Pin spacers. Store pointers in the _nodes - // array so we can keep track of which points are in which channels. - Real offset_x = (_nx - 1) * _pitch / 2.0; - Real offset_y = (_ny - 1) * _pitch / 2.0; - unsigned int node_id = 0; - for (unsigned int iy = 0; iy < _ny; iy++) - { - for (unsigned int ix = 0; ix < _nx; ix++) - { - int i_ch = _nx * iy + ix; - _nodes[i_ch].reserve(_n_cells); - for (unsigned int iz = 0; iz < _n_cells + 1; iz++) - { - _nodes[i_ch].push_back(mesh_base->add_point( - Point(_pitch * ix - offset_x, _pitch * iy - offset_y, _z_grid[iz]), node_id++)); - } - } - } - - // Add the elements which in this case are 2-node edges that link each - // subchannel's nodes vertically. - unsigned int elem_id = 0; - for (unsigned int iy = 0; iy < _ny; iy++) - { - for (unsigned int ix = 0; ix < _nx; ix++) - { - for (unsigned int iz = 0; iz < _n_cells; iz++) - { - Elem * elem = new Edge2; - elem->subdomain_id() = _block_id; - elem->set_id(elem_id++); - elem = mesh_base->add_elem(elem); - const int indx1 = ((_n_cells + 1) * _nx) * iy + (_n_cells + 1) * ix + iz; - const int indx2 = ((_n_cells + 1) * _nx) * iy + (_n_cells + 1) * ix + (iz + 1); - elem->set_node(0, mesh_base->node_ptr(indx1)); - elem->set_node(1, mesh_base->node_ptr(indx2)); - - if (iz == 0) - boundary_info.add_side(elem, 0, 0); - if (iz == _n_cells - 1) - boundary_info.add_side(elem, 1, 1); - } - } - } - - boundary_info.sideset_name(0) = "inlet"; - boundary_info.sideset_name(1) = "outlet"; - boundary_info.nodeset_name(0) = "inlet"; - boundary_info.nodeset_name(1) = "outlet"; - mesh_base->subdomain_name(_block_id) = name(); - mesh_base->prepare_for_use(); - - // move the meta data into QuadSubChannelMesh - auto & sch_mesh = static_cast(*_mesh); - sch_mesh._unheated_length_entry = _unheated_length_entry; - sch_mesh._heated_length = _heated_length; - sch_mesh._unheated_length_exit = _unheated_length_exit; - sch_mesh._z_grid = _z_grid; - sch_mesh._k_grid = _k_grid; - sch_mesh._spacer_z = _spacer_z; - sch_mesh._spacer_k = _spacer_k; - sch_mesh._z_blockage = _z_blockage; - sch_mesh._index_blockage = _index_blockage; - sch_mesh._reduction_blockage = _reduction_blockage; - sch_mesh._kij = _kij; - sch_mesh._pitch = _pitch; - sch_mesh._pin_diameter = _pin_diameter; - sch_mesh._n_cells = _n_cells; - sch_mesh._nx = _nx; - sch_mesh._ny = _ny; - sch_mesh._n_channels = _n_channels; - sch_mesh._n_gaps = _n_gaps; - sch_mesh._n_pins = _n_pins; - sch_mesh._side_gap = _side_gap; - sch_mesh._nodes = _nodes; - sch_mesh._gapnodes = _gapnodes; - sch_mesh._gap_to_chan_map = _gap_to_chan_map; - sch_mesh._gap_to_pin_map = _gap_to_pin_map; - sch_mesh._chan_to_gap_map = _chan_to_gap_map; - sch_mesh._chan_to_pin_map = _chan_to_pin_map; - sch_mesh._pin_to_chan_map = _pin_to_chan_map; - sch_mesh._sign_id_crossflow_map = _sign_id_crossflow_map; - sch_mesh._gij_map = _gij_map; - sch_mesh._subchannel_position = _subchannel_position; - sch_mesh._subch_type = _subch_type; - - return mesh_base; -} diff --git a/modules/subchannel/src/meshgenerators/SCMTriSubChannelMeshGenerator.C b/modules/subchannel/src/meshgenerators/SCMTriAssemblyMeshGenerator.C similarity index 89% rename from modules/subchannel/src/meshgenerators/SCMTriSubChannelMeshGenerator.C rename to modules/subchannel/src/meshgenerators/SCMTriAssemblyMeshGenerator.C index b32fb1509c90..aac8dfa13af8 100644 --- a/modules/subchannel/src/meshgenerators/SCMTriSubChannelMeshGenerator.C +++ b/modules/subchannel/src/meshgenerators/SCMTriAssemblyMeshGenerator.C @@ -7,31 +7,29 @@ //* Licensed under LGPL 2.1, please see LICENSE for details //* https://www.gnu.org/licenses/lgpl-2.1.html -#include "SCMTriSubChannelMeshGenerator.h" +#include "SCMTriAssemblyMeshGenerator.h" #include "TriSubChannelMesh.h" #include #include "libmesh/edge_edge2.h" #include "libmesh/unstructured_mesh.h" -registerMooseObject("SubChannelApp", SCMTriSubChannelMeshGenerator); -registerMooseObjectRenamed("SubChannelApp", - TriSubChannelMeshGenerator, - "06/30/2025 24:00", - SCMTriSubChannelMeshGenerator); +registerMooseObject("SubChannelApp", SCMTriAssemblyMeshGenerator); InputParameters -SCMTriSubChannelMeshGenerator::validParams() +SCMTriAssemblyMeshGenerator::validParams() { InputParameters params = MeshGenerator::validParams(); params.addClassDescription( - "Creates a mesh of 1D subchannels in a triangular lattice arrangement"); + "Creates a mesh of 1D subchannels and 1D pins in a triangular lattice arrangement"); params.addRequiredParam("n_cells", "The number of cells in the axial direction"); params.addRequiredParam("pitch", "Pitch [m]"); params.addRequiredParam("pin_diameter", "Rod diameter [m]"); params.addParam("unheated_length_entry", 0.0, "Unheated length at entry [m]"); params.addRequiredParam("heated_length", "Heated length [m]"); params.addParam("unheated_length_exit", 0.0, "Unheated length at exit [m]"); - params.addRequiredParam("nrings", "Number of fuel Pin rings per assembly [-]"); + params.addRequiredParam( + "nrings", + "Number of fuel-pin rings per assembly, counting the center pin as the first ring [-]"); params.addRequiredParam("flat_to_flat", "Flat to flat distance for the hexagonal assembly [m]"); params.addRequiredParam("dwire", "Wire diameter [m]"); @@ -54,16 +52,21 @@ SCMTriSubChannelMeshGenerator::validParams() params.addParam>("k_blockage", std::vector({0.0}), "Form loss coefficient of subchannels affected by blockage"); - params.addParam("block_id", 0, "Domain Index"); + params.addParam("subchannel_block_id", 0, "Subchannel block id"); + params.addParam("pin_block_id", 1, "Fuel Pin block id"); + params.addParam("block_id", 0, "Deprecated subchannel block id"); return params; } -SCMTriSubChannelMeshGenerator::SCMTriSubChannelMeshGenerator(const InputParameters & params) +SCMTriAssemblyMeshGenerator::SCMTriAssemblyMeshGenerator(const InputParameters & params) : MeshGenerator(params), _unheated_length_entry(getParam("unheated_length_entry")), _heated_length(getParam("heated_length")), _unheated_length_exit(getParam("unheated_length_exit")), - _block_id(getParam("block_id")), + _subchannel_block_id(params.isParamSetByUser("subchannel_block_id") + ? getParam("subchannel_block_id") + : getParam("block_id")), + _pin_block_id(getParam("pin_block_id")), _spacer_z(getParam>("spacer_z")), _spacer_k(getParam>("spacer_k")), _z_blockage(getParam>("z_blockage")), @@ -75,22 +78,42 @@ SCMTriSubChannelMeshGenerator::SCMTriSubChannelMeshGenerator(const InputParamete _pin_diameter(getParam("pin_diameter")), _n_cells(getParam("n_cells")), _n_rings(getParam("nrings")), + _n_channels(0), _flat_to_flat(getParam("flat_to_flat")), _dwire(getParam("dwire")), _hwire(getParam("hwire")), _duct_to_pin_gap(0.5 * - (_flat_to_flat - (_n_rings - 1) * _pitch * std::sqrt(3.0) - _pin_diameter)) + (_flat_to_flat - (_n_rings - 1) * _pitch * std::sqrt(3.0) - _pin_diameter)), + _npins(0), + _n_gaps(0), + _elem_id(0) { + const Real total_length = _unheated_length_entry + _heated_length + _unheated_length_exit; + + if (_n_rings < 2) + mooseError(name(), + ": 'nrings' must be at least 2. In this mesh generator, the center pin counts as " + "the first ring, so a 7-pin bundle uses nrings = 2."); + + if (_n_cells == 0) + mooseError(name(), ": The number of axial cells must be greater than zero"); + + if (total_length <= 0.0) + mooseError(name(), ": Total bundle length must be greater than zero"); + if (_spacer_z.size() != _spacer_k.size()) mooseError(name(), ": Size of vector spacer_z should be equal to size of vector spacer_k"); - if (_spacer_z.size() && - _spacer_z.back() > _unheated_length_entry + _heated_length + _unheated_length_exit) - mooseError(name(), ": Location of spacers should be less than the total bundle length"); + for (const auto spacer_z : _spacer_z) + if (spacer_z < 0.0 || spacer_z > total_length) + mooseError(name(), ": Location of spacers should be between zero and total bundle length"); if (_z_blockage.size() != 2) mooseError(name(), ": Size of vector z_blockage must be 2"); + if (_z_blockage.front() > _z_blockage.back()) + mooseError(name(), ": z_blockage inlet location must not exceed outlet location"); + if (*max_element(_reduction_blockage.begin(), _reduction_blockage.end()) > 1) mooseError(name(), ": The area reduction of the blocked subchannels cannot be more than 1"); @@ -105,7 +128,7 @@ SCMTriSubChannelMeshGenerator::SCMTriSubChannelMeshGenerator(const InputParamete _unheated_length_entry, _heated_length, _unheated_length_exit, _n_cells, _z_grid); // Defining the total length from 3 axial sections - Real L = _unheated_length_entry + _heated_length + _unheated_length_exit; + Real L = total_length; // Defining the position of the spacer grid in the numerical solution array std::vector spacer_cell; @@ -734,18 +757,6 @@ SCMTriSubChannelMeshGenerator::SCMTriSubChannelMeshGenerator(const InputParamete } } - /// Special case _n_rings == 1 - if (_n_rings == 1) - { - for (unsigned int i = 0; i < _n_channels; i++) - { - Real angle = (2 * i + 1) * libMesh::pi / 6.0; - _subch_type[i] = EChannelType::CORNER; - _subchannel_position[i][0] = std::cos(angle) * _flat_to_flat / 2.0; - _subchannel_position[i][1] = std::sin(angle) * _flat_to_flat / 2.0; - } - } - // Reduce reserved memory in the channel-to-gap map. for (auto & gap : _chan_to_gap_map) { @@ -753,15 +764,56 @@ SCMTriSubChannelMeshGenerator::SCMTriSubChannelMeshGenerator(const InputParamete } } +void +SCMTriAssemblyMeshGenerator::buildPinMesh(MeshBase & mesh_base) +{ + if (_npins == 0) + return; + + mesh_base.reserve_elem(_n_cells * _npins); + mesh_base.reserve_nodes((_n_cells + 1) * _npins); + + _pin_nodes.clear(); + _pin_nodes.resize(_npins); + + const unsigned int node_sub = mesh_base.n_nodes(); + const unsigned int elem_sub = mesh_base.n_elem(); + + unsigned int node_id = node_sub; + for (unsigned int i = 0; i < _npins; i++) + { + _pin_nodes[i].reserve(_n_cells + 1); + for (unsigned int iz = 0; iz < _n_cells + 1; iz++) + _pin_nodes[i].push_back(mesh_base.add_point( + Point(_pin_position[i](0), _pin_position[i](1), _z_grid[iz]), node_id++)); + } + + unsigned int elem_id = elem_sub; + for (unsigned int i = 0; i < _npins; i++) + for (unsigned int iz = 0; iz < _n_cells; iz++) + { + Elem * elem = new Edge2; + elem->subdomain_id() = _pin_block_id; + elem->set_id(elem_id++); + elem = mesh_base.add_elem(elem); + const int indx1 = (_n_cells + 1) * i + iz + node_sub; + const int indx2 = (_n_cells + 1) * i + (iz + 1) + node_sub; + elem->set_node(0, mesh_base.node_ptr(indx1)); + elem->set_node(1, mesh_base.node_ptr(indx2)); + } + + mesh_base.subdomain_name(_pin_block_id) = "fuel_pins"; +} + std::unique_ptr -SCMTriSubChannelMeshGenerator::generate() +SCMTriAssemblyMeshGenerator::generate() { auto mesh_base = buildMeshBaseObject(); BoundaryInfo & boundary_info = mesh_base->get_boundary_info(); mesh_base->set_spatial_dimension(3); - mesh_base->reserve_elem(_n_cells * _n_channels); - mesh_base->reserve_nodes((_n_cells + 1) * _n_channels); + mesh_base->reserve_elem(_n_cells * (_n_channels + _npins)); + mesh_base->reserve_nodes((_n_cells + 1) * (_n_channels + _npins)); _nodes.resize(_n_channels); // Add the points for the give x,y subchannel positions. The grid is hexagonal. // The grid along @@ -786,6 +838,7 @@ SCMTriSubChannelMeshGenerator::generate() for (unsigned int iz = 0; iz < _n_cells; iz++) { Elem * elem = new Edge2; + elem->subdomain_id() = _subchannel_block_id; elem->set_id(elem_id++); elem = mesh_base->add_elem(elem); const int indx1 = (_n_cells + 1) * i + iz; @@ -805,7 +858,8 @@ SCMTriSubChannelMeshGenerator::generate() boundary_info.nodeset_name(1) = "outlet"; // Naming the block - mesh_base->subdomain_name(_block_id) = name(); + mesh_base->subdomain_name(_subchannel_block_id) = "subchannel"; + buildPinMesh(*mesh_base); mesh_base->prepare_for_use(); @@ -848,6 +902,8 @@ SCMTriSubChannelMeshGenerator::generate() sch_mesh._gap_pairs_sf = _gap_pairs_sf; sch_mesh._chan_pairs_sf = _chan_pairs_sf; sch_mesh._pin_to_chan_map = _pin_to_chan_map; + sch_mesh._pin_nodes = _pin_nodes; + sch_mesh._pin_mesh_exist = (_npins > 0); return mesh_base; } diff --git a/modules/subchannel/src/meshgenerators/SCMTriPinMeshGenerator.C b/modules/subchannel/src/meshgenerators/SCMTriPinMeshGenerator.C deleted file mode 100644 index b0fb0a469dcb..000000000000 --- a/modules/subchannel/src/meshgenerators/SCMTriPinMeshGenerator.C +++ /dev/null @@ -1,123 +0,0 @@ -//* 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 - -#include "SCMTriPinMeshGenerator.h" -#include "TriSubChannelMesh.h" -#include "libmesh/edge_edge2.h" -#include - -registerMooseObject("SubChannelApp", SCMTriPinMeshGenerator); -registerMooseObjectRenamed("SubChannelApp", - TriPinMeshGenerator, - "06/30/2025 24:00", - SCMTriPinMeshGenerator); - -InputParameters -SCMTriPinMeshGenerator::validParams() -{ - InputParameters params = MeshGenerator::validParams(); - params.addRequiredParam("input", "The corresponding subchannel mesh"); - params.addClassDescription("Creates a mesh of 1D fuel pins in a triangular lattice arrangement"); - params.addParam("unheated_length_entry", 0.0, "Unheated length at entry [m]"); - params.addRequiredParam("heated_length", "Heated length [m]"); - params.addParam("unheated_length_exit", 0.0, "Unheated length at exit [m]"); - params.addRequiredParam("pitch", "Pitch [m]"); - params.addRequiredParam("nrings", "Number of fuel Pin rings per assembly [-]"); - params.addRequiredParam("n_cells", "The number of cells in the axial direction"); - params.addParam("block_id", 1, "Domain Index"); - return params; -} - -SCMTriPinMeshGenerator::SCMTriPinMeshGenerator(const InputParameters & params) - : MeshGenerator(params), - _input(getMesh("input")), - _unheated_length_entry(getParam("unheated_length_entry")), - _heated_length(getParam("heated_length")), - _unheated_length_exit(getParam("unheated_length_exit")), - _pitch(getParam("pitch")), - _n_rings(getParam("nrings")), - _n_cells(getParam("n_cells")), - _block_id(getParam("block_id")) -{ - Real dz = (_unheated_length_entry + _heated_length + _unheated_length_exit) / _n_cells; - for (unsigned int i = 0; i < _n_cells + 1; i++) - _z_grid.push_back(dz * i); -} - -std::unique_ptr -SCMTriPinMeshGenerator::generate() -{ - - // Setting up base elements in the mesh - std::unique_ptr mesh_base = std::move(_input); - if (!mesh_base) - mesh_base = buildMeshBaseObject(); - - mesh_base->set_mesh_dimension(3); - - // Defining the Pin positions - TriSubChannelMesh::pinPositions(_pin_position, _n_rings, _pitch, Point(0, 0)); - auto _nrods = _pin_position.size(); - - // Reserving memory in the mesh - mesh_base->reserve_elem(_n_cells * _nrods); - mesh_base->reserve_nodes((_n_cells + 1) * _nrods); - _pin_nodes.resize(_nrods); - - // Defining the extent of the subchanel mesh to append pins mesh - // to the current subchannel mesh - unsigned int chancount = 0; - for (unsigned int j = 0; j < _n_rings - 1; j++) - chancount += j * 6; - unsigned int _n_channels = chancount + _nrods - 1 + (_n_rings - 1) * 6 + 6; - unsigned int node_sub = (_n_cells + 1) * _n_channels; - unsigned int elem_sub = _n_cells * _n_channels; - - // Add the points in the shape of a rectilinear grid. The grid is regular - // on the xy-plane with a spacing of `pitch` between points. The grid along - // z is also regular. Store pointers in the _nodes - // array so we can keep track of which points are in which pins. - unsigned int node_id = node_sub; - for (unsigned int i = 0; i < _nrods; i++) - { - _pin_nodes[i].reserve(_n_cells); - for (unsigned int iz = 0; iz < _n_cells + 1; iz++) - { - _pin_nodes[i].push_back(mesh_base->add_point( - Point(_pin_position[i](0), _pin_position[i](1), _z_grid[iz]), node_id++)); - } - } - - // Add the elements which in this case are 2-node edges that link each - // pin nodes vertically. - unsigned int elem_id = elem_sub; - for (unsigned int i = 0; i < _nrods; i++) - { - for (unsigned int iz = 0; iz < _n_cells; iz++) - { - Elem * elem = new Edge2; - elem->subdomain_id() = _block_id; - elem->set_id(elem_id++); - elem = mesh_base->add_elem(elem); - const int indx1 = (_n_cells + 1) * i + iz + node_sub; - const int indx2 = (_n_cells + 1) * i + (iz + 1) + node_sub; - elem->set_node(0, mesh_base->node_ptr(indx1)); - elem->set_node(1, mesh_base->node_ptr(indx2)); - } - } - mesh_base->subdomain_name(_block_id) = name(); - mesh_base->prepare_for_use(); - - // move the meta data into TriSubChannelMesh - auto & sch_mesh = static_cast(*_mesh); - sch_mesh._pin_nodes = _pin_nodes; - sch_mesh._pin_mesh_exist = true; - - return mesh_base; -} diff --git a/modules/subchannel/src/problems/QuadSubChannel1PhaseProblem.C b/modules/subchannel/src/problems/QuadSubChannel1PhaseProblem.C index 0358f6e4c3ed..23060c139e21 100644 --- a/modules/subchannel/src/problems/QuadSubChannel1PhaseProblem.C +++ b/modules/subchannel/src/problems/QuadSubChannel1PhaseProblem.C @@ -269,6 +269,9 @@ QuadSubChannel1PhaseProblem::computeBeta(unsigned int i_gap, unsigned int iz, bo Real QuadSubChannel1PhaseProblem::computeAddedHeatPin(unsigned int i_ch, unsigned int iz) const { + if (!_pin_mesh_exist) + return 0.0; + // Compute axial location of nodes. auto z2 = _z_grid[iz]; auto z1 = _z_grid[iz - 1]; @@ -279,25 +282,16 @@ QuadSubChannel1PhaseProblem::computeAddedHeatPin(unsigned int i_ch, unsigned int { // Compute the height of this element. auto dz = z2 - z1; - if (_pin_mesh_exist) - { - auto heat_rate_in = 0.0; - auto heat_rate_out = 0.0; - for (auto i_pin : _subchannel_mesh.getChannelPins(i_ch)) - { - auto * node_in = _subchannel_mesh.getPinNode(i_pin, iz - 1); - auto * node_out = _subchannel_mesh.getPinNode(i_pin, iz); - heat_rate_out += 0.25 * (*_q_prime_soln)(node_out); - heat_rate_in += 0.25 * (*_q_prime_soln)(node_in); - } - return (heat_rate_in + heat_rate_out) * dz / 2.0; - } - else + auto heat_rate_in = 0.0; + auto heat_rate_out = 0.0; + for (auto i_pin : _subchannel_mesh.getChannelPins(i_ch)) { - auto * node_in = _subchannel_mesh.getChannelNode(i_ch, iz - 1); - auto * node_out = _subchannel_mesh.getChannelNode(i_ch, iz); - return ((*_q_prime_soln)(node_out) + (*_q_prime_soln)(node_in)) * dz / 2.0; + auto * node_in = _subchannel_mesh.getPinNode(i_pin, iz - 1); + auto * node_out = _subchannel_mesh.getPinNode(i_pin, iz); + heat_rate_out += 0.25 * (*_q_prime_soln)(node_out); + heat_rate_in += 0.25 * (*_q_prime_soln)(node_in); } + return (heat_rate_in + heat_rate_out) * dz / 2.0; } else return 0.0; diff --git a/modules/subchannel/src/problems/TriSubChannel1PhaseProblem.C b/modules/subchannel/src/problems/TriSubChannel1PhaseProblem.C index d474b94f7bab..412b813ad6ab 100644 --- a/modules/subchannel/src/problems/TriSubChannel1PhaseProblem.C +++ b/modules/subchannel/src/problems/TriSubChannel1PhaseProblem.C @@ -443,6 +443,9 @@ TriSubChannel1PhaseProblem::computeBeta(unsigned int i_gap, unsigned int iz, boo Real TriSubChannel1PhaseProblem::computeAddedHeatPin(unsigned int i_ch, unsigned int iz) const { + if (!_pin_mesh_exist) + return 0.0; + // Compute axial location of nodes. auto z2 = _z_grid[iz]; auto z1 = _z_grid[iz - 1]; @@ -453,41 +456,32 @@ TriSubChannel1PhaseProblem::computeAddedHeatPin(unsigned int i_ch, unsigned int { // Compute the height of this element. auto dz = z2 - z1; - if (_pin_mesh_exist) + double factor; + auto subch_type = _subchannel_mesh.getSubchannelType(i_ch); + switch (subch_type) { - double factor; - auto subch_type = _subchannel_mesh.getSubchannelType(i_ch); - switch (subch_type) - { - case EChannelType::CENTER: - factor = 1.0 / 6.0; - break; - case EChannelType::EDGE: - factor = 1.0 / 4.0; - break; - case EChannelType::CORNER: - factor = 1.0 / 6.0; - break; - default: - return 0.0; // handle invalid subch_type if needed - } - double heat_rate_in = 0.0; - double heat_rate_out = 0.0; - for (auto i_pin : _subchannel_mesh.getChannelPins(i_ch)) - { - auto * node_in = _subchannel_mesh.getPinNode(i_pin, iz - 1); - auto * node_out = _subchannel_mesh.getPinNode(i_pin, iz); - heat_rate_out += factor * (*_q_prime_soln)(node_out); - heat_rate_in += factor * (*_q_prime_soln)(node_in); - } - return (heat_rate_in + heat_rate_out) * dz / 2.0; + case EChannelType::CENTER: + factor = 1.0 / 6.0; + break; + case EChannelType::EDGE: + factor = 1.0 / 4.0; + break; + case EChannelType::CORNER: + factor = 1.0 / 6.0; + break; + default: + return 0.0; // handle invalid subch_type if needed } - else + double heat_rate_in = 0.0; + double heat_rate_out = 0.0; + for (auto i_pin : _subchannel_mesh.getChannelPins(i_ch)) { - auto * node_in = _subchannel_mesh.getChannelNode(i_ch, iz - 1); - auto * node_out = _subchannel_mesh.getChannelNode(i_ch, iz); - return ((*_q_prime_soln)(node_out) + (*_q_prime_soln)(node_in)) * dz / 2.0; + auto * node_in = _subchannel_mesh.getPinNode(i_pin, iz - 1); + auto * node_out = _subchannel_mesh.getPinNode(i_pin, iz); + heat_rate_out += factor * (*_q_prime_soln)(node_out); + heat_rate_in += factor * (*_q_prime_soln)(node_in); } + return (heat_rate_in + heat_rate_out) * dz / 2.0; } else return 0.0; diff --git a/modules/subchannel/src/transfers/SCMPinSolutionTransfer.C b/modules/subchannel/src/transfers/SCMPinSolutionTransfer.C deleted file mode 100644 index fe25f374c78f..000000000000 --- a/modules/subchannel/src/transfers/SCMPinSolutionTransfer.C +++ /dev/null @@ -1,39 +0,0 @@ -//* 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 - -#include "SCMPinSolutionTransfer.h" -#include "SubChannelMesh.h" - -registerMooseObject("SubChannelApp", SCMPinSolutionTransfer); -registerMooseObjectRenamed("SubChannelApp", - PinSolutionTransfer, - "06/30/2025 24:00", - SCMPinSolutionTransfer); - -InputParameters -SCMPinSolutionTransfer::validParams() -{ - InputParameters params = SCMSolutionTransferBase::validParams(); - params.addClassDescription( - "Transfers pin solution from computational mesh onto visualization mesh"); - return params; -} - -SCMPinSolutionTransfer::SCMPinSolutionTransfer(const InputParameters & parameters) - : SCMSolutionTransferBase(parameters) -{ -} - -Node * -SCMPinSolutionTransfer::getFromNode(const SubChannelMesh & from_mesh, const Point & src_node) -{ - unsigned int pin_idx = from_mesh.pinIndex(src_node); - unsigned iz = from_mesh.getZIndex(src_node); - return from_mesh.getPinNode(pin_idx, iz); -} diff --git a/modules/subchannel/src/transfers/SCMSolutionTransfer.C b/modules/subchannel/src/transfers/SCMSolutionTransfer.C index e10b97600fa2..04a3d9644fa3 100644 --- a/modules/subchannel/src/transfers/SCMSolutionTransfer.C +++ b/modules/subchannel/src/transfers/SCMSolutionTransfer.C @@ -8,6 +8,9 @@ //* https://www.gnu.org/licenses/lgpl-2.1.html #include "SCMSolutionTransfer.h" +#include "MultiApp.h" +#include "FEProblemBase.h" +#include "DisplacedProblem.h" #include "SubChannelMesh.h" registerMooseObject("SubChannelApp", SCMSolutionTransfer); @@ -15,25 +18,167 @@ registerMooseObjectRenamed("SubChannelApp", SolutionTransfer, "06/30/2025 24:00", SCMSolutionTransfer); +registerMooseObjectRenamed("SubChannelApp", + SCMPinSolutionTransfer, + "06/30/2027 24:00", + SCMSolutionTransfer); +registerMooseObjectRenamed("SubChannelApp", + PinSolutionTransfer, + "06/30/2027 24:00", + SCMSolutionTransfer); InputParameters SCMSolutionTransfer::validParams() { - InputParameters params = SCMSolutionTransferBase::validParams(); + InputParameters params = MultiAppTransfer::validParams(); + params.addRequiredParam>("variable", + "The auxiliary variables to transfer."); + MooseEnum transfer_type("subchannel pin", "subchannel"); + params.addParam("transfer_type", + transfer_type, + "Whether to transfer subchannel-centered or pin-centered fields."); params.addClassDescription( - "Transfers subchannel solution from computational mesh onto visualization mesh"); + "Transfers subchannel or pin solutions from a SubChannel mesh onto a visualization mesh."); return params; } SCMSolutionTransfer::SCMSolutionTransfer(const InputParameters & parameters) - : SCMSolutionTransferBase(parameters) + : MultiAppTransfer(parameters), + _var_names(getParam>("variable")), + _pin_transfer(getParam("transfer_type") == "pin") +{ + if (_directions.contains(Transfer::FROM_MULTIAPP)) + paramError("from_multiapp", "This transfer works only into multi-app."); +} + +void +SCMSolutionTransfer::initialSetup() +{ + MultiAppTransfer::initialSetup(); + for (std::size_t var_index = 0; var_index < _var_names.size(); ++var_index) + { + if (_to_problems.empty()) + continue; + + MooseVariableFieldBase & from_var = _subproblem.getVariable( + 0, _var_names[var_index], Moose::VarKindType::VAR_ANY, Moose::VarFieldType::VAR_FIELD_ANY); + System & from_sys = from_var.sys().system(); + const auto & fe_type = from_sys.variable_type(from_var.number()); + + if (fe_type.family != LAGRANGE || fe_type.order != FIRST) + paramError("variable", + "This transfer requires a first order Lagrange variable for the source variable"); + + MooseVariableFieldBase & to_var = _to_problems[0]->getVariable( + 0, _var_names[var_index], Moose::VarKindType::VAR_ANY, Moose::VarFieldType::VAR_FIELD_ANY); + + System & to_sys = to_var.sys().system(); + const auto & fe_type_target = to_sys.variable_type(to_var.number()); + + if (fe_type_target.family != LAGRANGE || fe_type_target.order != FIRST) + paramError("variable", + "This transfer requires a first order Lagrange variable for the source variable"); + } +} + +void +SCMSolutionTransfer::execute() { + TIME_SECTION( + "MultiAppDetailedSolutionBaseTransfer::execute()", 5, "Transferring subchannel solutions"); + getAppInfo(); + + switch (_current_direction) + { + case TO_MULTIAPP: + transferToMultiApps(); + break; + + default: + break; + } +} + +void +SCMSolutionTransfer::transferToMultiApps() +{ + mooseAssert(_from_meshes.size() == 1, "Only one source mesh can be active in this transfer."); + auto * from_mesh = dynamic_cast(_from_meshes[0]); + if (from_mesh == nullptr) + mooseError("This transfer works only with SubChannelMesh classes."); + if (_pin_transfer && !from_mesh->pinMeshExist()) + mooseError( + "This transfer was configured for pin variables, but the source mesh has no pin mesh."); + + for (unsigned int i = 0; i < getToMultiApp()->numGlobalApps(); i++) + if (getToMultiApp()->hasLocalApp(i)) + transferVarsToApp(i); +} + +void +SCMSolutionTransfer::transferVarsToApp(unsigned int app_idx) +{ + transferNodalVars(app_idx); +} + +void +SCMSolutionTransfer::transferNodalVars(unsigned int app_idx) +{ + Moose::ScopedCommSwapper swapper(getToMultiApp()->comm()); + + FEProblemBase & to_problem = getToMultiApp()->appProblemBase(app_idx); + MooseMesh * mesh = NULL; + if (_displaced_target_mesh && to_problem.getDisplacedProblem()) + mesh = &to_problem.getDisplacedProblem()->mesh(); + else + mesh = &to_problem.mesh(); + + const SubChannelMesh & from_mesh = dynamic_cast(*_from_meshes[0]); + FEProblemBase & from_problem = *_from_problems[0]; + + for (auto & node : mesh->getMesh().local_node_ptr_range()) + { + if (processor_id() != 0) + continue; + Node * from_node = getFromNode(from_mesh, *node); + + for (auto & var_name : _var_names) + { + System * to_sys = find_sys(to_problem.es(), var_name); + unsigned int to_sys_num = to_sys->number(); + unsigned int to_var_num = to_sys->variable_number(var_name); + + if (node->n_dofs(to_sys_num, to_var_num) > 0) + { + System * from_sys = find_sys(from_problem.es(), var_name); + unsigned int from_sys_num = from_sys->number(); + unsigned int from_var_num = from_sys->variable_number(var_name); + + swapper.forceSwap(); + NumericVector * from_solution = from_sys->solution.get(); + dof_id_type from_dof = from_node->dof_number(from_sys_num, from_var_num, 0); + Real from_value = (*from_solution)(from_dof); + swapper.forceSwap(); + + NumericVector & to_solution = getToMultiApp()->appTransferVector(app_idx, var_name); + dof_id_type to_dof = node->dof_number(to_sys_num, to_var_num, 0); + to_solution.set(to_dof, from_value); + } + } + } + + for (auto & var_name : _var_names) + { + getToMultiApp()->appTransferVector(app_idx, var_name).close(); + find_sys(to_problem.es(), var_name)->update(); + } } Node * SCMSolutionTransfer::getFromNode(const SubChannelMesh & from_mesh, const Point & src_node) { - unsigned int sch_idx = from_mesh.channelIndex(src_node); + unsigned int sch_idx = + _pin_transfer ? from_mesh.pinIndex(src_node) : from_mesh.channelIndex(src_node); unsigned iz = from_mesh.getZIndex(src_node); - return from_mesh.getChannelNode(sch_idx, iz); + return _pin_transfer ? from_mesh.getPinNode(sch_idx, iz) : from_mesh.getChannelNode(sch_idx, iz); } diff --git a/modules/subchannel/src/transfers/SCMSolutionTransferBase.C b/modules/subchannel/src/transfers/SCMSolutionTransferBase.C deleted file mode 100644 index 2ba64007ba0c..000000000000 --- a/modules/subchannel/src/transfers/SCMSolutionTransferBase.C +++ /dev/null @@ -1,153 +0,0 @@ -//* 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 - -#include "SCMSolutionTransferBase.h" -#include "MultiApp.h" -#include "FEProblemBase.h" -#include "DisplacedProblem.h" -#include "SubChannelMesh.h" - -InputParameters -SCMSolutionTransferBase::validParams() -{ - InputParameters params = MultiAppTransfer::validParams(); - params.addRequiredParam>("variable", - "The auxiliary variables to transfer."); - return params; -} - -SCMSolutionTransferBase::SCMSolutionTransferBase(const InputParameters & parameters) - : MultiAppTransfer(parameters), _var_names(getParam>("variable")) -{ - if (_directions.contains(Transfer::FROM_MULTIAPP)) - paramError("from_multiapp", "This transfer works only into multi-app."); -} - -void -SCMSolutionTransferBase::initialSetup() -{ - MultiAppTransfer::initialSetup(); - for (std::size_t var_index = 0; var_index < _var_names.size(); ++var_index) - { - // No local app, we cannot examine the target variable - if (_to_problems.empty()) - continue; - - // Check source variable on regular subchannel problem - MooseVariableFieldBase & from_var = _subproblem.getVariable( - 0, _var_names[var_index], Moose::VarKindType::VAR_ANY, Moose::VarFieldType::VAR_FIELD_ANY); - System & from_sys = from_var.sys().system(); - const auto & fe_type = from_sys.variable_type(from_var.number()); - - if (fe_type.family != LAGRANGE || fe_type.order != FIRST) - paramError("variable", - "This transfer requires a first order Lagrange variable for the source variable"); - - // Check target variable in visualization mesh - MooseVariableFieldBase & to_var = _to_problems[0]->getVariable( - 0, _var_names[var_index], Moose::VarKindType::VAR_ANY, Moose::VarFieldType::VAR_FIELD_ANY); - - System & to_sys = to_var.sys().system(); - const auto & fe_type_target = to_sys.variable_type(to_var.number()); - - if (fe_type_target.family != LAGRANGE || fe_type_target.order != FIRST) - paramError("variable", - "This transfer requires a first order Lagrange variable for the source variable"); - } -} - -void -SCMSolutionTransferBase::execute() -{ - TIME_SECTION( - "MultiAppDetailedSolutionBaseTransfer::execute()", 5, "Transferring subchannel solutions"); - getAppInfo(); - - switch (_current_direction) - { - case TO_MULTIAPP: - transferToMultiApps(); - break; - - default: - break; - } -} - -void -SCMSolutionTransferBase::transferToMultiApps() -{ - mooseAssert(_from_meshes.size() == 1, "Only one source mesh can be active in this transfer."); - if (dynamic_cast(_from_meshes[0]) == nullptr) - mooseError("This transfer works only with SubChannelMesh classes."); - - for (unsigned int i = 0; i < getToMultiApp()->numGlobalApps(); i++) - if (getToMultiApp()->hasLocalApp(i)) - transferVarsToApp(i); -} - -void -SCMSolutionTransferBase::transferVarsToApp(unsigned int app_idx) -{ - transferNodalVars(app_idx); -} - -void -SCMSolutionTransferBase::transferNodalVars(unsigned int app_idx) -{ - Moose::ScopedCommSwapper swapper(getToMultiApp()->comm()); - - FEProblemBase & to_problem = getToMultiApp()->appProblemBase(app_idx); - MooseMesh * mesh = NULL; - if (_displaced_target_mesh && to_problem.getDisplacedProblem()) - mesh = &to_problem.getDisplacedProblem()->mesh(); - else - mesh = &to_problem.mesh(); - - const SubChannelMesh & from_mesh = dynamic_cast(*_from_meshes[0]); - FEProblemBase & from_problem = *_from_problems[0]; - - for (auto & node : mesh->getMesh().local_node_ptr_range()) - { - // No local data to send - if (processor_id() != 0) - continue; - Node * from_node = getFromNode(from_mesh, *node); - - for (auto & var_name : _var_names) - { - System * to_sys = find_sys(to_problem.es(), var_name); - unsigned int to_sys_num = to_sys->number(); - unsigned int to_var_num = to_sys->variable_number(var_name); - - if (node->n_dofs(to_sys_num, to_var_num) > 0) - { - System * from_sys = find_sys(from_problem.es(), var_name); - unsigned int from_sys_num = from_sys->number(); - unsigned int from_var_num = from_sys->variable_number(var_name); - - swapper.forceSwap(); - NumericVector * from_solution = from_sys->solution.get(); - dof_id_type from_dof = from_node->dof_number(from_sys_num, from_var_num, 0); - Real from_value = (*from_solution)(from_dof); - swapper.forceSwap(); - - NumericVector & to_solution = getToMultiApp()->appTransferVector(app_idx, var_name); - dof_id_type to_dof = node->dof_number(to_sys_num, to_var_num, 0); - to_solution.set(to_dof, from_value); - } - } - } - - for (auto & var_name : _var_names) - { - getToMultiApp()->appTransferVector(app_idx, var_name).close(); - find_sys(to_problem.es(), var_name)->update(); - } -} diff --git a/modules/subchannel/test/tests/SCMQuadPower/gold/not_aligned.csv b/modules/subchannel/test/tests/SCMQuadPower/gold/not_aligned.csv deleted file mode 100644 index 6b81da444498..000000000000 --- a/modules/subchannel/test/tests/SCMQuadPower/gold/not_aligned.csv +++ /dev/null @@ -1,3 +0,0 @@ -time,Total_power_Aux_defaultPP,Total_power_IC_defaultPP,Total_power_SCMPinPowerPostprocessor,Total_power_SCMTHPowerPostprocessor -0,0,0,0,0 -1,1000000,1000000,1000000,999998.59459221 diff --git a/modules/subchannel/test/tests/SCMQuadPower/gold/not_aligned_line_check_0001.csv b/modules/subchannel/test/tests/SCMQuadPower/gold/not_aligned_line_check_0001.csv deleted file mode 100644 index 8a3e1aece5d7..000000000000 --- a/modules/subchannel/test/tests/SCMQuadPower/gold/not_aligned_line_check_0001.csv +++ /dev/null @@ -1,13 +0,0 @@ -id,q_prime,q_prime_aux,x,y,z -0,0,0,0,0,0 -0.13636363636364,0,0,0,0,0.13636363636364 -0.27272727272727,0,0,0,0,0.27272727272727 -0.40909090909091,0,0,0,0,0.40909090909091 -0.54545454545455,458333.33333333,458333.33333333,0,0,0.54545454545455 -0.68181818181818,458333.33333333,458333.33333333,0,0,0.68181818181818 -0.81818181818182,458333.33333333,458333.33333333,0,0,0.81818181818182 -0.95454545454545,458333.33333333,458333.33333333,0,0,0.95454545454545 -1.0909090909091,0,0,0,0,1.0909090909091 -1.2272727272727,0,0,0,0,1.2272727272727 -1.3636363636364,0,0,0,0,1.3636363636364 -1.5,0,0,0,0,1.5 diff --git a/modules/subchannel/test/tests/SCMQuadPower/gold/test_out.csv b/modules/subchannel/test/tests/SCMQuadPower/gold/test_out.csv deleted file mode 100644 index ade0eecbbfba..000000000000 --- a/modules/subchannel/test/tests/SCMQuadPower/gold/test_out.csv +++ /dev/null @@ -1,3 +0,0 @@ -time,Total_power_Aux_defaultPP,Total_power_IC_defaultPP,Total_power_SCMPinPowerPostprocessor,Total_power_SCMTHPowerPostprocessor -0,0,0,0,0 -1,1200000,1200000,1000000,999998.80505085 diff --git a/modules/subchannel/test/tests/SCMQuadPower/gold/test_out_line_check_0001.csv b/modules/subchannel/test/tests/SCMQuadPower/gold/test_out_line_check_0001.csv deleted file mode 100644 index 60d46facb511..000000000000 --- a/modules/subchannel/test/tests/SCMQuadPower/gold/test_out_line_check_0001.csv +++ /dev/null @@ -1,17 +0,0 @@ -id,q_prime,q_prime_aux,x,y,z -0,0,0,0,0,0 -0.1,0,0,0,0,0.1 -0.2,0,0,0,0,0.2 -0.3,0,0,0,0,0.3 -0.4,0,0,0,0,0.4 -0.5,500000,500000,0,0,0.5 -0.6,500000,500000,0,0,0.6 -0.7,500000,500000,0,0,0.7 -0.8,500000,500000,0,0,0.8 -0.9,500000,500000,0,0,0.9 -1,500000,500000,0,0,1 -1.1,0,0,0,0,1.1 -1.2,0,0,0,0,1.2 -1.3,0,0,0,0,1.3 -1.4,0,0,0,0,1.4 -1.5,0,0,0,0,1.5 diff --git a/modules/subchannel/test/tests/SCMQuadPower/test.i b/modules/subchannel/test/tests/SCMQuadPower/test.i deleted file mode 100644 index 7845c08f4140..000000000000 --- a/modules/subchannel/test/tests/SCMQuadPower/test.i +++ /dev/null @@ -1,192 +0,0 @@ -num_cells = 15 -T_in = 359.15 -# [1e+6 kg/m^2-hour] turns into kg/m^2-sec -mass_flux_in = '${fparse 1e+6 * 17.00 / 3600.}' -P_out = 4.923e6 # Pa - -[QuadSubChannelMesh] - [sub_channel] - type = SCMQuadSubChannelMeshGenerator - nx = 3 - ny = 3 - n_cells = ${num_cells} - pitch = 0.25 - pin_diameter = 0.125 - side_gap = 0.1 - unheated_length_entry = 0.5 - heated_length = 0.5 - unheated_length_exit = 0.5 - [] -[] - -[AuxVariables] - [q_prime_aux] - [] -[] - -[FluidProperties] - [water] - type = Water97FluidProperties - [] -[] - -[SubChannel] - type = QuadSubChannel1PhaseProblem - fp = water - n_blocks = 1 - beta = 0.08 - CT = 2.6 - compute_density = true - compute_viscosity = true - compute_power = true - P_out = ${P_out} - verbose_subchannel = true - implicit = true - segregated = false - friction_closure = 'MATRA' - pin_HTC_closure = 'Dittus-Boelter' -[] - -[SCMClosures] - [MATRA] - type = SCMFrictionMATRA - [] - [Dittus-Boelter] - type = SCMHTCDittusBoelter - [] -[] - -[AuxKernels] - [q_prime_IC] - type = SCMQuadPowerAux - variable = q_prime_aux - power = 1e6 # W - filename = "power_profile.txt" #type in name of file that describes radial power profile - execute_on = 'initial' - [] - [T_in_bc] - type = ConstantAux - variable = T - boundary = inlet - value = ${T_in} - execute_on = 'timestep_begin' - [] - [mdot_in_bc] - type = SCMMassFlowRateAux - variable = mdot - boundary = inlet - area = S - mass_flux = ${mass_flux_in} - execute_on = 'timestep_begin' - [] -[] - -[ICs] - [q_prime_IC] - type = SCMQuadPowerIC - variable = q_prime - power = 1e6 # W - filename = "power_profile.txt" #type in name of file that describes radial power profile - [] - - [S_IC] - type = SCMQuadFlowAreaIC - variable = S - [] - - [w_perim_IC] - type = SCMQuadWettedPerimIC - variable = w_perim - [] - - [T_ic] - type = ConstantIC - variable = T - value = ${T_in} - [] - - [Dpin_ic] - type = ConstantIC - variable = Dpin - value = 0.00950 - [] - - [P_ic] - type = ConstantIC - variable = P - value = 0.0 - [] - - [DP_ic] - type = ConstantIC - variable = DP - value = 0.0 - [] - - [Viscosity_ic] - type = ViscosityIC - variable = mu - p = ${P_out} - T = T - fp = water - [] - - [rho_ic] - type = RhoFromPressureTemperatureIC - variable = rho - p = ${P_out} - T = T - fp = water - [] - - [h_ic] - type = SpecificEnthalpyFromPressureTemperatureIC - variable = h - p = ${P_out} - T = T - fp = water - [] - - [mdot_ic] - type = ConstantIC - variable = mdot - value = 0.0 - [] -[] - -[Executioner] - type = Steady -[] - -[Postprocessors] - [Total_power_IC_defaultPP] - type = ElementIntegralVariablePostprocessor - variable = q_prime - [] - [Total_power_Aux_defaultPP] - type = ElementIntegralVariablePostprocessor - variable = q_prime_aux - [] - [Total_power_SCMPinPowerPostprocessor] - type = SCMPinPowerPostprocessor - [] - [Total_power_SCMTHPowerPostprocessor] - type = SCMTHPowerPostprocessor - [] -[] - -[VectorPostprocessors] - [line_check] - type = LineValueSampler - variable = 'q_prime q_prime_aux' - execute_on = 'TIMESTEP_END' - sort_by = 'z' - start_point = '0 0 0' - end_point = '0 0 1.5' - num_points = ${fparse num_cells + 1} - [] -[] - -[Outputs] - csv = true -[] diff --git a/modules/subchannel/test/tests/SCMQuadPower/test_with_pins.i b/modules/subchannel/test/tests/SCMQuadPower/test_with_pins.i index 8097edb4036b..0df1f7a6a37e 100644 --- a/modules/subchannel/test/tests/SCMQuadPower/test_with_pins.i +++ b/modules/subchannel/test/tests/SCMQuadPower/test_with_pins.i @@ -7,7 +7,7 @@ length = 0.5 [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 3 ny = 3 n_cells = ${num_cells} @@ -18,18 +18,6 @@ length = 0.5 heated_length = 0.5 unheated_length_exit = 0.5 [] - - [fuel_pins] - type = SCMQuadPinMeshGenerator - input = sub_channel - nx = 3 - ny = 3 - n_cells = ${num_cells} - pitch = 0.25 - unheated_length_entry = 0.5 - heated_length = 0.5 - unheated_length_exit = 0.5 - [] [] [Functions] diff --git a/modules/subchannel/test/tests/SCMQuadPower/tests b/modules/subchannel/test/tests/SCMQuadPower/tests index 96cf72a97bf0..e97911cb4607 100644 --- a/modules/subchannel/test/tests/SCMQuadPower/tests +++ b/modules/subchannel/test/tests/SCMQuadPower/tests @@ -1,23 +1,6 @@ [Tests] design = 'SCMQuadPowerAux.md SCMQuadPowerIC.md' issues = '#28497 #29233' - [SCMQuadPower_cells_aligned] - type = CSVDiff - input = 'test.i' - csvdiff = 'test_out_line_check_0001.csv test_out.csv' - recover = False - abs_zero = 1e-7 - requirement = 'The system will populate a uniform linear heat rate on subchannels in a quadrilateral lattice using an initial condition and auxiliary kernel' - [] - [SCMQuadPower_cells_not_aligned] - type = CSVDiff - input = 'test.i' - csvdiff = 'not_aligned_line_check_0001.csv not_aligned.csv' - cli_args = 'num_cells=11 Outputs/file_base=not_aligned' - recover = False - abs_zero = 1e-7 - requirement = 'The system will populate a uniform linear heat rate on subchannels in a quadrilateral lattice using an initial condition and auxiliary kernel in a mesh that has axial divisions that are not aligned with the heated region entrance and exit heights.' - [] [SCMQuadPower_cells_aligned_with_pins] type = CSVDiff input = 'test_with_pins.i' diff --git a/modules/subchannel/test/tests/SCMTriPower/gold/not_aligned.csv b/modules/subchannel/test/tests/SCMTriPower/gold/not_aligned.csv deleted file mode 100644 index 36fa6c21b8b1..000000000000 --- a/modules/subchannel/test/tests/SCMTriPower/gold/not_aligned.csv +++ /dev/null @@ -1,3 +0,0 @@ -time,Total_power_Aux_defaultPP,Total_power_IC_defaultPP,Total_power_SCMPinPowerPostprocessor,Total_power_SCMTHPowerPostprocessor -0,0,0,0,0 -1,20000,20000,20000,20000.030207665 diff --git a/modules/subchannel/test/tests/SCMTriPower/gold/test_out.csv b/modules/subchannel/test/tests/SCMTriPower/gold/test_out.csv deleted file mode 100644 index fcdb6d983f8f..000000000000 --- a/modules/subchannel/test/tests/SCMTriPower/gold/test_out.csv +++ /dev/null @@ -1,3 +0,0 @@ -time,Total_power_Aux_defaultPP,Total_power_IC_defaultPP,Total_power_SCMPinPowerPostprocessor,Total_power_SCMTHPowerPostprocessor -0,0,0,0,0 -1,21000,21000,20000,19999.971950208 diff --git a/modules/subchannel/test/tests/SCMTriPower/test.i b/modules/subchannel/test/tests/SCMTriPower/test.i deleted file mode 100644 index a2a63abdd801..000000000000 --- a/modules/subchannel/test/tests/SCMTriPower/test.i +++ /dev/null @@ -1,188 +0,0 @@ -T_in = 588.5 -flow_area = 0.0004980799633447909 #m2 -mass_flux_in = '${fparse 55*3.78541/10/60/flow_area}' -P_out = 2.0e5 # Pa -length = 0.5 -num_cells = 40 -[TriSubChannelMesh] - [subchannel] - type = SCMTriSubChannelMeshGenerator - nrings = 3 - n_cells = ${num_cells} - flat_to_flat = 3.41e-2 - heated_length = 0.5 - unheated_length_entry = 0.4 - unheated_length_exit = 0.1 - pin_diameter = 5.84e-3 - pitch = 7.26e-3 - dwire = 1.42e-3 - hwire = 0.3048 - [] -[] - -[AuxVariables] - [q_prime_aux] - [] -[] - -[Functions] - [axial_heat_rate] - type = ParsedFunction - expression = '(pi/2)*sin(pi*z/L)' - symbol_names = 'L' - symbol_values = '${length}' - [] -[] - -[FluidProperties] - [sodium] - type = PBSodiumFluidProperties - [] -[] - -[SubChannel] - type = TriSubChannel1PhaseProblem - fp = sodium - n_blocks = 1 - P_out = 2.0e5 - CT = 2.6 - compute_density = true - compute_viscosity = true - compute_power = true - implicit = true - segregated = false - verbose_subchannel = true - interpolation_scheme = upwind - # Heat Transfer Correlation - pin_HTC_closure = 'gnielinski' - # friction model - friction_closure = 'cheng' -[] - -[SCMClosures] - [cheng] - type = SCMFrictionUpdatedChengTodreas - [] - [gnielinski] - type = SCMHTCGnielinski - [] -[] - -[ICs] - [S_IC] - type = SCMTriFlowAreaIC - variable = S - [] - - [w_perim_IC] - type = SCMTriWettedPerimIC - variable = w_perim - [] - - [q_prime_ic] - type = SCMTriPowerIC - variable = q_prime - power = 20000 # W - filename = "pin_power_profile.txt" - # axial_heat_rate = axial_heat_rate - [] - - [T_ic] - type = ConstantIC - variable = T - value = ${T_in} - [] - - [P_ic] - type = ConstantIC - variable = P - value = 0.0 - [] - - [DP_ic] - type = ConstantIC - variable = DP - value = 0.0 - [] - - [Viscosity_ic] - type = ViscosityIC - variable = mu - p = ${P_out} - T = T - fp = sodium - [] - - [rho_ic] - type = RhoFromPressureTemperatureIC - variable = rho - p = ${P_out} - T = T - fp = sodium - [] - - [h_ic] - type = SpecificEnthalpyFromPressureTemperatureIC - variable = h - p = ${P_out} - T = T - fp = sodium - [] - - [mdot_ic] - type = ConstantIC - variable = mdot - value = 0.0 - [] -[] - -[AuxKernels] - [T_in_bc] - type = ConstantAux - variable = T - boundary = inlet - value = ${T_in} - execute_on = 'timestep_begin' - [] - [mdot_in_bc] - type = SCMMassFlowRateAux - variable = mdot - boundary = inlet - area = S - mass_flux = ${mass_flux_in} - execute_on = 'timestep_begin' - [] - [q_prime_AUX] - type = SCMTriPowerAux - variable = q_prime_aux - power = 20000 # W - filename = "pin_power_profile.txt" #type in name of file that describes radial power profile - # axial_heat_rate = axial_heat_rate - execute_on = 'initial' - [] -[] - -[Executioner] - type = Steady -[] - -[Postprocessors] - [Total_power_IC_defaultPP] - type = ElementIntegralVariablePostprocessor - variable = q_prime - [] - [Total_power_Aux_defaultPP] - type = ElementIntegralVariablePostprocessor - variable = q_prime_aux - [] - [Total_power_SCMPinPowerPostprocessor] - type = SCMPinPowerPostprocessor - [] - [Total_power_SCMTHPowerPostprocessor] - type = SCMTHPowerPostprocessor - [] -[] - -[Outputs] - csv = true -[] diff --git a/modules/subchannel/test/tests/SCMTriPower/test_with_pins.i b/modules/subchannel/test/tests/SCMTriPower/test_with_pins.i index ba55007c2787..1fbf13fef357 100644 --- a/modules/subchannel/test/tests/SCMTriPower/test_with_pins.i +++ b/modules/subchannel/test/tests/SCMTriPower/test_with_pins.i @@ -6,7 +6,7 @@ length = 0.5 num_cells = 40 [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = 3 n_cells = ${num_cells} flat_to_flat = 3.41e-2 @@ -18,17 +18,6 @@ num_cells = 40 dwire = 1.42e-3 hwire = 0.3048 [] - - [fuel_pins] - type = SCMTriPinMeshGenerator - input = subchannel - nrings = 3 - n_cells = ${num_cells} - heated_length = 0.5 - unheated_length_entry = 0.4 - unheated_length_exit = 0.1 - pitch = 7.26e-3 - [] [] [AuxVariables] diff --git a/modules/subchannel/test/tests/SCMTriPower/tests b/modules/subchannel/test/tests/SCMTriPower/tests index 8088d489ee74..9690bda8beeb 100644 --- a/modules/subchannel/test/tests/SCMTriPower/tests +++ b/modules/subchannel/test/tests/SCMTriPower/tests @@ -1,16 +1,6 @@ [Tests] design = 'SCMTriPowerAux.md SCMTriPowerIC.md' issues = '#28497 #29194' - [SCMTriPower_cells_aligned] - type = CSVDiff - capabilities = 'method!=dbg' - input = 'test.i' - csvdiff = 'test_out.csv' - recover = False - abs_zero = 1e-7 - rel_err = 1e-5 - requirement = 'The system will populate a uniform linear heat rate on subchannels in a triangular lattice using an initial condition and auxiliary kernel' - [] [SCMTriPower_cells_aligned_with_pins] type = CSVDiff input = 'test_with_pins.i' @@ -21,17 +11,6 @@ rel_err = 1e-5 requirement = 'The system will populate a sinusoidal linear heat rate on pins in a triangular lattice using an initial condition and auxiliary kernel' [] - [SCMTriPower_cells_not_aligned] - type = CSVDiff - input = 'test.i' - capabilities = 'method!=dbg' - csvdiff = 'not_aligned.csv' - cli_args = 'num_cells=31 Outputs/file_base=not_aligned' - recover = False - abs_zero = 1e-7 - rel_err = 1e-5 - requirement = 'The system will populate a uniform linear heat rate on subchannels in a triangular lattice using an initial condition and auxiliary kernel in a mesh that has axial divisions that are not aligned with the heated region entrance and exit heights.' - [] [SCMTriPower_cells_not_aligned_with_pins] type = CSVDiff input = 'test_with_pins.i' diff --git a/modules/subchannel/test/tests/auxkernels/mass_flow_rate/blocked_test.i b/modules/subchannel/test/tests/auxkernels/mass_flow_rate/blocked_test.i index 8a8029457298..66ce8def6876 100644 --- a/modules/subchannel/test/tests/auxkernels/mass_flow_rate/blocked_test.i +++ b/modules/subchannel/test/tests/auxkernels/mass_flow_rate/blocked_test.i @@ -1,6 +1,6 @@ [QuadSubChannelMesh] [subchannel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 6 ny = 6 n_cells = 3 diff --git a/modules/subchannel/test/tests/auxkernels/mass_flow_rate/gold/blocked_test_out.e b/modules/subchannel/test/tests/auxkernels/mass_flow_rate/gold/blocked_test_out.e index 607ad2fb9f9c..f8a7b21e892b 100644 Binary files a/modules/subchannel/test/tests/auxkernels/mass_flow_rate/gold/blocked_test_out.e and b/modules/subchannel/test/tests/auxkernels/mass_flow_rate/gold/blocked_test_out.e differ diff --git a/modules/subchannel/test/tests/auxkernels/uniform_mass_flow_rate/test.i b/modules/subchannel/test/tests/auxkernels/uniform_mass_flow_rate/test.i index 7da328e52996..7e80b9f0f229 100644 --- a/modules/subchannel/test/tests/auxkernels/uniform_mass_flow_rate/test.i +++ b/modules/subchannel/test/tests/auxkernels/uniform_mass_flow_rate/test.i @@ -1,6 +1,6 @@ [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 6 ny = 6 n_cells = 10 diff --git a/modules/subchannel/test/tests/gravity/one_pin_problem.i b/modules/subchannel/test/tests/gravity/one_pin_problem.i index 919b232e61f0..90e00040b0af 100644 --- a/modules/subchannel/test/tests/gravity/one_pin_problem.i +++ b/modules/subchannel/test/tests/gravity/one_pin_problem.i @@ -20,12 +20,7 @@ heated_length = 1.0 [QuadSubChannelMesh] [subchannel] - type = SCMQuadSubChannelMeshGenerator - [] - - [fuel_pins] - type = SCMQuadPinMeshGenerator - input = subchannel + type = SCMQuadAssemblyMeshGenerator [] [] diff --git a/modules/subchannel/test/tests/ics/FCTFdisplacementIC/gold/test_out.csv b/modules/subchannel/test/tests/ics/FCTFdisplacementIC/gold/test_out.csv new file mode 100644 index 000000000000..bdb46ed5df44 --- /dev/null +++ b/modules/subchannel/test/tests/ics/FCTFdisplacementIC/gold/test_out.csv @@ -0,0 +1,3 @@ +time,center_S,center_w_perim,corner_S,corner_w_perim,edge_S,edge_w_perim +0,0,0,0,0,0,0 +1,1.78771169811e-05,0.017645070068785,1.6955350355555e-05,0.014091834788374,4.3125203206028e-05,0.028871590068785 diff --git a/modules/subchannel/test/tests/ics/FCTFdisplacementIC/gold/test_out.e b/modules/subchannel/test/tests/ics/FCTFdisplacementIC/gold/test_out.e deleted file mode 100644 index a2fdfe228cdc..000000000000 Binary files a/modules/subchannel/test/tests/ics/FCTFdisplacementIC/gold/test_out.e and /dev/null differ diff --git a/modules/subchannel/test/tests/ics/FCTFdisplacementIC/test.i b/modules/subchannel/test/tests/ics/FCTFdisplacementIC/test.i index 8f3a7aa22050..ef045b046f19 100644 --- a/modules/subchannel/test/tests/ics/FCTFdisplacementIC/test.i +++ b/modules/subchannel/test/tests/ics/FCTFdisplacementIC/test.i @@ -32,7 +32,7 @@ unheated_length_exit = 0.855 #m [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = ${n_rings} n_cells = 10 flat_to_flat = ${inner_duct_in} @@ -47,16 +47,6 @@ unheated_length_exit = 0.855 #m spacer_k = '0.0' [] - [fuel_pins] - type = SCMTriPinMeshGenerator - input = subchannel - nrings = ${n_rings} - n_cells = 10 - unheated_length_entry = ${unheated_length_entry} - heated_length = ${heated_length} - unheated_length_exit = ${unheated_length_exit} - pitch = ${fuel_pin_pitch} - [] [] [Functions] @@ -221,11 +211,57 @@ unheated_length_exit = 0.855 #m [] [] -[Outputs] - exodus = true +[Postprocessors] + [center_S] + type = SubChannelPointValue + variable = S + index = 0 + execute_on = 'timestep_end' + height = 0.5 + [] + [edge_S] + type = SubChannelPointValue + variable = S + index = 96 + execute_on = 'timestep_end' + height = 0.5 + [] + [corner_S] + type = SubChannelPointValue + variable = S + index = 97 + execute_on = 'timestep_end' + height = 0.5 + [] + [center_w_perim] + type = SubChannelPointValue + variable = w_perim + index = 0 + execute_on = 'timestep_end' + height = 0.5 + [] + [edge_w_perim] + type = SubChannelPointValue + variable = w_perim + index = 96 + execute_on = 'timestep_end' + height = 0.5 + [] + [corner_w_perim] + type = SubChannelPointValue + variable = w_perim + index = 97 + execute_on = 'timestep_end' + height = 0.5 + [] [] [Executioner] type = Steady [] +[Outputs] + exodus = false + csv = true +[] + diff --git a/modules/subchannel/test/tests/ics/FCTFdisplacementIC/tests b/modules/subchannel/test/tests/ics/FCTFdisplacementIC/tests index 05b1f08a550f..ccbd9bcd9726 100644 --- a/modules/subchannel/test/tests/ics/FCTFdisplacementIC/tests +++ b/modules/subchannel/test/tests/ics/FCTFdisplacementIC/tests @@ -2,10 +2,14 @@ design = 'FCTFdisplacementIC.md' issues = '#29501' [test] - type = Exodiff + type = CSVDiff + csvdiff = test_out.csv + capabilities = 'method!=dbg' + valgrind = NONE + recover = false + abs_zero = 1e-6 + max_threads = 1 input = 'test.i' - exodiff = 'test_out.e' - recover = False requirement = 'The system will calculate the geometric parameters for FCTF' [] [] diff --git a/modules/subchannel/test/tests/ics/marvel/gold/test_out.csv b/modules/subchannel/test/tests/ics/marvel/gold/test_out.csv new file mode 100644 index 000000000000..66b5b7c07da3 --- /dev/null +++ b/modules/subchannel/test/tests/ics/marvel/gold/test_out.csv @@ -0,0 +1,3 @@ +time,center_S,center_w_perim,corner_S,corner_w_perim,edge_S,edge_w_perim +0,0,0,0,0,0,0 +1,0.00010027438927853,0.051349331922925,6.8990726400969e-05,0.038032143671196,0.0001714043629727,0.093295238070336 diff --git a/modules/subchannel/test/tests/ics/marvel/gold/test_out.e b/modules/subchannel/test/tests/ics/marvel/gold/test_out.e deleted file mode 100644 index bbf1ae860599..000000000000 Binary files a/modules/subchannel/test/tests/ics/marvel/gold/test_out.e and /dev/null differ diff --git a/modules/subchannel/test/tests/ics/marvel/test.i b/modules/subchannel/test/tests/ics/marvel/test.i index 31f497c7872c..d9f46b35f005 100644 --- a/modules/subchannel/test/tests/ics/marvel/test.i +++ b/modules/subchannel/test/tests/ics/marvel/test.i @@ -5,7 +5,7 @@ heated_length = 0.51 [TriSubChannelMesh] [subchannel] - type = TriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = 4 n_cells = 40 flat_to_flat = 0.22 @@ -47,11 +47,56 @@ heated_length = 0.51 [] [] - -[Outputs] - exodus = true +[Postprocessors] + [center_S] + type = SubChannelPointValue + variable = S + index = 0 + execute_on = 'timestep_end' + height = 0.5 + [] + [edge_S] + type = SubChannelPointValue + variable = S + index = 54 + execute_on = 'timestep_end' + height = 0.5 + [] + [corner_S] + type = SubChannelPointValue + variable = S + index = 55 + execute_on = 'timestep_end' + height = 0.5 + [] + [center_w_perim] + type = SubChannelPointValue + variable = w_perim + index = 0 + execute_on = 'timestep_end' + height = 0.5 + [] + [edge_w_perim] + type = SubChannelPointValue + variable = w_perim + index = 54 + execute_on = 'timestep_end' + height = 0.5 + [] + [corner_w_perim] + type = SubChannelPointValue + variable = w_perim + index = 55 + execute_on = 'timestep_end' + height = 0.5 + [] [] [Executioner] type = Steady [] + +[Outputs] + exodus = false + csv = true +[] diff --git a/modules/subchannel/test/tests/ics/marvel/tests b/modules/subchannel/test/tests/ics/marvel/tests index 8ba275919023..3b83e3310f3d 100644 --- a/modules/subchannel/test/tests/ics/marvel/tests +++ b/modules/subchannel/test/tests/ics/marvel/tests @@ -2,10 +2,14 @@ design = 'MarvelTriFlowAreaIC.md MarvelTriWettedPerimIC.md' issues = '#30295' [test] - type = Exodiff + type = CSVDiff + csvdiff = test_out.csv + capabilities = 'method!=dbg' + valgrind = NONE + recover = false + abs_zero = 1e-6 + max_threads = 1 input = 'test.i' - exodiff = 'test_out.e' - recover = False requirement = 'The system shall calculate the flow area and wetted perimeter for a MARVEL-type microreactor core modeled in SCM' [] [] \ No newline at end of file diff --git a/modules/subchannel/test/tests/ics/mass_flow/gold/test_out.csv b/modules/subchannel/test/tests/ics/mass_flow/gold/test_out.csv new file mode 100644 index 000000000000..8851c8123c04 --- /dev/null +++ b/modules/subchannel/test/tests/ics/mass_flow/gold/test_out.csv @@ -0,0 +1,3 @@ +time,center,corner,edge +0,0,0,0 +1,237.18850356876,224.57490366997,236.64980733994 diff --git a/modules/subchannel/test/tests/ics/mass_flow/gold/test_out.e b/modules/subchannel/test/tests/ics/mass_flow/gold/test_out.e deleted file mode 100644 index 3c44a16f7ab7..000000000000 Binary files a/modules/subchannel/test/tests/ics/mass_flow/gold/test_out.e and /dev/null differ diff --git a/modules/subchannel/test/tests/ics/mass_flow/test.i b/modules/subchannel/test/tests/ics/mass_flow/test.i index 3f719ea41f41..94114eaf5091 100644 --- a/modules/subchannel/test/tests/ics/mass_flow/test.i +++ b/modules/subchannel/test/tests/ics/mass_flow/test.i @@ -2,7 +2,7 @@ mass_flux_in = ${fparse 1e+6 * 17.00 / 3600.} [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 3 ny = 3 n_cells = 10 @@ -37,6 +37,30 @@ mass_flux_in = ${fparse 1e+6 * 17.00 / 3600.} [] [] +[Postprocessors] + [center] + type = SubChannelPointValue + variable = mdot + index = 4 + execute_on = 'timestep_end' + height = 0.5 + [] + [edge] + type = SubChannelPointValue + variable = mdot + index = 1 + execute_on = 'timestep_end' + height = 0.5 + [] + [corner] + type = SubChannelPointValue + variable = mdot + index = 0 + execute_on = 'timestep_end' + height = 0.5 + [] +[] + [Problem] solve = false [] @@ -46,5 +70,6 @@ mass_flux_in = ${fparse 1e+6 * 17.00 / 3600.} [] [Outputs] - exodus = true + exodus = false + csv = true [] diff --git a/modules/subchannel/test/tests/ics/mass_flow/tests b/modules/subchannel/test/tests/ics/mass_flow/tests index 79c49b29d101..61045c2da474 100644 --- a/modules/subchannel/test/tests/ics/mass_flow/tests +++ b/modules/subchannel/test/tests/ics/mass_flow/tests @@ -2,10 +2,14 @@ design = 'SCMMassFlowRateIC.md' issues = '#29513' [test] - type = Exodiff + type = CSVDiff + csvdiff = test_out.csv + capabilities = 'method!=dbg' + valgrind = NONE + recover = false + abs_zero = 1e-6 + max_threads = 1 input = 'test.i' - exodiff = 'test_out.e' - recover = False requirement = 'The system will apply initial massflow rate' [] [] diff --git a/modules/subchannel/test/tests/ics/quad_flow_area/gold/test_out.csv b/modules/subchannel/test/tests/ics/quad_flow_area/gold/test_out.csv new file mode 100644 index 000000000000..51cbba9888a2 --- /dev/null +++ b/modules/subchannel/test/tests/ics/quad_flow_area/gold/test_out.csv @@ -0,0 +1,3 @@ +time,center,corner,edge +0,0,0,0 +1,0.050228153696915,0.047557038424229,0.050114076848457 diff --git a/modules/subchannel/test/tests/ics/quad_flow_area/gold/test_out.e b/modules/subchannel/test/tests/ics/quad_flow_area/gold/test_out.e deleted file mode 100644 index 9d3fb753ebf9..000000000000 Binary files a/modules/subchannel/test/tests/ics/quad_flow_area/gold/test_out.e and /dev/null differ diff --git a/modules/subchannel/test/tests/ics/quad_flow_area/test.i b/modules/subchannel/test/tests/ics/quad_flow_area/test.i index 0609362ac2c6..365697a2b7af 100644 --- a/modules/subchannel/test/tests/ics/quad_flow_area/test.i +++ b/modules/subchannel/test/tests/ics/quad_flow_area/test.i @@ -1,6 +1,6 @@ [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 3 ny = 3 n_cells = 10 @@ -25,6 +25,30 @@ [] [] +[Postprocessors] + [center] + type = SubChannelPointValue + variable = S + index = 4 + execute_on = 'timestep_end' + height = 0.5 + [] + [edge] + type = SubChannelPointValue + variable = S + index = 1 + execute_on = 'timestep_end' + height = 0.5 + [] + [corner] + type = SubChannelPointValue + variable = S + index = 0 + execute_on = 'timestep_end' + height = 0.5 + [] +[] + [Problem] solve = false [] @@ -34,5 +58,6 @@ [] [Outputs] - exodus = true + exodus = false + csv = true [] diff --git a/modules/subchannel/test/tests/ics/quad_flow_area/tests b/modules/subchannel/test/tests/ics/quad_flow_area/tests index 11a73fd57024..0732b1dd7c8b 100644 --- a/modules/subchannel/test/tests/ics/quad_flow_area/tests +++ b/modules/subchannel/test/tests/ics/quad_flow_area/tests @@ -2,10 +2,14 @@ design = 'SCMQuadFlowAreaIC.md' issues = '#29194' [test] - type = Exodiff + type = CSVDiff + csvdiff = test_out.csv + capabilities = 'method!=dbg' + valgrind = NONE + recover = false + abs_zero = 1e-6 + max_threads = 1 input = 'test.i' - exodiff = 'test_out.e' - recover = False requirement = 'The system will calculate the subchannel flow area for quadrilateral assemblies' [] [] diff --git a/modules/subchannel/test/tests/ics/quad_wetted_perimeter/gold/test_out.csv b/modules/subchannel/test/tests/ics/quad_wetted_perimeter/gold/test_out.csv new file mode 100644 index 000000000000..a2672474a0ed --- /dev/null +++ b/modules/subchannel/test/tests/ics/quad_wetted_perimeter/gold/test_out.csv @@ -0,0 +1,3 @@ +time,center,corner,edge +0,0,0,0 +1,0.39269908169872,0.54817477042468,0.44634954084936 diff --git a/modules/subchannel/test/tests/ics/quad_wetted_perimeter/gold/test_out.e b/modules/subchannel/test/tests/ics/quad_wetted_perimeter/gold/test_out.e deleted file mode 100644 index fed836cda7be..000000000000 Binary files a/modules/subchannel/test/tests/ics/quad_wetted_perimeter/gold/test_out.e and /dev/null differ diff --git a/modules/subchannel/test/tests/ics/quad_wetted_perimeter/test.i b/modules/subchannel/test/tests/ics/quad_wetted_perimeter/test.i index 86d4560fe38e..b25df62a156c 100644 --- a/modules/subchannel/test/tests/ics/quad_wetted_perimeter/test.i +++ b/modules/subchannel/test/tests/ics/quad_wetted_perimeter/test.i @@ -1,6 +1,6 @@ [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 3 ny = 3 n_cells = 10 @@ -25,6 +25,30 @@ [] [] +[Postprocessors] + [center] + type = SubChannelPointValue + variable = w_perim + index = 4 + execute_on = 'timestep_end' + height = 0.5 + [] + [edge] + type = SubChannelPointValue + variable = w_perim + index = 1 + execute_on = 'timestep_end' + height = 0.5 + [] + [corner] + type = SubChannelPointValue + variable = w_perim + index = 0 + execute_on = 'timestep_end' + height = 0.5 + [] +[] + [Problem] solve = false [] @@ -34,5 +58,6 @@ [] [Outputs] - exodus = true + exodus = false + csv = true [] diff --git a/modules/subchannel/test/tests/ics/quad_wetted_perimeter/tests b/modules/subchannel/test/tests/ics/quad_wetted_perimeter/tests index e24ae9d576a8..e24a7231cdff 100644 --- a/modules/subchannel/test/tests/ics/quad_wetted_perimeter/tests +++ b/modules/subchannel/test/tests/ics/quad_wetted_perimeter/tests @@ -2,10 +2,14 @@ design = 'SCMQuadWettedPerimIC.md' issues = '#29233' [test] - type = Exodiff + type = CSVDiff + csvdiff = test_out.csv + capabilities = 'method!=dbg' + valgrind = NONE + recover = false + abs_zero = 1e-6 + max_threads = 1 input = 'test.i' - exodiff = 'test_out.e' - recover = False requirement = 'The system will calculate the wetted perimeter of subchannels in a quadrilateral lattice' [] [] diff --git a/modules/subchannel/test/tests/ics/tri_flow_area/gold/test_out.csv b/modules/subchannel/test/tests/ics/tri_flow_area/gold/test_out.csv new file mode 100644 index 000000000000..ed26f2949cf8 --- /dev/null +++ b/modules/subchannel/test/tests/ics/tri_flow_area/gold/test_out.csv @@ -0,0 +1,3 @@ +time,center,corner,edge +0,0,0,0 +1,0.0027939221920524,0.001725185385005,0.0052043488821598 diff --git a/modules/subchannel/test/tests/ics/tri_flow_area/gold/test_out.e b/modules/subchannel/test/tests/ics/tri_flow_area/gold/test_out.e deleted file mode 100644 index 23238a18c1e9..000000000000 Binary files a/modules/subchannel/test/tests/ics/tri_flow_area/gold/test_out.e and /dev/null differ diff --git a/modules/subchannel/test/tests/ics/tri_flow_area/test.i b/modules/subchannel/test/tests/ics/tri_flow_area/test.i index 8f012266bf49..7ee7ef3ab417 100644 --- a/modules/subchannel/test/tests/ics/tri_flow_area/test.i +++ b/modules/subchannel/test/tests/ics/tri_flow_area/test.i @@ -1,6 +1,6 @@ [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator n_cells = 2 nrings = 3 flat_to_flat = 0.60 @@ -16,6 +16,7 @@ [Variables] [S] + block = subchannel [] [] @@ -23,6 +24,31 @@ [S_IC] type = SCMTriFlowAreaIC variable = S + block = subchannel + [] +[] + +[Postprocessors] + [center] + type = SubChannelPointValue + variable = S + index = 0 + execute_on = 'timestep_end' + height = 0.5 + [] + [edge] + type = SubChannelPointValue + variable = S + index = 24 + execute_on = 'timestep_end' + height = 0.5 + [] + [corner] + type = SubChannelPointValue + variable = S + index = 25 + execute_on = 'timestep_end' + height = 0.5 [] [] @@ -35,5 +61,6 @@ [] [Outputs] - exodus = true + exodus = false + csv = true [] diff --git a/modules/subchannel/test/tests/ics/tri_flow_area/tests b/modules/subchannel/test/tests/ics/tri_flow_area/tests index 9f1f7b7c1f1b..acbd4ff67c89 100644 --- a/modules/subchannel/test/tests/ics/tri_flow_area/tests +++ b/modules/subchannel/test/tests/ics/tri_flow_area/tests @@ -2,10 +2,14 @@ design = 'SCMTriFlowAreaIC.md' issues = '#29194' [test] - type = Exodiff - input = 'test.i' - exodiff = 'test_out.e' + type = CSVDiff + csvdiff = test_out.csv + capabilities = 'method!=dbg' + valgrind = NONE recover = false + abs_zero = 1e-6 + max_threads = 1 + input = 'test.i' requirement = 'The system will calculate the subchannel flow area for triangular assemblies' [] [] diff --git a/modules/subchannel/test/tests/ics/tri_wetted_perimeter/gold/test_out.csv b/modules/subchannel/test/tests/ics/tri_wetted_perimeter/gold/test_out.csv new file mode 100644 index 000000000000..9508d0386e53 --- /dev/null +++ b/modules/subchannel/test/tests/ics/tri_wetted_perimeter/gold/test_out.csv @@ -0,0 +1,3 @@ +time,center,corner,edge +0,0,0,0 +1,0.23667985307134,0.16530344587089,0.36667985307134 diff --git a/modules/subchannel/test/tests/ics/tri_wetted_perimeter/gold/test_out.e b/modules/subchannel/test/tests/ics/tri_wetted_perimeter/gold/test_out.e deleted file mode 100644 index b6fd2b1525b7..000000000000 Binary files a/modules/subchannel/test/tests/ics/tri_wetted_perimeter/gold/test_out.e and /dev/null differ diff --git a/modules/subchannel/test/tests/ics/tri_wetted_perimeter/test.i b/modules/subchannel/test/tests/ics/tri_wetted_perimeter/test.i index 813908645024..e49b9e43f1de 100644 --- a/modules/subchannel/test/tests/ics/tri_wetted_perimeter/test.i +++ b/modules/subchannel/test/tests/ics/tri_wetted_perimeter/test.i @@ -1,6 +1,6 @@ [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = 3 n_cells = 2 flat_to_flat = 0.60 @@ -16,6 +16,7 @@ [Variables] [w_perim] + block = subchannel [] [] @@ -23,6 +24,31 @@ [w_perim_IC] type = SCMTriWettedPerimIC variable = w_perim + block = subchannel + [] +[] + +[Postprocessors] + [center] + type = SubChannelPointValue + variable = w_perim + index = 0 + execute_on = 'timestep_end' + height = 0.5 + [] + [edge] + type = SubChannelPointValue + variable = w_perim + index = 24 + execute_on = 'timestep_end' + height = 0.5 + [] + [corner] + type = SubChannelPointValue + variable = w_perim + index = 25 + execute_on = 'timestep_end' + height = 0.5 [] [] @@ -35,5 +61,6 @@ [] [Outputs] - exodus = true + exodus = false + csv = true [] diff --git a/modules/subchannel/test/tests/ics/tri_wetted_perimeter/tests b/modules/subchannel/test/tests/ics/tri_wetted_perimeter/tests index c97565649cbb..51c221ecc1ef 100644 --- a/modules/subchannel/test/tests/ics/tri_wetted_perimeter/tests +++ b/modules/subchannel/test/tests/ics/tri_wetted_perimeter/tests @@ -2,10 +2,14 @@ design = 'SCMTriWettedPerimIC.md' issues = '#29194' [test] - type = Exodiff - input = 'test.i' - exodiff = 'test_out.e' + type = CSVDiff + csvdiff = test_out.csv + capabilities = 'method!=dbg' + valgrind = NONE recover = false + abs_zero = 1e-6 + max_threads = 1 + input = 'test.i' requirement = 'The system will calculate the wetted perimeter of subchannels in a triangular lattice' [] [] diff --git a/modules/subchannel/test/tests/mesh/detailed_quad_sub_channel_mesh/coords.i b/modules/subchannel/test/tests/mesh/detailed_quad_assembly/coords.i similarity index 67% rename from modules/subchannel/test/tests/mesh/detailed_quad_sub_channel_mesh/coords.i rename to modules/subchannel/test/tests/mesh/detailed_quad_assembly/coords.i index 894c07b2a027..4cd8679a16cb 100644 --- a/modules/subchannel/test/tests/mesh/detailed_quad_sub_channel_mesh/coords.i +++ b/modules/subchannel/test/tests/mesh/detailed_quad_assembly/coords.i @@ -1,6 +1,6 @@ [Mesh] - [subchannel] - type = SCMDetailedQuadSubChannelMeshGenerator + [assembly] + type = SCMDetailedQuadAssemblyMeshGenerator nx = 3 ny = 3 n_cells = 10 diff --git a/modules/subchannel/test/tests/mesh/detailed_quad_sub_channel_mesh/gold/coords_1x2.e b/modules/subchannel/test/tests/mesh/detailed_quad_assembly/gold/coords_1x2.e similarity index 99% rename from modules/subchannel/test/tests/mesh/detailed_quad_sub_channel_mesh/gold/coords_1x2.e rename to modules/subchannel/test/tests/mesh/detailed_quad_assembly/gold/coords_1x2.e index 82c7eefd0ee1..e9f75d6b95f3 100644 Binary files a/modules/subchannel/test/tests/mesh/detailed_quad_sub_channel_mesh/gold/coords_1x2.e and b/modules/subchannel/test/tests/mesh/detailed_quad_assembly/gold/coords_1x2.e differ diff --git a/modules/subchannel/test/tests/mesh/detailed_quad_sub_channel_mesh/gold/coords_1x3.e b/modules/subchannel/test/tests/mesh/detailed_quad_assembly/gold/coords_1x3.e similarity index 99% rename from modules/subchannel/test/tests/mesh/detailed_quad_sub_channel_mesh/gold/coords_1x3.e rename to modules/subchannel/test/tests/mesh/detailed_quad_assembly/gold/coords_1x3.e index 00c43c85ac52..b0987b527a65 100644 Binary files a/modules/subchannel/test/tests/mesh/detailed_quad_sub_channel_mesh/gold/coords_1x3.e and b/modules/subchannel/test/tests/mesh/detailed_quad_assembly/gold/coords_1x3.e differ diff --git a/modules/subchannel/test/tests/mesh/detailed_quad_sub_channel_mesh/gold/coords_3x1.e b/modules/subchannel/test/tests/mesh/detailed_quad_assembly/gold/coords_3x1.e similarity index 99% rename from modules/subchannel/test/tests/mesh/detailed_quad_sub_channel_mesh/gold/coords_3x1.e rename to modules/subchannel/test/tests/mesh/detailed_quad_assembly/gold/coords_3x1.e index ba6fb4b098e5..d3d6b89df668 100644 Binary files a/modules/subchannel/test/tests/mesh/detailed_quad_sub_channel_mesh/gold/coords_3x1.e and b/modules/subchannel/test/tests/mesh/detailed_quad_assembly/gold/coords_3x1.e differ diff --git a/modules/subchannel/test/tests/mesh/detailed_quad_sub_channel_mesh/gold/coords_3x3.e b/modules/subchannel/test/tests/mesh/detailed_quad_assembly/gold/coords_3x3.e similarity index 57% rename from modules/subchannel/test/tests/mesh/detailed_quad_sub_channel_mesh/gold/coords_3x3.e rename to modules/subchannel/test/tests/mesh/detailed_quad_assembly/gold/coords_3x3.e index 12a8d2c74fd6..874b975213b0 100644 Binary files a/modules/subchannel/test/tests/mesh/detailed_quad_sub_channel_mesh/gold/coords_3x3.e and b/modules/subchannel/test/tests/mesh/detailed_quad_assembly/gold/coords_3x3.e differ diff --git a/modules/subchannel/test/tests/mesh/detailed_quad_sub_channel_mesh/tests b/modules/subchannel/test/tests/mesh/detailed_quad_assembly/tests similarity index 53% rename from modules/subchannel/test/tests/mesh/detailed_quad_sub_channel_mesh/tests rename to modules/subchannel/test/tests/mesh/detailed_quad_assembly/tests index b6a945fe229e..c091166b9fba 100644 --- a/modules/subchannel/test/tests/mesh/detailed_quad_sub_channel_mesh/tests +++ b/modules/subchannel/test/tests/mesh/detailed_quad_assembly/tests @@ -1,20 +1,27 @@ [Tests] - design = 'SCMDetailedQuadSubChannelMeshGenerator.md' - issues = '#29191 #29250' + design = 'SCMDetailedQuadAssemblyMeshGenerator.md' + issues = '#32796' [coords] type = Exodiff input = coords.i exodiff = coords_3x3.e cli_args = "--mesh-only coords_3x3.e" recover = false - requirement = 'The system will create a detailed mesh of the subchannels for quadrilateral assemblies (3x3)' + requirement = 'The system will create a detailed mesh of the subchannels and fuel pins for quadrilateral assemblies (3x3)' + [] + [subchannel_number] + type = 'RunException' + input = 'coords.i' + cli_args = 'Mesh/assembly/nx=1 Mesh/assembly/ny=1' + expect_err = "The number of subchannels cannot be less than 2 in both directions\. Smallest assembly allowed is either 2X1 or 1X2\." + requirement = 'The system shall check the minimum number of subchannels for detailed quadrilateral assemblies' [] [1x2] type = Exodiff input = coords.i exodiff = coords_1x2.e - cli_args = "--mesh-only coords_1x2.e Mesh/subchannel/nx=1 Mesh/subchannel/ny=2" + cli_args = "--mesh-only coords_1x2.e Mesh/assembly/nx=1 Mesh/assembly/ny=2" recover = false requirement = 'The system will create a detailed mesh of the subchannels for quadrilateral assemblies (1x2)' [] @@ -23,7 +30,7 @@ type = Exodiff input = coords.i exodiff = coords_1x3.e - cli_args = "--mesh-only coords_1x3.e Mesh/subchannel/nx=1 Mesh/subchannel/ny=3" + cli_args = "--mesh-only coords_1x3.e Mesh/assembly/nx=1 Mesh/assembly/ny=3" recover = false requirement = 'The system will create a detailed mesh of the subchannels for quadrilateral assemblies (1x3)' [] @@ -32,7 +39,7 @@ type = Exodiff input = coords.i exodiff = coords_3x1.e - cli_args = "--mesh-only coords_3x1.e Mesh/subchannel/nx=3 Mesh/subchannel/ny=1" + cli_args = "--mesh-only coords_3x1.e Mesh/assembly/nx=3 Mesh/assembly/ny=1" recover = false requirement = 'The system will create a detailed mesh of the subchannels for quadrilateral assemblies (3x1)' [] diff --git a/modules/subchannel/test/tests/mesh/detailed_quad_pin_mesh/coords.i b/modules/subchannel/test/tests/mesh/detailed_quad_pin_mesh/coords.i deleted file mode 100644 index a40ae453ee76..000000000000 --- a/modules/subchannel/test/tests/mesh/detailed_quad_pin_mesh/coords.i +++ /dev/null @@ -1,19 +0,0 @@ -[GlobalParams] - nx = 3 - ny = 3 - n_cells = 2 - pitch = 1 - side_gap = 0.1 - heated_length = 1 - pin_diameter = 0.5 -[] - -[Mesh] - [subchannel] - type = SCMDetailedQuadSubChannelMeshGenerator - [] - [pins] - type = SCMDetailedQuadPinMeshGenerator - input = subchannel - [] -[] diff --git a/modules/subchannel/test/tests/mesh/detailed_quad_pin_mesh/gold/coords_in.e b/modules/subchannel/test/tests/mesh/detailed_quad_pin_mesh/gold/coords_in.e deleted file mode 100644 index 247fd5de6df4..000000000000 Binary files a/modules/subchannel/test/tests/mesh/detailed_quad_pin_mesh/gold/coords_in.e and /dev/null differ diff --git a/modules/subchannel/test/tests/mesh/detailed_tri_sub_channel_mesh/coords.i b/modules/subchannel/test/tests/mesh/detailed_tri_assembly/coords.i similarity index 70% rename from modules/subchannel/test/tests/mesh/detailed_tri_sub_channel_mesh/coords.i rename to modules/subchannel/test/tests/mesh/detailed_tri_assembly/coords.i index f975c9c989ac..08358598a98c 100644 --- a/modules/subchannel/test/tests/mesh/detailed_tri_sub_channel_mesh/coords.i +++ b/modules/subchannel/test/tests/mesh/detailed_tri_assembly/coords.i @@ -8,8 +8,8 @@ [TriSubChannelMesh] [subchannel] - type = SCMDetailedTriSubChannelMeshGenerator + type = SCMDetailedTriAssemblyMeshGenerator pin_diameter = 0.01 - verbose_flag = true + verbose_flag = true [] [] diff --git a/modules/subchannel/test/tests/mesh/detailed_tri_pin_mesh/gold/coords_in.e b/modules/subchannel/test/tests/mesh/detailed_tri_assembly/gold/coords_in.e similarity index 90% rename from modules/subchannel/test/tests/mesh/detailed_tri_pin_mesh/gold/coords_in.e rename to modules/subchannel/test/tests/mesh/detailed_tri_assembly/gold/coords_in.e index 935cbfb2d9be..bee1e7b5dcff 100644 Binary files a/modules/subchannel/test/tests/mesh/detailed_tri_pin_mesh/gold/coords_in.e and b/modules/subchannel/test/tests/mesh/detailed_tri_assembly/gold/coords_in.e differ diff --git a/modules/subchannel/test/tests/mesh/detailed_quad_pin_mesh/tests b/modules/subchannel/test/tests/mesh/detailed_tri_assembly/tests similarity index 63% rename from modules/subchannel/test/tests/mesh/detailed_quad_pin_mesh/tests rename to modules/subchannel/test/tests/mesh/detailed_tri_assembly/tests index e06c93f6bc09..0136f4a4fec2 100644 --- a/modules/subchannel/test/tests/mesh/detailed_quad_pin_mesh/tests +++ b/modules/subchannel/test/tests/mesh/detailed_tri_assembly/tests @@ -1,12 +1,12 @@ [Tests] - design = 'SCMDetailedQuadPinMeshGenerator.md' - issues = '#29246' + design = 'SCMDetailedTriAssemblyMeshGenerator.md' + issues = '#32796' [coords] type = Exodiff input = coords.i exodiff = coords_in.e cli_args = "--mesh-only" recover = false - requirement = 'The system will create a detailed mesh of the fuel pins for quadrilateral assemblies' + requirement = 'The system will create a detailed mesh of the subchannels and pins in triangular assemblies' [] [] diff --git a/modules/subchannel/test/tests/mesh/detailed_tri_pin_mesh/coords.i b/modules/subchannel/test/tests/mesh/detailed_tri_pin_mesh/coords.i deleted file mode 100644 index fc5e15dd3842..000000000000 --- a/modules/subchannel/test/tests/mesh/detailed_tri_pin_mesh/coords.i +++ /dev/null @@ -1,18 +0,0 @@ -[GlobalParams] - nrings = 3 - n_cells = 20 - flat_to_flat = 0.056 - heated_length = 0.2 - pitch = 0.012 - pin_diameter = 0.01 -[] - -[TriSubChannelMesh] - [subchannel] - type = SCMDetailedTriSubChannelMeshGenerator - [] - [pins] - type = SCMDetailedTriPinMeshGenerator - input = subchannel - [] -[] diff --git a/modules/subchannel/test/tests/mesh/detailed_tri_pin_mesh/tests b/modules/subchannel/test/tests/mesh/detailed_tri_pin_mesh/tests deleted file mode 100644 index 8750afc3b98c..000000000000 --- a/modules/subchannel/test/tests/mesh/detailed_tri_pin_mesh/tests +++ /dev/null @@ -1,13 +0,0 @@ -[Tests] - design = 'SCMDetailedTriPinMeshGenerator.md' - issues = '#29484' - requirement = 'The system will create a detailed mesh of the fuel pins for triangular assemblies' - [coords] - type = Exodiff - input = coords.i - exodiff = coords_in.e - cli_args = "--mesh-only" - recover = false - requirement = 'The system will create a detailed mesh of the fuel pins for triangular assemblies' - [] -[] diff --git a/modules/subchannel/test/tests/mesh/detailed_tri_sub_channel_mesh/gold/coords_in.e b/modules/subchannel/test/tests/mesh/detailed_tri_sub_channel_mesh/gold/coords_in.e deleted file mode 100644 index 6fab3d3eed82..000000000000 Binary files a/modules/subchannel/test/tests/mesh/detailed_tri_sub_channel_mesh/gold/coords_in.e and /dev/null differ diff --git a/modules/subchannel/test/tests/mesh/detailed_tri_sub_channel_mesh/tests b/modules/subchannel/test/tests/mesh/detailed_tri_sub_channel_mesh/tests deleted file mode 100644 index 6db0544ada11..000000000000 --- a/modules/subchannel/test/tests/mesh/detailed_tri_sub_channel_mesh/tests +++ /dev/null @@ -1,12 +0,0 @@ -[Tests] - design = 'SCMDetailedTriSubChannelMeshGenerator.md' - issues = '#29493' - [coords] - type = Exodiff - input = coords.i - exodiff = coords_in.e - cli_args = "--mesh-only" - recover = false - requirement = 'The system will create a detailed mesh of the subchannels in triangular assemblies' - [] -[] diff --git a/modules/subchannel/test/tests/mesh/quad_sub_channel_mesh/coords.i b/modules/subchannel/test/tests/mesh/quad_assembly/coords.i similarity index 83% rename from modules/subchannel/test/tests/mesh/quad_sub_channel_mesh/coords.i rename to modules/subchannel/test/tests/mesh/quad_assembly/coords.i index 1d9e04c2761e..ff0594d392be 100644 --- a/modules/subchannel/test/tests/mesh/quad_sub_channel_mesh/coords.i +++ b/modules/subchannel/test/tests/mesh/quad_assembly/coords.i @@ -1,6 +1,6 @@ [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 3 ny = 3 n_cells = 10 diff --git a/modules/subchannel/test/tests/mesh/quad_assembly/gold/coords_in.e b/modules/subchannel/test/tests/mesh/quad_assembly/gold/coords_in.e new file mode 100644 index 000000000000..ef70565bc879 Binary files /dev/null and b/modules/subchannel/test/tests/mesh/quad_assembly/gold/coords_in.e differ diff --git a/modules/subchannel/test/tests/mesh/quad_sub_channel_mesh/subchannel_number.i b/modules/subchannel/test/tests/mesh/quad_assembly/subchannel_number.i similarity index 83% rename from modules/subchannel/test/tests/mesh/quad_sub_channel_mesh/subchannel_number.i rename to modules/subchannel/test/tests/mesh/quad_assembly/subchannel_number.i index 210710fa6287..7f69a6524c16 100644 --- a/modules/subchannel/test/tests/mesh/quad_sub_channel_mesh/subchannel_number.i +++ b/modules/subchannel/test/tests/mesh/quad_assembly/subchannel_number.i @@ -1,6 +1,6 @@ [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 1 ny = 1 n_cells = 10 diff --git a/modules/subchannel/test/tests/mesh/quad_sub_channel_mesh/tests b/modules/subchannel/test/tests/mesh/quad_assembly/tests similarity index 74% rename from modules/subchannel/test/tests/mesh/quad_sub_channel_mesh/tests rename to modules/subchannel/test/tests/mesh/quad_assembly/tests index e86ddac0c2fc..c25bde3428ca 100644 --- a/modules/subchannel/test/tests/mesh/quad_sub_channel_mesh/tests +++ b/modules/subchannel/test/tests/mesh/quad_assembly/tests @@ -1,5 +1,5 @@ [Tests] - design = 'SCMQuadSubChannelMeshGenerator.md' + design = 'SCMQuadAssemblyMeshGenerator.md' [coords] type = Exodiff input = coords.i @@ -7,12 +7,12 @@ cli_args = "--mesh-only" recover = false issues = '#29241' - requirement = 'The system will create a mesh of the subchannels for quadrilateral assemblies' + requirement = 'The system will create a mesh of the subchannels and pins for quadrilateral assemblies' [] [subchannel_number] type = 'RunException' input = 'subchannel_number.i' - expect_err = "The number of subchannels cannot be less than 2 in both directions \(x and y\)\. Smallest assembly allowed is either 2X1 or 1X2\." + expect_err = "The number of subchannels cannot be less than 2 in both directions\. Smallest assembly allowed is either 2X1 or 1X2\." issues = '#29224' requirement = 'The system shall check the minimum number of subchannels' [] diff --git a/modules/subchannel/test/tests/mesh/quad_subchannel_duct_mesh/coords.i b/modules/subchannel/test/tests/mesh/quad_duct/coords.i similarity index 87% rename from modules/subchannel/test/tests/mesh/quad_subchannel_duct_mesh/coords.i rename to modules/subchannel/test/tests/mesh/quad_duct/coords.i index 72d0fe50ced4..046c9525d491 100644 --- a/modules/subchannel/test/tests/mesh/quad_subchannel_duct_mesh/coords.i +++ b/modules/subchannel/test/tests/mesh/quad_duct/coords.i @@ -12,7 +12,7 @@ [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator [] [duct] diff --git a/modules/subchannel/test/tests/mesh/quad_duct/gold/coords_in.e b/modules/subchannel/test/tests/mesh/quad_duct/gold/coords_in.e new file mode 100644 index 000000000000..6f022afdc006 Binary files /dev/null and b/modules/subchannel/test/tests/mesh/quad_duct/gold/coords_in.e differ diff --git a/modules/subchannel/test/tests/mesh/quad_subchannel_duct_mesh/tests b/modules/subchannel/test/tests/mesh/quad_duct/tests similarity index 100% rename from modules/subchannel/test/tests/mesh/quad_subchannel_duct_mesh/tests rename to modules/subchannel/test/tests/mesh/quad_duct/tests diff --git a/modules/subchannel/test/tests/mesh/quad_sub_channel_mesh/gold/coords_in.e b/modules/subchannel/test/tests/mesh/quad_sub_channel_mesh/gold/coords_in.e deleted file mode 100644 index ab1fd4f32338..000000000000 Binary files a/modules/subchannel/test/tests/mesh/quad_sub_channel_mesh/gold/coords_in.e and /dev/null differ diff --git a/modules/subchannel/test/tests/mesh/quad_sub_channel_pin_mesh/coords.i b/modules/subchannel/test/tests/mesh/quad_sub_channel_pin_mesh/coords.i deleted file mode 100644 index 26f270d90ec8..000000000000 --- a/modules/subchannel/test/tests/mesh/quad_sub_channel_pin_mesh/coords.i +++ /dev/null @@ -1,24 +0,0 @@ -[QuadSubChannelMesh] - [sub_channel] - type = SCMQuadSubChannelMeshGenerator - nx = 3 - ny = 3 - n_cells = 10 - pitch = 0.25 - pin_diameter = 0.125 - side_gap = 0.1 - heated_length = 1 - spacer_k = '0.0' - spacer_z = '0' - [] - - [fuel_pins] - type = SCMQuadPinMeshGenerator - input = sub_channel - nx = 3 - ny = 3 - n_cells = 10 - pitch = 0.25 - heated_length = 1 - [] -[] diff --git a/modules/subchannel/test/tests/mesh/quad_sub_channel_pin_mesh/gold/coords_in.e b/modules/subchannel/test/tests/mesh/quad_sub_channel_pin_mesh/gold/coords_in.e deleted file mode 100644 index 590a57fdf7b4..000000000000 Binary files a/modules/subchannel/test/tests/mesh/quad_sub_channel_pin_mesh/gold/coords_in.e and /dev/null differ diff --git a/modules/subchannel/test/tests/mesh/quad_sub_channel_pin_mesh/tests b/modules/subchannel/test/tests/mesh/quad_sub_channel_pin_mesh/tests deleted file mode 100644 index 824486f6e13c..000000000000 --- a/modules/subchannel/test/tests/mesh/quad_sub_channel_pin_mesh/tests +++ /dev/null @@ -1,12 +0,0 @@ -[Tests] - design = 'SCMQuadPinMeshGenerator.md' - issues = '#29241' - [coords] - type = Exodiff - input = coords.i - exodiff = coords_in.e - cli_args = "--mesh-only" - recover = false - requirement = 'The system will create a mesh of the fuel pins for quadrilateral assemblies' - [] -[] diff --git a/modules/subchannel/test/tests/mesh/quad_subchannel_duct_mesh/gold/coords_in.e b/modules/subchannel/test/tests/mesh/quad_subchannel_duct_mesh/gold/coords_in.e deleted file mode 100644 index 37e466ebbc12..000000000000 Binary files a/modules/subchannel/test/tests/mesh/quad_subchannel_duct_mesh/gold/coords_in.e and /dev/null differ diff --git a/modules/subchannel/test/tests/mesh/tri_assembly/gold/tricoords3_in.e b/modules/subchannel/test/tests/mesh/tri_assembly/gold/tricoords3_in.e new file mode 100644 index 000000000000..a112f7ebaf16 Binary files /dev/null and b/modules/subchannel/test/tests/mesh/tri_assembly/gold/tricoords3_in.e differ diff --git a/modules/subchannel/test/tests/mesh/tri_subchannel_mesh/tests b/modules/subchannel/test/tests/mesh/tri_assembly/tests similarity index 85% rename from modules/subchannel/test/tests/mesh/tri_subchannel_mesh/tests rename to modules/subchannel/test/tests/mesh/tri_assembly/tests index dbb673739885..d1db2a068eed 100644 --- a/modules/subchannel/test/tests/mesh/tri_subchannel_mesh/tests +++ b/modules/subchannel/test/tests/mesh/tri_assembly/tests @@ -1,5 +1,5 @@ [Tests] - design = 'SCMTriSubChannelMeshGenerator.md' + design = 'SCMTriAssemblyMeshGenerator.md' issues = '#29194' [tricoords3] type = Exodiff diff --git a/modules/subchannel/test/tests/mesh/tri_subchannel_mesh/tricoords3.i b/modules/subchannel/test/tests/mesh/tri_assembly/tricoords3.i similarity index 85% rename from modules/subchannel/test/tests/mesh/tri_subchannel_mesh/tricoords3.i rename to modules/subchannel/test/tests/mesh/tri_assembly/tricoords3.i index 7e6fa264b59c..6227e26c1621 100644 --- a/modules/subchannel/test/tests/mesh/tri_subchannel_mesh/tricoords3.i +++ b/modules/subchannel/test/tests/mesh/tri_assembly/tricoords3.i @@ -1,6 +1,6 @@ [TriSubChannelMesh] [sub_channel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = 3 n_cells = 2 flat_to_flat = 0.60 diff --git a/modules/subchannel/test/tests/mesh/tri_subchannel_duct_mesh/coords.i b/modules/subchannel/test/tests/mesh/tri_duct/coords.i similarity index 88% rename from modules/subchannel/test/tests/mesh/tri_subchannel_duct_mesh/coords.i rename to modules/subchannel/test/tests/mesh/tri_duct/coords.i index 86bae0d5dd5e..d21a3300ca09 100644 --- a/modules/subchannel/test/tests/mesh/tri_subchannel_duct_mesh/coords.i +++ b/modules/subchannel/test/tests/mesh/tri_duct/coords.i @@ -8,7 +8,7 @@ [TriSubChannelMesh] [sub_channel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator pin_diameter = 0.1 dwire = 0.03 hwire = 0.3 diff --git a/modules/subchannel/test/tests/mesh/tri_subchannel_duct_mesh/gold/coords_in.e b/modules/subchannel/test/tests/mesh/tri_duct/gold/coords_in.e similarity index 62% rename from modules/subchannel/test/tests/mesh/tri_subchannel_duct_mesh/gold/coords_in.e rename to modules/subchannel/test/tests/mesh/tri_duct/gold/coords_in.e index 8af1584515ba..5589c5afc04c 100644 Binary files a/modules/subchannel/test/tests/mesh/tri_subchannel_duct_mesh/gold/coords_in.e and b/modules/subchannel/test/tests/mesh/tri_duct/gold/coords_in.e differ diff --git a/modules/subchannel/test/tests/mesh/tri_subchannel_duct_mesh/tests b/modules/subchannel/test/tests/mesh/tri_duct/tests similarity index 100% rename from modules/subchannel/test/tests/mesh/tri_subchannel_duct_mesh/tests rename to modules/subchannel/test/tests/mesh/tri_duct/tests diff --git a/modules/subchannel/test/tests/mesh/tri_sub_channel_pin_mesh/coords.i b/modules/subchannel/test/tests/mesh/tri_sub_channel_pin_mesh/coords.i deleted file mode 100644 index afab5b6f4579..000000000000 --- a/modules/subchannel/test/tests/mesh/tri_sub_channel_pin_mesh/coords.i +++ /dev/null @@ -1,27 +0,0 @@ -[GlobalParams] - nrings = 3 - n_cells = 20 - flat_to_flat = 0.056 - heated_length = 0.2 - pitch = 0.012 -[] - -[TriSubChannelMesh] - [subchannel] - type = SCMTriSubChannelMeshGenerator - pin_diameter = 0.01 - dwire = 0.002 - hwire = 0.0833 - spacer_z = '0' - spacer_k = '5.0' - [] - [pins] - type = SCMTriPinMeshGenerator - input = subchannel - - [] - [duct] - type = SCMTriDuctMeshGenerator - input = pins - [] -[] diff --git a/modules/subchannel/test/tests/mesh/tri_sub_channel_pin_mesh/gold/coords_in.e b/modules/subchannel/test/tests/mesh/tri_sub_channel_pin_mesh/gold/coords_in.e deleted file mode 100644 index d464c18f6e40..000000000000 Binary files a/modules/subchannel/test/tests/mesh/tri_sub_channel_pin_mesh/gold/coords_in.e and /dev/null differ diff --git a/modules/subchannel/test/tests/mesh/tri_sub_channel_pin_mesh/tests b/modules/subchannel/test/tests/mesh/tri_sub_channel_pin_mesh/tests deleted file mode 100644 index 4ade2c2b7d4b..000000000000 --- a/modules/subchannel/test/tests/mesh/tri_sub_channel_pin_mesh/tests +++ /dev/null @@ -1,13 +0,0 @@ -[Tests] - design = 'SCMTriDuctMeshGenerator.md' - issues = '#29484' - [coords] - type = Exodiff - input = coords.i - exodiff = coords_in.e - cli_args = "--mesh-only" - recover = false - mesh_mode = 'replicated' - requirement = 'The system will create a hexagonal duct mesh and a pin mesh for triangular assemblies' - [] -[] diff --git a/modules/subchannel/test/tests/mesh/tri_subchannel_mesh/gold/tricoords3_in.e b/modules/subchannel/test/tests/mesh/tri_subchannel_mesh/gold/tricoords3_in.e deleted file mode 100644 index af15baca3dc3..000000000000 Binary files a/modules/subchannel/test/tests/mesh/tri_subchannel_mesh/gold/tricoords3_in.e and /dev/null differ diff --git a/modules/subchannel/test/tests/multiapp/sc_core.i b/modules/subchannel/test/tests/multiapp/sc_core.i index e94582292863..64ed36b49316 100644 --- a/modules/subchannel/test/tests/multiapp/sc_core.i +++ b/modules/subchannel/test/tests/multiapp/sc_core.i @@ -27,7 +27,7 @@ duct_inside = '${fparse 11.43*2*scale_factor}' [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = '${fparse n_rings}' n_cells = 10 flat_to_flat = '${fparse duct_inside}' @@ -40,18 +40,10 @@ duct_inside = '${fparse 11.43*2*scale_factor}' spacer_k = '0' [] - [fuel_pins] - type = SCMTriPinMeshGenerator - input = subchannel - nrings = '${fparse n_rings}' - n_cells = 10 - heated_length = '${fparse length_heated_fuel}' - pitch = '${fparse fuel_pin_pitch}' - [] [duct] type = SCMTriDuctMeshGenerator - input = fuel_pins + input = subchannel nrings = '${fparse n_rings}' n_cells = 10 flat_to_flat = '${fparse duct_inside}' diff --git a/modules/subchannel/test/tests/outputs/normalslicevalues/test.i b/modules/subchannel/test/tests/outputs/normalslicevalues/test.i index ca205e798679..dc22ab12836d 100644 --- a/modules/subchannel/test/tests/outputs/normalslicevalues/test.i +++ b/modules/subchannel/test/tests/outputs/normalslicevalues/test.i @@ -1,6 +1,6 @@ [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 3 ny = 3 n_cells = 10 diff --git a/modules/subchannel/test/tests/positions/pin_positions.i b/modules/subchannel/test/tests/positions/pin_positions.i index 664f6877ddfe..9b1bb071e481 100644 --- a/modules/subchannel/test/tests/positions/pin_positions.i +++ b/modules/subchannel/test/tests/positions/pin_positions.i @@ -32,7 +32,7 @@ duct_inside = '${fparse duct_outside - 2 * duct_thickness}' [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = '${fparse n_rings}' n_cells = ${n_cells} flat_to_flat = '${fparse duct_inside}' @@ -47,20 +47,9 @@ duct_inside = '${fparse duct_outside - 2 * duct_thickness}' spacer_k = '0.5 0.5' [] - [fuel_pins] - type = SCMTriPinMeshGenerator - input = subchannel - nrings = '${fparse n_rings}' - n_cells = ${n_cells} - unheated_length_entry = '${fparse length_entry_fuel}' - heated_length = '${fparse length_heated_fuel}' - unheated_length_exit = '${fparse length_outlet_fuel}' - pitch = '${fparse fuel_pin_pitch}' - [] - [duct] type = SCMTriDuctMeshGenerator - input = fuel_pins + input = subchannel nrings = '${fparse n_rings}' n_cells = ${n_cells} flat_to_flat = '${fparse duct_inside}' diff --git a/modules/subchannel/test/tests/postprocessors/quadsubchannelpointvalue/test.i b/modules/subchannel/test/tests/postprocessors/quadsubchannelpointvalue/test.i index 7609ef7d6027..528c3d7646d5 100644 --- a/modules/subchannel/test/tests/postprocessors/quadsubchannelpointvalue/test.i +++ b/modules/subchannel/test/tests/postprocessors/quadsubchannelpointvalue/test.i @@ -2,7 +2,7 @@ T_in = 359.15 [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 3 ny = 3 n_cells = 10 diff --git a/modules/subchannel/test/tests/postprocessors/quadsubchannelpointvalue/test_error.i b/modules/subchannel/test/tests/postprocessors/quadsubchannelpointvalue/test_error.i index a3a30de0d8b0..26df3b54c6fc 100644 --- a/modules/subchannel/test/tests/postprocessors/quadsubchannelpointvalue/test_error.i +++ b/modules/subchannel/test/tests/postprocessors/quadsubchannelpointvalue/test_error.i @@ -2,7 +2,7 @@ T_in = 359.15 [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 3 ny = 3 n_cells = 10 diff --git a/modules/subchannel/test/tests/postprocessors/trisubchannelpointvalue/test.i b/modules/subchannel/test/tests/postprocessors/trisubchannelpointvalue/test.i index 488bb4c9cd4c..7c5730623470 100644 --- a/modules/subchannel/test/tests/postprocessors/trisubchannelpointvalue/test.i +++ b/modules/subchannel/test/tests/postprocessors/trisubchannelpointvalue/test.i @@ -2,7 +2,7 @@ T_in = 359.15 [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = 3 n_cells = 10 flat_to_flat = 3.41e-2 diff --git a/modules/subchannel/test/tests/problems/Lead-LBE-19pin/3D_LBE-19pin.i b/modules/subchannel/test/tests/problems/Lead-LBE-19pin/3D_LBE-19pin.i index 09148f6c479e..9cc2de2ad268 100644 --- a/modules/subchannel/test/tests/problems/Lead-LBE-19pin/3D_LBE-19pin.i +++ b/modules/subchannel/test/tests/problems/Lead-LBE-19pin/3D_LBE-19pin.i @@ -1,6 +1,6 @@ [Mesh] [subchannel] - type = SCMDetailedTriSubChannelMeshGenerator + type = SCMDetailedTriAssemblyMeshGenerator nrings = 3 n_cells = 50 flat_to_flat = 0.05319936 diff --git a/modules/subchannel/test/tests/problems/Lead-LBE-19pin/test_LBE-19pin.i b/modules/subchannel/test/tests/problems/Lead-LBE-19pin/test_LBE-19pin.i index 4a4d0469685b..67cd4a7c1333 100644 --- a/modules/subchannel/test/tests/problems/Lead-LBE-19pin/test_LBE-19pin.i +++ b/modules/subchannel/test/tests/problems/Lead-LBE-19pin/test_LBE-19pin.i @@ -6,7 +6,7 @@ mass_flux_in = '${fparse 10*rho_in/3600/flow_area}' P_out = 1.0e5 # Pa [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = 3 n_cells = 50 flat_to_flat = 0.05319936 @@ -42,6 +42,7 @@ P_out = 1.0e5 # Pa segregated = false verbose_subchannel = true interpolation_scheme = upwind + pin_HTC_closure = 'Dittus-Boelter' # friction model friction_closure = 'cheng' @@ -51,6 +52,9 @@ P_out = 1.0e5 # Pa [cheng] type = SCMFrictionUpdatedChengTodreas [] + [Dittus-Boelter] + type = SCMHTCDittusBoelter + [] [] [ICs] @@ -71,6 +75,12 @@ P_out = 1.0e5 # Pa filename = "pin_power_profile19.txt" [] + [Dpin_ic] + type = ConstantIC + variable = Dpin + value = 8.2e-3 + [] + [T_ic] type = ConstantIC variable = T @@ -209,6 +219,7 @@ P_out = 1.0e5 # Pa [Total_power] type = ElementIntegralVariablePostprocessor variable = q_prime + block = fuel_pins [] [] diff --git a/modules/subchannel/test/tests/problems/Lead-LBE-19pin/test_LEAD-19pin.i b/modules/subchannel/test/tests/problems/Lead-LBE-19pin/test_LEAD-19pin.i index a5b730b0c054..f825f6a64264 100644 --- a/modules/subchannel/test/tests/problems/Lead-LBE-19pin/test_LEAD-19pin.i +++ b/modules/subchannel/test/tests/problems/Lead-LBE-19pin/test_LEAD-19pin.i @@ -6,7 +6,7 @@ mass_flux_in = '${fparse 10*rho_in/3600/flow_area}' P_out = 1.0e5 # Pa [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = 3 n_cells = 50 flat_to_flat = 0.05319936 @@ -45,6 +45,7 @@ P_out = 1.0e5 # Pa verbose_multiapps = true verbose_subchannel = true interpolation_scheme = upwind + pin_HTC_closure = 'Dittus-Boelter' # friction model friction_closure = 'cheng' @@ -54,6 +55,9 @@ P_out = 1.0e5 # Pa [cheng] type = SCMFrictionUpdatedChengTodreas [] + [Dittus-Boelter] + type = SCMHTCDittusBoelter + [] [] [ICs] @@ -74,6 +78,12 @@ P_out = 1.0e5 # Pa filename = "pin_power_profile19.txt" [] + [Dpin_ic] + type = ConstantIC + variable = Dpin + value = 8.2e-3 + [] + [T_ic] type = ConstantIC variable = T @@ -217,6 +227,7 @@ P_out = 1.0e5 # Pa [Total_power] type = ElementIntegralVariablePostprocessor variable = q_prime + block = fuel_pins [] [] diff --git a/modules/subchannel/test/tests/problems/SFR/EBR-II/XX09_SS_SHRT17.i b/modules/subchannel/test/tests/problems/SFR/EBR-II/XX09_SS_SHRT17.i index e651ac54ebc7..9461d5f05705 100644 --- a/modules/subchannel/test/tests/problems/SFR/EBR-II/XX09_SS_SHRT17.i +++ b/modules/subchannel/test/tests/problems/SFR/EBR-II/XX09_SS_SHRT17.i @@ -25,7 +25,7 @@ unheated_length_exit = '${fparse 26.9*scale_factor}' [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = ${n_rings} n_cells = 50 flat_to_flat = ${inner_duct_in} @@ -39,15 +39,6 @@ unheated_length_exit = '${fparse 26.9*scale_factor}' spacer_k = '0.0' [] - [fuel_pins] - type = SCMTriPinMeshGenerator - input = subchannel - nrings = ${n_rings} - n_cells = 50 - unheated_length_exit = ${unheated_length_exit} - heated_length = ${heated_length} - pitch = ${fuel_pin_pitch} - [] [] [AuxVariables] diff --git a/modules/subchannel/test/tests/problems/SFR/sodium-19pin/test19_explicit.i b/modules/subchannel/test/tests/problems/SFR/sodium-19pin/test19_explicit.i index 5567db11403b..8b575612a305 100644 --- a/modules/subchannel/test/tests/problems/SFR/sodium-19pin/test19_explicit.i +++ b/modules/subchannel/test/tests/problems/SFR/sodium-19pin/test19_explicit.i @@ -12,7 +12,7 @@ P_out = 2.0e5 # Pa [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator pin_diameter = 0.01 dwire = 0.002 hwire = 0.0833 @@ -44,6 +44,7 @@ P_out = 2.0e5 # Pa segregated = true verbose_subchannel = true duct_HTC_closure = 'gnielinski' + pin_HTC_closure = 'Dittus-Boelter' friction_closure = 'cheng' [] @@ -54,6 +55,9 @@ P_out = 2.0e5 # Pa [gnielinski] type = SCMHTCGnielinski [] + [Dittus-Boelter] + type = SCMHTCDittusBoelter + [] [] [ICs] @@ -74,6 +78,12 @@ P_out = 2.0e5 # Pa filename = "pin_power_profile19.txt" [] + [Dpin_ic] + type = ConstantIC + variable = Dpin + value = 0.01 + [] + [T_ic] type = ConstantIC variable = T @@ -218,7 +228,7 @@ P_out = 2.0e5 # Pa [Total_power] type = ElementIntegralVariablePostprocessor variable = q_prime - block = subchannel + block = fuel_pins [] [mdot-8] type = SubChannelPointValue diff --git a/modules/subchannel/test/tests/problems/SFR/sodium-19pin/test19_implicit.i b/modules/subchannel/test/tests/problems/SFR/sodium-19pin/test19_implicit.i index a72c973a6c36..9c3ab9c9688c 100644 --- a/modules/subchannel/test/tests/problems/SFR/sodium-19pin/test19_implicit.i +++ b/modules/subchannel/test/tests/problems/SFR/sodium-19pin/test19_implicit.i @@ -12,7 +12,7 @@ P_out = 2.0e5 # Pa [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator pin_diameter = 0.01 dwire = 0.002 hwire = 0.0833 @@ -44,6 +44,7 @@ P_out = 2.0e5 # Pa segregated = true verbose_subchannel = true duct_HTC_closure = 'gnielinski' + pin_HTC_closure = 'Dittus-Boelter' friction_closure = 'cheng' [] @@ -54,6 +55,9 @@ P_out = 2.0e5 # Pa [gnielinski] type = SCMHTCGnielinski [] + [Dittus-Boelter] + type = SCMHTCDittusBoelter + [] [] [ICs] @@ -74,6 +78,12 @@ P_out = 2.0e5 # Pa filename = "pin_power_profile19.txt" [] + [Dpin_ic] + type = ConstantIC + variable = Dpin + value = 0.01 + [] + [T_ic] type = ConstantIC variable = T @@ -231,7 +241,7 @@ P_out = 2.0e5 # Pa [Total_power] type = ElementIntegralVariablePostprocessor variable = q_prime - block = subchannel + block = fuel_pins [] [Total_power_SCMDuctPowerPostprocessor] type = SCMDuctHeatRatePostprocessor diff --git a/modules/subchannel/test/tests/problems/SFR/sodium-19pin/test19_monolithic.i b/modules/subchannel/test/tests/problems/SFR/sodium-19pin/test19_monolithic.i index 0c95198d0902..3c9cf456267b 100644 --- a/modules/subchannel/test/tests/problems/SFR/sodium-19pin/test19_monolithic.i +++ b/modules/subchannel/test/tests/problems/SFR/sodium-19pin/test19_monolithic.i @@ -12,7 +12,7 @@ P_out = 2.0e5 # Pa [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator pin_diameter = 0.01 dwire = 0.002 hwire = 0.0833 @@ -45,6 +45,7 @@ P_out = 2.0e5 # Pa implicit = true segregated = false duct_HTC_closure = 'gnielinski' + pin_HTC_closure = 'Dittus-Boelter' friction_closure = 'cheng' [] @@ -55,6 +56,9 @@ P_out = 2.0e5 # Pa [gnielinski] type = SCMHTCGnielinski [] + [Dittus-Boelter] + type = SCMHTCDittusBoelter + [] [] [ICs] @@ -75,6 +79,12 @@ P_out = 2.0e5 # Pa filename = "pin_power_profile19.txt" [] + [Dpin_ic] + type = ConstantIC + variable = Dpin + value = 0.01 + [] + [T_ic] type = ConstantIC variable = T @@ -219,7 +229,7 @@ P_out = 2.0e5 # Pa [Total_power] type = ElementIntegralVariablePostprocessor variable = q_prime - block = subchannel + block = fuel_pins [] [mdot-8] type = SubChannelPointValue diff --git a/modules/subchannel/test/tests/problems/coupling/3d.i b/modules/subchannel/test/tests/problems/coupling/3d.i index a64a92cb5180..9bc3455c5b16 100644 --- a/modules/subchannel/test/tests/problems/coupling/3d.i +++ b/modules/subchannel/test/tests/problems/coupling/3d.i @@ -9,12 +9,8 @@ [] [Mesh] - [subchannel] - type = SCMDetailedQuadSubChannelMeshGenerator - [] - [fuel_pins] - type = SCMDetailedQuadPinMeshGenerator - input = subchannel + [assembly] + type = SCMDetailedQuadAssemblyMeshGenerator [] [] diff --git a/modules/subchannel/test/tests/problems/coupling/main.i b/modules/subchannel/test/tests/problems/coupling/main.i index 788d62b2b01c..648e02dfc3a5 100644 --- a/modules/subchannel/test/tests/problems/coupling/main.i +++ b/modules/subchannel/test/tests/problems/coupling/main.i @@ -4,7 +4,7 @@ heated_length = 1.0 [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 2 ny = 2 n_cells = 10 @@ -15,16 +15,6 @@ heated_length = 1.0 spacer_z = '0.0' spacer_k = '0.0' [] - - [fuel_pins] - type = SCMQuadPinMeshGenerator - input = sub_channel - nx = 2 - ny = 2 - n_cells = 10 - pitch = 0.014605 - heated_length = ${heated_length} - [] [] [FluidProperties] @@ -220,7 +210,8 @@ heated_length = 1.0 [] [pin_transfer] - type = SCMPinSolutionTransfer + type = SCMSolutionTransfer + transfer_type = pin to_multi_app = viz variable = 'Tpin q_prime Dpin' execute_on = 'timestep_end' diff --git a/modules/subchannel/test/tests/problems/heat_transfer_correlations/XX09_SCM_SS17.i b/modules/subchannel/test/tests/problems/heat_transfer_correlations/XX09_SCM_SS17.i index 8316c559494b..f7559d0a777e 100644 --- a/modules/subchannel/test/tests/problems/heat_transfer_correlations/XX09_SCM_SS17.i +++ b/modules/subchannel/test/tests/problems/heat_transfer_correlations/XX09_SCM_SS17.i @@ -26,7 +26,7 @@ unheated_length_exit = '${fparse 26.9*scale_factor}' [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = ${n_rings} n_cells = 20 flat_to_flat = ${inner_duct_in} @@ -38,19 +38,9 @@ unheated_length_exit = '${fparse 26.9*scale_factor}' hwire = ${wire_z_spacing} [] - [fuel_pins] - type = SCMTriPinMeshGenerator - input = subchannel - nrings = ${n_rings} - n_cells = 20 - unheated_length_exit = ${unheated_length_exit} - heated_length = ${heated_length} - pitch = ${fuel_pin_pitch} - [] - [duct] type = SCMTriDuctMeshGenerator - input = fuel_pins + input = subchannel nrings = ${n_rings} n_cells = 20 flat_to_flat = ${inner_duct_in} diff --git a/modules/subchannel/test/tests/problems/psbt/psbt_explicit.i b/modules/subchannel/test/tests/problems/psbt/psbt_explicit.i index 0284cce1917c..0063d57822cc 100644 --- a/modules/subchannel/test/tests/problems/psbt/psbt_explicit.i +++ b/modules/subchannel/test/tests/problems/psbt/psbt_explicit.i @@ -6,7 +6,7 @@ pin_diameter = 0.00950 [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 6 ny = 6 n_cells = 10 @@ -17,16 +17,6 @@ pin_diameter = 0.00950 spacer_z = '0.0' spacer_k = '0.0' [] - - [fuel_pins] - type = SCMQuadPinMeshGenerator - input = sub_channel - nx = 6 - ny = 6 - n_cells = 10 - pitch = 0.0126 - heated_length = 1.0 - [] [] [FluidProperties] @@ -140,7 +130,7 @@ pin_diameter = 0.00950 boundary = inlet value = ${T_in} execute_on = 'timestep_begin' - block = sub_channel + block = subchannel [] [mdot_in_bc] type = SCMMassFlowRateAux @@ -149,7 +139,7 @@ pin_diameter = 0.00950 area = S mass_flux = report_mass_flux_inlet execute_on = 'timestep_begin' - block = sub_channel + block = subchannel [] [] diff --git a/modules/subchannel/test/tests/problems/psbt/psbt_explicit_staggered.i b/modules/subchannel/test/tests/problems/psbt/psbt_explicit_staggered.i index b3e93785e619..639e50b5f59b 100644 --- a/modules/subchannel/test/tests/problems/psbt/psbt_explicit_staggered.i +++ b/modules/subchannel/test/tests/problems/psbt/psbt_explicit_staggered.i @@ -6,7 +6,7 @@ pin_diameter = 0.00950 [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 6 ny = 6 n_cells = 10 @@ -17,16 +17,6 @@ pin_diameter = 0.00950 spacer_z = '0.0' spacer_k = '0.0' [] - - [fuel_pins] - type = SCMQuadPinMeshGenerator - input = sub_channel - nx = 6 - ny = 6 - n_cells = 10 - pitch = 0.0126 - heated_length = 1.0 - [] [] [FluidProperties] @@ -141,7 +131,7 @@ pin_diameter = 0.00950 boundary = inlet value = ${T_in} execute_on = 'timestep_begin' - block = sub_channel + block = subchannel [] [mdot_in_bc] type = SCMMassFlowRateAux @@ -150,7 +140,7 @@ pin_diameter = 0.00950 area = S mass_flux = report_mass_flux_inlet execute_on = 'timestep_begin' - block = sub_channel + block = subchannel [] [] diff --git a/modules/subchannel/test/tests/problems/psbt/psbt_explicit_v2.i b/modules/subchannel/test/tests/problems/psbt/psbt_explicit_v2.i index b7be6604ecde..62f3d9ac22ff 100644 --- a/modules/subchannel/test/tests/problems/psbt/psbt_explicit_v2.i +++ b/modules/subchannel/test/tests/problems/psbt/psbt_explicit_v2.i @@ -6,7 +6,7 @@ pin_diameter = 0.00950 [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 6 ny = 6 n_cells = 10 @@ -17,16 +17,6 @@ pin_diameter = 0.00950 spacer_z = '0.0' spacer_k = '0.0' [] - - [fuel_pins] - type = SCMQuadPinMeshGenerator - input = sub_channel - nx = 6 - ny = 6 - n_cells = 10 - pitch = 0.0126 - heated_length = 1.0 - [] [] [FluidProperties] @@ -133,7 +123,7 @@ pin_diameter = 0.00950 boundary = inlet value = ${T_in} execute_on = 'timestep_begin' - block = sub_channel + block = subchannel [] [mdot_in_bc] type = SCMMassFlowRateAux @@ -142,7 +132,7 @@ pin_diameter = 0.00950 area = S mass_flux = report_mass_flux_inlet execute_on = 'timestep_begin' - block = sub_channel + block = subchannel [] [q_prime_IC] type = SCMQuadPowerAux diff --git a/modules/subchannel/test/tests/problems/psbt/psbt_implicit.i b/modules/subchannel/test/tests/problems/psbt/psbt_implicit.i index 1b5c730cabfd..778ac26c8fc6 100644 --- a/modules/subchannel/test/tests/problems/psbt/psbt_implicit.i +++ b/modules/subchannel/test/tests/problems/psbt/psbt_implicit.i @@ -6,7 +6,7 @@ pin_diameter = 0.00950 [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 6 ny = 6 n_cells = 10 @@ -17,16 +17,6 @@ pin_diameter = 0.00950 spacer_z = '0.0' spacer_k = '0.0' [] - - [fuel_pins] - type = SCMQuadPinMeshGenerator - input = sub_channel - nx = 6 - ny = 6 - n_cells = 10 - pitch = 0.0126 - heated_length = 1.0 - [] [] [FluidProperties] @@ -142,7 +132,7 @@ pin_diameter = 0.00950 boundary = inlet value = ${T_in} execute_on = 'timestep_begin' - block = sub_channel + block = subchannel [] [mdot_in_bc] type = SCMMassFlowRateAux @@ -151,7 +141,7 @@ pin_diameter = 0.00950 area = S mass_flux = report_mass_flux_inlet execute_on = 'timestep_begin' - block = sub_channel + block = subchannel [] [] diff --git a/modules/subchannel/test/tests/problems/psbt/psbt_monolithic.i b/modules/subchannel/test/tests/problems/psbt/psbt_monolithic.i index 7c549ab5e54e..8523f21801f2 100644 --- a/modules/subchannel/test/tests/problems/psbt/psbt_monolithic.i +++ b/modules/subchannel/test/tests/problems/psbt/psbt_monolithic.i @@ -5,8 +5,8 @@ P_out = 4.923e6 # Pa pin_diameter = 0.00950 [QuadSubChannelMesh] - [sub_channel] - type = SCMQuadSubChannelMeshGenerator + [assembly] + type = SCMQuadAssemblyMeshGenerator nx = 6 ny = 6 n_cells = 10 @@ -16,16 +16,8 @@ pin_diameter = 0.00950 heated_length = 1.0 spacer_z = '0.0' spacer_k = '0.0' - [] - - [fuel_pins] - type = SCMQuadPinMeshGenerator - input = sub_channel - nx = 6 - ny = 6 - n_cells = 10 - pitch = 0.0126 - heated_length = 1.0 + subchannel_block_id = 0 + pin_block_id = 1 [] [] @@ -142,7 +134,7 @@ pin_diameter = 0.00950 boundary = inlet value = ${T_in} execute_on = 'timestep_begin' - block = sub_channel + block = subchannel [] [mdot_in_bc] type = SCMMassFlowRateAux @@ -151,7 +143,7 @@ pin_diameter = 0.00950 area = S mass_flux = report_mass_flux_inlet execute_on = 'timestep_begin' - block = sub_channel + block = subchannel [] [] @@ -210,6 +202,7 @@ pin_diameter = 0.00950 [] [Outputs] + exodus = true csv = true [] diff --git a/modules/subchannel/test/tests/restart/gold/steady_out.e b/modules/subchannel/test/tests/restart/gold/steady_out.e index 027186cf857c..25341525be52 100644 Binary files a/modules/subchannel/test/tests/restart/gold/steady_out.e and b/modules/subchannel/test/tests/restart/gold/steady_out.e differ diff --git a/modules/subchannel/test/tests/restart/gold/transient_out.e b/modules/subchannel/test/tests/restart/gold/transient_out.e index cc43a06cc291..2e77fb9340fd 100644 Binary files a/modules/subchannel/test/tests/restart/gold/transient_out.e and b/modules/subchannel/test/tests/restart/gold/transient_out.e differ diff --git a/modules/subchannel/test/tests/restart/steady.i b/modules/subchannel/test/tests/restart/steady.i index 297a8e5f3377..13a5bb1fcf01 100644 --- a/modules/subchannel/test/tests/restart/steady.i +++ b/modules/subchannel/test/tests/restart/steady.i @@ -5,7 +5,7 @@ P_out = 4.923e6 # Pa [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 3 ny = 3 n_cells = 10 @@ -35,12 +35,16 @@ P_out = 4.923e6 # Pa compute_power = true P_out = ${P_out} friction_closure = 'MATRA' + pin_HTC_closure = 'Dittus-Boelter' [] [SCMClosures] [MATRA] type = SCMFrictionMATRA [] + [Dittus-Boelter] + type = SCMHTCDittusBoelter + [] [] [ICs] @@ -79,6 +83,12 @@ P_out = 4.923e6 # Pa value = 0.0 [] + [Dpin_ic] + type = ConstantIC + variable = Dpin + value = 0.00950 + [] + [rho_ic] type = RhoFromPressureTemperatureIC variable = rho diff --git a/modules/subchannel/test/tests/restart/transient.i b/modules/subchannel/test/tests/restart/transient.i index ecc57ebec03e..58d11296213a 100644 --- a/modules/subchannel/test/tests/restart/transient.i +++ b/modules/subchannel/test/tests/restart/transient.i @@ -5,7 +5,7 @@ P_out = 4.923e6 # Pa [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 3 ny = 3 n_cells = 10 @@ -47,12 +47,16 @@ P_out = 4.923e6 # Pa skip_additional_restart_data = true allow_initial_conditions_with_restart = true friction_closure = 'MATRA' + pin_HTC_closure = 'Dittus-Boelter' [] [SCMClosures] [MATRA] type = SCMFrictionMATRA [] + [Dittus-Boelter] + type = SCMHTCDittusBoelter + [] [] [Functions] diff --git a/modules/subchannel/test/tests/transfers/multiapp_detailed_solution_transfer/quad.i b/modules/subchannel/test/tests/transfers/multiapp_detailed_solution_transfer/quad.i index 4be29161421b..17bfcc922316 100644 --- a/modules/subchannel/test/tests/transfers/multiapp_detailed_solution_transfer/quad.i +++ b/modules/subchannel/test/tests/transfers/multiapp_detailed_solution_transfer/quad.i @@ -8,17 +8,12 @@ [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator pin_diameter = 0.5 side_gap = 0.1 spacer_z = '0' spacer_k = '0' [] - - [fuel_pins] - type = SCMQuadPinMeshGenerator - input = sub_channel - [] [] [FluidProperties] @@ -29,7 +24,7 @@ [AuxVariables] [P] - block = sub_channel + block = subchannel [] [T] block = fuel_pins @@ -81,7 +76,8 @@ variable = 'P' [] [T_transfer] - type = SCMPinSolutionTransfer + type = SCMSolutionTransfer + transfer_type = pin to_multi_app = viz variable = 'T' [] diff --git a/modules/subchannel/test/tests/transfers/multiapp_detailed_solution_transfer/quad_viz.i b/modules/subchannel/test/tests/transfers/multiapp_detailed_solution_transfer/quad_viz.i index fb225feac2d7..88f4e3146c74 100644 --- a/modules/subchannel/test/tests/transfers/multiapp_detailed_solution_transfer/quad_viz.i +++ b/modules/subchannel/test/tests/transfers/multiapp_detailed_solution_transfer/quad_viz.i @@ -8,20 +8,15 @@ [] [Mesh] - [sub_channel] - type = SCMDetailedQuadSubChannelMeshGenerator + [assembly] + type = SCMDetailedQuadAssemblyMeshGenerator side_gap = 0.1 [] - - [fuel_pins] - type = SCMDetailedQuadPinMeshGenerator - input = sub_channel - [] [] [AuxVariables] [P] - block = sub_channel + block = subchannel [] [T] block = fuel_pins diff --git a/modules/subchannel/test/tests/transfers/multiapp_detailed_solution_transfer/tests b/modules/subchannel/test/tests/transfers/multiapp_detailed_solution_transfer/tests index d2b66c0cfeac..75b84fe9d01f 100644 --- a/modules/subchannel/test/tests/transfers/multiapp_detailed_solution_transfer/tests +++ b/modules/subchannel/test/tests/transfers/multiapp_detailed_solution_transfer/tests @@ -6,6 +6,6 @@ input = 'quad.i' exodiff = 'quad_out.e quad_out_viz0.e' recover = false - requirement = 'The system shall be able to transger the subchannel/pin solution onto a detailed mesh' + requirement = 'The system shall be able to transfer the subchannel or pin solution onto a detailed mesh' [] [] diff --git a/modules/subchannel/validation/Blockage/PNNL_7x7/7X7blockage70.i b/modules/subchannel/validation/Blockage/PNNL_7x7/7X7blockage70.i index e35728825b62..0f713ed1059a 100644 --- a/modules/subchannel/validation/Blockage/PNNL_7x7/7X7blockage70.i +++ b/modules/subchannel/validation/Blockage/PNNL_7x7/7X7blockage70.i @@ -7,7 +7,7 @@ P_out = 101325 # Pa [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 8 ny = 8 n_cells = 36 @@ -27,34 +27,34 @@ P_out = 101325 # Pa [AuxVariables] [mdot] - block = sub_channel + block = subchannel [] [SumWij] - block = sub_channel + block = subchannel [] [P] - block = sub_channel + block = subchannel [] [DP] - block = sub_channel + block = subchannel [] [h] - block = sub_channel + block = subchannel [] [T] - block = sub_channel + block = subchannel [] [rho] - block = sub_channel + block = subchannel [] [mu] - block = sub_channel + block = subchannel [] [S] - block = sub_channel + block = subchannel [] [w_perim] - block = sub_channel + block = subchannel [] [] @@ -78,6 +78,13 @@ P_out = 101325 # Pa segregated = false staggered_pressure = false interpolation_scheme = 'upwind' + pin_HTC_closure = 'Dittus-Boelter' +[] + +[SCMClosures] + [Dittus-Boelter] + type = SCMHTCDittusBoelter + [] [] [ICs] diff --git a/modules/subchannel/validation/Blockage/PNNL_7x7/7X7blockage90.i b/modules/subchannel/validation/Blockage/PNNL_7x7/7X7blockage90.i index 33a1addc1570..d714e0c5569a 100644 --- a/modules/subchannel/validation/Blockage/PNNL_7x7/7X7blockage90.i +++ b/modules/subchannel/validation/Blockage/PNNL_7x7/7X7blockage90.i @@ -7,7 +7,7 @@ P_out = 101325 # Pa [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 8 ny = 8 n_cells = 84 @@ -27,34 +27,34 @@ P_out = 101325 # Pa [AuxVariables] [mdot] - block = sub_channel + block = subchannel [] [SumWij] - block = sub_channel + block = subchannel [] [P] - block = sub_channel + block = subchannel [] [DP] - block = sub_channel + block = subchannel [] [h] - block = sub_channel + block = subchannel [] [T] - block = sub_channel + block = subchannel [] [rho] - block = sub_channel + block = subchannel [] [mu] - block = sub_channel + block = subchannel [] [S] - block = sub_channel + block = subchannel [] [w_perim] - block = sub_channel + block = subchannel [] [] @@ -78,6 +78,13 @@ P_out = 101325 # Pa segregated = false staggered_pressure = false interpolation_scheme = central_difference + pin_HTC_closure = 'Dittus-Boelter' +[] + +[SCMClosures] + [Dittus-Boelter] + type = SCMHTCDittusBoelter + [] [] [ICs] diff --git a/modules/subchannel/validation/Blockage/PNNL_7x7/detailedMesh.i b/modules/subchannel/validation/Blockage/PNNL_7x7/detailedMesh.i index 0defb710d399..1870c5a2e2e7 100644 --- a/modules/subchannel/validation/Blockage/PNNL_7x7/detailedMesh.i +++ b/modules/subchannel/validation/Blockage/PNNL_7x7/detailedMesh.i @@ -9,8 +9,8 @@ [] [Mesh] - [subchannel] - type = SCMDetailedQuadSubChannelMeshGenerator + [assembly] + type = SCMDetailedQuadAssemblyMeshGenerator [] [] @@ -54,4 +54,3 @@ [Executioner] type = Steady [] - diff --git a/modules/subchannel/validation/Blockage/THORS/FFM-3A.i b/modules/subchannel/validation/Blockage/THORS/FFM-3A.i index 27ee0ac7c87c..4a7df77a7826 100644 --- a/modules/subchannel/validation/Blockage/THORS/FFM-3A.i +++ b/modules/subchannel/validation/Blockage/THORS/FFM-3A.i @@ -19,7 +19,7 @@ mass_flux_in = '${fparse rho * vol_flow / Flow_area}' P_out = 2.0e5 # Pa [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = 3 n_cells = 36 flat_to_flat = 0.0338514 @@ -60,6 +60,7 @@ P_out = 2.0e5 # Pa segregated = false verbose_subchannel = true interpolation_scheme = exponential + pin_HTC_closure = 'Dittus-Boelter' # friction model friction_closure = 'cheng' [] @@ -68,6 +69,9 @@ P_out = 2.0e5 # Pa [cheng] type = SCMFrictionUpdatedChengTodreas [] + [Dittus-Boelter] + type = SCMHTCDittusBoelter + [] [] [ICs] @@ -88,6 +92,12 @@ P_out = 2.0e5 # Pa filename = "pin_power_profile_19.txt" [] + [Dpin_ic] + type = ConstantIC + variable = Dpin + value = 0.005842 + [] + [T_ic] type = ConstantIC variable = T diff --git a/modules/subchannel/validation/Blockage/THORS/FFM-3A_viz.i b/modules/subchannel/validation/Blockage/THORS/FFM-3A_viz.i index 75c3aba50eac..34698066580d 100644 --- a/modules/subchannel/validation/Blockage/THORS/FFM-3A_viz.i +++ b/modules/subchannel/validation/Blockage/THORS/FFM-3A_viz.i @@ -10,7 +10,7 @@ [Mesh] [subchannel] - type = SCMDetailedTriSubChannelMeshGenerator + type = SCMDetailedTriAssemblyMeshGenerator nrings = 3 n_cells = 36 flat_to_flat = 3.41e-2 @@ -44,6 +44,7 @@ [w_perim] [] [q_prime] + block = fuel_pins [] [] diff --git a/modules/subchannel/validation/Blockage/THORS/FFM-3Adetailed.i b/modules/subchannel/validation/Blockage/THORS/FFM-3Adetailed.i index bb313920834a..c85aa52e4297 100644 --- a/modules/subchannel/validation/Blockage/THORS/FFM-3Adetailed.i +++ b/modules/subchannel/validation/Blockage/THORS/FFM-3Adetailed.i @@ -1,6 +1,6 @@ [Mesh] [subchannel] - type = SCMDetailedTriSubChannelMeshGenerator + type = SCMDetailedTriAssemblyMeshGenerator nrings = 3 n_cells = 36 flat_to_flat = 3.41e-2 @@ -34,6 +34,7 @@ [w_perim] [] [q_prime] + block = fuel_pins [] [] diff --git a/modules/subchannel/validation/Blockage/THORS/FFM-5B_high.i b/modules/subchannel/validation/Blockage/THORS/FFM-5B_high.i index fb3bc78dcdcc..f1026575ef1b 100644 --- a/modules/subchannel/validation/Blockage/THORS/FFM-5B_high.i +++ b/modules/subchannel/validation/Blockage/THORS/FFM-5B_high.i @@ -19,7 +19,7 @@ mass_flux_in = '${fparse rho * inlet_vel}' P_out = 2.0e5 # Pa [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = 3 n_cells = 50 flat_to_flat = 0.0324290 @@ -58,6 +58,7 @@ P_out = 2.0e5 # Pa segregated = false verbose_subchannel = true interpolation_scheme = exponential + pin_HTC_closure = 'Dittus-Boelter' # friction model friction_closure = 'cheng' [] @@ -66,6 +67,9 @@ P_out = 2.0e5 # Pa [cheng] type = SCMFrictionUpdatedChengTodreas [] + [Dittus-Boelter] + type = SCMHTCDittusBoelter + [] [] [ICs] @@ -86,6 +90,12 @@ P_out = 2.0e5 # Pa filename = "pin_power_profile_19.txt" [] + [Dpin_ic] + type = ConstantIC + variable = Dpin + value = 0.005842 + [] + [T_ic] type = ConstantIC variable = T @@ -234,9 +244,16 @@ P_out = 2.0e5 # Pa [] [Transfers] - [xfer] + [xfer_subchannel] type = SCMSolutionTransfer to_multi_app = viz - variable = 'mdot SumWij P DP h T rho mu q_prime S displacement w_perim' + transfer_type = subchannel + variable = 'mdot SumWij P DP h T rho mu S displacement w_perim' + [] + [xfer_q_prime] + type = SCMSolutionTransfer + to_multi_app = viz + transfer_type = pin + variable = q_prime [] [] diff --git a/modules/subchannel/validation/Blockage/THORS/FFM-5B_low.i b/modules/subchannel/validation/Blockage/THORS/FFM-5B_low.i index bda76634a8ab..872a270a4909 100644 --- a/modules/subchannel/validation/Blockage/THORS/FFM-5B_low.i +++ b/modules/subchannel/validation/Blockage/THORS/FFM-5B_low.i @@ -19,7 +19,7 @@ mass_flux_in = '${fparse rho * inlet_vel}' P_out = 2.0e5 # Pa [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = 3 n_cells = 50 flat_to_flat = 0.0324290 @@ -58,6 +58,7 @@ P_out = 2.0e5 # Pa segregated = false verbose_subchannel = true interpolation_scheme = exponential + pin_HTC_closure = 'Dittus-Boelter' # friction model friction_closure = 'cheng' [] @@ -66,6 +67,9 @@ P_out = 2.0e5 # Pa [cheng] type = SCMFrictionUpdatedChengTodreas [] + [Dittus-Boelter] + type = SCMHTCDittusBoelter + [] [] [ICs] @@ -97,6 +101,12 @@ P_out = 2.0e5 # Pa value = 0.0 [] + [Dpin_ic] + type = ConstantIC + variable = Dpin + value = 0.005842 + [] + [Viscosity_ic] type = ViscosityIC variable = mu @@ -234,9 +244,16 @@ P_out = 2.0e5 # Pa [] [Transfers] - [xfer] + [xfer_subchannel] type = SCMSolutionTransfer to_multi_app = viz - variable = 'mdot SumWij P DP h T rho mu q_prime S displacement w_perim' + transfer_type = subchannel + variable = 'mdot SumWij P DP h T rho mu S displacement w_perim' + [] + [xfer_q_prime] + type = SCMSolutionTransfer + to_multi_app = viz + transfer_type = pin + variable = q_prime [] [] diff --git a/modules/subchannel/validation/Blockage/THORS/FFM-5B_viz.i b/modules/subchannel/validation/Blockage/THORS/FFM-5B_viz.i index ffc19c1ab6d8..98a2ec447fc3 100644 --- a/modules/subchannel/validation/Blockage/THORS/FFM-5B_viz.i +++ b/modules/subchannel/validation/Blockage/THORS/FFM-5B_viz.i @@ -10,7 +10,7 @@ [Mesh] [subchannel] - type = SCMDetailedTriSubChannelMeshGenerator + type = SCMDetailedTriAssemblyMeshGenerator nrings = 3 n_cells = 50 flat_to_flat = 3.41e-2 @@ -54,7 +54,7 @@ block = subchannel [] [q_prime] - block = subchannel + block = fuel_pins [] [displacement] block = subchannel diff --git a/modules/subchannel/validation/Blockage/THORS/FFM-5Bdetailed.i b/modules/subchannel/validation/Blockage/THORS/FFM-5Bdetailed.i index 01dfd57b9459..8806db437b1f 100644 --- a/modules/subchannel/validation/Blockage/THORS/FFM-5Bdetailed.i +++ b/modules/subchannel/validation/Blockage/THORS/FFM-5Bdetailed.i @@ -1,6 +1,6 @@ [Mesh] [subchannel] - type = SCMDetailedTriSubChannelMeshGenerator + type = SCMDetailedTriAssemblyMeshGenerator nrings = 3 n_cells = 50 flat_to_flat = 3.41e-2 @@ -34,6 +34,7 @@ [w_perim] [] [q_prime] + block = fuel_pins [] [] diff --git a/modules/subchannel/validation/EBR-II/3d_SCM_SS.i b/modules/subchannel/validation/EBR-II/3d_SCM_SS.i index 8d13af30b6b0..da1def48a6f3 100644 --- a/modules/subchannel/validation/EBR-II/3d_SCM_SS.i +++ b/modules/subchannel/validation/EBR-II/3d_SCM_SS.i @@ -15,7 +15,7 @@ unheated_length_exit = '${fparse 26.9*scale_factor}' [TriSubChannelMesh] [subchannel] - type = SCMDetailedTriSubChannelMeshGenerator + type = SCMDetailedTriAssemblyMeshGenerator nrings = '${n_rings}' n_cells = 50 flat_to_flat = '${inner_duct_in}' @@ -25,16 +25,6 @@ unheated_length_exit = '${fparse 26.9*scale_factor}' pitch = '${fuel_pin_pitch}' [] - [fuel_pins] - type = SCMDetailedTriPinMeshGenerator - input = subchannel - nrings = '${n_rings}' - n_cells = 50 - unheated_length_exit = '${unheated_length_exit}' - heated_length = '${heated_length}' - pin_diameter = '${fuel_pin_diameter}' - pitch = '${fuel_pin_pitch}' - [] [] [AuxVariables] diff --git a/modules/subchannel/validation/EBR-II/3d_SCM_TR.i b/modules/subchannel/validation/EBR-II/3d_SCM_TR.i index 23e2fdbccbd8..953144c287ae 100644 --- a/modules/subchannel/validation/EBR-II/3d_SCM_TR.i +++ b/modules/subchannel/validation/EBR-II/3d_SCM_TR.i @@ -16,7 +16,7 @@ unheated_length_exit = '${fparse 26.9*scale_factor}' [TriSubChannelMesh] [subchannel] - type = SCMDetailedTriSubChannelMeshGenerator + type = SCMDetailedTriAssemblyMeshGenerator nrings = '${n_rings}' n_cells = 50 flat_to_flat = '${inner_duct_in}' @@ -26,16 +26,6 @@ unheated_length_exit = '${fparse 26.9*scale_factor}' pitch = '${fuel_pin_pitch}' [] - [fuel_pins] - type = SCMDetailedTriPinMeshGenerator - input = subchannel - nrings = '${n_rings}' - n_cells = 50 - unheated_length_exit = '${unheated_length_exit}' - heated_length = '${heated_length}' - pin_diameter = '${fuel_pin_diameter}' - pitch = '${fuel_pin_pitch}' - [] [] [AuxVariables] diff --git a/modules/subchannel/validation/EBR-II/XX09_SCM_SS17.i b/modules/subchannel/validation/EBR-II/XX09_SCM_SS17.i index a34b880e0cf2..195159399149 100644 --- a/modules/subchannel/validation/EBR-II/XX09_SCM_SS17.i +++ b/modules/subchannel/validation/EBR-II/XX09_SCM_SS17.i @@ -26,7 +26,7 @@ unheated_length_exit = '${fparse 26.9*scale_factor}' [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = ${n_rings} n_cells = 50 flat_to_flat = ${inner_duct_in} @@ -38,19 +38,10 @@ unheated_length_exit = '${fparse 26.9*scale_factor}' hwire = ${wire_z_spacing} [] - [fuel_pins] - type = SCMTriPinMeshGenerator - input = subchannel - nrings = ${n_rings} - n_cells = 50 - unheated_length_exit = ${unheated_length_exit} - heated_length = ${heated_length} - pitch = ${fuel_pin_pitch} - [] [duct] type = SCMTriDuctMeshGenerator - input = fuel_pins + input = subchannel nrings = ${n_rings} n_cells = 50 flat_to_flat = ${inner_duct_in} @@ -408,7 +399,8 @@ unheated_length_exit = '${fparse 26.9*scale_factor}' variable = 'mdot SumWij P DP h T rho mu S' [] [pin_transfer] - type = SCMPinSolutionTransfer + type = SCMSolutionTransfer + transfer_type = pin to_multi_app = viz variable = 'Tpin q_prime' [] diff --git a/modules/subchannel/validation/EBR-II/XX09_SCM_SS17_corrected.i b/modules/subchannel/validation/EBR-II/XX09_SCM_SS17_corrected.i index 295ec94c4c9c..ed8c27e697ac 100644 --- a/modules/subchannel/validation/EBR-II/XX09_SCM_SS17_corrected.i +++ b/modules/subchannel/validation/EBR-II/XX09_SCM_SS17_corrected.i @@ -26,7 +26,7 @@ unheated_length_exit = '${fparse 26.9*scale_factor}' [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = ${n_rings} n_cells = 50 flat_to_flat = ${inner_duct_in} @@ -38,19 +38,10 @@ unheated_length_exit = '${fparse 26.9*scale_factor}' hwire = ${wire_z_spacing} [] - [fuel_pins] - type = SCMTriPinMeshGenerator - input = subchannel - nrings = ${n_rings} - n_cells = 50 - unheated_length_exit = ${unheated_length_exit} - heated_length = ${heated_length} - pitch = ${fuel_pin_pitch} - [] [duct] type = SCMTriDuctMeshGenerator - input = fuel_pins + input = subchannel nrings = ${n_rings} n_cells = 50 flat_to_flat = ${inner_duct_in} @@ -408,7 +399,8 @@ unheated_length_exit = '${fparse 26.9*scale_factor}' variable = 'mdot SumWij P DP h T rho mu S' [] [pin_transfer] - type = SCMPinSolutionTransfer + type = SCMSolutionTransfer + transfer_type = pin to_multi_app = viz variable = 'Tpin q_prime' [] diff --git a/modules/subchannel/validation/EBR-II/XX09_SCM_SS45R.i b/modules/subchannel/validation/EBR-II/XX09_SCM_SS45R.i index f8f5d7fc90fc..502d57096326 100644 --- a/modules/subchannel/validation/EBR-II/XX09_SCM_SS45R.i +++ b/modules/subchannel/validation/EBR-II/XX09_SCM_SS45R.i @@ -26,7 +26,7 @@ unheated_length_exit = '${fparse 26.9*scale_factor}' [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = ${n_rings} n_cells = 50 flat_to_flat = ${inner_duct_in} @@ -38,19 +38,10 @@ unheated_length_exit = '${fparse 26.9*scale_factor}' hwire = ${wire_z_spacing} [] - [fuel_pins] - type = SCMTriPinMeshGenerator - input = subchannel - nrings = ${n_rings} - n_cells = 50 - unheated_length_exit = ${unheated_length_exit} - heated_length = ${heated_length} - pitch = ${fuel_pin_pitch} - [] [duct] type = SCMTriDuctMeshGenerator - input = fuel_pins + input = subchannel nrings = ${n_rings} n_cells = 50 flat_to_flat = ${inner_duct_in} @@ -408,7 +399,8 @@ unheated_length_exit = '${fparse 26.9*scale_factor}' variable = 'mdot SumWij P DP h T rho mu S' [] [pin_transfer] - type = SCMPinSolutionTransfer + type = SCMSolutionTransfer + transfer_type = pin to_multi_app = viz variable = 'Tpin q_prime' [] diff --git a/modules/subchannel/validation/EBR-II/XX09_SCM_SS45R_corrected.i b/modules/subchannel/validation/EBR-II/XX09_SCM_SS45R_corrected.i index 3a8b1bf62551..bc439e15dada 100644 --- a/modules/subchannel/validation/EBR-II/XX09_SCM_SS45R_corrected.i +++ b/modules/subchannel/validation/EBR-II/XX09_SCM_SS45R_corrected.i @@ -26,7 +26,7 @@ unheated_length_exit = '${fparse 26.9*scale_factor}' [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = ${n_rings} n_cells = 50 flat_to_flat = ${inner_duct_in} @@ -38,19 +38,10 @@ unheated_length_exit = '${fparse 26.9*scale_factor}' hwire = ${wire_z_spacing} [] - [fuel_pins] - type = SCMTriPinMeshGenerator - input = subchannel - nrings = ${n_rings} - n_cells = 50 - unheated_length_exit = ${unheated_length_exit} - heated_length = ${heated_length} - pitch = ${fuel_pin_pitch} - [] [duct] type = SCMTriDuctMeshGenerator - input = fuel_pins + input = subchannel nrings = ${n_rings} n_cells = 50 flat_to_flat = ${inner_duct_in} @@ -408,7 +399,8 @@ unheated_length_exit = '${fparse 26.9*scale_factor}' variable = 'mdot SumWij P DP h T rho mu S' [] [pin_transfer] - type = SCMPinSolutionTransfer + type = SCMSolutionTransfer + transfer_type = pin to_multi_app = viz variable = 'Tpin q_prime' [] diff --git a/modules/subchannel/validation/EBR-II/XX09_SCM_TR17.i b/modules/subchannel/validation/EBR-II/XX09_SCM_TR17.i index ced63f644a78..48f46fae4e07 100644 --- a/modules/subchannel/validation/EBR-II/XX09_SCM_TR17.i +++ b/modules/subchannel/validation/EBR-II/XX09_SCM_TR17.i @@ -25,7 +25,7 @@ unheated_length_exit = '${fparse 26.9*scale_factor}' [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = ${n_rings} n_cells = 50 flat_to_flat = ${inner_duct_in} @@ -39,15 +39,6 @@ unheated_length_exit = '${fparse 26.9*scale_factor}' spacer_k = '0.0' [] - [fuel_pins] - type = SCMTriPinMeshGenerator - input = subchannel - nrings = ${n_rings} - n_cells = 50 - unheated_length_exit = ${unheated_length_exit} - heated_length = ${heated_length} - pitch = ${fuel_pin_pitch} - [] [] [AuxVariables] @@ -349,7 +340,8 @@ unheated_length_exit = '${fparse 26.9*scale_factor}' variable = 'mdot SumWij P DP h T rho mu S' [] [pin_transfer] - type = SCMPinSolutionTransfer + type = SCMSolutionTransfer + transfer_type = pin to_multi_app = viz variable = 'Tpin q_prime' [] diff --git a/modules/subchannel/validation/EBR-II/XX09_SCM_TR45R.i b/modules/subchannel/validation/EBR-II/XX09_SCM_TR45R.i index c6063f8e61e5..3bfe16608529 100644 --- a/modules/subchannel/validation/EBR-II/XX09_SCM_TR45R.i +++ b/modules/subchannel/validation/EBR-II/XX09_SCM_TR45R.i @@ -25,7 +25,7 @@ unheated_length_exit = '${fparse 26.9*scale_factor}' [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = ${n_rings} n_cells = 50 flat_to_flat = ${inner_duct_in} @@ -39,15 +39,6 @@ unheated_length_exit = '${fparse 26.9*scale_factor}' spacer_k = '0.0' [] - [fuel_pins] - type = SCMTriPinMeshGenerator - input = subchannel - nrings = ${n_rings} - n_cells = 50 - unheated_length_exit = ${unheated_length_exit} - heated_length = ${heated_length} - pitch = ${fuel_pin_pitch} - [] [] [AuxVariables] @@ -348,7 +339,8 @@ unheated_length_exit = '${fparse 26.9*scale_factor}' variable = 'mdot SumWij P DP h T rho mu S' [] [pin_transfer] - type = SCMPinSolutionTransfer + type = SCMSolutionTransfer + transfer_type = pin to_multi_app = viz variable = 'Tpin q_prime' [] diff --git a/modules/subchannel/validation/ORNL_19_pin/3d_ORNL_19.i b/modules/subchannel/validation/ORNL_19_pin/3d_ORNL_19.i index 4cc881991b69..52c379cf5395 100644 --- a/modules/subchannel/validation/ORNL_19_pin/3d_ORNL_19.i +++ b/modules/subchannel/validation/ORNL_19_pin/3d_ORNL_19.i @@ -1,6 +1,6 @@ [Mesh] [subchannel] - type = SCMDetailedTriSubChannelMeshGenerator + type = SCMDetailedTriAssemblyMeshGenerator nrings = 3 n_cells = 40 flat_to_flat = 3.41e-2 @@ -34,6 +34,7 @@ [w_perim] [] [q_prime] + block = fuel_pins [] [] diff --git a/modules/subchannel/validation/ORNL_19_pin/test_ORNL_19.i b/modules/subchannel/validation/ORNL_19_pin/test_ORNL_19.i index 5129c1dd87c1..8a6d3b118224 100644 --- a/modules/subchannel/validation/ORNL_19_pin/test_ORNL_19.i +++ b/modules/subchannel/validation/ORNL_19_pin/test_ORNL_19.i @@ -12,7 +12,7 @@ mass_flux_in = '${fparse rho * vol_flow / flow_area}' P_out = 2.0e5 # Pa [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = 3 n_cells = 40 flat_to_flat = 3.41e-2 @@ -52,6 +52,7 @@ P_out = 2.0e5 # Pa verbose_multiapps = true verbose_subchannel = true interpolation_scheme = upwind + pin_HTC_closure = 'Dittus-Boelter' # friction model friction_closure = 'cheng' [] @@ -60,6 +61,9 @@ P_out = 2.0e5 # Pa [cheng] type = SCMFrictionUpdatedChengTodreas [] + [Dittus-Boelter] + type = SCMHTCDittusBoelter + [] [] [ICs] @@ -80,6 +84,12 @@ P_out = 2.0e5 # Pa filename = "pin_power_profile19.txt" [] + [Dpin_ic] + type = ConstantIC + variable = Dpin + value = 5.84e-3 + [] + [T_ic] type = ConstantIC variable = T @@ -228,6 +238,7 @@ P_out = 2.0e5 # Pa [Total_power] type = ElementIntegralVariablePostprocessor variable = q_prime + block = fuel_pins [] [] @@ -244,9 +255,15 @@ P_out = 2.0e5 # Pa [] [Transfers] - [xfer] + [subchannel_transfer] type = SCMSolutionTransfer to_multi_app = viz - variable = 'mdot SumWij P DP h T rho mu q_prime S' + variable = 'mdot SumWij P DP h T rho mu S' + [] + [pin_transfer] + type = SCMSolutionTransfer + transfer_type = pin + to_multi_app = viz + variable = q_prime [] [] diff --git a/modules/subchannel/validation/PNNL_12_pin/steady_state/2X6_ss.i b/modules/subchannel/validation/PNNL_12_pin/steady_state/2X6_ss.i index 28e3e610fdee..573d77f033b9 100644 --- a/modules/subchannel/validation/PNNL_12_pin/steady_state/2X6_ss.i +++ b/modules/subchannel/validation/PNNL_12_pin/steady_state/2X6_ss.i @@ -17,34 +17,31 @@ T_in = 297.039 # K P_out = 101325 # Pa [QuadSubChannelMesh] - [sub_channel] - type = SCMQuadSubChannelMeshGenerator - [] - - [fuel_pins] - type = SCMQuadPinMeshGenerator - input = sub_channel + [assembly] + type = SCMQuadAssemblyMeshGenerator + subchannel_block_id = 0 + pin_block_id = 1 [] [] [AuxVariables] [mdot] - block = sub_channel + block = subchannel [] [SumWij] - block = sub_channel + block = subchannel [] [P] - block = sub_channel + block = subchannel [] [DP] - block = sub_channel + block = subchannel [] [h] - block = sub_channel + block = subchannel [] [T] - block = sub_channel + block = subchannel [] [Tpin] block = fuel_pins @@ -53,16 +50,16 @@ P_out = 101325 # Pa block = fuel_pins [] [rho] - block = sub_channel + block = subchannel [] [mu] - block = sub_channel + block = subchannel [] [S] - block = sub_channel + block = subchannel [] [w_perim] - block = sub_channel + block = subchannel [] [q_prime] block = fuel_pins @@ -117,6 +114,7 @@ P_out = 101325 # Pa variable = q_prime power = 5460 # W filename = "power_profile.txt" + block = fuel_pins [] [T_ic] @@ -320,16 +318,17 @@ P_out = 101325 # Pa [] [] -###### Transfers to the detailedMesh at the end of the coupled simulations -[Transfers] - [subchannel_transfer] - type = SCMSolutionTransfer - to_multi_app = viz - variable = 'mdot SumWij P DP h T rho mu S' - [] - [pin_transfer] - type = SCMPinSolutionTransfer - to_multi_app = viz - variable = 'Tpin q_prime' - [] -[] +# ###### Transfers to the detailedMesh at the end of the coupled simulations +# [Transfers] +# [subchannel_transfer] +# type = SCMSolutionTransfer +# to_multi_app = viz +# variable = 'mdot SumWij P DP h T rho mu S' +# [] +# [pin_transfer] +# type = SCMSolutionTransfer +# transfer_type = pin +# to_multi_app = viz +# variable = 'Tpin q_prime' +# [] +# [] diff --git a/modules/subchannel/validation/PNNL_12_pin/steady_state/3d.i b/modules/subchannel/validation/PNNL_12_pin/steady_state/3d.i index 96ca716b4323..2bd43f91a431 100644 --- a/modules/subchannel/validation/PNNL_12_pin/steady_state/3d.i +++ b/modules/subchannel/validation/PNNL_12_pin/steady_state/3d.i @@ -10,12 +10,8 @@ [] [Mesh] - [subchannel] - type = SCMDetailedQuadSubChannelMeshGenerator - [] - [pins] - type = SCMDetailedQuadPinMeshGenerator - input = subchannel + [assembly] + type = SCMDetailedQuadAssemblyMeshGenerator [] [] diff --git a/modules/subchannel/validation/PNNL_12_pin/transient/2X6_transient.i b/modules/subchannel/validation/PNNL_12_pin/transient/2X6_transient.i index 3c4c99f821f9..331231b6fab6 100644 --- a/modules/subchannel/validation/PNNL_12_pin/transient/2X6_transient.i +++ b/modules/subchannel/validation/PNNL_12_pin/transient/2X6_transient.i @@ -3,7 +3,7 @@ P_out = 101325 # Pa [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 7 ny = 3 n_cells = 60 @@ -36,12 +36,16 @@ P_out = 101325 # Pa compute_power = false P_out = ${P_out} friction_closure = 'MATRA' + pin_HTC_closure = 'Dittus-Boelter' [] [SCMClosures] [MATRA] type = SCMFrictionMATRA [] + [Dittus-Boelter] + type = SCMHTCDittusBoelter + [] [] [ICs] @@ -74,6 +78,12 @@ P_out = 101325 # Pa value = 0.0 [] + [Dpin_ic] + type = ConstantIC + variable = Dpin + value = 0.012065 + [] + [DP_ic] type = ConstantIC variable = DP diff --git a/modules/subchannel/validation/PNNL_12_pin/transient/3d.i b/modules/subchannel/validation/PNNL_12_pin/transient/3d.i index bea6df23f2f4..444e72860fdc 100644 --- a/modules/subchannel/validation/PNNL_12_pin/transient/3d.i +++ b/modules/subchannel/validation/PNNL_12_pin/transient/3d.i @@ -1,6 +1,6 @@ [Mesh] - [subchannel] - type = SCMDetailedQuadSubChannelMeshGenerator + [assembly] + type = SCMDetailedQuadAssemblyMeshGenerator nx = 7 ny = 3 n_cells = 48 diff --git a/modules/subchannel/validation/Toshiba_37_pin/toshiba_37_pin.i b/modules/subchannel/validation/Toshiba_37_pin/toshiba_37_pin.i index 68b9bdbde40f..4d6d3bd5fdb8 100644 --- a/modules/subchannel/validation/Toshiba_37_pin/toshiba_37_pin.i +++ b/modules/subchannel/validation/Toshiba_37_pin/toshiba_37_pin.i @@ -4,7 +4,7 @@ mass_flux_in = '${fparse 1e+6 * 37.00 / 36000.*0.5}' P_out = 2.0e5 # Pa [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = 4 n_cells = 20 flat_to_flat = 0.085 @@ -24,6 +24,48 @@ P_out = 2.0e5 # Pa [] [] +[AuxVariables] + [mdot] + block = subchannel + [] + [SumWij] + block = subchannel + [] + [P] + block = subchannel + [] + [DP] + block = subchannel + [] + [h] + block = subchannel + [] + [T] + block = subchannel + [] + [Tpin] + block = fuel_pins + [] + [Dpin] + block = fuel_pins + [] + [rho] + block = subchannel + [] + [mu] + block = subchannel + [] + [S] + block = subchannel + [] + [w_perim] + block = subchannel + [] + [q_prime] + block = fuel_pins + [] +[] + [SubChannel] type = TriSubChannel1PhaseProblem fp = sodium @@ -40,6 +82,7 @@ P_out = 2.0e5 # Pa staggered_pressure = false verbose_multiapps = true verbose_subchannel = false + pin_HTC_closure = 'Dittus-Boelter' # friction model friction_closure = 'cheng' [] @@ -48,6 +91,9 @@ P_out = 2.0e5 # Pa [cheng] type = SCMFrictionUpdatedChengTodreas [] + [Dittus-Boelter] + type = SCMHTCDittusBoelter + [] [] [ICs] @@ -68,6 +114,12 @@ P_out = 2.0e5 # Pa filename = "pin_power_profile_37.txt" [] + [Dpin_ic] + type = ConstantIC + variable = Dpin + value = 0.01 + [] + [T_ic] type = ConstantIC variable = T @@ -169,10 +221,17 @@ P_out = 2.0e5 # Pa [] [] +###### Transfers to the detailedMesh at the end of the coupled simulations [Transfers] - [xfer] + [subchannel_transfer] + type = SCMSolutionTransfer + to_multi_app = viz + variable = 'mdot SumWij P DP h T rho mu S' + [] + [pin_transfer] type = SCMSolutionTransfer + transfer_type = pin to_multi_app = viz - variable = 'mdot SumWij P DP h T rho mu q_prime S' + variable = 'Tpin q_prime' [] [] diff --git a/modules/subchannel/validation/Toshiba_37_pin/toshiba_37_pin_viz.i b/modules/subchannel/validation/Toshiba_37_pin/toshiba_37_pin_viz.i index e1485fbf398e..29f50d7dcec0 100644 --- a/modules/subchannel/validation/Toshiba_37_pin/toshiba_37_pin_viz.i +++ b/modules/subchannel/validation/Toshiba_37_pin/toshiba_37_pin_viz.i @@ -1,48 +1,52 @@ [Mesh] - [subchannel] - type = SCMDetailedTriSubChannelMeshGenerator - nrings = 4 - n_cells = 20 - flat_to_flat = 0.085 - heated_length = 1.0 - pin_diameter = 0.01 - pitch = 0.012 - [] + [subchannel] + type = SCMDetailedTriAssemblyMeshGenerator + nrings = 4 + n_cells = 20 + flat_to_flat = 0.085 + heated_length = 1.0 + pin_diameter = 0.01 + pitch = 0.012 [] +[] - [AuxVariables] - [mdot] - [] - [SumWij] - [] - [P] - [] - [DP] - [] - [h] - [] - [T] - [] - [rho] - [] - [mu] - [] - [S] - [] - [w_perim] - [] - [q_prime] - [] +[AuxVariables] + [mdot] [] - - [Problem] - type = NoSolveProblem + [SumWij] [] - - [Outputs] - exodus = true + [P] + [] + [DP] + [] + [h] + [] + [T] + [] + [Tpin] + [] + [Dpin] + [] + [rho] [] + [mu] + [] + [S] + [] + [w_perim] + [] + [q_prime] + [] +[] - [Executioner] +[Problem] + type = NoSolveProblem +[] + +[Outputs] + exodus = true +[] + +[Executioner] type = Steady - [] +[] diff --git a/modules/subchannel/validation/areva_FCTF/3D.i b/modules/subchannel/validation/areva_FCTF/3D.i index 652754c7cbce..9cdfe651f5aa 100644 --- a/modules/subchannel/validation/areva_FCTF/3D.i +++ b/modules/subchannel/validation/areva_FCTF/3D.i @@ -12,7 +12,7 @@ unheated_length_exit = 0.855 #m [TriSubChannelMesh] [subchannel] - type = SCMDetailedTriSubChannelMeshGenerator + type = SCMDetailedTriAssemblyMeshGenerator nrings = '${n_rings}' n_cells = 65 flat_to_flat = '${inner_duct_in}' @@ -23,17 +23,6 @@ unheated_length_exit = 0.855 #m pitch = '${fuel_pin_pitch}' [] - [fuel_pins] - type = SCMDetailedTriPinMeshGenerator - input = subchannel - nrings = '${n_rings}' - n_cells = 65 - unheated_length_entry = ${unheated_length_entry} - heated_length = ${heated_length} - unheated_length_exit = ${unheated_length_exit} - pin_diameter = '${fuel_pin_diameter}' - pitch = '${fuel_pin_pitch}' - [] [] [AuxVariables] diff --git a/modules/subchannel/validation/areva_FCTF/FCTF_deformed.i b/modules/subchannel/validation/areva_FCTF/FCTF_deformed.i index 4a823270163e..361854ad8d82 100644 --- a/modules/subchannel/validation/areva_FCTF/FCTF_deformed.i +++ b/modules/subchannel/validation/areva_FCTF/FCTF_deformed.i @@ -38,7 +38,7 @@ unheated_length_exit = 0.855 #m [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = ${n_rings} n_cells = 65 flat_to_flat = ${inner_duct_in} @@ -53,16 +53,6 @@ unheated_length_exit = 0.855 #m spacer_k = '0.0' [] - [fuel_pins] - type = SCMTriPinMeshGenerator - input = subchannel - nrings = ${n_rings} - n_cells = 65 - unheated_length_entry = ${unheated_length_entry} - heated_length = ${heated_length} - unheated_length_exit = ${unheated_length_exit} - pitch = ${fuel_pin_pitch} - [] [] [Functions] @@ -238,7 +228,8 @@ unheated_length_exit = 0.855 #m variable = 'mdot SumWij P DP h T rho mu S displacement' [] [pin_transfer] - type = SCMPinSolutionTransfer + type = SCMSolutionTransfer + transfer_type = pin to_multi_app = viz variable = 'Dpin Tpin q_prime' [] diff --git a/modules/subchannel/validation/areva_FCTF/FCTF_non_deformed.i b/modules/subchannel/validation/areva_FCTF/FCTF_non_deformed.i index 6e9bd67b27e9..9c0d9c84288c 100644 --- a/modules/subchannel/validation/areva_FCTF/FCTF_non_deformed.i +++ b/modules/subchannel/validation/areva_FCTF/FCTF_non_deformed.i @@ -38,7 +38,7 @@ unheated_length_exit = 0.855 #m [TriSubChannelMesh] [subchannel] - type = SCMTriSubChannelMeshGenerator + type = SCMTriAssemblyMeshGenerator nrings = ${n_rings} n_cells = 65 flat_to_flat = ${inner_duct_in} @@ -53,16 +53,6 @@ unheated_length_exit = 0.855 #m spacer_k = '0.0' [] - [fuel_pins] - type = SCMTriPinMeshGenerator - input = subchannel - nrings = ${n_rings} - n_cells = 65 - unheated_length_entry = ${unheated_length_entry} - heated_length = ${heated_length} - unheated_length_exit = ${unheated_length_exit} - pitch = ${fuel_pin_pitch} - [] [] [Functions] @@ -278,7 +268,8 @@ unheated_length_exit = 0.855 #m variable = 'mdot SumWij P DP h T rho mu S displacement' [] [pin_transfer] - type = SCMPinSolutionTransfer + type = SCMSolutionTransfer + transfer_type = pin to_multi_app = viz variable = 'Dpin Tpin q_prime' [] diff --git a/modules/subchannel/validation/psbt/psbt_null_transient/3d.i b/modules/subchannel/validation/psbt/psbt_null_transient/3d.i index 720dffdaf66c..c73275b5caf4 100644 --- a/modules/subchannel/validation/psbt/psbt_null_transient/3d.i +++ b/modules/subchannel/validation/psbt/psbt_null_transient/3d.i @@ -1,6 +1,6 @@ [Mesh] - [subchannel] - type = SCMDetailedQuadSubChannelMeshGenerator + [assembly] + type = SCMDetailedQuadAssemblyMeshGenerator nx = 6 ny = 6 n_cells = 50 diff --git a/modules/subchannel/validation/psbt/psbt_null_transient/psbt_ss.i b/modules/subchannel/validation/psbt/psbt_null_transient/psbt_ss.i index 9c309f0cdc9d..6401107976d3 100644 --- a/modules/subchannel/validation/psbt/psbt_null_transient/psbt_ss.i +++ b/modules/subchannel/validation/psbt/psbt_null_transient/psbt_ss.i @@ -8,7 +8,7 @@ P_out = 4.923e6 # Pa [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 6 ny = 6 n_cells = 50 @@ -41,12 +41,16 @@ P_out = 4.923e6 # Pa P_out = ${P_out} # friction model friction_closure = 'MATRA' + pin_HTC_closure = 'Dittus-Boelter' [] [SCMClosures] [MATRA] type = SCMFrictionMATRA [] + [Dittus-Boelter] + type = SCMHTCDittusBoelter + [] [] [ICs] diff --git a/modules/subchannel/validation/psbt/psbt_null_transient/psbt_transient.i b/modules/subchannel/validation/psbt/psbt_null_transient/psbt_transient.i index b193bb27bd41..e2e85e23440a 100644 --- a/modules/subchannel/validation/psbt/psbt_null_transient/psbt_transient.i +++ b/modules/subchannel/validation/psbt/psbt_null_transient/psbt_transient.i @@ -8,7 +8,7 @@ P_out = 4.923e6 # Pa [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 6 ny = 6 n_cells = 50 @@ -52,12 +52,16 @@ P_out = 4.923e6 # Pa skip_additional_restart_data = true # friction model friction_closure = 'MATRA' + pin_HTC_closure = 'Dittus-Boelter' [] [SCMClosures] [MATRA] type = SCMFrictionMATRA [] + [Dittus-Boelter] + type = SCMHTCDittusBoelter + [] [] [Functions] diff --git a/modules/subchannel/validation/psbt/psbt_ss/3d.i b/modules/subchannel/validation/psbt/psbt_ss/3d.i index 055e3757f0f5..bab2f390ce99 100644 --- a/modules/subchannel/validation/psbt/psbt_ss/3d.i +++ b/modules/subchannel/validation/psbt/psbt_ss/3d.i @@ -1,6 +1,6 @@ [Mesh] - [subchannel] - type = SCMDetailedQuadSubChannelMeshGenerator + [assembly] + type = SCMDetailedQuadAssemblyMeshGenerator nx = 6 ny = 6 n_cells = 20 @@ -9,17 +9,6 @@ side_gap = 0.00095 heated_length = 1.0 [] - - [fuel_pins] - type = SCMDetailedQuadPinMeshGenerator - input = subchannel - nx = 6 - ny = 6 - n_cells = 20 - pitch = 0.0126 - pin_diameter = 0.00950 - heated_length = 1.0 - [] [] [AuxVariables] diff --git a/modules/subchannel/validation/psbt/psbt_ss/psbt.i b/modules/subchannel/validation/psbt/psbt_ss/psbt.i index 9e582f20070f..8cd491306c1e 100644 --- a/modules/subchannel/validation/psbt/psbt_ss/psbt.i +++ b/modules/subchannel/validation/psbt/psbt_ss/psbt.i @@ -8,7 +8,7 @@ mass_flux_in = ${fparse 1e+6 * 16.95 / 3600.} P_out = 14.72e6 # Pa [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 6 ny = 6 n_cells = 20 @@ -19,51 +19,41 @@ P_out = 14.72e6 # Pa spacer_z = '0.0 0.229 0.457 0.686 0.914 1.143 1.372 1.600 1.829 2.057 2.286 2.515 2.743 2.972 3.200 3.429' spacer_k = '0.7 0.4 1.0 0.4 1.0 0.4 1.0 0.4 1.0 0.4 1.0 0.4 1.0 0.4 1.0 0.4' [] - - [fuel_pins] - type = SCMQuadPinMeshGenerator - input = sub_channel - nx = 6 - ny = 6 - n_cells = 20 - pitch = 0.0126 - heated_length = 3.658 - [] [] [AuxVariables] [mdot] - block = sub_channel + block = subchannel [] [SumWij] - block = sub_channel + block = subchannel [] [P] - block = sub_channel + block = subchannel [] [DP] - block = sub_channel + block = subchannel [] [h] - block = sub_channel + block = subchannel [] [T] - block = sub_channel + block = subchannel [] [Tpin] block = fuel_pins [] [rho] - block = sub_channel + block = subchannel [] [mu] - block = sub_channel + block = subchannel [] [S] - block = sub_channel + block = subchannel [] [w_perim] - block = sub_channel + block = subchannel [] [q_prime] block = fuel_pins diff --git a/modules/subchannel/verification/enthalpy_mixing_verification/3d.i b/modules/subchannel/verification/enthalpy_mixing_verification/3d.i index ff541ba3e0a1..ec51d8b63525 100644 --- a/modules/subchannel/verification/enthalpy_mixing_verification/3d.i +++ b/modules/subchannel/verification/enthalpy_mixing_verification/3d.i @@ -1,6 +1,6 @@ [Mesh] - [subchannel] - type = SCMDetailedQuadSubChannelMeshGenerator + [assembly] + type = SCMDetailedQuadAssemblyMeshGenerator nx = 2 ny = 1 n_cells = 100 diff --git a/modules/subchannel/verification/enthalpy_mixing_verification/two_channel.i b/modules/subchannel/verification/enthalpy_mixing_verification/two_channel.i index 03aca0bfd2fe..ac37e4000704 100644 --- a/modules/subchannel/verification/enthalpy_mixing_verification/two_channel.i +++ b/modules/subchannel/verification/enthalpy_mixing_verification/two_channel.i @@ -3,7 +3,7 @@ P_out = 155e+5 # Pa [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 2 ny = 1 n_cells = 100 diff --git a/modules/subchannel/verification/friction_model_verification/3d.i b/modules/subchannel/verification/friction_model_verification/3d.i index 0aab03147b17..5538b73b8954 100644 --- a/modules/subchannel/verification/friction_model_verification/3d.i +++ b/modules/subchannel/verification/friction_model_verification/3d.i @@ -1,6 +1,6 @@ [Mesh] - [subchannel] - type = SCMDetailedQuadSubChannelMeshGenerator + [assembly] + type = SCMDetailedQuadAssemblyMeshGenerator nx = 2 ny = 1 n_cells = 100 diff --git a/modules/subchannel/verification/friction_model_verification/two_channel.i b/modules/subchannel/verification/friction_model_verification/two_channel.i index 79140a4c4898..65594f6e50ef 100644 --- a/modules/subchannel/verification/friction_model_verification/two_channel.i +++ b/modules/subchannel/verification/friction_model_verification/two_channel.i @@ -4,7 +4,7 @@ P_out = 155e+5 # Pa [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 1 ny = 2 n_cells = 100 diff --git a/modules/subchannel/verification/friction_model_verification/two_channel2.i b/modules/subchannel/verification/friction_model_verification/two_channel2.i index 8bf8303cce80..5d53071d6920 100644 --- a/modules/subchannel/verification/friction_model_verification/two_channel2.i +++ b/modules/subchannel/verification/friction_model_verification/two_channel2.i @@ -4,7 +4,7 @@ P_out = 155e+5 # Pa [QuadSubChannelMesh] [sub_channel] - type = SCMQuadSubChannelMeshGenerator + type = SCMQuadAssemblyMeshGenerator nx = 2 ny = 1 n_cells = 100