Loading tests/test_files/griffin_mesh.i 0 → 100644 +65 −0 Original line number Diff line number Diff line [Mesh] [refl_assembly] type = SimpleHexagonGenerator hexagon_size = 0.2 hexagon_size_style = apothem element_type = QUAD block_id = 0 [] [fuel_assembly1] type = SimpleHexagonGenerator hexagon_size = 0.2 hexagon_size_style = apothem element_type = QUAD block_id = 1 [] [fuel_assembly2] type = SimpleHexagonGenerator hexagon_size = 0.2 hexagon_size_style = apothem element_type = QUAD block_id = 2 [] [core_lattice] type = PatternedHexMeshGenerator inputs = ' refl_assembly fuel_assembly1 fuel_assembly2' pattern_boundary = none external_boundary_id = 15000 pattern = ' 0 0 0 0 0 0; 0 2 2 2 2 2 0; 0 2 2 2 2 2 2 0; 0 2 2 0 1 2 2 2 0; 0 2 2 1 1 1 1 2 2 0; 0 2 2 2 1 1 1 0 2 2 0; 0 2 2 1 1 1 1 2 2 0; 0 2 2 0 1 2 2 2 0; 0 2 2 2 2 2 2 0; 0 2 2 2 2 2 0; 0 0 0 0 0 0' [] [extrude_3d] type = FancyExtruderGenerator input = core_lattice heights = '0.1' num_layers = '2' direction = '0 0 1' top_boundary = 15001 bottom_boundary = 15002 subdomain_swaps = ' 0 0' [] [rename_sidesets] type = RenameBoundaryGenerator input = extrude_3d old_boundary = '15000 15001 15002' new_boundary = 'CORE_RADIAL CORE_TOP CORE_BOTTOM' [] final_generator = rename_sidesets uniform_refine = 0 [] tests/test_files/griffin_options.i 0 → 100644 +59 −0 Original line number Diff line number Diff line [TransportSystems] VacuumBoundary = "CORE_RADIAL" equation_type = eigenvalue G = 33 particle = neutron ReflectingBoundary = "CORE_BOTTOM CORE_TOP" [dfem_diffusion] scheme = DFEM-Diffusion order = FIRST family = MONOMIAL [] [] [Executioner] nl_rel_tol = 1e-8 nl_abs_tol = 1e-50 nl_max_its = 50 free_power_iterations = 4 l_tol = 0.01 l_max_its = 10000 eigen_tol = 0.0001 type = Eigenvalue solve_type = Newton [] [GlobalParams] library_name = ISOTXS-neutron material_id = 1 densities = 1.0 plus = true dbgmat = false grid_names = Tfuel grid = '1' [] [Materials] [fuel_assembly2_z0] type = MixedNeutronicsMaterial block = '2' isotopes = 'pseudo_REG_B' [] [fuel_assembly1_z0] type = MixedNeutronicsMaterial block = '1' isotopes = 'pseudo_REG_A' [] [refl_assembly_z0] type = MixedNeutronicsMaterial block = '0' isotopes = 'pseudo_REG_C' [] [] [Outputs] [pyarc] type = Exodus file_base = input [] [] tests/test_material_report.py +26 −4 Original line number Diff line number Diff line import pytest from pygriffin.isoxml_reader import parse_isoxml from pygriffin.pygriffin import PyGriffin def test_isoxml_isotopes(request): exp_isotopes = ['pseudo_REG_A', 'pseudo_REG_B', 'pseudo_REG_C'] isotopes = parse_isoxml(request.path.parent / 'test_files/isoxml_sample.xml') assert exp_isotopes == isotopes def test_materials(request): griffin_input = request.path.parent / 'test_files/griffin_options.i' griffin_mesh = request.path.parent / 'test_files/griffin_mesh.i' # create a pygriffin instance pyg = PyGriffin(input=griffin_input, mesh=griffin_mesh) mat_assignments = pyg.get_material_assignments() exp_mat_assignments = {'fuel_assembly2_z0': ['pseudo_REG_B'], 'fuel_assembly1_z0': ['pseudo_REG_A'], 'refl_assembly_z0': ['pseudo_REC_C']} assert sorted(exp_mat_assignments.keys()) == sorted(mat_assignments.keys()) exp_isotopes = (['pseudo_REG_B'], ['pseudo_REG_A'], ['pseudo_REG_C']) for exp_isos, mat_isos in zip(exp_isotopes, mat_assignments.values()): assert exp_isos == mat_isos def test_isoxml_materials(request): exp_materials = ['pseudo_REG_A', 'pseudo_REG_B', 'pseudo_REG_C'] materials = parse_isoxml(request.path.parent / 'test_files/isoxml_sample.xml') assert exp_materials == materials No newline at end of file Loading
tests/test_files/griffin_mesh.i 0 → 100644 +65 −0 Original line number Diff line number Diff line [Mesh] [refl_assembly] type = SimpleHexagonGenerator hexagon_size = 0.2 hexagon_size_style = apothem element_type = QUAD block_id = 0 [] [fuel_assembly1] type = SimpleHexagonGenerator hexagon_size = 0.2 hexagon_size_style = apothem element_type = QUAD block_id = 1 [] [fuel_assembly2] type = SimpleHexagonGenerator hexagon_size = 0.2 hexagon_size_style = apothem element_type = QUAD block_id = 2 [] [core_lattice] type = PatternedHexMeshGenerator inputs = ' refl_assembly fuel_assembly1 fuel_assembly2' pattern_boundary = none external_boundary_id = 15000 pattern = ' 0 0 0 0 0 0; 0 2 2 2 2 2 0; 0 2 2 2 2 2 2 0; 0 2 2 0 1 2 2 2 0; 0 2 2 1 1 1 1 2 2 0; 0 2 2 2 1 1 1 0 2 2 0; 0 2 2 1 1 1 1 2 2 0; 0 2 2 0 1 2 2 2 0; 0 2 2 2 2 2 2 0; 0 2 2 2 2 2 0; 0 0 0 0 0 0' [] [extrude_3d] type = FancyExtruderGenerator input = core_lattice heights = '0.1' num_layers = '2' direction = '0 0 1' top_boundary = 15001 bottom_boundary = 15002 subdomain_swaps = ' 0 0' [] [rename_sidesets] type = RenameBoundaryGenerator input = extrude_3d old_boundary = '15000 15001 15002' new_boundary = 'CORE_RADIAL CORE_TOP CORE_BOTTOM' [] final_generator = rename_sidesets uniform_refine = 0 []
tests/test_files/griffin_options.i 0 → 100644 +59 −0 Original line number Diff line number Diff line [TransportSystems] VacuumBoundary = "CORE_RADIAL" equation_type = eigenvalue G = 33 particle = neutron ReflectingBoundary = "CORE_BOTTOM CORE_TOP" [dfem_diffusion] scheme = DFEM-Diffusion order = FIRST family = MONOMIAL [] [] [Executioner] nl_rel_tol = 1e-8 nl_abs_tol = 1e-50 nl_max_its = 50 free_power_iterations = 4 l_tol = 0.01 l_max_its = 10000 eigen_tol = 0.0001 type = Eigenvalue solve_type = Newton [] [GlobalParams] library_name = ISOTXS-neutron material_id = 1 densities = 1.0 plus = true dbgmat = false grid_names = Tfuel grid = '1' [] [Materials] [fuel_assembly2_z0] type = MixedNeutronicsMaterial block = '2' isotopes = 'pseudo_REG_B' [] [fuel_assembly1_z0] type = MixedNeutronicsMaterial block = '1' isotopes = 'pseudo_REG_A' [] [refl_assembly_z0] type = MixedNeutronicsMaterial block = '0' isotopes = 'pseudo_REG_C' [] [] [Outputs] [pyarc] type = Exodus file_base = input [] []
tests/test_material_report.py +26 −4 Original line number Diff line number Diff line import pytest from pygriffin.isoxml_reader import parse_isoxml from pygriffin.pygriffin import PyGriffin def test_isoxml_isotopes(request): exp_isotopes = ['pseudo_REG_A', 'pseudo_REG_B', 'pseudo_REG_C'] isotopes = parse_isoxml(request.path.parent / 'test_files/isoxml_sample.xml') assert exp_isotopes == isotopes def test_materials(request): griffin_input = request.path.parent / 'test_files/griffin_options.i' griffin_mesh = request.path.parent / 'test_files/griffin_mesh.i' # create a pygriffin instance pyg = PyGriffin(input=griffin_input, mesh=griffin_mesh) mat_assignments = pyg.get_material_assignments() exp_mat_assignments = {'fuel_assembly2_z0': ['pseudo_REG_B'], 'fuel_assembly1_z0': ['pseudo_REG_A'], 'refl_assembly_z0': ['pseudo_REC_C']} assert sorted(exp_mat_assignments.keys()) == sorted(mat_assignments.keys()) exp_isotopes = (['pseudo_REG_B'], ['pseudo_REG_A'], ['pseudo_REG_C']) for exp_isos, mat_isos in zip(exp_isotopes, mat_assignments.values()): assert exp_isos == mat_isos def test_isoxml_materials(request): exp_materials = ['pseudo_REG_A', 'pseudo_REG_B', 'pseudo_REG_C'] materials = parse_isoxml(request.path.parent / 'test_files/isoxml_sample.xml') assert exp_materials == materials No newline at end of file