OpenMC/include/openmc/mgxs_interface.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

86 lines
2.8 KiB
C
Raw Permalink Normal View History

//! \file mgxs_interface.h
//! A collection of C interfaces to the C++ Mgxs class
#ifndef OPENMC_MGXS_INTERFACE_H
#define OPENMC_MGXS_INTERFACE_H
#include "openmc/hdf5_interface.h"
#include "openmc/mgxs.h"
#include "openmc/vector.h"
namespace openmc {
//==============================================================================
// Global MGXS data container structure
//==============================================================================
2019-11-08 14:57:04 -05:00
class MgxsInterface {
2019-11-08 13:25:49 -05:00
public:
MgxsInterface() = default;
// Construct from path to cross sections file, as well as a list
// of XS to read and the corresponding temperatures for each XS
MgxsInterface(const std::string& path_cross_sections,
const vector<std::string> xs_to_read,
2021-04-29 16:23:54 -04:00
const vector<vector<double>> xs_temps);
2019-11-08 13:25:49 -05:00
// Does things to construct after the nuclides and temperatures to
// read have been specified.
void init();
2019-11-08 13:25:49 -05:00
// Set which nuclides and temperatures are to be read
void set_nuclides_and_temperatures(
2021-04-29 16:23:54 -04:00
vector<std::string> xs_to_read, vector<vector<double>> xs_temps);
2019-11-08 13:25:49 -05:00
// Add an Mgxs object to be managed
void add_mgxs(
hid_t file_id, const std::string& name, const vector<double>& temperature);
2019-11-08 13:25:49 -05:00
// Reads just the header of the cross sections file, to find
// min & max energies as well as the available XS
void read_header(const std::string& path_cross_sections);
// Calculate microscopic cross sections from nuclide macro XS
void create_macro_xs();
2019-11-08 13:25:49 -05:00
// Get the kT values which are used in the OpenMC model
2021-04-29 16:23:54 -04:00
vector<vector<double>> get_mat_kTs();
// Get the group index corresponding to a continuous energy
int get_group_index(double E);
2019-11-08 13:25:49 -05:00
int num_energy_groups_;
int num_delayed_groups_;
vector<std::string> xs_names_; // available names in HDF5 file
vector<std::string> xs_to_read_; // XS which appear in materials
2021-04-29 16:23:54 -04:00
vector<vector<double>> xs_temps_to_read_; // temperatures used
2019-11-08 13:25:49 -05:00
std::string cross_sections_path_; // path to MGXS h5 file
vector<Mgxs> nuclides_;
vector<Mgxs> macro_xs_;
vector<double> energy_bins_;
vector<double> energy_bin_avg_;
vector<double> rev_energy_bins_;
2021-04-29 16:23:54 -04:00
vector<vector<double>> nuc_temps_; // all available temperatures
vector<double>
default_inverse_velocity_; // approximate default inverse-velocity data
};
namespace data {
2019-11-08 13:25:49 -05:00
extern MgxsInterface mg;
}
2018-10-17 06:34:12 -05:00
// Puts available XS in MGXS file to globals so that when
// materials are read, the MGXS specified in a material can
// be ensured to be present in the available data.
2019-11-07 14:01:04 -05:00
void put_mgxs_header_data_to_globals();
// Set which nuclides and temperatures are to be read on
2019-11-08 13:25:49 -05:00
// mg through global data
2019-11-07 14:01:04 -05:00
void set_mg_interface_nuclides_and_temps();
// After macro XS have been read, materials can be marked as fissionable
2019-11-07 14:01:04 -05:00
void mark_fissionable_mgxs_materials();
} // namespace openmc
#endif // OPENMC_MGXS_INTERFACE_H