mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2492 : Non-Darcy Flow : Ignore WPIMULT export setting if non-Darcy Flow is active
This commit is contained in:
@@ -326,15 +326,48 @@ RigCompletionData
|
|||||||
{
|
{
|
||||||
CVF_ASSERT(!completions.empty());
|
CVF_ASSERT(!completions.empty());
|
||||||
|
|
||||||
QString wellName = completions[0].wellName();
|
const RigCompletionData& firstCompletion = completions[0];
|
||||||
RigCompletionDataGridCell cellIndexIJK = completions[0].completionDataGridCell();
|
|
||||||
RigCompletionData::CompletionType completionType = completions[0].completionType();
|
const QString& wellName = firstCompletion.wellName();
|
||||||
|
const RigCompletionDataGridCell& cellIndexIJK = firstCompletion.completionDataGridCell();
|
||||||
|
RigCompletionData::CompletionType completionType = firstCompletion.completionType();
|
||||||
|
|
||||||
|
RigCompletionData resultCompletion(wellName, cellIndexIJK, firstCompletion.firstOrderingValue());
|
||||||
|
resultCompletion.setSecondOrderingValue(firstCompletion.secondOrderingValue());
|
||||||
|
|
||||||
|
bool anyNonDarcyFlowPresent = false;
|
||||||
|
for (const auto& c : completions)
|
||||||
|
{
|
||||||
|
if (c.isNonDarcyFlow()) anyNonDarcyFlowPresent = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (anyNonDarcyFlowPresent && completions.size() > 1)
|
||||||
|
{
|
||||||
|
QString errorMessage =
|
||||||
|
QString("Cannot combine multiple completions when Non-Darcy Flow contribution is present in same cell %1")
|
||||||
|
.arg(cellIndexIJK.oneBasedLocalCellIndexString());
|
||||||
|
RiaLogging::error(errorMessage);
|
||||||
|
resultCompletion.addMetadata("ERROR", errorMessage);
|
||||||
|
return resultCompletion; // Returning empty completion, should not be exported
|
||||||
|
}
|
||||||
|
|
||||||
|
if (firstCompletion.isNonDarcyFlow())
|
||||||
|
{
|
||||||
|
resultCompletion.setKh(firstCompletion.kh());
|
||||||
|
resultCompletion.setDFactor(firstCompletion.dFactor());
|
||||||
|
|
||||||
|
resultCompletion.setCombinedValuesExplicitTrans(firstCompletion.transmissibility(), completionType);
|
||||||
|
|
||||||
|
resultCompletion.m_metadata = firstCompletion.m_metadata;
|
||||||
|
|
||||||
|
return resultCompletion;
|
||||||
|
}
|
||||||
|
|
||||||
// completion type, skin factor, well bore diameter and cell direction are taken from (first) main bore,
|
// completion type, skin factor, well bore diameter and cell direction are taken from (first) main bore,
|
||||||
// if no main bore they are taken from first completion
|
// if no main bore they are taken from first completion
|
||||||
double skinfactor = completions[0].skinFactor();
|
double skinfactor = firstCompletion.skinFactor();
|
||||||
double wellBoreDiameter = completions[0].diameter();
|
double wellBoreDiameter = firstCompletion.diameter();
|
||||||
CellDirection cellDirection = completions[0].direction();
|
CellDirection cellDirection = firstCompletion.direction();
|
||||||
|
|
||||||
for (const RigCompletionData& completion : completions)
|
for (const RigCompletionData& completion : completions)
|
||||||
{
|
{
|
||||||
@@ -347,13 +380,6 @@ RigCompletionData
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RigCompletionData resultCompletion(wellName, cellIndexIJK, completions[0].firstOrderingValue());
|
|
||||||
resultCompletion.setSecondOrderingValue(completions[0].secondOrderingValue());
|
|
||||||
|
|
||||||
// NOTE : Kh and DFactor is taken from the first completion
|
|
||||||
resultCompletion.setKh(completions[0].kh());
|
|
||||||
resultCompletion.setDFactor(completions[0].dFactor());
|
|
||||||
|
|
||||||
double totalTrans = 0.0;
|
double totalTrans = 0.0;
|
||||||
|
|
||||||
for (const RigCompletionData& completion : completions)
|
for (const RigCompletionData& completion : completions)
|
||||||
@@ -362,7 +388,7 @@ RigCompletionData
|
|||||||
resultCompletion.m_metadata.insert(
|
resultCompletion.m_metadata.insert(
|
||||||
resultCompletion.m_metadata.end(), completion.m_metadata.begin(), completion.m_metadata.end());
|
resultCompletion.m_metadata.end(), completion.m_metadata.begin(), completion.m_metadata.end());
|
||||||
|
|
||||||
if (completion.completionType() != completions[0].completionType())
|
if (completion.completionType() != firstCompletion.completionType())
|
||||||
{
|
{
|
||||||
QString errorMessage = QString("Cannot combine completions of different types in same cell %1")
|
QString errorMessage = QString("Cannot combine completions of different types in same cell %1")
|
||||||
.arg(cellIndexIJK.oneBasedLocalCellIndexString());
|
.arg(cellIndexIJK.oneBasedLocalCellIndexString());
|
||||||
@@ -371,7 +397,7 @@ RigCompletionData
|
|||||||
return resultCompletion; // Returning empty completion, should not be exported
|
return resultCompletion; // Returning empty completion, should not be exported
|
||||||
}
|
}
|
||||||
|
|
||||||
if (completion.wellName() != completions[0].wellName())
|
if (completion.wellName() != firstCompletion.wellName())
|
||||||
{
|
{
|
||||||
QString errorMessage = QString("Cannot combine completions of different types in same cell %1")
|
QString errorMessage = QString("Cannot combine completions of different types in same cell %1")
|
||||||
.arg(cellIndexIJK.oneBasedLocalCellIndexString());
|
.arg(cellIndexIJK.oneBasedLocalCellIndexString());
|
||||||
@@ -639,14 +665,13 @@ void RicWellPathExportCompletionDataFeatureImpl::generateCompdatTable(RifEclipse
|
|||||||
case SHUT: formatter.add("SHUT"); break;
|
case SHUT: formatter.add("SHUT"); break;
|
||||||
case AUTO: formatter.add("AUTO"); break;
|
case AUTO: formatter.add("AUTO"); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RigCompletionData::isDefaultValue(data.saturation()))
|
if (RigCompletionData::isDefaultValue(data.saturation()))
|
||||||
formatter.add("1*");
|
formatter.add("1*");
|
||||||
else
|
else
|
||||||
formatter.add(data.saturation());
|
formatter.add(data.saturation());
|
||||||
|
|
||||||
if (!RigCompletionData::isDefaultValue(data.dFactor()) ||
|
if (data.isNonDarcyFlow() || RigCompletionData::isDefaultValue(data.transmissibility()))
|
||||||
RigCompletionData::isDefaultValue(data.transmissibility()))
|
|
||||||
{
|
{
|
||||||
if (RigCompletionData::isDefaultValue(data.transmissibility()))
|
if (RigCompletionData::isDefaultValue(data.transmissibility()))
|
||||||
formatter.add("1*");
|
formatter.add("1*");
|
||||||
|
|||||||
@@ -178,6 +178,17 @@ void RigCompletionData::setCombinedValuesImplicitTransWPImult(double wpi
|
|||||||
m_diameter = wellDiameter;
|
m_diameter = wellDiameter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RigCompletionData::isNonDarcyFlow() const
|
||||||
|
{
|
||||||
|
if (!isDefaultValue(m_kh)) return true;
|
||||||
|
if (!isDefaultValue(m_dFactor)) return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ public:
|
|||||||
double wellDiameter,
|
double wellDiameter,
|
||||||
CompletionType completionType);
|
CompletionType completionType);
|
||||||
|
|
||||||
|
bool isNonDarcyFlow() const;
|
||||||
void setDFactor(double dFactor);
|
void setDFactor(double dFactor);
|
||||||
void setKh(double kh);
|
void setKh(double kh);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user