1
|
#include "Reactor.hxx"
|
2
|
|
3
|
#include "EvolutionData.hxx"
|
4
|
#include "DataBank.hxx"
|
5
|
#include "Pool.hxx"
|
6
|
#include "FabricationPlant.hxx"
|
7
|
#include "Storage.hxx"
|
8
|
#include "CLASS.hxx"
|
9
|
|
10
|
#include "LogFile.hxx"
|
11
|
|
12
|
#include <iostream>
|
13
|
#include <cmath>
|
14
|
#include <omp.h>
|
15
|
|
16
|
//________________________________________________________________________
|
17
|
//
|
18
|
// Reactor
|
19
|
//
|
20
|
//
|
21
|
//
|
22
|
//
|
23
|
//________________________________________________________________________
|
24
|
ClassImp(Reactor)
|
25
|
|
26
|
Reactor::Reactor()
|
27
|
{
|
28
|
|
29
|
|
30
|
}
|
31
|
|
32
|
Reactor::Reactor(LogFile* log)
|
33
|
{
|
34
|
|
35
|
fLog = log;
|
36
|
|
37
|
}
|
38
|
|
39
|
Reactor::Reactor(LogFile* log, DataBank<IsotopicVector>* fueltypeDB,
|
40
|
FabricationPlant* fabricationplant,
|
41
|
Pool* Pool,
|
42
|
double creationtime, double lifetime)
|
43
|
{
|
44
|
|
45
|
fLog = log;
|
46
|
|
47
|
fIsStarted = false;
|
48
|
fShutDown = false;
|
49
|
fEndOfCycle = false;
|
50
|
|
51
|
fFabricationPlant = fabricationplant;
|
52
|
fFixedFuel = false;
|
53
|
fBurnUp = -1.;
|
54
|
fHeavyMetalMass = -1.;
|
55
|
|
56
|
fAssociedPool = Pool;
|
57
|
|
58
|
fFuelTypeDB = fueltypeDB;
|
59
|
|
60
|
fInternalTime = 0;
|
61
|
fInCycleTime = 0;
|
62
|
fPower = -1.;
|
63
|
fCycleTime = -1.; //BU in GWd/t
|
64
|
|
65
|
fCreationTime = (cSecond)creationtime;
|
66
|
fLifeTime = (cSecond)lifetime;
|
67
|
|
68
|
cout << "!!INFO!! !!!Reactor!!! A Reactor has been define :" << endl;
|
69
|
cout << "\t Fuel Composition is not fixed ! "<< endl;
|
70
|
cout << "\t Fuel Type set to : \t "<< fFuelTypeDB->GetFuelType() << endl;
|
71
|
cout << "\t Creation time set at \t " << (double)(fCreationTime/3600/24/365.25) << " year" << endl;
|
72
|
cout << "\t Life time (Operating's Duration) set at \t " << (double)(fLifeTime/3600/24/365.25) << " year" << endl << endl;
|
73
|
cout << "!!WARNING!! !!!Reactor!!! You need to set Burn-up/Power/CycleTime (2 of 3) & Heavy Metal Mass Manualy !! " << endl;
|
74
|
|
75
|
|
76
|
fLog->fLog << "!!INFO!! !!!Reactor!!! A Reactor has been define :" << endl;
|
77
|
fLog->fLog << "\t Fuel Composition is not fixed ! "<< endl;
|
78
|
fLog->fLog << "\t Fuel Type set to : \t "<< fFuelTypeDB->GetFuelType() << endl;
|
79
|
fLog->fLog << "\t Creation time set at \t " << (double)(fCreationTime/3600/24/365.25) << " year" << endl;
|
80
|
fLog->fLog << "\t Life time (Operating's Duration) set at \t " << (double)(fLifeTime/3600/24/365.25) << " year" << endl << endl;
|
81
|
fLog->fLog << "!!WARNING!! !!!Reactor!!! You need to set Burn-up/Power/CycleTime (2 of 3) & Heavy Metal Mass Manualy !! " << endl;
|
82
|
|
83
|
|
84
|
}
|
85
|
|
86
|
Reactor::Reactor(LogFile* log, DataBank<IsotopicVector>* fueltypeDB, FabricationPlant* fabricationplant, Pool* Pool,
|
87
|
double creationtime, double lifetime,
|
88
|
double Power, double HMMass, double BurnUp, double ChargeFactor)
|
89
|
{
|
90
|
|
91
|
fLog = log;
|
92
|
|
93
|
fIsStarted = false;
|
94
|
fShutDown = false;
|
95
|
fEndOfCycle = false;
|
96
|
|
97
|
fFabricationPlant = fabricationplant;
|
98
|
fFixedFuel = false;
|
99
|
|
100
|
fAssociedPool = Pool;
|
101
|
|
102
|
fFuelTypeDB = fueltypeDB;
|
103
|
|
104
|
fInternalTime = 0;
|
105
|
fInCycleTime = 0;
|
106
|
|
107
|
fBurnUp = BurnUp;
|
108
|
fHeavyMetalMass = HMMass;
|
109
|
fPower = Power*ChargeFactor;
|
110
|
fCycleTime = (cSecond) (fBurnUp*1e9 / (fPower) * fHeavyMetalMass *3600*24); //BU in GWd/t
|
111
|
|
112
|
fCreationTime = (cSecond)creationtime;
|
113
|
fLifeTime = (cSecond)lifetime;
|
114
|
|
115
|
|
116
|
|
117
|
cout << "!!INFO!! !!!Reactor!!! A Reactor has been define :" << endl;
|
118
|
cout << "\t Fuel Composition is not fixed ! "<< endl;
|
119
|
cout << "\t Fuel Type set to : \t "<< fFuelTypeDB->GetFuelType() << endl;
|
120
|
cout << "\t Creation time set at \t " << (double)(fCreationTime/3600/24/365.25) << " year" << endl;
|
121
|
cout << "\t Life time (Operating's Duration) set at \t " << (double)(fLifeTime/3600/24/365.25) << " year" << endl;
|
122
|
cout << "\t The Effective Thermal Power is \t " << (double)(fPower *1e-6) << " MW (with Full Power " << Power << " and " << ChargeFactor << " Charge Factor)"<< endl;
|
123
|
cout << "\t Burn-Up at end of Cycle set at \t " << (double)(fBurnUp) << " GWj/t" << endl;
|
124
|
cout << "\t The corresponding Cycle Time is\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl;
|
125
|
cout << "\t The Heavy Metal Mass in the Core set at " << (double)(fHeavyMetalMass) << " tons" << endl << endl;
|
126
|
|
127
|
fLog->fLog << "!!INFO!! !!!Reactor!!! A Reactor has been define :" << endl;
|
128
|
fLog->fLog << "\t Fuel Composition is not fixed ! "<< endl;
|
129
|
fLog->fLog << "\t Fuel Type set to : \t "<< fFuelTypeDB->GetFuelType() << endl;
|
130
|
fLog->fLog << "\t Creation time set at \t " << (double)(fCreationTime/3600/24/365.25) << " year" << endl;
|
131
|
fLog->fLog << "\t Life time (Operating's Duration) set at \t " << (double)(fLifeTime/3600/24/365.25) << " year" << endl;
|
132
|
fLog->fLog << "\t The Effective Thermal Power is \t " << (double)(fPower *1e-6) << " MW (with Full Power " << Power << " and " << ChargeFactor << " Charge Factor)"<< endl;
|
133
|
fLog->fLog << "\t Burn-Up at end of Cycle set at \t " << (double)(fBurnUp) << " GWj/t" << endl;
|
134
|
fLog->fLog << "\t The corresponding Cycle Time is\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl;
|
135
|
fLog->fLog << "\t The Heavy Metal Mass in the Core set at " << (double)(fHeavyMetalMass) << " tons" << endl << endl;
|
136
|
|
137
|
|
138
|
}
|
139
|
|
140
|
Reactor::Reactor(LogFile* log, DataBank<IsotopicVector>* fueltypeDB,
|
141
|
FabricationPlant* fabricationplant,
|
142
|
Pool* Pool,
|
143
|
double creationtime, double lifetime, double cycletime,
|
144
|
double HMMass, double BurnUp)
|
145
|
{
|
146
|
|
147
|
fLog = log;
|
148
|
|
149
|
fIsStarted = false;
|
150
|
fShutDown = false;
|
151
|
fEndOfCycle = false;
|
152
|
|
153
|
fFabricationPlant = fabricationplant;
|
154
|
fFixedFuel = false;
|
155
|
fBurnUp = BurnUp;
|
156
|
fHeavyMetalMass = HMMass;
|
157
|
|
158
|
fAssociedPool = Pool;
|
159
|
|
160
|
fFuelTypeDB = fueltypeDB;
|
161
|
|
162
|
fInternalTime = 0;
|
163
|
fInCycleTime = 0;
|
164
|
fCycleTime = (cSecond)cycletime;
|
165
|
fCreationTime = (cSecond)creationtime;
|
166
|
fLifeTime = (cSecond)lifetime;
|
167
|
fPower = BurnUp*3600.*24. / (fCycleTime) * HMMass *1e9; //BU in GWd/t
|
168
|
|
169
|
|
170
|
cout << "!!INFO!! !!!Reactor!!! A Reactor has been define :" << endl;
|
171
|
cout << "\t Fuel Composition is not fixed ! "<< endl;
|
172
|
cout << "\t Fuel Type set to : \t "<< fFuelTypeDB->GetFuelType() << endl;
|
173
|
cout << "\t Creation time set at \t " << (double)(fCreationTime/3600/24/365.25) << " year" << endl;
|
174
|
cout << "\t Life time (Operating's Duration) set at \t " << (double)(fCreationTime/3600/24/365.25) << " year" << endl;
|
175
|
cout << "\t The Cycle Time set at\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl;
|
176
|
cout << "\t Burn-Up at end of Cycle set at \t " << (double)(fBurnUp) << " GWj/t" << endl;
|
177
|
cout << "\t The corresponding Effective Thermal Power is \t " << (double)(fPower *1e-6) << " MW" << endl;
|
178
|
cout << "\t The Heavy Metal Mass in the Core set at " << (double)(fHeavyMetalMass) << " tons" << endl << endl;
|
179
|
|
180
|
fLog->fLog << "!!INFO!! !!!Reactor!!! A Reactor has been define :" << endl;
|
181
|
fLog->fLog << "\t Fuel Composition is not fixed ! "<< endl;
|
182
|
fLog->fLog << "\t Fuel Type set to : \t "<< fFuelTypeDB->GetFuelType() << endl;
|
183
|
fLog->fLog << "\t Creation time set at \t " << (double)(fCreationTime/3600/24/365.25) << " year" << endl;
|
184
|
fLog->fLog << "\t Life time (Operating's Duration) set at \t " << (double)(fCreationTime/3600/24/365.25) << " year" << endl;
|
185
|
fLog->fLog << "\t The Cycle Time set at\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl;
|
186
|
fLog->fLog << "\t Burn-Up at end of Cycle set at \t " << (double)(fBurnUp) << " GWj/t" << endl;
|
187
|
fLog->fLog << "\t The corresponding Effective Thermal Power is \t " << (double)(fPower *1e-6) << " MW" << endl;
|
188
|
fLog->fLog << "\t The Heavy Metal Mass in the Core set at " << (double)(fHeavyMetalMass) << " tons" << endl << endl;
|
189
|
|
190
|
|
191
|
}
|
192
|
|
193
|
|
194
|
Reactor::Reactor(LogFile* log, EvolutionData evolutivedb,
|
195
|
Pool* Pool,
|
196
|
double creationtime,
|
197
|
double lifetime,
|
198
|
double power, double HMMass, double BurnUp, double ChargeFactor )
|
199
|
{
|
200
|
|
201
|
fLog = log;
|
202
|
|
203
|
fIsStarted = false;
|
204
|
fShutDown = false;
|
205
|
fEndOfCycle = false;
|
206
|
|
207
|
|
208
|
|
209
|
|
210
|
|
211
|
|
212
|
|
213
|
fFixedFuel = true;
|
214
|
fIsStorage = false;
|
215
|
|
216
|
fAssociedPool = Pool;
|
217
|
|
218
|
fInternalTime = 0;
|
219
|
fInCycleTime = 0;
|
220
|
fCreationTime = (cSecond)creationtime;
|
221
|
fLifeTime = (cSecond)lifetime;
|
222
|
|
223
|
fPower = power * ChargeFactor;
|
224
|
|
225
|
fHeavyMetalMass = HMMass;
|
226
|
|
227
|
map<ZAI, double> ZAImass;
|
228
|
////!!!!
|
229
|
ZAImass.insert( pair< ZAI,double >( ZAI(90,232,0), 232038060.000e-6 ) );
|
230
|
|
231
|
ZAIMass.insert( pair< ZAI,double >( ZAI(92,232,0), 232000000e-6 ) );
|
232
|
ZAIMass.insert( pair< ZAI,double >( ZAI(92,233,0), 233000000e-6 ) );
|
233
|
ZAIMass.insert( pair< ZAI,double >( ZAI(92,234,0), 234000000e-6 ) );
|
234
|
ZAIMass.insert( pair< ZAI,double >( ZAI(92,236,0), 236000000e-6 ) );
|
235
|
ZAImass.insert( pair< ZAI,double >( ZAI(92,238,0), 238050788.247e-6 ) );
|
236
|
ZAImass.insert( pair< ZAI,double >( ZAI(92,235,0), 235043929.918e-6 ) );
|
237
|
|
238
|
ZAImass.insert( pair< ZAI,double >( ZAI(94,238,0), 238049559.894e-6 ) );
|
239
|
ZAImass.insert( pair< ZAI,double >( ZAI(94,239,0), 239052163.381e-6 ) );
|
240
|
ZAImass.insert( pair< ZAI,double >( ZAI(94,240,0), 240053813.545e-6 ) );
|
241
|
ZAImass.insert( pair< ZAI,double >( ZAI(94,241,0), 241056851.456e-6 ) );
|
242
|
ZAImass.insert( pair< ZAI,double >( ZAI(94,242,0), 242058742.611e-6 ) );
|
243
|
|
244
|
ZAImass.insert( pair< ZAI,double >( ZAI(95,241,0), 241056829.144e-6 ) );
|
245
|
|
246
|
double Na = 6.02214129e23; //N Avogadro
|
247
|
map<ZAI ,double>::iterator it;
|
248
|
map<ZAI ,double> isotopicquantity = evolutivedb.GetIsotopicVectorAt(0.).GetActinidesComposition().GetIsotopicQuantity();
|
249
|
double M0 = 0;
|
250
|
for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++ )
|
251
|
M0 += (*it).second*ZAImass.find( (*it).first )->second/Na*1e-6;
|
252
|
|
253
|
fEvolutionDB = evolutivedb * (fHeavyMetalMass/M0);
|
254
|
|
255
|
fBurnUp = BurnUp;
|
256
|
fCycleTime = (cSecond) (fBurnUp*1e9 / (fPower) * fHeavyMetalMass *3600*24);
|
257
|
|
258
|
fIVBeginCycle = fEvolutionDB.GetIsotopicVectorAt(0);
|
259
|
fIVInCycle = fEvolutionDB.GetIsotopicVectorAt(0);
|
260
|
fIVOutCycle = fEvolutionDB.GetIsotopicVectorAt( (cSecond)(fCycleTime/fEvolutionDB.GetPower()*fPower) );
|
261
|
|
262
|
cout << "!!INFO!! !!!Reactor!!! A Reactor has been define :" << endl;
|
263
|
cout << "\t Fuel Composition is fixed ! "<< endl;
|
264
|
cout << "\t Creation time set at \t " << (double)(fCreationTime/3600/24/365.25) << " year" << endl;
|
265
|
cout << "\t Life time (Operating's Duration) set at \t " << (double)(fLifeTime/3600/24/365.25) << " year" << endl;
|
266
|
cout << "\t The Cycle Time set at\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl;
|
267
|
cout << "\t The Effective Thermal Power is \t " << (double)(fPower *1e-6) << " MW (with Full Power " << power << " and " << ChargeFactor << " Charge Factor)"<< endl;
|
268
|
cout << "\t The Heavy Metal Mass in the Core set at " << (double)(fHeavyMetalMass) << " tons" << endl << endl;
|
269
|
|
270
|
fLog->fLog << "!!INFO!! !!!Reactor!!! A Reactor has been define :" << endl;
|
271
|
fLog->fLog << "\t Fuel Composition is fixed ! "<< endl;
|
272
|
fLog->fLog << "\t Creation time set at \t " << (double)(fCreationTime/3600/24/365.25) << " year" << endl;
|
273
|
fLog->fLog << "\t Life time (Operating's Duration) set at \t " << (double)(fLifeTime/3600/24/365.25) << " year" << endl;
|
274
|
fLog->fLog << "\t The Cycle Time set at\t " << (double)(fCycleTime/3600/24/365.25) << " year" << endl;
|
275
|
fLog->fLog << "\t The Effective Thermal Power is \t " << (double)(fPower *1e-6) << " MW (with Full Power " << power << " and " << ChargeFactor << " Charge Factor)"<< endl;
|
276
|
fLog->fLog << "\t The Heavy Metal Mass in the Core set at " << (double)(fHeavyMetalMass) << " tons" << endl << endl;
|
277
|
|
278
|
|
279
|
}
|
280
|
|
281
|
|
282
|
//________________________________________________________________________
|
283
|
Reactor::~Reactor()
|
284
|
{
|
285
|
|
286
|
|
287
|
}
|
288
|
|
289
|
//________________________________________________________________________
|
290
|
void Reactor::SetCycleTime(double cycletime)
|
291
|
{
|
292
|
if(fFixedFuel==true)
|
293
|
{
|
294
|
fCycleTime = (cSecond)cycletime;
|
295
|
fIVOutCycle = fEvolutionDB.GetIsotopicVectorAt(fCycleTime/fEvolutionDB.GetPower()*fPower);
|
296
|
}
|
297
|
else
|
298
|
{
|
299
|
fCycleTime = (cSecond)cycletime;
|
300
|
fPower = fBurnUp*3600*24 / (fCycleTime) * fHeavyMetalMass *1e9; //BU in GWd/t
|
301
|
}
|
302
|
}
|
303
|
//________________________________________________________________________
|
304
|
void Reactor::SetPower(double Power)
|
305
|
{
|
306
|
if(fFixedFuel==true)
|
307
|
{
|
308
|
fPower = Power;
|
309
|
fIVOutCycle = fEvolutionDB.GetIsotopicVectorAt( (cSecond)(fCycleTime/fEvolutionDB.GetPower()*fPower) );
|
310
|
}
|
311
|
else
|
312
|
{
|
313
|
fPower = Power;
|
314
|
fCycleTime = (cSecond)(fBurnUp*1e9 / (fPower) * fHeavyMetalMass *3600*24); //BU in GWd/t
|
315
|
}
|
316
|
|
317
|
}
|
318
|
|
319
|
//________________________________________________________________________
|
320
|
void Reactor::SetEvolutionDB(EvolutionData evolutionDB)
|
321
|
{
|
322
|
|
323
|
fEvolutionDB = evolutionDB;
|
324
|
fIVOutCycle = fEvolutionDB.GetIsotopicVectorAt( (cSecond)(fCycleTime/fEvolutionDB.GetPower()*fPower) );
|
325
|
fIVBeginCycle = fEvolutionDB.GetIsotopicVectorAt(0);
|
326
|
|
327
|
|
328
|
}
|
329
|
|
330
|
//________________________________________________________________________
|
331
|
void Reactor::SetNewFuel(EvolutionData ivdb)
|
332
|
{
|
333
|
|
334
|
SetEvolutionDB(ivdb);
|
335
|
|
336
|
}
|
337
|
|
338
|
//________________________________________________________________________
|
339
|
void Reactor::Evolution(cSecond t)
|
340
|
{
|
341
|
|
342
|
|
343
|
if( fShutDown == true || t < fCreationTime ) return; // Reactor stop or not started...
|
344
|
|
345
|
if(Norme(fIVReactor)!=0){
|
346
|
#pragma omp critical(ParcPowerUpdate)
|
347
|
{fParc->AddToPower(fPower);}
|
348
|
}
|
349
|
else if(fIsStarted==true){
|
350
|
fLog->fLog << "!!Warning!! !!!Reactor!!!"
|
351
|
<< " Reactor should be working but there is no Heavy Nucleus Inside. It's not working so have a zero power..."
|
352
|
<< " Time : "<< t/365.25/3600/24 << " years" << endl;
|
353
|
}
|
354
|
|
355
|
|
356
|
if( t == fInternalTime && t!=0 ) return;
|
357
|
|
358
|
|
359
|
|
360
|
if(fInternalTime == 0 && fIsStarted == false) // Start of the Reactor
|
361
|
{
|
362
|
fEndOfCycle = true;
|
363
|
fIVReactor = fIVBeginCycle;
|
364
|
fInternalTime = t;
|
365
|
|
366
|
}
|
367
|
|
368
|
// Check if the Reactor if started ...
|
369
|
if(fIsStarted == false) return; // If the reactor just start don't need to make Fuel evolution
|
370
|
|
371
|
|
372
|
cSecond EvolutionTime = t - fInternalTime; // Calculation of the evolution time (relativ)
|
373
|
|
374
|
if( EvolutionTime + fInCycleTime == fCycleTime ) //End of Cycle
|
375
|
{
|
376
|
fEndOfCycle = true;
|
377
|
fInternalTime += EvolutionTime; // Update Internal Time
|
378
|
fInCycleTime += EvolutionTime; // Update InCycleTime
|
379
|
|
380
|
if(t >= fCreationTime + fLifeTime) // if the Next Cycle don't 'Exist...
|
381
|
fShutDown = true;
|
382
|
|
383
|
}
|
384
|
else if(EvolutionTime + fInCycleTime < fCycleTime ) // During Cycle
|
385
|
{
|
386
|
|
387
|
fInternalTime += EvolutionTime; // Update Internal Time
|
388
|
fInCycleTime += EvolutionTime; // Update InCycleTime
|
389
|
|
390
|
fIVReactor = fEvolutionDB.GetIsotopicVectorAt( (cSecond)(fInCycleTime/fEvolutionDB.GetPower()*fPower) ); // update the fuel composition
|
391
|
if(t>=fCreationTime + fLifeTime) fShutDown = true;
|
392
|
}
|
393
|
else
|
394
|
{
|
395
|
// This is so bad!! You will probably unsynchronize all the reactor....
|
396
|
cout << "!!Warning!! !!!Reactor!!!"
|
397
|
<< " Evolution is too long! This is a Bad way to deal the evolution of the reactor..."
|
398
|
<< t/365.25/3600/24 << " :" << endl;
|
399
|
|
400
|
fLog->fLog << "!!Warning!! !!!Reactor!!!"
|
401
|
<< " Evolution is too long! This is a Bad way to deal the evolution of the reactor..."
|
402
|
<< t/365.25/3600/24 << " :" << endl;
|
403
|
exit(1);
|
404
|
}
|
405
|
|
406
|
|
407
|
}
|
408
|
|
409
|
//________________________________________________________________________
|
410
|
void Reactor::Dump()
|
411
|
{
|
412
|
|
413
|
|
414
|
if(fInternalTime < fCreationTime) return;
|
415
|
if(fShutDown == true && fIsStarted == false) return; // Reactor stopped...
|
416
|
|
417
|
if(fFixedFuel == true)
|
418
|
{
|
419
|
|
420
|
if(fEndOfCycle == true && fShutDown == false )
|
421
|
{
|
422
|
fEndOfCycle = false;
|
423
|
|
424
|
if(fIsStarted == true ) // A Cycle has already been done
|
425
|
fAssociedPool->AddIVCooling(fIVReactor);
|
426
|
else fIsStarted = true; // Just start the first cycle
|
427
|
|
428
|
if(fParc->GetStockManagement() == false && fIsStorage == true)
|
429
|
{
|
430
|
IsotopicVector BuildIVtmp ;
|
431
|
IsotopicVector GodPart;
|
432
|
|
433
|
//Get The Storage Compostion
|
434
|
BuildIVtmp.Add(fStorage->GetFullStock().GetIsotopicQuantity());
|
435
|
//Get the rest after IVIn creation
|
436
|
BuildIVtmp -= fIVInCycle;
|
437
|
//Get the God part form this rest
|
438
|
GodPart.Add(BuildIVtmp.GetIsotopicQuantityNeeded()) ;
|
439
|
//Take what you can from Storage...
|
440
|
fStorage->TakeFromStock( fIVInCycle - GodPart);
|
441
|
//And Get the rest from God
|
442
|
fParc->AddGod(GodPart);
|
443
|
|
444
|
}
|
445
|
else fParc->AddGod(fIVInCycle);
|
446
|
|
447
|
fIVReactor = fIVBeginCycle;
|
448
|
fInCycleTime = 0;
|
449
|
}
|
450
|
else if (fEndOfCycle == true && fShutDown == true) //shutdown at end of Cycle
|
451
|
{
|
452
|
|
453
|
fAssociedPool->AddIVCooling(fIVOutCycle);
|
454
|
fIVReactor.Clear();
|
455
|
fInCycleTime = 0;
|
456
|
fIsStarted = false; // shut down the Reactor
|
457
|
}
|
458
|
else if (fEndOfCycle == false && fShutDown == true) //shutdown during Cycle
|
459
|
{
|
460
|
fAssociedPool->AddIVCooling(fIVReactor);
|
461
|
fIVReactor.Clear();
|
462
|
fInCycleTime = 0;
|
463
|
fIsStarted = false; // shut down the Reactor
|
464
|
}
|
465
|
}
|
466
|
else
|
467
|
{
|
468
|
if(fParc->GetStockManagement() == false)
|
469
|
{
|
470
|
cout << "!!Warning!! !!!Reactor!!! Can't have unfixedFuel without stock management'" << endl;
|
471
|
fLog->fLog << "!!Warning!! !!!Reactor!!! Can't have unfixedFuel without stock management" << endl;
|
472
|
exit(1);
|
473
|
}
|
474
|
|
475
|
|
476
|
if(fEndOfCycle == true && fShutDown == false )
|
477
|
{
|
478
|
fEndOfCycle = false;
|
479
|
|
480
|
if(fIsStarted == true ) // A Cycle has already been done
|
481
|
{
|
482
|
fAssociedPool->AddIVCooling(fIVOutCycle);
|
483
|
}
|
484
|
else fIsStarted = true; // Just start the first cycle
|
485
|
|
486
|
SetNewFuel(fFabricationPlant->GetReactorEvolutionDB(fId));
|
487
|
fFabricationPlant->TakeReactorFuel(fId);
|
488
|
|
489
|
|
490
|
fIVReactor = fIVBeginCycle;
|
491
|
fInCycleTime = 0;
|
492
|
|
493
|
}
|
494
|
else if (fEndOfCycle == true && fShutDown == true) //shutdown at end of Cycle
|
495
|
{
|
496
|
fAssociedPool->AddIVCooling(fIVOutCycle);
|
497
|
fIVReactor.Clear();
|
498
|
fInCycleTime = 0;
|
499
|
fIsStarted = false; // shut down the Reactor
|
500
|
}
|
501
|
else if (fEndOfCycle == false && fShutDown == true) //shutdown during Cycle
|
502
|
{
|
503
|
fAssociedPool->AddIVCooling(fIVReactor);
|
504
|
fIVReactor.Clear();
|
505
|
fInCycleTime = 0;
|
506
|
fIsStarted = false; // shut down the Reactor
|
507
|
}
|
508
|
|
509
|
|
510
|
|
511
|
}
|
512
|
|
513
|
|
514
|
}
|
515
|
|
516
|
|
517
|
|
518
|
|