mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-10 23:46:00 -06:00
#2389 Fracture: Set perforation length and depth from file values
This commit is contained in:
parent
7779ff5ed0
commit
b2bdd996d2
@ -36,7 +36,6 @@ cvf::ref<RigStimPlanFractureDefinition> RifStimPlanXmlReader::readStimPlanXMLFil
|
|||||||
QString * errorMessage)
|
QString * errorMessage)
|
||||||
{
|
{
|
||||||
RiaLogging::info(QString("Starting to open StimPlan XML file: '%1'").arg(stimPlanFileName));
|
RiaLogging::info(QString("Starting to open StimPlan XML file: '%1'").arg(stimPlanFileName));
|
||||||
RiaEclipseUnitTools::UnitSystemType unitSystem = RiaEclipseUnitTools::UNITS_UNKNOWN;
|
|
||||||
|
|
||||||
cvf::ref<RigStimPlanFractureDefinition> stimPlanFileData = new RigStimPlanFractureDefinition;
|
cvf::ref<RigStimPlanFractureDefinition> stimPlanFileData = new RigStimPlanFractureDefinition;
|
||||||
size_t startingNegXsValues = 0;
|
size_t startingNegXsValues = 0;
|
||||||
@ -51,9 +50,10 @@ cvf::ref<RigStimPlanFractureDefinition> RifStimPlanXmlReader::readStimPlanXMLFil
|
|||||||
QXmlStreamReader xmlStream;
|
QXmlStreamReader xmlStream;
|
||||||
xmlStream.setDevice(&dataFile);
|
xmlStream.setDevice(&dataFile);
|
||||||
xmlStream.readNext();
|
xmlStream.readNext();
|
||||||
startingNegXsValues = readStimplanGridAndTimesteps(xmlStream, stimPlanFileData.p(), unitSystem);
|
startingNegXsValues = readStimplanGridAndTimesteps(xmlStream, stimPlanFileData.p());
|
||||||
|
|
||||||
|
RiaEclipseUnitTools::UnitSystemType unitSystem = stimPlanFileData->unitSet();
|
||||||
|
|
||||||
stimPlanFileData->setUnitSet(unitSystem);
|
|
||||||
if (unitSystem != RiaEclipseUnitTools::UNITS_UNKNOWN)
|
if (unitSystem != RiaEclipseUnitTools::UNITS_UNKNOWN)
|
||||||
RiaLogging::info(QString("Setting unit system for StimPlan fracture template %1 to %2").arg(stimPlanFileName).arg(unitSystem.uiText()));
|
RiaLogging::info(QString("Setting unit system for StimPlan fracture template %1 to %2").arg(stimPlanFileName).arg(unitSystem.uiText()));
|
||||||
else
|
else
|
||||||
@ -160,7 +160,7 @@ cvf::ref<RigStimPlanFractureDefinition> RifStimPlanXmlReader::readStimPlanXMLFil
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
size_t RifStimPlanXmlReader::readStimplanGridAndTimesteps(QXmlStreamReader &xmlStream, RigStimPlanFractureDefinition* stimPlanFileData, RiaEclipseUnitTools::UnitSystemType& unit)
|
size_t RifStimPlanXmlReader::readStimplanGridAndTimesteps(QXmlStreamReader &xmlStream, RigStimPlanFractureDefinition* stimPlanFileData)
|
||||||
{
|
{
|
||||||
|
|
||||||
size_t startNegValuesXs = 0;
|
size_t startNegValuesXs = 0;
|
||||||
@ -179,6 +179,16 @@ size_t RifStimPlanXmlReader::readStimplanGridAndTimesteps(QXmlStreamReader &xmlS
|
|||||||
if (xmlStream.name() == "grid")
|
if (xmlStream.name() == "grid")
|
||||||
{
|
{
|
||||||
gridunit = getAttributeValueString(xmlStream, "uom");
|
gridunit = getAttributeValueString(xmlStream, "uom");
|
||||||
|
|
||||||
|
if (gridunit == "m") stimPlanFileData->setUnitSet(RiaEclipseUnitTools::UNITS_METRIC);
|
||||||
|
else if (gridunit == "ft") stimPlanFileData->setUnitSet(RiaEclipseUnitTools::UNITS_FIELD);
|
||||||
|
else stimPlanFileData->setUnitSet(RiaEclipseUnitTools::UNITS_UNKNOWN);
|
||||||
|
|
||||||
|
double tvdToTopPerfFt = getAttributeValueDouble(xmlStream, "TVDToTopPerfFt");
|
||||||
|
double tvdToBottomPerfFt = getAttributeValueDouble(xmlStream, "TVDToBottomPerfFt");
|
||||||
|
|
||||||
|
stimPlanFileData->setTvdToTopPerf(tvdToTopPerfFt, RiaDefines::UNIT_FEET);
|
||||||
|
stimPlanFileData->setTvdToBottomPerf(tvdToBottomPerfFt, RiaDefines::UNIT_FEET);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xmlStream.name() == "xs")
|
if (xmlStream.name() == "xs")
|
||||||
@ -205,10 +215,6 @@ size_t RifStimPlanXmlReader::readStimplanGridAndTimesteps(QXmlStreamReader &xmlS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gridunit == "m") unit = RiaEclipseUnitTools::UNITS_METRIC;
|
|
||||||
else if (gridunit == "ft") unit = RiaEclipseUnitTools::UNITS_FIELD;
|
|
||||||
else unit = RiaEclipseUnitTools::UNITS_UNKNOWN;
|
|
||||||
|
|
||||||
if (startNegValuesYs > 0)
|
if (startNegValuesYs > 0)
|
||||||
{
|
{
|
||||||
RiaLogging::error(QString("Negative depth values detected in XML file"));
|
RiaLogging::error(QString("Negative depth values detected in XML file"));
|
||||||
|
@ -36,7 +36,7 @@ public:
|
|||||||
static cvf::ref<RigStimPlanFractureDefinition> readStimPlanXMLFile(const QString& stimPlanFileName, double conductivityScalingFactor, QString * errorMessage);
|
static cvf::ref<RigStimPlanFractureDefinition> readStimPlanXMLFile(const QString& stimPlanFileName, double conductivityScalingFactor, QString * errorMessage);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static size_t readStimplanGridAndTimesteps(QXmlStreamReader &xmlStream, RigStimPlanFractureDefinition* stimPlanFileData, RiaEclipseUnitTools::UnitSystemType& unit);
|
static size_t readStimplanGridAndTimesteps(QXmlStreamReader &xmlStream, RigStimPlanFractureDefinition* stimPlanFileData);
|
||||||
|
|
||||||
static double getAttributeValueDouble(QXmlStreamReader &xmlStream, QString parameterName);
|
static double getAttributeValueDouble(QXmlStreamReader &xmlStream, QString parameterName);
|
||||||
static QString getAttributeValueString(QXmlStreamReader &xmlStream, QString parameterName);
|
static QString getAttributeValueString(QXmlStreamReader &xmlStream, QString parameterName);
|
||||||
|
@ -214,6 +214,7 @@ void RimStimPlanFractureTemplate::setDefaultsBasedOnXMLfile()
|
|||||||
if (m_stimPlanFractureDefinitionData.isNull()) return;
|
if (m_stimPlanFractureDefinitionData.isNull()) return;
|
||||||
|
|
||||||
setDepthOfWellPathAtFracture();
|
setDepthOfWellPathAtFracture();
|
||||||
|
setPerforationLength();
|
||||||
RiaLogging::info(QString("Setting well/fracture intersection depth at %1").arg(m_wellPathDepthAtFracture));
|
RiaLogging::info(QString("Setting well/fracture intersection depth at %1").arg(m_wellPathDepthAtFracture));
|
||||||
m_activeTimeStepIndex = static_cast<int>(m_stimPlanFractureDefinitionData->totalNumberTimeSteps() - 1);
|
m_activeTimeStepIndex = static_cast<int>(m_stimPlanFractureDefinitionData->totalNumberTimeSteps() - 1);
|
||||||
bool polygonPropertySet = setBorderPolygonResultNameToDefault();
|
bool polygonPropertySet = setBorderPolygonResultNameToDefault();
|
||||||
@ -339,10 +340,40 @@ void RimStimPlanFractureTemplate::setDepthOfWellPathAtFracture()
|
|||||||
{
|
{
|
||||||
if (!m_stimPlanFractureDefinitionData.isNull())
|
if (!m_stimPlanFractureDefinitionData.isNull())
|
||||||
{
|
{
|
||||||
double firstDepth = m_stimPlanFractureDefinitionData->minDepth();
|
double firstTvd = m_stimPlanFractureDefinitionData->topPerfTvd();
|
||||||
double lastDepth = m_stimPlanFractureDefinitionData->maxDepth();
|
double lastTvd = m_stimPlanFractureDefinitionData->bottomPerfTvd();
|
||||||
double averageDepth = (firstDepth + lastDepth) / 2;
|
|
||||||
m_wellPathDepthAtFracture = averageDepth;
|
if (firstTvd != HUGE_VAL && lastTvd != HUGE_VAL)
|
||||||
|
{
|
||||||
|
m_wellPathDepthAtFracture = (firstTvd + lastTvd) / 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
firstTvd = m_stimPlanFractureDefinitionData->minDepth();
|
||||||
|
lastTvd = m_stimPlanFractureDefinitionData->maxDepth();
|
||||||
|
m_wellPathDepthAtFracture = (firstTvd + lastTvd) / 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimStimPlanFractureTemplate::setPerforationLength()
|
||||||
|
{
|
||||||
|
if (!m_stimPlanFractureDefinitionData.isNull())
|
||||||
|
{
|
||||||
|
double firstTvd = m_stimPlanFractureDefinitionData->topPerfTvd();
|
||||||
|
double lastTvd = m_stimPlanFractureDefinitionData->bottomPerfTvd();
|
||||||
|
|
||||||
|
if (firstTvd != HUGE_VAL && lastTvd != HUGE_VAL)
|
||||||
|
{
|
||||||
|
perforationLength = std::round(cvf::Math::abs(firstTvd - lastTvd));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
perforationLength = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,6 +99,7 @@ private:
|
|||||||
|
|
||||||
bool setBorderPolygonResultNameToDefault();
|
bool setBorderPolygonResultNameToDefault();
|
||||||
void setDepthOfWellPathAtFracture();
|
void setDepthOfWellPathAtFracture();
|
||||||
|
void setPerforationLength();
|
||||||
QString getUnitForStimPlanParameter(QString parameterName);
|
QString getUnitForStimPlanParameter(QString parameterName);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -42,9 +42,9 @@ RigStimPlanResultFrames::RigStimPlanResultFrames()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RigStimPlanFractureDefinition::RigStimPlanFractureDefinition() : m_unitSet(RiaEclipseUnitTools::UNITS_UNKNOWN)
|
RigStimPlanFractureDefinition::RigStimPlanFractureDefinition() :
|
||||||
|
m_unitSet(RiaEclipseUnitTools::UNITS_UNKNOWN), m_topPerfTvd(HUGE_VAL), m_bottomPerfTvd(HUGE_VAL)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -55,6 +55,64 @@ RigStimPlanFractureDefinition::~RigStimPlanFractureDefinition()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RigStimPlanFractureDefinition::setTvdToTopPerf(double topPerfTvd, RiaDefines::DepthUnitType unit)
|
||||||
|
{
|
||||||
|
if (unit == RiaDefines::UNIT_METER)
|
||||||
|
{
|
||||||
|
if (m_unitSet == RiaEclipseUnitTools::UNITS_FIELD)
|
||||||
|
{
|
||||||
|
m_topPerfTvd = RiaEclipseUnitTools::meterToFeet(topPerfTvd);
|
||||||
|
}
|
||||||
|
else if (m_unitSet == RiaEclipseUnitTools::UNITS_METRIC)
|
||||||
|
{
|
||||||
|
m_topPerfTvd = topPerfTvd;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (unit == RiaDefines::UNIT_FEET)
|
||||||
|
{
|
||||||
|
if (m_unitSet == RiaEclipseUnitTools::UNITS_FIELD)
|
||||||
|
{
|
||||||
|
m_topPerfTvd = topPerfTvd;
|
||||||
|
}
|
||||||
|
else if (m_unitSet == RiaEclipseUnitTools::UNITS_METRIC)
|
||||||
|
{
|
||||||
|
m_topPerfTvd = RiaEclipseUnitTools::feetToMeter(topPerfTvd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RigStimPlanFractureDefinition::setTvdToBottomPerf(double bottomPerfTvd, RiaDefines::DepthUnitType unit)
|
||||||
|
{
|
||||||
|
if (unit == RiaDefines::UNIT_METER)
|
||||||
|
{
|
||||||
|
if (m_unitSet == RiaEclipseUnitTools::UNITS_FIELD)
|
||||||
|
{
|
||||||
|
m_bottomPerfTvd = RiaEclipseUnitTools::meterToFeet(bottomPerfTvd);
|
||||||
|
}
|
||||||
|
else if (m_unitSet == RiaEclipseUnitTools::UNITS_METRIC)
|
||||||
|
{
|
||||||
|
m_bottomPerfTvd = bottomPerfTvd;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (unit == RiaDefines::UNIT_FEET)
|
||||||
|
{
|
||||||
|
if (m_unitSet == RiaEclipseUnitTools::UNITS_FIELD)
|
||||||
|
{
|
||||||
|
m_bottomPerfTvd = bottomPerfTvd;
|
||||||
|
}
|
||||||
|
else if (m_unitSet == RiaEclipseUnitTools::UNITS_METRIC)
|
||||||
|
{
|
||||||
|
m_bottomPerfTvd = RiaEclipseUnitTools::feetToMeter(bottomPerfTvd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -65,6 +65,11 @@ public:
|
|||||||
double maxDepth() const { return depths.back(); }
|
double maxDepth() const { return depths.back(); }
|
||||||
size_t depthCount() const { return depths.size(); }
|
size_t depthCount() const { return depths.size(); }
|
||||||
|
|
||||||
|
double topPerfTvd() const { return m_topPerfTvd; }
|
||||||
|
double bottomPerfTvd() const { return m_bottomPerfTvd; }
|
||||||
|
void setTvdToTopPerf(double topPerfTvd, RiaDefines::DepthUnitType unit);
|
||||||
|
void setTvdToBottomPerf(double bottomPerfTvd, RiaDefines::DepthUnitType unit);
|
||||||
|
|
||||||
// Grid Geometry
|
// Grid Geometry
|
||||||
|
|
||||||
std::vector<double> getNegAndPosXcoords() const;
|
std::vector<double> getNegAndPosXcoords() const;
|
||||||
@ -128,6 +133,9 @@ private:
|
|||||||
std::vector<double> m_gridYs;
|
std::vector<double> m_gridYs;
|
||||||
std::vector<double> depths;
|
std::vector<double> depths;
|
||||||
|
|
||||||
|
double m_topPerfTvd;
|
||||||
|
double m_bottomPerfTvd;
|
||||||
|
|
||||||
std::vector<double> m_timeSteps;
|
std::vector<double> m_timeSteps;
|
||||||
std::vector<RigStimPlanResultFrames> m_stimPlanResults;
|
std::vector<RigStimPlanResultFrames> m_stimPlanResults;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user