MURE
Loading...
Searching...
No Matches
EvolutionControl.hxx
Go to the documentation of this file.
1/*
2 This file is part of MURE,
3 Copyright (C) 2007-2021 MURE developers.
4
5 MURE is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 MURE is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with MURE. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#ifndef _EVOLUTIONCONTROL_HXX_
20#define _EVOLUTIONCONTROL_HXX_
21
27#include <fstream>
28#include <iostream>
29#include <sstream>
30#include <vector>
31#include <string>
32
33#include "FuelReprocessing.hxx"
34#include "MCSource.hxx"
35
37class MCSource;
38
39using namespace std;
40//________________________________________________________________________
41//
42// EvolutionControl
44
57//________________________________________________________________________
58
60{
61 public:
63
69
71 {
72 return new EvolutionControl(*this);
73 }
74
75 virtual ~EvolutionControl();
76
81 virtual void ControlBeforeFirstMCRun() {};
82 virtual void ControlAfterRestart(int RestartRun) {};
83
85
90 virtual void ControlAfterEachMCRun();
91
93
99 virtual void ControlBeforeEachSubStep();
100
102
108 virtual void ControlAfterEachEvolutionStep();
109
110 virtual void ControlAfterLastMCRun() {};
111
112 void SetMCRunTime(vector < double > T);
113 vector < double > &GetMCRunTimes()
114 {
115 return fMCRunTimes;
116 }
118
123 void SetWantedKeff(double keff = 1.)
124 {
125 fWantedKeff = keff;
126 }
127 void SetWantedHNProportion(double HNproportion = 0.01)
128 {
129 fWantedHNProportion = HNproportion;
130 }
132 {
133 return fWantedHNProportion;
134 }
135 void SetLockToInitialKeff(bool flag = true)
136 {
137 fLockToInitialKeff = flag;
138 }
139 void SetConstantPower(bool flag = true)
140 {
141 fConstantPower = flag;
142 }
144 {
145 return fConstantPower;
146 }
148 {
149 fFuelReprocessing = processing;
150 }
152 {
153 return fFuelReprocessing;
154 }
156
161
162 virtual void CalculateCoeffsAtStep(int s) {}
163 virtual void SetRunFuelTemperatureCoeff(bool flag = true) {}
164 virtual void SetRunVoidCoeff(bool flag = true) {}
165 virtual void SetRunModeratorTemperatureCoeff(bool flag = true) {}
166 virtual void SetRunPoisonReactivityWorth(bool flag = true) {}
167 virtual void SetCriticalitySource(MCSource *s) {}
169 virtual void ControlKeff(double Time) {}
170 void RunMCCriticality(string FileName);
172
177 virtual double EstimatedKeff();
178 virtual void FindKeffSlope();
179 virtual void FindAbsorptionSlope();
180
181 virtual void FindFissionSlope();
182 virtual void FindNuFissionSlope();
183 virtual void ExtrapolateRates();
184
186
191
192 virtual void WriteControlParameters() {}
193 virtual void WriteCurrentRates();
194
196
200 void PrintKeffWarning();
201
203
211 void FindNextCoefs(double value, vector < double > &V, double &Slope, double &Intersept, int &LastMCRunNumber);
212
214
215 protected:
216
217 virtual void InitVector();
218 vector < double > fMCRunTimes;
219
221 double fWantedKeff;
223 vector < double > fMCTime;
224
225 vector < double > fMCKeff;
226 vector < double > fMCDeltaKeff;
227 double fOldKeff;
229
230 vector < double > fKeffWarningTime;
231 vector < double > fKeffWarningGap;
232 vector < double > fKeffWarning3sigma;
233 vector < int > fKeffWarningMCNum;
234
237
238 vector < double > fMCAbs;
239 vector < double > fMCDeltaAbs;
242
243 vector < double > fMCFiss;
244 vector < double > fMCDeltaFiss;
247
248 vector < double > fMCNuFiss;
249 vector < double > fMCDeltaNuFiss;
252
253
256 double fSumOfN2N ;
257 double fTNF;
258
260
261};
262
263#endif
Header file for FuelReprocessing class.
Header file for Monte-Carlo Source abstract class.
EvolutionControl allows interactions with the evolution.
Definition EvolutionControl.hxx:60
virtual void InitVector()
build vector used in fits full of 0.
Definition EvolutionControl.cxx:161
double fOldKeff
The previous MC keff result.
Definition EvolutionControl.hxx:227
vector< double > fKeffWarningTime
Times at which estimate keff differs from MC keff at 3sigma.
Definition EvolutionControl.hxx:230
double GetWantedHNProportion()
Definition EvolutionControl.hxx:131
vector< double > fMCFiss
vector of last MC run's global fission rate.
Definition EvolutionControl.hxx:243
virtual void ControlAfterRestart(int RestartRun)
control at the very beginning of the evolution, before any MC run
Definition EvolutionControl.hxx:82
vector< double > fMCTime
vector of last MC run time (for fits)
Definition EvolutionControl.hxx:223
double fTNF
the Tally normalization Factor
Definition EvolutionControl.hxx:257
virtual void WriteCurrentRates()
Write absorpstion, fission, ... rates in ABS, FISS, ... files.
Definition EvolutionControl.cxx:777
void PrintKeffWarning()
Print Keff estimation warnings.
Definition EvolutionControl.cxx:468
vector< double > fKeffWarningGap
|Estimate keff - Mcnp Keff|
Definition EvolutionControl.hxx:231
vector< double > fKeffWarning3sigma
3sigma on MC keff
Definition EvolutionControl.hxx:232
double fFitNuFissIntercept
intersept of linear fit of the nu*fission rate.
Definition EvolutionControl.hxx:251
FuelReprocessing * fFuelReprocessing
the FuelReprocessing
Definition EvolutionControl.hxx:259
double fFitKeffSlope
slope to find the Keff extrapolation
Definition EvolutionControl.hxx:235
vector< double > fMCDeltaKeff
vector of last MC run Keff error
Definition EvolutionControl.hxx:226
virtual void CalculateCoeffsAtStep(int s)
Abstract method ; to be overloaded.
Definition EvolutionControl.hxx:162
virtual void ExtrapolateRates()
Extrapolation of reaction rates on the next step from a linear fit.
Definition EvolutionControl.cxx:772
void SetWantedKeff(double keff=1.)
Definition EvolutionControl.hxx:123
vector< double > fMCKeff
vector of last MC run Keff
Definition EvolutionControl.hxx:225
void FindNextCoefs(double value, vector< double > &V, double &Slope, double &Intersept, int &LastMCRunNumber)
Fit a vector and return the fitted parameters.
Definition EvolutionControl.cxx:394
double fFitAbsIntercept
Absorption intercept for the extrapolation.
Definition EvolutionControl.hxx:241
void SetMCRunTime(vector< double > T)
Control at the end of evolution, after the last Evolution Step (or MC run if evolution end on a MC ru...
Definition EvolutionControl.cxx:184
virtual void ControlAfterEachMCRun()
when restart from existing (B)DATA files, call this method just after reading files
Definition EvolutionControl.cxx:191
double fWantedKeff
The wanted Keff of the problem.
Definition EvolutionControl.hxx:221
void RunMCCriticality(string FileName)
Run MC only for a Kcode (no tally)
Definition EvolutionControl.cxx:796
virtual void ControlBeforeEachSubStep()
Control just before each sub-step in an Evolution Step.
Definition EvolutionControl.cxx:216
void SetConstantPower(bool flag=true)
Definition EvolutionControl.hxx:139
virtual void FindNuFissionSlope()
Find the slope of Fission*nu base on previous run (fit)
Definition EvolutionControl.cxx:678
void SetWantedHNProportion(double HNproportion=0.01)
Definition EvolutionControl.hxx:127
vector< double > fMCDeltaFiss
vector of last MC run's global fission rate error.
Definition EvolutionControl.hxx:244
virtual double EstimatedKeff()
Extrapolation of Keff on the next step from a linear fit.
Definition EvolutionControl.cxx:275
virtual void FindAbsorptionSlope()
Find the slope of Aborption base on previous run (fit)
Definition EvolutionControl.cxx:481
void SetLockToInitialKeff(bool flag=true)
Definition EvolutionControl.hxx:135
virtual void FindFissionSlope()
Find the slope of Fission base on previous run (fit)
Definition EvolutionControl.cxx:583
virtual EvolutionControl * Clone()
Definition EvolutionControl.hxx:70
virtual void SetCriticalitySource(MCSource *s)
Abstract method ; to be overloaded.
Definition EvolutionControl.hxx:167
virtual void SetRunModeratorTemperatureCoeff(bool flag=true)
Abstract method ; to be overloaded.
Definition EvolutionControl.hxx:165
bool fConstantPower
whether or not keep a constant power
Definition EvolutionControl.hxx:220
virtual void FindKeffSlope()
Find the slope of Keff base on previous run (fit)
Definition EvolutionControl.cxx:283
virtual void WriteControlParameters()
Write poison/fissile proportions etc.
Definition EvolutionControl.hxx:192
vector< double > fMCRunTimes
Time at which MC run is performed.
Definition EvolutionControl.hxx:218
virtual void SetRunPoisonReactivityWorth(bool flag=true)
Abstract method ; to be overloaded.
Definition EvolutionControl.hxx:166
virtual void SetRunVoidCoeff(bool flag=true)
Abstract method ; to be overloaded.
Definition EvolutionControl.hxx:164
bool fLockToInitialKeff
for keff control.
Definition EvolutionControl.hxx:228
double fSumOfFission
sum of all (n, fission) reaction in a cell
Definition EvolutionControl.hxx:254
double fFitNuFissSlope
slope of linear fit of the nu*fission rate.
Definition EvolutionControl.hxx:250
double fFitAbsSlope
slope to find extrapolated Absorption value.
Definition EvolutionControl.hxx:240
vector< int > fKeffWarningMCNum
The MC run number of the warning.
Definition EvolutionControl.hxx:233
double fFitFissSlope
slope of linear fit of the fission rate.
Definition EvolutionControl.hxx:245
double fSumOfN2N
sum of all (n, 2n) reaction in a cell
Definition EvolutionControl.hxx:256
virtual void ControlBeforeFirstMCRun()
Definition EvolutionControl.hxx:81
vector< double > fMCDeltaNuFiss
vector of last MC run's global nu*fission rate error
Definition EvolutionControl.hxx:249
vector< double > fMCDeltaAbs
vector of last MC run global Absorption rate (-2) error
Definition EvolutionControl.hxx:239
vector< double > fMCAbs
vector of last MC run's global total absorption rate.
Definition EvolutionControl.hxx:238
double fSumOfCapture
sum of all (n, gamma) reaction in a cell
Definition EvolutionControl.hxx:255
virtual void ControlAfterEachEvolutionStep()
Control after the last CRAM/RK sub-step of an Evolution Step.
Definition EvolutionControl.cxx:242
virtual void ControlAfterLastMCRun()
Definition EvolutionControl.hxx:110
double fWantedHNProportion
The wanted heavy nuclide proportion.
Definition EvolutionControl.hxx:222
double fFitFissIntercept
intersept of linear fit of the fission rate.
Definition EvolutionControl.hxx:246
double fFitKeffIntersept
intersept to find the Keff extrapolation
Definition EvolutionControl.hxx:236
vector< double > fMCNuFiss
vector of last MC run's global nu*fission rate.
Definition EvolutionControl.hxx:248
vector< double > & GetMCRunTimes()
Definition EvolutionControl.hxx:113
FuelReprocessing * GetFuelReprocessing()
Definition EvolutionControl.hxx:151
virtual void ControlKeff(double Time)
Abstract method ; to be overloaded.
Definition EvolutionControl.hxx:169
void SetFuelReprocessing(FuelReprocessing *processing)
Definition EvolutionControl.hxx:147
bool IsConstantPower()
Definition EvolutionControl.hxx:143
EvolutionControl()
Default Constructor.
Definition EvolutionControl.cxx:41
virtual ~EvolutionControl()
destructor
Definition EvolutionControl.cxx:136
virtual void LaunchReactivityCoeffsCalculations()
Abstract method ; to be overloaded.
Definition EvolutionControl.hxx:168
virtual void SetRunFuelTemperatureCoeff(bool flag=true)
Abstract method ; to be overloaded.
Definition EvolutionControl.hxx:163
FuelReprocessing allows Fuel reprocessing during Evolution.
Definition FuelReprocessing.hxx:119
Define a Monte-Carlo Source.
Definition MCSource.hxx:53
the namespace of the Standard C++

MURE Project, documentation generated by Doxygen 1.9.7 - Fri Jan 19 2024