mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-11 07:56:08 -06:00
#1320 - pre-proto - Performing harmonic mean upscaling for stimPlan values
This commit is contained in:
parent
28a794cc40
commit
0f86097870
@ -157,8 +157,31 @@ void RifEclipseExportTools::performStimPlanUpscalingAndPrintResults(const std::v
|
|||||||
fracture->computeUpscaledPropertyFromStimPlan(caseToApply);
|
fracture->computeUpscaledPropertyFromStimPlan(caseToApply);
|
||||||
std::vector<RigFractureData> fracDataVector = fracture->attachedRigFracture()->fractureData();
|
std::vector<RigFractureData> fracDataVector = fracture->attachedRigFracture()->fractureData();
|
||||||
|
|
||||||
|
out << qSetFieldWidth(4);
|
||||||
|
out << "-- ";
|
||||||
|
|
||||||
|
out << qSetFieldWidth(12);
|
||||||
|
out << "Well";
|
||||||
|
|
||||||
|
out << qSetFieldWidth(16);
|
||||||
|
out << "Fracture name ";
|
||||||
|
|
||||||
|
|
||||||
|
out << qSetFieldWidth(5);
|
||||||
|
out << "i"; // 2. I location grid block, adding 1 to go to eclipse 1-based grid definition
|
||||||
|
out << "j"; // 3. J location grid block, adding 1 to go to eclipse 1-based grid definition
|
||||||
|
out << "k"; // 4. K location of upper connecting grid block, adding 1 to go to eclipse 1-based grid definition
|
||||||
|
|
||||||
|
out << qSetFieldWidth(10);
|
||||||
|
out << "cellIndex";
|
||||||
|
out << "Aritm. ";
|
||||||
|
out << "Harm. ";
|
||||||
|
|
||||||
|
out << "\n";
|
||||||
|
|
||||||
for (RigFractureData fracData : fracDataVector)
|
for (RigFractureData fracData : fracDataVector)
|
||||||
{
|
{
|
||||||
|
|
||||||
out << qSetFieldWidth(4);
|
out << qSetFieldWidth(4);
|
||||||
out << "-- ";
|
out << "-- ";
|
||||||
|
|
||||||
@ -182,7 +205,8 @@ void RifEclipseExportTools::performStimPlanUpscalingAndPrintResults(const std::v
|
|||||||
|
|
||||||
out << qSetFieldWidth(10);
|
out << qSetFieldWidth(10);
|
||||||
out << fracData.cellIndex;
|
out << fracData.cellIndex;
|
||||||
out << QString::number(fracData.upscaledStimPlanValue, 'f', 3);
|
out << QString::number(fracData.upscaledAritmStimPlanValue, 'f', 3);
|
||||||
|
out << QString::number(fracData.upscaledHarmStimPlanValue, 'f', 3);
|
||||||
|
|
||||||
out << "\n";
|
out << "\n";
|
||||||
}
|
}
|
||||||
|
@ -563,7 +563,7 @@ void RimFracture::computeUpscaledPropertyFromStimPlan(RimEclipseCase* caseToAppl
|
|||||||
for (size_t fracCell : fracCells)
|
for (size_t fracCell : fracCells)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (fracCell == 168690)
|
if (fracCell == 160050)
|
||||||
{
|
{
|
||||||
qDebug() << "Test";
|
qDebug() << "Test";
|
||||||
}
|
}
|
||||||
@ -605,8 +605,7 @@ void RimFracture::computeUpscaledPropertyFromStimPlan(RimEclipseCase* caseToAppl
|
|||||||
|
|
||||||
double area;
|
double area;
|
||||||
std::vector<double> areaOfFractureParts;
|
std::vector<double> areaOfFractureParts;
|
||||||
std::vector<double> areaXvalueOfFractureParts;
|
std::vector<double> valuesForFractureParts;
|
||||||
|
|
||||||
|
|
||||||
for (std::vector<cvf::Vec3d> planeCellPolygon : planeCellPolygons)
|
for (std::vector<cvf::Vec3d> planeCellPolygon : planeCellPolygons)
|
||||||
{
|
{
|
||||||
@ -624,29 +623,21 @@ void RimFracture::computeUpscaledPropertyFromStimPlan(RimEclipseCase* caseToAppl
|
|||||||
{
|
{
|
||||||
area = cvf::GeometryTools::polygonAreaNormal3D(clippedStimPlanPolygon).length();
|
area = cvf::GeometryTools::polygonAreaNormal3D(clippedStimPlanPolygon).length();
|
||||||
areaOfFractureParts.push_back(area);
|
areaOfFractureParts.push_back(area);
|
||||||
areaXvalueOfFractureParts.push_back(area*stimPlanParameterValue);
|
valuesForFractureParts.push_back(stimPlanParameterValue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (areaOfFractureParts.size() > 0)
|
||||||
}
|
|
||||||
|
|
||||||
if (areaXvalueOfFractureParts.size() > 0)
|
|
||||||
{
|
{
|
||||||
double fractureCellArea = 0.0;
|
fracData.upscaledAritmStimPlanValue = areaWeightedArithmeticAverage(areaOfFractureParts, valuesForFractureParts);
|
||||||
for (double area : areaOfFractureParts) fractureCellArea += area;
|
fracData.upscaledHarmStimPlanValue = areaWeightedHarmonicAverage(areaOfFractureParts, valuesForFractureParts);
|
||||||
double fractureCellAreaXvalue = 0.0;
|
|
||||||
for (double areaXvalue : areaXvalueOfFractureParts) fractureCellAreaXvalue += areaXvalue;
|
|
||||||
double upscaledValueArithmetic = fractureCellAreaXvalue / fractureCellArea;
|
|
||||||
|
|
||||||
fracData.upscaledStimPlanValue = upscaledValueArithmetic;
|
|
||||||
fracData.cellIndex = fracCell;
|
fracData.cellIndex = fracCell;
|
||||||
fracDataVec.push_back(fracData);
|
fracDataVec.push_back(fracData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_rigFracture->setFractureData(fracDataVec);
|
m_rigFracture->setFractureData(fracDataVec);
|
||||||
@ -655,6 +646,48 @@ void RimFracture::computeUpscaledPropertyFromStimPlan(RimEclipseCase* caseToAppl
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
double RimFracture::areaWeightedHarmonicAverage(std::vector<double> areaOfFractureParts, std::vector<double> valuesForFractureParts)
|
||||||
|
{
|
||||||
|
//TODO: Unit test?
|
||||||
|
double fractureCellArea = 0.0;
|
||||||
|
for (double area : areaOfFractureParts) fractureCellArea += area;
|
||||||
|
|
||||||
|
if (areaOfFractureParts.size() != valuesForFractureParts.size()) return cvf::UNDEFINED_DOUBLE;
|
||||||
|
|
||||||
|
double fractureCellAreaDivvalue = 0.0;
|
||||||
|
for (int i = 0; i < valuesForFractureParts.size(); i++)
|
||||||
|
{
|
||||||
|
fractureCellAreaDivvalue += areaOfFractureParts[i] / valuesForFractureParts[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
double upscaledValueHarmonic = fractureCellArea / fractureCellAreaDivvalue;
|
||||||
|
return upscaledValueHarmonic;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
double RimFracture::areaWeightedArithmeticAverage(std::vector<double> areaOfFractureParts, std::vector<double> valuesForFractureParts)
|
||||||
|
{
|
||||||
|
//TODO: Unit test?
|
||||||
|
double fractureCellArea = 0.0;
|
||||||
|
for (double area : areaOfFractureParts) fractureCellArea += area;
|
||||||
|
|
||||||
|
if (areaOfFractureParts.size() != valuesForFractureParts.size()) return cvf::UNDEFINED_DOUBLE;
|
||||||
|
|
||||||
|
double fractureCellAreaXvalue = 0.0;
|
||||||
|
for (int i = 0; i < valuesForFractureParts.size(); i++)
|
||||||
|
{
|
||||||
|
fractureCellAreaXvalue += areaOfFractureParts[i] * valuesForFractureParts[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
double upscaledValueArithmetic = fractureCellAreaXvalue / fractureCellArea;
|
||||||
|
return upscaledValueArithmetic;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -87,6 +87,9 @@ public:
|
|||||||
void computeTransmissibility(RimEclipseCase* caseToApply);
|
void computeTransmissibility(RimEclipseCase* caseToApply);
|
||||||
void computeUpscaledPropertyFromStimPlan(RimEclipseCase* caseToApply);
|
void computeUpscaledPropertyFromStimPlan(RimEclipseCase* caseToApply);
|
||||||
|
|
||||||
|
double areaWeightedHarmonicAverage(std::vector<double> areaOfFractureParts, std::vector<double> valuesForFractureParts);
|
||||||
|
double areaWeightedArithmeticAverage(std::vector<double> areaOfFractureParts, std::vector<double> valuesForFractureParts);
|
||||||
|
|
||||||
|
|
||||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||||
cvf::Vec3d fracturePosition() const;
|
cvf::Vec3d fracturePosition() const;
|
||||||
|
@ -47,7 +47,8 @@ public:
|
|||||||
bool cellIsActive;
|
bool cellIsActive;
|
||||||
|
|
||||||
//TODO: Used for upscaling - should be moved?
|
//TODO: Used for upscaling - should be moved?
|
||||||
double upscaledStimPlanValue;
|
double upscaledAritmStimPlanValue;
|
||||||
|
double upscaledHarmStimPlanValue;
|
||||||
size_t cellIndex;
|
size_t cellIndex;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user