예제 #1
0
 def setUp(self):
     self.o, self.r = test_reactors.loadTestReactor(
         TEST_ROOT, customSettings={"xsKernel": "MC2v2"}
     )
     self.r.core.lib = isotxs.readBinary(ISOAA_PATH)
     self.r.core.p.keff = 1.0
     self.converter = uniformMesh.NeutronicsUniformMeshConverter()
예제 #2
0
    def _performGeometryTransformations(self, makePlots=False):
        """
        Apply geometry conversions to make reactor work in neutronics

        There are two conditions where things must happen:

        1. If you are doing finite-difference, you need to add the edge assemblies (fast).
           For this, we just modify the reactor in place

        2. If you are doing detailed axial expansion, you need to average out the axial mesh (slow!)
           For this we need to create a whole copy of the reactor and use that.

        In both cases, we need to undo the modifications between reading the output
        and applying the result to the data model.

        See Also
        --------
        _undoGeometryTransformations
        """
        if any(self.geomConverters):
            raise RuntimeError(
                "The reactor has been transformed, but not restored to the original.\n"
                + "Geometry converter is set to {} \n.".format(
                    self.geomConverters) +
                "This is a programming error and requires further investigation."
            )
        neutronicsReactor = self.r
        if self.options.detailedAxialExpansion:
            converter = self.geomConverters.get("axial")
            if not converter:
                converter = uniformMesh.NeutronicsUniformMeshConverter(
                    None,
                    calcReactionRates=self.options.
                    calcReactionRatesOnMeshConversion,
                )
                neutronicsReactor = converter.convert(self.r)
                if makePlots:
                    converter.plotConvertedReactor()
                self.geomConverters["axial"] = converter

        if self.edgeAssembliesAreNeeded():
            converter = self.geomConverters.get(
                "edgeAssems", geometryConverters.EdgeAssemblyChanger())
            converter.addEdgeAssemblies(neutronicsReactor.core)
            self.geomConverters["edgeAssems"] = converter

        self.r = neutronicsReactor
예제 #3
0
    def setUp(self):
        """
        Build two assemblies.

        The source assembly has two blocks, heights 3 and 7 cm. The destination
        has one big block that's 10 cm. Flux is set to 5 and 10 respectively on
        the two source blocks. They are populated with arbitrary flux and pdens
        values.
        """
        self.sourceAssem, self.destinationAssem = test_assemblies.buildTestAssemblies(
        )[2:]
        self.height1 = 3.0
        self.height2 = 7.0
        self.sourceAssem[0].setHeight(self.height1)
        self.sourceAssem[0].p.flux = 5.0
        self.sourceAssem[1].setHeight(self.height2)
        self.sourceAssem[1].p.flux = 10.0
        self.sourceAssem.calculateZCoords()
        self.destinationAssem[0].setHeight(self.height1 + self.height2)
        self.destinationAssem.calculateZCoords()

        self.converter = uniformMesh.NeutronicsUniformMeshConverter()
예제 #4
0
 def setUp(self):
     self.converter = uniformMesh.NeutronicsUniformMeshConverter()
     self.converter._sourceReactor = self.r