#1364 - pre-proto - Fixing bugs in calculation of upscaled cond values

This commit is contained in:
astridkbjorke 2017-03-31 10:25:24 +02:00
parent 228e39880f
commit 4f645758b3
5 changed files with 31 additions and 25 deletions

View File

@ -187,8 +187,8 @@ void RifEclipseExportTools::performStimPlanUpscalingAndPrintResults(const std::v
out << qSetFieldWidth(10);
out << "cellIndex";
out << "Aritm. ";
out << "Harm. ";
out << "condHA. ";
out << "condAH. ";
out << "\n";
@ -218,8 +218,8 @@ void RifEclipseExportTools::performStimPlanUpscalingAndPrintResults(const std::v
out << qSetFieldWidth(10);
out << fracData.reservoirCellIndex;
out << QString::number(fracData.upscaledAritmStimPlanValue, 'f', 3);
out << QString::number(fracData.upscaledHarmStimPlanValue, 'f', 3);
out << QString::number(fracData.upscaledStimPlanValueHA, 'f', 3);
out << QString::number(fracData.upscaledStimPlanValueAH, 'f', 3);
out << "\n";
}

View File

@ -801,17 +801,17 @@ std::vector<RigStimPlanCell*> RimStimPlanFractureTemplate::getStimPlanCells(cons
std::vector<double> depthCoords;
for (int i = 0; i < depthCoordsAtNodes.size() - 1; i++) depthCoords.push_back((depthCoordsAtNodes[i] + depthCoordsAtNodes[i + 1]) / 2);
for (int i = 0; i < xCoords.size() - 1; i++)
for (int j = 0; j < xCoords.size() - 1; j++)
{
for (int j = 0; j < depthCoords.size() - 1; j++)
for (int i = 0; i < depthCoords.size() - 1; i++)
{
std::vector<cvf::Vec3d> cellPolygon;
cellPolygon.push_back(cvf::Vec3d(static_cast<float>(xCoords[i]), static_cast<float>(depthCoords[j]), 0.0));
cellPolygon.push_back(cvf::Vec3d(static_cast<float>(xCoords[i + 1]), static_cast<float>(depthCoords[j]), 0.0));
cellPolygon.push_back(cvf::Vec3d(static_cast<float>(xCoords[i + 1]), static_cast<float>(depthCoords[j + 1]), 0.0));
cellPolygon.push_back(cvf::Vec3d(static_cast<float>(xCoords[i]), static_cast<float>(depthCoords[j + 1]), 0.0));
cellPolygon.push_back(cvf::Vec3d(static_cast<float>(xCoords[j]), static_cast<float>(depthCoords[i]), 0.0));
cellPolygon.push_back(cvf::Vec3d(static_cast<float>(xCoords[j + 1]), static_cast<float>(depthCoords[i]), 0.0));
cellPolygon.push_back(cvf::Vec3d(static_cast<float>(xCoords[j + 1]), static_cast<float>(depthCoords[i + 1]), 0.0));
cellPolygon.push_back(cvf::Vec3d(static_cast<float>(xCoords[j]), static_cast<float>(depthCoords[i + 1]), 0.0));
RigStimPlanCell* stimPlanCell = new RigStimPlanCell(cellPolygon, propertyValuesAtTimeStep[j + 1][i + 1], i, j);
RigStimPlanCell* stimPlanCell = new RigStimPlanCell(cellPolygon, propertyValuesAtTimeStep[i + 1][j + 1], i, j);
stimPlanCells.push_back(stimPlanCell);
}
}

View File

@ -47,8 +47,8 @@ public:
bool cellIsActive;
//TODO: Used for upscaling - should be moved?
double upscaledAritmStimPlanValue;
double upscaledHarmStimPlanValue;
double upscaledStimPlanValueHA;
double upscaledStimPlanValueAH;
};

View File

@ -351,12 +351,13 @@ std::pair<double, double> RigFractureTransCalc::flowAcrossLayersUpscaling(QStrin
cvf::Vec3d directionAcrossLayers;
cvf::Vec3d directionAlongLayers;
//TODO: Get these vectors properly...
directionAcrossLayers = cvf::Vec3d(0, -1, 0);
directionAlongLayers = cvf::Vec3d(1, 0, 0);
directionAcrossLayers = cvf::Vec3d(0.0, -1.0, 0.0);
directionAlongLayers = cvf::Vec3d(1.0, 0.0, 0.0);
directionAcrossLayers.transformVector(static_cast<cvf::Mat4d>(invertedTransMatrix));
directionAlongLayers.transformVector(static_cast<cvf::Mat4d>(invertedTransMatrix));
//TODO: Rotate if dip, tilt != 0 Or is this already handled when transforming to frature plane???
//directionAcrossLayers.transformVector(static_cast<cvf::Mat4d>(invertedTransMatrix));
//directionAlongLayers.transformVector(static_cast<cvf::Mat4d>(invertedTransMatrix));
std::vector<cvf::Vec3f> fracPolygon = m_fracture->attachedFractureDefinition()->fracturePolygon(unitSystem);
std::vector<std::vector<cvf::Vec3d> > polygonsDescribingFractureInCell;
@ -427,7 +428,8 @@ double RigFractureTransCalc::computeHAupscale(RimStimPlanFractureTemplate* fracT
DcolSum.push_back(sumDi);
double lAvgValue = sumLiDi / sumDi;
lavgCol.push_back(lAvgValue);
CondHarmCol.push_back(1 / (sumLiDi*sumDiDivCondLi));
double harmMeanForCol = (sumDi / lAvgValue) * (1 / sumDiDivCondLi);
CondHarmCol.push_back(harmMeanForCol);
}
}
@ -577,13 +579,13 @@ void RigFractureTransCalc::computeUpscaledPropertyFromStimPlan( QString resultNa
std::pair<double, double> upscaledCondFlowAcrossLayers = flowAcrossLayersUpscaling(resultName, resultUnit, timeStepIndex, m_unitForCalculation, fracCell);
double upscaledAritmStimPlanValue = upscaledCondFlowAcrossLayers.first;
double upscaledHarmStimPlanValue = upscaledCondFlowAcrossLayers.second;
double upscaledStimPlanValueHA = upscaledCondFlowAcrossLayers.first;
double upscaledStimPlanValueAH = upscaledCondFlowAcrossLayers.second;
if (upscaledAritmStimPlanValue != cvf::UNDEFINED_DOUBLE)
if (upscaledStimPlanValueHA != cvf::UNDEFINED_DOUBLE)
{
fracData.upscaledAritmStimPlanValue = upscaledAritmStimPlanValue;
fracData.upscaledHarmStimPlanValue = upscaledHarmStimPlanValue;
fracData.upscaledStimPlanValueHA = upscaledStimPlanValueHA;
fracData.upscaledStimPlanValueAH = upscaledStimPlanValueAH;
fracDataVec.push_back(fracData);
}

View File

@ -63,12 +63,16 @@ public:
static std::vector<RigStimPlanCell*> getRowOfStimPlanCells(std::vector<RigStimPlanCell*> allStimPlanCells, size_t i);
static std::vector<RigStimPlanCell*> getColOfStimPlanCells(std::vector<RigStimPlanCell*> allStimPlanCells, size_t j);
private:
double convertConductivtyValue(double Kw, RimDefines::UnitSystem fromUnit, RimDefines::UnitSystem toUnit);
private:
RimEclipseCase* m_case;
RimFracture* m_fracture;
RimDefines::UnitSystem m_unitForCalculation;
double convertConductivtyValue(double Kw, RimDefines::UnitSystem fromUnit, RimDefines::UnitSystem toUnit);
//TODO: Legge til rigFractureData vektor her...
//TODO: Funksjoner for å sette / hente data basert på celleindex
};