Project

General

Profile

Too many steps in routine RungeKutta » SimpleExample.cxx

YANG Richard Yi, 02/29/2016 06:14 PM

 
1
/*
2
   ___________           ______          _________
3
  |           |         |      |        |         |
4
  | PWR_UOX*4 |  =====> | Pool | =====> | Storage | 
5
  |___________|         |______|        |_________|
6
                                             ||
7
                                             ||
8
                                             \/
9
        __________       _________        __________________
10
       |         |      |         |      |                  |
11
       | Storage |<=====| PWR_URE |<=====| FabricationPlant |
12
       |_________|      |_________|      |__________________|
13
 
14
*/
15

    
16
// \rm CLASS* ; g++ -o CLASS_exec SimpleExample.cxx EQM_Simple.o -I $CLASS_include -L $CLASS_lib -lCLASSpkg `root-config --cflags` `root-config --libs` -fopenmp -lgomp -Wunused-result -lTMVA
17

    
18
#include "CLASSHeaders.hxx"
19
#include <sstream>
20
#include <iomanip>
21
#include <math.h>
22
#include <string>
23
#include "EQM_Simple.hxx"
24
#include "XS/XSM_CLOSEST.hxx"
25
#include "Irradiation/IM_RK4.hxx"
26
using namespace std;
27

    
28
int main(int argc, char** argv)
29
{  
30
  //All parameters;
31
  cSecond year=3600*24.*365.25;
32
  int Std_output_level=0;  // Only error are shown in terminal
33
  int File_output_level=2; // Error + Warning + Info are shown in the file CLASS_OUTPUT.log
34
  cSecond start=0.0;//Scenario start time (year);
35
  cSecond time=20.0;//Whole time of the scenario (year);
36
  cSecond coolingtime=5.0;//(year);
37
  cSecond fabricationtime=1.0;//(year);
38
  cSecond startreactor[]={1.,1.,1.,1.,15.};//(year);
39
  cSecond life[]={40.,40.,40.,40.,40.};//(year);
40
  double HMM[]={63.833491,63.833491,63.833491,63.833491,63.833491};//(ton);
41
  double power[]={40.17,40.17,40.17,40.17,40.17};//Specific power (MW/tHM);
42
  double burnup[]={33.5,33.5,33.5,33.5,28.790592};//(GWd/tHM);
43
  double loadfactor[]={0.85,0.85,0.85,0.85,0.85};
44
  int n=5;//Number of reactors;
45
  int i;
46
  
47
  //Change all parameters into the good units;
48
  start=start*year;
49
  time=time*year;
50
  coolingtime=coolingtime*year;
51
  fabricationtime=fabricationtime*year;
52
  for(i=0;i<=n-1;i++)
53
  {
54
    startreactor[i]=startreactor[i]*year;
55
    life[i]=life[i]*year;
56
    power[i]=power[i]*HMM[i]*1.0e6;
57
  }
58
  
59
  //Log management;
60
  CLASSLogger* Logger=new CLASSLogger("CLASS_OUTPUT.log",Std_output_level,File_output_level);
61

    
62
  //Scenario;
63
  Scenario* gCLASS=new Scenario(start,Logger);
64
  gCLASS->SetStockManagement(true);
65
  gCLASS->SetTimeStep(year/12.0);
66
  gCLASS->SetOutputFileName("CLASS.root");
67

    
68
  //Decay database;
69
  DecayDataBank* DecayDB=new DecayDataBank(gCLASS->GetLog(),"/home/yang/CLASS_4.1.0/DATA_BASES/DECAY/ALL/Decay.idx");
70
  gCLASS->SetDecayDataBase(DecayDB);
71
  
72
  //Fixed fuel reactors database;
73
  EvolutionData *database=new EvolutionData(Logger,"/home/yang/Results/RefFuel/UOX_3.2_40.17_33.5.dat");
74
  
75
  //Physics models;
76
  EQM_Simple *eqm=new EQM_Simple();
77
  XSM_CLOSEST *xsm=new XSM_CLOSEST(gCLASS->GetLog(),"/home/yang/Results/SymbioticScenarios/SimpleExample/SimpleXSM.idx");
78
  IM_RK4 *im=new IM_RK4(Logger);
79
  PhysicsModels *phym=new PhysicsModels(xsm,eqm,im);
80
  
81
  //Storages;
82
  Storage *stock=new Storage(Logger);
83
  stock->SetName("Stock_UOX");
84
  Storage *stockru=new Storage(Logger);
85
  stockru->SetName("Stock_RU");
86
  gCLASS->Add(stock);
87
  gCLASS->Add(stockru);
88
/*  Storage *Fissile=new Storage(Logger);
89
  Fissile->SetName("FissileStorage");
90
  gCLASS->Add(Fissile);
91
  Storage *Fertile=new Storage(Logger);
92
  Fertile->SetName("FertileStorage");
93
  gCLASS->Add(Fertile);
94
*/    
95
/*  //SeparationPlant;
96
  SeparationPlant *sp=new SeparationPlant(Logger);
97
  IsotopicVector fissile;
98
  fissile.Add(92,234,0,1.);
99
  fissile.Add(92,235,0,1.);
100
  fissile.Add(92,236,0,1.);
101
  IsotopicVector fertile;
102
  fertile.Add(92,238,0,1.);
103
  sp->SetBackEndDestination(Fissile,fissile,5*year);
104
  sp->SetBackEndDestination(Fertile,fertile,5*year);
105
*/  
106
  //Spent fuel pool;  
107
  Pool *pool=new Pool(Logger,stock,coolingtime);
108
  gCLASS->Add(pool);
109
  
110
  //FabricationPlant;
111
  FabricationPlant *fp=new FabricationPlant(gCLASS->GetLog(),fabricationtime);
112
  fp->SetFiFo(false);
113
  fp->AddFissileStorage(stock);
114
//  fp->AddFertileStorage(Fertile);
115
  fp->SetName("FP_RU");
116
  gCLASS->Add(fp);
117
   
118
  //Fixed fuel reactors;
119
  Reactor *uox1=new Reactor(Logger,
120
                            database,
121
                            pool,
122
                            startreactor[0],
123
                            life[0],
124
                            power[0],
125
                            HMM[0],
126
                            burnup[0],
127
                            loadfactor[0]);
128
  uox1->SetName("PWR_UOX_1");                            
129
  gCLASS->AddReactor(uox1);
130
  
131
  Reactor *uox2=new Reactor(Logger,
132
                            database,
133
                            pool,
134
                            startreactor[1],
135
                            life[1],
136
                            power[1],
137
                            HMM[1],
138
                            burnup[1],
139
                            loadfactor[1]);
140
  uox2->SetName("PWR_UOX_2");
141
  gCLASS->AddReactor(uox2);
142

    
143
  Reactor *uox3=new Reactor(Logger,
144
                            database,
145
                            pool,
146
                            startreactor[2],
147
                            life[2],
148
                            power[2],
149
                            HMM[2],
150
                            burnup[2],
151
                            loadfactor[2]);
152
  uox3->SetName("PWR_UOX_3");
153
  gCLASS->AddReactor(uox3);
154

    
155
  Reactor *uox4=new Reactor(Logger,
156
                            database,
157
                            pool,
158
                            startreactor[3],
159
                            life[3],
160
                            power[3],
161
                            HMM[3],
162
                            burnup[3],
163
                            loadfactor[3]);
164
  uox4->SetName("PWR_UOX_4");
165
  gCLASS->AddReactor(uox4);
166
  
167
  //Reprocessed fuel;
168
  Reactor *ru=new Reactor(Logger,
169
                          phym,
170
                          fp,
171
                          stockru,
172
                          startreactor[4],
173
                          life[4],
174
                          power[4],
175
                          HMM[4],
176
                          burnup[4],
177
                          loadfactor[4]);
178
  ru->SetName("PWR_RU");
179
  gCLASS->AddReactor(ru);                          
180
                  
181
  gCLASS->Evolution((double)(start+time));
182
  delete gCLASS;          
183

    
184
  return 1;
185
}
186

    
187

    
188

    
(1-1/2)