Skip to main content

Wrapper for source term alaysis code NUIT

Project description

Contents

Summary

pyNUIT is a package in Python which wrappers the source term analysis code NUIT, and integrates various util tools for its control and management.

Install

  1. Using git clone: git clone https://github.com/thu-inet/pyNUIT.git
  2. Download the zip and unzip to destination path

Only a few basic Python packages are required, including:

  • Numpy
  • Matplotlib
  • Pandas *pyNUIT is platform-independent, yet NUIT is in C++ and you need to have the right complied version to use it. Currrently, pyNUIT uses wine and NUIT for windows to make it usable on Linux, so make sure you get wine installed correctly if you are working with Linux.

Get Started

The most basic module is nt.Model and nt.Output, for management of NUIT input model and its output.

# import pyNUIT
import pyNUIT as nt

# define the model
model = nt.Model()
model.add_nuclide("U235", 0.85)
model.add_nuclide("U238", 4.15)

# define power history
for i in range(10):
    model.add_burnup(time=10, unit='day', val=800E-6)

# define the output
model.set_output("isotope", print_all_step=0)

# library configuration
model.set_library(r"D:\\NUIT\\NUITLib_HTGR_900k")

# run the model to get output
out = model("model.xml", nuitpath="D:\\NUIT\\NUITx.exe")

# read calculation results
burnup = out.burnups[-1]
density = out.get_nuclide_mass("Cs137")[-1]
print(f"Nuclide density of Cs137 at {burnup} MWd/kgU is {density} n/cm/barn")

Histogram class is used to represent the power history, and can transfer its power history into nt.Model to form a complete model.


# define two histogram instances
histo1 = nt.Histogram(["2019-01-15 00:00", "2019-02-26 00:00", "2019-03-26 00:00"], [(0,0), (3.7E6,3.7E6), (3.7E6, 0)])
histo2 = nt.Histogram(["2019-05-28 00:00", "2019-07-02 00:00"], [(0, 0), (3E6, 3E6)])

# concatenate two histograms
histo = histo1 + histo2

# pass the power history to model
histo.model = model
model = histo.to_model(step_length=10*86400)

Classes in nt.data are used to interact with data libraries.

# read the multi-group xs lib
mgxslib = nt.data.MGXSlib.from_datfile("D:\\NUIT\\NUITLib_HTGR_900k\\NuitMgXsLib.dat")

# use existing flux data to collapse into one-group xslib
xslib = mgxslib.to_xslib(flux)

# check the xs of Cs134, MT=102 reaction
print(f"Cross section of Cs-134 Reaction(102) is {xslib("Cs134")(102)}")

# export xslib into .dat file
xslib.to_datfile("xslib.dat")

Reference

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

NUIT-0.2.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

NUIT-0.2-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file NUIT-0.2.tar.gz.

File metadata

  • Download URL: NUIT-0.2.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for NUIT-0.2.tar.gz
Algorithm Hash digest
SHA256 9c6a01647c06f3d76ec5f6404dfccf54ed90f203687d9367c5a14b0f6e777a33
MD5 35896542abbbc5a958558aceb4335fc1
BLAKE2b-256 bb14d77883ad0da855a7fb54afbe3764a440cdd6a75f9fbe0a7ab602a2ca8b7f

See more details on using hashes here.

File details

Details for the file NUIT-0.2-py3-none-any.whl.

File metadata

  • Download URL: NUIT-0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for NUIT-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cc3e5831c3f2500ecc97539a91ee3fbe6ece7f62caebfb6311b41b869deb4861
MD5 f532f5c376e8dd5b7ccc1508902efb7e
BLAKE2b-256 d39ebd0bf86dab7c2f4fbe6b48e27dfca8a0e3542ac12bd7b04e3e6db47733dd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page