Merge branch 'dev' into dev-deeper

This commit is contained in:
Bjørn Erik Jensen 2018-11-22 14:21:00 +01:00
commit 15a6bc358b
38 changed files with 449 additions and 277 deletions

View File

@ -27,27 +27,37 @@ QString RiaDefines::conductivityResultName()
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
QString RiaDefines::unitStringConductivity(RiaEclipseUnitTools::UnitSystem unitSystem) QString RiaDefines::unitStringConductivity(RiaEclipseUnitTools::UnitSystem unitSystem)
{ {
switch (unitSystem) switch (unitSystem)
{ {
case RiaEclipseUnitTools::UNITS_METRIC: return "md-m"; case RiaEclipseUnitTools::UNITS_METRIC:
case RiaEclipseUnitTools::UNITS_FIELD: return "md-ft"; return "md-m";
default: return ""; case RiaEclipseUnitTools::UNITS_FIELD:
return "md-ft";
default:
return "";
} }
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
double RiaDefines::nonDarcyFlowAlpha(RiaEclipseUnitTools::UnitSystem unitSystem) double RiaDefines::nonDarcyFlowAlpha(RiaEclipseUnitTools::UnitSystem unitSystem)
{ {
switch (unitSystem) switch (unitSystem)
{ {
case RiaEclipseUnitTools::UNITS_METRIC: return 2.24460e-10; case RiaEclipseUnitTools::UNITS_METRIC:
case RiaEclipseUnitTools::UNITS_FIELD: return 6.83352e-8; return 2.24460e-10;
default: return 0.0; case RiaEclipseUnitTools::UNITS_FIELD:
return 6.83352e-8;
case RiaEclipseUnitTools::UNITS_LAB:
return 5.41375E-11;
// case RiaEclipseUnitTools::PVT_METRIC: return 2.25533E-10;
default:
return 0.0;
} }
} }

View File

@ -27,5 +27,5 @@ namespace RiaDefines
QString conductivityResultName(); QString conductivityResultName();
QString unitStringConductivity(RiaEclipseUnitTools::UnitSystem unitSystem); QString unitStringConductivity(RiaEclipseUnitTools::UnitSystem unitSystem);
double nonDarcyFlowAlpha(RiaEclipseUnitTools::UnitSystem unitSystem); double nonDarcyFlowAlpha(RiaEclipseUnitTools::UnitSystem unitSystem);
}; }; // namespace RiaDefines

View File

