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 exceptions.StateError( "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.cs["detailedAxialExpansion"]: converter = self.geomConverters.get("axial") if not converter: converter = uniformMesh.UniformMeshGeometryConverter(self.cs) 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
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.UniformMeshGeometryConverter()
def setUp(self): self.o, self.r = test_reactors.loadTestReactor(TEST_ROOT) self.converter = uniformMesh.UniformMeshGeometryConverter()
def setUp(self): self.converter = uniformMesh.UniformMeshGeometryConverter() self.converter._sourceReactor = self.r