From d494c8639d941a7b2868ce68afdbb10e6f73ea00 Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot <mouginot.baptiste@gmail.com> Date: Thu, 25 Jun 2015 21:16:41 +0000 Subject: [PATCH] add decay read in Evolutiondata "no no warning" remove olread from decay debug in XM model.. remove info in SeparationPlant git-svn-id: svn+ssh://svn.in2p3.fr/class@678 0e7d625b-0364-4367-a6be-d5be4a48d228 --- .../BaM_Dev/include/DecayDataBank.hxx | 9 +- .../BaM_Dev/include/EvolutionData.hxx | 16 +- .../BaM_Dev/include/FabricationPlant.hxx | 4 +- source/branches/BaM_Dev/src/DecayDataBank.cxx | 11 +- source/branches/BaM_Dev/src/EvolutionData.cxx | 29 +- .../branches/BaM_Dev/src/FabricationPlant.cxx | 15 +- source/branches/BaM_Dev/src/Reactor.cxx | 321 +++++++++--------- source/branches/BaM_Dev/src/Scenario.cxx | 5 - .../branches/BaM_Dev/src/SeparationPlant.cxx | 6 +- source/branches/BaM_Dev/src/XSModel.cxx | 14 +- 10 files changed, 234 insertions(+), 196 deletions(-) diff --git a/source/branches/BaM_Dev/include/DecayDataBank.hxx b/source/branches/BaM_Dev/include/DecayDataBank.hxx index e9a3d7615..e3050cac5 100644 --- a/source/branches/BaM_Dev/include/DecayDataBank.hxx +++ b/source/branches/BaM_Dev/include/DecayDataBank.hxx @@ -65,7 +65,7 @@ class DecayDataBank : public CLASSObject \param DB_index_file : path to the index file \param olfreadmethod : true if the old format of EvolutionData are used (deprecated) (ie without the key word such as Inv, XSFiss...) */ - DecayDataBank(string DB_index_file, bool olfreadmethod = false ); + DecayDataBank(string DB_index_file ); //} //{ /// Special Constructor. @@ -75,7 +75,7 @@ class DecayDataBank : public CLASSObject \param DB_index_file : path to the index file \param olfreadmethod : true if the old format of EvolutionData are used (ie without the key word such as Inv, XSFiss...) */ - DecayDataBank(CLASSLogger* Log, string DB_index_file, bool olfreadmethod = false ); + DecayDataBank(CLASSLogger* Log, string DB_index_file ); //} //{ @@ -127,9 +127,7 @@ class DecayDataBank : public CLASSObject { fDecayDataBank = mymap; } //!< Set the DecayDataBank map void SetDataBaseIndex(string database) { fDataBaseIndex = database;; ReadDataBase(); } //!< Set the name of the database index - - void SetOldReadMethod(bool val) { fOldReadMethod = val; ReadDataBase();} ///< use the old reading method - + void SetFastCalculation(bool val) { fFastCalculation = val; } //} @@ -172,7 +170,6 @@ class DecayDataBank : public CLASSObject map<ZAI, EvolutionData> fDecayDataBank; ///< DataBank map string fDataBaseIndex; ///< Name of the index - bool fOldReadMethod; ///< use old DB format }; diff --git a/source/branches/BaM_Dev/include/EvolutionData.hxx b/source/branches/BaM_Dev/include/EvolutionData.hxx index 7d0a20e9e..df13f19c8 100755 --- a/source/branches/BaM_Dev/include/EvolutionData.hxx +++ b/source/branches/BaM_Dev/include/EvolutionData.hxx @@ -84,7 +84,19 @@ public : \param oldread true if the oldmethod should be use to read the DatBase File (deprecated) \param zai set the ZAI if you want to add a stable nuclei. */ - EvolutionData(CLASSLogger* log, string DB_file, bool oldread = false, ZAI zai = ZAI(0,0,0) ); + EvolutionData(CLASSLogger* log, string DB_file, bool isDecay = false, ZAI zai = ZAI(0,0,0) ); + //} + + //{ + /// Special Constructor. + /*! + Make a new EvolutionData + \param log : used for the log. + \param DB_file path to the DataBase file + \param oldread true if the oldmethod should be use to read the DatBase File (deprecated) + \param zai set the ZAI if you want to add a stable nuclei. + */ + EvolutionData(bool oldread, CLASSLogger* log, string DB_file, bool isDecay = false, ZAI zai = ZAI(0,0,0) ); //} @@ -219,7 +231,7 @@ protected : cSecond fFinalTime; ///< time of the last point bool fIsCrossSection; ///< true if some cross section are present in the database - + bool fisDecay; string fReactorType; ///< Type of reactor diff --git a/source/branches/BaM_Dev/include/FabricationPlant.hxx b/source/branches/BaM_Dev/include/FabricationPlant.hxx index 23f753bfb..61ed7cd8b 100644 --- a/source/branches/BaM_Dev/include/FabricationPlant.hxx +++ b/source/branches/BaM_Dev/include/FabricationPlant.hxx @@ -100,7 +100,7 @@ public : void AddReactor(int reactorid, double creationtime) - { fReactorNextStep.insert( pair<int,cSecond> (reactorid, (cSecond)creationtime-GetCycleTime() ) ); } //!< Add a new reactor to be filled with the fresh fuel build by the FabricationPlant + { fReactorNextStep.insert( pair<int,cSecond> (reactorid, (cSecond)creationtime-GetCycleTime() ) ); } //!< Add a new reactor to be filled with the fresh fuel build by the FabricationPlant void SetReUsableStorage(Storage* store) { fReUsable = store; fIsReusable = true;} //!< Set the Storage where all the separated matetial not used in the fabrication process will be sent. (if not present it goes to WASTE) #endif @@ -130,7 +130,7 @@ public : map<int, IsotopicVector > GetReactorFuturIncome() const { return fReactorFuturIV;} //!< Return the list of the futur fuel IV - + cSecond GetFabricationTime() const {return GetCycleTime();} //@} diff --git a/source/branches/BaM_Dev/src/DecayDataBank.cxx b/source/branches/BaM_Dev/src/DecayDataBank.cxx index 6110a657b..dd800660b 100644 --- a/source/branches/BaM_Dev/src/DecayDataBank.cxx +++ b/source/branches/BaM_Dev/src/DecayDataBank.cxx @@ -30,7 +30,6 @@ DecayDataBank::DecayDataBank():CLASSObject(new CLASSLogger("DecayDataBank.log")) string CLASSPATH = getenv("CLASS_PATH"); string DB_index_file = CLASSPATH + "/DATA_BASES/DECAY/ALL/Decay.idx"; fDataBaseIndex = DB_index_file; - fOldReadMethod = false; fFastCalculation = true; // Warning @@ -46,11 +45,10 @@ DecayDataBank::DecayDataBank():CLASSObject(new CLASSLogger("DecayDataBank.log")) //________________________________________________________________________ -DecayDataBank::DecayDataBank(string DB_index_file, bool olfreadmethod):CLASSObject(new CLASSLogger("DecayDataBank.log")) +DecayDataBank::DecayDataBank(string DB_index_file):CLASSObject(new CLASSLogger("DecayDataBank.log")) { fDataBaseIndex = DB_index_file; - fOldReadMethod = olfreadmethod; fFastCalculation = true; // Warning @@ -60,11 +58,10 @@ DecayDataBank::DecayDataBank(string DB_index_file, bool olfreadmethod):CLASSObje } //________________________________________________________________________ -DecayDataBank::DecayDataBank(CLASSLogger* log, string DB_index_file, bool olfreadmethod):CLASSObject(log) +DecayDataBank::DecayDataBank(CLASSLogger* log, string DB_index_file):CLASSObject(log) { fDataBaseIndex = DB_index_file; - fOldReadMethod = olfreadmethod; fFastCalculation = true; // Warning @@ -114,7 +111,7 @@ DBGL if(rZ == zai.Z() && rA == zai.A() && rI == zai.I() ) { string file_name = StringLine::NextWord(line,start); - EvolutionData evolutionproduct = EvolutionData(GetLog(), file_name, fOldReadMethod); + EvolutionData evolutionproduct = EvolutionData(GetLog(), file_name, true); #pragma omp critical(DBupdate) {fDecayDataBank.insert( pair<ZAI ,EvolutionData >(zai, evolutionproduct) );} returnIV = evolutionproduct.GetIsotopicVectorAt(dt); @@ -127,7 +124,7 @@ DBGL WARNING << " Oups... Can't Find the ZAI : " << zai.Z() << " " << zai.A() << " " << zai.I() << "!!! It will be considered as stable !!" << endl; - EvolutionData evolutionproduct = EvolutionData(GetLog()," " , false, zai); + EvolutionData evolutionproduct = EvolutionData(GetLog()," " , true, zai); {fDecayDataBank.insert( pair<ZAI, EvolutionData >(zai, evolutionproduct) );} returnIV = evolutionproduct.GetIsotopicVectorAt(dt); diff --git a/source/branches/BaM_Dev/src/EvolutionData.cxx b/source/branches/BaM_Dev/src/EvolutionData.cxx index e06985a6b..a71bd88f7 100755 --- a/source/branches/BaM_Dev/src/EvolutionData.cxx +++ b/source/branches/BaM_Dev/src/EvolutionData.cxx @@ -363,7 +363,7 @@ EvolutionData::EvolutionData(CLASSLogger* log):CLASSObject(log) } //________________________________________________________________________ -EvolutionData::EvolutionData(CLASSLogger* log, string DB_file, bool oldread, ZAI zai):CLASSObject(log) +EvolutionData::EvolutionData(CLASSLogger* log, string DB_file, bool isDecay, ZAI zai):CLASSObject(log) { fIsCrossSection = false; @@ -372,6 +372,30 @@ EvolutionData::EvolutionData(CLASSLogger* log, string DB_file, bool oldread, ZAI fCycleTime = 0; fKeff = 0; fFlux = 0; + fisDecay = isDecay; + + if(zai != ZAI(0,0,0)) + AddAsStable(zai); + else + ReadDB( fDB_file, false); // Read Evolution Produc DB file name + + + + +} + + +//________________________________________________________________________ +EvolutionData::EvolutionData(bool oldread, CLASSLogger* log, string DB_file, bool isDecay, ZAI zai):CLASSObject(log) +{ + + fIsCrossSection = false; + fDB_file = DB_file; + fPower = 0; + fCycleTime = 0; + fKeff = 0; + fFlux = 0; + fisDecay = isDecay; if(zai != ZAI(0,0,0)) AddAsStable(zai); @@ -569,7 +593,8 @@ void EvolutionData::ReadDB(string DBfile, bool oldread) return; } - ReadInfo(); // Read the .info associeted + if(!fisDecay) + ReadInfo(); // Read the .info associeted ifstream DecayDB(DBfile.c_str()); // Open the File if(!DecayDB) //check if file is correctly open diff --git a/source/branches/BaM_Dev/src/FabricationPlant.cxx b/source/branches/BaM_Dev/src/FabricationPlant.cxx index 341802fc7..3043bc3ba 100644 --- a/source/branches/BaM_Dev/src/FabricationPlant.cxx +++ b/source/branches/BaM_Dev/src/FabricationPlant.cxx @@ -249,7 +249,8 @@ void FabricationPlant::BuildFuelForReactor(int ReactorId, cSecond t) { DBGV("Building process failed: ") if (!fSubstitutionFuel) - { DBGV("Reactor not loaded ") + { + DBGV("Reactor not loaded ") { EvolutionData EmptyDB; pair<map<int, EvolutionData>::iterator, bool> IResult; @@ -266,9 +267,11 @@ void FabricationPlant::BuildFuelForReactor(int ReactorId, cSecond t) } } else - { DBGV("Using substitute : ") + { + DBGV("Using substitute : ") if(fSubstitutionFissile)//if the build fail possibility to take a fissile material from an infinite fissile stock (if infinite stock defined) - { DBGV("->From an infinite stock") + { + DBGV("->From an infinite stock") //make the user specified fissil composition to decay the fabrication time IsotopicVector CooledSeparatedIV = GetDecay(fSubstitutionFissileIV, GetCycleTime()); //Building the fuel : @@ -299,7 +302,8 @@ void FabricationPlant::BuildFuelForReactor(int ReactorId, cSecond t) DBGL } else - { DBGV("->From a fixed data base") + { + DBGV("->From a fixed data base") IsotopicVector IV = fSubstitutionEvolutionData.GetIsotopicVectorAt(0); EvolutionData evolutiondb = fSubstitutionEvolutionData * R_HM_Mass / IV.GetTotalMass(); @@ -321,7 +325,8 @@ void FabricationPlant::BuildFuelForReactor(int ReactorId, cSecond t) AddCumulativeIVIn(IV); } - }DBGL + } + DBGL ResetArrays(); return; diff --git a/source/branches/BaM_Dev/src/Reactor.cxx b/source/branches/BaM_Dev/src/Reactor.cxx index 401e285f6..c49d26cc6 100755 --- a/source/branches/BaM_Dev/src/Reactor.cxx +++ b/source/branches/BaM_Dev/src/Reactor.cxx @@ -28,68 +28,68 @@ ClassImp(Reactor) Reactor::Reactor():CLASSFacility(4) { - + SetName("R_Reactor."); - + fOutBackEndFacility = 0; fStorage = 0; fFabricationPlant = 0; fFuelPlan = 0; - + } Reactor::Reactor(CLASSLogger* log):CLASSFacility(log, 4) { DBGL - + fOutBackEndFacility = 0; fStorage = 0; fFabricationPlant = 0; fFuelPlan = 0; SetName("R_Reactor."); - + DBGL } Reactor::Reactor(CLASSLogger* log, CLASSBackEnd* Pool, - cSecond creationtime, - cSecond lifetime, - double power, double HMMass, double CapacityFactor ):CLASSFacility(log, creationtime, lifetime, 4) + cSecond creationtime, + cSecond lifetime, + double power, double HMMass, double CapacityFactor ):CLASSFacility(log, creationtime, lifetime, 4) { DBGL (*this).SetName("R_Reactor."); - - + + fIsStarted = false; fIsShutDown = false; fIsAtEndOfCycle = false; - + fStorage = 0; fFabricationPlant = 0; - + fFixedFuel = true; fIsStorage = false; - + fOutBackEndFacility = Pool; - + fPower = power * CapacityFactor; fEfficiencyFactor = 0.33; fElectricPower = fEfficiencyFactor*fPower; - + fHeavyMetalMass = HMMass; - + fBurnUp = -1; fCycleTime = (-1); - + fIVBeginCycle = fEvolutionDB.GetIsotopicVectorAt(0); fIVInCycle = fEvolutionDB.GetIsotopicVectorAt(0); fIVOutCycle = fEvolutionDB.GetIsotopicVectorAt( (cSecond)(fCycleTime/fEvolutionDB.GetPower()*fPower) ); - - + + fFuelPlan = 0; - + INFO << " A Reactor has been define :" << endl; INFO << "\t Fuel Composition is fixed (for now)! "<< endl; INFO << "\t Creation time set at \t " << ((double)GetCreationTime())/((double)cYear) << " year" << endl; @@ -98,28 +98,28 @@ Reactor::Reactor(CLASSLogger* log, 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 CapacityFactor):CLASSFacility(log, creationtime, lifetime, 4) + cSecond creationtime, cSecond lifetime, + double Power, double HMMass, double CapacityFactor):CLASSFacility(log, creationtime, lifetime, 4) { DBGL (*this).SetName("R_Reactor."); - - + + fStorage = 0; fIsStarted = false; fIsShutDown = false; fIsAtEndOfCycle = false; - + fFabricationPlant = fabricationplant; fFixedFuel = false; - + fOutBackEndFacility = Pool; - + fBurnUp = -1; fHeavyMetalMass = HMMass; fPower = Power*CapacityFactor; @@ -127,11 +127,11 @@ Reactor::Reactor(CLASSLogger* log, fElectricPower = fEfficiencyFactor*fPower; fCycleTime = -1; //BU in GWd/t - + fFuelPlan = 0; - - - + + + INFO << " A Reactor has been define :" << endl; INFO << "\t Fuel Composition is not fixed (for now)! "<< endl; INFO << "\t Creation time set at \t " << ((double)GetCreationTime())/((double)cYear) << " year" << endl; @@ -141,41 +141,41 @@ Reactor::Reactor(CLASSLogger* log, DBGL - + } Reactor::Reactor(CLASSLogger* log, PhysicsModels* fueltypeDB, FabricationPlant* fabricationplant, CLASSBackEnd* Pool, - cSecond creationtime, cSecond lifetime, - double Power, double HMMass, double BurnUp, double CapacityFactor):CLASSFacility(log, creationtime, lifetime, 4) + cSecond creationtime, cSecond lifetime, + double Power, double HMMass, double BurnUp, double CapacityFactor):CLASSFacility(log, creationtime, lifetime, 4) { DBGL (*this).SetName("R_Reactor."); - - + + fStorage = 0; fIsStarted = false; fIsShutDown = false; fIsAtEndOfCycle = false; - + fFabricationPlant = fabricationplant; - + fFixedFuel = false; - + fOutBackEndFacility = Pool; - + fBurnUp = BurnUp; fHeavyMetalMass = HMMass; fPower = Power*CapacityFactor; fEfficiencyFactor = 0.33; fElectricPower = fEfficiencyFactor*fPower; fCycleTime = (cSecond) (fBurnUp*1e9 / (fPower) * fHeavyMetalMass *3600*24); //BU in GWd/t - + fFuelPlan = new CLASSFuelPlan(log); fFuelPlan->AddFuel(creationtime, CLASSFuel(fueltypeDB), fBurnUp); - - - + + + INFO << " A Reactor has been define :" << endl; INFO << "\t Fuel Composition is not fixed ! "<< endl; INFO << "\t Creation time set at \t " << (double)(GetCreationTime()/cYear) << " year" << endl; @@ -184,33 +184,33 @@ Reactor::Reactor(CLASSLogger* log, PhysicsModels* fueltypeDB, FabricationPlant* 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)/((double)cYear) << " 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, FabricationPlant* fabricationplant, - CLASSBackEnd* Pool, - cSecond creationtime, cSecond lifetime, cSecond cycletime, - double HMMass, double BurnUp):CLASSFacility(log, creationtime, lifetime, cycletime, 4) + CLASSBackEnd* Pool, + cSecond creationtime, cSecond lifetime, cSecond cycletime, + double HMMass, double BurnUp):CLASSFacility(log, creationtime, lifetime, cycletime, 4) { DBGL (*this).SetName("R_Reactor."); - - + + fIsStarted = false; fIsShutDown = false; fIsAtEndOfCycle = false; - + fStorage = 0; - + fFabricationPlant = fabricationplant; fFixedFuel = false; fBurnUp = BurnUp; fHeavyMetalMass = HMMass; - + fOutBackEndFacility = Pool; fPower = BurnUp*3600.*24. / (fCycleTime) * HMMass *1e9; //BU in GWd/t fEfficiencyFactor = 0.33; @@ -218,8 +218,8 @@ Reactor::Reactor(CLASSLogger* log, PhysicsModels* fueltypeDB, fFuelPlan = new CLASSFuelPlan(log); fFuelPlan->AddFuel(creationtime, CLASSFuel(fueltypeDB), fBurnUp); - - + + INFO << " A Reactor has been define :" << endl; INFO << "\t Fuel Composition is not fixed ! "<< endl; INFO << "\t Creation time set at \t " << ((double)GetCreationTime())/((double)cYear) << " year" << endl; @@ -228,55 +228,55 @@ Reactor::Reactor(CLASSLogger* log, PhysicsModels* fueltypeDB, INFO << "\t Burn-Up at end of Cycle set at \t " << (double)(fBurnUp) << " GWj/t" << endl; INFO << "\t The corresponding Effective Thermal Power is \t " << (double)(fPower *1e-6) << " MW" << endl; INFO << "\t The Heavy Metal Mass in the Core set at " << (double)(fHeavyMetalMass) << " tons" << endl << endl; - - + + DBGL - + } Reactor::Reactor(CLASSLogger* log, EvolutionData* evolutivedb, - CLASSBackEnd* Pool, - cSecond creationtime, - cSecond lifetime, - double power, double HMMass, double BurnUp, double CapacityFactor ):CLASSFacility(log, creationtime, lifetime, 4) + CLASSBackEnd* Pool, + cSecond creationtime, + cSecond lifetime, + double power, double HMMass, double BurnUp, double CapacityFactor ):CLASSFacility(log, creationtime, lifetime, 4) { DBGL (*this).SetName("R_Reactor."); - - + + fIsStarted = false; fIsShutDown = false; fIsAtEndOfCycle = false; - + fStorage = 0; fFabricationPlant = 0; - + fFixedFuel = true; fIsStorage = false; - + fOutBackEndFacility = Pool; - + fPower = power * CapacityFactor; fEfficiencyFactor = 0.33; fElectricPower = fEfficiencyFactor*fPower; fHeavyMetalMass = HMMass; - + double M0 = cZAIMass.GetMass( evolutivedb->GetIsotopicVectorAt(0.).GetActinidesComposition() ); - + fEvolutionDB = (*evolutivedb) * (fHeavyMetalMass/M0); - + fBurnUp = BurnUp; fCycleTime = (cSecond) (fBurnUp*1e9 / (fPower) * fHeavyMetalMass *3600*24); - + fIVBeginCycle = fEvolutionDB.GetIsotopicVectorAt(0); fIVInCycle = fEvolutionDB.GetIsotopicVectorAt(0); fIVOutCycle = fEvolutionDB.GetIsotopicVectorAt( (cSecond)(fCycleTime/fEvolutionDB.GetPower()*fPower) ); - + 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()/cYear) << " year" << endl; @@ -284,52 +284,52 @@ Reactor::Reactor(CLASSLogger* log, EvolutionData* evolutivedb, INFO << "\t The Cycle Time set at\t " << ((double)fCycleTime)/((double)cYear) << " year" << 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, - CLASSBackEnd* Pool, - cSecond creationtime, cSecond lifetime, cSecond cycletime, + CLASSBackEnd* Pool, + cSecond creationtime, cSecond lifetime, cSecond cycletime, double HMMass, double BurnUp ):CLASSFacility(log, creationtime, lifetime, cycletime, 4) { DBGL (*this).SetName("R_Reactor."); - - + + fIsStarted = false; fIsShutDown = false; fIsAtEndOfCycle = false; - + fStorage = 0; fFabricationPlant = 0; - + fFixedFuel = true; fIsStorage = false; - + fOutBackEndFacility = Pool; - + fPower = BurnUp*3600.*24. / (fCycleTime) * HMMass *1e9; //BU in GWd/t fEfficiencyFactor = 0.33; fElectricPower = fEfficiencyFactor*fPower; fHeavyMetalMass = HMMass; - + double M0 = cZAIMass.GetMass( evolutivedb->GetIsotopicVectorAt(0.).GetActinidesComposition() ); - + fEvolutionDB = (*evolutivedb) * (fHeavyMetalMass/M0); - + fBurnUp = BurnUp; - + fIVBeginCycle = fEvolutionDB.GetIsotopicVectorAt(0); fIVInCycle = fEvolutionDB.GetIsotopicVectorAt(0); fIVOutCycle = fEvolutionDB.GetIsotopicVectorAt( (cSecond)(fCycleTime/fEvolutionDB.GetPower()*fPower) ); - - + + 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())/((double)cYear) << " year" << endl; @@ -345,15 +345,15 @@ Reactor::Reactor(CLASSLogger* log, EvolutionData* evolutivedb, //________________________________________________________________________ Reactor::~Reactor() { - - + + } //________________________________________________________________________ void Reactor::SetCycleTime(double cycletime) { fCycleTime = (cSecond)cycletime; - + if(fFixedFuel==true) { fIVOutCycle = fEvolutionDB.GetIsotopicVectorAt(fCycleTime/fEvolutionDB.GetPower()*fPower); @@ -368,7 +368,7 @@ void Reactor::SetCycleTime(double cycletime) void Reactor::SetPower(double Power) { fPower = Power; - + if(fFixedFuel==true) { fCycleTime = (cSecond) (fBurnUp*1e9 / (fPower) * fHeavyMetalMass *3600*24); @@ -376,15 +376,15 @@ void Reactor::SetPower(double Power) } else fCycleTime = (cSecond)(fBurnUp*1e9 / (fPower) * fHeavyMetalMass *3600*24); //BU in GWd/t - - + + } //________________________________________________________________________ void Reactor::SetBurnUp(double BU) { - + fBurnUp = BU; - + if(fFixedFuel==true) { fCycleTime = (cSecond) (fBurnUp*1e9 / (fPower) * fHeavyMetalMass *3600*24); @@ -392,38 +392,39 @@ void Reactor::SetBurnUp(double BU) } else fCycleTime = (cSecond) (fBurnUp*1e9 / (fPower) * fHeavyMetalMass *3600*24); - + } //________________________________________________________________________ void Reactor::SetEvolutionDB(EvolutionData evolutionDB) { + DBGL double M0 = cZAIMass.GetMass( evolutionDB.GetIsotopicVectorAt(0.).GetActinidesComposition() ); fEvolutionDB = evolutionDB * (fHeavyMetalMass/M0); - + fIVOutCycle = fEvolutionDB.GetIsotopicVectorAt( (cSecond)(fCycleTime/fEvolutionDB.GetPower()*fPower) ); fIVBeginCycle = fEvolutionDB.GetIsotopicVectorAt(0); - - + DBGL + } //________________________________________________________________________ void Reactor::SetNewFuel(EvolutionData ivdb) { - + DBGL SetEvolutionDB(ivdb); - + DBGL } //________________________________________________________________________ void Reactor::Evolution(cSecond t) { -DBGL - - + DBGL + + if( fIsShutDown || t < GetCreationTime() ) return; // Reactor stop or not started... - + if(Norme(fInsideIV)!=0 && fIsStarted) { #pragma omp critical(ParcPowerUpdate) @@ -434,46 +435,46 @@ DBGL WARNING << " Reactor should be working but have no Heavy Nucleus Inside. It's not working so have a zero power..." << " Time : "<< t/cYear << " years" << endl; } - - + + if( t < fInternalTime ) return; if( t == fInternalTime && t!=GetCreationTime() ) return; - - - + + + if( t == GetCreationTime() && !fIsStarted) // Start of the Reactor { fIsAtEndOfCycle = true; fInsideIV = fIVBeginCycle; fInternalTime = t; fInCycleTime = 0; - + } - + // Check if the Reactor if started ... if(!fIsStarted) return; // If the reactor just start don't need to make Fuel evolution - - + + cSecond EvolutionTime = t - fInternalTime; // Calculation of the evolution time (relativ) - - + + if( EvolutionTime + fInCycleTime == fCycleTime ) //End of Cycle { fIsAtEndOfCycle = true; fInternalTime += EvolutionTime; // Update Internal Time fInCycleTime += EvolutionTime; // Update InCycleTime - + if(t >= GetCreationTime() + GetLifeTime()) // if the Next Cycle don't 'Exist... fIsShutDown = true; - - + + } else if(EvolutionTime + fInCycleTime < fCycleTime ) // During Cycle { - + fInternalTime += EvolutionTime; // Update Internal Time fInCycleTime += EvolutionTime; // Update InCycleTime - + fInsideIV = fEvolutionDB.GetIsotopicVectorAt( (cSecond)(fInCycleTime/fEvolutionDB.GetPower()*fPower) ); // update the fuel composition if(t>=GetCreationTime() + GetLifeTime()) fIsShutDown = true; } @@ -487,21 +488,21 @@ DBGL ERROR << " I have spend " << fInCycleTime +EvolutionTime << " and should have been " << fCycleTime << endl; exit(1); } - -DBGL + + DBGL } //________________________________________________________________________ void Reactor::Dump() { -DBGL - - + DBGL + + if(fInternalTime < GetCreationTime()) return; if(fIsShutDown && !fIsStarted) return; // Reactor stopped... if(!fIsAtEndOfCycle && !fIsShutDown) return; - -// First trash the irradiated fuel + + // First trash the irradiated fuel if(fIsAtEndOfCycle && !fIsShutDown ) { if(fIsStarted ) // A Cycle has already been done @@ -510,11 +511,11 @@ DBGL AddCumulativeIVOut(fInsideIV); } else fIsStarted = true; // Just start the first cycle - + } else if (fIsAtEndOfCycle && fIsShutDown ) //shutdown at end of Cycle { - + fOutBackEndFacility->AddIV(fIVOutCycle); AddCumulativeIVOut(fIVOutCycle); fInsideIV.Clear(); @@ -529,15 +530,15 @@ DBGL fInCycleTime = 0; fIsStarted = false; // shut down the Reactor } - - + + DBGL - - -// Get the new Fuel ! + + + // Get the new Fuel ! pair<CLASSFuel, double> NextFuel = fFuelPlan->GetFuelAt(fInternalTime); SetBurnUp((NextFuel).second); - + if( NextFuel.first.GetPhysicsModels() ) fFixedFuel = false; else if( NextFuel.first.GetEvolutionData() ) @@ -549,7 +550,7 @@ DBGL exit(1); } DBGL - + if(fFixedFuel ) { DBGL @@ -557,13 +558,13 @@ DBGL { SetEvolutionDB( *(NextFuel.first.GetEvolutionData()) ); fIsAtEndOfCycle = false; - - + + if(!GetParc()->GetStockManagement() && fIsStorage ) { IsotopicVector BuildIVtmp ; IsotopicVector OutIncomePart; - + //Get The Storage Compostion BuildIVtmp.Add(fStorage->GetInsideIV().GetIsotopicQuantity()); //Get the rest after IVIn creation @@ -574,18 +575,18 @@ DBGL fStorage->TakeFromStock( fIVInCycle - OutIncomePart); //And Get the rest from OutIncome GetParc()->AddOutIncome(OutIncomePart); - + } else GetParc()->AddOutIncome(fIVInCycle); - - + + fInsideIV = fIVBeginCycle; AddCumulativeIVIn(fIVBeginCycle); - + fInCycleTime = 0; } DBGL - + } else { @@ -595,28 +596,26 @@ DBGL ERROR << " Can't have unfixedFuel without stock management" << endl; exit(1); } - + if(fIsAtEndOfCycle && !fIsShutDown ) { fIsAtEndOfCycle = false; - SetNewFuel(fFabricationPlant->GetReactorEvolutionDB(GetId())); fFabricationPlant->TakeReactorFuel(GetId()); - - + fInsideIV = fIVBeginCycle; AddCumulativeIVIn(fIVBeginCycle); - + fInCycleTime = 0; } - + DBGL - + } -DBGL + DBGL } @@ -626,7 +625,7 @@ cSecond Reactor::GetNextCycleTime(cSecond time) { DBGL cSecond LastCycle = fInternalTime - fInCycleTime; - + while ( LastCycle < time) { cSecond cycletime = (cSecond)(fFuelPlan->GetFuelAt(LastCycle).second*1e9 / (fPower) * fHeavyMetalMass *3600*24); diff --git a/source/branches/BaM_Dev/src/Scenario.cxx b/source/branches/BaM_Dev/src/Scenario.cxx index 834521f24..1ef14f5d8 100755 --- a/source/branches/BaM_Dev/src/Scenario.cxx +++ b/source/branches/BaM_Dev/src/Scenario.cxx @@ -157,7 +157,6 @@ void Scenario::AddPool(Pool* Pool) fPool.push_back(Pool); fPool.back()->SetParc(this); fPool.back()->SetDecayDataBank( (*this).GetDecayDataBase() ); - fPool.back()->SetLog(GetLog()); fPool.back()->SetId((int)fPool.size()-1); fPool.back()->SetInternalTime(fAbsoluteTime); @@ -191,7 +190,6 @@ void Scenario::AddReactor(Reactor* reactor) fReactor.push_back(reactor); fReactor.back()->SetParc(this); - fReactor.back()->SetLog(GetLog()); fReactor.back()->SetId((int)fReactor.size()-1); fReactor.back()->SetInternalTime(fAbsoluteTime); @@ -226,7 +224,6 @@ void Scenario::AddStorage(Storage* storage) fStorage.push_back(storage); fStorage.back()->SetParc(this); fStorage.back()->SetDecayDataBank( (*this).GetDecayDataBase() ); - fStorage.back()->SetLog(GetLog()); fStorage.back()->SetId((int)fStorage.size()-1); fStorage.back()->SetInternalTime(fAbsoluteTime); @@ -260,7 +257,6 @@ void Scenario::AddFabricationPlant(FabricationPlant* fabricationplant) fFabricationPlant.push_back(fabricationplant); fFabricationPlant.back()->SetParc(this); fFabricationPlant.back()->SetDecayDataBank( (*this).GetDecayDataBase() ); - fFabricationPlant.back()->SetLog(GetLog()); fFabricationPlant.back()->SetId((int)fStorage.size()-1); fFabricationPlant.back()->SetInternalTime(fAbsoluteTime); @@ -293,7 +289,6 @@ void Scenario::AddSeparationPlant(SeparationPlant* SeparationPlant) fSeparationPlant.push_back(SeparationPlant); fSeparationPlant.back()->SetParc(this); fSeparationPlant.back()->SetDecayDataBank( (*this).GetDecayDataBase() ); - fSeparationPlant.back()->SetLog(GetLog()); fSeparationPlant.back()->SetId((int)fSeparationPlant.size()-1); fSeparationPlant.back()->SetInternalTime(fAbsoluteTime); diff --git a/source/branches/BaM_Dev/src/SeparationPlant.cxx b/source/branches/BaM_Dev/src/SeparationPlant.cxx index 00cae400e..9ae24ea82 100644 --- a/source/branches/BaM_Dev/src/SeparationPlant.cxx +++ b/source/branches/BaM_Dev/src/SeparationPlant.cxx @@ -83,9 +83,9 @@ DBGL { cSecond CurrentTime = GetParc()->GetAbsoluteTime(); - INFO << "Separation..." <<endl; - INFO << "Current Time : " << CurrentTime <<endl; - INFO << "IV Separation Time : " << fDestinationStorageStartingTime[fds] <<endl; + DBGV( "Separation..." <<endl); + DBGV( "Current Time : " << CurrentTime <<endl); + DBGV( "IV Separation Time : " << fDestinationStorageStartingTime[fds] <<endl); if(CurrentTime >= fDestinationStorageStartingTime[fds]) { diff --git a/source/branches/BaM_Dev/src/XSModel.cxx b/source/branches/BaM_Dev/src/XSModel.cxx index f2dcd6360..97e3f5a0c 100644 --- a/source/branches/BaM_Dev/src/XSModel.cxx +++ b/source/branches/BaM_Dev/src/XSModel.cxx @@ -9,6 +9,7 @@ #include "XSModel.hxx" #include "StringLine.hxx" #include "CLASSMethod.hxx" +#include "ZAI.hxx" using namespace std; @@ -100,7 +101,7 @@ void XSModel::ReadRParam(const string &line) } if( keyword == "k_mass" ) fDBHMMass = atof(StringLine::NextWord(line, pos, ' ').c_str()); - else if( keyword == "k_mass" ) + else if( keyword == "k_power" ) fDBPower = atof(StringLine::NextWord(line, pos, ' ').c_str()); DBGL @@ -141,9 +142,16 @@ void XSModel::ReadZAIlimits(const string &line) int A = atoi(StringLine::NextWord(line, pos, ' ').c_str()); int I = atoi(StringLine::NextWord(line, pos, ' ').c_str()); - double upLimit = atof(StringLine::NextWord(line, pos, ' ').c_str()); double downLimit = atof(StringLine::NextWord(line, pos, ' ').c_str()); - + double upLimit = atof(StringLine::NextWord(line, pos, ' ').c_str()); + + if (upLimit < downLimit) + { + double tmp = upLimit; + upLimit = downLimit; + downLimit = tmp; + } + fZAILimits.insert(pair<ZAI, pair<double, double> >(ZAI(Z,A,I), pair<double,double>(downLimit, upLimit))); DBGL } -- GitLab