@ -131,7 +131,7 @@ std::vector<RigCompletionData>
{ {
// No change in transmissibility for main bore // No change in transmissibility for main bore
auto transmissibilityAndPermeability = auto transmissibilityAndPermeability =
RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibilityAndPermeability( RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibilityAndKh(
settings.caseToApply, settings.caseToApply,
wellPath, wellPath,
wellBorePart.lengthsInCell, wellBorePart.lengthsInCell,
@ -146,7 +146,7 @@ std::vector<RigCompletionData>
{ {
// Adjust transmissibility for fishbone laterals // Adjust transmissibility for fishbone laterals
auto transmissibilityAndPermeability = auto transmissibilityAndPermeability =
RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibilityAndPermeability( RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibilityAndKh(
settings.caseToApply, settings.caseToApply,
wellPath, wellPath,
wellBorePart.lengthsInCell, wellBorePart.lengthsInCell,

View File

@ -20,6 +20,7 @@
#include "RiaApplication.h" #include "RiaApplication.h"
#include "RiaFilePathTools.h" #include "RiaFilePathTools.h"
#include "RiaFractureDefines.h"
#include "RiaLogging.h" #include "RiaLogging.h"
#include "RiaPreferences.h" #include "RiaPreferences.h"
@ -1658,46 +1659,39 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeatureImpl::gener
const RimNonDarcyPerforationParameters* nonDarcyParameters = const RimNonDarcyPerforationParameters* nonDarcyParameters =
wellPath->perforationIntervalCollection()->nonDarcyParameters(); wellPath->perforationIntervalCollection()->nonDarcyParameters();
double transmissibility = 0.0; double transmissibility = 0.0;
double effectivePermeability = 0.0; double kh = RigCompletionData::defaultValue();
double dFactor = RigCompletionData::defaultValue();
{ {
auto transmissibilityAndPermeability = auto transmissibilityAndKh = calculateTransmissibilityAndKh(settings.caseToApply,
calculateTransmissibilityAndPermeability(settings.caseToApply, wellPath,
wellPath, cell.intersectionLengthsInCellCS,
cell.intersectionLengthsInCellCS, interval->skinFactor(),
interval->skinFactor(), interval->diameter(unitSystem) / 2,
interval->diameter(unitSystem) / 2, cell.globCellIndex,
cell.globCellIndex, settings.useLateralNTG);
settings.useLateralNTG);
transmissibility = transmissibilityAndPermeability.first; transmissibility = transmissibilityAndKh.first;
if (nonDarcyParameters->nonDarcyFlowType() != RimNonDarcyPerforationParameters::NON_DARCY_NONE) if (nonDarcyParameters->nonDarcyFlowType() == RimNonDarcyPerforationParameters::NON_DARCY_USER_DEFINED)
{ {
effectivePermeability = kh = transmissibilityAndKh.second;
transmissibilityAndPermeability.second * nonDarcyParameters->gridPermeabilityScalingFactor(); dFactor = nonDarcyParameters->userDefinedDFactor();
} }
} else if (nonDarcyParameters->nonDarcyFlowType() == RimNonDarcyPerforationParameters::NON_DARCY_COMPUTED)
{
kh = transmissibilityAndKh.second;
double dFactor = RigCompletionData::defaultValue(); const double effectivePermeability =
double kh = RigCompletionData::defaultValue(); kh * nonDarcyParameters->gridPermeabilityScalingFactor() / cell.intersectionLengthsInCellCS.length();
if (nonDarcyParameters->nonDarcyFlowType() == RimNonDarcyPerforationParameters::NON_DARCY_USER_DEFINED) dFactor = calculateDFactor(settings.caseToApply,
{ cell.intersectionLengthsInCellCS,
dFactor = nonDarcyParameters->userDefinedDFactor(); cell.globCellIndex,
} wellPath->perforationIntervalCollection()->nonDarcyParameters(),
else if (nonDarcyParameters->nonDarcyFlowType() == RimNonDarcyPerforationParameters::NON_DARCY_COMPUTED) effectivePermeability);
{ }
dFactor = calculateDFactor(settings.caseToApply,
cell.intersectionLengthsInCellCS,
cell.globCellIndex,
wellPath->perforationIntervalCollection()->nonDarcyParameters(),
effectivePermeability);
}
if (nonDarcyParameters->nonDarcyFlowType() != RimNonDarcyPerforationParameters::NON_DARCY_NONE)
{
kh = effectivePermeability * cell.intersectionLengthsInCellCS.length();
} }
completion.setTransAndWPImultBackgroundDataFromPerforation( completion.setTransAndWPImultBackgroundDataFromPerforation(
@ -2307,15 +2301,15 @@ CellDirection RicWellPathExportCompletionDataFeatureImpl::calculateCellMainDirec
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::pair<double, double> std::pair<double, double>
RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibilityAndPermeability(RimEclipseCase* eclipseCase, RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibilityAndKh(RimEclipseCase* eclipseCase,
const RimWellPath* wellPath, const RimWellPath* wellPath,
const cvf::Vec3d& internalCellLengths, const cvf::Vec3d& internalCellLengths,
double skinFactor, double skinFactor,
double wellRadius, double wellRadius,
size_t globalCellIndex, size_t globalCellIndex,
bool useLateralNTG, bool useLateralNTG,
size_t volumeScaleConstant, size_t volumeScaleConstant,
CellDirection directionForVolumeScaling) CellDirection directionForVolumeScaling)
{ {
RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData(); RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
@ -2367,7 +2361,7 @@ std::pair<double, double>
double permy = permyAccessObject->cellScalarGlobIdx(globalCellIndex); double permy = permyAccessObject->cellScalarGlobIdx(globalCellIndex);
double permz = permzAccessObject->cellScalarGlobIdx(globalCellIndex); double permz = permzAccessObject->cellScalarGlobIdx(globalCellIndex);
const double totalPermeabilityForCell = RigTransmissibilityEquations::totalPermeability(permx, permy, permz); const double totalKh = RigTransmissibilityEquations::totalPermeability(permx, permy, permz, internalCellLengths, latNtg, ntg);
double darcy = RiaEclipseUnitTools::darcysConstant(wellPath->unitSystem()); double darcy = RiaEclipseUnitTools::darcysConstant(wellPath->unitSystem());
@ -2387,7 +2381,7 @@ std::pair<double, double>
const double totalConnectionFactor = RigTransmissibilityEquations::totalConnectionFactor(transx, transy, transz); const double totalConnectionFactor = RigTransmissibilityEquations::totalConnectionFactor(transx, transy, transz);
return std::make_pair(totalConnectionFactor, totalPermeabilityForCell); return std::make_pair(totalConnectionFactor, totalKh);
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -2401,10 +2395,15 @@ double RicWellPathExportCompletionDataFeatureImpl::calculateDFactor(RimEclipseCa
{ {
using EQ = RigPerforationTransmissibilityEquations; using EQ = RigPerforationTransmissibilityEquations;
if (!eclipseCase || !eclipseCase->eclipseCaseData())
{
return std::numeric_limits<double>::infinity();
}
RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
double porosity = 0.0; double porosity = 0.0;
{ {
RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PORO"); eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PORO");
cvf::ref<RigResultAccessor> poroAccessObject = cvf::ref<RigResultAccessor> poroAccessObject =
RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PORO"); RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PORO");
@ -2421,7 +2420,9 @@ double RicWellPathExportCompletionDataFeatureImpl::calculateDFactor(RimEclipseCa
porosity, porosity,
nonDarcyParameters->porosityScalingFactor()); nonDarcyParameters->porosityScalingFactor());
return EQ::dFactor(nonDarcyParameters->unitConstant(), const double alpha = RiaDefines::nonDarcyFlowAlpha(eclipseCaseData->unitsType());
return EQ::dFactor(alpha,
betaFactor, betaFactor,
effectivePermeability, effectivePermeability,
internalCellLengths.length(), internalCellLengths.length(),

View File

@ -83,7 +83,7 @@ public:
const cvf::Vec3d& lengthsInCell); const cvf::Vec3d& lengthsInCell);
static std::pair<double, double> static std::pair<double, double>
calculateTransmissibilityAndPermeability(RimEclipseCase* eclipseCase, calculateTransmissibilityAndKh(RimEclipseCase* eclipseCase,
const RimWellPath* wellPath, const RimWellPath* wellPath,
const cvf::Vec3d& internalCellLengths, const cvf::Vec3d& internalCellLengths,
double skinFactor, double skinFactor,

View File

@ -23,9 +23,10 @@
#include "RicLinkVisibleViewsFeature.h" #include "RicLinkVisibleViewsFeature.h"
#include "RimProject.h"
#include "Rim3dView.h" #include "Rim3dView.h"
#include "RimContourMapView.h"
#include "RimGridView.h" #include "RimGridView.h"
#include "RimProject.h"
#include "RimViewLinkerCollection.h" #include "RimViewLinkerCollection.h"
#include "RimViewLinker.h" #include "RimViewLinker.h"
@ -42,9 +43,14 @@ bool RicLinkViewFeature::isCommandEnabled()
{ {
std::vector<caf::PdmUiItem*> allSelectedItems; std::vector<caf::PdmUiItem*> allSelectedItems;
std::vector<RimGridView*> selectedGridViews; std::vector<RimGridView*> selectedGridViews;
std::vector<RimContourMapView*> selectedContourMaps;
caf::SelectionManager::instance()->selectedItems(allSelectedItems); caf::SelectionManager::instance()->selectedItems(allSelectedItems);
caf::SelectionManager::instance()->objectsByType(&selectedGridViews); caf::SelectionManager::instance()->objectsByType(&selectedGridViews);
if (selectedGridViews.size() > 1u && allSelectedItems.size() == selectedGridViews.size()) caf::SelectionManager::instance()->objectsByType(&selectedContourMaps);
size_t selectedRegularGridViews = selectedGridViews.size() - selectedContourMaps.size();
if (selectedGridViews.size() > 1u && selectedRegularGridViews >= 1u && allSelectedItems.size() == selectedGridViews.size())
{ {
return true; return true;
} }
@ -80,8 +86,10 @@ void RicLinkViewFeature::onActionTriggered(bool isChecked)
{ {
std::vector<caf::PdmUiItem*> allSelectedItems; std::vector<caf::PdmUiItem*> allSelectedItems;
std::vector<RimGridView*> selectedGridViews; std::vector<RimGridView*> selectedGridViews;
caf::SelectionManager::instance()->selectedItems(allSelectedItems); caf::SelectionManager::instance()->selectedItems(allSelectedItems);
caf::SelectionManager::instance()->objectsByType(&selectedGridViews); caf::SelectionManager::instance()->objectsByType(&selectedGridViews);
if (selectedGridViews.size() > 1u && allSelectedItems.size() == selectedGridViews.size()) if (selectedGridViews.size() > 1u && allSelectedItems.size() == selectedGridViews.size())
{ {
RicLinkVisibleViewsFeature::linkViews(selectedGridViews); RicLinkVisibleViewsFeature::linkViews(selectedGridViews);

View File

@ -23,9 +23,10 @@
#include "RicLinkVisibleViewsFeatureUi.h" #include "RicLinkVisibleViewsFeatureUi.h"
#include "RimViewController.h" #include "RimContourMapView.h"
#include "RimProject.h"
#include "RimGridView.h" #include "RimGridView.h"
#include "RimProject.h"
#include "RimViewController.h"
#include "RimViewLinker.h" #include "RimViewLinker.h"
#include "RimViewLinkerCollection.h" #include "RimViewLinkerCollection.h"
@ -147,6 +148,15 @@ void RicLinkVisibleViewsFeature::linkViews(std::vector<RimGridView*>& views)
RimProject* proj = RiaApplication::instance()->project(); RimProject* proj = RiaApplication::instance()->project();
RimViewLinker* viewLinker = proj->viewLinkerCollection->viewLinker(); RimViewLinker* viewLinker = proj->viewLinkerCollection->viewLinker();
std::vector<RimGridView*> masterCandidates;
for (RimGridView* view : views)
{
if (dynamic_cast<RimContourMapView*>(view) == nullptr)
{
masterCandidates.push_back(view);
}
}
if (!viewLinker) if (!viewLinker)
{ {
// Create a new view linker // Create a new view linker
@ -155,15 +165,20 @@ void RicLinkVisibleViewsFeature::linkViews(std::vector<RimGridView*>& views)
{ {
return; return;
} }
CVF_ASSERT(!masterCandidates.empty());
RicLinkVisibleViewsFeatureUi featureUi; RimGridView* masterView = masterCandidates.front();
featureUi.setViews(views); if (masterCandidates.size() > 1u)
{
RicLinkVisibleViewsFeatureUi featureUi;
featureUi.setViews(masterCandidates);
caf::PdmUiPropertyViewDialog propertyDialog(nullptr, &featureUi, "Select Master View", ""); caf::PdmUiPropertyViewDialog propertyDialog(nullptr, &featureUi, "Select Master View", "");
propertyDialog.setWindowIcon(QIcon(":/chain.png")); propertyDialog.setWindowIcon(QIcon(":/chain.png"));
if (propertyDialog.exec() != QDialog::Accepted) return; if (propertyDialog.exec() != QDialog::Accepted) return;
RimGridView* masterView = featureUi.masterView(); masterView = featureUi.masterView();
}
viewLinker = new RimViewLinker; viewLinker = new RimViewLinker;
proj->viewLinkerCollection()->viewLinker = viewLinker; proj->viewLinkerCollection()->viewLinker = viewLinker;
viewLinker->setMasterView(masterView); viewLinker->setMasterView(masterView);

View File

@ -21,8 +21,9 @@
#include "RiaApplication.h" #include "RiaApplication.h"
#include "RimProject.h" #include "RimContourMapView.h"
#include "RimGridView.h" #include "RimGridView.h"
#include "RimProject.h"
#include "RimViewController.h" #include "RimViewController.h"
#include "RimViewLinker.h" #include "RimViewLinker.h"
#include "RimViewLinkerCollection.h" #include "RimViewLinkerCollection.h"
@ -54,6 +55,11 @@ bool RicSetMasterViewFeature::isCommandEnabled()
return false; return false;
} }
if (dynamic_cast<RimContourMapView*>(activeView) != nullptr)
{
return false;
}
return true; return true;
} }

View File

@ -177,60 +177,62 @@ void RivWellPathPartMgr::appendWellPathAttributesToModel(cvf::ModelBasicList*
for (RimWellPathAttribute* attribute : attributes) for (RimWellPathAttribute* attribute : attributes)
{ {
if (attribute->componentType() == RiaDefines::CASING) if (attribute->isEnabled())
{ {
double wellPathRadius = this->wellPathRadius(characteristicCellSize, this->wellPathCollection()); if (attribute->componentType() == RiaDefines::CASING)
double endMD = attribute->endMD();
double shoeLength = wellPathRadius;
double shoeStartMD = endMD - shoeLength;
std::vector<cvf::Vec3d> displayCoords;
displayCoords.push_back(displayCoordTransform->transformToDisplayCoord(m_rimWellPath->wellPathGeometry()->interpolatedPointAlongWellPath(shoeStartMD)));
displayCoords.push_back(displayCoordTransform->transformToDisplayCoord(m_rimWellPath->wellPathGeometry()->interpolatedPointAlongWellPath(endMD)));
displayCoords.push_back(displayCoordTransform->transformToDisplayCoord(m_rimWellPath->wellPathGeometry()->interpolatedPointAlongWellPath(endMD)));
std::vector<double> radii;
radii.push_back(wellPathRadius);
radii.push_back(wellPathRadius * 2.5);
radii.push_back(wellPathRadius * 1.1);
cvf::ref<RivObjectSourceInfo> objectSourceInfo = new RivObjectSourceInfo(attribute);
cvf::Collection<cvf::Part> parts;
geoGenerator.tubeWithCenterLinePartsAndVariableWidth(&parts, displayCoords, radii, attribute->defaultComponentColor());
for (auto part : parts)
{ {
part->setSourceInfo(objectSourceInfo.p()); double wellPathRadius = this->wellPathRadius(characteristicCellSize, this->wellPathCollection());
model->addPart(part.p()); double endMD = attribute->endMD();
double shoeLength = wellPathRadius;
double shoeStartMD = endMD - shoeLength;
std::vector<cvf::Vec3d> displayCoords;
displayCoords.push_back(displayCoordTransform->transformToDisplayCoord(m_rimWellPath->wellPathGeometry()->interpolatedPointAlongWellPath(shoeStartMD)));
displayCoords.push_back(displayCoordTransform->transformToDisplayCoord(m_rimWellPath->wellPathGeometry()->interpolatedPointAlongWellPath(endMD)));
displayCoords.push_back(displayCoordTransform->transformToDisplayCoord(m_rimWellPath->wellPathGeometry()->interpolatedPointAlongWellPath(endMD)));
std::vector<double> radii;
radii.push_back(wellPathRadius);
radii.push_back(wellPathRadius * 2.5);
radii.push_back(wellPathRadius * 1.1);
cvf::ref<RivObjectSourceInfo> objectSourceInfo = new RivObjectSourceInfo(attribute);
cvf::Collection<cvf::Part> parts;
geoGenerator.tubeWithCenterLinePartsAndVariableWidth(&parts, displayCoords, radii, attribute->defaultComponentColor());
for (auto part : parts)
{
part->setSourceInfo(objectSourceInfo.p());
model->addPart(part.p());
}
} }
} else if (attribute->componentType() == RiaDefines::PACKER)
else if (attribute->componentType() == RiaDefines::PACKER)
{
double wellPathRadius = this->wellPathRadius(characteristicCellSize, this->wellPathCollection());
double startMD = attribute->startMD();
double packerLength = wellPathRadius;
double endMD = attribute->startMD() + packerLength;
std::vector<cvf::Vec3d> displayCoords;
displayCoords.push_back(displayCoordTransform->transformToDisplayCoord(m_rimWellPath->wellPathGeometry()->interpolatedPointAlongWellPath(startMD)));
displayCoords.push_back(displayCoordTransform->transformToDisplayCoord(m_rimWellPath->wellPathGeometry()->interpolatedPointAlongWellPath(startMD)));
displayCoords.push_back(displayCoordTransform->transformToDisplayCoord(m_rimWellPath->wellPathGeometry()->interpolatedPointAlongWellPath(endMD)));
displayCoords.push_back(displayCoordTransform->transformToDisplayCoord(m_rimWellPath->wellPathGeometry()->interpolatedPointAlongWellPath(endMD)));
std::vector<double> radii;
radii.push_back(wellPathRadius);
radii.push_back(wellPathRadius * 2.5);
radii.push_back(wellPathRadius * 2.5);
radii.push_back(wellPathRadius);
cvf::ref<RivObjectSourceInfo> objectSourceInfo = new RivObjectSourceInfo(attribute);
cvf::Collection<cvf::Part> parts;
geoGenerator.tubeWithCenterLinePartsAndVariableWidth(&parts, displayCoords, radii, attribute->defaultComponentColor());
for (auto part : parts)
{ {
part->setSourceInfo(objectSourceInfo.p()); double wellPathRadius = this->wellPathRadius(characteristicCellSize, this->wellPathCollection());
model->addPart(part.p()); double startMD = attribute->startMD();
double endMD = attribute->endMD();
std::vector<cvf::Vec3d> displayCoords;
displayCoords.push_back(displayCoordTransform->transformToDisplayCoord(m_rimWellPath->wellPathGeometry()->interpolatedPointAlongWellPath(startMD)));
displayCoords.push_back(displayCoordTransform->transformToDisplayCoord(m_rimWellPath->wellPathGeometry()->interpolatedPointAlongWellPath(startMD)));
displayCoords.push_back(displayCoordTransform->transformToDisplayCoord(m_rimWellPath->wellPathGeometry()->interpolatedPointAlongWellPath(endMD)));
displayCoords.push_back(displayCoordTransform->transformToDisplayCoord(m_rimWellPath->wellPathGeometry()->interpolatedPointAlongWellPath(endMD)));
std::vector<double> radii;
radii.push_back(wellPathRadius);
radii.push_back(wellPathRadius * 1.5);
radii.push_back(wellPathRadius * 1.5);
radii.push_back(wellPathRadius);
cvf::ref<RivObjectSourceInfo> objectSourceInfo = new RivObjectSourceInfo(attribute);
cvf::Collection<cvf::Part> parts;
geoGenerator.tubeWithCenterLinePartsAndVariableWidth(&parts, displayCoords, radii, attribute->defaultComponentColor());
for (auto part : parts)
{
part->setSourceInfo(objectSourceInfo.p());
model->addPart(part.p());
}
} }
} }
} }

View File

@ -632,6 +632,17 @@ cvf::BoundingBox RimFishbonesMultipleSubs::boundingBoxInDomainCoords() const
return bb; return bb;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimFishbonesMultipleSubs::isEnabled() const
{
RimFishbonesCollection* collection;
this->firstAncestorOrThisOfTypeAsserted(collection);
return collection->isChecked() && isActive();
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -110,6 +110,7 @@ public:
cvf::BoundingBox boundingBoxInDomainCoords() const override; cvf::BoundingBox boundingBoxInDomainCoords() const override;
// Overrides from RimWellPathCompletionsInterface // Overrides from RimWellPathCompletionsInterface
bool isEnabled() const override;
RiaDefines::WellPathComponentType componentType() const override; RiaDefines::WellPathComponentType componentType() const override;
QString componentLabel() const override; QString componentLabel() const override;
QString componentTypeLabel() const override; QString componentTypeLabel() const override;

View File

@ -39,6 +39,7 @@
#include "RimReservoirCellResultsStorage.h" #include "RimReservoirCellResultsStorage.h"
#include "RimStimPlanColors.h" #include "RimStimPlanColors.h"
#include "RimStimPlanFractureTemplate.h" #include "RimStimPlanFractureTemplate.h"
#include "RimWellPathFractureCollection.h"
#include "RivWellFracturePartMgr.h" #include "RivWellFracturePartMgr.h"
@ -286,6 +287,16 @@ void RimFracture::clearCachedNonDarcyProperties()
m_cachedFractureProperties = NonDarcyData(); m_cachedFractureProperties = NonDarcyData();
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimFracture::isEnabled() const
{
RimWellPathFractureCollection* fractureCollection = nullptr;
this->firstAncestorOrThisOfTypeAsserted(fractureCollection);
return fractureCollection->isChecked() && isChecked();
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -129,6 +129,7 @@ public:
friend class RimFractureTemplate; friend class RimFractureTemplate;
// RimWellPathCompletionsInterface overrides. // RimWellPathCompletionsInterface overrides.
bool isEnabled() const override;
RiaDefines::WellPathComponentType componentType() const override; RiaDefines::WellPathComponentType componentType() const override;
QString componentLabel() const override; QString componentLabel() const override;
QString componentTypeLabel() const override; QString componentTypeLabel() const override;

View File

@ -49,14 +49,6 @@ RimNonDarcyPerforationParameters::RimNonDarcyPerforationParameters()
CAF_PDM_InitField(&m_userDefinedDFactor, "UserDefinedDFactor", 1.0, "D Factor", "", "", ""); CAF_PDM_InitField(&m_userDefinedDFactor, "UserDefinedDFactor", 1.0, "D Factor", "", "", "");
CAF_PDM_InitField(&m_unitConstant,
"UnitConstant",
1.0,
"<html> Unit Constant (&alpha;)</html>",
"",
"<html>Unit:[cP*Day*m<sup>2</sup>/(Forch*mD*Sm<sup>3</sup>)]</html>",
"");
CAF_PDM_InitField(&m_gridPermeabilityScalingFactor, CAF_PDM_InitField(&m_gridPermeabilityScalingFactor,
"GridPermeabilityScalingFactor", "GridPermeabilityScalingFactor",
1.0, 1.0,
@ -65,7 +57,7 @@ RimNonDarcyPerforationParameters::RimNonDarcyPerforationParameters()
"", "",
""); "");
CAF_PDM_InitField(&m_wellRadius, "WellRadius", 0.15, "<html>Well Radius (r<sub>w</sub>)</html> [m]", "", "", ""); CAF_PDM_InitField(&m_wellRadius, "WellRadius", 0.108, "<html>Well Radius (r<sub>w</sub>)</html> [m]", "", "", "");
CAF_PDM_InitField(&m_relativeGasDensity, CAF_PDM_InitField(&m_relativeGasDensity,
"RelativeGasDensity", "RelativeGasDensity",
@ -117,14 +109,6 @@ double RimNonDarcyPerforationParameters::userDefinedDFactor() const
return m_userDefinedDFactor; return m_userDefinedDFactor;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimNonDarcyPerforationParameters::unitConstant() const
{
return m_unitConstant;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -210,7 +194,6 @@ void RimNonDarcyPerforationParameters::defineUiOrdering(QString uiConfigName, ca
{ {
{ {
auto group = nonDarcyFlowGroup->addNewGroup("Parameters"); auto group = nonDarcyFlowGroup->addNewGroup("Parameters");
group->add(&m_unitConstant);
group->add(&m_gridPermeabilityScalingFactor); group->add(&m_gridPermeabilityScalingFactor);
group->add(&m_wellRadius); group->add(&m_wellRadius);
group->add(&m_relativeGasDensity); group->add(&m_relativeGasDensity);

View File

@ -40,7 +40,6 @@ public:
NonDarcyFlowEnum nonDarcyFlowType() const; NonDarcyFlowEnum nonDarcyFlowType() const;
double userDefinedDFactor() const; double userDefinedDFactor() const;
double unitConstant() const;
double gridPermeabilityScalingFactor() const; double gridPermeabilityScalingFactor() const;
double wellRadius() const; double wellRadius() const;
double relativeGasDensity() const; double relativeGasDensity() const;
@ -57,7 +56,6 @@ private:
caf::PdmField<caf::AppEnum<NonDarcyFlowEnum>> m_nonDarcyFlowType; caf::PdmField<caf::AppEnum<NonDarcyFlowEnum>> m_nonDarcyFlowType;
caf::PdmField<double> m_userDefinedDFactor; caf::PdmField<double> m_userDefinedDFactor;
caf::PdmField<double> m_unitConstant;
caf::PdmField<double> m_gridPermeabilityScalingFactor; caf::PdmField<double> m_gridPermeabilityScalingFactor;
caf::PdmField<double> m_wellRadius; caf::PdmField<double> m_wellRadius;
caf::PdmField<double> m_relativeGasDensity; caf::PdmField<double> m_relativeGasDensity;

View File

@ -23,6 +23,7 @@
#include "RigCaseCellResultsData.h" #include "RigCaseCellResultsData.h"
#include "RigWellPath.h" #include "RigWellPath.h"
#include "RimPerforationCollection.h"
#include "RimProject.h" #include "RimProject.h"
#include "RimWellPath.h" #include "RimWellPath.h"
#include "RimWellPathValve.h" #include "RimWellPathValve.h"
@ -232,6 +233,16 @@ std::vector<RimWellPathValve*> RimPerforationInterval::valves() const
return allValves; return allValves;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimPerforationInterval::isEnabled() const
{
RimPerforationCollection* perforationCollection;
this->firstAncestorOrThisOfTypeAsserted(perforationCollection);
return perforationCollection->isChecked() && isChecked();
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -70,6 +70,7 @@ public:
std::vector<RimWellPathValve*> valves() const; std::vector<RimWellPathValve*> valves() const;
// RimWellPathCompletionInterface overrides // RimWellPathCompletionInterface overrides
bool isEnabled() const override;
RiaDefines::WellPathComponentType componentType() const override; RiaDefines::WellPathComponentType componentType() const override;
QString componentLabel() const override; QString componentLabel() const override;
QString componentTypeLabel() const override; QString componentTypeLabel() const override;

View File

@ -31,6 +31,7 @@
class RimWellPathComponentInterface class RimWellPathComponentInterface
{ {
public: public:
virtual bool isEnabled() const = 0;
virtual RiaDefines::WellPathComponentType componentType() const = 0; virtual RiaDefines::WellPathComponentType componentType() const = 0;
virtual QString componentLabel() const = 0; virtual QString componentLabel() const = 0;
virtual QString componentTypeLabel() const = 0; virtual QString componentTypeLabel() const = 0;

View File

@ -103,6 +103,16 @@ std::vector<double> RimWellPathValve::valveLocations() const
return valveDepths; return valveDepths;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellPathValve::isEnabled() const
{
RimPerforationInterval* perforationInterval = nullptr;
this->firstAncestorOrThisOfType(perforationInterval);
return perforationInterval->isEnabled() && isChecked();
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -46,6 +46,7 @@ public:
std::vector<double> valveLocations() const; std::vector<double> valveLocations() const;
// Overrides from RimWellPathCompletionInterface // Overrides from RimWellPathCompletionInterface
bool isEnabled() const override;
RiaDefines::WellPathComponentType componentType() const override; RiaDefines::WellPathComponentType componentType() const override;
QString componentLabel() const override; QString componentLabel() const override;
QString componentTypeLabel() const override; QString componentTypeLabel() const override;

View File

@ -138,7 +138,7 @@ QString Rim3dWellLogExtractionCurve::resultPropertyString() const
QString name; QString name;
if (eclipseCase) if (eclipseCase)
{ {
name = caf::Utils::makeValidFileBasename(m_eclipseResultDefinition->resultVariableUiName()); name = caf::Utils::makeValidFileBasename(m_eclipseResultDefinition->resultVariableUiShortName());
} }
else if (geoMechCase) else if (geoMechCase)
{ {

View File

@ -658,8 +658,8 @@ void RimContourMapProjection::defineUiOrdering(QString uiConfigName, caf::PdmUiO
{ {
caf::PdmUiGroup* mainGroup = uiOrdering.addNewGroup("Projection Settings"); caf::PdmUiGroup* mainGroup = uiOrdering.addNewGroup("Projection Settings");
mainGroup->add(&m_relativeSampleSpacing); mainGroup->add(&m_relativeSampleSpacing);
mainGroup->add(&m_resultAggregation);
mainGroup->add(&m_showContourLines); mainGroup->add(&m_showContourLines);
mainGroup->add(&m_resultAggregation);
caf::PdmUiGroup* weightingGroup = uiOrdering.addNewGroup("Mean Weighting Options"); caf::PdmUiGroup* weightingGroup = uiOrdering.addNewGroup("Mean Weighting Options");
weightingGroup->add(&m_weightByParameter); weightingGroup->add(&m_weightByParameter);

View File

@ -553,11 +553,11 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calculateValueOptions(
{ {
if ( fieldNeedingOptions == &m_resultVariableUiField ) if ( fieldNeedingOptions == &m_resultVariableUiField )
{ {
options.push_back(calcTimeOfFlightOptionItem()); options.push_back(caf::PdmOptionItemInfo(timeOfFlightString(false), RIG_FLD_TOF_RESNAME));
if (m_phaseSelection() == RigFlowDiagResultAddress::PHASE_ALL) if (m_phaseSelection() == RigFlowDiagResultAddress::PHASE_ALL)
{ {
options.push_back(caf::PdmOptionItemInfo("Tracer Cell Fraction (Sum)", RIG_FLD_CELL_FRACTION_RESNAME)); options.push_back(caf::PdmOptionItemInfo("Tracer Cell Fraction (Sum)", RIG_FLD_CELL_FRACTION_RESNAME));
options.push_back(calcMaxFractionTracerOptionItem()); options.push_back(caf::PdmOptionItemInfo(maxFractionTracerString(false), RIG_FLD_MAX_FRACTION_TRACER_RESNAME));
options.push_back(caf::PdmOptionItemInfo("Injector Producer Communication", RIG_FLD_COMMUNICATION_RESNAME)); options.push_back(caf::PdmOptionItemInfo("Injector Producer Communication", RIG_FLD_COMMUNICATION_RESNAME));
} }
} }
@ -742,69 +742,7 @@ QString RimEclipseResultDefinition::resultVariableUiName() const
{ {
if (resultType() == RiaDefines::FLOW_DIAGNOSTICS) if (resultType() == RiaDefines::FLOW_DIAGNOSTICS)
{ {
QString fullName; return flowDiagResUiText(false, 32);
if (m_flowTracerSelectionMode() == FLOW_TR_BY_SELECTION)
{
RigFlowDiagResultAddress flowDiagRes = flowDiagResAddress();
bool allInjectors = injectorSelectionState() == ALL_SELECTED;
bool allProducers = producerSelectionState() == ALL_SELECTED;
if (allInjectors && allProducers)
{
QString allTracersText = caf::AppEnum< FlowTracerSelectionType >::uiText(FLOW_TR_INJ_AND_PROD);
fullName = QString::fromStdString(flowDiagResAddress().uiShortText());
fullName += QString(" (%1)").arg(allTracersText);
}
else if (allInjectors)
{
QStringList fullTracerList;
QStringList listOfSelectedProducers;
QString allInjectorsText = caf::AppEnum< FlowTracerSelectionType >::uiText(FLOW_TR_INJECTORS);
for (const QString& producer : m_selectedProducerTracers())
{
listOfSelectedProducers.push_back(producer);
}
fullTracerList.push_back(allInjectorsText);
if (!listOfSelectedProducers.empty())
{
fullTracerList.push_back(listOfSelectedProducers.join(", "));
}
fullName = QString::fromStdString(flowDiagResAddress().uiShortText());
fullName += QString(" (%1)").arg(fullTracerList.join(", "));
}
else if (allProducers)
{
QStringList fullTracerList;
QStringList listOfSelectedInjectors;
QString allProducersText = caf::AppEnum< FlowTracerSelectionType >::uiText(FLOW_TR_PRODUCERS);
for (const QString& injector : m_selectedInjectorTracers())
{
listOfSelectedInjectors.push_back(injector);
}
fullTracerList.push_back(allProducersText);
if (!listOfSelectedInjectors.empty())
{
fullTracerList.push_back(listOfSelectedInjectors.join(", "));
}
fullName = QString::fromStdString(flowDiagResAddress().uiShortText());
fullName += QString(" (%1)").arg(fullTracerList.join(", "));
}
else
{
fullName = QString::fromStdString(flowDiagResAddress().uiText());
}
}
else
{
fullName = QString::fromStdString(flowDiagResAddress().uiShortText());
fullName += QString(" (%1)").arg(m_flowTracerSelectionMode().uiText());
}
return fullName;
} }
return m_resultVariable(); return m_resultVariable();
@ -817,16 +755,7 @@ QString RimEclipseResultDefinition::resultVariableUiShortName() const
{ {
if (resultType() == RiaDefines::FLOW_DIAGNOSTICS) if (resultType() == RiaDefines::FLOW_DIAGNOSTICS)
{ {
QString candidate = resultVariableUiName(); return flowDiagResUiText(true, 24);
QString postfix = "...)";
int stringSizeLimit = 32;
if (candidate.size() > stringSizeLimit + postfix.size())
{
candidate = candidate.left(stringSizeLimit);
candidate += postfix;
}
return candidate;
} }
return m_resultVariable(); return m_resultVariable();
@ -1279,6 +1208,37 @@ bool RimEclipseResultDefinition::hasDualPorFractureResult()
return false; return false;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimEclipseResultDefinition::flowDiagResUiText(bool shortLabel, int maxTracerStringLength) const
{
QString uiText = QString::fromStdString(flowDiagResAddress().variableName);
if (flowDiagResAddress().variableName == RIG_FLD_TOF_RESNAME)
{
uiText = timeOfFlightString(shortLabel);
}
else if (flowDiagResAddress().variableName == RIG_FLD_MAX_FRACTION_TRACER_RESNAME)
{
uiText = maxFractionTracerString(shortLabel);
}
QString tracersString = selectedTracersString();
if (!tracersString.isEmpty())
{
const QString postfix = "...";
if (tracersString.size() > maxTracerStringLength + postfix.size())
{
tracersString = tracersString.left(maxTracerStringLength);
tracersString += postfix;
}
uiText += QString("\n%1").arg(tracersString);
}
return uiText;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -1407,53 +1367,122 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calcOptionsForSelected
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
caf::PdmOptionItemInfo RimEclipseResultDefinition::calcTimeOfFlightOptionItem() QString RimEclipseResultDefinition::timeOfFlightString(bool shorter) const
{ {
QString tofString;
bool multipleSelected = false;
if (injectorSelectionState() != NONE_SELECTED && producerSelectionState() != NONE_SELECTED) if (injectorSelectionState() != NONE_SELECTED && producerSelectionState() != NONE_SELECTED)
{ {
return caf::PdmOptionItemInfo("Residence Time (Average)", RIG_FLD_TOF_RESNAME); tofString = shorter ? "Res.Time" : "Residence Time";
multipleSelected = true;
} }
else if (injectorSelectionState() == ONE_SELECTED && producerSelectionState() == NONE_SELECTED) else if (injectorSelectionState() != NONE_SELECTED)
{ {
return caf::PdmOptionItemInfo("Forward Time Of Flight", RIG_FLD_TOF_RESNAME); tofString = shorter ? "Fwd.TOF" : "Forward Time Of Flight";
} }
else if (injectorSelectionState() >= MULTIPLE_SELECTED && producerSelectionState() == NONE_SELECTED) else if (producerSelectionState() != NONE_SELECTED)
{ {
return caf::PdmOptionItemInfo("Forward Time Of Flight (Average)", RIG_FLD_TOF_RESNAME); tofString = shorter ? "Rev.TOF" : "Reverse Time Of Flight";
} }
else if (injectorSelectionState() == NONE_SELECTED && producerSelectionState() == ONE_SELECTED) else
{ {
return caf::PdmOptionItemInfo("Reverse Time Of Flight", RIG_FLD_TOF_RESNAME); tofString = shorter ? "TOF" : "Time Of Flight";
} }
else if (injectorSelectionState() == NONE_SELECTED && producerSelectionState() >= MULTIPLE_SELECTED)
multipleSelected = multipleSelected ||
injectorSelectionState() >= MULTIPLE_SELECTED || producerSelectionState() >= MULTIPLE_SELECTED;
if (multipleSelected && !shorter)
{ {
return caf::PdmOptionItemInfo("Reverse Time Of Flight (Average)", RIG_FLD_TOF_RESNAME); tofString += " (Average)";
} }
return caf::PdmOptionItemInfo("Time Of Flight", RIG_FLD_TOF_RESNAME); return tofString;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
caf::PdmOptionItemInfo RimEclipseResultDefinition::calcMaxFractionTracerOptionItem() QString RimEclipseResultDefinition::maxFractionTracerString(bool shorter) const
{ {
if (injectorSelectionState() == ONE_SELECTED && producerSelectionState() == NONE_SELECTED) QString mfString;
if (injectorSelectionState() >= ONE_SELECTED && producerSelectionState() == NONE_SELECTED)
{ {
return caf::PdmOptionItemInfo("Flooding Region", RIG_FLD_MAX_FRACTION_TRACER_RESNAME); mfString = shorter ? "FloodReg" : "Flooding Region";
if (injectorSelectionState() >= MULTIPLE_SELECTED)
mfString += "s";
} }
else if (injectorSelectionState() >= MULTIPLE_SELECTED && producerSelectionState() == NONE_SELECTED) else if (injectorSelectionState() == NONE_SELECTED && producerSelectionState() >= ONE_SELECTED)
{ {
return caf::PdmOptionItemInfo("Flooding Regions", RIG_FLD_MAX_FRACTION_TRACER_RESNAME); mfString = shorter ? "DrainReg" : "Drainage Region";
if (producerSelectionState() >= MULTIPLE_SELECTED)
mfString += "s";
} }
else if (injectorSelectionState() == NONE_SELECTED && producerSelectionState() == ONE_SELECTED) else
{ {
return caf::PdmOptionItemInfo("Drainage Region", RIG_FLD_MAX_FRACTION_TRACER_RESNAME); mfString = shorter ? "Drain&FloodReg" : "Drainage/Flooding Regions";
} }
else if (injectorSelectionState() == NONE_SELECTED && producerSelectionState() >= MULTIPLE_SELECTED) return mfString;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimEclipseResultDefinition::selectedTracersString() const
{
QStringList fullTracersList;
FlowTracerSelectionState injectorState = injectorSelectionState();
FlowTracerSelectionState producerState = producerSelectionState();
if (injectorState == ALL_SELECTED && producerState == ALL_SELECTED)
{ {
return caf::PdmOptionItemInfo("Drainage Regions", RIG_FLD_MAX_FRACTION_TRACER_RESNAME); fullTracersList += caf::AppEnum<FlowTracerSelectionType>::uiText(FLOW_TR_INJ_AND_PROD);
} }
return caf::PdmOptionItemInfo("Drainage/Flooding Regions", RIG_FLD_MAX_FRACTION_TRACER_RESNAME); else
{
if (injectorState == ALL_SELECTED)
{
fullTracersList += caf::AppEnum<FlowTracerSelectionType>::uiText(FLOW_TR_INJECTORS);
}
if (producerState == ALL_SELECTED)
{
fullTracersList += caf::AppEnum<FlowTracerSelectionType>::uiText(FLOW_TR_PRODUCERS);
}
if (injectorSelectionState() == ONE_SELECTED || injectorSelectionState() == MULTIPLE_SELECTED)
{
QStringList listOfSelectedInjectors;
for (const QString& injector : m_selectedInjectorTracers())
{
listOfSelectedInjectors.push_back(injector);
}
if (!listOfSelectedInjectors.empty())
{
fullTracersList += listOfSelectedInjectors.join(", ");
}
}
if (producerSelectionState() == ONE_SELECTED || producerSelectionState() == MULTIPLE_SELECTED)
{
QStringList listOfSelectedProducers;
for (const QString& producer : m_selectedProducerTracers())
{
listOfSelectedProducers.push_back(producer);
}
if (!listOfSelectedProducers.empty())
{
fullTracersList.push_back(listOfSelectedProducers.join(", "));
}
}
}
QString tracersText;
if (!fullTracersList.empty())
{
tracersText = fullTracersList.join(", ");
}
return tracersText;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -163,15 +163,19 @@ private:
bool operator()(const QString& lhs, const QString& rhs) const; bool operator()(const QString& lhs, const QString& rhs) const;
}; };
private: private:
void assignFlowSolutionFromCase(); void assignFlowSolutionFromCase();
bool hasDualPorFractureResult(); bool hasDualPorFractureResult();
QString flowDiagResUiText(bool shortLabel, int maxTracerStringLength = std::numeric_limits<int>::max()) const;
QList<caf::PdmOptionItemInfo> calcOptionsForVariableUiFieldStandard(); QList<caf::PdmOptionItemInfo> calcOptionsForVariableUiFieldStandard();
QList<caf::PdmOptionItemInfo> calcOptionsForSelectedTracerField(bool injector); QList<caf::PdmOptionItemInfo> calcOptionsForSelectedTracerField(bool injector);
caf::PdmOptionItemInfo calcTimeOfFlightOptionItem(); QString timeOfFlightString(bool shorter) const;
caf::PdmOptionItemInfo calcMaxFractionTracerOptionItem(); QString maxFractionTracerString(bool shorter) const;
QString selectedTracersString() const;
void changedTracerSelectionField(bool injector); void changedTracerSelectionField(bool injector);
QStringList getResultNamesForCurrentUiResultType(); QStringList getResultNamesForCurrentUiResultType();

View File

@ -1139,7 +1139,7 @@ void RimEclipseView::updateMinMaxValuesAndAddLegendToView(QString legendLabel,
if (resultColors->hasResult() && resultColors->legendConfig()->showLegend()) if (resultColors->hasResult() && resultColors->legendConfig()->showLegend())
{ {
resultColors->legendConfig()->setTitle(legendLabel + resultColors->resultVariableUiShortName()); resultColors->legendConfig()->setTitle(legendLabel + resultColors->resultVariableUiName());
m_viewer->addColorLegendToBottomLeftCorner(resultColors->legendConfig()->titledOverlayFrame()); m_viewer->addColorLegendToBottomLeftCorner(resultColors->legendConfig()->titledOverlayFrame());
} }

View File

@ -794,7 +794,7 @@ QString RimWellLogExtractionCurve::wellLogChannelName() const
QString name; QString name;
if (eclipseCase) if (eclipseCase)
{ {
name = caf::Utils::makeValidFileBasename( m_eclipseResultDefinition->resultVariableUiName()); name = caf::Utils::makeValidFileBasename( m_eclipseResultDefinition->resultVariableUiShortName());
} }
else if (geoMechCase) else if (geoMechCase)
{ {

View File

@ -1799,7 +1799,6 @@ void RimWellLogTrack::updateWellPathAttributesOnPlot()
m_wellPathAttributePlotObjects.push_back(std::unique_ptr<RiuWellPathComponentPlotItem>(new RiuWellPathComponentPlotItem(wellPathAttributeSource()))); m_wellPathAttributePlotObjects.push_back(std::unique_ptr<RiuWellPathComponentPlotItem>(new RiuWellPathComponentPlotItem(wellPathAttributeSource())));
} }
if (m_showWellPathAttributes) if (m_showWellPathAttributes)
{ {
if (m_wellPathAttributeCollection) if (m_wellPathAttributeCollection)
@ -1813,13 +1812,16 @@ void RimWellLogTrack::updateWellPathAttributesOnPlot()
std::set<QString> attributesAssignedToLegend; std::set<QString> attributesAssignedToLegend;
for (RimWellPathAttribute* attribute : attributes) for (RimWellPathAttribute* attribute : attributes)
{ {
std::unique_ptr<RiuWellPathComponentPlotItem> plotItem(new RiuWellPathComponentPlotItem(wellPathAttributeSource(), attribute)); if (attribute->isEnabled())
QString legendTitle = plotItem->legendTitle(); {
bool contributeToLegend = m_wellPathAttributesInLegend() && std::unique_ptr<RiuWellPathComponentPlotItem> plotItem(new RiuWellPathComponentPlotItem(wellPathAttributeSource(), attribute));
!attributesAssignedToLegend.count(legendTitle); QString legendTitle = plotItem->legendTitle();
plotItem->setContributeToLegend(contributeToLegend); bool contributeToLegend = m_wellPathAttributesInLegend() &&
m_wellPathAttributePlotObjects.push_back(std::move(plotItem)); !attributesAssignedToLegend.count(legendTitle);
attributesAssignedToLegend.insert(legendTitle); plotItem->setContributeToLegend(contributeToLegend);
m_wellPathAttributePlotObjects.push_back(std::move(plotItem));
attributesAssignedToLegend.insert(legendTitle);
}
} }
} }
} }
@ -1831,13 +1833,16 @@ void RimWellLogTrack::updateWellPathAttributesOnPlot()
std::set<QString> completionsAssignedToLegend; std::set<QString> completionsAssignedToLegend;
for (const RimWellPathComponentInterface* completion : allCompletions) for (const RimWellPathComponentInterface* completion : allCompletions)
{ {
std::unique_ptr<RiuWellPathComponentPlotItem> plotItem(new RiuWellPathComponentPlotItem(wellPathAttributeSource(), completion)); if (completion->isEnabled())
QString legendTitle = plotItem->legendTitle(); {
bool contributeToLegend = m_wellPathCompletionsInLegend() && std::unique_ptr<RiuWellPathComponentPlotItem> plotItem(new RiuWellPathComponentPlotItem(wellPathAttributeSource(), completion));
!completionsAssignedToLegend.count(legendTitle); QString legendTitle = plotItem->legendTitle();
plotItem->setContributeToLegend(contributeToLegend); bool contributeToLegend = m_wellPathCompletionsInLegend() &&
m_wellPathAttributePlotObjects.push_back(std::move(plotItem)); !completionsAssignedToLegend.count(legendTitle);
completionsAssignedToLegend.insert(legendTitle); plotItem->setContributeToLegend(contributeToLegend);
m_wellPathAttributePlotObjects.push_back(std::move(plotItem));
completionsAssignedToLegend.insert(legendTitle);
}
} }
} }

View File

@ -188,6 +188,14 @@ double RimWellPath::wellPathRadiusScaleFactor() const
return m_wellPathRadiusScaleFactor(); return m_wellPathRadiusScaleFactor();
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellPath::isEnabled() const
{
return m_showWellPath;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -124,6 +124,7 @@ public:
// RimWellPathComponentInterface overrides // RimWellPathComponentInterface overrides
bool isEnabled() const override;
RiaDefines::WellPathComponentType componentType() const override; RiaDefines::WellPathComponentType componentType() const override;
QString componentLabel() const override; QString componentLabel() const override;
QString componentTypeLabel() const override; QString componentTypeLabel() const override;

View File

@ -91,6 +91,16 @@ void RimWellPathAttribute::setDepthsFromWellPath(const RimWellPath* wellPath)
m_endMD = wellPath->wellPathGeometry()->measureDepths().back(); m_endMD = wellPath->wellPathGeometry()->measureDepths().back();
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellPathAttribute::isEnabled() const
{
RimWellPathAttributeCollection* collection = nullptr;
this->firstAncestorOrThisOfTypeAsserted(collection);
return collection->isChecked();
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -217,12 +227,16 @@ void RimWellPathAttribute::fieldChangedByUi(const caf::PdmFieldHandle* changedFi
this->firstAncestorOrThisOfTypeAsserted(wellPath); this->firstAncestorOrThisOfTypeAsserted(wellPath);
m_startMD = wellPath->wellPathGeometry()->measureDepths().front(); m_startMD = wellPath->wellPathGeometry()->measureDepths().front();
} }
else if (m_type() == RiaDefines::PACKER)
{
m_endMD = m_startMD + 2;
}
} }
if (changedField == &m_startMD) if (changedField == &m_startMD)
{ {
if (m_type() == RiaDefines::PACKER) if (m_type() == RiaDefines::PACKER)
{ {
m_endMD = m_startMD + 50; m_endMD = m_startMD + 2;
} }
} }

View File

@ -46,6 +46,7 @@ public:
void setDepthsFromWellPath(const RimWellPath* wellPath); void setDepthsFromWellPath(const RimWellPath* wellPath);
// Overrides from RimWellPathCompletionInterface // Overrides from RimWellPathCompletionInterface
bool isEnabled() const override;
RiaDefines::WellPathComponentType componentType() const override; RiaDefines::WellPathComponentType componentType() const override;
QString componentLabel() const override; QString componentLabel() const override;
QString componentTypeLabel() const override; QString componentTypeLabel() const override;
@ -54,9 +55,9 @@ public:
double endMD() const override; double endMD() const override;
private: private:
bool isDiameterSupported() const; bool isDiameterSupported() const;
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override; QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
static QString generateInchesLabel(double diameter); static QString generateInchesLabel(double diameter);
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override; void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;

View File

@ -17,6 +17,7 @@
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
#include "RimWellPathAttributeCollection.h" #include "RimWellPathAttributeCollection.h"
#include "RimProject.h"
#include "RimWellPathAttribute.h" #include "RimWellPathAttribute.h"
#include "RimWellLogTrack.h" #include "RimWellLogTrack.h"
@ -37,6 +38,7 @@ RimWellPathAttributeCollection::RimWellPathAttributeCollection()
m_attributes.uiCapability()->setUiEditorTypeName(caf::PdmUiTableViewEditor::uiEditorTypeName()); m_attributes.uiCapability()->setUiEditorTypeName(caf::PdmUiTableViewEditor::uiEditorTypeName());
m_attributes.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::TOP); m_attributes.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::TOP);
m_attributes.uiCapability()->setCustomContextMenuEnabled(true); m_attributes.uiCapability()->setCustomContextMenuEnabled(true);
this->setName("Casing Design");
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -157,3 +159,20 @@ void RimWellPathAttributeCollection::defineUiTreeOrdering(caf::PdmUiTreeOrdering
{ {
uiTreeOrdering.skipRemainingChildren(true); uiTreeOrdering.skipRemainingChildren(true);
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathAttributeCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue)
{
if (changedField == this->objectToggleField())
{
RimProject* proj;
this->firstAncestorOrThisOfTypeAsserted(proj);
proj->scheduleCreateDisplayModelAndRedrawAllViews();
this->updateAllReferringTracks();
}
}

View File

@ -17,6 +17,8 @@
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
#pragma once #pragma once
#include "RimCheckableNamedObject.h"
#include "cafAppEnum.h" #include "cafAppEnum.h"
#include "cvfBase.h" #include "cvfBase.h"
#include "cafPdmChildArrayField.h" #include "cafPdmChildArrayField.h"
@ -25,7 +27,7 @@
class RimWellPathAttribute; class RimWellPathAttribute;
class RimWellPathAttributeCollection : public caf::PdmObject class RimWellPathAttributeCollection : public RimCheckableNamedObject
{ {
CAF_PDM_HEADER_INIT; CAF_PDM_HEADER_INIT;
public: public:
@ -37,11 +39,13 @@ public:
void insertAttribute(RimWellPathAttribute* insertBefore, RimWellPathAttribute* attribute); void insertAttribute(RimWellPathAttribute* insertBefore, RimWellPathAttribute* attribute);
void deleteAttribute(RimWellPathAttribute* attributeToDelete); void deleteAttribute(RimWellPathAttribute* attributeToDelete);
void deleteAllAttributes(); void deleteAllAttributes();
protected: protected:
void defineCustomContextMenu(const caf::PdmFieldHandle* fieldNeedingMenu, QMenu* menu, QWidget* fieldEditorWidget) override; void defineCustomContextMenu(const caf::PdmFieldHandle* fieldNeedingMenu, QMenu* menu, QWidget* fieldEditorWidget) override;
void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override; void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override;
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override; void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override; void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
private: private:
caf::PdmChildArrayField<RimWellPathAttribute*> m_attributes; caf::PdmChildArrayField<RimWellPathAttribute*> m_attributes;

View File

@ -31,8 +31,8 @@ RimWellPathTarget::RimWellPathTarget()
CAF_PDM_InitField(&m_isEnabled, "IsEnabled", true, "", "", "", ""); CAF_PDM_InitField(&m_isEnabled, "IsEnabled", true, "", "", "", "");
//m_targetType.uiCapability()->setUiHidden(true); //m_targetType.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&m_targetPoint, "TargetPoint", "Point", "", "", ""); CAF_PDM_InitFieldNoDefault(&m_targetPoint, "TargetPoint", "Point", "", "", "");
CAF_PDM_InitField(&m_dogleg1, "Dogleg1", 3.0, "DL in", "", "", ""); CAF_PDM_InitField(&m_dogleg1, "Dogleg1", 3.0, "DL in", "", "[deg/30m]", "");
CAF_PDM_InitField(&m_dogleg2, "Dogleg2", 3.0, "DL out", "", "", ""); CAF_PDM_InitField(&m_dogleg2, "Dogleg2", 3.0, "DL out", "", "[deg/30m]", "");
CAF_PDM_InitFieldNoDefault(&m_targetType, "TargetType", "Type", "", "", ""); CAF_PDM_InitFieldNoDefault(&m_targetType, "TargetType", "Type", "", "", "");
m_targetType.uiCapability()->setUiHidden(true); m_targetType.uiCapability()->setUiHidden(true);
CAF_PDM_InitField(&m_hasTangentConstraintUiField, "HasTangentConstraint", false, "Dir", "", "", ""); CAF_PDM_InitField(&m_hasTangentConstraintUiField, "HasTangentConstraint", false, "Dir", "", "", "");

View File

@ -113,7 +113,7 @@ float RigGeoMechWellLogExtractor::calculatePorePressureInSegment(int64_t interse
double porePressure = hydroStaticPorePressureBar; double porePressure = hydroStaticPorePressureBar;
// 1: Try pore pressure from the grid // 1: Try pore pressure from the grid
if (porePressure == hydroStaticPorePressureBar && averageSegmentPorePressureBar != std::numeric_limits<float>::infinity()) if (porePressure == hydroStaticPorePressureBar && averageSegmentPorePressureBar > 0.0)
{ {
porePressure = averageSegmentPorePressureBar; porePressure = averageSegmentPorePressureBar;
} }
@ -137,6 +137,8 @@ float RigGeoMechWellLogExtractor::calculatePorePressureInSegment(int64_t interse
porePressure = pascalToBar(poreElementPressuresPascal[elmIdx]); porePressure = pascalToBar(poreElementPressuresPascal[elmIdx]);
} }
// 4: If no pore-pressure was found, the default value of hydrostatic pore pressure is used. // 4: If no pore-pressure was found, the default value of hydrostatic pore pressure is used.
CVF_ASSERT(porePressure >= 0.0);
return porePressure; return porePressure;
} }

View File

@ -18,9 +18,6 @@
#include "RigTransmissibilityEquations.h" #include "RigTransmissibilityEquations.h"
#include "cvfBase.h"
#include "cvfMath.h"
#include <cmath> #include <cmath>
#include <limits> #include <limits>
@ -60,19 +57,26 @@ double RigTransmissibilityEquations::totalConnectionFactor(double transX, double
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
double RigTransmissibilityEquations::totalPermeability(const double permx, const double permy, const double permz) double RigTransmissibilityEquations::totalPermeability(double cellPermX,
double cellPermY,
double cellPermZ,
const cvf::Vec3d& internalCellLengths,
double lateralNtg,
double ntg)
{ {
const double kx = cvf::Math::sqrt(permy * permz); // Compute kh for each local grid cell axis
const double ky = cvf::Math::sqrt(permx * permz); // Use permeability values for the two other axis
const double kz = cvf::Math::sqrt(permy * permx); double khx = sqrt(cellPermY * cellPermZ) * internalCellLengths.x() * lateralNtg;
double khy = sqrt(cellPermX * cellPermZ) * internalCellLengths.y() * lateralNtg;
double khz = sqrt(cellPermX * cellPermY) * internalCellLengths.z() * ntg;
const double totalPerm = cvf::Math::sqrt(kx * kx + ky * ky + kz * kz); const double totalKh = cvf::Math::sqrt(khx * khx + khy * khy + khz * khz);
return totalPerm; return totalKh;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
double RigTransmissibilityEquations::permeability(const double conductivity, const double width) double RigTransmissibilityEquations::permeability(const double conductivity, const double width)
{ {

View File

@ -18,6 +18,10 @@
#pragma once #pragma once
#include "cvfBase.h"
#include "cvfMath.h"
#include "cvfVector3.h"
class RigTransmissibilityEquations class RigTransmissibilityEquations
{ {
public: public:
@ -34,7 +38,12 @@ public:
static double totalConnectionFactor(double transX, double transY, double transZ); static double totalConnectionFactor(double transX, double transY, double transZ);
static double totalPermeability(const double permx, const double permy, const double permz); static double totalPermeability(double cellPermX,
double cellPermY,
double cellPermZ,
const cvf::Vec3d& internalCellLengths,
double lateralNtg,
double ntg);
static double permeability(const double conductivity, const double width); static double permeability(const double conductivity, const double width);

View File

@ -143,6 +143,7 @@ QString Utils::makeValidFileBasename(const QString& fileBasenameCandidate)
cleanBasename.replace("|", "_"); cleanBasename.replace("|", "_");
cleanBasename.replace("?", "_"); cleanBasename.replace("?", "_");
cleanBasename.replace("*", "_"); cleanBasename.replace("*", "_");
cleanBasename.replace("\n", "_");
cleanBasename.replace(QRegExp("_+"), "_"); cleanBasename.replace(QRegExp("_+"), "_");