mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1234 - pre-proto - Adding time-step and property type for fracture polygon calculation
This commit is contained in:
parent
8ce430cb25
commit
fde41f5116
@ -56,6 +56,10 @@ RimStimPlanFractureTemplate::RimStimPlanFractureTemplate(void)
|
||||
|
||||
CAF_PDM_InitField(&wellPathDepthAtFracture, "WellPathDepthAtFracture", 0.0, "Well/Fracture Intersection Depth", "", "", "");
|
||||
wellPathDepthAtFracture.uiCapability()->setUiEditorTypeName(caf::PdmUiDoubleSliderEditor::uiEditorTypeName());
|
||||
|
||||
CAF_PDM_InitField(¶meterForPolygon, "parameterForPolyton", QString(""), "Parameter", "", "", "");
|
||||
CAF_PDM_InitField(×tepForPolygon, "timestepForPolygon", 0, "TimeStep", "", "", "");
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -108,6 +112,11 @@ void RimStimPlanFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* ch
|
||||
proj->createDisplayModelAndRedrawAllViews();
|
||||
}
|
||||
|
||||
if (¶meterForPolygon == changedField || ×tepForPolygon == changedField)
|
||||
{
|
||||
fracturePolygon();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -267,6 +276,37 @@ std::vector<std::vector<double>> RimStimPlanFractureTemplate::getDataAtTimeIndex
|
||||
return m_stimPlanFractureDefinitionData->getDataAtTimeIndex(resultName, unitName, timeStepIndex);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RimStimPlanFractureTemplate::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly)
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
|
||||
if (fieldNeedingOptions == ¶meterForPolygon)
|
||||
{
|
||||
for (std::pair<QString, QString> nameUnit : getStimPlanPropertyNamesUnits())
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo(nameUnit.first + " [" + nameUnit.second +"]", nameUnit.first + " " + nameUnit.second));
|
||||
}
|
||||
}
|
||||
|
||||
else if (fieldNeedingOptions == ×tepForPolygon)
|
||||
{
|
||||
std::vector<double> timeValues = getStimPlanTimeValues();
|
||||
int index = 0;
|
||||
for (double value : timeValues)
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo(QString::number(value), index));
|
||||
index++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return options;
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -581,9 +621,17 @@ void RimStimPlanFractureTemplate::computeMinMax(const QString& resultName, const
|
||||
std::vector<cvf::Vec3f> RimStimPlanFractureTemplate::fracturePolygon()
|
||||
{
|
||||
std::vector<cvf::Vec3f> polygon;
|
||||
QString parameterName;
|
||||
QString parameterUnit;
|
||||
|
||||
//TODO: Handle multiple time-step and properties
|
||||
std::vector<std::vector<double>> dataAtTimeStep = m_stimPlanFractureDefinitionData->getDataAtTimeIndex(getStimPlanPropertyNamesUnits()[0].first, getStimPlanPropertyNamesUnits()[0].second, 0);
|
||||
if (parameterForPolygon().split(" ").size() > 1)
|
||||
{
|
||||
parameterName = parameterForPolygon().split(" ")[0];
|
||||
parameterUnit = parameterForPolygon().split(" ")[1];
|
||||
}
|
||||
else return polygon;
|
||||
|
||||
std::vector<std::vector<double>> dataAtTimeStep = m_stimPlanFractureDefinitionData->getDataAtTimeIndex(parameterName, parameterUnit, timestepForPolygon);
|
||||
|
||||
for (int k = 0; k < dataAtTimeStep.size(); k++)
|
||||
{
|
||||
@ -596,20 +644,19 @@ std::vector<cvf::Vec3f> RimStimPlanFractureTemplate::fracturePolygon()
|
||||
if ((dataAtTimeStep[k])[(i + 1)] < 1e-7)
|
||||
{
|
||||
polygon.push_back(cvf::Vec3f(static_cast<float>(m_stimPlanFractureDefinitionData->gridXs[i]),
|
||||
static_cast<float>(m_stimPlanFractureDefinitionData->depths[k]), 0.0f));
|
||||
static_cast<float>(m_stimPlanFractureDefinitionData->depths[k]) - wellPathDepthAtFracture, 0.0f));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
polygon.push_back(cvf::Vec3f(static_cast<float>(m_stimPlanFractureDefinitionData->gridXs[i]),
|
||||
static_cast<float>(m_stimPlanFractureDefinitionData->depths[k]), 0.0f));
|
||||
static_cast<float>(m_stimPlanFractureDefinitionData->depths[k]) - wellPathDepthAtFracture, 0.0f));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<cvf::Vec3f> negPolygon;
|
||||
|
||||
for (const auto& node : polygon)
|
||||
{
|
||||
cvf::Vec3f negNode = node;
|
||||
@ -645,6 +692,10 @@ void RimStimPlanFractureTemplate::defineUiOrdering(QString uiConfigName, caf::Pd
|
||||
caf::PdmUiGroup* propertyGroup = uiOrdering.addNewGroup("Properties");
|
||||
propertyGroup->add(&fractureConductivity);
|
||||
propertyGroup->add(&skinFactor);
|
||||
|
||||
caf::PdmUiGroup* polygonGroup = uiOrdering.addNewGroup("Fracture Polygon Basis");
|
||||
polygonGroup->add(¶meterForPolygon);
|
||||
polygonGroup->add(×tepForPolygon);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -49,6 +49,9 @@ public:
|
||||
virtual ~RimStimPlanFractureTemplate(void);
|
||||
|
||||
caf::PdmField<double> wellPathDepthAtFracture;
|
||||
|
||||
caf::PdmField<QString> parameterForPolygon;
|
||||
caf::PdmField<int> timestepForPolygon;
|
||||
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
|
||||
@ -69,6 +72,9 @@ public:
|
||||
|
||||
std::vector<std::vector<double>> getDataAtTimeIndex(const QString& resultName, const QString& unitName, size_t timeStepIndex) const;
|
||||
|
||||
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
||||
|
||||
protected:
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
|
||||
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute) override;
|
||||
|
@ -182,16 +182,3 @@ void RigStimPlanFractureDefinition::computeMinMax(const QString& resultName, con
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<QString> RigStimPlanFractureDefinition::resultNames() const
|
||||
{
|
||||
std::vector<QString> names;
|
||||
|
||||
names.push_back("Conductivity");
|
||||
names.push_back("Permeability");
|
||||
names.push_back("Width");
|
||||
|
||||
return names;
|
||||
}
|
||||
|
@ -61,8 +61,6 @@ public:
|
||||
std::vector<std::vector<double>> getDataAtTimeIndex(const QString& resultName, const QString& unit, size_t timeStepIndex) const;
|
||||
void computeMinMax(const QString& resultName, const QString& unit, double* minValue, double* maxValue) const;
|
||||
|
||||
std::vector<QString> resultNames() const;
|
||||
|
||||
private:
|
||||
size_t resultIndex(const QString& resultName, const QString& unit) const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user