From 0332067e832ce1865ac0e78a320a3452d8221011 Mon Sep 17 00:00:00 2001 From: Wim Haeck Date: Tue, 4 Jun 2024 20:01:01 -0600 Subject: [PATCH] Adding the nubar data to the MultigroupTable --- src/NDItk/MultigroupTable.hpp | 8 +++++ src/NDItk/MultigroupTable/src/ctor.hpp | 6 +++- src/NDItk/MultigroupTable/src/read.hpp | 42 ++++++++++++++++++++++++ src/NDItk/MultigroupTable/src/verify.hpp | 10 +++--- 4 files changed, 60 insertions(+), 6 deletions(-) diff --git a/src/NDItk/MultigroupTable.hpp b/src/NDItk/MultigroupTable.hpp index 29ea86c..a6d2740 100644 --- a/src/NDItk/MultigroupTable.hpp +++ b/src/NDItk/MultigroupTable.hpp @@ -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" @@ -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_; @@ -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 ); diff --git a/src/NDItk/MultigroupTable/src/ctor.hpp b/src/NDItk/MultigroupTable/src/ctor.hpp index d754ffd..15b20d8 100644 --- a/src/NDItk/MultigroupTable/src/ctor.hpp +++ b/src/NDItk/MultigroupTable/src/ctor.hpp @@ -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 ), diff --git a/src/NDItk/MultigroupTable/src/read.hpp b/src/NDItk/MultigroupTable/src/read.hpp index 7766c9c..be38d0d 100644 --- a/src/NDItk/MultigroupTable/src/read.hpp +++ b/src/NDItk/MultigroupTable/src/read.hpp @@ -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 ) { diff --git a/src/NDItk/MultigroupTable/src/verify.hpp b/src/NDItk/MultigroupTable/src/verify.hpp index cbfc45d..a26b766 100644 --- a/src/NDItk/MultigroupTable/src/verify.hpp +++ b/src/NDItk/MultigroupTable/src/verify.hpp @@ -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: {}",