mit-crpg / OpenMOC

A method of characteristics code for nuclear reactor physics calculations.
https://mit-crpg.github.io/OpenMOC/
Other
148 stars 83 forks source link

Allow user to provide numpy array with coarse group structure for CMFD. #43

Closed samuelshaner closed 10 years ago

samuelshaner commented 10 years ago

The CMFD module currently allows users to specify the number of groups to use in the CMFD solver. This can be anywhere from 1 to the number of groups in the MOC solver. If the number of CMFD groups is different than the number of MOC groups, the MOC group structure is cut up into coarse groups with each coarse group containing the same number of fine groups. If (num_MOC_groups % num_CMFD_groups != 0), the lowest group will be assigned the extra groups and thus grow by (num_MOC_groups % num_CMFD_groups) groups. This issue is to add the functionality to allow the user to specify the coarse mesh group structure and thereby achieve better spectral resolution in a coarse group CMFD solve.

wbinventor commented 10 years ago

This should be straightforward to do with NumPY and/or SWIG typemaps. See my documentation I'm the User's Guide for the step-by-step procedure to do this (like two steps):

NumPy typemaps to input a NumPy array:

https://mit-crpg.github.io/OpenMOC/devguide/swig.html#numpy-typemaps

SWIG typemaps to input a Python list:

https://mit-crpg.github.io/OpenMOC/devguide/swig.html#swig-typemaps

samuelshaner commented 10 years ago

Implemented, tested, and documented.