mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2559 Fracture Template : Fix unit conversion for width and conductivity
This commit is contained in:
@@ -55,7 +55,10 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Unit : meter or feet
|
||||||
double m_width;
|
double m_width;
|
||||||
|
|
||||||
|
// Unit : mD (milliDarcy)
|
||||||
double m_permeability;
|
double m_permeability;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -444,14 +444,30 @@ FractureWidthAndConductivity RimStimPlanFractureTemplate::widthAndConductivityAt
|
|||||||
{
|
{
|
||||||
if (nameUnit.first == propertyNameForFractureWidth)
|
if (nameUnit.first == propertyNameForFractureWidth)
|
||||||
{
|
{
|
||||||
auto data = m_stimPlanFractureDefinitionData->fractureGridResults(nameUnit.first, nameUnit.second, m_activeTimeStepIndex);
|
double widthInRequiredUnit = HUGE_VAL;
|
||||||
|
|
||||||
double width = data[wellCellIndex];
|
|
||||||
|
|
||||||
if (fabs(width) > 1e-20)
|
|
||||||
{
|
{
|
||||||
values.m_width = width;
|
auto resultValues = m_stimPlanFractureDefinitionData->fractureGridResults(nameUnit.first, nameUnit.second, m_activeTimeStepIndex);
|
||||||
values.m_permeability = conductivity / width;
|
|
||||||
|
double widthInFileUnitSystem = resultValues[wellCellIndex];
|
||||||
|
|
||||||
|
if (fractureTemplateUnit() == RiaEclipseUnitTools::UNITS_METRIC)
|
||||||
|
{
|
||||||
|
QString unitText = nameUnit.second;
|
||||||
|
|
||||||
|
widthInRequiredUnit = RiaEclipseUnitTools::convertToMeter(widthInFileUnitSystem, unitText);
|
||||||
|
}
|
||||||
|
else if (fractureTemplateUnit() == RiaEclipseUnitTools::UNITS_FIELD)
|
||||||
|
{
|
||||||
|
QString unitText = nameUnit.second;
|
||||||
|
|
||||||
|
widthInRequiredUnit = RiaEclipseUnitTools::convertToFeet(widthInFileUnitSystem, unitText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (widthInRequiredUnit != HUGE_VAL && fabs(widthInRequiredUnit) > 1e-20)
|
||||||
|
{
|
||||||
|
values.m_width = widthInRequiredUnit;
|
||||||
|
values.m_permeability = conductivity / widthInRequiredUnit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -662,6 +678,7 @@ double RimStimPlanFractureTemplate::resultValueAtIJ(const QString& uiResultName,
|
|||||||
|
|
||||||
if (adjustedI >= fractureGrid()->iCellCount() || adjustedJ >= fractureGrid()->jCellCount())
|
if (adjustedI >= fractureGrid()->iCellCount() || adjustedJ >= fractureGrid()->jCellCount())
|
||||||
{
|
{
|
||||||
|
|
||||||
return HUGE_VAL;
|
return HUGE_VAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -700,12 +717,10 @@ void RimStimPlanFractureTemplate::updateFractureGrid()
|
|||||||
|
|
||||||
if (m_stimPlanFractureDefinitionData.notNull())
|
if (m_stimPlanFractureDefinitionData.notNull())
|
||||||
{
|
{
|
||||||
QString condUnit = RiaDefines::unitStringConductivity(fractureTemplateUnit());
|
|
||||||
|
|
||||||
m_fractureGrid = m_stimPlanFractureDefinitionData->createFractureGrid(m_conductivityResultNameOnFile,
|
m_fractureGrid = m_stimPlanFractureDefinitionData->createFractureGrid(m_conductivityResultNameOnFile,
|
||||||
m_activeTimeStepIndex,
|
m_activeTimeStepIndex,
|
||||||
condUnit,
|
m_wellPathDepthAtFracture,
|
||||||
m_wellPathDepthAtFracture);
|
m_fractureTemplateUnit());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ void RigStimPlanFractureDefinition::scaleYs(double scaleFactor, double wellPathI
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RigStimPlanFractureDefinition::setTvdToTopPerf(double topPerfTvd)
|
void RigStimPlanFractureDefinition::setTvdToTopPerf(double topPerfTvd)
|
||||||
{
|
{
|
||||||
@@ -276,22 +276,86 @@ std::vector<std::pair<QString, QString> > RigStimPlanFractureDefinition::getStim
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::vector<std::vector<double>>
|
||||||
|
RigStimPlanFractureDefinition::conductivityValuesAtTimeStep(const QString& resultName,
|
||||||
|
int activeTimeStepIndex,
|
||||||
|
RiaEclipseUnitTools::UnitSystem requiredUnitSet) const
|
||||||
|
{
|
||||||
|
std::vector<std::vector<double>> conductivityValues;
|
||||||
|
|
||||||
|
QString conductivityUnitTextOnFile;
|
||||||
|
|
||||||
|
std::vector<std::pair<QString, QString>> propertyNamesUnitsOnFile = this->getStimPlanPropertyNamesUnits();
|
||||||
|
for (auto properyNameUnit : propertyNamesUnitsOnFile)
|
||||||
|
{
|
||||||
|
if (resultName == properyNameUnit.first)
|
||||||
|
{
|
||||||
|
conductivityUnitTextOnFile = properyNameUnit.second;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (conductivityUnitTextOnFile.isEmpty())
|
||||||
|
{
|
||||||
|
RiaLogging::error("Did not find unit for conductivity on file");
|
||||||
|
|
||||||
|
return conductivityValues;
|
||||||
|
}
|
||||||
|
|
||||||
|
conductivityValues = this->getDataAtTimeIndex(resultName, conductivityUnitTextOnFile, activeTimeStepIndex);
|
||||||
|
|
||||||
|
// Convert to the conductivity unit system used by the fracture template
|
||||||
|
// The conductivity value is used in the computations of transmissibility when exporting COMPDAT, and has unit md-m or md-ft
|
||||||
|
// This unit must match the unit used to represent coordinates of the grid used for export
|
||||||
|
|
||||||
|
QString conversionUnitText;
|
||||||
|
if (conductivityUnitTextOnFile == "md-m")
|
||||||
|
{
|
||||||
|
conversionUnitText = "m";
|
||||||
|
}
|
||||||
|
else if (conductivityUnitTextOnFile == "md-ft")
|
||||||
|
{
|
||||||
|
conversionUnitText = "ft";
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto& yValues : conductivityValues)
|
||||||
|
{
|
||||||
|
for (auto& xVal : yValues)
|
||||||
|
{
|
||||||
|
if (requiredUnitSet == RiaEclipseUnitTools::UNITS_FIELD)
|
||||||
|
{
|
||||||
|
xVal = RiaEclipseUnitTools::convertToFeet(xVal, conversionUnitText);
|
||||||
|
}
|
||||||
|
else if (requiredUnitSet == RiaEclipseUnitTools::UNITS_METRIC)
|
||||||
|
{
|
||||||
|
xVal = RiaEclipseUnitTools::convertToMeter(xVal, conversionUnitText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return conductivityValues;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
cvf::ref<RigFractureGrid> RigStimPlanFractureDefinition::createFractureGrid(const QString& resultName,
|
cvf::ref<RigFractureGrid> RigStimPlanFractureDefinition::createFractureGrid(const QString& resultName,
|
||||||
int activeTimeStepIndex,
|
int activeTimeStepIndex,
|
||||||
const QString& conductivityUnitText,
|
double wellPathIntersectionAtFractureDepth,
|
||||||
double wellPathIntersectionAtFractureDepth)
|
RiaEclipseUnitTools::UnitSystem requiredUnitSet)
|
||||||
{
|
{
|
||||||
|
std::vector<std::vector<double>> conductivityValues = conductivityValuesAtTimeStep(resultName, activeTimeStepIndex, requiredUnitSet);
|
||||||
|
if (conductivityValues.empty())
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<RigFractureCell> stimPlanCells;
|
std::vector<RigFractureCell> stimPlanCells;
|
||||||
std::pair<size_t, size_t> wellCenterStimPlanCellIJ = std::make_pair(0, 0);
|
std::pair<size_t, size_t> wellCenterStimPlanCellIJ = std::make_pair(0, 0);
|
||||||
|
|
||||||
bool wellCenterStimPlanCellFound = false;
|
bool wellCenterStimPlanCellFound = false;
|
||||||
|
|
||||||
std::vector<std::vector<double>> conductivityValuesAtTimeStep = this->getDataAtTimeIndex(resultName,
|
|
||||||
conductivityUnitText,
|
|
||||||
activeTimeStepIndex);
|
|
||||||
|
|
||||||
std::vector<double> yCoordsAtNodes = this->adjustedYCoordsAroundWellPathPosition(wellPathIntersectionAtFractureDepth);
|
std::vector<double> yCoordsAtNodes = this->adjustedYCoordsAroundWellPathPosition(wellPathIntersectionAtFractureDepth);
|
||||||
std::vector<double> xCoordsAtNodes = this->m_Xs;
|
std::vector<double> xCoordsAtNodes = this->m_Xs;
|
||||||
|
|
||||||
@@ -311,9 +375,9 @@ cvf::ref<RigFractureGrid> RigStimPlanFractureDefinition::createFractureGrid(cons
|
|||||||
cellPolygon.push_back(cvf::Vec3d(xCoords[i], depthCoords[j + 1], 0.0));
|
cellPolygon.push_back(cvf::Vec3d(xCoords[i], depthCoords[j + 1], 0.0));
|
||||||
|
|
||||||
RigFractureCell stimPlanCell(cellPolygon, i, j);
|
RigFractureCell stimPlanCell(cellPolygon, i, j);
|
||||||
if ( conductivityValuesAtTimeStep.size() > 0 ) //Assuming vector to be of correct length, or no values
|
if ( conductivityValues.size() > 0 ) //Assuming vector to be of correct length, or no values
|
||||||
{
|
{
|
||||||
stimPlanCell.setConductivityValue(conductivityValuesAtTimeStep[j + 1][i + 1]);
|
stimPlanCell.setConductivityValue(conductivityValues[j + 1][i + 1]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -73,8 +73,8 @@ public:
|
|||||||
|
|
||||||
cvf::ref<RigFractureGrid> createFractureGrid(const QString& resultName,
|
cvf::ref<RigFractureGrid> createFractureGrid(const QString& resultName,
|
||||||
int activeTimeStepIndex,
|
int activeTimeStepIndex,
|
||||||
const QString& conductivityUnitText,
|
double wellPathIntersectionAtFractureDepth,
|
||||||
double wellPathIntersectionAtFractureDepth);
|
RiaEclipseUnitTools::UnitSystem requiredUnitSet);
|
||||||
|
|
||||||
void createFractureTriangleGeometry(double wellPathIntersectionAtFractureDepth,
|
void createFractureTriangleGeometry(double wellPathIntersectionAtFractureDepth,
|
||||||
const QString& fractureUserName,
|
const QString& fractureUserName,
|
||||||
@@ -124,6 +124,10 @@ private:
|
|||||||
void scaleXs(double scaleFactor);
|
void scaleXs(double scaleFactor);
|
||||||
void scaleYs(double scaleFactor, double wellPathIntersectionY);
|
void scaleYs(double scaleFactor, double wellPathIntersectionY);
|
||||||
|
|
||||||
|
std::vector<std::vector<double>> conductivityValuesAtTimeStep(const QString& resultName,
|
||||||
|
int activeTimeStepIndex,
|
||||||
|
RiaEclipseUnitTools::UnitSystem requiredUnitSet) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RiaEclipseUnitTools::UnitSystem m_unitSet; // To be deleted
|
RiaEclipseUnitTools::UnitSystem m_unitSet; // To be deleted
|
||||||
std::vector<double> m_fileXs;
|
std::vector<double> m_fileXs;
|
||||||
|
|||||||
Reference in New Issue
Block a user