Skip to content

Commit

Permalink
Adding the nubar data to the MultigroupTable
Browse files Browse the repository at this point in the history
  • Loading branch information
whaeck committed Jun 5, 2024
1 parent 9918fab commit 0332067
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 6 deletions.
8 changes: 8 additions & 0 deletions src/NDItk/MultigroupTable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include "NDItk/multigroup/ReactionCrossSections.hpp"
#include "NDItk/multigroup/TotalCrossSection.hpp"
#include "NDItk/multigroup/AverageFissionEnergyRelease.hpp"
#include "NDItk/multigroup/FissionNeutronMultiplicity.hpp"
#include "NDItk/multigroup/FissionNeutronProduction.hpp"
#include "NDItk/multigroup/OutgoingParticleTypes.hpp"
#include "NDItk/multigroup/OutgoingParticleTransportData.hpp"
#include "NDItk/multigroup/HeatingNumbers.hpp"
Expand All @@ -37,6 +39,9 @@ class MultigroupTable {
multigroup::ReactionCrossSections xs_;
multigroup::ScatteringMatrix scattering_;
multigroup::AverageFissionEnergyRelease release_;
multigroup::FissionNeutronMultiplicity nubar_prompt_;
multigroup::FissionNeutronMultiplicity nubar_delayed_;
multigroup::FissionNeutronMultiplicity nubar_total_;
multigroup::HeatingNumbers primary_heating_;
multigroup::Kerma primary_kerma_;
depletion::ReactionMultiplicities product_multiplicities_all_;
Expand Down Expand Up @@ -278,6 +283,9 @@ class MultigroupTable {
this->xs_.print( iter );
this->scattering_.print( iter );
this->release_.print( iter );
this->nubar_prompt_.print( iter );
this->nubar_delayed_.print( iter );
this->nubar_total_.print( iter );
this->primary_heating_.print( iter );
this->primary_kerma_.print( iter );
this->product_multiplicities_all_.print( iter );
Expand Down
6 changes: 5 additions & 1 deletion src/NDItk/MultigroupTable/src/ctor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
MultigroupTable() :
metadata_(), primary_structure_(),
velocities_(), weights_(), total_(), xs_(), scattering_(),
release_(), primary_heating_(), primary_kerma_(),
release_(),
nubar_prompt_( multigroup::FissionType::Prompt ),
nubar_delayed_( multigroup::FissionType::Delayed ),
nubar_total_( multigroup::FissionType::Total ),
primary_heating_(), primary_kerma_(),
product_multiplicities_all_( depletion::ReactionMultiplicityType::All ),
product_multiplicities_few_( depletion::ReactionMultiplicityType::Few ),
product_multiplicities_rmo_( depletion::ReactionMultiplicityType::RMO ),
Expand Down
42 changes: 42 additions & 0 deletions src/NDItk/MultigroupTable/src/read.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,48 @@ void read( Iterator& iter, const Iterator& end ) {

readRecord( this->release_, iter, end );
}
// prompt fission neutorn multiplicity
else if ( keyword == this->nubar_prompt_.keyword() ) {

if ( this->metadata_.numberGroups().has_value() ) {

readRecord( this->nubar_prompt_, iter, end, this->metadata_.numberGroups().value() );
}
else {

Log::error( "Metadata required for the \'\' record was not found", keyword );
Log::info( "Required metadata is missing: number of groups in the primary group structure" );
throw std::exception();
}
}
// delayed fission neutorn multiplicity
else if ( keyword == this->nubar_delayed_.keyword() ) {

if ( this->metadata_.numberGroups().has_value() ) {

readRecord( this->nubar_delayed_, iter, end, this->metadata_.numberGroups().value() );
}
else {

Log::error( "Metadata required for the \'\' record was not found", keyword );
Log::info( "Required metadata is missing: number of groups in the primary group structure" );
throw std::exception();
}
}
// total fission neutorn multiplicity
else if ( keyword == this->nubar_total_.keyword() ) {

if ( this->metadata_.numberGroups().has_value() ) {

readRecord( this->nubar_total_, iter, end, this->metadata_.numberGroups().value() );
}
else {

Log::error( "Metadata required for the \'\' record was not found", keyword );
Log::info( "Required metadata is missing: number of groups in the primary group structure" );
throw std::exception();
}
}
// primary and outgoing heating keyword
else if ( keyword.find( this->primary_heating_.keyword() ) == 0 ) {

Expand Down
10 changes: 5 additions & 5 deletions src/NDItk/MultigroupTable/src/verify.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ void verify() {
if ( types > 0 ) {

if ( ( this->outgoingParticleTypes().numberOutgoingParticles() != types ) ||
( this->outgoingParticleTransportData().numberOutgoingParticles() != types ) ||
( this->outgoing_structure_.size() != types ) ||
( this->outgoing_production_.size() != types ) ||
( this->outgoing_heating_.size() != types ) ||
( this->outgoing_kerma_.size() != types ) ) {
( ! this->outgoingParticleTransportData().empty() && this->outgoingParticleTransportData().numberOutgoingParticles() != types ) ||
( this->outgoing_structure_.size() && this->outgoing_structure_.size() != types ) ||
( this->outgoing_production_.size() && this->outgoing_production_.size() != types ) ||
( this->outgoing_heating_.size() && this->outgoing_heating_.size() != types ) ||
( this->outgoing_kerma_.size() && this->outgoing_kerma_.size() != types ) ) {

Log::error( "Found inconsistent number of outgoing particle types across the table" );
Log::info( "Number of outgoing particles in the metadata: {}",
Expand Down

0 comments on commit 0332067

Please sign in to comment.