CLASS  5.1
Fuel Cycle Simulator
Scenario.hxx
Go to the documentation of this file.
1 #ifndef _SCENARIO_
2 #define _SCENARIO_
3 
8 #include "CLASSObject.hxx"
9 #include "IsotopicVector.hxx"
10 
11 #include <TFile.h>
12 #include <TTree.h>
13 #include <vector>
14 #include <string>
15 #include <map>
16 #include <iostream>
17 
18 
19 
20 using namespace std;
21 typedef long long int cSecond;
22 
23 class DecayDataBank;
24 class FabricationPlant;
25 class SeparationPlant;
26 class Reactor;
27 class Pool;
28 class Storage;
29 
30 //-----------------------------------------------------------------------------//
32 
41 //________________________________________________________________________
42 
43 
44 class Scenario : public CLASSObject
45 {
46 public :
47 
48  //********* Constructor/Destructor Method *********//
49 
54  //{
60  Scenario(CLASSLogger* Log, cSecond abstime = 0);
61  //}
62 
63  //{
68  Scenario(cSecond abstime);
69  //}
70 
71  //{
77  Scenario(cSecond abstime, CLASSLogger* log);
78  //}
79 
80  ~Scenario();
81 
82 
83 
84  //********* Get Method *********//
90  return fAbsoluteTime;
91  }
92  map<cSecond, int> GetTimeStep() {
93  return fTimeStep;
94  }
95  vector<Reactor*> GetReactor() {
96  return fReactor;
97  }
98  vector<Storage*> GetStorage() {
99  return fStorage;
100  }
101  vector<Pool*> GetPool() {
102  return fPool;
103  }
104  vector<FabricationPlant*> GetFabricationPlant() {
105  return fFabricationPlant;
106  }
108  return fDecayDataBase;
109  }
110 
112  return fPrintStep;
113  }
115  return fStockManagement;
116  }
117  string GetOutputFileName() {
118  return fOutputFileName;
119  }
120  string GetOutputTreeName() {
121  return fOutputTreeName;
122  }
123 
125  return fWaste;
126  }
127 
129 
130 
131 
132 
133  //********* Set Method *********//
138 
139  //{
141 
145  void SetTimeStep(cSecond timestep) {
146  fPrintStep = timestep;
147  }
148  //}
149 
150  //{
152 
156  void SetStockManagement(bool val) {
157  fStockManagement = val;
158  }
159  //}
160 
161  //{
163 
167  void SetDecayDataBase(DecayDataBank* decaydatabase) {
168  fDecayDataBase = decaydatabase;
169  }
170  //}
171 
172  //{
174 
178  void SetOutputFileName(string name) {
179  fOutputFileName = name;
180  }
181  //}
182 
183 
184  //{
186 
190  void SetOutputTreeName(string name) {
191  fOutputTreeName = name;
192  }
193  //}
195 
196  void SetLogTimeStep(bool val = true) {
197  fLogTimeStep = true;
198  }
199 
200 
201  void SetZAIThreshold(int z = 90) {
202  fZAIThreshold = z;
203  }
204 
205 
206  //********* Add Method *********//
211 
212  void AddPool(Pool* Pool);
213  void AddReactor(Reactor* reactor);
214  void AddStorage(Storage* storage);
215  void AddFabricationPlant(FabricationPlant* fabricationplant);
216  void AddSeparationPlant(SeparationPlant* separationplant);
217 
218  void Add(Pool* Pool) {
219  AddPool(Pool);
220  }
221  void Add(Reactor* reactor) {
222  AddReactor(reactor);
223  }
224  void Add(Storage* storage) {
225  AddStorage(storage);
226  }
227  void Add(FabricationPlant* fabricationplant) {
228  AddFabricationPlant(fabricationplant);
229  }
230  void Add(SeparationPlant* separationplant) {
231  AddSeparationPlant(separationplant);
232  }
233 
235 
236 
237 
238  //********* Evolution Method *********//
243 
244  void BuildTimeVector(cSecond t);
245 
251  void Evolution(cSecond t);
252  void BackEndEvolution();
253  void PoolEvolution();
254  void PoolDump();
255 
256  void ReactorEvolution();
257  void FabricationPlantEvolution();
258  void StorageEvolution();
259 
261 
262 
263 
264  //-------- IsotopicVector --------//
265 
270 
271 
273  return fOutIncome;
274  }
275 
276  void AddOutIncome(ZAI zai, double quantity) {
277  AddOutIncome(zai*quantity);
278  }
279  void AddOutIncome(IsotopicVector isotopicvector) {
280  fOutIncome.Add(isotopicvector);
281  }
282  void AddWaste(ZAI zai, double quantity) {
283  AddWaste(zai*quantity);
284  }
285  void AddWaste(IsotopicVector isotopicvector) {
286  fWaste.Add(isotopicvector);
287  }
288  void AddToPower(double power, double elpower) {
289  fParcPower += power;
290  fParcElectricPower += elpower;
291  }
293 
294 
295  void ApplyZAIThreshold();
297 
298 
299 
300  //********* In/Out related Method *********//
301 
306 
307  void PrintCLASSPresentation();
308  void ProgressPrintout(cSecond t);
309 
310  void Print();
311  void Write();
312 
313  void OpenOutputTree();
314  void CloseOutputTree();
315  void OutAttach();
316 
317  void ResetQuantity();
318  void UpdateParc();
319 
321 
322 
323 
324 protected :
325  bool fNewTtree;
328 
332  map<cSecond, int> fTimeStep;
333 
341 
342  vector<Storage*> fStorage;
343  vector<Pool*> fPool;
344  vector<Reactor*> fReactor;
345  vector<FabricationPlant*> fFabricationPlant;
346  vector<SeparationPlant*> fSeparationPlant;
348 
349 
350  TFile* fOutFile;
352  TTree* fOutT;
354  string fOutputLogName;
355 
362 
363 
366  double fParcPower;
368 
369 };
370 
371 
372 #endif
Defines a Storage object.
Definition: Storage.hxx:38
IsotopicVector fOutIncome
OutIncomeIncome IV.
Definition: Scenario.hxx:358
void SetTimeStep(cSecond timestep)
Set the printing step periodicity.
Definition: Scenario.hxx:145
void SetLogTimeStep(bool val=true)
Definition: Scenario.hxx:196
Defines the spent fuel pool.
Definition: Pool.hxx:36
map< cSecond, int > fTimeStep
Definition: Scenario.hxx:332
void AddOutIncome(ZAI zai, double quantity)
Definition: Scenario.hxx:276
TTree * fOutT
Name of the Output File.
Definition: Scenario.hxx:352
bool fNewTtree
True if we want to define a new TTree in the output File.
Definition: Scenario.hxx:325
void Add(SeparationPlant *separationplant)
Definition: Scenario.hxx:230
vector< SeparationPlant * > fSeparationPlant
Vector of FabricationPlant.
Definition: Scenario.hxx:346
string fOutputFileName
Definition: Scenario.hxx:351
int fZAIThreshold
Definition: Scenario.hxx:339
Allows to store & operate on radioactive sample.
Definition: IsotopicVector.hxx:37
void Add(Pool *Pool)
Definition: Scenario.hxx:218
vector< Pool * > fPool
Vector of Pool.
Definition: Scenario.hxx:343
Definition: CLASSBackEndDict.cxx:37
void SetOutputTreeName(string name)
Set the Output TTree Name.
Definition: Scenario.hxx:190
IsotopicVector GetWaste()
Definition: Scenario.hxx:124
cSecond fAbsoluteTime
Absolute Clock in [s].
Definition: Scenario.hxx:330
Definition: FabricationPlant.hxx:68
long long int cSecond
Definition: Scenario.hxx:21
Defines a nucleus.
Definition: ZAI.hxx:33
vector< FabricationPlant * > fFabricationPlant
Vector of FabricationPlant.
Definition: Scenario.hxx:345
void SetDecayDataBase(DecayDataBank *decaydatabase)
Set the DecayDataBank.
Definition: Scenario.hxx:167
IsotopicVector GetOutIncome() const
Definition: Scenario.hxx:272
cSecond GetPrintSet()
Definition: Scenario.hxx:111
bool fStockManagement
True if real StockManagement false unstead (Default = true)
Definition: Scenario.hxx:326
TFile * fOutFile
Pointer to the Root Output File.
Definition: Scenario.hxx:350
bool GetStockManagement()
Definition: Scenario.hxx:114
void SetOutputFileName(string name)
Set the Output File Name.
Definition: Scenario.hxx:178
IsotopicVector fIVInCycleTotal
Sum of all IV in the cycle (without Waste) IV.
Definition: Scenario.hxx:364
void SetStockManagement(bool val)
Set the StockManagement method.
Definition: Scenario.hxx:156
void AddWaste(IsotopicVector isotopicvector)
Definition: Scenario.hxx:285
void SetZAIThreshold(int z=90)
Definition: Scenario.hxx:201
DecayDataBank * fDecayDataBase
Pointer to the Decay DataBase.
Definition: Scenario.hxx:347
void Add(FabricationPlant *fabricationplant)
Definition: Scenario.hxx:227
cSecond fPrintStep
Time interval between two output update in [s].
Definition: Scenario.hxx:329
bool fLogTimeStep
Definition: Scenario.hxx:327
Defines a SeparationPlant.
Definition: SeparationPlant.hxx:38
void AddOutIncome(IsotopicVector isotopicvector)
Definition: Scenario.hxx:279
vector< Storage * > fStorage
Vector of Storages.
Definition: Scenario.hxx:342
double fParcPower
Sum of the Power of all reactor in the parc.
Definition: Scenario.hxx:366
IsotopicVector fTotalInReactor
Sum of all IV in Reactor IV.
Definition: Scenario.hxx:361
string GetOutputTreeName()
Definition: Scenario.hxx:120
long long int cSecond
Definition: CLASSConstante.hxx:10
cSecond GetAbsoluteTime()
Definition: Scenario.hxx:89
double fParcElectricPower
Sum of the Power of all reactor in the parc.
Definition: Scenario.hxx:367
Header file for IsotopicVector class.
string fOutputLogName
Name of the Output TTree.
Definition: Scenario.hxx:354
vector< Pool * > GetPool()
Definition: Scenario.hxx:101
Describes outcore radioactive decays.
Definition: DecayDataBank.hxx:45
IsotopicVector fIVTotal
Sum of all IV in the parc (including Waste) IV.
Definition: Scenario.hxx:365
Object to handle output messages.
Definition: CLASSLogger.hxx:144
vector< FabricationPlant * > GetFabricationPlant()
Definition: Scenario.hxx:104
IsotopicVector fFuelFabrication
Sum of all IV in Fabrication IV.
Definition: Scenario.hxx:360
vector< Storage * > GetStorage()
Definition: Scenario.hxx:98
cSecond fStartingTime
Starting Time in [s].
Definition: Scenario.hxx:331
void AddWaste(ZAI zai, double quantity)
Definition: Scenario.hxx:282
Define common proporties of all objects.
Definition: CLASSObject.hxx:39
int fCloverCount
Definition: Scenario.hxx:340
IsotopicVector fTotalCooling
Sum of all IV in Cooling IV.
Definition: Scenario.hxx:359
vector< Reactor * > fReactor
Vector of Reactor.
Definition: Scenario.hxx:344
void Add(Reactor *reactor)
Definition: Scenario.hxx:221
Defines the Reactor.
Definition: Reactor.hxx:41
void Add(Storage *storage)
Definition: Scenario.hxx:224
string GetOutputFileName()
Definition: Scenario.hxx:117
IsotopicVector fTotalStorage
Sum of all IV in Storage IV.
Definition: Scenario.hxx:357
Header file for CLASSObject class.
DecayDataBank * GetDecayDataBase()
Definition: Scenario.hxx:107
map< cSecond, int > GetTimeStep()
Definition: Scenario.hxx:92
string fOutputTreeName
Definition: Scenario.hxx:353
IsotopicVector fWaste
Waste IV.
Definition: Scenario.hxx:356
Defines a Scenario (the whole electro-nuclear system)
Definition: Scenario.hxx:44
void AddToPower(double power, double elpower)
Add power to the installed power in the Parc.
Definition: Scenario.hxx:288
vector< Reactor * > GetReactor()
Definition: Scenario.hxx:95