Skip to content
Snippets Groups Projects
Commit ba51926c authored by BaM's avatar BaM
Browse files

Add a ZAI threshold to remove all nuclei below

git-svn-id: svn+ssh://svn.in2p3.fr/class@624 0e7d625b-0364-4367-a6be-d5be4a48d228
parent 3477141a
No related branches found
No related tags found
No related merge requests found
......@@ -120,6 +120,8 @@ class CLASSBackEnd : public CLASSFacility
\name BackEndFacility specific Method
*/
//@{
virtual void ApplyZAIThreshold(int z = 90); //!< Put all nuclei below the threshold in -2 -2 -2 ZAI...
virtual void AddIV(IsotopicVector isotopicvector); //!< Add an Isotopicvector to the IVArray
void ClearIVArray(); //!< Empty the IVArray removing all fuel stored
......
......@@ -172,7 +172,7 @@ public :
\name Evolution Method
*/
//@{
virtual void ApplyZAIThreshold(int z = 90); //!< Put all nuclei below the threshold in -2 -2 -2 ZAI...
void AddCumulativeIVIn(IsotopicVector IV) { fCumulativeIVIn += IV;} //!< Add the Input IsotopicVector in the cumulative IV IN
void AddCumulativeIVOut(IsotopicVector IV) { fCumulativeIVOut += IV;} //!< Add the Input IsotopicVector in the cumulative IV OUT
virtual void Evolution(cSecond t) = 0; //!< Performs the Evolution to time t
......
......@@ -119,6 +119,7 @@ public :
void Multiply(double factor); //!< Multiply the IV by a Factor
void ApplyZAIThreshold(int z = 90); //!< Put all nuclei below the threshold in -2 -2 -2 ZAI...
IsotopicVector& operator+=(IsotopicVector const& IVb); //!< Operator += definition
IsotopicVector& operator-=(IsotopicVector const& IVb); //!< Operator -= definition
......
......@@ -159,7 +159,11 @@ class Scenario : public CLASSObject
//}
//@}
void SetLogTimeStep(bool val = true) {fLogTimeStep = true;}
void SetLogTimeStep(bool val = true) { fLogTimeStep = true; }
void SetZAIThreshold(int z = 90) { fZAIThreshold = z;}
//********* Add Method *********//
/*!
......@@ -225,6 +229,8 @@ class Scenario : public CLASSObject
void AddWaste(IsotopicVector isotopicvector) { fWaste.Add(isotopicvector); } //!< Add a isotopicVector to Waste
void AddToPower(double power) { fParcPower += power;} //!< Add power to the installed power in the Parc
void ApplyZAIThreshold();
//@}
......@@ -269,6 +275,8 @@ class Scenario : public CLASSObject
/// \li 16 fuel Fabrication
int fZAIThreshold; ///<
vector<Storage*> fStorage; ///< Vector of Storages
vector<Pool*> fPool; ///< Vector of Pool
vector<Reactor*> fReactor; ///< Vector of Reactor
......
......@@ -94,6 +94,18 @@ IsotopicVector CLASSBackEnd::GetDecay(IsotopicVector isotopicvector, cSecond t)
}
void CLASSBackEnd::ApplyZAIThreshold(int z)
{
fInsideIV.ApplyZAIThreshold(z);
fCumulativeIVIn.ApplyZAIThreshold(z);
fCumulativeIVOut.ApplyZAIThreshold(z);
for(int i = 0; i < (int)fIVArray.size(); i++)
fIVArray[i].ApplyZAIThreshold(z);
}
map<cSecond,int> CLASSBackEnd::GetTheBackEndTimePath()
{
DBGL
......
......@@ -78,4 +78,14 @@ CLASSFacility::CLASSFacility(CLASSLogger* log, cSecond creationtime, cSecond lif
fCreationTime = creationtime;
fLifeTime = lifetime;
}
void CLASSFacility::ApplyZAIThreshold(int z)
{
fInsideIV.ApplyZAIThreshold(z);
fCumulativeIVIn.ApplyZAIThreshold(z);
fCumulativeIVOut.ApplyZAIThreshold(z);
}
\ No newline at end of file
......@@ -432,6 +432,31 @@ void IsotopicVector::Remove(const IsotopicVector& isotopicvector)
}
//________________________________________________________________________
void IsotopicVector::ApplyZAIThreshold(int z)
{
map<ZAI ,double> cleanedIsotopicQuantity;
cleanedIsotopicQuantity.insert( pair<ZAI ,double>(ZAI(-2,-2,-2), 0));
map<ZAI ,double> isotopicquantity = (*this).GetIsotopicQuantity();
map<ZAI ,double >::iterator it;
for( it = isotopicquantity.begin(); it != isotopicquantity.end(); it++)
{
if( (*it).first.Z() < z)
cleanedIsotopicQuantity[ZAI(-2,-2,-2)] += (*it).second;
else
cleanedIsotopicQuantity.insert(*it);
}
fIsotopicQuantity = cleanedIsotopicQuantity;
}
//________________________________________________________________________
void IsotopicVector::Need(const ZAI& zai, double quantity)
{
......
......@@ -64,6 +64,7 @@ Scenario::Scenario(CLASSLogger* log, cSecond abstime):CLASSObject(log)
fParcPower = 0;
fZAIThreshold = -1;
// Warning
......@@ -99,6 +100,7 @@ Scenario::Scenario( cSecond abstime, CLASSLogger* log):CLASSObject(log)
fParcPower = 0;
fZAIThreshold = -1;
// Warning
......@@ -133,6 +135,7 @@ Scenario::Scenario( cSecond abstime ):CLASSObject(new CLASSLogger("CLASS_OUTPUT.
fParcPower = 0;
fZAIThreshold = -1;
// Warning
......@@ -670,6 +673,9 @@ void Scenario::Evolution(cSecond t)
{
#pragma omp single
{
if(fZAIThreshold != -1)
ApplyZAIThreshold();
UpdateParc();
fOutT->Fill();
ProgressPrintout( (cSecond)t);
......@@ -715,6 +721,30 @@ void Scenario::ProgressPrintout(cSecond t)
//________________________________________________________________________
//______________________________ Out Method ______________________________
//________________________________________________________________________
void Scenario::ApplyZAIThreshold()
{
for(int i =0; i < (int)fFabricationPlant.size(); i++)
fFabricationPlant[i]->ApplyZAIThreshold(fZAIThreshold);
for(int i = 0; i < (int) fPool.size();i++)
fPool[i]->ApplyZAIThreshold(fZAIThreshold);
for(int i = 0; i < (int)fStorage.size(); i++)
fStorage[i]->ApplyZAIThreshold(fZAIThreshold);
for(int i = 0; i < (int)fReactor.size(); i++)
fReactor[i]->ApplyZAIThreshold(fZAIThreshold);
fWaste.ApplyZAIThreshold(fZAIThreshold);
}
void Scenario::UpdateParc()
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment