From e2f9083950d4774960014ca6f719f1045735767b Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot <mouginot.baptiste@gmail.com> Date: Mon, 7 Jul 2014 09:18:46 +0000 Subject: [PATCH] Correction in inclusion, adding a CLASSConstante CLASS (With Na and Masses) git-svn-id: svn+ssh://svn.in2p3.fr/class@300 0e7d625b-0364-4367-a6be-d5be4a48d228 --- .../branches/CLASSV3/include/CLASSBackEnd.hxx | 9 +++---- .../CLASSV3/include/CLASSConstante.hxx | 11 ++++++++ .../CLASSV3/include/CLASSFacility.hxx | 10 +++---- .../branches/CLASSV3/include/CLASSHeaders.hxx | 4 +-- .../CLASSV3/include/EvolutionData.hxx | 1 - source/branches/CLASSV3/include/ZAIMass.hxx | 1 + source/branches/CLASSV3/src/CLASSBackEnd.cxx | 6 ++--- source/branches/CLASSV3/src/CLASSFacility.cxx | 27 +++++++++++++++---- source/branches/CLASSV3/src/DecayDataBank.cxx | 1 - .../branches/CLASSV3/src/EQM_LIN_PWR_MOX.cxx | 3 ++- source/branches/CLASSV3/src/EvolutionData.cxx | 22 +++------------ .../branches/CLASSV3/src/FabricationPlant.cxx | 18 +++---------- source/branches/CLASSV3/src/IM_Matrix.cxx | 4 +-- source/branches/CLASSV3/src/IM_RK4.cxx | 6 ++--- .../branches/CLASSV3/src/IrradiationModel.cxx | 1 - .../branches/CLASSV3/src/IsotopicVector.cxx | 5 +--- .../CLASSV3/src/PWR_THPU_FabricationPlant.cxx | 19 ++++++------- .../CLASSV3/src/PWR_THU_FabricationPlant.cxx | 15 +++++------ source/branches/CLASSV3/src/Pool.cxx | 12 +++------ source/branches/CLASSV3/src/Reactor.cxx | 20 +++++--------- source/branches/CLASSV3/src/Scenario.cxx | 17 ++++++------ source/branches/CLASSV3/src/Storage.cxx | 10 +++---- source/branches/CLASSV3/src/ZAI.cxx | 2 -- source/branches/CLASSV3/src/ZAIMass.cxx | 12 +++++++-- 24 files changed, 109 insertions(+), 127 deletions(-) create mode 100644 source/branches/CLASSV3/include/CLASSConstante.hxx diff --git a/source/branches/CLASSV3/include/CLASSBackEnd.hxx b/source/branches/CLASSV3/include/CLASSBackEnd.hxx index 20d1694a4..22f93623a 100644 --- a/source/branches/CLASSV3/include/CLASSBackEnd.hxx +++ b/source/branches/CLASSV3/include/CLASSBackEnd.hxx @@ -19,6 +19,7 @@ #include "TNamed.h" using namespace std; + typedef long long int cSecond; //-----------------------------------------------------------------------------// @@ -33,15 +34,13 @@ typedef long long int cSecond; //________________________________________________________________________ - - class CLASSBackEnd : public CLASSFacility { public : ///< Normal Constructor. - CLASSBackEnd(); - CLASSBackEnd(LogFile* log); - CLASSBackEnd(LogFile* log, cSecond cycletime); + CLASSBackEnd(int type = 0); + CLASSBackEnd(LogFile* log,int type = 0); + CLASSBackEnd(LogFile* log, cSecond cycletime, int type = 0); //********* Get Method *********// /*! diff --git a/source/branches/CLASSV3/include/CLASSConstante.hxx b/source/branches/CLASSV3/include/CLASSConstante.hxx new file mode 100644 index 000000000..92a9a374d --- /dev/null +++ b/source/branches/CLASSV3/include/CLASSConstante.hxx @@ -0,0 +1,11 @@ +#ifndef _CLASSConstante_HXX_ +#define _CLASSConstante_HXX_ + +//CLASS library +#include "ZAIMass.hxx" + +const double AVOGADRO = 6.02214129e23; +const ZAIMass cZAIMass; + + +#endif diff --git a/source/branches/CLASSV3/include/CLASSFacility.hxx b/source/branches/CLASSV3/include/CLASSFacility.hxx index 790dad54b..445518328 100644 --- a/source/branches/CLASSV3/include/CLASSFacility.hxx +++ b/source/branches/CLASSV3/include/CLASSFacility.hxx @@ -40,11 +40,11 @@ class CLASSFacility : public CLASSObject { public : ///< Normal Constructor. - CLASSFacility(); - CLASSFacility(LogFile* log); - CLASSFacility(LogFile* log, cSecond cycletime); - CLASSFacility(LogFile* log, cSecond creationtime, cSecond lifetime); - CLASSFacility(LogFile* log, cSecond startingtime, cSecond lifetime, cSecond cycletime); + CLASSFacility(int type = 0); + CLASSFacility(LogFile* log, int type = 0); + CLASSFacility(LogFile* log, cSecond cycletime, int type = 0); + CLASSFacility(LogFile* log, cSecond creationtime, cSecond lifetime, int type = 0); + CLASSFacility(LogFile* log, cSecond startingtime, cSecond lifetime, cSecond cycletime, int type = 0); //********* Get Method *********// /*! diff --git a/source/branches/CLASSV3/include/CLASSHeaders.hxx b/source/branches/CLASSV3/include/CLASSHeaders.hxx index 4c33a63ad..6f2df54e3 100755 --- a/source/branches/CLASSV3/include/CLASSHeaders.hxx +++ b/source/branches/CLASSV3/include/CLASSHeaders.hxx @@ -5,9 +5,8 @@ //CLASS library +#include "CLASSConstante.hxx #include "Scenario.hxx" -#include "CLASSObject.hxx" -#include "CLASSFacility.hxx" #include "Reactor.hxx" #include "Pool.hxx" #include "FabricationPlant.hxx" @@ -19,7 +18,6 @@ #include "EvolutionData.hxx" #include "PhysicModels.hxx" #include "DecayDataBank.hxx" -#include "StringLine.hxx" #include "ZAIMass.hxx" diff --git a/source/branches/CLASSV3/include/EvolutionData.hxx b/source/branches/CLASSV3/include/EvolutionData.hxx index 6ecab70e6..ec45b24a9 100755 --- a/source/branches/CLASSV3/include/EvolutionData.hxx +++ b/source/branches/CLASSV3/include/EvolutionData.hxx @@ -225,7 +225,6 @@ protected : double fPower; ///< Power in W double fCycleTime; ///< Cycle time of the DataBase double fHeavyMetalMass; ///< Cycle time of the DataBase - double fNormFactor; ///< Normalisation factor needed to represent to full core (unsless) void OldReadDB(string DBfile); //!< Read old format database diff --git a/source/branches/CLASSV3/include/ZAIMass.hxx b/source/branches/CLASSV3/include/ZAIMass.hxx index fce146aa4..cbc204873 100644 --- a/source/branches/CLASSV3/include/ZAIMass.hxx +++ b/source/branches/CLASSV3/include/ZAIMass.hxx @@ -11,6 +11,7 @@ */ #include <map> + #include "ZAI.hxx" #include "TObject.h" #include <iostream> diff --git a/source/branches/CLASSV3/src/CLASSBackEnd.cxx b/source/branches/CLASSV3/src/CLASSBackEnd.cxx index 97c14af8c..359f57a2d 100644 --- a/source/branches/CLASSV3/src/CLASSBackEnd.cxx +++ b/source/branches/CLASSV3/src/CLASSBackEnd.cxx @@ -21,18 +21,18 @@ //________________________________________________________________________ ClassImp(CLASSBackEnd) -CLASSBackEnd::CLASSBackEnd():CLASSFacility() +CLASSBackEnd::CLASSBackEnd(int type):CLASSFacility(type) { fDecayDataBase = 0; } -CLASSBackEnd::CLASSBackEnd(LogFile* log):CLASSFacility(log) +CLASSBackEnd::CLASSBackEnd(LogFile* log, int type):CLASSFacility(log, type) { fDecayDataBase = 0; } -CLASSBackEnd::CLASSBackEnd(LogFile* log, cSecond cycletime):CLASSFacility(log, cycletime) +CLASSBackEnd::CLASSBackEnd(LogFile* log, cSecond cycletime, int type):CLASSFacility(log, cycletime, type) { fDecayDataBase = 0; } diff --git a/source/branches/CLASSV3/src/CLASSFacility.cxx b/source/branches/CLASSV3/src/CLASSFacility.cxx index d1fe94ed5..6af195a65 100644 --- a/source/branches/CLASSV3/src/CLASSFacility.cxx +++ b/source/branches/CLASSV3/src/CLASSFacility.cxx @@ -15,34 +15,48 @@ using namespace std; ClassImp(CLASSFacility) -CLASSFacility::CLASSFacility():CLASSObject() + + +CLASSFacility::CLASSFacility(int type):CLASSObject() { fParc = 0; + + fFacilityType = type; + fInternalTime = 0; fInCycleTime = 0; fCycleTime = -1; } -CLASSFacility::CLASSFacility(LogFile* log):CLASSObject(log) +CLASSFacility::CLASSFacility(LogFile* log, int type):CLASSObject(log) { fParc = 0; + + fFacilityType = type; + fInternalTime = 0; fInCycleTime = 0; fCycleTime = -1; } -CLASSFacility::CLASSFacility(LogFile* log, cSecond cycletime):CLASSObject(log) +CLASSFacility::CLASSFacility(LogFile* log, cSecond cycletime, int type):CLASSObject(log) { fParc = 0; + + fFacilityType = type; + fInternalTime = 0; fInCycleTime = 0; fCycleTime = cycletime; } -CLASSFacility::CLASSFacility(LogFile* log, cSecond creationtime, cSecond lifetime):CLASSObject(log) +CLASSFacility::CLASSFacility(LogFile* log, cSecond creationtime, cSecond lifetime, int type):CLASSObject(log) { fParc = 0; + + fFacilityType = type; + fInternalTime = 0; fInCycleTime = 0; fCycleTime = -1; @@ -50,9 +64,12 @@ CLASSFacility::CLASSFacility(LogFile* log, cSecond creationtime, cSecond lifetim fLifeTime = lifetime; } -CLASSFacility::CLASSFacility(LogFile* log, cSecond creationtime, cSecond lifetime, cSecond cycletime):CLASSObject(log) +CLASSFacility::CLASSFacility(LogFile* log, cSecond creationtime, cSecond lifetime, cSecond cycletime, int type):CLASSObject(log) { fParc = 0; + + fFacilityType = type; + fInternalTime = 0; fInCycleTime = 0; fCycleTime = cycletime; diff --git a/source/branches/CLASSV3/src/DecayDataBank.cxx b/source/branches/CLASSV3/src/DecayDataBank.cxx index cb3ac37da..8e1ef583b 100644 --- a/source/branches/CLASSV3/src/DecayDataBank.cxx +++ b/source/branches/CLASSV3/src/DecayDataBank.cxx @@ -1,7 +1,6 @@ #include "DecayDataBank.hxx" #include "IsotopicVector.hxx" -#include "CLASSHeaders.hxx" #include "LogFile.hxx" #include "StringLine.hxx" diff --git a/source/branches/CLASSV3/src/EQM_LIN_PWR_MOX.cxx b/source/branches/CLASSV3/src/EQM_LIN_PWR_MOX.cxx index 1fda8ea64..f243a91e5 100644 --- a/source/branches/CLASSV3/src/EQM_LIN_PWR_MOX.cxx +++ b/source/branches/CLASSV3/src/EQM_LIN_PWR_MOX.cxx @@ -1,11 +1,12 @@ #include "EQM_LIN_PWR_MOX.hxx" +#include "CLASSConstante.hxx" + #include <vector> #include "StringLine.hxx" #include "LogFile.hxx" #include "IsotopicVector.hxx" -#include "CLASSHeaders.hxx" diff --git a/source/branches/CLASSV3/src/EvolutionData.cxx b/source/branches/CLASSV3/src/EvolutionData.cxx index 7cd5fa137..c6cbbd0ca 100755 --- a/source/branches/CLASSV3/src/EvolutionData.cxx +++ b/source/branches/CLASSV3/src/EvolutionData.cxx @@ -1,8 +1,7 @@ #include "EvolutionData.hxx" -#include "CLASSHeaders.hxx" - #include "LogFile.hxx" +#include "CLASSConstante.hxx" #include "StringLine.hxx" #include <TGraph.h> @@ -349,7 +348,6 @@ EvolutionData::EvolutionData():CLASSObject() fIsCrossSection = false; fPower = 0; fCycleTime = 0; - fNormFactor = 1; fKeff = 0; fFlux = 0; } @@ -362,7 +360,6 @@ EvolutionData::EvolutionData(LogFile* Log) fIsCrossSection = false; fPower = 0; fCycleTime = 0; - fNormFactor = 1; fKeff = 0; fFlux = 0; @@ -378,7 +375,6 @@ EvolutionData::EvolutionData(LogFile* Log, string DB_file, bool oldread, ZAI zai fDB_file = DB_file; fPower = 0; fCycleTime = 0; - fNormFactor = 1; fKeff = 0; fFlux = 0; @@ -662,7 +658,6 @@ void EvolutionData::ReadDB(string DBfile, bool oldread) }while ( !DecayDB.eof() ); - double Na = 6.02214129e23; //N Avogadro double M = 0; { map<ZAI, double >::iterator it ; @@ -673,7 +668,7 @@ void EvolutionData::ReadDB(string DBfile, bool oldread) for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++ ) { - M += (*it).second*cZAIMass.fZAIMass.find( (*it).first )->second/Na*1e-6; + M += (*it).second*cZAIMass.fZAIMass.find( (*it).first )->second/AVOGADRO*1e-6; } isotopicquantity.clear(); @@ -771,7 +766,7 @@ void EvolutionData::ReadInv(string line, double* time, int NTimeStep) int i = 0; while(start < (int)line.size() && i < NTimeStep ) // Read the Data { - Inv[i] = atof(StringLine::NextWord(line, start, ' ').c_str())*fNormFactor ; + Inv[i] = atof(StringLine::NextWord(line, start, ' ').c_str()) ; i++; } // Add the TGraph @@ -926,17 +921,6 @@ void EvolutionData::ReadInfo() getline(InfoDB, line); if ( tlc(StringLine::NextWord(line, start, ' ')) == "constantpower") fPower = atof(StringLine::NextWord(line, start, ' ').c_str()); - - - getline(InfoDB, line); // cutoff - getline(InfoDB, line); // NUmber of Nuclei - start = 0; - getline(InfoDB, line); - if ( tlc(StringLine::NextWord(line, start, ' ')) == "normalizationfactor") - { - fNormFactor = atof(StringLine::NextWord(line, start, ' ').c_str()); - fPower = fPower * fNormFactor; - } InfoDB.close(); } diff --git a/source/branches/CLASSV3/src/FabricationPlant.cxx b/source/branches/CLASSV3/src/FabricationPlant.cxx index 6f665320a..380b37f15 100644 --- a/source/branches/CLASSV3/src/FabricationPlant.cxx +++ b/source/branches/CLASSV3/src/FabricationPlant.cxx @@ -7,8 +7,8 @@ #include "PhysicModels.hxx" #include "IsotopicVector.hxx" #include "Scenario.hxx" -#include "CLASSHeaders.hxx" #include "LogFile.hxx" +#include "CLASSConstante.hxx" @@ -32,29 +32,20 @@ // //________________________________________________________________________ //________________________________________________________________________ -template <class T> T random(T a, T b) //peak random numebr between a and b -{ - double range = pow(2., 31); - srand(time(NULL)); //initialize the srand - return (T)a + (T)(b-a)*rand()/range; -} - ClassImp(FabricationPlant) -FabricationPlant::FabricationPlant():CLASSFacility() +FabricationPlant::FabricationPlant():CLASSFacility(16) { - SetFacilityType(16); SetName("F_FabricationPLant."); fReUsable = 0; } -FabricationPlant::FabricationPlant(LogFile* log, double fabricationtime):CLASSFacility(log, fabricationtime) +FabricationPlant::FabricationPlant(LogFile* log, double fabricationtime):CLASSFacility(log, fabricationtime, 16) { - SetFacilityType(16); SetName("F_FabricationPLant."); fFiFo = false; @@ -415,12 +406,11 @@ void FabricationPlant::SetSubstitutionFuel(EvolutionData fuel) { fSubstitutionFuel = true; - double Na = 6.02214129e23; //N Avogadro map<ZAI ,double>::iterator it; map<ZAI ,double> isotopicquantity = fuel.GetIsotopicVectorAt(0.).GetActinidesComposition().GetIsotopicQuantity(); double M0 = 0; for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++ ) - M0 += (*it).second*cZAIMass.fZAIMass.find( (*it).first )->second/Na*1e-6; + M0 += (*it).second*cZAIMass.fZAIMass.find( (*it).first )->second/AVOGADRO*1e-6; fSubstitutionEvolutionData = fuel / M0; } diff --git a/source/branches/CLASSV3/src/IM_Matrix.cxx b/source/branches/CLASSV3/src/IM_Matrix.cxx index f10b124b9..80c7c0f06 100644 --- a/source/branches/CLASSV3/src/IM_Matrix.cxx +++ b/source/branches/CLASSV3/src/IM_Matrix.cxx @@ -9,7 +9,6 @@ #include "IM_Matrix.hxx" #include "IsotopicVector.hxx" -#include "CLASSHeaders.hxx" #include "LogFile.hxx" #include "StringLine.hxx" @@ -99,7 +98,6 @@ EvolutionData IM_Matrix::GenerateEvolutionData(IsotopicVector isotopicvector, Ev //-------------------------// ReactorType = XSSet.GetReactorType(); - double Na = 6.02214129e23; //N Avogadro double M_ref = XSSet.GetHeavyMetalMass(); double M = 0; double Power_ref = XSSet.GetPower(); @@ -113,7 +111,7 @@ EvolutionData IM_Matrix::GenerateEvolutionData(IsotopicVector isotopicvector, Ev map<ZAI, double >isotopicquantity = IVtmp.GetIsotopicQuantity(); for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++ ) - M += isotopicvector.GetActinidesComposition().GetZAIIsotopicQuantity( (*it).first )*cZAIMass.fZAIMass.find( (*it).first )->second/Na*1e-6; + M += isotopicvector.GetActinidesComposition().GetZAIIsotopicQuantity( (*it).first )*cZAIMass.fZAIMass.find( (*it).first )->second/AVOGADRO*1e-6; isotopicquantity.clear(); } diff --git a/source/branches/CLASSV3/src/IM_RK4.cxx b/source/branches/CLASSV3/src/IM_RK4.cxx index 020054007..394b44ad5 100644 --- a/source/branches/CLASSV3/src/IM_RK4.cxx +++ b/source/branches/CLASSV3/src/IM_RK4.cxx @@ -9,8 +9,9 @@ #include "IM_RK4.hxx" #include "IsotopicVector.hxx" -#include "CLASSHeaders.hxx" +#include "CLASSConstante.hxx" #include "LogFile.hxx" + #include "StringLine.hxx" #include <TGraph.h> @@ -115,7 +116,6 @@ EvolutionData IM_RK4::GenerateEvolutionData(IsotopicVector isotopicvector, Evolu //-------------------------// ReactorType = XSSet.GetReactorType(); - double Na = 6.02214129e23; //N Avogadro double M_ref = XSSet.GetHeavyMetalMass(); double M = 0; double Power_ref = XSSet.GetPower(); @@ -129,7 +129,7 @@ EvolutionData IM_RK4::GenerateEvolutionData(IsotopicVector isotopicvector, Evolu map<ZAI, double >isotopicquantity = IVtmp.GetIsotopicQuantity(); for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++ ) - M += isotopicvector.GetActinidesComposition().GetZAIIsotopicQuantity( (*it).first )*cZAIMass.fZAIMass.find( (*it).first )->second/Na*1e-6; + M += isotopicvector.GetActinidesComposition().GetZAIIsotopicQuantity( (*it).first )*cZAIMass.fZAIMass.find( (*it).first )->second/AVOGADRO*1e-6; isotopicquantity.clear(); } diff --git a/source/branches/CLASSV3/src/IrradiationModel.cxx b/source/branches/CLASSV3/src/IrradiationModel.cxx index 13609a192..51599b896 100644 --- a/source/branches/CLASSV3/src/IrradiationModel.cxx +++ b/source/branches/CLASSV3/src/IrradiationModel.cxx @@ -9,7 +9,6 @@ #include "IrradiationModel.hxx" #include "IsotopicVector.hxx" -#include "CLASSHeaders.hxx" #include "LogFile.hxx" #include "StringLine.hxx" diff --git a/source/branches/CLASSV3/src/IsotopicVector.cxx b/source/branches/CLASSV3/src/IsotopicVector.cxx index edfd4f50f..6c8ad57b1 100755 --- a/source/branches/CLASSV3/src/IsotopicVector.cxx +++ b/source/branches/CLASSV3/src/IsotopicVector.cxx @@ -1,6 +1,7 @@ #include "IsotopicVector.hxx" #include "LogFile.hxx" +#include "CLASSConstante.hxx" #include <cmath> @@ -8,7 +9,6 @@ #include <fstream> #include <string> #include <algorithm> -#include "CLASSHeaders.hxx" //________________________________________________________________________ //________________________________________________________________________ // @@ -518,10 +518,7 @@ double IsotopicVector::GetTotalMass() const double IsotopicVector::MeanMolar() const { - double AVOGADRO = 6.02214129e23; - return GetTotalMass() * 1e6 * AVOGADRO / GetActinidesComposition().GetSumOfAll(); - } //________________________________________________________________________ diff --git a/source/branches/CLASSV3/src/PWR_THPU_FabricationPlant.cxx b/source/branches/CLASSV3/src/PWR_THPU_FabricationPlant.cxx index c1009068e..1ce7c45aa 100644 --- a/source/branches/CLASSV3/src/PWR_THPU_FabricationPlant.cxx +++ b/source/branches/CLASSV3/src/PWR_THPU_FabricationPlant.cxx @@ -1,4 +1,6 @@ #include "PWR_THPU_FabricationPlant.hxx" + + #include "Storage.hxx" #include "Reactor.hxx" #include "EvolutionData.hxx" @@ -6,12 +8,8 @@ #include "DecayDataBank.hxx" #include "IsotopicVector.hxx" #include "Scenario.hxx" -#include "CLASSHeaders.hxx" #include "LogFile.hxx" - - - #include "TMatrixT.h" #include <sstream> @@ -121,7 +119,6 @@ void PWR_THPU_FabricationPlant::BuildFuelForReactor(int ReactorId) GetLog()->fLog << "!!Bad Trouble!! !!!FabricationPlant!!! Try to do MOX with a not MOXed DB" << endl; exit (1); } - double Na = 6.02214129e23; //N Avogadro double HMmass = GetParc()->GetReactor()[ReactorId]->GetHeavyMetalMass(); @@ -143,7 +140,7 @@ void PWR_THPU_FabricationPlant::BuildFuelForReactor(int ReactorId) isotopicquantity = FullUsedStock.GetSpeciesComposition(94).GetIsotopicQuantity(); for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++ ) - MPu_0 += (*it).second*cZAIMass.fZAIMass.find( (*it).first )->second/Na*1e-6; + MPu_0 += (*it).second*cZAIMass.fZAIMass.find( (*it).first )->second/AVOGADRO*1e-6; } stock = GetStockToRecycle(); @@ -210,7 +207,7 @@ void PWR_THPU_FabricationPlant::BuildFuelForReactor(int ReactorId) for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++ ) if ((*it).first.A() >= 238 && (*it).first.A() <= 242) { - MPu_1 += (*it).second * (cZAIMass.fZAIMass.find( (*it).first )->second)/Na*1e-6; + MPu_1 += (*it).second * (cZAIMass.fZAIMass.find( (*it).first )->second)/AVOGADRO*1e-6; } isotopicquantity = GetDecay( FullUsedStock , GetCycleTime()).GetSpeciesComposition(94).GetIsotopicQuantity(); @@ -224,14 +221,14 @@ void PWR_THPU_FabricationPlant::BuildFuelForReactor(int ReactorId) //cout<<"TEST TEST TEST TEST TEST MPu_1 : "<<MPu_1<<endl; double StockFactionToUse = 0; - double NT = HMmass*1e6 * Na / (cZAIMass.fZAIMass.find( ZAI(90,232,0) )->second); + double NT = HMmass*1e6 * AVOGADRO / (cZAIMass.fZAIMass.find( ZAI(90,232,0) )->second); double N1 = (BU - FuelType->GetFuelParameter()[6]) * NT; double N2 = -Sum_AlphaI_nPuI0; - double N3 = -FuelType->GetFuelParameter()[0] * Na / (cZAIMass.fZAIMass.find( ZAI(90,232,0) )->second) * (HMmass*1e6 - MPu_0*1e6); + double N3 = -FuelType->GetFuelParameter()[0] * AVOGADRO / (cZAIMass.fZAIMass.find( ZAI(90,232,0) )->second) * (HMmass*1e6 - MPu_0*1e6); double D1 = Sum_AlphaI_nPuI; - double D2 = -FuelType->GetFuelParameter()[0] * MPu_1*1e6 * Na / (cZAIMass.fZAIMass.find( ZAI(90,232,0) )->second) ; + double D2 = -FuelType->GetFuelParameter()[0] * MPu_1*1e6 * AVOGADRO / (cZAIMass.fZAIMass.find( ZAI(90,232,0) )->second) ; StockFactionToUse = (N1 + N2 + N3) / (D1 + D2); @@ -265,7 +262,7 @@ void PWR_THPU_FabricationPlant::BuildFuelForReactor(int ReactorId) //cout<<"TEST TEST TEST TEST TEST HMmass : "<<HMmass <<endl; //cout<<"TEST TEST TEST TEST TEST MPu_0 : "<<MPu_0<<endl; //cout<<"TEST TEST TEST TEST TEST StockFactionToUse*MPu_1 : "<<StockFactionToUse<<"*"<<MPu_1<<endl; - double Th_Quantity = (HMmass - (MPu_0+StockFactionToUse*MPu_1 ))/(cZAIMass.fZAIMass.find( ZAI(90,232,0) )->second)*Na/1e-6; + double Th_Quantity = (HMmass - (MPu_0+StockFactionToUse*MPu_1 ))/(cZAIMass.fZAIMass.find( ZAI(90,232,0) )->second)*AVOGADRO/1e-6; GetParc()->AddGodIncome(Th, Th_Quantity); diff --git a/source/branches/CLASSV3/src/PWR_THU_FabricationPlant.cxx b/source/branches/CLASSV3/src/PWR_THU_FabricationPlant.cxx index 30ed8541b..351d854f4 100644 --- a/source/branches/CLASSV3/src/PWR_THU_FabricationPlant.cxx +++ b/source/branches/CLASSV3/src/PWR_THU_FabricationPlant.cxx @@ -1,4 +1,5 @@ #include "PWR_THU_FabricationPlant.hxx" + #include "Storage.hxx" #include "Reactor.hxx" #include "EvolutionData.hxx" @@ -6,7 +7,6 @@ #include "DecayDataBank.hxx" #include "IsotopicVector.hxx" #include "Scenario.hxx" -#include "CLASSHeaders.hxx" #include "LogFile.hxx" @@ -119,7 +119,6 @@ void PWR_THU_FabricationPlant::BuildFuelForReactor(int ReactorId) GetLog()->fLog << "!!Bad Trouble!! !!!FabricationPlant!!! Try to do MOX with a not MOXed DB" << endl; exit (1); } - double Na = 6.02214129e23; //N Avogadro double HMmass = GetParc()->GetReactor()[ReactorId]->GetHeavyMetalMass(); double BU = GetParc()->GetReactor()[ReactorId]->GetBurnUp(); @@ -140,7 +139,7 @@ void PWR_THU_FabricationPlant::BuildFuelForReactor(int ReactorId) isotopicquantity = FullUsedStock.GetSpeciesComposition(92).GetIsotopicQuantity(); for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++ ) - MU_0 += (*it).second*cZAIMass.fZAIMass.find( (*it).first )->second/Na*1e-6; + MU_0 += (*it).second*cZAIMass.fZAIMass.find( (*it).first )->second/AVOGADRO*1e-6; } stock = GetStockToRecycle(); @@ -207,7 +206,7 @@ void PWR_THU_FabricationPlant::BuildFuelForReactor(int ReactorId) for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++ ) if ((*it).first.A() >= 232 && (*it).first.A() <= 236) { - MU_1 += (*it).second * (cZAIMass.fZAIMass.find( (*it).first )->second)/Na*1e-6; + MU_1 += (*it).second * (cZAIMass.fZAIMass.find( (*it).first )->second)/AVOGADRO*1e-6; } isotopicquantity = GetDecay( FullUsedStock , GetCycleTime()).GetSpeciesComposition(92).GetIsotopicQuantity(); @@ -220,14 +219,14 @@ void PWR_THU_FabricationPlant::BuildFuelForReactor(int ReactorId) double StockFactionToUse = 0; - double NT = HMmass*1e6 * Na / (cZAIMass.fZAIMass.find( ZAI(90,232,0) )->second); + double NT = HMmass*1e6 * AVOGADRO / (cZAIMass.fZAIMass.find( ZAI(90,232,0) )->second); double N1 = (BU - FuelType->GetFuelParameter()[6]) * NT; double N2 = -Sum_AlphaI_nUI0; - double N3 = -FuelType->GetFuelParameter()[0] * Na / (cZAIMass.fZAIMass.find( ZAI(90,232,0) )->second) * (HMmass*1e6 - MU_0*1e6); + double N3 = -FuelType->GetFuelParameter()[0] * AVOGADRO / (cZAIMass.fZAIMass.find( ZAI(90,232,0) )->second) * (HMmass*1e6 - MU_0*1e6); double D1 = Sum_AlphaI_nUI; - double D2 = -FuelType->GetFuelParameter()[0] * MU_1*1e6 * Na / (cZAIMass.fZAIMass.find( ZAI(90,232,0) )->second) ; + double D2 = -FuelType->GetFuelParameter()[0] * MU_1*1e6 * AVOGADRO / (cZAIMass.fZAIMass.find( ZAI(90,232,0) )->second) ; StockFactionToUse = (N1 + N2 + N3) / (D1 + D2); @@ -261,7 +260,7 @@ void PWR_THU_FabricationPlant::BuildFuelForReactor(int ReactorId) //cout<<"TEST TEST TEST TEST TEST HMmass : "<<HMmass <<endl; //cout<<"TEST TEST TEST TEST TEST MU_0 : "<<MU_0<<endl; //cout<<"TEST TEST TEST TEST TEST StockFactionToUse*MU_1 : "<<StockFactionToUse<<"*"<<MU_1<<endl; - double Th_Quantity = (HMmass - (MU_0+StockFactionToUse*MU_1 ))/(cZAIMass.fZAIMass.find( ZAI(90,232,0) )->second)*Na/1e-6; + double Th_Quantity = (HMmass - (MU_0+StockFactionToUse*MU_1 ))/(cZAIMass.fZAIMass.find( ZAI(90,232,0) )->second)*AVOGADRO/1e-6; GetParc()->AddGodIncome( Th, Th_Quantity); diff --git a/source/branches/CLASSV3/src/Pool.cxx b/source/branches/CLASSV3/src/Pool.cxx index 6296a5047..6470040b2 100755 --- a/source/branches/CLASSV3/src/Pool.cxx +++ b/source/branches/CLASSV3/src/Pool.cxx @@ -1,6 +1,5 @@ #include "Pool.hxx" -#include "DecayDataBank.hxx" #include "IsotopicVector.hxx" #include "Storage.hxx" #include "Scenario.hxx" @@ -22,18 +21,17 @@ //________________________________________________________________________ ClassImp(Pool) -Pool::Pool():CLASSBackEnd() + +Pool::Pool():CLASSBackEnd(8) { fOutBackEndFacility = 0; - SetFacilityType(8); SetName("P_Pool."); } //________________________________________________________________________ -Pool::Pool(LogFile* log, cSecond coolingtime):CLASSBackEnd(log, coolingtime) +Pool::Pool(LogFile* log, cSecond coolingtime):CLASSBackEnd(log, coolingtime, 8) { - SetFacilityType(8); fCycleTime = (cSecond)coolingtime; fIsStarted = false; @@ -58,11 +56,9 @@ Pool::Pool(LogFile* log, cSecond coolingtime):CLASSBackEnd(log, coolingtime) } //________________________________________________________________________ -Pool::Pool(LogFile* log, CLASSBackEnd* storage, cSecond coolingtime):CLASSBackEnd(log, coolingtime) +Pool::Pool(LogFile* log, CLASSBackEnd* storage, cSecond coolingtime):CLASSBackEnd(log, coolingtime, 8) { - SetFacilityType(8); - fOutBackEndFacility = storage; SetIsStorageType(false); diff --git a/source/branches/CLASSV3/src/Reactor.cxx b/source/branches/CLASSV3/src/Reactor.cxx index 580b8ca99..a8fc20dcb 100755 --- a/source/branches/CLASSV3/src/Reactor.cxx +++ b/source/branches/CLASSV3/src/Reactor.cxx @@ -6,7 +6,7 @@ #include "FabricationPlant.hxx" #include "Storage.hxx" #include "Scenario.hxx" -#include "CLASSHeaders.hxx" +#include "CLASSConstante.hxx" #include "LogFile.hxx" @@ -59,10 +59,9 @@ Reactor::Reactor(LogFile* log):CLASSFacility(log) Reactor::Reactor(LogFile* log, PhysicModels* fueltypeDB, FabricationPlant* fabricationplant, CLASSBackEnd* Pool, - cSecond creationtime, cSecond lifetime):CLASSFacility(log, creationtime, lifetime) + cSecond creationtime, cSecond lifetime):CLASSFacility(log, creationtime, lifetime, 4) { - SetFacilityType(4); SetName("R_Reactor."); @@ -101,9 +100,8 @@ Reactor::Reactor(LogFile* log, PhysicModels* fueltypeDB, Reactor::Reactor(LogFile* log, PhysicModels* fueltypeDB, FabricationPlant* fabricationplant, CLASSBackEnd* Pool, cSecond creationtime, cSecond lifetime, - double Power, double HMMass, double BurnUp, double ChargeFactor):CLASSFacility(log, creationtime, lifetime) + double Power, double HMMass, double BurnUp, double ChargeFactor):CLASSFacility(log, creationtime, lifetime, 4) { - SetFacilityType(4); SetName("R_Reactor."); @@ -154,9 +152,8 @@ Reactor::Reactor(LogFile* log, PhysicModels* fueltypeDB, FabricationPlant* fabricationplant, CLASSBackEnd* Pool, cSecond creationtime, cSecond lifetime, cSecond cycletime, - double HMMass, double BurnUp):CLASSFacility(log, creationtime, lifetime, cycletime) + double HMMass, double BurnUp):CLASSFacility(log, creationtime, lifetime, cycletime, 4) { - SetFacilityType(4); SetName("R_Reactor."); @@ -206,9 +203,8 @@ Reactor::Reactor(LogFile* log, EvolutionData evolutivedb, CLASSBackEnd* Pool, cSecond creationtime, cSecond lifetime, - double power, double HMMass, double BurnUp, double ChargeFactor ):CLASSFacility(log, creationtime, lifetime) + double power, double HMMass, double BurnUp, double ChargeFactor ):CLASSFacility(log, creationtime, lifetime, 4) { - SetFacilityType(4); SetName("R_Reactor."); @@ -229,12 +225,11 @@ Reactor::Reactor(LogFile* log, EvolutionData evolutivedb, fHeavyMetalMass = HMMass; - double Na = 6.02214129e23; //N Avogadro map<ZAI ,double>::iterator it; map<ZAI ,double> isotopicquantity = evolutivedb.GetIsotopicVectorAt(0.).GetActinidesComposition().GetIsotopicQuantity(); double M0 = 0; for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++ ) - M0 += (*it).second*cZAIMass.fZAIMass.find( (*it).first )->second/Na*1e-6; + M0 += (*it).second*cZAIMass.fZAIMass.find( (*it).first )->second/AVOGADRO*1e-6; fEvolutionDB = evolutivedb * (fHeavyMetalMass/M0); @@ -325,12 +320,11 @@ void Reactor::SetBurnUp(double BU) //________________________________________________________________________ void Reactor::SetEvolutionDB(EvolutionData evolutionDB) { - double Na = 6.02214129e23; //N Avogadro map<ZAI ,double>::iterator it; map<ZAI ,double> isotopicquantity = evolutionDB.GetIsotopicVectorAt(0.).GetActinidesComposition().GetIsotopicQuantity(); double M0 = 0; for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++ ) - M0 += (*it).second*cZAIMass.fZAIMass.find( (*it).first )->second/Na*1e-6; + M0 += (*it).second*cZAIMass.fZAIMass.find( (*it).first )->second/AVOGADRO*1e-6; fEvolutionDB = evolutionDB * (fHeavyMetalMass/M0); fIVOutCycle = fEvolutionDB.GetIsotopicVectorAt( (cSecond)(fCycleTime/fEvolutionDB.GetPower()*fPower) ); diff --git a/source/branches/CLASSV3/src/Scenario.cxx b/source/branches/CLASSV3/src/Scenario.cxx index 65d6b27dc..c657ffff9 100755 --- a/source/branches/CLASSV3/src/Scenario.cxx +++ b/source/branches/CLASSV3/src/Scenario.cxx @@ -1,13 +1,5 @@ #include "Scenario.hxx" -#include "Storage.hxx" -#include "Reactor.hxx" -#include "CLASSBackEnd.hxx" -#include "Pool.hxx" -#include "FabricationPlant.hxx" -#include "LogFile.hxx" - - #include <ctime> #include "time.h" #include <cmath> @@ -16,6 +8,15 @@ #include <sstream> #include <algorithm> #include <omp.h> +#include "stdlib.h" + +#include "Storage.hxx" +#include "Reactor.hxx" +#include "CLASSBackEnd.hxx" +#include "Pool.hxx" +#include "FabricationPlant.hxx" +#include "LogFile.hxx" + //________________________________________________________________________ // diff --git a/source/branches/CLASSV3/src/Storage.cxx b/source/branches/CLASSV3/src/Storage.cxx index 8a2aaa9d7..98fd52947 100644 --- a/source/branches/CLASSV3/src/Storage.cxx +++ b/source/branches/CLASSV3/src/Storage.cxx @@ -1,6 +1,5 @@ #include "Storage.hxx" -#include "DecayDataBank.hxx" #include "Scenario.hxx" #include "LogFile.hxx" @@ -21,17 +20,15 @@ //________________________________________________________________________ ClassImp(Storage) -Storage::Storage():CLASSBackEnd() +Storage::Storage():CLASSBackEnd(-1) { - SetFacilityType(-1); SetIsStorageType(); SetName("S_Storage."); } -Storage::Storage(LogFile* log):CLASSBackEnd(log) +Storage::Storage(LogFile* log):CLASSBackEnd(log, -1) { - SetFacilityType(-1); SetIsStorageType(); SetName("S_Storage."); @@ -42,9 +39,8 @@ Storage::Storage(LogFile* log):CLASSBackEnd(log) } //________________________________________________________________________ -Storage::Storage(LogFile* log, DecayDataBank* evolutivedb):CLASSBackEnd(log) +Storage::Storage(LogFile* log, DecayDataBank* evolutivedb):CLASSBackEnd(log, -1) { - SetFacilityType(-1); SetIsStorageType(); SetDecayDataBank(evolutivedb); diff --git a/source/branches/CLASSV3/src/ZAI.cxx b/source/branches/CLASSV3/src/ZAI.cxx index 4aae24441..59a94275b 100755 --- a/source/branches/CLASSV3/src/ZAI.cxx +++ b/source/branches/CLASSV3/src/ZAI.cxx @@ -1,6 +1,4 @@ #include "ZAI.hxx" -#include "CLASSHeaders.hxx" - //const string DEFAULTDATABASE = "DecayBase.dat"; //________________________________________________________________________ diff --git a/source/branches/CLASSV3/src/ZAIMass.cxx b/source/branches/CLASSV3/src/ZAIMass.cxx index 187d5a28c..621a7104c 100644 --- a/source/branches/CLASSV3/src/ZAIMass.cxx +++ b/source/branches/CLASSV3/src/ZAIMass.cxx @@ -1,5 +1,12 @@ #include "ZAIMass.hxx" -#include "CLASSHeaders.hxx" + +#include "CLASSConstante.hxx" + +#include "stdlib.h" +#include <fstream> +#include <string> + +#include "IsotopicVector.hxx" //________________________________________________________________________ // // ZAI @@ -16,7 +23,9 @@ ZAIMass::ZAIMass() { string CLASSPATH = getenv("CLASS_PATH"); string MassDataFile = CLASSPATH +"/source/data/Mass.dat"; + ifstream infile(MassDataFile.c_str()); + if(!infile.good()) { cout<<"ZAIMass Error.\n can't find/open file "<<MassDataFile<<endl; @@ -60,7 +69,6 @@ double ZAIMass::GetMass(const IsotopicVector IV) const { double TotalMass = 0; - double AVOGADRO=6.02214129e23; map<ZAI ,double >::iterator it; map<ZAI ,double > isotopicquantity = IV.GetIsotopicQuantity(); -- GitLab