diff --git a/DAGMC_Geometry.h5m b/DAGMC_Geometry.h5m new file mode 100644 index 0000000..96d2bbe Binary files /dev/null and b/DAGMC_Geometry.h5m differ diff --git a/WC_Layers/Conversion_h5m.py b/WC_Layers/Conversion_h5m.py new file mode 100644 index 0000000..b35de24 --- /dev/null +++ b/WC_Layers/Conversion_h5m.py @@ -0,0 +1,36 @@ +import openmc +import numpy as np +import pymoab +from pymoab import core, types, rng +import matplotlib.pyplot as plt + +# Load the statepoint file +sp = openmc.StatePoint("statepoint.10.h5") + +mb = core.Core() +mb.load_file('OpenMC_Mesh.h5m') + +# Retrieve the tally +tally = sp.get_tally(id=2) + +# Load the mesh +mesh = sp.meshes[1] + +tally_data = tally.get_reshaped_data(value='mean') + +#Summing over cell filter: +flux_spectra_on_mesh = tally_data.sum(axis=0) + +ebounds = tally.find_filter(openmc.EnergyFilter).bins + +plt.xlabel('Energy [eV]') +plt.ylabel('Flux [n/cm^2-s]') +plt.loglog(ebounds[:,0],flux_sum_en[0,:,0,0]) +plt.savefig("Flux_Graph.png") + +# get all tets from the MOAB mesh +all_tets = mb.get_entities_by_type(0, types.MBTET) +n_flux_tag = mb.tag_get_handle('FLUX_MESH', 175, types.MB_TYPE_DOUBLE, types.MB_TAG_DENSE, create_if_missing=True) +mb.tag_set_data(n_flux_tag, all_tets, flux_spectra_on_mesh[:,:,0,0]) # the shape of the data will need to be checked here + +mb.write_file('Mesh_with_Tally.h5m') diff --git a/WC_Layers/PyNE_Lib.py b/WC_Layers/PyNE_Lib.py new file mode 100644 index 0000000..b402206 --- /dev/null +++ b/WC_Layers/PyNE_Lib.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +""" +Created on Mon Sep 2 01:08:06 2024 + +@author: Anupama Rajendra +""" + +from pyne.material import Material +from pyne.material_library import MaterialLibrary + +W=Material({"W":1}) +W.density=19.3 +Graphite=Material({"C":1}) +Graphite.density=2.62 + +MatLib = MaterialLibrary() +MatLib["W"]=W +MatLib["Graphite"]=Graphite +MatLib.write_hdf5("PyNE_Lib_WC.h5", h5_overwrite=True) diff --git a/WC_Layers/config.ini b/WC_Layers/config.ini new file mode 100644 index 0000000..64c5b52 --- /dev/null +++ b/WC_Layers/config.ini @@ -0,0 +1,43 @@ +[general] +# Specify whether this problem uses structured or unstructured mesh +structured: False +# Specify whether this problem uses sub-voxel r2s +sub_voxel: False + +[step1] +# Path to MCNP MESHTAL file containing neutron fluxes or a DAG-MCNP5 +# unstructured mesh tally .h5m file. +meshtal: Mesh_with_Tally.h5m +# Tally number within the meshtal file containing the fluxes for activation. +tally_num: 2 +# The name of the tag used to store flux data on the mesh. For unstructured +# mesh this tag must already exist within the file specified in . +flux_tag: FLUX_MESH +# Path to the DAGMC material-laden geometry file (.h5m). +geom: DAGMC_Geometry.h5m +# If True the fluxes in the fluxin file will be printed in the reverse +# order of how they appear within the flux vector tag. Since MCNP and +# the Meshtal class order fluxes from low energy to high energy, this +# option should be true if the transmutation data being used is +# ordered from high-energy to low-energy. +reverse: True +# Number of rays to fire down each mesh row in each direction to calculate +# cell volume fractions. +num_rays: 100 +# If true, rays will be fired down mesh rows in evenly spaced intervals. +# In this case must be a perfect square. If false, rays are fired +# down mesh rows in random intervals. +grid: False + +[step2] +# List of decays times, seperated by commas. These strings much match exactly +# with their counterparts in the phtn_src file produced in step1. No spaces +# should appear in this line except the space between the time and the time unit +# for each entry. +decay_times:24 h,2.6864e+6 s +# The prefix of the .h5m files containing the source density distributations for +# each decay time. +output: source +# The name of the output files containing the total photon source intensities for +# each decay time +tot_phtn_src_intensities : total_photon_source_intensities.txt