Skip to main content

Python API to JiTCDDE for neutronic and thermal hydraulic systems

Project description

msrDynamics

msrDynamics is an object-oriented API to JiTCDDE, a delay differential equation solver, written with emulation of simulink-style solvers for molten salt reactor (MSR) systems in mind (see Singh et al), but can be extended to other fission and/or thermal hydraulic systems. The goal of this package is to streamline the implemetation of such nodal models for more complex systems, where direct handling of the equations can become cumbersome.

Installation

Clone this repository. Then, within your preferred python environment, install the project with pip by providing the path to the project folder.

pip install </path/to/msrDynamics>

The project is not yet available on PyPI.

Methodology

The API creates nodal systems, of the form discussed in the examples below, whereby variables representing system properties or masses are aggregated into nodes with associated properties, and which only interact with other nodes through these properties. The system can then be described as a first-order system of differential equations, suitable for a numerical solver. The nodes therefore, are essentially representations of the state variables of the system.

Usage

Nodes are represented by the Node() object which stores properties associated with the node, and contains helper methods to define certian dynamics like convective and advective heat transfer as well as neutron kinetics. For example, fuel flow through a core in direct contact with a moderator material (e.g. graphite), could be set up as follows.

import paramerers
import numpy as np

# instantiate system 
msr = System()

# define nodes with mass m, scpecific heat capacity scp, and mass flow W
f1 = Node(m = m_f1, scp = scp_f, W = W_f)
f2 = Node(m = m_f2, scp = scp_f, W = W_f)
g  = Node(m = m_g, scp = scp_g)

# add nodes to system 
msr.add_nodes([f1,f2,g])

# define dynamics 
f1.set_dTdt_advective(source = f_in)
f1.set_dTdt_convective(source = g.y(), hA = [hA_fg])

f2.set_dTdt_advective(source = f_1.y())
f2.set_dTdt_convective(source = g.y(), hA = [hA_fg])

g.set_dTdt_convective(source = [f1.y(), f2.y()], hA = [hA_fg, hA_fg])

# solve 
T = np.arange(0,100,0.01)
msr.solve(T)

Note, for any system, a System() object is required for proper handling of the global indexing required for the JiTCDDE backend. Nodes need to be added to the system object before dynamics are defined. This is because certain global system information is required in order to index the variables properly for the backend.

Nodes can also represent state variables associated with neutron kinetics, like neutron concentration $n(t)$ delayed neutorn precursor concentrations $C_i(t)$, and therefore does not need to be associated with a thermal mass. The helper methods take other nodes to which a given node is coupled, along with relevant system parameters, as arguments, and sets up the symbolic expressions representing the equations govenring the dynamics of the node. These symbolic expressions are the input to the JiTCDDE backend. Alternatively, if the user wishes to circumvent the helper methods, or would like to define other dynamics, a node's dynamics can be set directly with a user-defined symbolic expression through the Node.dydt attribute, e.g.

# instantiate system 
f = System()

# define nodes
x = Node(m = m_x)
y = Node(m = m_y)

# add nodes to system
f.add_nodes([x,y])

# define dynamics 
x.dydt = x.y() - y.y()
y.dydt = - x.y() + y.y() 

Examples

See the notebooks below for more detailed examples of usage, as well as comparison to experimental data.

Comparison of results from the Molten Salt Reactor Experiment (MSRE) generated with msrDynamics against experimental data, and similar work by Singh et al.

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

msrdynamics-0.1.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

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

msrDynamics-0.1.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file msrdynamics-0.1.0.tar.gz.

File metadata

  • Download URL: msrdynamics-0.1.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.6

File hashes

Hashes for msrdynamics-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8901f35f5ed8c75c4d17b224109ad48eb9d9c2b9e33612c3491334c0dc8bde44
MD5 8c99ba40dc8493426a48f15ab78a95f5
BLAKE2b-256 0ccb9f6c6b6375827ba58ad09b0e2c6675a9b61512323e698ec1f4af792b000a

See more details on using hashes here.

File details

Details for the file msrDynamics-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: msrDynamics-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.6

File hashes

Hashes for msrDynamics-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7ecd53a3040e9affc48ec1226cef91c43407701d18a2b37fd73466c56fa47165
MD5 5880cf71d973223b316a33f1daca3649
BLAKE2b-256 f1bb10c22501e33dd1b1e7d525e233204bea6f01a174e791f34c01326e0ed383

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