mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Combined TRAN results: Now set to 0.0 on border to inactive cells / grid border
This commit is contained in:
parent
fff8f0c89b
commit
ed202cc7cf
@ -55,6 +55,35 @@ double RigCombTransResultAccessor::cellScalar(size_t gridLocalCellIndex) const
|
|||||||
|
|
||||||
return HUGE_VAL;
|
return HUGE_VAL;
|
||||||
}
|
}
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
/// Get tran value from neighbor cell. Return 0.0 on active/inactive cell borders and end of grid
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
double RigCombTransResultAccessor::neighborCellTran(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId, const RigResultAccessor* transAccessor) const
|
||||||
|
{
|
||||||
|
if (transAccessor != NULL)
|
||||||
|
{
|
||||||
|
size_t i, j, k, neighborGridCellIdx;
|
||||||
|
m_grid->ijkFromCellIndex(gridLocalCellIndex, &i, &j, &k);
|
||||||
|
|
||||||
|
if (m_grid->cellIJKNeighbor(i, j, k, faceId, &neighborGridCellIdx))
|
||||||
|
{
|
||||||
|
double neighborCellValue = transAccessor->cellScalar(neighborGridCellIdx);
|
||||||
|
if (neighborCellValue == HUGE_VAL && transAccessor->cellScalar(gridLocalCellIndex) != HUGE_VAL)
|
||||||
|
{
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return neighborCellValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return HUGE_VAL;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
@ -73,16 +102,7 @@ double RigCombTransResultAccessor::cellFaceScalar(size_t gridLocalCellIndex, cvf
|
|||||||
break;
|
break;
|
||||||
case cvf::StructGridInterface::NEG_I:
|
case cvf::StructGridInterface::NEG_I:
|
||||||
{
|
{
|
||||||
if (m_xTransAccessor.notNull())
|
return this->neighborCellTran(gridLocalCellIndex, cvf::StructGridInterface::NEG_I, m_xTransAccessor.p());
|
||||||
{
|
|
||||||
size_t i, j, k, neighborGridCellIdx;
|
|
||||||
m_grid->ijkFromCellIndex(gridLocalCellIndex, &i, &j, &k);
|
|
||||||
|
|
||||||
if (m_grid->cellIJKNeighbor(i, j, k, cvf::StructGridInterface::NEG_I, &neighborGridCellIdx))
|
|
||||||
{
|
|
||||||
return m_xTransAccessor->cellScalar(neighborGridCellIdx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case cvf::StructGridInterface::POS_J:
|
case cvf::StructGridInterface::POS_J:
|
||||||
@ -95,16 +115,7 @@ double RigCombTransResultAccessor::cellFaceScalar(size_t gridLocalCellIndex, cvf
|
|||||||
break;
|
break;
|
||||||
case cvf::StructGridInterface::NEG_J:
|
case cvf::StructGridInterface::NEG_J:
|
||||||
{
|
{
|
||||||
if (m_yTransAccessor.notNull())
|
return this->neighborCellTran(gridLocalCellIndex, cvf::StructGridInterface::NEG_J, m_yTransAccessor.p());
|
||||||
{
|
|
||||||
size_t i, j, k, neighborGridCellIdx;
|
|
||||||
m_grid->ijkFromCellIndex(gridLocalCellIndex, &i, &j, &k);
|
|
||||||
|
|
||||||
if (m_grid->cellIJKNeighbor(i, j, k, cvf::StructGridInterface::NEG_J, &neighborGridCellIdx))
|
|
||||||
{
|
|
||||||
return m_yTransAccessor->cellScalar(neighborGridCellIdx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case cvf::StructGridInterface::POS_K:
|
case cvf::StructGridInterface::POS_K:
|
||||||
@ -117,16 +128,7 @@ double RigCombTransResultAccessor::cellFaceScalar(size_t gridLocalCellIndex, cvf
|
|||||||
break;
|
break;
|
||||||
case cvf::StructGridInterface::NEG_K:
|
case cvf::StructGridInterface::NEG_K:
|
||||||
{
|
{
|
||||||
if (m_zTransAccessor.notNull())
|
return this->neighborCellTran(gridLocalCellIndex, cvf::StructGridInterface::NEG_K, m_zTransAccessor.p());
|
||||||
{
|
|
||||||
size_t i, j, k, neighborGridCellIdx;
|
|
||||||
m_grid->ijkFromCellIndex(gridLocalCellIndex, &i, &j, &k);
|
|
||||||
|
|
||||||
if (m_grid->cellIJKNeighbor(i, j, k, cvf::StructGridInterface::NEG_K, &neighborGridCellIdx))
|
|
||||||
{
|
|
||||||
return m_zTransAccessor->cellScalar(neighborGridCellIdx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -39,8 +39,8 @@ public:
|
|||||||
|
|
||||||
virtual double cellScalar(size_t gridLocalCellIndex) const;
|
virtual double cellScalar(size_t gridLocalCellIndex) const;
|
||||||
virtual double cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId) const;
|
virtual double cellFaceScalar(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
double neighborCellTran(size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId, const RigResultAccessor* transAccessor) const;
|
||||||
|
|
||||||
cvf::ref<RigResultAccessor> m_xTransAccessor;
|
cvf::ref<RigResultAccessor> m_xTransAccessor;
|
||||||
cvf::ref<RigResultAccessor> m_yTransAccessor;
|
cvf::ref<RigResultAccessor> m_yTransAccessor;
|
||||||
|
Loading…
Reference in New Issue
Block a user