diff --git a/source/branches/CLASSV3/include/CLASSBackEnd.hxx b/source/branches/CLASSV3/include/CLASSBackEnd.hxx index 20d1694a428faeb6723111772c990927803d5752..22f93623a93c1a7b2a6b8339ab150997382d4cb5 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 0000000000000000000000000000000000000000..92a9a374d8b142df777a2559c71caa244e420b44 --- /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 790dad54bf4be1bfeb5d7a72c367c9e72328b0b2..445518328bb77aad107ff93178af4bf1644dbdaf 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 4c33a63adc949c29db41e824067a8e55597427d0..6f2df54e325bba37f9a4c0479350d6d6bb409a88 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 6ecab70e686d04261de1f9c6295e9463775ac0ab..ec45b24a99e9ee27fcc98dbb7abb8b3445a1a68a 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 fce146aa42a499de77bf7c5d4e6a635587f604b0..cbc2048738fc1b5720dfbb1dcdf1697137c5a0a1 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 97c14af8c573399599fd9515d6901b9ce4623c1a..359f57a2d5258828a2dcebaa3ff5939bc1488101 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 d1fe94ed56fc95ab3a1101b252917b1aba63d581..6af195a65eeb6827e3fc52fda4e8ffc5ef6275ff 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 cb3ac37dac5849f932efd300f0fe2e2fce1fea30..8e1ef583b5c6f42e1256532ed05558ebcdb2f619 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 1fda8ea643e953ed499edb6e86ab5379a3fcbd9b..f243a91e5bc65ed309705fa63c3d661e8a8fa791 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 7cd5fa13754e6ffcce32894e1fc1242f25b6891e..c6cbbd0ca25835a12a3a9764cfa928b81b0dd156 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 6f665320a04776e45fc8421e2619f2056e0c7a18..380b37f152db7b90bc433280a6d92c27c90fff3f 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 f10b124b9f50d448ce732da5669875c8b43fa92e..80c7c0f0675f3c8cae81b2b5d28695e4e94b70b7 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 0200540078187bf08ddf11fbeef573b1004a0ad0..394b44ad599e89642394f49f0a1fa3aa425545d1 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 13609a192fc94a02539dcf4da22fa03eeeddc263..51599b896c9e0917ce0993523db6ad14d1854b41 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 edfd4f50f5685abff9bd473ce463507082a82679..6c8ad57b1e1bf849a87dc873d63a58062b11cf60 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 c1009068e01f380691ff33e1a19c750a764b9dbf..1ce7c45aa44b1b4185b3fe364973f959dd3f29c7 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 30ed8541b0362441755f3f7f85ef64d741b95fb8..351d854f428ee88c234e4ec8dd3ec952fd1bbdb1 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 6296a504754dd08cf8233d3432df29fa77cd9913..6470040b2ea175044ef0bc1efe6f43da54096210 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 580b8ca992a16098294f2a8f3fff77b629f9b5a7..a8fc20dcb0b6c7f9e472c3497fb4e607fa044aba 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 65d6b27dcdee1d1b08657c2f981b9b57e7d9c80e..c657ffff92bbca9e17f0d09855361d20e2a825f3 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 8a2aaa9d72d6176bf8ac1ac106a7e54a313a80b1..98fd52947bd5c245966fa01cbfe523cd7cd70606 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 4aae24441ac05155480fe2d25b3dcfcc8583b765..59a94275b4016e7a153db8c21a136b45da302043 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 187d5a28ca4b87451d86de9a90c6179aed46aaf8..621a7104cfad0268450f5de8d9807a30b0c931f7 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();