Newer
Older
#ifndef _Reactor_
#define _Reactor_
/*!
\file
\brief Header file for reactor classes.
*/
#include <string>
#include <map>
#include "CLASSFacility.hxx"
#include "IsotopicVector.hxx"
#include "EvolutionData.hxx"
#include "PhysicsModels.hxx"

Baptiste LENIAU
committed
#include "ReactorScheduler.hxx"
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
using namespace std;
class CLASSBackEnd;
class EvolutionData;
class FabricationPlant;
class Storage;
class CLASSLogger;
//-----------------------------------------------------------------------------//
//! Defines the Reactor
/*!
The aim of this class is to deal the evolution of the fuel inside a reactor.
The fuel state in the reactor is describe in the IsotopicVector. Its evolution is contained in an EvolutionData
@author BaM
@version 2.0
*/
//________________________________________________________________________
class Reactor : public CLASSFacility
{
public :
//********* Constructor/Destructor Method *********//
/*!
\name Constructor/Desctructor
*/
//@{
Reactor(); ///< Normal Constructor.
//{
/// CLASSLogger Constructor.
/*!
Use create an empty Reactor loading a CLASSLogger
\param log: used for the log.
*/
Reactor(CLASSLogger* log);
//}
//{
/// Special Constructor for reprocessed fuel using cycletime and Burn-Up.
/*!
Make a new reactor
\param log: used for the log,
\param backend: CLASSBackend which get the fuel after the cooling,
\param creationtime: creation time in [s],
\param lifetime: working time duration in [s],
\param Power: Thermal power of the reactor in [W],
\param HMMass: Mass of Heavy Metal in the Reactor in [t] of heavy metal,
\param CapacityFactor effective charge of the reactor, fraction between 0 & 1.
*/
Reactor(CLASSLogger* log, CLASSBackEnd* backend,
cSecond creationtime , cSecond lifetime, double Power,
double HMMass, double CapacityFactor = 1);
//}
//{
/// Special Constructor for reprocessed fuel using cycletime and Burn-Up.
/*!
Make a new reactor
\param log: used for the log.
\param backend: CLASSBackend which get the fuel after the cooling,
\param creationtime: creation time in [s],
\param lifetime: working time duration in [s],
\param cycletime: duration of a cycle in [s],
\param Power: Thermal power of the reactor in [W],
\param HMMass: Mass of Heavy Metal in the Reactor in [t] of heavy metal,
\param CapacityFactor effective charge of the reactor, fraction between 0 & 1.
*/
Reactor(CLASSLogger* log,
FabricationPlant* fabricationplant, CLASSBackEnd* backend,
cSecond creationtime , cSecond lifetime, double Power,
double HMMass, double CapacityFactor = 1);
//}
//{
/// Special Constructor for reprocessed fuel using cycletime and Burn-Up.
/*!
Make a new reactor
\param log: used for the log,
\param fueltypeDB Databank describing the evolution of the fuel;
\param backend: CLASSBackend which get the fuel after the cooling,
\param creationtime: creation time in [s],
\param lifetime: working time duration in [s],
\param cycletime: duration of a cycle in [s],
\param HMMass: Mass of Heavy Metal in the Reactor in [t] of heavy metal,
\param BurnUp: Burnup reach by the fuel at the end of the cycle in [GWd/t].
*/
Reactor(CLASSLogger* log, PhysicsModels* fueltypeDB,
FabricationPlant* fabricationplant, CLASSBackEnd* Pool,
cSecond creationtime , cSecond lifetime, cSecond cycletime,
double HMMass, double BurnUp);
//}
//{
/// Special Constructor for reprocessed fuel using Power and Burn-Up.
/*!
Make a new reactor
\param log: used for the log,
\param fueltypeDB Databank describing the evolution of the fuel,
\param backend: CLASSBackend which get the fuel after the cooling,
\param creationtime: creation time in [s],
\param lifetime: working time duration in [s],
\param Power: Thermal power of the reactor in [W],
\param HMMass: Mass of Heavy Metal in the Reactor in [t] of heavy metal,
\param BurnUp: Burnup reach by the fuel at the end of the cycle in [GWd/t],
\param CapacityFactor effective charge of the reactor, fraction between 0 & 1.
*/
Reactor(CLASSLogger* log, PhysicsModels* fueltypeDB,
FabricationPlant* fabricationplant, CLASSBackEnd* backend,
cSecond creationtime , cSecond lifetime,
double Power, double HMMass, double BurnUp, double CapacityFactor);
//}
//{
/// Special Constructor for fixed fuel using Power and Burn-Up.
/*!
Make a new reactor
\param log: used for the log,
\param evolutivedb: EvolutionData describing the evolution of the fuel,
\param backend: CLASSBackend which get the fuel after the cooling,
\param creationtime: creation time in [s],
\param lifetime: working time duration in [s],
\param Power: Thermal power of the reactor in [W],
\param HMMass: Mass of Heavy Metal in the Reactor in [t] of heavy metal,
\param BurnUp: Burnup reach by the fuel at the end of the cycle in [GWd/t],
\param CapacityFactor: effective charge of the reactor, fraction between 0 & 1.
*/
Reactor(CLASSLogger* log, EvolutionData* evolutivedb, CLASSBackEnd* backend,
cSecond creationtime, cSecond lifetime,
double power, double HMMass, double BurnUp, double CapacityFactor);
//}
//{
/// Special Constructor for fixed fuel using Power and Burn-Up.
/*!
Make a new reactor
\param log: used for the log,
\param evolutivedb: EvolutionData describing the evolution of the fuel,
\param backend: CLASSBackend which get the fuel after the cooling,
\param creationtime: creation time in [s],
\param lifetime: working time duration in [s]
\param Power: Thermal power of the reactor in [W],
\param HMMass: Mass of Heavy Metal in the Reactor in [t] of heavy metal,
\param BurnUp: Burnup reach by the fuel at the end of the cycle in [GWd/t],
*/
Reactor(CLASSLogger* log, EvolutionData* evolutivedb, CLASSBackEnd* backend,
cSecond creationtime, cSecond lifetime,
cSecond cycletime, double HMMass, double BurnUp);
//}
~Reactor(); ///< Normal Destructor
//@}
//********* Get Method *********//
/*!
\name Get Method
*/
//@{
IsotopicVector GetIVReactor() const { return GetInsideIV(); } //!< Return the IV contain in the Reactor
IsotopicVector GetIVBeginCycle() const { return fIVBeginCycle; } //!< Return the Starting Cycle IV

Baptiste LENIAU
committed
//!< (Note : IVBegin != IVIn, only if using ReactorScheduler)
IsotopicVector GetIVOutCycle() const { return fIVOutCycle; } //!< Return the Out Cycle IV
IsotopicVector GetIVInCycle() const { return fIVInCycle; } //!< Return the In Cycle IV

Baptiste LENIAU
committed
//!< (Note : IVIn != IVBegin, only if using ReactorScheduler)
cSecond GetNextCycleTime(cSecond time);
bool IsFuelFixed() const { return fFixedFuel; } //!< True if using fixed fuel, False otherwise
double GetHeavyMetalMass() const { return fHeavyMetalMass; } //!< Return the HeavyMetal Mass in the Core at the begining of the cycle
double GetBurnUp() const { return fBurnUp; } //!< Return the Burn Up of the Fuel at the end of the cycle
double GetCapacityFactor() const { return fCapacityFactor; } //!< Return the capacity factor of the reactor
double GetPower() const { return fPower; } //!< Return the cycle time of the Reactor
#ifndef __CINT__
EvolutionData GetEvolutionDB() const { return fEvolutionDB; } //!< Return the Evolution database of the fuel
CLASSBackEnd* GetOutBackEndFacility() const { return fOutBackEndFacility; } //!< Return the pointer to Associeted BackEnd Facility
FabricationPlant* GetFabricationPlant() const { return fFabricationPlant; } //!< Return the pointer to the FabricationPlant
ReactorScheduler* GetScheduler() const { return fReactorScheduler; } ///< return the ReactorScheduler
#endif
//@}
//********* Set Method *********//
/*!
\name Set Method
*/
//@{

Baptiste LENIAU
committed
void SetReactorScheduler(ReactorScheduler* reactorscheduler) { fReactorScheduler = reactorscheduler; } //!< Set the ReactorScheduler
void SetHMMass(double Mass) {fHeavyMetalMass = Mass;} //!< Set the heavy metal mass in the core at the begining of the cycle
void SetCycleTime(double cycletime); //!< Set the cycle time (Power fixed)
void SetPower(double Power); //!< Set the power (burnup cte)
void SetBurnUp(double BU); //!< Set the burnUp reach at end of cycle (Power cte)
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
void SetIVReactor(IsotopicVector isotopicvector) { fInsideIV = isotopicvector; } //!< Set the IV inside the Reactor core
void SetIVBeginCycle(IsotopicVector isotopicvector) { fIVBeginCycle = isotopicvector;} //!< Set the IV at the beginging of the Reactor cycle
void SetIVOutCycle(IsotopicVector isotopicvector){ fIVOutCycle = isotopicvector;} //!< Set the IV Going out at the end of the cycle
void SetIVInCycle(IsotopicVector isotopicvector) { fIVInCycle = isotopicvector;} //!< Set the IV coming In at the beginning of the cycle
#ifndef __CINT__
void SetOutBackEndFacility(CLASSBackEnd* pool) { fOutBackEndFacility = pool; } //!< Return the pointer to OutBackEnd Facility
void SetStorage(Storage* storage) { fStorage = storage; fIsStorage = true;} //!< Set the pointer to the Storage
void SetFabricationPlant(FabricationPlant* FP) { fFabricationPlant = FP;} //!< Set the Pointer to the FabricationPlant
void SetEvolutionDB(EvolutionData evolutionDB); //!< Set the pointer to the DB evolution of the Reactor
#endif
using CLASSFacility::SetName;
using CLASSFacility::GetName;
//@}
//********* Evolution & Modification Method *********//
/*!
\name Evolution & Modification Method
*/
//@{
void Evolution(cSecond t); //!< Performs the Evolution until time t
void Dump(); //!< Write modification (IV In/Out, filling the TF...)
void SetNewFuel(EvolutionData ivdb); //!< Change the Evolutive DB of the Reactor
void CheckListConsistency(PhysicsModels* fueltypeDB, FabricationPlant* fabricationplant); //!< Check if FP/EqM lists are identical
#ifndef __CINT__

Baptiste LENIAU
committed
void AddScheduleEntry(cSecond time, ReactorModel* Model, double BurnUp, double Power, double HMMass) //!< Add A new schedule entry

Baptiste LENIAU
committed
{ if(Model->GetPhysicsModels() && !fFabricationPlant )
{ERROR<<"You must add a FabicationPlant to Reactor " <<GetName()
<<"\n"<< "Use YourReactor->AddFabricationPlant(YourFP);"<<endl;exit(0);}
fReactorScheduler->AddEntry( time, Model, BurnUp, Power*fCapacityFactor, HMMass);
} //!< Change the Model and/or BurnUp and/or Power and/or HMMass from time time

Baptiste LENIAU
committed
void AddScheduleEntry(cSecond time, EvolutionData* Model, double BurnUp, double Power, double HMMass)

Baptiste LENIAU
committed
{ fReactorScheduler->AddEntry( time, new ReactorModel(Model), BurnUp, Power*fCapacityFactor, HMMass); } //!< Change the Model and/or BurnUp and/or Power and/or HMMass from time time

Baptiste LENIAU
committed
void AddScheduleEntry(cSecond time, PhysicsModels* Model, double BurnUp, double Power, double HMMass)

Baptiste LENIAU
committed
{ if(!fFabricationPlant)
{ERROR<<"You must add a FabicationPlant to Reactor " <<GetName()
<<"\n"<< "Use YourReactor->AddFabricationPlant(YourFP);"<<endl;exit(0);}
fReactorScheduler->AddEntry( time, new ReactorModel(Model), BurnUp, Power*fCapacityFactor, HMMass);
} //!< Change the Model and/or BurnUp and/or Power and/or HMMass from time time
#endif
//@}
protected :
bool fFixedFuel; //!< true if the fuel is fixed (not reprocessed)
bool fIsStorage; //!< true if a storage has been define (to approximate the reprocessing using fixed fuel)
//********* Internal Parameter *********//
double fPower; ///< Power (in Watt)
double fElectricPower; ///< ElectrocPower (in Watt)
double fEfficiencyFactor; ///< ElectrocPower (in Watt)

Baptiste LENIAU
committed
double fCapacityFactor; ///< Capacity factor [0-1]
IsotopicVector fIVBeginCycle; ///< Fuel IV at the beginning of a cycle
IsotopicVector fIVInCycle; ///< IVBegin add at the beginning of the cycle
IsotopicVector fIVOutCycle; ///< IV wich get out at the end of a cycle
#ifndef __CINT__
EvolutionData fEvolutionDB; //!< Pointer to the actual evolution DataBase
CLASSBackEnd* fOutBackEndFacility; //!< Pointer to the BackEnd Facility which collect the spend fuel
FabricationPlant* fFabricationPlant; //!< Pointer to the FabricationPlant
Storage* fStorage; //!< Pointer to the Stock (only for reprocessing fuel in fixed base...)
ReactorScheduler* fReactorScheduler; //!< Pointer to the ReactorScheduler