mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Support cell densities in the random ray solver (#3720)
This commit is contained in:
parent
7106958e00
commit
5bce5adabc
12 changed files with 648 additions and 30 deletions
|
|
@ -14,6 +14,7 @@
|
|||
#include "openmc/memory.h" // for unique_ptr
|
||||
#include "openmc/ncrystal_interface.h"
|
||||
#include "openmc/particle.h"
|
||||
#include "openmc/settings.h"
|
||||
#include "openmc/vector.h"
|
||||
|
||||
namespace openmc {
|
||||
|
|
@ -110,9 +111,12 @@ public:
|
|||
//! \return Density in [atom/b-cm]
|
||||
double density() const { return density_; }
|
||||
|
||||
//! Get density in [g/cm^3]
|
||||
//! Get density in [g/cm^3].
|
||||
//! \return Density in [g/cm^3]
|
||||
double density_gpcc() const { return density_gpcc_; }
|
||||
double density_gpcc() const
|
||||
{
|
||||
return settings::run_CE ? density_gpcc_ : density();
|
||||
}
|
||||
|
||||
//! Get charge density in [e/b-cm]
|
||||
//! \return Charge density in [e/b-cm]
|
||||
|
|
|
|||
|
|
@ -146,6 +146,7 @@ public:
|
|||
|
||||
// Scalar fields
|
||||
int* material_;
|
||||
double* density_mult_;
|
||||
int* is_small_;
|
||||
int* n_hits_;
|
||||
int* birthday_;
|
||||
|
|
@ -195,6 +196,9 @@ public:
|
|||
int& material() { return *material_; }
|
||||
const int material() const { return *material_; }
|
||||
|
||||
double& density_mult() { return *density_mult_; }
|
||||
const double density_mult() const { return *density_mult_; }
|
||||
|
||||
int& is_small() { return *is_small_; }
|
||||
const int is_small() const { return *is_small_; }
|
||||
|
||||
|
|
@ -316,7 +320,9 @@ public:
|
|||
//---------------------------------------
|
||||
// Scalar fields
|
||||
|
||||
int material_ {0}; //!< Index in openmc::model::materials array
|
||||
int material_ {0}; //!< Index in openmc::model::materials array
|
||||
double density_mult_ {1.0}; //!< A density multiplier queried from the cell
|
||||
//!< corresponding to the source region.
|
||||
OpenMPMutex lock_;
|
||||
double volume_ {
|
||||
0.0}; //!< Volume (computed from the sum of ray crossing lengths)
|
||||
|
|
@ -394,6 +400,9 @@ public:
|
|||
int& material(int64_t sr) { return material_[sr]; }
|
||||
const int material(int64_t sr) const { return material_[sr]; }
|
||||
|
||||
double& density_mult(int64_t sr) { return density_mult_[sr]; }
|
||||
const double density_mult(int64_t sr) const { return density_mult_[sr]; }
|
||||
|
||||
int& is_small(int64_t sr) { return is_small_[sr]; }
|
||||
const int is_small(int64_t sr) const { return is_small_[sr]; }
|
||||
|
||||
|
|
@ -625,6 +634,7 @@ private:
|
|||
|
||||
// SoA storage for scalar fields (one item per source region)
|
||||
vector<int> material_;
|
||||
vector<double> density_mult_;
|
||||
vector<int> is_small_;
|
||||
vector<int> n_hits_;
|
||||
vector<int> mesh_;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue