From 2f6c89eb49e9595e1c4526fd06eebf45948a668a Mon Sep 17 00:00:00 2001 From: Baptiste LENIAU <baptiste.leniau@subatech.in2p3.fr> Date: Thu, 8 Oct 2015 14:57:22 +0000 Subject: [PATCH] save trunk as version 4.1 git-svn-id: svn+ssh://svn.in2p3.fr/class@792 0e7d625b-0364-4367-a6be-d5be4a48d228 --- .../tags/version4.1/ExampleParc_MLP_MOX.cxx | 364 +++++++++++++++++ .../version4.1/ExampleParc_MLP_MOX_Kinf.cxx | 380 ++++++++++++++++++ .../tags/version4.1/ExampleParc_QUAD_MOX.cxx | 364 +++++++++++++++++ example/tags/version4.1/FBR_Example.cxx | 143 +++++++ example/tags/version4.1/Separation.cxx | 177 ++++++++ example/tags/version4.1/SimpleReactor.cxx | 105 +++++ example/tags/version4.1/SimpleReactor2.cxx | 109 +++++ 7 files changed, 1642 insertions(+) create mode 100644 example/tags/version4.1/ExampleParc_MLP_MOX.cxx create mode 100644 example/tags/version4.1/ExampleParc_MLP_MOX_Kinf.cxx create mode 100644 example/tags/version4.1/ExampleParc_QUAD_MOX.cxx create mode 100644 example/tags/version4.1/FBR_Example.cxx create mode 100644 example/tags/version4.1/Separation.cxx create mode 100644 example/tags/version4.1/SimpleReactor.cxx create mode 100644 example/tags/version4.1/SimpleReactor2.cxx diff --git a/example/tags/version4.1/ExampleParc_MLP_MOX.cxx b/example/tags/version4.1/ExampleParc_MLP_MOX.cxx new file mode 100644 index 000000000..6b6c2f3b4 --- /dev/null +++ b/example/tags/version4.1/ExampleParc_MLP_MOX.cxx @@ -0,0 +1,364 @@ +/************************************************************/ +// DESCRIPTION +// +// +// Simple Scenario with 8 PWR UOX and one PWR MOX +// +// +// _______ ____ ______ _______________ +// | 10 x | | | | | | | +// |Reactor| =>|Pool|=>|Storage|=====>|FabricationPlant| +// | UOx | |UOX | | UOX | |________________| +// |_______| |____| |_______| || +// || +// \/ +// ______ ____ _______ +// | | | | | 1 x | +// |Storage|<=== |Pool|<==|Reactor| +// | MOX | |MOX | | MOX | +// |_______| |____| |_______| +// +// +//@author BaL +/***********************************************************/ +#include "CLASSHeaders.hxx" +#include <sstream> +#include <iomanip> +#include <math.h> +#include <string> +#include "XS/XSM_MLP.hxx" //Load the include for Neural network cross section predictor +#include "Irradiation/IM_RK4.hxx" //Load the include for Runge Kutta 4 resolution +#include "Equivalence/EQM_PWR_MLP_MOX.hxx" //Load the include for Neural Network Equivalence Model (PWRMOX) +using namespace std; + +int main(int argc, char** argv) +{ + //seconds in one year + cSecond year = 3600*24.*365.25; + /******LOG MANAGEMENT**********************************/ + //Definition of the Log file : CLASS messages output + int Std_output_level = 0; // Only error are shown in terminal + int File_output_level = 2; // Error + Warning + Info are shown in the file CLASS_OUTPUT.log + CLASSLogger *Logger = new CLASSLogger("CLASS_OUTPUT.log",Std_output_level,File_output_level); + + /******SCENARIO**********************************/ + // The scenario start at year 1977 + Scenario *gCLASS=new Scenario(1977*year,Logger); + gCLASS->SetStockManagement(true); //If false all the IsotopicVector in stocks are mixed together. + gCLASS->SetTimeStep(year/4.); //the scenario calculation is updated every 3 months + cSecond EndOfScenarioTime=2040*year; //Scenario ends in year 2040 + gCLASS->SetOutputFileName("ExampleParc_MLP.root"); //Set the name of the output file + + /******DATA BASES**********************************/ + //Geting CLASS to path + string CLASS_PATH = getenv("CLASS_PATH"); + if (CLASS_PATH=="") + { + cout<<" Please setenv CLASS_PATH to your CLASS installation folder in your .bashs or .tcshrc"<<endl; + exit(0); + } + string PATH_TO_DATA = CLASS_PATH + "/DATA_BASES/"; + + /*===Decay data base===*/ + //The decay data base is taken from the file Decay.idx + DecayDataBank* DecayDB = new DecayDataBank(gCLASS->GetLog(), PATH_TO_DATA + "DECAY/ALL/Decay.idx"); //you may have to open this file and do the proper changes according your path + gCLASS->SetDecayDataBase(DecayDB);//This decay data base will be used for all the decay calculations in this Scenario + + /*===Reactor data base===*/ + + // Reprocessed fuel PWR MOX + XSM_MLP* XSMOX = new XSM_MLP(gCLASS->GetLog(), PATH_TO_DATA + "PWR/MOX/XSModel/30Wg_FullMOX");//Defining the XS Predictor + IM_RK4 *IMRK4 = new IM_RK4(gCLASS->GetLog()); //Bateman's equation solver method (RungeKutta4) + EQM_PWR_MLP_MOX* EQMMLPPWRMOX = new EQM_PWR_MLP_MOX(gCLASS->GetLog(),PATH_TO_DATA + "PWR/MOX/EQModel/MLP/EQM_MLP_PWR_MOX_3batch.xml");//Defining the EquivalenceModel + PhysicsModels* PHYMOD = new PhysicsModels(XSMOX, EQMMLPPWRMOX, IMRK4); //The PhysicsModels containing the 3 object previously defined + + //Fixed fuel : PWR UOX + EvolutionData *CYCLADE = new EvolutionData(gCLASS->GetLog(), PATH_TO_DATA + "PWR/UOX/FixedFuel/CYCLADES.dat"); + EvolutionData *GARANCE = new EvolutionData(gCLASS->GetLog(), PATH_TO_DATA + "PWR/UOX/FixedFuel/GARANCE.dat"); + EvolutionData *STD900 = new EvolutionData(gCLASS->GetLog(), PATH_TO_DATA + "PWR/UOX/FixedFuel/STD900.dat"); + + /******FACILITIES*********************************/ + /*=== Stock===*/ + //Storage for UOX + Storage *StockUOX = new Storage(gCLASS->GetLog()); // Definition of the stock + StockUOX->SetName("StockUOX"); // Its name + gCLASS->Add(StockUOX); //Adding the stock to the Scenario + //Storage for MOX + Storage *StockMOX = new Storage(gCLASS->GetLog()); // Definition of the stock + StockMOX->SetName("StockMOX"); // Its name + gCLASS->Add(StockMOX); //Adding the stock to the Scenario + + /*===Pool===*/ + //Pool for UOX + Pool *Cooling_UOX = new Pool(gCLASS->GetLog(),StockUOX, 5*year); //After 5 years of cooling, the pool sends its content to "StockUOX" + Cooling_UOX->SetName("Pool_UOX"); + gCLASS->Add(Cooling_UOX); + //Pool for MOX + Pool *Cooling_MOX = new Pool(gCLASS->GetLog(),StockMOX, 5*year); //After 5 years of cooling, the pool sends its content to "StockMOX" + Cooling_MOX->SetName("Pool_MOX"); + gCLASS->Add(Cooling_MOX); + + /*===A FabricationPlant===*/ + FabricationPlant *FP_MOX = new FabricationPlant(gCLASS->GetLog(), 3*year); //Declare a FabricationPlant. After the build of the fuel, it decays during 3years before to be loaded in Reactor + FP_MOX->SetFiFo(false); //The latest isotopicVector to enter in "Stock" will be used to build the fuel (Opposite of First In First Out) + FP_MOX->SetName("Fab_MOX"); + FP_MOX->AddFissileStorage(StockUOX); //Tell the FP to look in StockUOX for fissionable material + //FP_MOX->AddFertileStorage(Stock2);//Tell the FP to look in Stock2 for fertile material + //If fertile stock is not defined (like here), CLASS get fertile from nature (OUTCOMING vector) + //FP_MOX->SetReUsableStorage(wastestock);//By default the fabricationplant get the list of nuclei defined in the EquivalenceModel (here EQM_MLP_MOX) from stock and send the others nuclei in WASTE. If user want these nuclei to go in another stock he can use the SetReUsableStorage function + gCLASS->AddFabricationPlant(FP_MOX); + + + /*=== Reactors : Pallier CP0===*/ + double Power_CP0 = 2.66e9; //Thermal power (in W) + + //Combustibles type : CYCLADE + double BurnUp_Cyclade = 47; // GWd/tHM + double HMMass_Cyclade = 72.3; //heavy metal mass (in tons) + + //Fessenheim power plant + //reactor n°1 + cSecond StartingTime = 1978*year; + cSecond LifeTime = (EndOfScenarioTime - StartingTime); + + Reactor* Fessenheim_1 = new Reactor(gCLASS->GetLog(),// Log + CYCLADE, // The DataBase used + Cooling_UOX, // Connected Backend facility : The reactor discharge its fuel into the Pool "Cooling_UOX" + StartingTime, // Starting time + LifeTime, // time of reactor life time + Power_CP0, // Power + HMMass_Cyclade, // HM mass + BurnUp_Cyclade, // BurnUp + 0.8); // Load Factor + + + Fessenheim_1->SetName("Fessenheim_1");// name of the reactor (as it will show up in the CLASSGui) + gCLASS->AddReactor(Fessenheim_1);//Add this reactor to the scenario + + //reactor n°2 + StartingTime = 1978*year; + LifeTime = (EndOfScenarioTime - StartingTime); + + Reactor* Fessenheim_2 = new Reactor(gCLASS->GetLog(),// Log + CYCLADE, // The DataBase used + Cooling_UOX, // Connected Backend facility : The reactor discharge its fuel into the Pool "Cooling_UOX" + StartingTime, // Starting time + LifeTime, // time of reactor life time + Power_CP0, // Power + HMMass_Cyclade, // HM mass + BurnUp_Cyclade, // BurnUp + 0.8); // Load Factor + + + Fessenheim_2->SetName("Fessenheim_2");// name of the reactor (as it will show up in the CLASSGui) + gCLASS->AddReactor(Fessenheim_2);//Add this reactor to the scenario + + //Bugey power plant + //reactor n°2 + StartingTime = 1979*year; + LifeTime = (EndOfScenarioTime - StartingTime); + Reactor* Bugey_2 = new Reactor(gCLASS->GetLog(),// Log + CYCLADE, // The DataBase used + Cooling_UOX, // Connected Backend facility : The reactor discharge its fuel into the Pool "Cooling_UOX" + StartingTime, // Starting time + LifeTime, // time of reactor life time + Power_CP0, // Power + HMMass_Cyclade, // HM mass + BurnUp_Cyclade, // BurnUp + 0.8); // Load Factor + + + Bugey_2->SetName("Bugey_2");// name of the reactor (as it will show up in the CLASSGui) + gCLASS->AddReactor(Bugey_2);//Add this reactor to the scenario + //reactor n° 3 + StartingTime = 1979*year; + LifeTime = (EndOfScenarioTime - StartingTime); + Reactor* Bugey_3 = new Reactor(gCLASS->GetLog(),// Log + CYCLADE, // The DataBase used + Cooling_UOX, // Connected Backend facility : The reactor discharge its fuel into the Pool "Cooling_UOX" + StartingTime, // Starting time + LifeTime, // time of reactor life time + Power_CP0, // Power + HMMass_Cyclade, // HM mass + BurnUp_Cyclade, // BurnUp + 0.8); // Load Factor + + + Bugey_3->SetName("Bugey_3");// name of the reactor (as it will show up in the CLASSGui) + gCLASS->AddReactor(Bugey_3);//Add this reactor to the scenario + + //reactor n° 4 + StartingTime = 1979*year; + LifeTime = (EndOfScenarioTime - StartingTime); + Reactor* Bugey_4 = new Reactor(gCLASS->GetLog(),// Log + CYCLADE, // The DataBase used + Cooling_UOX, // Connected Backend facility : The reactor discharge its fuel into the Pool "Cooling_UOX" + StartingTime, // Starting time + LifeTime, // time of reactor life time + Power_CP0, // Power + HMMass_Cyclade, // HM mass + BurnUp_Cyclade, // BurnUp + 0.8); // Load Factor + + + Bugey_4->SetName("Bugey_4");// name of the reactor (as it will show up in the CLASSGui) + gCLASS->AddReactor(Bugey_4);//Add this reactor to the scenario + + //reactor n° 5 + StartingTime = 1980*year; + LifeTime = (EndOfScenarioTime - StartingTime); + Reactor* Bugey_5 = new Reactor(gCLASS->GetLog(),// Log + CYCLADE, // The DataBase used + Cooling_UOX, // Connected Backend facility : The reactor discharge its fuel into the Pool "Cooling_UOX" + StartingTime, // Starting time + LifeTime, // time of reactor life time + Power_CP0, // Power + HMMass_Cyclade, // HM mass + BurnUp_Cyclade, // BurnUp + 0.8); // Load Factor + + + Bugey_5->SetName("Bugey_5");// name of the reactor (as it will show up in the CLASSGui) + gCLASS->AddReactor(Bugey_5);//Add this reactor to the scenario + + /*=== Reactors : Pallier CPY===*/ + double Power_CPY = 2.785e9; //Thermal power (in W) + //Combustibles type : GARANCE + double BurnUp_GARANCE = 42; // GWd/tHM + double HMMass_GARANCE = 72.3; //heavy metal mass (in tons) + + + // Gravelines power plant + //reactor n° 1 + StartingTime = 1980*year; + LifeTime = (EndOfScenarioTime - StartingTime); + Reactor* Gravelines_1 = new Reactor(gCLASS->GetLog(),// Log + GARANCE, // The DataBase used + Cooling_UOX, // Connected Backend + StartingTime, // Starting time + LifeTime, // time of reactor l + Power_CPY, // Power + HMMass_GARANCE, // HM mass + BurnUp_GARANCE, // BurnUp + 0.8); // Load Factor + + + Gravelines_1->SetName("Gravelines_1");// name of the reactor (as it will show + gCLASS->AddReactor(Gravelines_1);//Add this reactor to the scenario + + //Combustibles type : STANDARD 900 + double BurnUp_STD900 = 33; // GWd/tHM + double HMMass_STD900 = 72.3; //heavy metal mass (in tons) + + //reactor n° 2 + StartingTime = 1980*year; + LifeTime = (EndOfScenarioTime - StartingTime); + Reactor* Gravelines_2 = new Reactor(gCLASS->GetLog(),// Log + STD900, // The DataBase used + Cooling_UOX, // Connected Backend + StartingTime, // Starting time + LifeTime, // time of reactor l + Power_CPY, // Power + HMMass_STD900, // HM mass + BurnUp_STD900, // BurnUp + 0.8); // Load Factor + + + Gravelines_2->SetName("Gravelines_2");// name of the reactor (as it will show + gCLASS->AddReactor(Gravelines_2);//Add this reactor to the scenario + + // Tricastin power plant + + //reactor n° 1 + StartingTime = 1980*year; + LifeTime = (EndOfScenarioTime - StartingTime); + Reactor* Tricastin_1 = new Reactor(gCLASS->GetLog(),// Log + STD900, // The DataBase used + Cooling_UOX, // Connected Backend + StartingTime, // Starting time + LifeTime, // time of reactor l + Power_CPY, // Power + HMMass_STD900, // HM mass + BurnUp_STD900, // BurnUp + 0.8); // Load Factor + + + Tricastin_1->SetName("Tricastin_1");// name of the reactor (as it will ll sh + gCLASS->AddReactor(Tricastin_1);//Add this reactor to the scenario + + //reactor n° 2 + StartingTime = 1980*year; + LifeTime = (EndOfScenarioTime - StartingTime); + Reactor* Tricastin_2 = new Reactor(gCLASS->GetLog(),// Log + STD900, // The DataBase used + Cooling_UOX, // Connected Backend + StartingTime, // Starting time + LifeTime, // time of reactor l + Power_CPY, // Power + HMMass_STD900, // HM mass + BurnUp_STD900, // BurnUp + 0.8); // Load Factor + + + Tricastin_2->SetName("Tricastin_2");// name of the reactor (as it will l + gCLASS->AddReactor(Tricastin_2);//Add this reactor to the scenario + + + + + // Dampierre Power Plant UOX puis MOX + //UOX + cSecond Dampierre_MOX_Time = 1991*year; + + StartingTime = 1980*year; + LifeTime = Dampierre_MOX_Time - StartingTime; + double BunrUpMOX = 35; + Reactor* Dampierre_UOX = new Reactor(gCLASS->GetLog(),// Log + STD900, // The DataBase used + Cooling_UOX, // Connected Backend + StartingTime, // Starting time + LifeTime, // time of reactor l + Power_CPY, // Power + HMMass_STD900, // HM mass + BurnUp_STD900, // BurnUp + 0.8); // Load Factor + + + Dampierre_UOX->SetName("Dampierre_UOX");// name of the reactor (as it will l + gCLASS->AddReactor(Dampierre_UOX);//Add this reactor to the scenario + + //the PWR MOX + StartingTime = Dampierre_MOX_Time; + LifeTime = EndOfScenarioTime - StartingTime; + Reactor* Dampierre_MOX = new Reactor(gCLASS->GetLog(),// Log + PHYMOD, // The models used to build the fuel & to calculate its evolution + FP_MOX, // The FabricationPlant + Cooling_MOX, // Connected Backend + StartingTime, // Starting time + LifeTime, // time of reactor l + Power_CPY, // Power + HMMass_STD900, // HM mass + BunrUpMOX, // BurnUp + 0.8); // Load Factor + + Dampierre_MOX->SetName("Dampierre_MOX");// name of the reactor (as it will l + gCLASS->AddReactor(Dampierre_MOX);//Add this reactor to the scenario + + + + gCLASS->Evolution((double)EndOfScenarioTime);//Perform the calculation from year 1977(defined in Scenario declaration) to year 2018 + + delete gCLASS; + +} + + +//========================================================================================== +// Compilation +//========================================================================================== +/* + + \rm CLASS* ; g++ -o CLASS_Exec ExampleParc_MLP_MOX.cxx -I $CLASS_include -L $CLASS_lib -lCLASSpkg `root-config --cflags` `root-config --libs` -fopenmp -lgomp -Wunused-result + + + */ diff --git a/example/tags/version4.1/ExampleParc_MLP_MOX_Kinf.cxx b/example/tags/version4.1/ExampleParc_MLP_MOX_Kinf.cxx new file mode 100644 index 000000000..2c05af353 --- /dev/null +++ b/example/tags/version4.1/ExampleParc_MLP_MOX_Kinf.cxx @@ -0,0 +1,380 @@ +/************************************************************/ +// DESCRIPTION +// +// +// Simple Scenario with 8 PWR UOX and one PWR MOX +// +// +// _______ ____ ______ _______________ +// | 10 x | | | | | | | +// |Reactor| =>|Pool|=>|Storage|=====>|FabricationPlant| +// | UOx | |UOX | | UOX | |________________| +// |_______| |____| |_______| || +// || +// \/ +// ______ ____ _______ +// | | | | | 1 x | +// |Storage|<=== |Pool|<==|Reactor| +// | MOX | |MOX | | MOX | +// |_______| |____| |_______| +// +// +//@author BaL +/***********************************************************/ +#include "CLASSHeaders.hxx" +#include <sstream> +#include <iomanip> +#include <math.h> +#include <string> +#include "XS/XSM_MLP.hxx" //Load the include for Neural network cross section predictor +#include "Irradiation/IM_RK4.hxx" //Load the include for Runge Kutta 4 resolution +#include "Equivalence/EQM_MLP_Kinf.hxx" //Load the include for Neural Network Equivalence Model (PWRMOX) +using namespace std; + +int main(int argc, char** argv) +{ + //seconds in one year + cSecond year = 3600*24.*365.25; + /******LOG MANAGEMENT**********************************/ + //Definition of the Log file : CLASS messages output + int Std_output_level = 0; // Only error are shown in terminal + int File_output_level = 2; // Error + Warning + Info are shown in the file CLASS_OUTPUT.log + CLASSLogger *Logger = new CLASSLogger("CLASS_OUTPUT.log",Std_output_level,File_output_level); + + /******SCENARIO**********************************/ + // The scenario start at year 1977 + Scenario *gCLASS=new Scenario(1977*year,Logger); + gCLASS->SetStockManagement(true); //If false all the IsotopicVector in stocks are mixed together. + gCLASS->SetTimeStep(year/2.); //the scenario calculation is updated every 3 months + cSecond EndOfScenarioTime=2010*year; //Scenario ends in year 2040 + gCLASS->SetOutputFileName("ExampleParc_MLP_Kinf_Kpred.root"); //Set the name of the output file + + /******DATA BASES**********************************/ + //Geting CLASS to path + string CLASS_PATH = getenv("CLASS_PATH"); + if (CLASS_PATH=="") + { + cout<<" Please setenv CLASS_PATH to your CLASS installation folder in your .bashs or .tcshrc"<<endl; + exit(0); + } + string PATH_TO_DATA = CLASS_PATH+"/DATA_BASES/"; + + /*===Decay data base===*/ + //The decay data base is taken from the file Decay.idx + DecayDataBank* DecayDB = new DecayDataBank(gCLASS->GetLog(), PATH_TO_DATA + "DECAY/ALL/Decay.idx"); //you may have to open this file and do the proper changes according your path + gCLASS->SetDecayDataBase(DecayDB);//This decay data base will be used for all the decay calculations in this Scenario + + /*===Reactor data base===*/ + + // Reprocessed fuel PWR MOX + XSM_MLP* XSMOX = new XSM_MLP(gCLASS->GetLog(), PATH_TO_DATA + "PWR/MOX/XSModel/30Wg_FullMOX");//Defining the XS Predictor + IM_RK4 *IMRK4 = new IM_RK4(gCLASS->GetLog()); //Bateman's equation solver method (RungeKutta4) + + //Defining the EquivalenceModel + int NumberOfBatches = 3 ; //The maximum reachable burnup is calculated using a fuel management of 1/3 + double K_Threshold = 1.02 ; //Threshold on the average (over batches) kinfinite . + + //Constructor where kinfini is predicted with a mlp + EQM_MLP_Kinf* EQMMLPPWRMOX = new EQM_MLP_Kinf(gCLASS->GetLog(),PATH_TO_DATA + "PWR/MOX/EQModel/MLP_Kinf/MLP/PWR_MOX_30Wg.xml",NumberOfBatches,"",K_Threshold); + + //Constructor where kinfini is predicted as a 2nd order polynome with weight predicted with mlps + /*EQM_MLP_Kinf* EQMMLPPWRMOX = new EQM_MLP_Kinf(gCLASS->GetLog(), + PATH_TO_DATA + "PWR/MOX/EQModel/MLP_Kinf/POL2/MLP_POL2_Alpha_0.xml", + PATH_TO_DATA + "PWR/MOX/EQModel/MLP_Kinf/POL2/MLP_POL2_Alpha_1.xml", + PATH_TO_DATA + "PWR/MOX/EQModel/MLP_Kinf/POL2/MLP_POL2_Alpha_2.xml", + PATH_TO_DATA + "PWR/MOX/EQModel/MLP_Kinf/POL2/PWR_MOX_30Wg.nfo", + NumberOfBatches,K_Threshold);//Defining the EquivalenceModel + */ + + PhysicsModels* PHYMOD = new PhysicsModels(XSMOX, EQMMLPPWRMOX, IMRK4); //The PhysicsModels containing the 3 object previously defined + + //Fixed fuel : PWR UOX + EvolutionData *CYCLADE = new EvolutionData(gCLASS->GetLog(), PATH_TO_DATA + "PWR/UOX/FixedFuel/CYCLADES.dat"); + EvolutionData *GARANCE = new EvolutionData(gCLASS->GetLog(), PATH_TO_DATA + "PWR/UOX/FixedFuel/GARANCE.dat"); + EvolutionData *STD900 = new EvolutionData(gCLASS->GetLog(), PATH_TO_DATA + "PWR/UOX/FixedFuel/STD900.dat"); + + /******FACILITIES*********************************/ + /*=== Stock===*/ + //Storage for UOX + Storage *StockUOX = new Storage(gCLASS->GetLog()); // Definition of the stock + StockUOX->SetName("StockUOX"); // Its name + gCLASS->Add(StockUOX); //Adding the stock to the Scenario + //Storage for MOX + Storage *StockMOX = new Storage(gCLASS->GetLog()); // Definition of the stock + StockMOX->SetName("StockMOX"); // Its name + gCLASS->Add(StockMOX); //Adding the stock to the Scenario + + /*===Pool===*/ + //Pool for UOX + Pool *Cooling_UOX = new Pool(gCLASS->GetLog(),StockUOX, 5*year); //After 5 years of cooling, the pool sends its content to "StockUOX" + Cooling_UOX->SetName("Pool_UOX"); + gCLASS->Add(Cooling_UOX); + //Pool for MOX + Pool *Cooling_MOX = new Pool(gCLASS->GetLog(),StockMOX, 5*year); //After 5 years of cooling, the pool sends its content to "StockMOX" + Cooling_MOX->SetName("Pool_MOX"); + gCLASS->Add(Cooling_MOX); + + /*===A FabricationPlant===*/ + FabricationPlant *FP_MOX = new FabricationPlant(gCLASS->GetLog(), 3*year); //Declare a FabricationPlant. After the build of the fuel, it decays during 3years before to be loaded in Reactor + FP_MOX->SetFiFo(false); //The latest isotopicVector to enter in "Stock" will be used to build the fuel (Opposite of First In First Out) + FP_MOX->SetName("Fab_MOX"); + FP_MOX->AddFissileStorage(StockUOX); //Tell the FP to look in StockUOX for fissionable material + //FP_MOX->AddFertileStorage(Stock2);//Tell the FP to look in Stock2 for fertile material + //If fertile stock is not defined (like here), CLASS get fertile from nature (OUTCOMING vector) + //FP_MOX->SetReUsableStorage(wastestock);//By default the fabricationplant get the list of nuclei defined in the EquivalenceModel (here EQM_MLP_MOX) from stock and send the others nuclei in WASTE. If user want these nuclei to go in another stock he can use the SetReUsableStorage function + gCLASS->AddFabricationPlant(FP_MOX); + + + /*=== Reactors : Pallier CP0===*/ + double Power_CP0 = 2.66e9; //Thermal power (in W) + + //Combustibles type : CYCLADE + double BurnUp_Cyclade = 47; // GWd/tHM + double HMMass_Cyclade = 72.3; //heavy metal mass (in tons) + + //Fessenheim power plant + //reactor n°1 + cSecond StartingTime = 1978*year; + cSecond LifeTime = (EndOfScenarioTime - StartingTime); + + Reactor* Fessenheim_1 = new Reactor(gCLASS->GetLog(),// Log + CYCLADE, // The DataBase used + Cooling_UOX, // Connected Backend facility : The reactor discharge its fuel into the Pool "Cooling_UOX" + StartingTime, // Starting time + LifeTime, // time of reactor life time + Power_CP0, // Power + HMMass_Cyclade, // HM mass + BurnUp_Cyclade, // BurnUp + 0.8); // Load Factor + + + Fessenheim_1->SetName("Fessenheim_1");// name of the reactor (as it will show up in the CLASSGui) + gCLASS->AddReactor(Fessenheim_1);//Add this reactor to the scenario + + //reactor n°2 + StartingTime = 1978*year; + LifeTime = (EndOfScenarioTime - StartingTime); + + Reactor* Fessenheim_2 = new Reactor(gCLASS->GetLog(),// Log + CYCLADE, // The DataBase used + Cooling_UOX, // Connected Backend facility : The reactor discharge its fuel into the Pool "Cooling_UOX" + StartingTime, // Starting time + LifeTime, // time of reactor life time + Power_CP0, // Power + HMMass_Cyclade, // HM mass + BurnUp_Cyclade, // BurnUp + 0.8); // Load Factor + + + Fessenheim_2->SetName("Fessenheim_2");// name of the reactor (as it will show up in the CLASSGui) + gCLASS->AddReactor(Fessenheim_2);//Add this reactor to the scenario + + //Bugey power plant + //reactor n°2 + StartingTime = 1979*year; + LifeTime = (EndOfScenarioTime - StartingTime); + Reactor* Bugey_2 = new Reactor(gCLASS->GetLog(),// Log + CYCLADE, // The DataBase used + Cooling_UOX, // Connected Backend facility : The reactor discharge its fuel into the Pool "Cooling_UOX" + StartingTime, // Starting time + LifeTime, // time of reactor life time + Power_CP0, // Power + HMMass_Cyclade, // HM mass + BurnUp_Cyclade, // BurnUp + 0.8); // Load Factor + + + Bugey_2->SetName("Bugey_2");// name of the reactor (as it will show up in the CLASSGui) + gCLASS->AddReactor(Bugey_2);//Add this reactor to the scenario + //reactor n° 3 + StartingTime = 1979*year; + LifeTime = (EndOfScenarioTime - StartingTime); + Reactor* Bugey_3 = new Reactor(gCLASS->GetLog(),// Log + CYCLADE, // The DataBase used + Cooling_UOX, // Connected Backend facility : The reactor discharge its fuel into the Pool "Cooling_UOX" + StartingTime, // Starting time + LifeTime, // time of reactor life time + Power_CP0, // Power + HMMass_Cyclade, // HM mass + BurnUp_Cyclade, // BurnUp + 0.8); // Load Factor + + + Bugey_3->SetName("Bugey_3");// name of the reactor (as it will show up in the CLASSGui) + gCLASS->AddReactor(Bugey_3);//Add this reactor to the scenario + + //reactor n° 4 + StartingTime = 1979*year; + LifeTime = (EndOfScenarioTime - StartingTime); + Reactor* Bugey_4 = new Reactor(gCLASS->GetLog(),// Log + CYCLADE, // The DataBase used + Cooling_UOX, // Connected Backend facility : The reactor discharge its fuel into the Pool "Cooling_UOX" + StartingTime, // Starting time + LifeTime, // time of reactor life time + Power_CP0, // Power + HMMass_Cyclade, // HM mass + BurnUp_Cyclade, // BurnUp + 0.8); // Load Factor + + + Bugey_4->SetName("Bugey_4");// name of the reactor (as it will show up in the CLASSGui) + gCLASS->AddReactor(Bugey_4);//Add this reactor to the scenario + + //reactor n° 5 + StartingTime = 1980*year; + LifeTime = (EndOfScenarioTime - StartingTime); + Reactor* Bugey_5 = new Reactor(gCLASS->GetLog(),// Log + CYCLADE, // The DataBase used + Cooling_UOX, // Connected Backend facility : The reactor discharge its fuel into the Pool "Cooling_UOX" + StartingTime, // Starting time + LifeTime, // time of reactor life time + Power_CP0, // Power + HMMass_Cyclade, // HM mass + BurnUp_Cyclade, // BurnUp + 0.8); // Load Factor + + + Bugey_5->SetName("Bugey_5");// name of the reactor (as it will show up in the CLASSGui) + gCLASS->AddReactor(Bugey_5);//Add this reactor to the scenario + + /*=== Reactors : Pallier CPY===*/ + double Power_CPY = 2.785e9; //Thermal power (in W) + //Combustibles type : GARANCE + double BurnUp_GARANCE = 42; // GWd/tHM + double HMMass_GARANCE = 72.3; //heavy metal mass (in tons) + + + // Gravelines power plant + //reactor n° 1 + StartingTime = 1980*year; + LifeTime = (EndOfScenarioTime - StartingTime); + Reactor* Gravelines_1 = new Reactor(gCLASS->GetLog(),// Log + GARANCE, // The DataBase used + Cooling_UOX, // Connected Backend + StartingTime, // Starting time + LifeTime, // time of reactor l + Power_CPY, // Power + HMMass_GARANCE, // HM mass + BurnUp_GARANCE, // BurnUp + 0.8); // Load Factor + + + Gravelines_1->SetName("Gravelines_1");// name of the reactor (as it will show + gCLASS->AddReactor(Gravelines_1);//Add this reactor to the scenario + + //Combustibles type : STANDARD 900 + double BurnUp_STD900 = 33; // GWd/tHM + double HMMass_STD900 = 72.3; //heavy metal mass (in tons) + + //reactor n° 2 + StartingTime = 1980*year; + LifeTime = (EndOfScenarioTime - StartingTime); + Reactor* Gravelines_2 = new Reactor(gCLASS->GetLog(),// Log + STD900, // The DataBase used + Cooling_UOX, // Connected Backend + StartingTime, // Starting time + LifeTime, // time of reactor l + Power_CPY, // Power + HMMass_STD900, // HM mass + BurnUp_STD900, // BurnUp + 0.8); // Load Factor + + + Gravelines_2->SetName("Gravelines_2");// name of the reactor (as it will show + gCLASS->AddReactor(Gravelines_2);//Add this reactor to the scenario + + // Tricastin power plant + + //reactor n° 1 + StartingTime = 1980*year; + LifeTime = (EndOfScenarioTime - StartingTime); + Reactor* Tricastin_1 = new Reactor(gCLASS->GetLog(),// Log + STD900, // The DataBase used + Cooling_UOX, // Connected Backend + StartingTime, // Starting time + LifeTime, // time of reactor l + Power_CPY, // Power + HMMass_STD900, // HM mass + BurnUp_STD900, // BurnUp + 0.8); // Load Factor + + + Tricastin_1->SetName("Tricastin_1");// name of the reactor (as it will ll sh + gCLASS->AddReactor(Tricastin_1);//Add this reactor to the scenario + + //reactor n° 2 + StartingTime = 1980*year; + LifeTime = (EndOfScenarioTime - StartingTime); + Reactor* Tricastin_2 = new Reactor(gCLASS->GetLog(),// Log + STD900, // The DataBase used + Cooling_UOX, // Connected Backend + StartingTime, // Starting time + LifeTime, // time of reactor l + Power_CPY, // Power + HMMass_STD900, // HM mass + BurnUp_STD900, // BurnUp + 0.8); // Load Factor + + + Tricastin_2->SetName("Tricastin_2");// name of the reactor (as it will l + gCLASS->AddReactor(Tricastin_2);//Add this reactor to the scenario + + + + + // Dampierre Power Plant UOX puis MOX + //UOX + cSecond Dampierre_MOX_Time = 1991*year; + + StartingTime = 1980*year; + LifeTime = Dampierre_MOX_Time - StartingTime; + double BunrUpMOX = 35; + Reactor* Dampierre_UOX = new Reactor(gCLASS->GetLog(),// Log + STD900, // The DataBase used + Cooling_UOX, // Connected Backend + StartingTime, // Starting time + LifeTime, // time of reactor l + Power_CPY, // Power + HMMass_STD900, // HM mass + BurnUp_STD900, // BurnUp + 0.8); // Load Factor + + + Dampierre_UOX->SetName("Dampierre_UOX");// name of the reactor (as it will l + gCLASS->AddReactor(Dampierre_UOX);//Add this reactor to the scenario + + //the PWR MOX + StartingTime = Dampierre_MOX_Time; + LifeTime = EndOfScenarioTime - StartingTime; + Reactor* Dampierre_MOX = new Reactor(gCLASS->GetLog(),// Log + PHYMOD, // The models used to build the fuel & to calculate its evolution + FP_MOX, // The FabricationPlant + Cooling_MOX, // Connected Backend + StartingTime, // Starting time + LifeTime, // time of reactor l + Power_CPY, // Power + HMMass_STD900, // HM mass + BunrUpMOX, // BurnUp + 0.8); // Load Factor + + Dampierre_MOX->SetName("Dampierre_MOX");// name of the reactor (as it will l + gCLASS->AddReactor(Dampierre_MOX);//Add this reactor to the scenario + + + + gCLASS->Evolution((double)EndOfScenarioTime);//Perform the calculation from year 1977(defined in Scenario declaration) to year 2018 + + delete gCLASS; + +} + + +//========================================================================================== +// Compilation +//========================================================================================== +/* + + \rm CLASS* ; g++ -o CLASS_Exec ExampleParc_MLP_MOX_Kinf.cxx -I $CLASS_include -L $CLASS_lib -lCLASSpkg `root-config --cflags` `root-config --libs` -fopenmp -lgomp -Wunused-result + + + */ diff --git a/example/tags/version4.1/ExampleParc_QUAD_MOX.cxx b/example/tags/version4.1/ExampleParc_QUAD_MOX.cxx new file mode 100644 index 000000000..a0b170880 --- /dev/null +++ b/example/tags/version4.1/ExampleParc_QUAD_MOX.cxx @@ -0,0 +1,364 @@ +/************************************************************/ +// DESCRIPTION +// +// +// Simple Scenario with 8 PWR UOX and one PWR MOX +// +// +// _______ ____ ______ _______________ +// | 10 x | | | | | | | +// |Reactor| =>|Pool|=>|Storage|=====>|FabricationPlant| +// | UOx | |UOX | | UOX | |________________| +// |_______| |____| |_______| || +// || +// \/ +// ______ ____ _______ +// | | | | | 1 x | +// |Storage|<=== |Pool|<==|Reactor| +// | MOX | |MOX | | MOX | +// |_______| |____| |_______| +// +// +//@author BaL +/***********************************************************/ +#include "CLASSHeaders.hxx" +#include <sstream> +#include <iomanip> +#include <math.h> +#include <string> +#include "XS/XSM_MLP.hxx" //Load the include for Neural network cross section predictor +#include "Irradiation/IM_RK4.hxx" //Load the include for Runge Kutta 4 resolution +#include "Equivalence/EQM_PWR_QUAD_MOX.hxx" //Load the include for Neural Network Equivalence Model (PWRMOX) +using namespace std; + +int main(int argc, char** argv) +{ + //seconds in one year + cSecond year = 3600*24.*365.25; + /******LOG MANAGEMENT**********************************/ + //Definition of the Log file : CLASS messages output + int Std_output_level = 0; // Only error are shown in terminal + int File_output_level = 2; // Error + Warning + Info are shown in the file CLASS_OUTPUT.log + CLASSLogger *Logger = new CLASSLogger("CLASS_OUTPUT.log",Std_output_level,File_output_level); + + /******SCENARIO**********************************/ + // The scenario start at year 1977 + Scenario *gCLASS=new Scenario(1977*year,Logger); + gCLASS->SetStockManagement(true); //If false all the IsotopicVector in stocks are mixed together. + gCLASS->SetTimeStep(year/4.); //the scenario calculation is updated every 3 months + cSecond EndOfScenarioTime=2040*year; //Scenario ends in year 2040 + gCLASS->SetOutputFileName("ExampleParc_QUAD.root"); //Set the name of the output file + + /******DATA BASES**********************************/ + //Geting CLASS to path + string CLASS_PATH = getenv("CLASS_PATH"); + if (CLASS_PATH=="") + { + cout<<" Please setenv CLASS_PATH to your CLASS installation folder in your .bashs or .tcshrc"<<endl; + exit(0); + } + string PATH_TO_DATA = CLASS_PATH+"/DATA_BASES/"; + + /*===Decay data base===*/ + //The decay data base is taken from the file Decay.idx + DecayDataBank* DecayDB = new DecayDataBank(gCLASS->GetLog(), PATH_TO_DATA + "DECAY/ALL/Decay.idx"); //you may have to open this file and do the proper changes according your path + gCLASS->SetDecayDataBase(DecayDB);//This decay data base will be used for all the decay calculations in this Scenario + + /*===Reactor data base===*/ + + // Reprocessed fuel PWR MOX + XSM_MLP* XSMOX = new XSM_MLP(gCLASS->GetLog(), PATH_TO_DATA + "PWR/MOX/XSModel/30Wg_FullMOX");//Defining the XS Predictor + IM_RK4 *IMRK4 = new IM_RK4(gCLASS->GetLog()); //Bateman's equation solver method (RungeKutta4) + EQM_PWR_QUAD_MOX* EQMQUADPWRMOX = new EQM_PWR_QUAD_MOX(gCLASS->GetLog(),PATH_TO_DATA + "PWR/MOX/EQModel/QUADRATIQUE/EQM_QUAD_PWR_MOX_3batch_35GWdt.dat");//Defining the EquivalenceModel + PhysicsModels* PHYMOD = new PhysicsModels(XSMOX, EQMQUADPWRMOX, IMRK4); //The PhysicsModels containing the 3 object previously defined + + //Fixed fuel : PWR UOX + EvolutionData *CYCLADE = new EvolutionData(gCLASS->GetLog(), PATH_TO_DATA + "PWR/UOX/FixedFuel/CYCLADES.dat"); + EvolutionData *GARANCE = new EvolutionData(gCLASS->GetLog(), PATH_TO_DATA + "PWR/UOX/FixedFuel/GARANCE.dat"); + EvolutionData *STD900 = new EvolutionData(gCLASS->GetLog(), PATH_TO_DATA + "PWR/UOX/FixedFuel/STD900.dat"); + + /******FACILITIES*********************************/ + /*=== Stock===*/ + //Storage for UOX + Storage *StockUOX = new Storage(gCLASS->GetLog()); // Definition of the stock + StockUOX->SetName("StockUOX"); // Its name + gCLASS->Add(StockUOX); //Adding the stock to the Scenario + //Storage for MOX + Storage *StockMOX = new Storage(gCLASS->GetLog()); // Definition of the stock + StockMOX->SetName("StockMOX"); // Its name + gCLASS->Add(StockMOX); //Adding the stock to the Scenario + + /*===Pool===*/ + //Pool for UOX + Pool *Cooling_UOX = new Pool(gCLASS->GetLog(),StockUOX, 5*year); //After 5 years of cooling, the pool sends its content to "StockUOX" + Cooling_UOX->SetName("Pool_UOX"); + gCLASS->Add(Cooling_UOX); + //Pool for MOX + Pool *Cooling_MOX = new Pool(gCLASS->GetLog(),StockMOX, 5*year); //After 5 years of cooling, the pool sends its content to "StockMOX" + Cooling_MOX->SetName("Pool_MOX"); + gCLASS->Add(Cooling_MOX); + + /*===A FabricationPlant===*/ + FabricationPlant *FP_MOX = new FabricationPlant(gCLASS->GetLog(), 3*year); //Declare a FabricationPlant. After the build of the fuel, it decays during 3years before to be loaded in Reactor + FP_MOX->SetFiFo(false); //The latest isotopicVector to enter in "Stock" will be used to build the fuel (Opposite of First In First Out) + FP_MOX->SetName("Fab_MOX"); + FP_MOX->AddFissileStorage(StockUOX); //Tell the FP to look in StockUOX for fissionable material + //FP_MOX->AddFertileStorage(Stock2);//Tell the FP to look in Stock2 for fertile material + //If fertile stock is not defined (like here), CLASS get fertile from nature (OUTCOMING vector) + //FP_MOX->SetReUsableStorage(wastestock);//By default the fabricationplant get the list of nuclei defined in the EquivalenceModel (here EQM_MLP_MOX) from stock and send the others nuclei in WASTE. If user want these nuclei to go in another stock he can use the SetReUsableStorage function + gCLASS->AddFabricationPlant(FP_MOX); + + + /*=== Reactors : Pallier CP0===*/ + double Power_CP0 = 2.66e9; //Thermal power (in W) + + //Combustibles type : CYCLADE + double BurnUp_Cyclade = 47; // GWd/tHM + double HMMass_Cyclade = 72.3; //heavy metal mass (in tons) + + //Fessenheim power plant + //reactor n°1 + cSecond StartingTime = 1978*year; + cSecond LifeTime = (EndOfScenarioTime - StartingTime); + + Reactor* Fessenheim_1 = new Reactor(gCLASS->GetLog(),// Log + CYCLADE, // The DataBase used + Cooling_UOX, // Connected Backend facility : The reactor discharge its fuel into the Pool "Cooling_UOX" + StartingTime, // Starting time + LifeTime, // time of reactor life time + Power_CP0, // Power + HMMass_Cyclade, // HM mass + BurnUp_Cyclade, // BurnUp + 0.8); // Load Factor + + + Fessenheim_1->SetName("Fessenheim_1");// name of the reactor (as it will show up in the CLASSGui) + gCLASS->AddReactor(Fessenheim_1);//Add this reactor to the scenario + + //reactor n°2 + StartingTime = 1978*year; + LifeTime = (EndOfScenarioTime - StartingTime); + + Reactor* Fessenheim_2 = new Reactor(gCLASS->GetLog(),// Log + CYCLADE, // The DataBase used + Cooling_UOX, // Connected Backend facility : The reactor discharge its fuel into the Pool "Cooling_UOX" + StartingTime, // Starting time + LifeTime, // time of reactor life time + Power_CP0, // Power + HMMass_Cyclade, // HM mass + BurnUp_Cyclade, // BurnUp + 0.8); // Load Factor + + + Fessenheim_2->SetName("Fessenheim_2");// name of the reactor (as it will show up in the CLASSGui) + gCLASS->AddReactor(Fessenheim_2);//Add this reactor to the scenario + + //Bugey power plant + //reactor n°2 + StartingTime = 1979*year; + LifeTime = (EndOfScenarioTime - StartingTime); + Reactor* Bugey_2 = new Reactor(gCLASS->GetLog(),// Log + CYCLADE, // The DataBase used + Cooling_UOX, // Connected Backend facility : The reactor discharge its fuel into the Pool "Cooling_UOX" + StartingTime, // Starting time + LifeTime, // time of reactor life time + Power_CP0, // Power + HMMass_Cyclade, // HM mass + BurnUp_Cyclade, // BurnUp + 0.8); // Load Factor + + + Bugey_2->SetName("Bugey_2");// name of the reactor (as it will show up in the CLASSGui) + gCLASS->AddReactor(Bugey_2);//Add this reactor to the scenario + //reactor n° 3 + StartingTime = 1979*year; + LifeTime = (EndOfScenarioTime - StartingTime); + Reactor* Bugey_3 = new Reactor(gCLASS->GetLog(),// Log + CYCLADE, // The DataBase used + Cooling_UOX, // Connected Backend facility : The reactor discharge its fuel into the Pool "Cooling_UOX" + StartingTime, // Starting time + LifeTime, // time of reactor life time + Power_CP0, // Power + HMMass_Cyclade, // HM mass + BurnUp_Cyclade, // BurnUp + 0.8); // Load Factor + + + Bugey_3->SetName("Bugey_3");// name of the reactor (as it will show up in the CLASSGui) + gCLASS->AddReactor(Bugey_3);//Add this reactor to the scenario + + //reactor n° 4 + StartingTime = 1979*year; + LifeTime = (EndOfScenarioTime - StartingTime); + Reactor* Bugey_4 = new Reactor(gCLASS->GetLog(),// Log + CYCLADE, // The DataBase used + Cooling_UOX, // Connected Backend facility : The reactor discharge its fuel into the Pool "Cooling_UOX" + StartingTime, // Starting time + LifeTime, // time of reactor life time + Power_CP0, // Power + HMMass_Cyclade, // HM mass + BurnUp_Cyclade, // BurnUp + 0.8); // Load Factor + + + Bugey_4->SetName("Bugey_4");// name of the reactor (as it will show up in the CLASSGui) + gCLASS->AddReactor(Bugey_4);//Add this reactor to the scenario + + //reactor n° 5 + StartingTime = 1980*year; + LifeTime = (EndOfScenarioTime - StartingTime); + Reactor* Bugey_5 = new Reactor(gCLASS->GetLog(),// Log + CYCLADE, // The DataBase used + Cooling_UOX, // Connected Backend facility : The reactor discharge its fuel into the Pool "Cooling_UOX" + StartingTime, // Starting time + LifeTime, // time of reactor life time + Power_CP0, // Power + HMMass_Cyclade, // HM mass + BurnUp_Cyclade, // BurnUp + 0.8); // Load Factor + + + Bugey_5->SetName("Bugey_5");// name of the reactor (as it will show up in the CLASSGui) + gCLASS->AddReactor(Bugey_5);//Add this reactor to the scenario + + /*=== Reactors : Pallier CPY===*/ + double Power_CPY = 2.785e9; //Thermal power (in W) + //Combustibles type : GARANCE + double BurnUp_GARANCE = 42; // GWd/tHM + double HMMass_GARANCE = 72.3; //heavy metal mass (in tons) + + + // Gravelines power plant + //reactor n° 1 + StartingTime = 1980*year; + LifeTime = (EndOfScenarioTime - StartingTime); + Reactor* Gravelines_1 = new Reactor(gCLASS->GetLog(),// Log + GARANCE, // The DataBase used + Cooling_UOX, // Connected Backend + StartingTime, // Starting time + LifeTime, // time of reactor l + Power_CPY, // Power + HMMass_GARANCE, // HM mass + BurnUp_GARANCE, // BurnUp + 0.8); // Load Factor + + + Gravelines_1->SetName("Gravelines_1");// name of the reactor (as it will show + gCLASS->AddReactor(Gravelines_1);//Add this reactor to the scenario + + //Combustibles type : STANDARD 900 + double BurnUp_STD900 = 33; // GWd/tHM + double HMMass_STD900 = 72.3; //heavy metal mass (in tons) + + //reactor n° 2 + StartingTime = 1980*year; + LifeTime = (EndOfScenarioTime - StartingTime); + Reactor* Gravelines_2 = new Reactor(gCLASS->GetLog(),// Log + STD900, // The DataBase used + Cooling_UOX, // Connected Backend + StartingTime, // Starting time + LifeTime, // time of reactor l + Power_CPY, // Power + HMMass_STD900, // HM mass + BurnUp_STD900, // BurnUp + 0.8); // Load Factor + + + Gravelines_2->SetName("Gravelines_2");// name of the reactor (as it will show + gCLASS->AddReactor(Gravelines_2);//Add this reactor to the scenario + + // Tricastin power plant + + //reactor n° 1 + StartingTime = 1980*year; + LifeTime = (EndOfScenarioTime - StartingTime); + Reactor* Tricastin_1 = new Reactor(gCLASS->GetLog(),// Log + STD900, // The DataBase used + Cooling_UOX, // Connected Backend + StartingTime, // Starting time + LifeTime, // time of reactor l + Power_CPY, // Power + HMMass_STD900, // HM mass + BurnUp_STD900, // BurnUp + 0.8); // Load Factor + + + Tricastin_1->SetName("Tricastin_1");// name of the reactor (as it will ll sh + gCLASS->AddReactor(Tricastin_1);//Add this reactor to the scenario + + //reactor n° 2 + StartingTime = 1980*year; + LifeTime = (EndOfScenarioTime - StartingTime); + Reactor* Tricastin_2 = new Reactor(gCLASS->GetLog(),// Log + STD900, // The DataBase used + Cooling_UOX, // Connected Backend + StartingTime, // Starting time + LifeTime, // time of reactor l + Power_CPY, // Power + HMMass_STD900, // HM mass + BurnUp_STD900, // BurnUp + 0.8); // Load Factor + + + Tricastin_2->SetName("Tricastin_2");// name of the reactor (as it will l + gCLASS->AddReactor(Tricastin_2);//Add this reactor to the scenario + + + + + // Dampierre Power Plant UOX puis MOX + //UOX + cSecond Dampierre_MOX_Time = 1991*year; + + StartingTime = 1980*year; + LifeTime = Dampierre_MOX_Time - StartingTime; + double BunrUpMOX = 35; + Reactor* Dampierre_UOX = new Reactor(gCLASS->GetLog(),// Log + STD900, // The DataBase used + Cooling_UOX, // Connected Backend + StartingTime, // Starting time + LifeTime, // time of reactor l + Power_CPY, // Power + HMMass_STD900, // HM mass + BurnUp_STD900, // BurnUp + 0.8); // Load Factor + + + Dampierre_UOX->SetName("Dampierre_UOX");// name of the reactor (as it will l + gCLASS->AddReactor(Dampierre_UOX);//Add this reactor to the scenario + + //the PWR MOX + StartingTime = Dampierre_MOX_Time; + LifeTime = EndOfScenarioTime - StartingTime; + Reactor* Dampierre_MOX = new Reactor(gCLASS->GetLog(),// Log + PHYMOD, // The models used to build the fuel & to calculate its evolution + FP_MOX, // The FabricationPlant + Cooling_MOX, // Connected Backend + StartingTime, // Starting time + LifeTime, // time of reactor l + Power_CPY, // Power + HMMass_STD900, // HM mass + BunrUpMOX, // BurnUp + 0.8); // Load Factor + + Dampierre_MOX->SetName("Dampierre_MOX");// name of the reactor (as it will l + gCLASS->AddReactor(Dampierre_MOX);//Add this reactor to the scenario + + + + gCLASS->Evolution((double)EndOfScenarioTime);//Perform the calculation from year 1977(defined in Scenario declaration) to year 2018 + + delete gCLASS; + +} + + +//========================================================================================== +// Compilation +//========================================================================================== +/* + + \rm CLASS* ; g++ -o CLASS_Exec ExampleParc_QUAD_MOX.cxx -I $CLASS_include -L $CLASS_lib -lCLASSpkg `root-config --cflags` `root-config --libs` -fopenmp -lgomp -Wunused-result + + + */ diff --git a/example/tags/version4.1/FBR_Example.cxx b/example/tags/version4.1/FBR_Example.cxx new file mode 100644 index 000000000..4c306eed0 --- /dev/null +++ b/example/tags/version4.1/FBR_Example.cxx @@ -0,0 +1,143 @@ +/************************************************************/ +// DESCRIPTION +// Close Fuel cycle scenario : +// This park is constituted by a FBR-Na MOX which +// multi-recycle its own fuel. +// The Storage is initially filled with Pu in order +// to this scenario to be doable +// _______________ _______ ____ _______ +// | | | FBR | | | | | +// ||===>|FabricationPlant| =>|Reactor| =>|Pool|=>|Storage|===|| +// || |________________| |_______| |____| |_______| || +// ||=========================================================|| +// +// The spent fuel goes to the pool for 5 y +// then it goes to the Storage +// +//@author BaL +/***********************************************************/ +#include "CLASSHeaders.hxx" +#include <sstream> +#include <iomanip> +#include <math.h> +#include <string> +#include "XS/XSM_MLP.hxx" //Load the include for Neural network cross section predictor +#include "Irradiation/IM_RK4.hxx" //Load the include for Runge Kutta 4 resolution +#include "Equivalence/EQM_FBR_BakerRoss_MOX.hxx" //Load the include for Neural Network Equivalence Model (PWRMOX) +using namespace std; + +int main(int argc, char** argv) +{ + //seconds in one year + cSecond year = 3600*24.*365.25; + /******LOG MANAGEMENT**********************************/ + //Definition of the Log file : CLASS messages output + int Std_output_level = 0; // Only error are shown in terminal + int File_output_level = 2; // Error + Warning + Info are shown in the file CLASS_OUTPUT.log + CLASSLogger *Logger = new CLASSLogger("CLASS_OUTPUT.log",Std_output_level,File_output_level); + + /******SCENARIO**********************************/ + // The scenario start at year 1977 + Scenario *gCLASS=new Scenario(1977*year,Logger); + gCLASS->SetStockManagement(true); //If false all the IsotopicVector in stocks are mixed together. + gCLASS->SetTimeStep(year/4.); //the scenario calculation is updated every 3 months + gCLASS->SetOutputFileName("FBR_Example.root"); //Set the name of the output file + + /******DATA BASES**********************************/ + //Geting CLASS to path + string CLASS_PATH = getenv("CLASS_PATH"); + if (CLASS_PATH=="") + { + cout<<" Please setenv CLASS_PATH to your CLASS installation folder in your .bashs or .tcshrc"<<endl; + exit(0); + } + string PATH_TO_DATA = CLASS_PATH + "/DATA_BASES/"; + + /*===Decay data base===*/ + //The decay data base is taken from the file Decay.idx + DecayDataBank* DecayDB = new DecayDataBank(gCLASS->GetLog(), PATH_TO_DATA + "DECAY/ALL/Decay.idx"); + gCLASS->SetDecayDataBase(DecayDB);//This decay data base will be used for all the decay calculations in this Scenario + + /*===Reactor data base===*/ + + XSM_MLP* XS_FBRMOX = new XSM_MLP(gCLASS->GetLog(), PATH_TO_DATA + "FBR_Na/MOX/XSModel/ESFR_48Wg");//Defining the XS Predictor + IM_RK4 *IMRK4 = new IM_RK4(gCLASS->GetLog()); //Bateman's equation solver method (RungeKutta4) + IMRK4->SetSpectrumType("fast"); //Set the spectrum to fast for reactions isomeric branching ratios (can be fast or thermal) + IMRK4->LoadFPYield("" , CLASS_PATH + "/data/FPyield_Fast_JEFF3.1.dat");//Add the handling of fission procuct and gets fission yields from this file (the first argument is for spontaneousfission yield : here is not handle) + + EQM_FBR_BakerRoss_MOX* EQM_FBRMOX = new EQM_FBR_BakerRoss_MOX(gCLASS->GetLog());//Defining the EquivalenceModel + EQM_FBRMOX->SetBuildFuelFirstGuess(0.12); //Set the first guess of fissile content to 12 per cent of plutonium (default : 5%) + PhysicsModels* PHYMOD = new PhysicsModels(XS_FBRMOX, EQM_FBRMOX, IMRK4); //The PhysicsModels containing the 3 object previously defined + + + /******FACILITIES*********************************/ + /*===A Stock===*/ + Storage *Stock = new Storage(gCLASS->GetLog()); // Definition of the stock + Stock->SetName("Stock"); // Its name + //Fill the stock with an initial amount of Plutonium + // In order to allow the FBR_MOX to work + IsotopicVector InitialIV; + InitialIV.Add(94,238,0,4e27 ); + InitialIV.Add(94,239,0,6.4e28); + InitialIV.Add(94,240,0,1.6e28); + InitialIV.Add(94,241,0,9.0e27); + InitialIV.Add(94,242,0,6e27 ); + InitialIV.Add(95,241,0,1e27 ); + gCLASS->Add(Stock); //Adding the stock to the Scenario + Stock->AddToStock(InitialIV); + + /*===A Pool===*/ + Pool *Cooling_MOX = new Pool(gCLASS->GetLog(),Stock, 5*year); //After 5 years of cooling, the pool sends its content to "Stock" + Cooling_MOX->SetName("Pool_MOX"); + gCLASS->Add(Cooling_MOX); + + /*===A FabricationPlant===*/ + FabricationPlant *FP_MOX = new FabricationPlant(gCLASS->GetLog(), 3*year); //Declare a FabricationPlant. After the build of the fuel, it decays during 3years before to be loaded in Reactor + FP_MOX->SetFiFo(false); //The latest isotopicVector to enter in "Stock" will be used to build the fuel (Opposite of First In First Out) + FP_MOX->SetName("Fab_MOX"); + FP_MOX->AddFissileStorage(Stock); //Tell the FP to look in Stock for fissionable material + //FP_MOX->AddFertileStorage(Stock2);//Tell the FP to look in Stock2 for fertile material + //If fertile stock is not defined (like here), CLASS get fertile from nature (OUTCOMING vector) + //FP_MOX->SetReUsableStorage(wastestock);//By default the fabricationplant get the list of nuclei defined in the EquivalenceModel (here EQM_MLP_MOX) from stock and send the others nuclei in WASTE. If user want these nuclei to go in another stock he can use the SetReUsableStorage function + gCLASS->AddFabricationPlant(FP_MOX); + + + /*===A Reactor : FBR_MOX===*/ + double HMMass = 7.48336500000000058e+01; //heavy metal mass (in tons) + double Power_CP0 = 3.6e9; //Thermal power (in W) + double BurnUp = 100; //100 GWd/tHM + + cSecond StartingTime = 1985*year; + cSecond LifeTime = 40*year; + + Reactor* FBR_MOX = new Reactor(gCLASS->GetLog(), // Log + PHYMOD, // The models used to build the fuel & to calculate its evolution + FP_MOX, // The FabricationPlant + Cooling_MOX, // Connected Backend facility : The reactor discharge its fuel into the Pool "Cooling_UOX" + StartingTime, // Starting time + LifeTime, // time of reactor life time + Power_CP0, // Power + HMMass, // HM mass + BurnUp, // BurnUp + 0.8); // Reactor efficiency (% of time it is working @ full power) + + + FBR_MOX->SetName("a_FBR_MOX"); // name of the reactor (as it will show up in the CLASSGui) + gCLASS->AddReactor(FBR_MOX); //Add this reactor to the scenario + + gCLASS->Evolution((double)year*2018);//Perform the calculation from year 1977(defined in Scenario declaration) to year 2018 + + delete gCLASS; + +} + + +//========================================================================================== +// Compilation +//========================================================================================== +/* + + \rm CLASS* ; g++ -o CLASS_Exec FBR_Example.cxx -I $CLASS_include -L $CLASS_lib -lCLASSpkg `root-config --cflags` `root-config --libs` -fopenmp -lgomp -Wunused-result + + + */ diff --git a/example/tags/version4.1/Separation.cxx b/example/tags/version4.1/Separation.cxx new file mode 100644 index 000000000..e60a020db --- /dev/null +++ b/example/tags/version4.1/Separation.cxx @@ -0,0 +1,177 @@ +/*****************************************************************/ +// DESCRIPTION +// Illustrative scenario to show how to use the +// SeparationPlant and BackEnd Facilities (Pool/Storage/Separation) +// This park is constituted by a simple PWR UOX Reactor, a pool +// 4 Storage and 2 FabricationPlant. +// _______ _______________ +// | | | | => Pool => Storage1 +// |Reactor| =>|SeparationPlant1| => Storage2 +// |_______| |_______________ | =>|SeparationPlant2|=>Storage3 +// | |=>Storage4 +// +// +//@author BaL +/****************************************************************/ +#include "CLASSHeaders.hxx" +#include <sstream> +#include <iomanip> +#include <math.h> +#include <string> + +using namespace std; + +int main(int argc, char** argv) +{ + //seconds in one year + cSecond year = 3600*24.*365.25; + /******LOG MANAGEMENT**********************************/ + //Definition of the Log file : CLASS messages output + int Std_output_level = 0; //Only error are shown in terminal + int File_output_level = 2; // Error + Warning + Info are shown in the file CLASS_OUTPUT.log + CLASSLogger *Logger = new CLASSLogger("CLASS_OUTPUT.log",Std_output_level,File_output_level); + + /******SCENARIO**********************************/ + // The scenario start at year 1977 + Scenario *gCLASS=new Scenario(1977*year,Logger); + gCLASS->SetStockManagement(true); //If false all the IsotopicVector in stocks are mixed together. + gCLASS->SetTimeStep(year/4.); //the scenario calculation is updated every 3 months + gCLASS->SetOutputFileName("Separation.root"); //Set the name of the output file + + /******DATA BASES**********************************/ + //Geting CLASS to path + string CLASS_PATH = getenv("CLASS_PATH"); + if (CLASS_PATH=="") + { + cout<<" Please setenv CLASS_PATH to your CLASS installation folder in your .bashs or .tcshrc"<<endl; + exit(0); + } + string PATH_TO_DATA = CLASS_PATH + "/DATA_BASES/"; + + /*===Decay data base===*/ + //The decay data base is taken from the file Decay.idx + DecayDataBank* DecayDB = new DecayDataBank(gCLASS->GetLog(), PATH_TO_DATA + "DECAY/ALL/Decay.idx"); + gCLASS->SetDecayDataBase(DecayDB);//This decay data base will be used for all the decay calculations in this Scenario + + /*===Reactor data base===*/ + //The file STD900.dat correspond to a fuel evolution of a UOX PWR (see manual for details) + EvolutionData *STD900 = new EvolutionData(gCLASS->GetLog(), PATH_TO_DATA + "PWR/UOX/FixedFuel/STD900.dat"); + /******FACILITIES*********************************/ + /*===The 4 Stocks ===*/ + Storage* MyStorage1 = new Storage(Logger); + MyStorage1->SetName("Storage1"); + gCLASS->Add(MyStorage1); //Adding the stock to the Scenario + + Storage* MyStorage2 = new Storage(Logger); + MyStorage2->SetName("Storage2"); + gCLASS->Add(MyStorage2); //Adding the stock to the Scenario + + Storage* MyStorage3 = new Storage(Logger); + MyStorage3->SetName("Storage3"); + gCLASS->Add(MyStorage3); //Adding the stock to the Scenario + + Storage* MyStorage4 = new Storage(Logger); + MyStorage4->SetName("Storage4"); + gCLASS->Add(MyStorage4); //Adding the stock to the Scenario + + + /*===A Pool===*/ + Pool* MyPool1 = new Pool ( Logger , MyStorage1 , 5*year) ; //Defined the Pool MyPool1 connected to the Storage MyStorage1. 5year of cooling + //After 5 years of cooling, the pool sends its content to "MyStorage1" + MyPool1->SetName("MyPool1"); + gCLASS->Add(MyPool1); + + + //*=======2 Separation Plants===*/ + /***Separation Efficencies Definition***/ + IsotopicVector UraniumSeparationEfficiency; + UraniumSeparationEfficiency.Add(92,232,0,0.99);//Efficiency of 99% + UraniumSeparationEfficiency.Add(92,233,0,0.99); + UraniumSeparationEfficiency.Add(92,234,0,0.99); + UraniumSeparationEfficiency.Add(92,235,0,0.99); + UraniumSeparationEfficiency.Add(92,236,0,0.99); + UraniumSeparationEfficiency.Add(92,238,0,0.99); + + IsotopicVector PlutoniumSeparationEfficiency; + PlutoniumSeparationEfficiency.Add(94,236,0,0.98);//Efficiency of 98% + PlutoniumSeparationEfficiency.Add(94,238,0,0.98);//Efficiency of 98% + PlutoniumSeparationEfficiency.Add(94,239,0,0.98); + PlutoniumSeparationEfficiency.Add(94,240,0,0.98); + PlutoniumSeparationEfficiency.Add(94,241,0,0.98); + PlutoniumSeparationEfficiency.Add(94,242,0,0.98); + + IsotopicVector AmericiumSeparationEfficiency; + AmericiumSeparationEfficiency.Add(95,241,0,0.98);//Efficiency of 98% + AmericiumSeparationEfficiency.Add(95,243,0,0.98);//Efficiency of 98% + + //Yes we assume that may be one day, such isotopic separation will be doable !! + IsotopicVector Am241SeparationEfficiency; + Am241SeparationEfficiency.Add(95,241,0,0.98);//Efficiency of 98% + IsotopicVector Am243SeparationEfficiency; + Am243SeparationEfficiency.Add(95,243,0,0.98);//Efficiency of 98% + + + //Separation 2 + SeparationPlant* MySeparation2 = new SeparationPlant ( Logger ) ; + MySeparation2->SetName("Separation2"); + + double AvoidReprocessingUntilYear = 1990*year; + MySeparation2->SetBackEndDestination( MyStorage3 , Am241SeparationEfficiency , AvoidReprocessingUntilYear ); + //Extract 241Am from incoming material and send it to MyStorage3, wait year 1990 to begin extraction + MySeparation2->SetBackEndDestination( MyStorage4 , Am243SeparationEfficiency , AvoidReprocessingUntilYear ); + //Extract 243Am from incoming material and send it to MyStorage4, wait year 1990 to begin extraction + //The material flux wich not goes to a BackeEnDestination is sent to the WASTE + gCLASS->Add(MySeparation2); + + //Separation 1 + SeparationPlant* MySeparation1 = new SeparationPlant ( Logger ) ; + MySeparation1->SetName("Separation1"); + + + MySeparation1->SetBackEndDestination( MyPool1 , UraniumSeparationEfficiency , 0 ); + //Extract uranium from incoming material and send it to MyPool1, Don't wait before extraction + MySeparation1->SetBackEndDestination( MyStorage2 , PlutoniumSeparationEfficiency , 0 ) ; + //Extract Plutonium from incoming material and send it to MyStorage2 , Don't wait before extraction + MySeparation1->SetBackEndDestination( MySeparation2 , AmericiumSeparationEfficiency , AvoidReprocessingUntilYear ) ; + //Extract Americium from incoming material and send it to MySeparation2 , wait year 1990 to begin extraction + gCLASS->Add(MySeparation1); + + + /*===A Reactor : PWR_UOX===*/ + double HMMass = 72.5;//heavy metal mass (in tons) + double Power_CP0 = 2660e6;//Thermal power (in W) + double BurnUp = 33; //33 GWd/tHM + + cSecond StartingTime = 1978*year; + cSecond LifeTime = 40*year; + + Reactor* PWR_UOX = new Reactor(gCLASS->GetLog(), //Log + STD900, // Data base + MySeparation1, // Connected Backend facility : The reactor discharge its fuel into the SeparationPlant1 "MySeparation1" + StartingTime, // Starting time + LifeTime, // time of reactor life time + Power_CP0, // Power + HMMass,// HM mass + BurnUp, // BurnUp + 0.8); // Load Factor + + + PWR_UOX->SetName("a_PWR_Reactor");// name of the reactor (as it will show up in the CLASSGui) + gCLASS->AddReactor(PWR_UOX);//Add this reactor to the scenario + + gCLASS->Evolution((double)year*2018);//Perform the calculation from year 1977(defined in Scenario declaration) to year 2018 + + delete gCLASS; + +} + + +//========================================================================================== +// Compilation +//========================================================================================== +/* + + \rm CLASS* ; g++ -o CLASS_Exec Separation.cxx -I $CLASS_include -L $CLASS_lib -lCLASSpkg `root-config --cflags` `root-config --libs` -fopenmp -lgomp -Wunused-result + + + */ diff --git a/example/tags/version4.1/SimpleReactor.cxx b/example/tags/version4.1/SimpleReactor.cxx new file mode 100644 index 000000000..5de7685e1 --- /dev/null +++ b/example/tags/version4.1/SimpleReactor.cxx @@ -0,0 +1,105 @@ +/*************************************************/ +// DESCRIPTION +// Simple scenario : +// This park is constituted by a simple PWR UOX +// Reactor and a Storage. +// _______ _______ +// | | | | +// |Reactor| =>|Storage| +// |_______| |_______| +// +// The spent fuel goes to a Storage +// +//@author BaL +/*************************************************/ +#include "CLASSHeaders.hxx" +#include <sstream> +#include <iomanip> +#include <math.h> +#include <string> + +using namespace std; + +int main(int argc, char** argv) +{ + + //seconds in one year + cSecond year = 3600*24.*365.25; + /******LOG MANAGEMENT**********************************/ + //Definition of the Log file : CLASS messages output + int Std_output_level = 0; //Only error are shown in terminal + int File_output_level = 2; // Error + Warning + Info are shown in the file CLASS_OUTPUT.log + CLASSLogger *Logger = new CLASSLogger("CLASS_OUTPUT.log",Std_output_level,File_output_level); + + /******SCENARIO**********************************/ + // The scenario start at year 1977 + Scenario *gCLASS=new Scenario(1977*year,Logger); + gCLASS->SetStockManagement(true); //If false all the IsotopicVector in stocks are mixed together. + gCLASS->SetTimeStep(year/4.); //the scenario calculation is updated every 3 months + gCLASS->SetOutputFileName("SimpleReactor.root"); //Set the name of the output file + + /******DATA BASES**********************************/ + //Geting CLASS to path + string CLASS_PATH = getenv("CLASS_PATH"); + if (CLASS_PATH=="") + { + cout<<" Please setenv CLASS_PATH to your CLASS installation folder in your .bashs or .tcshrc"<<endl; + exit(0); + } + string PATH_TO_DATA = CLASS_PATH + "/DATA_BASES/"; + + /*===Decay data base===*/ + //The decay data base is taken from the file Decay.idx + DecayDataBank* DecayDB = new DecayDataBank(gCLASS->GetLog(), PATH_TO_DATA + "DECAY/ALL/Decay.idx"); + gCLASS->SetDecayDataBase(DecayDB);//This decay data base will be used for all the decay calculations in this Scenario + + /*===Reactor data base===*/ + //The file STD900.dat correspond to a fuel evolution of a UOX PWR (see manual for details) + EvolutionData *STD900 = new EvolutionData(gCLASS->GetLog(), PATH_TO_DATA + "PWR/UOX/FixedFuel/STD900.dat"); + + /******FACILITIES*********************************/ + /*===A Stock===*/ + Storage *Stock = new Storage(gCLASS->GetLog()); //Definition of the stock + Stock->SetName("Stock_UOX"); //Its name + Stock->AddToStock(ZAI(92,238,0) * 10);// Just to illustrate, here we add ten nuclei of 238U in this stock + gCLASS->Add(Stock); //Adding the stock to the Scenario + + + /*===A Reactor : PWR_UOX===*/ + double HMMass = 72.5;//heavy metal mass (in tons) + double Power_CP0 = 2660e6;//Thermal power (in W) + double BurnUp = 33; //33 GWd/tHM + + cSecond StartingTime = 1978*year; + cSecond LifeTime = 40*year; + + Reactor* PWR_UOX = new Reactor(gCLASS->GetLog(), //Log + STD900, // Data base + Stock, // Connected Backend facility (here the Storage "Stock" previously declared) + StartingTime, // Starting time + LifeTime, // time of reactor life time + Power_CP0, // Power + HMMass,// HM mass + BurnUp, // BurnUp + 0.8); // Load Factor + + + PWR_UOX->SetName("a_PWR_Reactor");// name of the reactor (as it will show up in the CLASSGui) + gCLASS->AddReactor(PWR_UOX);//Add this reactor to the scenario + + gCLASS->Evolution((double)year*2018);//Perform the calculation from year 1977(defined in Scenario declaration) to year 2018 + + delete gCLASS; + +} + + +//========================================================================================== +// Compilation +//========================================================================================== +/* + + \rm CLASS* ; g++ -o CLASS_Exec SimpleReactor.cxx -I $CLASS_include -L $CLASS_lib -lCLASSpkg `root-config --cflags` `root-config --libs` -fopenmp -lgomp -Wunused-result + + + */ diff --git a/example/tags/version4.1/SimpleReactor2.cxx b/example/tags/version4.1/SimpleReactor2.cxx new file mode 100644 index 000000000..328b1c667 --- /dev/null +++ b/example/tags/version4.1/SimpleReactor2.cxx @@ -0,0 +1,109 @@ +/*************************************************/ +// DESCRIPTION +// Simple scenario : +// This park is constituted by a simple PWR UOX +// Reactor, a pool and a Storage. +// _______ ____ _______ +// | | | | | | +// |Reactor| =>|Pool|=>|Storage| +// |_______| |____| |_______| +// +// The spent fuel goes to the pool for 5 y +// then it goes to the Storage +// +//@author BaL +/*************************************************/ +#include "CLASSHeaders.hxx" +#include <sstream> +#include <iomanip> +#include <math.h> +#include <string> + +using namespace std; + +int main(int argc, char** argv) +{ + + //seconds in one year + cSecond year = 3600*24.*365.25; + /******LOG MANAGEMENT**********************************/ + //Definition of the Log file : CLASS messages output + int Std_output_level = 0; //Only error are shown in terminal + int File_output_level = 2; // Error + Warning + Info are shown in the file CLASS_OUTPUT.log + CLASSLogger *Logger = new CLASSLogger("CLASS_OUTPUT.log",Std_output_level,File_output_level); + + /******SCENARIO**********************************/ + // The scenario start at year 1977 + Scenario *gCLASS=new Scenario(1977*year,Logger); + gCLASS->SetStockManagement(true); //If false all the IsotopicVector in stocks are mixed together. + gCLASS->SetTimeStep(year/4.); //the scenario calculation is updated every 3 months + gCLASS->SetOutputFileName("SimpleReactor2.root"); //Set the name of the output file + + /******DATA BASES**********************************/ + //Geting CLASS to path + string CLASS_PATH = getenv("CLASS_PATH"); + if (CLASS_PATH=="") + { + cout<<" Please setenv CLASS_PATH to your CLASS installation folder in your .bashs or .tcshrc"<<endl; + exit(0); + } + string PATH_TO_DATA = CLASS_PATH+"/DATA_BASES/"; + + /*===Decay data base===*/ + //The decay data base is taken from the file Decay.idx + DecayDataBank* DecayDB = new DecayDataBank(gCLASS->GetLog(), "../DATA_BASES/DECAY/ALL/Decay.idx"); + gCLASS->SetDecayDataBase(DecayDB);//This decay data base will be used for all the decay calculations in this Scenario + + /*===Reactor data base===*/ + //The file STD900.dat correspond to a fuel evolution of a UOX PWR (see manual for details) + EvolutionData *STD900 = new EvolutionData(gCLASS->GetLog(), "../DATA_BASES/PWR/UOX/FixedFuel/STD900.dat"); + /******FACILITIES*********************************/ + /*===A Stock===*/ + Storage *Stock = new Storage(gCLASS->GetLog()); //Definition of the stock + Stock->SetName("Stock_UOX"); //Its name + Stock->AddToStock(ZAI(92,238,0) * 10);// Just to illustrate, here we add ten nuclei of 238U in this stock + gCLASS->Add(Stock); //Adding the stock to the Scenario + + /*===A Pool===*/ + Pool *Cooling_UOX = new Pool(gCLASS->GetLog(),Stock, 5*year); //After 5 years of cooling, the pool sends its content to "Stock" + Cooling_UOX->SetName("Pool_UOX"); + gCLASS->Add(Cooling_UOX); + + /*===A Reactor : PWR_UOX===*/ + double HMMass = 72.5;//heavy metal mass (in tons) + double Power_CP0 = 2660e6;//Thermal power (in W) + double BurnUp = 33; //33 GWd/tHM + + cSecond StartingTime = 1978*year; + cSecond LifeTime = 40*year; + + Reactor* PWR_UOX = new Reactor(gCLASS->GetLog(), //Log + STD900, // Data base + Cooling_UOX, // Connected Backend facility : The reactor discharge its fuel into the Pool "Cooling_UOX" + StartingTime, // Starting time + LifeTime, // time of reactor life time + Power_CP0, // Power + HMMass,// HM mass + BurnUp, // BurnUp + 0.8); // Load Factor + + + PWR_UOX->SetName("a_PWR_Reactor");// name of the reactor (as it will show up in the CLASSGui) + gCLASS->AddReactor(PWR_UOX);//Add this reactor to the scenario + + gCLASS->Evolution((double)year*2018);//Perform the calculation from year 1977(defined in Scenario declaration) to year 2018 + + delete gCLASS; + +} + + +//========================================================================================== +// Compilation +//========================================================================================== +/* + + \rm CLASS* ; g++ -o CLASS_Exec SimpleReactor2.cxx -I $CLASS_include -L $CLASS_lib -lCLASSpkg `root-config --cflags` `root-config --libs` -fopenmp -lgomp -Wunused-result + + + */ -- GitLab