diff --git a/source/branches/CLASSV3/include/CLASSFuel.hxx b/source/branches/CLASSV3/include/CLASSFuel.hxx index 1ae1fce9dcdd27da87ea47df6290e643401cf29f..98d320fa6e13c3e40c4ea5e76678437ab5054906 100644 --- a/source/branches/CLASSV3/include/CLASSFuel.hxx +++ b/source/branches/CLASSV3/include/CLASSFuel.hxx @@ -16,11 +16,11 @@ #include <fstream> #include "CLASSObject.hxx" +#include "PhysicsModels.hxx" +#include "EvolutionData.hxx" using namespace std; -class EvolutionData; -class PhysicsModels; //-----------------------------------------------------------------------------// /*! Define a CLASS Object. @@ -38,15 +38,15 @@ class CLASSFuel : public CLASSObject { public : ///< Normal Constructor. - CLASSFuel(); - CLASSFuel(CLASSLogger* log); + CLASSFuel(EvolutionData* evo); + CLASSFuel(PhysicsModels* evo); virtual CLASSFuel* Clone() { return new CLASSFuel(*this); } //!< Correct way to copy a CLASSFuel in case of derivation - virtual EvolutionData* GetEvolutionData() {return 0;} - virtual PhysicsModels* GetPhysicsModels() {return 0;} + EvolutionData* GetEvolutionData() {return fEvolutionData;} + PhysicsModels* GetPhysicsModels() {return fPhysicsModels;} using CLASSObject::SetName; using CLASSObject::GetName; protected : @@ -54,6 +54,8 @@ class CLASSFuel : public CLASSObject private : + EvolutionData* fEvolutionData; + PhysicsModels* fPhysicsModels; }; #endif diff --git a/source/branches/CLASSV3/include/CLASSFuelPlan.hxx b/source/branches/CLASSV3/include/CLASSFuelPlan.hxx index 89b81c7d07454369e5e3e7e389ac8036ba45f6d3..81b8d721b0afd72d15c091dd514592a7b6efcdfa 100644 --- a/source/branches/CLASSV3/include/CLASSFuelPlan.hxx +++ b/source/branches/CLASSV3/include/CLASSFuelPlan.hxx @@ -44,6 +44,8 @@ class CLASSFuelPlan : public CLASSObject CLASSFuelPlan(CLASSLogger* log); void AddFuel(cSecond time, CLASSFuel fuel, double BurnUp); + void AddFuel(cSecond time, EvolutionData* fuel, double BurnUp) {AddFuel( time, CLASSFuel(fuel), BurnUp);} + void AddFuel(cSecond time, PhysicsModels* fuel, double BurnUp) {AddFuel( time, CLASSFuel(fuel), BurnUp);} pair< CLASSFuel, double> GetFuelAt(cSecond t); diff --git a/source/branches/CLASSV3/include/EquivalenceModel.hxx b/source/branches/CLASSV3/include/EquivalenceModel.hxx index 12dda4888af347525d187cabc6af642f687d213a..1a5086dd78d969e7f3adab380749a3a6ecfe2b56 100644 --- a/source/branches/CLASSV3/include/EquivalenceModel.hxx +++ b/source/branches/CLASSV3/include/EquivalenceModel.hxx @@ -46,7 +46,7 @@ class EquivalenceModel : public CLASSObject \param double HMMass, needed Heavy metal mass needed \param vector<double> &lambda, fraction of the stock to take (initialy should be 0) \param vector<IsotopicVector> FissilArray, isotopicvectors to use to get the fissil part of the fuel - \param vector<IsotopicVector> FertilArray, isotopicvectors to use to get the fertil part of the fuel (if empty take it from the god) + \param vector<IsotopicVector> FertilArray, isotopicvectors to use to get the fertil part of the fuel (if empty take it from the OutIncome) */ virtual vector<double> BuildFuel(double BurnUp, double HMMass, vector<IsotopicVector> FissilArray, vector<IsotopicVector> FertilArray ); diff --git a/source/branches/CLASSV3/include/EvolutionData.hxx b/source/branches/CLASSV3/include/EvolutionData.hxx index 2e0c29cced137db5d66f6ec4b781d41d24306c5e..b7e15aadebeb2f178cf4cbbc1ce4071bff26da48 100755 --- a/source/branches/CLASSV3/include/EvolutionData.hxx +++ b/source/branches/CLASSV3/include/EvolutionData.hxx @@ -11,7 +11,7 @@ #include <map> #include "IsotopicVector.hxx" -#include "CLASSFuel.hxx" +#include "CLASSObject.hxx" #include "ZAI.hxx" #include "TMatrix.h" @@ -49,7 +49,7 @@ double Distance(EvolutionData Evd1, IsotopicVector IV1 ); -class EvolutionData : public CLASSFuel +class EvolutionData : public CLASSObject { public : @@ -142,7 +142,6 @@ public : //@{ #ifndef __CINT__ - EvolutionData* GetEvolutionData() {return this;} map<ZAI ,TGraph* > GetInventoryEvolution() const { return fInventoryEvolution; } //!< return the EvolutionData map map<ZAI ,TGraph* > GetFissionXS() const { return fFissionXS; } //!< return the fission cross section map map<ZAI ,TGraph* > GetCaptureXS() const { return fCaptureXS; } //!< return the capture cross section map diff --git a/source/branches/CLASSV3/include/PhysicsModels.hxx b/source/branches/CLASSV3/include/PhysicsModels.hxx index a9d968ef7a621ac592dcca355b59cb0a1b96e7d4..d5a4e5a0063eadd5c2d21bf795c9fd56b7632bfb 100644 --- a/source/branches/CLASSV3/include/PhysicsModels.hxx +++ b/source/branches/CLASSV3/include/PhysicsModels.hxx @@ -11,7 +11,6 @@ @authors BLG,BaM @version 1.0 */ -#include "CLASSFuel.hxx" #include "EquivalenceModel.hxx" #include "XSModel.hxx" #include "IrradiationModel.hxx" @@ -42,7 +41,7 @@ typedef long long int cSecond; //________________________________________________________________________ -class PhysicsModels : public CLASSFuel +class PhysicsModels : public CLASSObject { public : diff --git a/source/branches/CLASSV3/include/Reactor.hxx b/source/branches/CLASSV3/include/Reactor.hxx index ef488055924ba463e34dee2416faf8b4a400483f..c0d6423f9286135d68508e2f35ae0e84cd16a4cb 100755 --- a/source/branches/CLASSV3/include/Reactor.hxx +++ b/source/branches/CLASSV3/include/Reactor.hxx @@ -75,7 +75,7 @@ public : */ Reactor(CLASSLogger* log, CLASSBackEnd* Pool, cSecond creationtime , cSecond lifetime, double Power, - double HMMass, double ChargeFactor = 1); + double HMMass, double CapacityFactor = 1); //} //{ @@ -93,7 +93,7 @@ public : Reactor(CLASSLogger* log, FabricationPlant* fabricationplant, CLASSBackEnd* Pool, cSecond creationtime , cSecond lifetime, double Power, - double HMMass, double ChargeFactor = 1); + double HMMass, double CapacityFactor = 1); //} //{ @@ -109,7 +109,7 @@ public : \param HMMass Mass of Heavy Metal in the Reactor \param BurnUp Burnup reach by the fuel at the end of the cycle */ - Reactor(CLASSLogger* log, PhysicsModels fueltypeDB, + Reactor(CLASSLogger* log, PhysicsModels* fueltypeDB, FabricationPlant* fabricationplant, CLASSBackEnd* Pool, cSecond creationtime , cSecond lifetime, cSecond cycletime, double HMMass, double BurnUp); @@ -127,12 +127,12 @@ public : \param Power Thermal power of the reactor \param HMMass Mass of Heavy Metal in the Reactor \param BurnUp Burnup reach by the fuel at the end of the cycle - \param ChargeFactor effective charge of the reactor. + \param CapacityFactor effective charge of the reactor. */ - Reactor(CLASSLogger* log, PhysicsModels fueltypeDB, + Reactor(CLASSLogger* log, PhysicsModels* fueltypeDB, FabricationPlant* fabricationplant, CLASSBackEnd* Pool, cSecond creationtime , cSecond lifetime, - double Power, double HMMass, double BurnUp, double ChargeFactor); + double Power, double HMMass, double BurnUp, double CapacityFactor); //} //{ @@ -147,11 +147,11 @@ public : \param Power Thermal power of the reactor \param HMMass Mass of Heavy Metal in the Reactor \param BurnUp Burnup reach by the fuel at the end of the cycle - \param ChargeFactor effective charge of the reactor. + \param CapacityFactor effective charge of the reactor. */ - Reactor(CLASSLogger* log, EvolutionData evolutivedb, CLASSBackEnd* Pool, + Reactor(CLASSLogger* log, EvolutionData* evolutivedb, CLASSBackEnd* Pool, cSecond creationtime, cSecond lifetime, - double power, double HMMass, double BurnUp, double ChargeFactor); + double power, double HMMass, double BurnUp, double CapacityFactor); //} //{ @@ -166,9 +166,9 @@ public : \param Power Thermal power of the reactor \param HMMass Mass of Heavy Metal in the Reactor \param BurnUp Burnup reach by the fuel at the end of the cycle - \param ChargeFactor effective charge of the reactor. + \param CapacityFactor effective charge of the reactor. */ - Reactor(CLASSLogger* log, EvolutionData evolutivedb, CLASSBackEnd* Pool, + Reactor(CLASSLogger* log, EvolutionData* evolutivedb, CLASSBackEnd* Pool, cSecond creationtime, cSecond lifetime, cSecond cycletime, double HMMass, double BurnUp); //} @@ -247,6 +247,7 @@ public : void SetOutBackEndFacility(CLASSBackEnd* pool) { fOutBackEndFacility = pool; } //!< Return the pointer to OutBackEnd Facility void SetStorage(Storage* storage) { fStorage = storage; fIsStorage = true;} //!< Set the Pointer to the Storage + void SetFabricationPlant(FabricationPlant* FP) { fFabricationPlant = FP;} //!< Set the Pointer to the FabricationPlant void SetEvolutionDB(EvolutionData evolutionDB); //!< Set the Pointer to the DB Evolution of the Reactor #endif diff --git a/source/branches/CLASSV3/include/Scenario.hxx b/source/branches/CLASSV3/include/Scenario.hxx index 382a4c512a7b31bf49aee1d680113c31140162ca..a90bfcfd6fada56b632cd74058da9c144ecebe90 100755 --- a/source/branches/CLASSV3/include/Scenario.hxx +++ b/source/branches/CLASSV3/include/Scenario.hxx @@ -148,6 +148,7 @@ public : //} //@} + void SetLogTimeStep(bool val = true) {fLogTimeStep = true;} //********* Add Method *********// /*! @@ -170,8 +171,6 @@ public : \name Evolution Method */ //@{ - void OldBuildTimeVector(cSecond t); - void BuildTimeVector(cSecond t); ///< Build the Time Evolution Vector where : /// \li 1 printing, @@ -198,9 +197,9 @@ public : //@{ - IsotopicVector GetGod() const { return fGod; } //!< Return the God Providings IsotopicVector - void AddGod(ZAI zai, double quantity) { AddGod(zai*quantity); } //!< Add a ZAI*quantity to GodIncome - void AddGod(IsotopicVector isotopicvector) { fGod.Add(isotopicvector); } //!< Add a isotopicVector to GodIncome + IsotopicVector GetOutIncome() const { return fOutIncome; } //!< Return the OutIncome Providings IsotopicVector + void AddOutIncome(ZAI zai, double quantity) { AddOutIncome(zai*quantity); } //!< Add a ZAI*quantity to OutIncomeIncome + void AddOutIncome(IsotopicVector isotopicvector) { fOutIncome.Add(isotopicvector); } //!< Add a isotopicVector to OutIncomeIncome void AddWaste(ZAI zai, double quantity) { AddWaste(zai*quantity); } //!< Add a ZAI*quantity to Waste void AddWaste(IsotopicVector isotopicvector) { fWaste.Add(isotopicvector); } //!< Add a isotopicVector to Waste void AddToPower(double power) { fParcPower += power;} //!< Add power to the installed power in the Parc @@ -234,7 +233,7 @@ public : protected : bool fNewTtree; //!< Tru if we want to define a new TTree in the output File bool fStockManagement; ///< True if real StockManagement false unstead (Default = true) - + bool fLogTimeStep; cSecond fPrintStep; ///< Time interval between two output update cSecond fAbsoluteTime; ///< Absolute Clock @@ -262,7 +261,7 @@ protected : IsotopicVector fWaste; ///< Waste IV IsotopicVector fTotalStorage; ///< Sum of all IV in Storage IV - IsotopicVector fGod; ///< GodIncome IV + IsotopicVector fOutIncome; ///< OutIncomeIncome IV IsotopicVector fTotalCooling; ///< Sum of all IV in Cooling IV IsotopicVector fFuelFabrication; ///< Sum of all IV in Fabrication IV IsotopicVector fTotalInReactor; ///< Sum of all IV in Reactor IV diff --git a/source/branches/CLASSV3/include/XSModel.hxx b/source/branches/CLASSV3/include/XSModel.hxx index 3e8fbf15b227f8d2469eee7b1448337af6479e63..832a2bdc7aba4fb49bac70db9b96e061fe849ac5 100644 --- a/source/branches/CLASSV3/include/XSModel.hxx +++ b/source/branches/CLASSV3/include/XSModel.hxx @@ -1,4 +1,3 @@ - #ifndef _XSMODEL_HXX #define _XSMODEL_HXX @@ -12,6 +11,7 @@ @version 1.0 */ #include "EvolutionData.hxx" +#include "CLASSObject.hxx" using namespace std; @@ -45,9 +45,9 @@ class XSModel : public CLASSObject XSModel(); XSModel(CLASSLogger* log); - virtual EvolutionData GetCrossSections(IsotopicVector IV,double t=0) {return 0;} - - + virtual EvolutionData GetCrossSections(IsotopicVector IV,double t=0) {return EvolutionData();} + + }; diff --git a/source/branches/CLASSV3/src/CLASSFuel.cxx b/source/branches/CLASSV3/src/CLASSFuel.cxx index 7c84ea8009b637e4cf2d2c369fec174fd3c70f19..de1d23c3a457f1d36a24b5b2750a225b84e3a96d 100644 --- a/source/branches/CLASSV3/src/CLASSFuel.cxx +++ b/source/branches/CLASSV3/src/CLASSFuel.cxx @@ -13,10 +13,14 @@ using namespace std; // //________________________________________________________________________ -CLASSFuel::CLASSFuel():CLASSObject() +CLASSFuel::CLASSFuel(EvolutionData* evo) { + fEvolutionData = evo; + fPhysicsModels = 0; } -CLASSFuel::CLASSFuel(CLASSLogger* log):CLASSObject(log) +CLASSFuel::CLASSFuel(PhysicsModels* evo) { + fEvolutionData = 0; + fPhysicsModels = evo; } \ No newline at end of file diff --git a/source/branches/CLASSV3/src/CLASSFuelPlan.cxx b/source/branches/CLASSV3/src/CLASSFuelPlan.cxx index 8f37661ed1249873251fbadb09aa687454d9296b..42cc1e0d92b0aff02b681f521f008bb5aeda02f9 100644 --- a/source/branches/CLASSV3/src/CLASSFuelPlan.cxx +++ b/source/branches/CLASSV3/src/CLASSFuelPlan.cxx @@ -15,24 +15,29 @@ using namespace std; CLASSFuelPlan::CLASSFuelPlan():CLASSObject() { + DBGL } CLASSFuelPlan::CLASSFuelPlan(CLASSLogger* log):CLASSObject(log) { + DBGL + DBGL } void CLASSFuelPlan::AddFuel(cSecond time, CLASSFuel fuel, double BurnUp) { + DBGL fLoadingPlan.insert(pair< cSecond, pair< CLASSFuel, double > >(time, pair< CLASSFuel, double > (fuel, BurnUp)) ); + DBGL } pair< CLASSFuel, double > CLASSFuelPlan::GetFuelAt(cSecond t) { + DBGL pair< CLASSFuel, double > FuelAtT = fLoadingPlan.begin()->second; map< cSecond, pair< CLASSFuel, double > >::iterator it; - bool AfterPrevious = false; bool AfterNext = true; for (it = fLoadingPlan.begin(); it != fLoadingPlan.end(); it++ ) @@ -44,12 +49,14 @@ pair< CLASSFuel, double > CLASSFuelPlan::GetFuelAt(cSecond t) if (AfterPrevious && !AfterNext) { + DBGL return FuelAtT; } else if (!AfterPrevious && !AfterNext) { WARNING << "The time asked is before the first laoding time..."<< endl; WARNING << "The first Fuel will be loaded... Check your FuelPLan!!!!!" << endl; + DBGL return FuelAtT; } else @@ -59,5 +66,6 @@ pair< CLASSFuel, double > CLASSFuelPlan::GetFuelAt(cSecond t) } } + DBGL return FuelAtT; } diff --git a/source/branches/CLASSV3/src/EvolutionData.cxx b/source/branches/CLASSV3/src/EvolutionData.cxx index 54760ecc5b4d714471dfacf4e85ce10e70f7fb58..522e58070a6f697a6dba964221831e7dbbb60833 100755 --- a/source/branches/CLASSV3/src/EvolutionData.cxx +++ b/source/branches/CLASSV3/src/EvolutionData.cxx @@ -348,7 +348,7 @@ ClassImp(EvolutionData) -EvolutionData::EvolutionData():CLASSFuel() +EvolutionData::EvolutionData():CLASSObject() { fIsCrossSection = false; fPower = 0; @@ -358,7 +358,7 @@ EvolutionData::EvolutionData():CLASSFuel() } //________________________________________________________________________ -EvolutionData::EvolutionData(CLASSLogger* log):CLASSFuel(log) +EvolutionData::EvolutionData(CLASSLogger* log):CLASSObject(log) { fIsCrossSection = false; @@ -371,7 +371,7 @@ EvolutionData::EvolutionData(CLASSLogger* log):CLASSFuel(log) } //________________________________________________________________________ -EvolutionData::EvolutionData(CLASSLogger* log, string DB_file, bool oldread, ZAI zai):CLASSFuel(log) +EvolutionData::EvolutionData(CLASSLogger* log, string DB_file, bool oldread, ZAI zai):CLASSObject(log) { fIsCrossSection = false; diff --git a/source/branches/CLASSV3/src/FabricationPlant.cxx b/source/branches/CLASSV3/src/FabricationPlant.cxx index 4eba7ed4995826442b0c4f48e82a30caad8613c5..abf4dd27b06571f2cd3d63e612f110cdd06611be 100644 --- a/source/branches/CLASSV3/src/FabricationPlant.cxx +++ b/source/branches/CLASSV3/src/FabricationPlant.cxx @@ -47,6 +47,7 @@ FabricationPlant::FabricationPlant():CLASSFacility(16) FabricationPlant::FabricationPlant(CLASSLogger* log, double fabricationtime):CLASSFacility(log, fabricationtime, 16) { +DBGL SetName("F_FabricationPLant."); fFiFo = false; @@ -58,6 +59,7 @@ FabricationPlant::FabricationPlant(CLASSLogger* log, double fabricationtime):CLA INFO << " A FabricationPlant has been define :" << endl; INFO << "\t Chronological Stock Priority has been set! "<< endl; INFO << "\t Fabrication time set to \t " << (double)(GetCycleTime()/3600/24/365.25) << " year" << endl << endl; +DBGL } @@ -113,8 +115,10 @@ DBGL map<int ,cSecond >::iterator it; for( it = fReactorNextStep.begin(); it!= fReactorNextStep.end(); it++ ) { - if( t + GetCycleTime() >= GetParc()->GetReactor()[ (*it).first ]->GetCreationTime() - && t + GetCycleTime() < GetParc()->GetReactor()[ (*it).first ]->GetCreationTime() + GetParc()->GetReactor()[ (*it).first ]->GetLifeTime()) + double R_CreactionTime = GetParc()->GetReactor()[ (*it).first ]->GetCreationTime(); + double R_LifeTime = GetParc()->GetReactor()[ (*it).first ]->GetLifeTime(); + if( t + GetCycleTime() >= R_CreactionTime + && t + GetCycleTime() < R_CreactionTime + R_LifeTime) { if( (*it).second == t ) { @@ -122,8 +126,10 @@ DBGL pair<CLASSFuel, double> R_Fuel = GetParc()->GetReactor()[ReactorId]->GetFuelPlan()->GetFuelAt( t + GetCycleTime() ); #pragma omp critical(FuelBuild) { - if( typeid(R_Fuel.first) == typeid(PhysicsModels) ) + if( R_Fuel.first.GetPhysicsModels() ) + { BuildFuelForReactor( (*it).first, t ); + } } double R_BU = R_Fuel.second; @@ -247,7 +253,7 @@ void FabricationPlant::BuildFuelForReactor(int ReactorId, cSecond t) if(!IResult.second) IResult.first->second = evolutiondb; } - GetParc()->AddGod( IV ); + GetParc()->AddOutIncome( IV ); fInsideIV += IV; AddCumulativeIVIn(IV); @@ -538,7 +544,7 @@ DBGL } } else - GetParc()->AddGod( fFertileArray[0]*LambdaArray.back() ); + GetParc()->AddOutIncome( fFertileArray[0]*LambdaArray.back() ); //Clear the Building Array (Fissile and Fertile) diff --git a/source/branches/CLASSV3/src/IsotopicVector.cxx b/source/branches/CLASSV3/src/IsotopicVector.cxx index a9176c849a4a5df9c482abe03c2e675e51cd7edc..873d11390088817cddc067c298be9343966066c4 100755 --- a/source/branches/CLASSV3/src/IsotopicVector.cxx +++ b/source/branches/CLASSV3/src/IsotopicVector.cxx @@ -338,9 +338,9 @@ double IsotopicVector::GetSumOfAll() const void IsotopicVector::Add(const ZAI& zai, double quantity) { - if( ceil(quantity*1e25) - quantity*1e25 > quantity*1e25 - floor(quantity*1e25) ) - quantity = floor(quantity*1e25)*1/1e25; - else quantity = ceil(quantity*1e25)*1/1e25; + if( ceil(quantity*1e50) - quantity*1e50 > quantity*1e50 - floor(quantity*1e50) ) + quantity = floor(quantity*1e50)*1/1e50; + else quantity = ceil(quantity*1e50)*1/1e50; if(quantity > 0) diff --git a/source/branches/CLASSV3/src/PWR_THPU_FabricationPlant.cxx b/source/branches/CLASSV3/src/PWR_THPU_FabricationPlant.cxx index dcb14a30b5a0d3a3e7f71aafd00ae71800476b12..3fc4fdb254cfc5fd2043e4ba90ad64713110c4e3 100644 --- a/source/branches/CLASSV3/src/PWR_THPU_FabricationPlant.cxx +++ b/source/branches/CLASSV3/src/PWR_THPU_FabricationPlant.cxx @@ -258,7 +258,7 @@ void PWR_THPU_FabricationPlant::BuildFuelForReactor(int ReactorId) //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)*AVOGADRO/1e-6; - GetParc()->AddGodIncome(Th, Th_Quantity); + GetParc()->AddOutIncomeIncome(Th, Th_Quantity); for(int i = (int)fFractionToTake.size()-1; i >= 0; i--) { diff --git a/source/branches/CLASSV3/src/PWR_THU_FabricationPlant.cxx b/source/branches/CLASSV3/src/PWR_THU_FabricationPlant.cxx index 6d3ae534f9e6da329f9c4d70cebf54c0a9d59fe3..411e4e9b13c36a3b22f34c0b6b9c32599a8127a7 100644 --- a/source/branches/CLASSV3/src/PWR_THU_FabricationPlant.cxx +++ b/source/branches/CLASSV3/src/PWR_THU_FabricationPlant.cxx @@ -253,7 +253,7 @@ void PWR_THU_FabricationPlant::BuildFuelForReactor(int ReactorId) //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)*AVOGADRO/1e-6; - GetParc()->AddGodIncome( Th, Th_Quantity); + GetParc()->AddOutIncomeIncome( Th, Th_Quantity); for(int i = (int)fFractionToTake.size()-1; i >= 0; i--) { diff --git a/source/branches/CLASSV3/src/PhysicsModels.cxx b/source/branches/CLASSV3/src/PhysicsModels.cxx index db69ab9406f519f3006255919996608f0db13ef9..1e18a41107797cb42d7abe6159b4523de9e21e30 100644 --- a/source/branches/CLASSV3/src/PhysicsModels.cxx +++ b/source/branches/CLASSV3/src/PhysicsModels.cxx @@ -11,7 +11,7 @@ -PhysicsModels::PhysicsModels():CLASSFuel() +PhysicsModels::PhysicsModels():CLASSObject() { fXSModel = 0; @@ -21,7 +21,7 @@ PhysicsModels::PhysicsModels():CLASSFuel() } //________________________________________________________________________ -PhysicsModels::PhysicsModels(XSModel* XS, EquivalenceModel* EM, IrradiationModel* IM ):CLASSFuel() +PhysicsModels::PhysicsModels(XSModel* XS, EquivalenceModel* EM, IrradiationModel* IM ):CLASSObject() { fXSModel = XS; @@ -31,7 +31,7 @@ PhysicsModels::PhysicsModels(XSModel* XS, EquivalenceModel* EM, IrradiationModel } //________________________________________________________________________ -PhysicsModels::PhysicsModels(CLASSLogger* log, XSModel* XS, EquivalenceModel* EM, IrradiationModel* IM ):CLASSFuel(log) +PhysicsModels::PhysicsModels(CLASSLogger* log, XSModel* XS, EquivalenceModel* EM, IrradiationModel* IM ):CLASSObject(log) { fXSModel = XS; diff --git a/source/branches/CLASSV3/src/Pool.cxx b/source/branches/CLASSV3/src/Pool.cxx index 1299771e18f038800be21826446ba0f414f444a4..9a098ab69cea611a57ff1e63707e8278292aa985 100755 --- a/source/branches/CLASSV3/src/Pool.cxx +++ b/source/branches/CLASSV3/src/Pool.cxx @@ -31,6 +31,7 @@ Pool::Pool():CLASSBackEnd(8) //________________________________________________________________________ Pool::Pool(CLASSLogger* log, cSecond coolingtime):CLASSBackEnd(log, coolingtime, 8) { + DBGL fCycleTime = (cSecond)coolingtime; @@ -47,12 +48,14 @@ Pool::Pool(CLASSLogger* log, cSecond coolingtime):CLASSBackEnd(log, coolingtime, INFO << "\t The Cooling Time set at\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl; WARNING << " All Cooled Fuel goes directly to WASTE after cooling !! " << endl; + DBGL } //________________________________________________________________________ Pool::Pool(CLASSLogger* log, CLASSBackEnd* storage, cSecond coolingtime):CLASSBackEnd(log, coolingtime, 8) { + DBGL fOutBackEndFacility = storage; SetIsStorageType(false); @@ -68,6 +71,7 @@ Pool::Pool(CLASSLogger* log, CLASSBackEnd* storage, cSecond coolingtime):CLASSBa INFO << "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; INFO << "\t The Cooling Time set at\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl; + DBGL } diff --git a/source/branches/CLASSV3/src/Reactor.cxx b/source/branches/CLASSV3/src/Reactor.cxx index f3315253c8dbb45bda0d9ad5c61738cd72923435..1c72ad8c321e3a780529810880e708233486fc49 100755 --- a/source/branches/CLASSV3/src/Reactor.cxx +++ b/source/branches/CLASSV3/src/Reactor.cxx @@ -41,20 +41,23 @@ Reactor::Reactor():CLASSFacility(4) Reactor::Reactor(CLASSLogger* log):CLASSFacility(log, 4) { + DBGL fOutBackEndFacility = 0; fStorage = 0; fFabricationPlant = 0; SetName("R_Reactor."); + DBGL } Reactor::Reactor(CLASSLogger* log, CLASSBackEnd* Pool, cSecond creationtime, cSecond lifetime, - double power, double HMMass, double ChargeFactor ):CLASSFacility(log, creationtime, lifetime, 4) + double power, double HMMass, double CapacityFactor ):CLASSFacility(log, creationtime, lifetime, 4) { + DBGL (*this).SetName("R_Reactor."); @@ -70,7 +73,7 @@ Reactor::Reactor(CLASSLogger* log, fOutBackEndFacility = Pool; - fPower = power * ChargeFactor; + fPower = power * CapacityFactor; fHeavyMetalMass = HMMass; @@ -88,17 +91,19 @@ Reactor::Reactor(CLASSLogger* log, INFO << "\t Fuel Composition is fixed (for now)! "<< endl; INFO << "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; INFO << "\t Life time (Operating's Duration) set at \t " << (double)(GetLifeTime()/3600/24/365.25) << " year" << endl; - INFO << "\t The Effective Thermal Power is \t " << (double)(fPower *1e-6) << " MW (with Full Power " << power << " and " << ChargeFactor << " Charge Factor)"<< endl; + INFO << "\t The Effective Thermal Power is \t " << (double)(fPower *1e-6) << " MW (with Full Power " << power << " and " << CapacityFactor << " capacity factor)"<< endl; INFO << "\t The Heavy Metal Mass in the Core set at " << (double)(fHeavyMetalMass) << " tons" << endl << endl; - + DBGL + } Reactor::Reactor(CLASSLogger* log, FabricationPlant* fabricationplant, CLASSBackEnd* Pool, cSecond creationtime, cSecond lifetime, - double Power, double HMMass, double ChargeFactor):CLASSFacility(log, creationtime, lifetime, 4) + double Power, double HMMass, double CapacityFactor):CLASSFacility(log, creationtime, lifetime, 4) { + DBGL (*this).SetName("R_Reactor."); @@ -114,7 +119,7 @@ Reactor::Reactor(CLASSLogger* log, fBurnUp = -1; fHeavyMetalMass = HMMass; - fPower = Power*ChargeFactor; + fPower = Power*CapacityFactor; fCycleTime = -1; //BU in GWd/t fFuelPlan = 0; @@ -125,18 +130,20 @@ Reactor::Reactor(CLASSLogger* log, INFO << "\t Fuel Composition is not fixed (for now)! "<< endl; INFO << "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; INFO << "\t Life time (Operating's Duration) set at \t " << (double)(GetLifeTime()/3600/24/365.25) << " year" << endl; - INFO << "\t The Effective Thermal Power is \t " << (double)(fPower *1e-6) << " MW (with Full Power " << Power << " and " << ChargeFactor << " Charge Factor)"<< endl; + INFO << "\t The Effective Thermal Power is \t " << (double)(fPower *1e-6) << " MW (with Full Power " << Power << " and " << CapacityFactor << " capacity factor)"<< endl; INFO << "\t The Heavy Metal Mass in the Core set at " << (double)(fHeavyMetalMass) << " tons" << endl << endl; - + DBGL + } -Reactor::Reactor(CLASSLogger* log, PhysicsModels fueltypeDB, FabricationPlant* fabricationplant, CLASSBackEnd* Pool, +Reactor::Reactor(CLASSLogger* log, PhysicsModels* fueltypeDB, FabricationPlant* fabricationplant, CLASSBackEnd* Pool, cSecond creationtime, cSecond lifetime, - double Power, double HMMass, double BurnUp, double ChargeFactor):CLASSFacility(log, creationtime, lifetime, 4) + double Power, double HMMass, double BurnUp, double CapacityFactor):CLASSFacility(log, creationtime, lifetime, 4) { + DBGL (*this).SetName("R_Reactor."); @@ -146,16 +153,18 @@ Reactor::Reactor(CLASSLogger* log, PhysicsModels fueltypeDB, FabricationPlant* f fIsAtEndOfCycle = false; fFabricationPlant = fabricationplant; + fFixedFuel = false; fOutBackEndFacility = Pool; fBurnUp = BurnUp; fHeavyMetalMass = HMMass; - fPower = Power*ChargeFactor; + fPower = Power*CapacityFactor; fCycleTime = (cSecond) (fBurnUp*1e9 / (fPower) * fHeavyMetalMass *3600*24); //BU in GWd/t - fFuelPlan->AddFuel(creationtime, fueltypeDB, fBurnUp); + fFuelPlan = new CLASSFuelPlan(log); + fFuelPlan->AddFuel(creationtime, CLASSFuel(fueltypeDB), fBurnUp); @@ -163,21 +172,23 @@ Reactor::Reactor(CLASSLogger* log, PhysicsModels fueltypeDB, FabricationPlant* f INFO << "\t Fuel Composition is not fixed ! "<< endl; INFO << "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; INFO << "\t Life time (Operating's Duration) set at \t " << (double)(GetLifeTime()/3600/24/365.25) << " year" << endl; - INFO << "\t The Effective Thermal Power is \t " << (double)(fPower *1e-6) << " MW (with Full Power " << Power << " and " << ChargeFactor << " Charge Factor)"<< endl; + INFO << "\t The Effective Thermal Power is \t " << (double)(fPower *1e-6) << " MW (with Full Power " << Power << " and " << CapacityFactor << " capacity factor)"<< endl; INFO << "\t Burn-Up at end of Cycle set at \t " << (double)(fBurnUp) << " GWj/t" << endl; INFO << "\t The corresponding Cycle Time is\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl; INFO << "\t The Heavy Metal Mass in the Core set at " << (double)(fHeavyMetalMass) << " tons" << endl << endl; + DBGL } -Reactor::Reactor(CLASSLogger* log, PhysicsModels fueltypeDB, +Reactor::Reactor(CLASSLogger* log, PhysicsModels* fueltypeDB, FabricationPlant* fabricationplant, CLASSBackEnd* Pool, cSecond creationtime, cSecond lifetime, cSecond cycletime, double HMMass, double BurnUp):CLASSFacility(log, creationtime, lifetime, cycletime, 4) { + DBGL (*this).SetName("R_Reactor."); @@ -195,7 +206,8 @@ Reactor::Reactor(CLASSLogger* log, PhysicsModels fueltypeDB, fOutBackEndFacility = Pool; fPower = BurnUp*3600.*24. / (fCycleTime) * HMMass *1e9; //BU in GWd/t - fFuelPlan->AddFuel(creationtime, fueltypeDB, fBurnUp); + fFuelPlan = new CLASSFuelPlan(log); + fFuelPlan->AddFuel(creationtime, CLASSFuel(fueltypeDB), fBurnUp); INFO << " A Reactor has been define :" << endl; @@ -208,16 +220,18 @@ Reactor::Reactor(CLASSLogger* log, PhysicsModels fueltypeDB, INFO << "\t The Heavy Metal Mass in the Core set at " << (double)(fHeavyMetalMass) << " tons" << endl << endl; + DBGL } -Reactor::Reactor(CLASSLogger* log, EvolutionData evolutivedb, +Reactor::Reactor(CLASSLogger* log, EvolutionData* evolutivedb, CLASSBackEnd* Pool, cSecond creationtime, cSecond lifetime, - double power, double HMMass, double BurnUp, double ChargeFactor ):CLASSFacility(log, creationtime, lifetime, 4) + double power, double HMMass, double BurnUp, double CapacityFactor ):CLASSFacility(log, creationtime, lifetime, 4) { + DBGL (*this).SetName("R_Reactor."); @@ -233,17 +247,17 @@ Reactor::Reactor(CLASSLogger* log, EvolutionData evolutivedb, fOutBackEndFacility = Pool; - fPower = power * ChargeFactor; + fPower = power * CapacityFactor; fHeavyMetalMass = HMMass; map<ZAI ,double>::iterator it; - map<ZAI ,double> isotopicquantity = evolutivedb.GetIsotopicVectorAt(0.).GetActinidesComposition().GetIsotopicQuantity(); + 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/AVOGADRO*1e-6; - fEvolutionDB = evolutivedb * (fHeavyMetalMass/M0); + fEvolutionDB = *evolutivedb * (fHeavyMetalMass/M0); fBurnUp = BurnUp; fCycleTime = (cSecond) (fBurnUp*1e9 / (fPower) * fHeavyMetalMass *3600*24); @@ -252,25 +266,27 @@ Reactor::Reactor(CLASSLogger* log, EvolutionData evolutivedb, fIVInCycle = fEvolutionDB.GetIsotopicVectorAt(0); fIVOutCycle = fEvolutionDB.GetIsotopicVectorAt( (cSecond)(fCycleTime/fEvolutionDB.GetPower()*fPower) ); - - fFuelPlan->AddFuel(creationtime, evolutivedb, fBurnUp); + fFuelPlan = new CLASSFuelPlan(log); + fFuelPlan->AddFuel(creationtime, CLASSFuel(evolutivedb), fBurnUp); INFO << " A Reactor has been define :" << endl; INFO << "\t Fuel Composition is fixed ! "<< endl; INFO << "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; INFO << "\t Life time (Operating's Duration) set at \t " << (double)(GetLifeTime()/3600/24/365.25) << " year" << endl; INFO << "\t The Cycle Time set at\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl; - INFO << "\t The Effective Thermal Power is \t " << (double)(fPower *1e-6) << " MW (with Full Power " << power << " and " << ChargeFactor << " Charge Factor)"<< endl; + INFO << "\t The Effective Thermal Power is \t " << (double)(fPower *1e-6) << " MW (with Full Power " << power << " and " << CapacityFactor << " capacity factor)"<< endl; INFO << "\t The Heavy Metal Mass in the Core set at " << (double)(fHeavyMetalMass) << " tons" << endl << endl; + DBGL } -Reactor::Reactor(CLASSLogger* log, EvolutionData evolutivedb, +Reactor::Reactor(CLASSLogger* log, EvolutionData* evolutivedb, CLASSBackEnd* Pool, - cSecond creationtime, cSecond lifetime, cSecond cyclertime, - double HMMass, double BurnUp, double ChargeFactor ):CLASSFacility(log, creationtime, lifetime, cycletime, 4) + cSecond creationtime, cSecond lifetime, cSecond cycletime, + double HMMass, double BurnUp ):CLASSFacility(log, creationtime, lifetime, cycletime, 4) { + DBGL (*this).SetName("R_Reactor."); @@ -291,12 +307,12 @@ Reactor::Reactor(CLASSLogger* log, EvolutionData evolutivedb, fHeavyMetalMass = HMMass; map<ZAI ,double>::iterator it; - map<ZAI ,double> isotopicquantity = evolutivedb.GetIsotopicVectorAt(0.).GetActinidesComposition().GetIsotopicQuantity(); + 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/AVOGADRO*1e-6; - fEvolutionDB = evolutivedb * (fHeavyMetalMass/M0); + fEvolutionDB = *evolutivedb * (fHeavyMetalMass/M0); fBurnUp = BurnUp; @@ -305,17 +321,17 @@ Reactor::Reactor(CLASSLogger* log, EvolutionData evolutivedb, fIVOutCycle = fEvolutionDB.GetIsotopicVectorAt( (cSecond)(fCycleTime/fEvolutionDB.GetPower()*fPower) ); - fFuelPlan->AddFuel(creationtime, evolutivedb, fBurnUp); + fFuelPlan->AddFuel(creationtime, CLASSFuel(evolutivedb), fBurnUp); INFO << " A Reactor has been define :" << endl; INFO << "\t Fuel Composition is fixed ! "<< endl; INFO << "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; INFO << "\t Life time (Operating's Duration) set at \t " << (double)(GetLifeTime()/3600/24/365.25) << " year" << endl; INFO << "\t The Cycle Time set at\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl; - INFO << "\t The Effective Thermal Power is \t " << (double)(fPower *1e-6) << " MW (with Full Power " << power << " and " << ChargeFactor << " Charge Factor)"<< endl; + INFO << "\t The Effective Thermal Power is \t " << (double)(fPower *1e-6) << " MW (with Full Power " << fPower << endl; INFO << "\t The Heavy Metal Mass in the Core set at " << (double)(fHeavyMetalMass) << " tons" << endl << endl; - + DBGL } @@ -386,6 +402,7 @@ void Reactor::SetEvolutionDB(EvolutionData evolutionDB) fIVBeginCycle = fEvolutionDB.GetIsotopicVectorAt(0); + } //________________________________________________________________________ @@ -459,10 +476,12 @@ DBGL } else { - // This is so bad!! You will probably unsynchronize all the reactor.... - ERROR << " " << (*this).GetName()<< endl; + // Evolution goes after the end of cycle.... check it + ERROR << " " << (*this).GetName() << endl; + ERROR << " Evolution Time is " << t << endl; ERROR << " Evolution is too long! There is a problem in Reactor evolution at " << t/365.25/3600/24 << endl; ERROR << " This is too long of : " << EvolutionTime + fInCycleTime - fCycleTime << endl; + ERROR << " I have spend " << fInCycleTime +EvolutionTime << " and should have been " << fCycleTime << endl; exit(1); } @@ -477,7 +496,7 @@ DBGL if(fInternalTime < GetCreationTime()) return; if(fIsShutDown && !fIsStarted) return; // Reactor stopped... - + if(!fIsAtEndOfCycle && !fIsShutDown) return; // First trash the irradiated fuel if(fIsAtEndOfCycle && !fIsShutDown ) @@ -509,50 +528,52 @@ DBGL } + DBGL // Get the new Fuel ! - pair<CLASSFuel, double> NextFuel = fFuelPlan->GetFuelAt(fInternalTime); SetBurnUp((NextFuel).second); - if( typeid(NextFuel.first) == typeid(PhysicsModels) ) + if( NextFuel.first.GetPhysicsModels() ) fFixedFuel = false; - else if( typeid(NextFuel.first) == typeid(EvolutionData) ) + else if( NextFuel.first.GetEvolutionData() ) fFixedFuel = true; else { + ERROR << typeid(NextFuel.first).name() << endl; ERROR << "WRONG Fuel Format Correct it !! " << endl; exit(1); } + DBGL if(fFixedFuel ) { + DBGL if(fIsAtEndOfCycle && !fIsShutDown ) { - SetEvolutionDB( *NextFuel.first.GetEvolutionData() ); - + SetEvolutionDB( *(NextFuel.first.GetEvolutionData()) ); fIsAtEndOfCycle = false; if(!GetParc()->GetStockManagement() && fIsStorage ) { IsotopicVector BuildIVtmp ; - IsotopicVector GodPart; + IsotopicVector OutIncomePart; //Get The Storage Compostion BuildIVtmp.Add(fStorage->GetInsideIV().GetIsotopicQuantity()); //Get the rest after IVIn creation BuildIVtmp -= fIVInCycle; - //Get the God part form this rest - GodPart.Add(BuildIVtmp.GetIsotopicQuantityNeeded()) ; + //Get the OutIncome part form this rest + OutIncomePart.Add(BuildIVtmp.GetIsotopicQuantityNeeded()) ; //Take what you can from Storage... - fStorage->TakeFromStock( fIVInCycle - GodPart); - //And Get the rest from God - GetParc()->AddGod(GodPart); + fStorage->TakeFromStock( fIVInCycle - OutIncomePart); + //And Get the rest from OutIncome + GetParc()->AddOutIncome(OutIncomePart); } - else GetParc()->AddGod(fIVInCycle); + else GetParc()->AddOutIncome(fIVInCycle); fInsideIV = fIVBeginCycle; @@ -560,10 +581,12 @@ DBGL fInCycleTime = 0; } + DBGL } else { + DBGL if(!GetParc()->GetStockManagement()) { ERROR << " Can't have unfixedFuel without stock management" << endl; @@ -582,10 +605,10 @@ DBGL AddCumulativeIVIn(fIVBeginCycle); fInCycleTime = 0; - } - + DBGL + } diff --git a/source/branches/CLASSV3/src/Scenario.cxx b/source/branches/CLASSV3/src/Scenario.cxx index ab0c576e07f5bda4e6b559f48765066434da207e..41b1ee9b3a094bc9535f1c3e3f278c974b11a585 100755 --- a/source/branches/CLASSV3/src/Scenario.cxx +++ b/source/branches/CLASSV3/src/Scenario.cxx @@ -53,6 +53,7 @@ Scenario::Scenario():CLASSObject(new CLASSLogger("CLASS_OUTPUT.log")) fStartingTime = fAbsoluteTime; fStockManagement = true; + fLogTimeStep = false; fOutputFileName = "CLASS_Default.root"; fOutputTreeName = "Data"; @@ -81,6 +82,7 @@ Scenario::Scenario(cSecond abstime):CLASSObject(new CLASSLogger()) fStartingTime = fAbsoluteTime; fStockManagement = true; + fLogTimeStep = false; fOutputFileName = "CLASS_Default.root"; fOutputTreeName = "Data"; @@ -110,6 +112,7 @@ Scenario::Scenario(CLASSLogger* log, cSecond abstime):CLASSObject(log) fStartingTime = fAbsoluteTime; fStockManagement = true; + fLogTimeStep = false; fOutputFileName = "CLASS_Default.root"; fOutputTreeName = "Data"; @@ -141,6 +144,7 @@ Scenario::Scenario(cSecond abstime, CLASSLogger* log):CLASSObject(log) fStartingTime = fAbsoluteTime; fStockManagement = true; + fLogTimeStep = false; fOutputFileName = "CLASS_Default.root"; fOutputTreeName = "Data"; @@ -342,24 +346,37 @@ void Scenario::BuildTimeVector(cSecond t) fTimeStep.insert( pair<cSecond ,int>(t,1) ); //********* Printing Step *********// { + DBGL cSecond step = fStartingTime; if(step >= fAbsoluteTime ) fTimeStep.insert( pair<cSecond ,int>(step,1) ); step += fPrintStep; + cSecond timescale = 1; + do { if(step >= fAbsoluteTime ) fTimeStep.insert( pair<cSecond ,int>(step,1) ); - step += fPrintStep; + + if(fLogTimeStep) + { + timescale *= 10; + step = fPrintStep*timescale; + } + else + step += fPrintStep; + } while( step < t ); + DBGL } for(int i = 0; i < (int)fReactor.size();i++) { + DBGL cSecond R_StartingTime = fReactor[i]->GetCreationTime(); cSecond R_ShutDownTime = fReactor[i]->GetCreationTime() + fReactor[i]->GetLifeTime(); @@ -436,18 +453,19 @@ void Scenario::BuildTimeVector(cSecond t) //********* FabricationPlant Evolution Step *********// - if( typeid(R_Fuel.first) == typeid(PhysicsModels) ) + if( R_Fuel.first.GetPhysicsModels() ) { - fReactor[i]->GetFabricationPlant()->AddReactor( i, fReactor[i]->GetCreationTime() ); + fReactor[i]->GetFabricationPlant()->AddReactor( i, step ); - if( (step - F_CycleTime) >= fAbsoluteTime && (step - F_CycleTime) <= t ) - { + F_CycleTime = fReactor[i]->GetFabricationPlant()->GetCycleTime(); + + if(step - F_CycleTime >= fAbsoluteTime && step - F_CycleTime <= t && step < R_ShutDownTime) + { // Set End of reactor cycle pair< map<cSecond, int>::iterator, bool > IResult; IResult = fTimeStep.insert( pair<cSecond ,int>(step - F_CycleTime,16) ); - if( !IResult.second ) - IResult.first->second |= 16; + if( !IResult.second ) IResult.first->second |= 16; } else if( step - F_CycleTime < fStartingTime ) { @@ -456,6 +474,7 @@ void Scenario::BuildTimeVector(cSecond t) } } + step += R_CycleTime; //Prepare the first Cycle R_Fuel = fReactor[i]->GetFuelPlan()->GetFuelAt(step); @@ -467,75 +486,74 @@ void Scenario::BuildTimeVector(cSecond t) ERROR << " Be carefull a reactor cycletime is set to 0 second....\"\n" << endl; exit(1); } - step += R_CycleTime; while(step <= t && step <= R_ShutDownTime ) { + DBGL // FabricationPlant Evolution Step - if( typeid(R_Fuel.first) == typeid(PhysicsModels) ) + if( R_Fuel.first.GetPhysicsModels() ) { + fReactor[i]->GetFabricationPlant()->AddReactor( i, step ); + F_CycleTime = fReactor[i]->GetFabricationPlant()->GetCycleTime(); - if(step - F_CycleTime >= fAbsoluteTime && - step - F_CycleTime <= t && - step < R_ShutDownTime) + if(step - F_CycleTime >= fAbsoluteTime && step - F_CycleTime <= t && step < R_ShutDownTime) { // Set End of reactor cycle pair< map<cSecond, int>::iterator, bool > IResult; IResult = fTimeStep.insert( pair<cSecond ,int>(step - F_CycleTime,16) ); if( !IResult.second ) IResult.first->second |= 16; } + } - if(step >= fAbsoluteTime && - step <= t && - step < R_ShutDownTime) - { // Set End of reactor cycle - pair< map<cSecond, int>::iterator, bool > IResult = fTimeStep.insert( pair<cSecond ,int>(step,4) ); - if( !IResult.second ) IResult.first->second |= 4; - } - // End/Start Of Reactor Cycle Step // + if(step >= fAbsoluteTime && step <= t && step < R_ShutDownTime) + { // Set End of reactor cycle + pair< map<cSecond, int>::iterator, bool > IResult = fTimeStep.insert( pair<cSecond ,int>(step,4) ); + if( !IResult.second ) IResult.first->second |= 4; + } + // End/Start Of Reactor Cycle Step // - map< cSecond, int >::iterator TV_it; // the time vector iterator - // BackEnd fuel Cycle - // Loop on the BackEnd fuel Cycle Time path - for(TV_it = R_BackEndTimePath.begin(); TV_it != R_BackEndTimePath.end(); TV_it++) - { - if(step + (*TV_it).first >= fAbsoluteTime && - step + (*TV_it).first <= t) - { // Test if each step of the Fuel Cycle BackEnd is after the actual time (AbsolutreTime) and before the end of the evolution (t) - pair< map<cSecond, int>::iterator, bool > IResult; + map< cSecond, int >::iterator TV_it; // the time vector iterator + // BackEnd fuel Cycle + // Loop on the BackEnd fuel Cycle Time path + for(TV_it = R_BackEndTimePath.begin(); TV_it != R_BackEndTimePath.end(); TV_it++) + { - IResult = fTimeStep.insert( pair<cSecond ,int>(step + (*TV_it).first, (*TV_it).second) ); - if( !IResult.second ) - IResult.first->second |= (*TV_it).second; - } + if(step + (*TV_it).first >= fAbsoluteTime && + step + (*TV_it).first <= t) + { // Test if each step of the Fuel Cycle BackEnd is after the actual time (AbsolutreTime) and before the end of the evolution (t) + pair< map<cSecond, int>::iterator, bool > IResult; + + IResult = fTimeStep.insert( pair<cSecond ,int>(step + (*TV_it).first, (*TV_it).second) ); + if( !IResult.second ) + IResult.first->second |= (*TV_it).second; } + } + step += R_CycleTime; - // Update to the next fuel - R_Fuel = fReactor[i]->GetFuelPlan()->GetFuelAt(step); + // Update to the next fuel + R_Fuel = fReactor[i]->GetFuelPlan()->GetFuelAt(step); - R_BU = fReactor[i]->GetFuelPlan()->GetFuelAt(step).second; - R_CycleTime = (cSecond) (R_BU / R_Power * R_HMMass * 1e9 *3600*24); - if(R_CycleTime == 0) - { - ERROR << " Be carefull a reactor cycletime is set to 0 second....\"\n" << endl; - exit(1); - } - step += R_CycleTime; + R_BU = fReactor[i]->GetFuelPlan()->GetFuelAt(step).second; + R_CycleTime = (cSecond) (R_BU / R_Power * R_HMMass * 1e9 *3600*24); + if(R_CycleTime == 0) + { + ERROR << " Be carefull a reactor cycletime is set to 0 second....\"\n" << endl; + exit(1); } - - + DBGL } + DBGL } //****** Print the Time Index ******// ofstream TimeStepfile("CLASS_TimeStep", ios_base::app); // Open the File @@ -551,156 +569,6 @@ void Scenario::BuildTimeVector(cSecond t) } -//________________________________________________________________________ -void Scenario::OldBuildTimeVector(cSecond t) -{ - fTimeStep.clear(); - fTimeStep.insert( pair<cSecond ,int>(t,1) ); - //********* Printing Step *********// - { - cSecond step = 0; - if(fAbsoluteTime == fStartingTime) - step = fStartingTime; - else - { - step = fAbsoluteTime; - } - if(step >= fAbsoluteTime ) - fTimeStep.insert( pair<cSecond ,int>(step,1) ); - step += fPrintStep; - do - { - - if(step >= fAbsoluteTime ) - fTimeStep.insert( pair<cSecond ,int>(step,1) ); - step += fPrintStep; - } - while( step < t ); - } - - for(int i = 0; i < (int)fReactor.size();i++) - { - double step = fReactor[i]->GetCreationTime(); - double coolingstep = fReactor[i]->GetOutBackEndFacility()->GetCycleTime(); - double fabricationstep = 0; - - if(!fReactor[i]->IsFuelFixed()) - fabricationstep = fReactor[i]->GetFabricationPlant()->GetCycleTime(); - - - //********* Reactor Evolution Step *********// - // set destruction of a reactor - if( (fReactor[i]->GetCreationTime() + fReactor[i]->GetLifeTime() > fAbsoluteTime) && - (fReactor[i]->GetCreationTime() + fReactor[i]->GetLifeTime() < t) ) - { - //********* Reactor Shutdown *********// - pair< map<cSecond, int>::iterator, bool > IResult = fTimeStep.insert( pair<cSecond ,int>(fReactor[i]->GetCreationTime() + fReactor[i]->GetLifeTime(),2) ); - if( !IResult.second ) IResult.first->second |= 2; - - //********* End of Cooling after reactor Shutdown *********// - if(fReactor[i]->GetCreationTime() + fReactor[i]->GetLifeTime()+coolingstep >= fAbsoluteTime - && fReactor[i]->GetCreationTime() + fReactor[i]->GetLifeTime()+coolingstep <= t) - { - pair< map<cSecond, int>::iterator, bool > IResult = fTimeStep.insert( pair<cSecond ,int>(fReactor[i]->GetCreationTime() + fReactor[i]->GetLifeTime()+coolingstep,8) ); - if( !IResult.second ) IResult.first->second |= 8; - } - } - - - //********* Start Of Reactor First Cycle *********// - if(step >= fAbsoluteTime && step <= t && step < fReactor[i]->GetCreationTime() + fReactor[i]->GetLifeTime()) - { - pair< map<cSecond, int>::iterator, bool > IResult = fTimeStep.insert( pair<cSecond ,int>(step,4) ); - if( !IResult.second ) IResult.first->second |= 4; - } - - //********* FabricationPlant Evolution Step *********// - if(!fReactor[i]->IsFuelFixed()) - { - if(step > fAbsoluteTime && step - fabricationstep <= t && step < fReactor[i]->GetCreationTime() + fReactor[i]->GetLifeTime() ) - { - pair< map<cSecond, int>::iterator, bool > IResult = fTimeStep.insert( pair<cSecond ,int>(step -fabricationstep,16) ); - if( !IResult.second ) IResult.first->second |= 16; - } - else if(step - fabricationstep < fStartingTime) - { - ERROR << " Can't Build Fuel before Scenario's start\"\n" << endl; - exit(1); - } - } - - - //********* Reactor related Step *********// - step += fReactor[i]->GetCycleTime(); - if (fReactor[i]->GetCycleTime() !=0) - { - do - { - - - //********* FabricationPlant Evolution Step *********// - if(!fReactor[i]->IsFuelFixed()) - if(step > fAbsoluteTime && step - fabricationstep <= t && step < fReactor[i]->GetCreationTime() + fReactor[i]->GetLifeTime()) - { // Set End of reactor cycle - pair< map<cSecond, int>::iterator, bool > IResult = fTimeStep.insert( pair<cSecond ,int>(step -fabricationstep,16) ); - if( !IResult.second ) IResult.first->second |= 16; - } - - - //********* End/Start Of Reactor Cycle Step *********// - if(step > fAbsoluteTime && step <= t && step < fReactor[i]->GetCreationTime() + fReactor[i]->GetLifeTime()) - { // Set End of reactor cycle - pair< map<cSecond, int>::iterator, bool > IResult = fTimeStep.insert( pair<cSecond ,int>(step,4) ); - if( !IResult.second ) IResult.first->second |= 4; - } - - //********* End of Cooling Step *********// - if(step >= fAbsoluteTime && step + coolingstep <= t) // Set End of Cooling - { - pair< map<cSecond, int>::iterator, bool > IResult = fTimeStep.insert( pair<cSecond ,int>(step+coolingstep,8) ); - if( !IResult.second ) IResult.first->second |= 8; - } - step += fReactor[i]->GetCycleTime(); - } - while(step <= t && step <= fReactor[i]->GetCreationTime() + fReactor[i]->GetLifeTime() ); - } - } - - - //*** In Case of Evolution Restart ****// - for(int i =0; i < (int)fPool.size(); i++) - { - //********* End of Cooling Step *********// - for(int j = 0; j<(int)fPool[i]->GetIVArray().size(); j++ )// Set End of Cooling - { - if(fPool[i]->GetCoolingStartingTime()[j] + fPool[i]->GetCycleTime() > fAbsoluteTime ) - { - pair< map<cSecond, int>::iterator, bool > IResult; - IResult = fTimeStep.insert( pair<cSecond ,int>(fPool[i]->GetCoolingStartingTime()[j] + fPool[i]->GetCycleTime(),8) ); - if( !IResult.second ) IResult.first->second |= 8; - } - } - } - - - - //****** Print the Time Index ******// - ofstream TimeStepfile("CLASS_TimeStep", ios_base::app); // Open the File - - if(!TimeStepfile) - { - WARNING << " Can't open \" CLASS_TimeStep \"\n" << endl; - } - else - { - map<cSecond ,int >::iterator it; - for( it = fTimeStep.begin(); it != fTimeStep.end(); it++) - TimeStepfile << (*it).first << " " << (*it).second << endl; - } -} - - - //________________________________________________________________________ //___________________________ Evolution Method ___________________________ //________________________________________________________________________ @@ -772,6 +640,7 @@ void Scenario::Evolution(cSecond t) for(it = fTimeStep.begin(); it != fTimeStep.end(); it++) { + fWaste = fDecayDataBase->GetDecay(fWaste, (*it).first - fAbsoluteTime); fAbsoluteTime = (*it).first; @@ -864,7 +733,6 @@ void Scenario::UpdateParc() void Scenario::ResetQuantity() { - fTotalInReactor.Clear(); fTotalStorage.Clear(); fTotalCooling.Clear(); @@ -942,7 +810,7 @@ void Scenario::OutAttach() fOutT->Branch("INCYCLE.", "IsotopicVector", &fIVInCycleTotal); fOutT->Branch("TOTAL.", "IsotopicVector", &fIVTotal); - fOutT->Branch("GOD.", "IsotopicVector", &fGod); + fOutT->Branch("OUTINCOME.", "IsotopicVector", &fOutIncome); fOutT->Branch("WASTE.", "IsotopicVector", &fWaste); // Branch the separate object diff --git a/source/branches/CLASSV3/src/Storage.cxx b/source/branches/CLASSV3/src/Storage.cxx index 1fe1f1e695a848188a5cdf32808472e1e90e4876..43baac4974375ec015af58b0ca7ccefcdbb97877 100644 --- a/source/branches/CLASSV3/src/Storage.cxx +++ b/source/branches/CLASSV3/src/Storage.cxx @@ -25,13 +25,16 @@ ClassImp(Storage) Storage::Storage():CLASSBackEnd(-1) { + DBGL SetIsStorageType(); SetName("S_Storage."); + DBGL } Storage::Storage(CLASSLogger* log):CLASSBackEnd(log, -1) { + DBGL SetIsStorageType(); SetName("S_Storage."); @@ -42,6 +45,7 @@ Storage::Storage(CLASSLogger* log):CLASSBackEnd(log, -1) //________________________________________________________________________ Storage::Storage(CLASSLogger* log, DecayDataBank* evolutivedb):CLASSBackEnd(log, -1) { + DBGL SetIsStorageType(); SetDecayDataBank(evolutivedb); @@ -51,6 +55,7 @@ Storage::Storage(CLASSLogger* log, DecayDataBank* evolutivedb):CLASSBackEnd(log, INFO << " A new Storage has been define." << endl; + DBGL } //________________________________________________________________________ diff --git a/source/branches/CLASSV3/src/XSModel.cxx b/source/branches/CLASSV3/src/XSModel.cxx index 19b7c12ce271f49a9c763e54cc523002e4a30bff..6c5f38452c4c92c5d1d66d466bbd94924b98a732 100644 --- a/source/branches/CLASSV3/src/XSModel.cxx +++ b/source/branches/CLASSV3/src/XSModel.cxx @@ -10,14 +10,13 @@ using namespace std; -XSModel::XSModel(): CLASSObject() +XSModel::XSModel():CLASSObject() { } - -XSModel::XSModel(CLASSLogger* log): CLASSObject(log) +XSModel::XSModel(CLASSLogger* log):CLASSObject(log) { } \ No newline at end of file