diff --git a/source/branches/CLASSV3/src/Makefile b/source/branches/CLASSV3/src/Makefile index 80f32732dc003521df8258266537d329e1952dd9..f9b56fa4a268bc4fcaecfce20deb7be4f177e5cc 100755 --- a/source/branches/CLASSV3/src/Makefile +++ b/source/branches/CLASSV3/src/Makefile @@ -27,6 +27,7 @@ OBJS = CLASSLogger.o \ FabricationPlant.o FabricationPlantDict.o \ Reactor.o ReactorDict.o \ CLASSBackEnd.o CLASSBackEndDict.o\ + SeparationPlant.o SeparationPlantDict.o\ Storage.o StorageDict.o\ Pool.o PoolDict.o\ DecayDataBank.o \ @@ -56,6 +57,7 @@ ROOTOBJS = CLASSLogger.o \ CLASSBackEnd.o CLASSBackEndDict.o\ Storage.o StorageDict.o\ Pool.o PoolDict.o\ + SeparationPlant.o SeparationPlantDict.o\ DecayDataBank.o \ DynamicalSystem.o\ CLASSFuel.o\ @@ -105,6 +107,9 @@ FabricationPlantDict.cxx: $(LOCALINC)/FabricationPlant.hxx PoolDict.cxx: $(LOCALINC)/Pool.hxx rootcint -f $@ -c $^ +SeparationPlantDict.cxx: $(LOCALINC)/SeparationPlant.hxx + rootcint -f $@ -c $^ + IsotopicVectorDict.cxx: $(LOCALINC)/IsotopicVector.hxx rootcint -f $@ -c $^ diff --git a/source/branches/CLASSV3/src/PWR_THPU_FabricationPlant.cxx b/source/branches/CLASSV3/src/PWR_THPU_FabricationPlant.cxx deleted file mode 100644 index 3fc4fdb254cfc5fd2043e4ba90ad64713110c4e3..0000000000000000000000000000000000000000 --- a/source/branches/CLASSV3/src/PWR_THPU_FabricationPlant.cxx +++ /dev/null @@ -1,298 +0,0 @@ -#include "PWR_THPU_FabricationPlant.hxx" - - -#include "Storage.hxx" -#include "Reactor.hxx" -#include "EvolutionData.hxx" -#include "FuelDataBank.hxx" -#include "DecayDataBank.hxx" -#include "IsotopicVector.hxx" -#include "Scenario.hxx" -#include "CLASSLogger.hxx" - -#include "TMatrixT.h" - -#include <sstream> -#include <string> -#include <iostream> -#include <cmath> -#include <algorithm> - - //________________________________________________________________________ - //________________________________________________________________________ - //________________________________________________________________________ - // - // MyFabricationPlant - // a FP specific to one type of Reactor and one type of Fuel - // - // - // - //________________________________________________________________________ - //________________________________________________________________________ -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; -} - - - - -PWR_THPU_FabricationPlant::PWR_THPU_FabricationPlant():FabricationPlant() -{ -} - -PWR_THPU_FabricationPlant::PWR_THPU_FabricationPlant(CLASSLogger* log) -{ - SetFacilityType(16); - - SetLog(log); - fFiFo = false; - SetCycleTime(-1); - fUpdateReferenceDBatEachStep = false; - fSubstitutionFuel = false; - fStorage = 0; - fReUsable = 0; - - cout << "!!INFO!! !!!FabricationPlant!!! A FabricationPlant has been define :" << endl; - cout << "\t Chronological Stock Priority set! "<< endl << endl; - cout << "!!WARNING!! !!!FabricationPlant!!! You need to set the different stock manually as well as the Fabrication Time Manualy !! " << endl; - fLog << "!!INFO!! !!!FabricationPlant!!! A FabricationPlant has been define :" << endl; - fLog << "\t Chronological Stock Priority set! "<< endl << endl; - fLog << "!!WARNING!! !!!FabricationPlant!!! You need to set the different stock manually as well as the Fabrication Time Manualy !! " << endl; - - - -} - -PWR_THPU_FabricationPlant::PWR_THPU_FabricationPlant(CLASSLogger* log, Storage* storage, Storage* reusable, double fabircationtime) -{ - SetFacilityType(16); - - SetLog(log); - - fFiFo = false; - fUpdateReferenceDBatEachStep = false; - fSubstitutionFuel = false; - - - SetCycleTime((cSecond)fabircationtime ); - fStorage = storage; - fReUsable = reusable; - - - INFO << "!!INFO!! !!!FabricationPlant!!! 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; - - - - -} - - - - //________________________________________________________________________ -PWR_THPU_FabricationPlant::~PWR_THPU_FabricationPlant() -{ - - -} - - - - - -void PWR_THPU_FabricationPlant::BuildFuelForReactor(int ReactorId) -{ - //cout<<"INFO : This is a specific FabricationPlant"<<endl<<"GOOD JOB!!!"<<endl; - FuelDataBank* FuelType = GetParc()->GetReactor()[ReactorId]->GetFuelType(); - string ReactorType ="PWR"; - if(FuelType->GetFuelType() != "THPU" || ReactorType !="PWR")//Check if the reactor is the right type and use the right type of fuel - { - ERROR << "!!Bad Trouble!! !!!FabricationPlant!!! Try to do MOX with a not MOXed DB" << endl; - exit (1); - } - - double HMmass = GetParc()->GetReactor()[ReactorId]->GetHeavyMetalMass(); - - double BU = GetParc()->GetReactor()[ReactorId]->GetBurnUp(); - IsotopicVector FullUsedStock; - IsotopicVector stock; - - bool FuelBuild = false; - while(!FuelBuild) - { - double nPu_0 = 0; - double MPu_0 = 0; - { - map<ZAI ,double>::iterator it; - - map<ZAI ,double> isotopicquantity = GetDecay( FullUsedStock , GetCycleTime()).GetSpeciesComposition(94).GetIsotopicQuantity(); - for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++ ) - nPu_0 += (*it).second; - - isotopicquantity = FullUsedStock.GetSpeciesComposition(94).GetIsotopicQuantity(); - for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++ ) - MPu_0 += (*it).second*cZAIMass.fZAIMass.find( (*it).first )->second/AVOGADRO*1e-6; - } - - stock = GetStockToRecycle(); - if( stock.GetZAIIsotopicQuantity(ZAI(-1,-1,-1)) == 1 ) // Not enought stock to build the needed fuel - { - if (!fSubstitutionFuel) - { - { - EvolutionData evolutiondb; - pair<map<int, EvolutionData>::iterator, bool> IResult; - IResult = fReactorFuturDB.insert( pair<int, EvolutionData>(ReactorId,evolutiondb) ); - if(!IResult.second) - IResult.first->second = evolutiondb; - } - { - IsotopicVector EmptyIV; - pair<map<int, IsotopicVector>::iterator, bool> IResult; - IResult = fReactorFuturIV.insert( pair<int, IsotopicVector>(ReactorId,EmptyIV) ); - if(!IResult.second) - IResult.first->second = EmptyIV; - } - } - else - { - { - EvolutionData evolutiondb = fSubstitutionEvolutionData* HMmass; - pair<map<int, EvolutionData>::iterator, bool> IResult; - IResult = fReactorFuturDB.insert( pair<int, EvolutionData>(ReactorId,evolutiondb) ); - if(!IResult.second) - IResult.first->second = evolutiondb; - } - { - IsotopicVector IV = fSubstitutionEvolutionData.GetIsotopicVectorAt(0)* HMmass; - pair<map<int, IsotopicVector>::iterator, bool> IResult; - IResult = fReactorFuturIV.insert( pair<int, IsotopicVector>(ReactorId, IV) ); - if(!IResult.second) - IResult.first->second = IV; - } - - } - FuelBuild = true; - fFractionToTake.clear(); - } - else - { - double nPu_1 = 0; - double MPu_1 = 0; - double Sum_AlphaI_nPuI = 0; - double Sum_AlphaI_nPuI0 = 0; - { - map<ZAI ,double>::iterator it; - map<ZAI ,double> isotopicquantity = GetDecay( stock , GetCycleTime()).GetSpeciesComposition(94).GetIsotopicQuantity(); - - for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++ ) - { - if ((*it).first.A() >= 238 && (*it).first.A() <= 242) - { - nPu_1 += (*it).second; - Sum_AlphaI_nPuI += FuelType->GetFuelParameter()[(*it).first.A() -237]*(*it).second; - } - } - - isotopicquantity = stock.GetSpeciesComposition(94).GetIsotopicQuantity(); - 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)/AVOGADRO*1e-6; - } - - isotopicquantity = GetDecay( FullUsedStock , GetCycleTime()).GetSpeciesComposition(94).GetIsotopicQuantity(); - for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++ ) - if ((*it).first.A() >= 238 && (*it).first.A() <= 242) - { - Sum_AlphaI_nPuI0 += FuelType->GetFuelParameter()[(*it).first.A() -237]*(*it).second; - } - } - //cout<<"TEST TEST TEST TEST TEST HMmass : "<<HMmass <<endl; - //cout<<"TEST TEST TEST TEST TEST MPu_1 : "<<MPu_1<<endl; - double StockFactionToUse = 0; - - 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] * 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 * AVOGADRO / (cZAIMass.fZAIMass.find( ZAI(90,232,0) )->second) ; - - StockFactionToUse = (N1 + N2 + N3) / (D1 + D2); - - if(StockFactionToUse < 0) - { - stock.GetActinidesComposition().Print(); - - ERROR << "!!Bad Trouble!! !!!FabricationPlant!!! Oups Bug in calculating stock fraction to use" << endl; - RecycleStock(0.); - FuelBuild = false; - - } - else if( StockFactionToUse > 1 ) - { - //cout<<"TEST TEST TEST TEST TEST Not enough Pu"<<endl; - - FullUsedStock += stock; - RecycleStock(1); - FuelBuild = false; - } - else - { - RecycleStock(StockFactionToUse); - - IsotopicVector IVBeginCycle; - FuelBuild = true; - - ZAI Th = ZAI(90,232,0); - //cout<<"TEST TEST TEST TEST TEST (HMmass - (MPu_0+StockFactionToUse*MPu_1 ) : "<<(HMmass - (MPu_0+StockFactionToUse*MPu_1 ))<<endl; - //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)*AVOGADRO/1e-6; - - GetParc()->AddOutIncomeIncome(Th, Th_Quantity); - - for(int i = (int)fFractionToTake.size()-1; i >= 0; i--) - { - IVBeginCycle += fStorage->GetIVArray()[fFractionToTake[i].first].GetSpeciesComposition(94)*( fFractionToTake[i].second ); - fReUsable->AddIV(fStorage->GetIVArray()[fFractionToTake[i].first]*(fFractionToTake[i].second) - - fStorage->GetIVArray()[fFractionToTake[i].first].GetSpeciesComposition(94)*(fFractionToTake[i].second)); - - fStorage->TakeFractionFromStock(fFractionToTake[i].first,fFractionToTake[i].second); - - } - fFractionToTake.clear(); - - IVBeginCycle += Th_Quantity*Th; - EvolutionData evolutiondb = BuildEvolutiveDB(ReactorId, IVBeginCycle); - - { - pair<map<int, EvolutionData>::iterator, bool> IResult; - IResult = fReactorFuturDB.insert( pair<int, EvolutionData>(ReactorId,evolutiondb) ); - if(!IResult.second) - IResult.first->second = evolutiondb; - } - { - pair<map<int, IsotopicVector>::iterator, bool> IResult; - IResult = fReactorFuturIV.insert( pair<int, IsotopicVector>(ReactorId,IVBeginCycle) ); - if(!IResult.second) - IResult.first->second = IVBeginCycle; - - AddCumulativeIVIn(IVBeginCycle); - fInsideIV += IVBeginCycle; - - - } - } - } - } - -} diff --git a/source/branches/CLASSV3/src/PWR_THU_FabricationPlant.cxx b/source/branches/CLASSV3/src/PWR_THU_FabricationPlant.cxx deleted file mode 100644 index 411e4e9b13c36a3b22f34c0b6b9c32599a8127a7..0000000000000000000000000000000000000000 --- a/source/branches/CLASSV3/src/PWR_THU_FabricationPlant.cxx +++ /dev/null @@ -1,293 +0,0 @@ -#include "PWR_THU_FabricationPlant.hxx" - -#include "Storage.hxx" -#include "Reactor.hxx" -#include "EvolutionData.hxx" -#include "FuelDataBank.hxx" -#include "DecayDataBank.hxx" -#include "IsotopicVector.hxx" -#include "Scenario.hxx" -#include "CLASSLogger.hxx" - - - - -#include "TMatrixT.h" - -#include <sstream> -#include <string> -#include <iostream> -#include <cmath> -#include <algorithm> - - //________________________________________________________________________ - //________________________________________________________________________ - //________________________________________________________________________ - // - // MyFabricationPlant - // a FP specific to one type of Reactor and one type of Fuel - // - // - // - //________________________________________________________________________ - //________________________________________________________________________ -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; -} - -PWR_THU_FabricationPlant::PWR_THU_FabricationPlant():FabricationPlant() -{ - -} - -PWR_THU_FabricationPlant::PWR_THU_FabricationPlant(CLASSLogger* log) -{ - SetFacilityType(16); - - SetLog(log); - fFiFo = false; - SetCycleTime(-1); - fUpdateReferenceDBatEachStep = false; - fSubstitutionFuel = false; - fStorage = 0; - fReUsable = 0; - - INFO << "!!INFO!! !!!FabricationPlant!!! A FabricationPlant has been define :" << endl; - INFO << "\t Chronological Stock Priority set! "<< endl << endl; - INFO << "!!WARNING!! !!!FabricationPlant!!! You need to set the different stock manually as well as the Fabrication Time Manualy !! " << endl; - - - -} - -PWR_THU_FabricationPlant::PWR_THU_FabricationPlant(CLASSLogger* log, Storage* storage, Storage* reusable, double fabircationtime) -{ - SetFacilityType(16); - - SetLog(log); - - fFiFo = false; - fUpdateReferenceDBatEachStep = false; - fSubstitutionFuel = false; - - - SetCycleTime((cSecond)fabircationtime ); - fStorage = storage; - fReUsable = reusable; - - - INFO << "!!INFO!! !!!FabricationPlant!!! 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; - - - - -} - - - - //________________________________________________________________________ -PWR_THU_FabricationPlant::~PWR_THU_FabricationPlant() -{ - - -} - - - - - -void PWR_THU_FabricationPlant::BuildFuelForReactor(int ReactorId) -{ - //cout<<"INFO : This is a specific FabricationPlant"<<endl<<"GOOD JOB!!!"<<endl; - FuelDataBank* FuelType = GetParc()->GetReactor()[ReactorId]->GetFuelType(); - string ReactorType ="PWR"; - if(FuelType->GetFuelType() != "THU" || ReactorType !="PWR")//Check if the reactor is the right type and use the right type of fuel - { - ERROR << "!!Bad Trouble!! !!!FabricationPlant!!! Try to do MOX with a not MOXed DB" << endl; - exit (1); - } - - double HMmass = GetParc()->GetReactor()[ReactorId]->GetHeavyMetalMass(); - double BU = GetParc()->GetReactor()[ReactorId]->GetBurnUp(); - IsotopicVector FullUsedStock; - IsotopicVector stock; - - bool FuelBuild = false; - while(!FuelBuild) - { - double nU_0 = 0; - double MU_0 = 0; - { - map<ZAI ,double>::iterator it; - - map<ZAI ,double> isotopicquantity = GetDecay( FullUsedStock , GetCycleTime()).GetSpeciesComposition(92).GetIsotopicQuantity(); - for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++ ) - nU_0 += (*it).second; - - isotopicquantity = FullUsedStock.GetSpeciesComposition(92).GetIsotopicQuantity(); - for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++ ) - MU_0 += (*it).second*cZAIMass.fZAIMass.find( (*it).first )->second/AVOGADRO*1e-6; - } - - stock = GetStockToRecycle(); - if( stock.GetZAIIsotopicQuantity(ZAI(-1,-1,-1)) == 1 ) // Not enought stock to build the needed fuel - { - if (!fSubstitutionFuel) - { - { - EvolutionData evolutiondb; - pair<map<int, EvolutionData>::iterator, bool> IResult; - IResult = fReactorFuturDB.insert( pair<int, EvolutionData>(ReactorId,evolutiondb) ); - if(!IResult.second) - IResult.first->second = evolutiondb; - } - { - IsotopicVector EmptyIV; - pair<map<int, IsotopicVector>::iterator, bool> IResult; - IResult = fReactorFuturIV.insert( pair<int, IsotopicVector>(ReactorId,EmptyIV) ); - if(!IResult.second) - IResult.first->second = EmptyIV; - } - } - else - { - { - EvolutionData evolutiondb = fSubstitutionEvolutionData* HMmass; - pair<map<int, EvolutionData>::iterator, bool> IResult; - IResult = fReactorFuturDB.insert( pair<int, EvolutionData>(ReactorId,evolutiondb) ); - if(!IResult.second) - IResult.first->second = evolutiondb; - } - { - IsotopicVector IV = fSubstitutionEvolutionData.GetIsotopicVectorAt(0)* HMmass; - pair<map<int, IsotopicVector>::iterator, bool> IResult; - IResult = fReactorFuturIV.insert( pair<int, IsotopicVector>(ReactorId, IV) ); - if(!IResult.second) - IResult.first->second = IV; - } - - } - FuelBuild = true; - fFractionToTake.clear(); - } - else - { - double nU_1 = 0; - double MU_1 = 0; - double Sum_AlphaI_nUI = 0; - double Sum_AlphaI_nUI0 = 0; - { - map<ZAI ,double>::iterator it; - map<ZAI ,double> isotopicquantity = GetDecay( stock , GetCycleTime()).GetSpeciesComposition(92).GetIsotopicQuantity(); - - for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++ ) - { - if ((*it).first.A() >= 232 && (*it).first.A() <= 236) - { - nU_1 += (*it).second; - Sum_AlphaI_nUI += FuelType->GetFuelParameter()[(*it).first.A() -231]*(*it).second; - } - } - - isotopicquantity = stock.GetSpeciesComposition(92).GetIsotopicQuantity(); - 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)/AVOGADRO*1e-6; - } - - isotopicquantity = GetDecay( FullUsedStock , GetCycleTime()).GetSpeciesComposition(92).GetIsotopicQuantity(); - for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++ ) - if ((*it).first.A() >= 232 && (*it).first.A() <= 236) - { - Sum_AlphaI_nUI0 += FuelType->GetFuelParameter()[(*it).first.A() -231]*(*it).second; - } - } - - double StockFactionToUse = 0; - - 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] * 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 * AVOGADRO / (cZAIMass.fZAIMass.find( ZAI(90,232,0) )->second) ; - - StockFactionToUse = (N1 + N2 + N3) / (D1 + D2); - - if(StockFactionToUse < 0) - { - stock.GetActinidesComposition().Print(); - - ERROR << "!!Bad Trouble!! !!!FabricationPlant!!! Oups Bug in calculating stock fraction to use" << endl; - RecycleStock(0.); - FuelBuild = false; - - } - else if( StockFactionToUse > 1 ) - { - //cout<<"TEST TEST TEST TEST TEST Not enough Pu"<<endl; - - FullUsedStock += stock; - RecycleStock(1); - FuelBuild = false; - } - else - { - RecycleStock(StockFactionToUse); - - IsotopicVector IVBeginCycle; - FuelBuild = true; - - ZAI Th = ZAI(90,232,0); - //cout<<"TEST TEST TEST TEST TEST (HMmass - (MU_0+StockFactionToUse*MU_1 ) : "<<(HMmass - (MU_0+StockFactionToUse*MU_1 ))<<endl; - //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)*AVOGADRO/1e-6; - - GetParc()->AddOutIncomeIncome( Th, Th_Quantity); - - for(int i = (int)fFractionToTake.size()-1; i >= 0; i--) - { - IVBeginCycle += fStorage->GetIVArray()[fFractionToTake[i].first].GetSpeciesComposition(92)*( fFractionToTake[i].second ); - fReUsable->AddIV(fStorage->GetIVArray()[fFractionToTake[i].first]*(fFractionToTake[i].second) - - fStorage->GetIVArray()[fFractionToTake[i].first].GetSpeciesComposition(92)*(fFractionToTake[i].second)); - - fStorage->TakeFractionFromStock(fFractionToTake[i].first,fFractionToTake[i].second); - - } - fFractionToTake.clear(); - - IVBeginCycle += Th_Quantity*Th; - EvolutionData evolutiondb = BuildEvolutiveDB(ReactorId, IVBeginCycle); - - { - pair<map<int, EvolutionData>::iterator, bool> IResult; - IResult = fReactorFuturDB.insert( pair<int, EvolutionData>(ReactorId,evolutiondb) ); - if(!IResult.second) - IResult.first->second = evolutiondb; - } - { - pair<map<int, IsotopicVector>::iterator, bool> IResult; - IResult = fReactorFuturIV.insert( pair<int, IsotopicVector>(ReactorId,IVBeginCycle) ); - if(!IResult.second) - IResult.first->second = IVBeginCycle; - - AddCumulativeIVIn(IVBeginCycle); - fInsideIV += IVBeginCycle; - - - } - } - } - } - -} diff --git a/source/branches/CLASSV3/src/SeparationPlant.cxx b/source/branches/CLASSV3/src/SeparationPlant.cxx new file mode 100644 index 0000000000000000000000000000000000000000..4edf2edc69fc9c2d9146fac5dfc2388ade45b40c --- /dev/null +++ b/source/branches/CLASSV3/src/SeparationPlant.cxx @@ -0,0 +1,131 @@ +#include "SeparationPlant.hxx" + +#include "IsotopicVector.hxx" +#include "Storage.hxx" +#include "Scenario.hxx" +#include "CLASSLogger.hxx" + +#include <sstream> +#include <string> +#include <iostream> +#include <cmath> +#include <algorithm> + +//________________________________________________________________________ +// +// SeparationPlant +// +// +// +// +//________________________________________________________________________ +ClassImp(SeparationPlant) + + +SeparationPlant::SeparationPlant():CLASSBackEnd(8) +{ + fOutBackEndFacility = 0; + SetName("C_SeparationPlant."); + SetIsStorageType(); +} + +//________________________________________________________________________ +SeparationPlant::SeparationPlant(CLASSLogger* log, cSecond separationtime):CLASSBackEnd(log, separationtime, 8) +{ + + + fCycleTime = (cSecond)separationtime; + fIsStarted = false; + fPutToWaste = true; + fCoolingLastIndex = 0; + + fOutBackEndFacility = 0; + SetName("C_SeparationPlant."); + + SetIsStorageType(); + + INFO << " A new SeparationPlant has been define :" << endl; + INFO << "\t Creation time set at \t " << (double)(GetCreationTime()/3600/24/365.25) << " year" << endl; + INFO << "\t The Separation Time set at\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl; + WARNING << " All Separated Fuel go directly to WASTE after cooling !! " << endl; + + +} + + +//________________________________________________________________________ +SeparationPlant::~SeparationPlant() +{ + + +} + +//________________________________________________________________________ + +//________________________________________________________________________ +void SeparationPlant::SetStorageDestination(CLASSBackEnd* storagedestination, IsotopicVector isotopicvector, cSecond destinationstartingtime) +{ + + fDestinationStorageStartingTime.push_back(destinationstartingtime); + fDestinationStorage.push_back(storagedestination); + fDestinationStorageIV.push_back(isotopicvector); + + if(fDestinationStorage.size()>=2) + { + //checker que pas 2 fois le même ZAI + //Dans VectorIsotopic, BaM a fait des trucs cools + //-> IV->GetThisComposition(IV2) + } + if (fDestinationStorage.size() != fDestinationStorageIV.size()) + ERROR << " fDestinationStorage.size() != fDestinationStorageIV.size() !! " << endl; + + +/* + + + +les pertes non gérées -> WASTE par défaut + + + + +*/ +} + + +void SeparationPlant::AddIV(IsotopicVector IV) +{ + + for(int fds=0; fds<(int)fDestinationStorage.size(); fds++) + { + cSecond CurrentTime = GetParc()->GetAbsoluteTime(); + + INFO << "Separation..." <<endl; + INFO << "Current Time : " << CurrentTime <<endl; + INFO << "IV Separation Time : " << fDestinationStorageStartingTime[fds] <<endl; + + if(CurrentTime >= fDestinationStorageStartingTime[fds]) + { + IsotopicVector IVtmp; + IVtmp = IV.GetThisComposition(fDestinationStorageIV[fds]); + fDestinationStorage[fds]->AddIV(IVtmp); + IV -= IVtmp; + } + //IV.Print(); + + } + + GetParc()->AddWaste(IV); + + +} + +//________________________________________________________________________ +// Time Action with the reste of the Universe : +// Out Storage +// Evolution : +// Cooling +//________________________________________________________________________ + + +