mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1058 Convert time of flight to days
This commit is contained in:
parent
c19fc232c8
commit
c65c9b1c58
@ -38,45 +38,30 @@ RigFlowDiagTimeStepResult::RigFlowDiagTimeStepResult(size_t activeCellCount)
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFlowDiagTimeStepResult::setInjectorTracerTOF(const std::string& tracerName, const std::map<int, double>& cellValues)
|
||||
{
|
||||
std::set<std::string> tracers;
|
||||
tracers.insert(tracerName);
|
||||
|
||||
this->addResult(RigFlowDiagResultAddress(RIG_FLD_TOF_RESNAME, tracers), cellValues);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFlowDiagTimeStepResult::setInjectorTracerFraction(const std::string& tracerName, const std::map<int, double>& cellValues)
|
||||
void RigFlowDiagTimeStepResult::setTracerTOF(const std::string& tracerName, const std::map<int, double>& cellValues)
|
||||
{
|
||||
std::set<std::string> tracers;
|
||||
tracers.insert(tracerName);
|
||||
|
||||
RigFlowDiagResultAddress resAddr(RIG_FLD_TOF_RESNAME, tracers);
|
||||
|
||||
this->addResult(RigFlowDiagResultAddress(RIG_FLD_CELL_FRACTION_RESNAME, tracers), cellValues);
|
||||
this->addResult(resAddr, cellValues);
|
||||
|
||||
std::vector<double>& activeCellValues = m_nativeResults[resAddr];
|
||||
for (double & val: activeCellValues)
|
||||
{
|
||||
val = val * 1.15741e-5; // days pr second. Converting to days
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFlowDiagTimeStepResult::setProducerTracerTOF(const std::string& tracerName, const std::map<int, double>& cellValues)
|
||||
{
|
||||
std::set<std::string> tracers;
|
||||
tracers.insert(tracerName);
|
||||
|
||||
this->addResult(RigFlowDiagResultAddress(RIG_FLD_TOF_RESNAME, tracers), cellValues);
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFlowDiagTimeStepResult::setProducerTracerFraction(const std::string& tracerName, const std::map<int, double>& cellValues)
|
||||
void RigFlowDiagTimeStepResult::setTracerFraction(const std::string& tracerName, const std::map<int, double>& cellValues)
|
||||
{
|
||||
std::set<std::string> tracers;
|
||||
tracers.insert(tracerName);
|
||||
@ -232,9 +217,9 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI
|
||||
for ( const CellSetID& tracerId: injSol.startPoints() )
|
||||
{
|
||||
CellSetValues tofVals = injSol.timeOfFlight(tracerId);
|
||||
result.setInjectorTracerTOF(tracerId.to_string(), tofVals);
|
||||
result.setTracerTOF(tracerId.to_string(), tofVals);
|
||||
CellSetValues fracVals = injSol.concentration(tracerId);
|
||||
result.setInjectorTracerFraction(tracerId.to_string(), fracVals);
|
||||
result.setTracerFraction(tracerId.to_string(), fracVals);
|
||||
}
|
||||
}
|
||||
|
||||
@ -251,9 +236,9 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI
|
||||
for ( const CellSetID& tracerId: prodSol.startPoints() )
|
||||
{
|
||||
CellSetValues tofVals = prodSol.timeOfFlight(tracerId);
|
||||
result.setProducerTracerTOF(tracerId.to_string(), tofVals);
|
||||
result.setTracerTOF(tracerId.to_string(), tofVals);
|
||||
CellSetValues fracVals = prodSol.concentration(tracerId);
|
||||
result.setInjectorTracerFraction(tracerId.to_string(), fracVals);
|
||||
result.setTracerFraction(tracerId.to_string(), fracVals);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,10 +35,8 @@ class RigFlowDiagTimeStepResult
|
||||
public:
|
||||
RigFlowDiagTimeStepResult(size_t activeCellCount);
|
||||
|
||||
void setInjectorTracerTOF (const std::string& tracerName, const std::map<int, double>& cellValues);
|
||||
void setInjectorTracerFraction(const std::string& tracerName, const std::map<int, double>& cellValues);
|
||||
void setProducerTracerTOF (const std::string& tracerName, const std::map<int, double>& cellValues);
|
||||
void setProducerTracerFraction(const std::string& tracerName, const std::map<int, double>& cellValues);
|
||||
void setTracerTOF (const std::string& tracerName, const std::map<int, double>& cellValues);
|
||||
void setTracerFraction(const std::string& tracerName, const std::map<int, double>& cellValues);
|
||||
|
||||
// Use to "steal" the data from this one using swap
|
||||
std::map<RigFlowDiagResultAddress, std::vector<double> >& nativeResults() { return m_nativeResults; }
|
||||
|
Loading…
Reference in New Issue
Block a user