mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
clang-format: Set column width to 140
* Set column width to 140 * Use c++20 * Remove redundant virtual
This commit is contained in:
@@ -108,8 +108,7 @@ RigCompletionData& RigCompletionData::operator=( const RigCompletionData& other
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigCompletionData::isPerforationValve( CompletionType type )
|
||||
{
|
||||
return type == CompletionType::PERFORATION_AICD || type == CompletionType::PERFORATION_ICD ||
|
||||
type == CompletionType::PERFORATION_ICV;
|
||||
return type == CompletionType::PERFORATION_AICD || type == CompletionType::PERFORATION_ICD || type == CompletionType::PERFORATION_ICV;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -125,8 +124,7 @@ bool RigCompletionData::isValve( CompletionType type )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigCompletionData::isWsegValveTypes( CompletionType type )
|
||||
{
|
||||
return type == CompletionType::FISHBONES_ICD || type == CompletionType::PERFORATION_ICD ||
|
||||
type == CompletionType::PERFORATION_ICV;
|
||||
return type == CompletionType::FISHBONES_ICD || type == CompletionType::PERFORATION_ICD || type == CompletionType::PERFORATION_ICV;
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
|
||||
@@ -124,8 +124,7 @@ size_t RigCompletionDataGridCell::localCellIndexK() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RigCompletionDataGridCell::oneBasedLocalCellIndexString() const
|
||||
{
|
||||
QString text =
|
||||
QString( "[%1, %2, %3]" ).arg( m_localCellIndexI + 1 ).arg( m_localCellIndexJ + 1 ).arg( m_localCellIndexK + 1 );
|
||||
QString text = QString( "[%1, %2, %3]" ).arg( m_localCellIndexI + 1 ).arg( m_localCellIndexJ + 1 ).arg( m_localCellIndexK + 1 );
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
@@ -68,28 +68,24 @@ RigEclipseToStimPlanCalculator::RigEclipseToStimPlanCalculator( const RimEclipse
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseToStimPlanCalculator::computeValues()
|
||||
{
|
||||
auto reservoirCellIndicesOpenForFlow =
|
||||
RimFractureContainmentTools::reservoirCellIndicesOpenForFlow( m_case, m_fracture );
|
||||
auto reservoirCellIndicesOpenForFlow = RimFractureContainmentTools::reservoirCellIndicesOpenForFlow( m_case, m_fracture );
|
||||
|
||||
auto resultValueAtIJ =
|
||||
[]( const std::vector<std::vector<double>>& values, const RigFractureGrid& fractureGrid, size_t i, size_t j ) {
|
||||
if ( values.empty() ) return HUGE_VAL;
|
||||
auto resultValueAtIJ = []( const std::vector<std::vector<double>>& values, const RigFractureGrid& fractureGrid, size_t i, size_t j ) {
|
||||
if ( values.empty() ) return HUGE_VAL;
|
||||
|
||||
size_t adjustedI = i + 1;
|
||||
size_t adjustedJ = j + 1;
|
||||
size_t adjustedI = i + 1;
|
||||
size_t adjustedJ = j + 1;
|
||||
|
||||
if ( adjustedI >= fractureGrid.iCellCount() + 1 || adjustedJ >= fractureGrid.jCellCount() + 1 )
|
||||
return HUGE_VAL;
|
||||
if ( adjustedI >= fractureGrid.iCellCount() + 1 || adjustedJ >= fractureGrid.jCellCount() + 1 ) return HUGE_VAL;
|
||||
|
||||
return values[adjustedJ][adjustedI];
|
||||
};
|
||||
return values[adjustedJ][adjustedI];
|
||||
};
|
||||
|
||||
std::vector<std::vector<double>> injectivityFactors;
|
||||
std::vector<std::vector<double>> viscosities;
|
||||
std::vector<std::vector<double>> filterCakeMobilities;
|
||||
|
||||
RimThermalFractureTemplate* thermalFractureTemplate =
|
||||
dynamic_cast<RimThermalFractureTemplate*>( m_fracture->fractureTemplate() );
|
||||
RimThermalFractureTemplate* thermalFractureTemplate = dynamic_cast<RimThermalFractureTemplate*>( m_fracture->fractureTemplate() );
|
||||
|
||||
if ( thermalFractureTemplate != nullptr )
|
||||
{
|
||||
@@ -97,25 +93,22 @@ void RigEclipseToStimPlanCalculator::computeValues()
|
||||
size_t timeStep = thermalFractureTemplate->activeTimeStepIndex();
|
||||
|
||||
injectivityFactors =
|
||||
thermalFractureTemplate
|
||||
->resultValues( RiaDefines::injectivityFactorResultName(),
|
||||
RiaDefines::getExpectedThermalFractureUnit( RiaDefines::injectivityFactorResultName(),
|
||||
unitSystem ),
|
||||
thermalFractureTemplate->resultValues( RiaDefines::injectivityFactorResultName(),
|
||||
RiaDefines::getExpectedThermalFractureUnit( RiaDefines::injectivityFactorResultName(),
|
||||
unitSystem ),
|
||||
|
||||
timeStep );
|
||||
timeStep );
|
||||
|
||||
viscosities = thermalFractureTemplate
|
||||
->resultValues( RiaDefines::viscosityResultName(),
|
||||
RiaDefines::getExpectedThermalFractureUnit( RiaDefines::viscosityResultName(),
|
||||
unitSystem ),
|
||||
timeStep );
|
||||
viscosities =
|
||||
thermalFractureTemplate->resultValues( RiaDefines::viscosityResultName(),
|
||||
RiaDefines::getExpectedThermalFractureUnit( RiaDefines::viscosityResultName(), unitSystem ),
|
||||
timeStep );
|
||||
|
||||
filterCakeMobilities =
|
||||
thermalFractureTemplate
|
||||
->resultValues( RiaDefines::filterCakeMobilityResultName(),
|
||||
RiaDefines::getExpectedThermalFractureUnit( RiaDefines::filterCakeMobilityResultName(),
|
||||
unitSystem ),
|
||||
timeStep );
|
||||
thermalFractureTemplate->resultValues( RiaDefines::filterCakeMobilityResultName(),
|
||||
RiaDefines::getExpectedThermalFractureUnit( RiaDefines::filterCakeMobilityResultName(),
|
||||
unitSystem ),
|
||||
timeStep );
|
||||
}
|
||||
|
||||
for ( size_t i = 0; i < m_fractureGrid.fractureCells().size(); i++ )
|
||||
@@ -138,33 +131,30 @@ void RigEclipseToStimPlanCalculator::computeValues()
|
||||
double relativePermeability = 1.0;
|
||||
|
||||
auto filterPressureDropType = thermalFractureTemplate->filterCakePressureDropType();
|
||||
eclToFractureTransCalc =
|
||||
std::make_unique<RigEclipseToThermalCellTransmissibilityCalculator>( m_case,
|
||||
m_fractureTransform,
|
||||
m_fractureSkinFactor,
|
||||
m_cDarcy,
|
||||
fractureCell,
|
||||
m_fracture,
|
||||
filterPressureDropType,
|
||||
injectivityFactor,
|
||||
filterCakeMobility,
|
||||
viscosity,
|
||||
relativePermeability );
|
||||
eclToFractureTransCalc = std::make_unique<RigEclipseToThermalCellTransmissibilityCalculator>( m_case,
|
||||
m_fractureTransform,
|
||||
m_fractureSkinFactor,
|
||||
m_cDarcy,
|
||||
fractureCell,
|
||||
m_fracture,
|
||||
filterPressureDropType,
|
||||
injectivityFactor,
|
||||
filterCakeMobility,
|
||||
viscosity,
|
||||
relativePermeability );
|
||||
}
|
||||
else
|
||||
{
|
||||
eclToFractureTransCalc =
|
||||
std::make_unique<RigEclipseToStimPlanCellTransmissibilityCalculator>( m_case,
|
||||
m_fractureTransform,
|
||||
m_fractureSkinFactor,
|
||||
m_cDarcy,
|
||||
fractureCell,
|
||||
m_fracture );
|
||||
eclToFractureTransCalc = std::make_unique<RigEclipseToStimPlanCellTransmissibilityCalculator>( m_case,
|
||||
m_fractureTransform,
|
||||
m_fractureSkinFactor,
|
||||
m_cDarcy,
|
||||
fractureCell,
|
||||
m_fracture );
|
||||
}
|
||||
|
||||
eclToFractureTransCalc->computeValues( reservoirCellIndicesOpenForFlow );
|
||||
const std::vector<size_t>& fractureCellContributingEclipseCells =
|
||||
eclToFractureTransCalc->globalIndiciesToContributingEclipseCells();
|
||||
const std::vector<size_t>& fractureCellContributingEclipseCells = eclToFractureTransCalc->globalIndiciesToContributingEclipseCells();
|
||||
|
||||
if ( !fractureCellContributingEclipseCells.empty() )
|
||||
{
|
||||
@@ -178,7 +168,7 @@ using CellIdxSpace = RigTransmissibilityCondenser::CellAddress;
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseToStimPlanCalculator::appendDataToTransmissibilityCondenser( bool useFiniteConductivityInFracture,
|
||||
void RigEclipseToStimPlanCalculator::appendDataToTransmissibilityCondenser( bool useFiniteConductivityInFracture,
|
||||
RigTransmissibilityCondenser* condenser ) const
|
||||
{
|
||||
for ( const auto& eclToFractureTransCalc : m_singleFractureCellCalculators )
|
||||
@@ -195,17 +185,13 @@ void RigEclipseToStimPlanCalculator::appendDataToTransmissibilityCondenser( bool
|
||||
{
|
||||
if ( useFiniteConductivityInFracture )
|
||||
{
|
||||
condenser->addNeighborTransmissibility( { true,
|
||||
CellIdxSpace::ECLIPSE,
|
||||
fractureCellContributingEclipseCells[i] },
|
||||
condenser->addNeighborTransmissibility( { true, CellIdxSpace::ECLIPSE, fractureCellContributingEclipseCells[i] },
|
||||
{ false, CellIdxSpace::STIMPLAN, stimPlanCellIndex },
|
||||
fractureCellContributingEclipseCellTransmissibilities[i] );
|
||||
}
|
||||
else
|
||||
{
|
||||
condenser->addNeighborTransmissibility( { true,
|
||||
CellIdxSpace::ECLIPSE,
|
||||
fractureCellContributingEclipseCells[i] },
|
||||
condenser->addNeighborTransmissibility( { true, CellIdxSpace::ECLIPSE, fractureCellContributingEclipseCells[i] },
|
||||
{ true, CellIdxSpace::WELL, 1 },
|
||||
fractureCellContributingEclipseCellTransmissibilities[i] );
|
||||
}
|
||||
|
||||
@@ -47,8 +47,7 @@ public:
|
||||
const RigFractureGrid& fractureGrid,
|
||||
const RimFracture* fracture );
|
||||
|
||||
void appendDataToTransmissibilityCondenser( bool useFiniteConductivityInFracture,
|
||||
RigTransmissibilityCondenser* condenser ) const;
|
||||
void appendDataToTransmissibilityCondenser( bool useFiniteConductivityInFracture, RigTransmissibilityCondenser* condenser ) const;
|
||||
|
||||
// Returns the area intersecting eclipse cells open for flow, from both active and inactive cells
|
||||
// Truncated parts of the fracture are not included
|
||||
|
||||
@@ -38,13 +38,12 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigEclipseToStimPlanCellTransmissibilityCalculator::RigEclipseToStimPlanCellTransmissibilityCalculator(
|
||||
const RimEclipseCase* caseToApply,
|
||||
cvf::Mat4d fractureTransform,
|
||||
double skinFactor,
|
||||
double cDarcy,
|
||||
const RigFractureCell& stimPlanCell,
|
||||
const RimFracture* fracture )
|
||||
RigEclipseToStimPlanCellTransmissibilityCalculator::RigEclipseToStimPlanCellTransmissibilityCalculator( const RimEclipseCase* caseToApply,
|
||||
cvf::Mat4d fractureTransform,
|
||||
double skinFactor,
|
||||
double cDarcy,
|
||||
const RigFractureCell& stimPlanCell,
|
||||
const RimFracture* fracture )
|
||||
: m_case( caseToApply )
|
||||
, m_fractureTransform( fractureTransform )
|
||||
, m_fractureSkinFactor( skinFactor )
|
||||
@@ -160,9 +159,8 @@ void RigEclipseToStimPlanCellTransmissibilityCalculator::calculateStimPlanCellsM
|
||||
cvf::ref<RigResultAccessor> dataAccessObjectDz = createResultAccessor( m_case, "DZ" );
|
||||
if ( dataAccessObjectDx.isNull() || dataAccessObjectDy.isNull() || dataAccessObjectDz.isNull() )
|
||||
{
|
||||
RiaLogging::error(
|
||||
"Data for DX/DY/DZ is not complete, and these values are required for export of COMPDAT. Make sure "
|
||||
"'Preferences->Compute DEPTH Related Properties' is checked." );
|
||||
RiaLogging::error( "Data for DX/DY/DZ is not complete, and these values are required for export of COMPDAT. Make sure "
|
||||
"'Preferences->Compute DEPTH Related Properties' is checked." );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -172,8 +170,7 @@ void RigEclipseToStimPlanCellTransmissibilityCalculator::calculateStimPlanCellsM
|
||||
cvf::ref<RigResultAccessor> dataAccessObjectPermZ = createResultAccessor( m_case, "PERMZ" );
|
||||
if ( dataAccessObjectPermX.isNull() || dataAccessObjectPermY.isNull() || dataAccessObjectPermZ.isNull() )
|
||||
{
|
||||
RiaLogging::error(
|
||||
"Data for PERMX/PERMY/PERMZ is not complete, and these values are required for export of COMPDAT." );
|
||||
RiaLogging::error( "Data for PERMX/PERMY/PERMZ is not complete, and these values are required for export of COMPDAT." );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -193,15 +190,13 @@ void RigEclipseToStimPlanCellTransmissibilityCalculator::calculateStimPlanCellsM
|
||||
for ( size_t reservoirCellIndex : reservoirCellIndices )
|
||||
{
|
||||
const RigMainGrid* mainGrid = m_case->eclipseCaseData()->mainGrid();
|
||||
if ( !m_fracture->isEclipseCellOpenForFlow( mainGrid, reservoirCellIndicesOpenForFlow, reservoirCellIndex ) )
|
||||
continue;
|
||||
if ( !m_fracture->isEclipseCellOpenForFlow( mainGrid, reservoirCellIndicesOpenForFlow, reservoirCellIndex ) ) continue;
|
||||
|
||||
std::array<cvf::Vec3d, 8> hexCorners;
|
||||
mainGrid->cellCornerVertices( reservoirCellIndex, hexCorners.data() );
|
||||
|
||||
std::vector<std::vector<cvf::Vec3d>> planeCellPolygons;
|
||||
bool isPlanIntersected =
|
||||
RigHexIntersectionTools::planeHexIntersectionPolygons( hexCorners, m_fractureTransform, planeCellPolygons );
|
||||
bool isPlanIntersected = RigHexIntersectionTools::planeHexIntersectionPolygons( hexCorners, m_fractureTransform, planeCellPolygons );
|
||||
if ( !isPlanIntersected || planeCellPolygons.empty() ) continue;
|
||||
|
||||
cvf::Vec3d localX;
|
||||
@@ -306,30 +301,27 @@ void RigEclipseToStimPlanCellTransmissibilityCalculator::calculateStimPlanCellsM
|
||||
NTG = dataAccessObjectNTG->cellScalarGlobIdx( reservoirCellIndex );
|
||||
}
|
||||
|
||||
double transmissibility_X =
|
||||
RigFractureTransmissibilityEquations::matrixToFractureTrans( permY,
|
||||
NTG,
|
||||
Ay,
|
||||
dx,
|
||||
m_fractureSkinFactor,
|
||||
fractureAreaWeightedlength,
|
||||
m_cDarcy );
|
||||
double transmissibility_Y =
|
||||
RigFractureTransmissibilityEquations::matrixToFractureTrans( permX,
|
||||
NTG,
|
||||
Ax,
|
||||
dy,
|
||||
m_fractureSkinFactor,
|
||||
fractureAreaWeightedlength,
|
||||
m_cDarcy );
|
||||
double transmissibility_Z =
|
||||
RigFractureTransmissibilityEquations::matrixToFractureTrans( permZ,
|
||||
1.0,
|
||||
Az,
|
||||
dz,
|
||||
m_fractureSkinFactor,
|
||||
fractureAreaWeightedlength,
|
||||
m_cDarcy );
|
||||
double transmissibility_X = RigFractureTransmissibilityEquations::matrixToFractureTrans( permY,
|
||||
NTG,
|
||||
Ay,
|
||||
dx,
|
||||
m_fractureSkinFactor,
|
||||
fractureAreaWeightedlength,
|
||||
m_cDarcy );
|
||||
double transmissibility_Y = RigFractureTransmissibilityEquations::matrixToFractureTrans( permX,
|
||||
NTG,
|
||||
Ax,
|
||||
dy,
|
||||
m_fractureSkinFactor,
|
||||
fractureAreaWeightedlength,
|
||||
m_cDarcy );
|
||||
double transmissibility_Z = RigFractureTransmissibilityEquations::matrixToFractureTrans( permZ,
|
||||
1.0,
|
||||
Az,
|
||||
dz,
|
||||
m_fractureSkinFactor,
|
||||
fractureAreaWeightedlength,
|
||||
m_cDarcy );
|
||||
|
||||
cvf::Vec3d transmissibilityVector( transmissibility_X, transmissibility_Y, transmissibility_Z );
|
||||
transmissibility = calculateTransmissibility( transmissibilityVector, fractureArea );
|
||||
@@ -347,8 +339,8 @@ void RigEclipseToStimPlanCellTransmissibilityCalculator::calculateStimPlanCellsM
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<size_t> RigEclipseToStimPlanCellTransmissibilityCalculator::getPotentiallyFracturedCellsForPolygon(
|
||||
const std::vector<cvf::Vec3d>& polygon ) const
|
||||
std::vector<size_t>
|
||||
RigEclipseToStimPlanCellTransmissibilityCalculator::getPotentiallyFracturedCellsForPolygon( const std::vector<cvf::Vec3d>& polygon ) const
|
||||
{
|
||||
std::vector<size_t> cellIndices;
|
||||
|
||||
@@ -379,19 +371,14 @@ std::vector<size_t> RigEclipseToStimPlanCellTransmissibilityCalculator::getPoten
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<RigResultAccessor>
|
||||
RigEclipseToStimPlanCellTransmissibilityCalculator::createResultAccessor( const RimEclipseCase* eclipseCase,
|
||||
const QString& uiResultName )
|
||||
cvf::ref<RigResultAccessor> RigEclipseToStimPlanCellTransmissibilityCalculator::createResultAccessor( const RimEclipseCase* eclipseCase,
|
||||
const QString& uiResultName )
|
||||
{
|
||||
RiaDefines::PorosityModelType porosityModel = RiaDefines::PorosityModelType::MATRIX_MODEL;
|
||||
const RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
|
||||
|
||||
// Create result accessor object for main grid at time step zero (static result date is always at first time step
|
||||
return RigResultAccessorFactory::createFromResultAddress( eclipseCaseData,
|
||||
0,
|
||||
porosityModel,
|
||||
0,
|
||||
RigEclipseResultAddress( uiResultName ) );
|
||||
return RigResultAccessorFactory::createFromResultAddress( eclipseCaseData, 0, porosityModel, 0, RigEclipseResultAddress( uiResultName ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -64,13 +64,12 @@ public:
|
||||
static std::vector<QString> optionalResultNames();
|
||||
|
||||
private:
|
||||
void calculateStimPlanCellsMatrixTransmissibility( const std::set<size_t>& reservoirCellIndicesOpenForFlow );
|
||||
void calculateStimPlanCellsMatrixTransmissibility( const std::set<size_t>& reservoirCellIndicesOpenForFlow );
|
||||
virtual double calculateTransmissibility( const cvf::Vec3d& transmissibilityVector, double fractureArea );
|
||||
|
||||
std::vector<size_t> getPotentiallyFracturedCellsForPolygon( const std::vector<cvf::Vec3d>& polygon ) const;
|
||||
|
||||
static cvf::ref<RigResultAccessor> createResultAccessor( const RimEclipseCase* eclipseCase,
|
||||
const QString& uiResultName );
|
||||
static cvf::ref<RigResultAccessor> createResultAccessor( const RimEclipseCase* eclipseCase, const QString& uiResultName );
|
||||
|
||||
protected:
|
||||
const RimEclipseCase* m_case;
|
||||
|
||||
@@ -44,18 +44,17 @@ class RimFracture;
|
||||
class RigEclipseToThermalCellTransmissibilityCalculator : public RigEclipseToStimPlanCellTransmissibilityCalculator
|
||||
{
|
||||
public:
|
||||
explicit RigEclipseToThermalCellTransmissibilityCalculator(
|
||||
const RimEclipseCase* caseToApply,
|
||||
cvf::Mat4d fractureTransform,
|
||||
double skinFactor,
|
||||
double cDarcy,
|
||||
const RigFractureCell& stimPlanCell,
|
||||
const RimFracture* fracture,
|
||||
RimThermalFractureTemplate::FilterCakePressureDrop filterCakePressureDrop,
|
||||
double injectvityFactor,
|
||||
double filterCakeMobility,
|
||||
double viscosity,
|
||||
double relativePermeability );
|
||||
explicit RigEclipseToThermalCellTransmissibilityCalculator( const RimEclipseCase* caseToApply,
|
||||
cvf::Mat4d fractureTransform,
|
||||
double skinFactor,
|
||||
double cDarcy,
|
||||
const RigFractureCell& stimPlanCell,
|
||||
const RimFracture* fracture,
|
||||
RimThermalFractureTemplate::FilterCakePressureDrop filterCakePressureDrop,
|
||||
double injectvityFactor,
|
||||
double filterCakeMobility,
|
||||
double viscosity,
|
||||
double relativePermeability );
|
||||
|
||||
protected:
|
||||
double calculateTransmissibility( const cvf::Vec3d& transmissibilityVector, double fractureArea ) override;
|
||||
|
||||
@@ -36,14 +36,10 @@ double RigFractureTransmissibilityEquations::centerToCenterFractureCellTrans( do
|
||||
double sideLengthNormalTransCell2,
|
||||
double cDarcyForRelevantUnit )
|
||||
{
|
||||
double transCell1 = centerToEdgeFractureCellTrans( conductivityCell1,
|
||||
sideLengthParallellTransCell1,
|
||||
sideLengthNormalTransCell1,
|
||||
cDarcyForRelevantUnit );
|
||||
double transCell2 = centerToEdgeFractureCellTrans( conductivityCell2,
|
||||
sideLengthParallellTransCell2,
|
||||
sideLengthNormalTransCell2,
|
||||
cDarcyForRelevantUnit );
|
||||
double transCell1 =
|
||||
centerToEdgeFractureCellTrans( conductivityCell1, sideLengthParallellTransCell1, sideLengthNormalTransCell1, cDarcyForRelevantUnit );
|
||||
double transCell2 =
|
||||
centerToEdgeFractureCellTrans( conductivityCell2, sideLengthParallellTransCell2, sideLengthNormalTransCell2, cDarcyForRelevantUnit );
|
||||
|
||||
double totalTrans = 1 / ( ( 1 / transCell1 ) + ( 1 / transCell2 ) );
|
||||
|
||||
@@ -196,7 +192,6 @@ double RigFractureTransmissibilityEquations::centerToEdgeFractureCellTrans( doub
|
||||
double sideLengthNormalTrans,
|
||||
double cDarcyForRelevantUnit )
|
||||
{
|
||||
double transmissibility =
|
||||
cDarcyForRelevantUnit * conductivity * sideLengthNormalTrans / ( sideLengthParallellTrans / 2 );
|
||||
double transmissibility = cDarcyForRelevantUnit * conductivity * sideLengthNormalTrans / ( sideLengthParallellTrans / 2 );
|
||||
return transmissibility;
|
||||
}
|
||||
|
||||
@@ -49,19 +49,12 @@ public:
|
||||
double cDarcyForRelevantUnit,
|
||||
double wellRadius );
|
||||
|
||||
static double matrixToFractureTrans( double permX,
|
||||
double NTG,
|
||||
double Ay,
|
||||
double dx,
|
||||
double skinfactor,
|
||||
double fractureAreaWeightedlength,
|
||||
double cDarcy );
|
||||
static double
|
||||
matrixToFractureTrans( double permX, double NTG, double Ay, double dx, double skinfactor, double fractureAreaWeightedlength, double cDarcy );
|
||||
|
||||
static double effectiveInternalFractureToWellTransPDDHC( double sumScaledMatrixToFractureTrans,
|
||||
double scaledMatrixToWellTrans );
|
||||
static double effectiveInternalFractureToWellTransPDDHC( double sumScaledMatrixToFractureTrans, double scaledMatrixToWellTrans );
|
||||
|
||||
static double effectiveMatrixToWellTransPDDHC( double sumOriginalMatrixToFractureTrans,
|
||||
double effectiveInternalFractureToWellTrans );
|
||||
static double effectiveMatrixToWellTransPDDHC( double sumOriginalMatrixToFractureTrans, double effectiveInternalFractureToWellTrans );
|
||||
|
||||
static double matrixPermeability( double permx, double permy, double NTG );
|
||||
|
||||
|
||||
@@ -142,12 +142,11 @@ double RigTransmissibilityCondenser::condensedTransmissibility( CellAddress exte
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::map<size_t, double>
|
||||
RigTransmissibilityCondenser::scaleMatrixToFracTransByMatrixWellDP( const RigActiveCellInfo* actCellInfo,
|
||||
double currentWellPressure,
|
||||
const std::vector<double>& currentMatrixPressures,
|
||||
double* minPressureDrop,
|
||||
double* maxPressureDrop )
|
||||
std::map<size_t, double> RigTransmissibilityCondenser::scaleMatrixToFracTransByMatrixWellDP( const RigActiveCellInfo* actCellInfo,
|
||||
double currentWellPressure,
|
||||
const std::vector<double>& currentMatrixPressures,
|
||||
double* minPressureDrop,
|
||||
double* maxPressureDrop )
|
||||
{
|
||||
std::map<size_t, double> originalLumpedMatrixToFractureTrans; // Sum(T_mf)
|
||||
|
||||
@@ -167,11 +166,10 @@ std::map<size_t, double>
|
||||
size_t globalMatrixCellIdx = jt->first.m_globalCellIdx;
|
||||
size_t eclipseResultIndex = actCellInfo->cellResultIndex( globalMatrixCellIdx );
|
||||
CVF_ASSERT( eclipseResultIndex < currentMatrixPressures.size() );
|
||||
double unsignedDeltaPressure =
|
||||
std::abs( currentMatrixPressures[eclipseResultIndex] - currentWellPressure );
|
||||
double nonZeroDeltaPressure = std::max( epsilonDeltaPressure, unsignedDeltaPressure );
|
||||
maxNonZeroDeltaPressure = std::max( maxNonZeroDeltaPressure, nonZeroDeltaPressure );
|
||||
minNonZeroDeltaPressure = std::min( minNonZeroDeltaPressure, nonZeroDeltaPressure );
|
||||
double unsignedDeltaPressure = std::abs( currentMatrixPressures[eclipseResultIndex] - currentWellPressure );
|
||||
double nonZeroDeltaPressure = std::max( epsilonDeltaPressure, unsignedDeltaPressure );
|
||||
maxNonZeroDeltaPressure = std::max( maxNonZeroDeltaPressure, nonZeroDeltaPressure );
|
||||
minNonZeroDeltaPressure = std::min( minNonZeroDeltaPressure, nonZeroDeltaPressure );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -191,9 +189,8 @@ std::map<size_t, double>
|
||||
|
||||
originalLumpedMatrixToFractureTrans[globalMatrixCellIdx] += jt->second;
|
||||
|
||||
double unsignedDeltaPressure =
|
||||
std::abs( currentMatrixPressures[eclipseResultIndex] - currentWellPressure );
|
||||
double nonZeroDeltaPressure = std::max( epsilonDeltaPressure, unsignedDeltaPressure );
|
||||
double unsignedDeltaPressure = std::abs( currentMatrixPressures[eclipseResultIndex] - currentWellPressure );
|
||||
double nonZeroDeltaPressure = std::max( epsilonDeltaPressure, unsignedDeltaPressure );
|
||||
|
||||
jt->second *= nonZeroDeltaPressure / maxNonZeroDeltaPressure;
|
||||
}
|
||||
@@ -470,8 +467,7 @@ void printCellAddress( std::stringstream& str,
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RigTransmissibilityCondenser::neighborTransDebugOutput( const RigMainGrid* mainGrid,
|
||||
const RigFractureGrid* fractureGrid )
|
||||
std::string RigTransmissibilityCondenser::neighborTransDebugOutput( const RigMainGrid* mainGrid, const RigFractureGrid* fractureGrid )
|
||||
{
|
||||
std::stringstream debugText;
|
||||
for ( const auto& adrEqIdxPair : m_neighborTransmissibilities )
|
||||
@@ -493,8 +489,7 @@ std::string RigTransmissibilityCondenser::neighborTransDebugOutput( const RigMai
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RigTransmissibilityCondenser::condensedTransDebugOutput( const RigMainGrid* mainGrid,
|
||||
const RigFractureGrid* fractureGrid )
|
||||
std::string RigTransmissibilityCondenser::condensedTransDebugOutput( const RigMainGrid* mainGrid, const RigFractureGrid* fractureGrid )
|
||||
{
|
||||
std::stringstream debugText;
|
||||
for ( const auto& adrEqIdxPair : m_condensedTransmissibilities )
|
||||
|
||||
@@ -70,8 +70,7 @@ public:
|
||||
|
||||
bool operator==( const CellAddress& o )
|
||||
{
|
||||
return ( m_isExternal == o.m_isExternal ) && ( m_cellIndexSpace == o.m_cellIndexSpace ) &&
|
||||
( m_globalCellIdx == o.m_globalCellIdx );
|
||||
return ( m_isExternal == o.m_isExternal ) && ( m_cellIndexSpace == o.m_cellIndexSpace ) && ( m_globalCellIdx == o.m_globalCellIdx );
|
||||
}
|
||||
|
||||
// Ordering external after internal is important for the matrix order internally
|
||||
@@ -79,8 +78,7 @@ public:
|
||||
bool operator<( const CellAddress& other ) const
|
||||
{
|
||||
if ( m_isExternal != other.m_isExternal ) return !m_isExternal; // Internal cells < External cells
|
||||
if ( m_cellIndexSpace != other.m_cellIndexSpace )
|
||||
return m_cellIndexSpace < other.m_cellIndexSpace; // Eclipse < StimPlan
|
||||
if ( m_cellIndexSpace != other.m_cellIndexSpace ) return m_cellIndexSpace < other.m_cellIndexSpace; // Eclipse < StimPlan
|
||||
if ( m_globalCellIdx != other.m_globalCellIdx ) return m_globalCellIdx < other.m_globalCellIdx;
|
||||
return false;
|
||||
}
|
||||
@@ -105,9 +103,9 @@ public:
|
||||
double* maxPressureDrop );
|
||||
|
||||
std::map<size_t, double> calculateFicticiousFractureToWellTransmissibilities();
|
||||
std::map<size_t, double> calculateEffectiveMatrixToWellTransmissibilities(
|
||||
const std::map<size_t, double>& originalLumpedMatrixToFractureTrans,
|
||||
const std::map<size_t, double>& ficticuousFractureToWellTransMap );
|
||||
std::map<size_t, double>
|
||||
calculateEffectiveMatrixToWellTransmissibilities( const std::map<size_t, double>& originalLumpedMatrixToFractureTrans,
|
||||
const std::map<size_t, double>& ficticuousFractureToWellTransMap );
|
||||
|
||||
void calculateCondensedTransmissibilities();
|
||||
|
||||
|
||||
@@ -73,9 +73,8 @@ RigVirtualPerforationTransmissibilities::~RigVirtualPerforationTransmissibilitie
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigVirtualPerforationTransmissibilities::setCompletionDataForWellPath(
|
||||
const RimWellPath* wellPath,
|
||||
const std::vector<std::vector<RigCompletionData>>& completionsPerTimeStep )
|
||||
void RigVirtualPerforationTransmissibilities::setCompletionDataForWellPath( const RimWellPath* wellPath,
|
||||
const std::vector<std::vector<RigCompletionData>>& completionsPerTimeStep )
|
||||
{
|
||||
CVF_ASSERT( m_mapFromWellToCompletionData.find( wellPath ) == m_mapFromWellToCompletionData.end() );
|
||||
|
||||
@@ -99,8 +98,7 @@ void RigVirtualPerforationTransmissibilities::setCompletionDataForWellPath(
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::map<size_t, std::vector<RigCompletionData>>&
|
||||
RigVirtualPerforationTransmissibilities::multipleCompletionsPerEclipseCell( const RimWellPath* wellPath,
|
||||
size_t timeStepIndex ) const
|
||||
RigVirtualPerforationTransmissibilities::multipleCompletionsPerEclipseCell( const RimWellPath* wellPath, size_t timeStepIndex ) const
|
||||
{
|
||||
auto item = m_mapFromWellToCompletionData.find( wellPath );
|
||||
if ( item != m_mapFromWellToCompletionData.end() )
|
||||
@@ -126,9 +124,8 @@ const std::map<size_t, std::vector<RigCompletionData>>&
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigVirtualPerforationTransmissibilities::setCompletionDataForSimWell(
|
||||
const RigSimWellData* simWellData,
|
||||
const std::vector<std::vector<RigCompletionData>>& completionsPerTimeStep )
|
||||
void RigVirtualPerforationTransmissibilities::setCompletionDataForSimWell( const RigSimWellData* simWellData,
|
||||
const std::vector<std::vector<RigCompletionData>>& completionsPerTimeStep )
|
||||
{
|
||||
m_mapFromSimWellToCompletionData[simWellData] = completionsPerTimeStep;
|
||||
}
|
||||
@@ -136,9 +133,8 @@ void RigVirtualPerforationTransmissibilities::setCompletionDataForSimWell(
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<RigCompletionData>&
|
||||
RigVirtualPerforationTransmissibilities::completionsForSimWell( const RigSimWellData* simWellData,
|
||||
size_t timeStepIndex ) const
|
||||
const std::vector<RigCompletionData>& RigVirtualPerforationTransmissibilities::completionsForSimWell( const RigSimWellData* simWellData,
|
||||
size_t timeStepIndex ) const
|
||||
{
|
||||
static std::vector<RigCompletionData> dummayVector;
|
||||
|
||||
|
||||
@@ -55,17 +55,15 @@ public:
|
||||
RigVirtualPerforationTransmissibilities();
|
||||
~RigVirtualPerforationTransmissibilities() override;
|
||||
|
||||
void setCompletionDataForWellPath( const RimWellPath* wellPath,
|
||||
const std::vector<std::vector<RigCompletionData>>& completionsPerTimeStep );
|
||||
void setCompletionDataForWellPath( const RimWellPath* wellPath, const std::vector<std::vector<RigCompletionData>>& completionsPerTimeStep );
|
||||
|
||||
const std::map<size_t, std::vector<RigCompletionData>>&
|
||||
multipleCompletionsPerEclipseCell( const RimWellPath* wellPath, size_t timeStepIndex ) const;
|
||||
const std::map<size_t, std::vector<RigCompletionData>>& multipleCompletionsPerEclipseCell( const RimWellPath* wellPath,
|
||||
size_t timeStepIndex ) const;
|
||||
|
||||
void setCompletionDataForSimWell( const RigSimWellData* simWellData,
|
||||
const std::vector<std::vector<RigCompletionData>>& completionsPerTimeStep );
|
||||
|
||||
const std::vector<RigCompletionData>& completionsForSimWell( const RigSimWellData* simWellData,
|
||||
size_t timeStepIndex ) const;
|
||||
const std::vector<RigCompletionData>& completionsForSimWell( const RigSimWellData* simWellData, size_t timeStepIndex ) const;
|
||||
|
||||
void computeMinMax( double* minValue, double* maxValue, double* posClosestToZero, double* negClosestToZero ) const;
|
||||
|
||||
|
||||
@@ -55,12 +55,7 @@ RigWellPathStimplanIntersector::RigWellPathStimplanIntersector( const std::vecto
|
||||
}
|
||||
double perforationLength = rimFracture->perforationLength();
|
||||
|
||||
calculate( fractureXf,
|
||||
wellPathPoints,
|
||||
wellRadius,
|
||||
perforationLength,
|
||||
fractureGridCellPolygons,
|
||||
m_stimPlanCellIdxToIntersectionInfoMap );
|
||||
calculate( fractureXf, wellPathPoints, wellRadius, perforationLength, fractureGridCellPolygons, m_stimPlanCellIdxToIntersectionInfoMap );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -80,7 +75,7 @@ void RigWellPathStimplanIntersector::calculate( const cvf::Mat4d&
|
||||
double wellRadius,
|
||||
double perforationLength,
|
||||
const std::vector<std::vector<cvf::Vec3d>>& fractureGridCellPolygons,
|
||||
std::map<size_t, WellCellIntersection>& m_stimPlanCellIdxToIntersectionInfoMap )
|
||||
std::map<size_t, WellCellIntersection>& m_stimPlanCellIdxToIntersectionInfoMap )
|
||||
{
|
||||
cvf::Mat4d toFractureXf = fractureXf.getInverted();
|
||||
|
||||
|
||||
@@ -50,8 +50,7 @@ public:
|
||||
double computeLength() const { return cvf::Math::sqrt( hlength * hlength + vlength * vlength ); }
|
||||
};
|
||||
|
||||
RigWellPathStimplanIntersector( const std::vector<cvf::Vec3d>& wellPathPoints,
|
||||
gsl::not_null<const RimFracture*> rimFracture );
|
||||
RigWellPathStimplanIntersector( const std::vector<cvf::Vec3d>& wellPathPoints, gsl::not_null<const RimFracture*> rimFracture );
|
||||
|
||||
const std::map<size_t, WellCellIntersection>& intersections() const;
|
||||
|
||||
@@ -73,13 +72,12 @@ private:
|
||||
class RigWellPathStimplanIntersectorTester
|
||||
{
|
||||
public:
|
||||
static void testCalculate(
|
||||
const cvf::Mat4d& fractureXf,
|
||||
const std::vector<cvf::Vec3d>& wellPathPoints,
|
||||
double wellRadius,
|
||||
double perforationLength,
|
||||
const std::vector<std::vector<cvf::Vec3d>>& stpCellPolygons,
|
||||
std::map<size_t, RigWellPathStimplanIntersector::WellCellIntersection>& stimPlanCellIdxToIntersectionInfoMap )
|
||||
static void testCalculate( const cvf::Mat4d& fractureXf,
|
||||
const std::vector<cvf::Vec3d>& wellPathPoints,
|
||||
double wellRadius,
|
||||
double perforationLength,
|
||||
const std::vector<std::vector<cvf::Vec3d>>& stpCellPolygons,
|
||||
std::map<size_t, RigWellPathStimplanIntersector::WellCellIntersection>& stimPlanCellIdxToIntersectionInfoMap )
|
||||
{
|
||||
RigWellPathStimplanIntersector::calculate( fractureXf,
|
||||
wellPathPoints,
|
||||
|
||||
@@ -53,13 +53,12 @@ size_t RigEclCellIndexCalculator::resultCellIndex( size_t gridIndex, size_t grid
|
||||
/// The pipeBranchesWellResultPoints are describing the lines between the points, starting with the first line
|
||||
// and is thus expected to be one less than the number of centerline points
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigAccWellFlowCalculator::RigAccWellFlowCalculator(
|
||||
const std::vector<std::vector<cvf::Vec3d>>& pipeBranchesCLCoords,
|
||||
const std::vector<std::vector<RigWellResultPoint>>& pipeBranchesWellResultPoints,
|
||||
const std::map<QString, const std::vector<double>*>& tracerCellFractionValues,
|
||||
const RigEclCellIndexCalculator& cellIndexCalculator,
|
||||
double smallContribThreshold,
|
||||
bool isProducer )
|
||||
RigAccWellFlowCalculator::RigAccWellFlowCalculator( const std::vector<std::vector<cvf::Vec3d>>& pipeBranchesCLCoords,
|
||||
const std::vector<std::vector<RigWellResultPoint>>& pipeBranchesWellResultPoints,
|
||||
const std::map<QString, const std::vector<double>*>& tracerCellFractionValues,
|
||||
const RigEclCellIndexCalculator& cellIndexCalculator,
|
||||
double smallContribThreshold,
|
||||
bool isProducer )
|
||||
: m_pipeBranchesCLCoords( pipeBranchesCLCoords )
|
||||
, m_pipeBranchesWellResultPoints( pipeBranchesWellResultPoints )
|
||||
, m_tracerCellFractionValues( &tracerCellFractionValues )
|
||||
@@ -85,9 +84,9 @@ RigAccWellFlowCalculator::RigAccWellFlowCalculator(
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigAccWellFlowCalculator::RigAccWellFlowCalculator( const std::vector<std::vector<cvf::Vec3d>>& pipeBranchesCLCoords,
|
||||
RigAccWellFlowCalculator::RigAccWellFlowCalculator( const std::vector<std::vector<cvf::Vec3d>>& pipeBranchesCLCoords,
|
||||
const std::vector<std::vector<RigWellResultPoint>>& pipeBranchesWellResultPoints,
|
||||
double smallContribThreshold )
|
||||
double smallContribThreshold )
|
||||
: m_pipeBranchesCLCoords( pipeBranchesCLCoords )
|
||||
, m_pipeBranchesWellResultPoints( pipeBranchesWellResultPoints )
|
||||
, m_tracerCellFractionValues( nullptr )
|
||||
@@ -176,8 +175,7 @@ const std::vector<double>& RigAccWellFlowCalculator::connectionNumbersFromTop( s
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<double>& RigAccWellFlowCalculator::accumulatedTracerFlowPrConnection( const QString& tracerName,
|
||||
size_t branchIdx ) const
|
||||
const std::vector<double>& RigAccWellFlowCalculator::accumulatedTracerFlowPrConnection( const QString& tracerName, size_t branchIdx ) const
|
||||
{
|
||||
auto flowPrTracerIt = m_connectionFlowPrBranch[branchIdx].accFlowPrTracer.find( tracerName );
|
||||
if ( flowPrTracerIt != m_connectionFlowPrBranch[branchIdx].accFlowPrTracer.end() )
|
||||
@@ -229,8 +227,7 @@ const std::vector<double>& RigAccWellFlowCalculator::trueVerticalDepth( size_t b
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<double>& RigAccWellFlowCalculator::accumulatedTracerFlowPrPseudoLength( const QString& tracerName,
|
||||
size_t branchIdx ) const
|
||||
const std::vector<double>& RigAccWellFlowCalculator::accumulatedTracerFlowPrPseudoLength( const QString& tracerName, size_t branchIdx ) const
|
||||
{
|
||||
auto flowPrTracerIt = m_pseudoLengthFlowPrBranch[branchIdx].accFlowPrTracer.find( tracerName );
|
||||
if ( flowPrTracerIt != m_pseudoLengthFlowPrBranch[branchIdx].accFlowPrTracer.end() )
|
||||
@@ -248,8 +245,7 @@ const std::vector<double>& RigAccWellFlowCalculator::accumulatedTracerFlowPrPseu
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<double>& RigAccWellFlowCalculator::tracerFlowPrPseudoLength( const QString& tracerName,
|
||||
size_t branchIdx ) const
|
||||
const std::vector<double>& RigAccWellFlowCalculator::tracerFlowPrPseudoLength( const QString& tracerName, size_t branchIdx ) const
|
||||
{
|
||||
auto flowPrTracerIt = m_pseudoLengthFlowPrBranch[branchIdx].flowPrTracer.find( tracerName );
|
||||
if ( flowPrTracerIt != m_pseudoLengthFlowPrBranch[branchIdx].flowPrTracer.end() )
|
||||
@@ -326,8 +322,7 @@ bool RigAccWellFlowCalculator::isWellFlowConsistent() const
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
std::vector<double>
|
||||
RigAccWellFlowCalculator::calculateAccumulatedFractions( const std::vector<double>& accumulatedFlowPrTracer ) const
|
||||
std::vector<double> RigAccWellFlowCalculator::calculateAccumulatedFractions( const std::vector<double>& accumulatedFlowPrTracer ) const
|
||||
{
|
||||
double totalFlow = 0.0;
|
||||
for ( double tracerFlow : accumulatedFlowPrTracer )
|
||||
@@ -441,8 +436,7 @@ void RigAccWellFlowCalculator::calculateAccumulatedFlowPrConnection( size_t bran
|
||||
|
||||
// Add the total accumulated (fraction) flows from any branches connected to this cell
|
||||
|
||||
size_t connNumFromTop = connectionIndexFromTop( resPointUniqueIndexFromBottom, clSegIdx ) +
|
||||
startConnectionNumberFromTop;
|
||||
size_t connNumFromTop = connectionIndexFromTop( resPointUniqueIndexFromBottom, clSegIdx ) + startConnectionNumberFromTop;
|
||||
|
||||
std::vector<size_t> downStreamBranchIndices = findDownStreamBranchIdxs( branchCells[clSegIdx] );
|
||||
for ( size_t dsBidx : downStreamBranchIndices )
|
||||
@@ -698,9 +692,8 @@ std::vector<double> RigAccWellFlowCalculator::accumulatedDsBranchFlowPrTracer( c
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Calculate the flow pr tracer. If inconsistent flow, keep the existing fractions constant
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double>
|
||||
RigAccWellFlowCalculator::calculateWellCellFlowPrTracer( const RigWellResultPoint& wellCell,
|
||||
const std::vector<double>& currentAccumulatedFlowPrTracer ) const
|
||||
std::vector<double> RigAccWellFlowCalculator::calculateWellCellFlowPrTracer( const RigWellResultPoint& wellCell,
|
||||
const std::vector<double>& currentAccumulatedFlowPrTracer ) const
|
||||
{
|
||||
std::vector<double> flowPrTracer( m_tracerNames.size(), 0.0 );
|
||||
|
||||
@@ -720,8 +713,8 @@ std::vector<double>
|
||||
{
|
||||
if ( wellCell.isCell() && wellCell.m_isOpen )
|
||||
{
|
||||
size_t resCellIndex = m_cellIndexCalculator.resultCellIndex( wellCell.m_gridIndex, wellCell.m_gridCellIndex );
|
||||
size_t tracerIdx = 0;
|
||||
size_t resCellIndex = m_cellIndexCalculator.resultCellIndex( wellCell.m_gridIndex, wellCell.m_gridCellIndex );
|
||||
size_t tracerIdx = 0;
|
||||
double totalTracerFractionInCell = 0.0;
|
||||
for ( const auto& tracerFractionValsPair : ( *m_tracerCellFractionValues ) )
|
||||
{
|
||||
@@ -765,8 +758,7 @@ std::vector<double>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<size_t>
|
||||
RigAccWellFlowCalculator::wrpToUniqueWrpIndexFromBottom( const std::vector<RigWellResultPoint>& branchCells ) const
|
||||
std::vector<size_t> RigAccWellFlowCalculator::wrpToUniqueWrpIndexFromBottom( const std::vector<RigWellResultPoint>& branchCells ) const
|
||||
{
|
||||
std::vector<size_t> resPointToConnectionIndexFromBottom;
|
||||
resPointToConnectionIndexFromBottom.resize( branchCells.size(), -1 );
|
||||
@@ -783,10 +775,9 @@ std::vector<size_t>
|
||||
|
||||
while ( clSegIdx >= 0 )
|
||||
{
|
||||
if ( branchCells[clSegIdx].isValid() && ( branchCells[clSegIdx].m_gridIndex != prevGridIdx ||
|
||||
branchCells[clSegIdx].m_gridCellIndex != prevGridCellIdx ||
|
||||
branchCells[clSegIdx].m_ertSegmentId != prevErtSegId ||
|
||||
branchCells[clSegIdx].m_ertBranchId != prevErtBranchId ) )
|
||||
if ( branchCells[clSegIdx].isValid() &&
|
||||
( branchCells[clSegIdx].m_gridIndex != prevGridIdx || branchCells[clSegIdx].m_gridCellIndex != prevGridCellIdx ||
|
||||
branchCells[clSegIdx].m_ertSegmentId != prevErtSegId || branchCells[clSegIdx].m_ertBranchId != prevErtBranchId ) )
|
||||
{
|
||||
++connIdxFromBottom;
|
||||
|
||||
@@ -807,8 +798,7 @@ std::vector<size_t>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RigAccWellFlowCalculator::connectionIndexFromTop( const std::vector<size_t>& resPointToConnectionIndexFromBottom,
|
||||
size_t clSegIdx )
|
||||
size_t RigAccWellFlowCalculator::connectionIndexFromTop( const std::vector<size_t>& resPointToConnectionIndexFromBottom, size_t clSegIdx )
|
||||
{
|
||||
return resPointToConnectionIndexFromBottom.front() - resPointToConnectionIndexFromBottom[clSegIdx];
|
||||
}
|
||||
@@ -846,8 +836,7 @@ void RigAccWellFlowCalculator::sortTracers()
|
||||
|
||||
double totalFlow = 0.0;
|
||||
|
||||
if ( mainBranchAccFlow.size() )
|
||||
totalFlow = -fabs( mainBranchAccFlow.back() ); // Based on size in reverse order (biggest to least)
|
||||
if ( mainBranchAccFlow.size() ) totalFlow = -fabs( mainBranchAccFlow.back() ); // Based on size in reverse order (biggest to least)
|
||||
|
||||
sortedTracers.insert( { totalFlow, tracerName } );
|
||||
}
|
||||
|
||||
@@ -104,13 +104,12 @@ private:
|
||||
void sortTracers();
|
||||
void groupSmallContributions();
|
||||
|
||||
void groupSmallTracers( std::map<QString, std::vector<double>>* branchFlowSet,
|
||||
const std::vector<QString>& tracersToGroup );
|
||||
void groupSmallTracers( std::map<QString, std::vector<double>>* branchFlowSet, const std::vector<QString>& tracersToGroup );
|
||||
|
||||
bool isWellFlowConsistent() const;
|
||||
std::vector<double> calculateAccumulatedFractions( const std::vector<double>& accumulatedFlowPrTracer ) const;
|
||||
std::vector<size_t> wrpToUniqueWrpIndexFromBottom( const std::vector<RigWellResultPoint>& branchCells ) const;
|
||||
static size_t connectionIndexFromTop( const std::vector<size_t>& resPointToConnectionIndexFromBottom, size_t clSegIdx );
|
||||
static size_t connectionIndexFromTop( const std::vector<size_t>& resPointToConnectionIndexFromBottom, size_t clSegIdx );
|
||||
std::vector<size_t> findDownStreamBranchIdxs( const RigWellResultPoint& connectionPoint ) const;
|
||||
|
||||
std::vector<std::pair<QString, double>> totalWellFlowPrTracer() const;
|
||||
@@ -145,8 +144,7 @@ private:
|
||||
const std::vector<double>& flowPrTracer );
|
||||
|
||||
std::vector<double> accumulatedDsBranchFlowPrTracer( const BranchFlow& downStreamBranchFlow ) const;
|
||||
void addDownStreamBranchFlow( std::vector<double>* accFlowPrTracer,
|
||||
const std::vector<double>& accBranchFlowPrTracer ) const;
|
||||
void addDownStreamBranchFlow( std::vector<double>* accFlowPrTracer, const std::vector<double>& accBranchFlowPrTracer ) const;
|
||||
|
||||
std::vector<BranchFlow> m_connectionFlowPrBranch;
|
||||
std::vector<BranchFlow> m_pseudoLengthFlowPrBranch;
|
||||
|
||||
@@ -55,8 +55,7 @@ double RigActiveCellsResultAccessor::cellScalar( size_t gridLocalCellIndex ) con
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigActiveCellsResultAccessor::cellFaceScalar( size_t gridLocalCellIndex,
|
||||
cvf::StructGridInterface::FaceType faceId ) const
|
||||
double RigActiveCellsResultAccessor::cellFaceScalar( size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId ) const
|
||||
{
|
||||
return cellScalar( gridLocalCellIndex );
|
||||
}
|
||||
@@ -82,8 +81,7 @@ double RigActiveCellsResultAccessor::cellScalarGlobIdx( size_t reservoirCellInde
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigActiveCellsResultAccessor::cellFaceScalarGlobIdx( size_t globCellIndex,
|
||||
cvf::StructGridInterface::FaceType faceId ) const
|
||||
double RigActiveCellsResultAccessor::cellFaceScalarGlobIdx( size_t globCellIndex, cvf::StructGridInterface::FaceType faceId ) const
|
||||
{
|
||||
return cellScalarGlobIdx( globCellIndex );
|
||||
}
|
||||
|
||||
@@ -26,8 +26,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigAllGridCellsResultAccessor::RigAllGridCellsResultAccessor( const RigGridBase* grid,
|
||||
const std::vector<double>* reservoirResultValues )
|
||||
RigAllGridCellsResultAccessor::RigAllGridCellsResultAccessor( const RigGridBase* grid, const std::vector<double>* reservoirResultValues )
|
||||
: m_grid( grid )
|
||||
, m_reservoirResultValues( reservoirResultValues )
|
||||
{
|
||||
@@ -49,8 +48,7 @@ double RigAllGridCellsResultAccessor::cellScalar( size_t gridLocalCellIndex ) co
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigAllGridCellsResultAccessor::cellFaceScalar( size_t gridLocalCellIndex,
|
||||
cvf::StructGridInterface::FaceType faceId ) const
|
||||
double RigAllGridCellsResultAccessor::cellFaceScalar( size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId ) const
|
||||
{
|
||||
return cellScalar( gridLocalCellIndex );
|
||||
}
|
||||
@@ -70,8 +68,7 @@ double RigAllGridCellsResultAccessor::cellScalarGlobIdx( size_t globCellIndex )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigAllGridCellsResultAccessor::cellFaceScalarGlobIdx( size_t globCellIndex,
|
||||
cvf::StructGridInterface::FaceType faceId ) const
|
||||
double RigAllGridCellsResultAccessor::cellFaceScalarGlobIdx( size_t globCellIndex, cvf::StructGridInterface::FaceType faceId ) const
|
||||
{
|
||||
return cellScalarGlobIdx( globCellIndex );
|
||||
}
|
||||
|
||||
@@ -29,10 +29,7 @@ public:
|
||||
RigAllanDiagramData();
|
||||
~RigAllanDiagramData() override;
|
||||
|
||||
const std::map<std::pair<int, int>, int>& formationCombinationToCategory()
|
||||
{
|
||||
return m_formationCombinationToCategory;
|
||||
}
|
||||
const std::map<std::pair<int, int>, int>& formationCombinationToCategory() { return m_formationCombinationToCategory; }
|
||||
|
||||
std::pair<int, int> formationIndexCombinationFromCategory( int category )
|
||||
{
|
||||
|
||||
@@ -82,15 +82,14 @@ bool RigCaseCellResultCalculator::computeDifference( RigEclipseCaseData*
|
||||
auto gridB_j = baseMainGrid->cellCountJ();
|
||||
auto gridB_k = baseMainGrid->cellCountK();
|
||||
|
||||
RiaLogging::error(
|
||||
QString( "Not able to compute cell value difference between two grids, as the Grid Cell Count is not "
|
||||
"matching: Grid 1 IJK [%1,%2,%3] vs Grid 2 IJK [%4,%5,%6]" )
|
||||
.arg( gridA_i )
|
||||
.arg( gridA_j )
|
||||
.arg( gridA_k )
|
||||
.arg( gridB_i )
|
||||
.arg( gridB_j )
|
||||
.arg( gridB_k ) );
|
||||
RiaLogging::error( QString( "Not able to compute cell value difference between two grids, as the Grid Cell Count is not "
|
||||
"matching: Grid 1 IJK [%1,%2,%3] vs Grid 2 IJK [%4,%5,%6]" )
|
||||
.arg( gridA_i )
|
||||
.arg( gridA_j )
|
||||
.arg( gridA_k )
|
||||
.arg( gridB_i )
|
||||
.arg( gridB_j )
|
||||
.arg( gridB_k ) );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -124,9 +123,8 @@ bool RigCaseCellResultCalculator::computeDifference( RigEclipseCaseData*
|
||||
|
||||
// Initialize difference result with infinity for correct number of time steps and values per time step
|
||||
{
|
||||
const std::vector<std::vector<double>>& srcFrames = sourceCaseResults->cellScalarResults( nativeAddress );
|
||||
std::vector<std::vector<double>>* diffResultFrames =
|
||||
sourceCaseResults->modifiableCellScalarResultTimesteps( address );
|
||||
const std::vector<std::vector<double>>& srcFrames = sourceCaseResults->cellScalarResults( nativeAddress );
|
||||
std::vector<std::vector<double>>* diffResultFrames = sourceCaseResults->modifiableCellScalarResultTimesteps( address );
|
||||
diffResultFrames->resize( srcFrames.size() );
|
||||
for ( size_t fIdx = 0; fIdx < srcFrames.size(); ++fIdx )
|
||||
{
|
||||
@@ -236,9 +234,8 @@ bool RigCaseCellResultCalculator::computeDivideByCellFaceArea( RigMainGrid*
|
||||
|
||||
// Initialize difference result with infinity for correct number of time steps and values per time step
|
||||
{
|
||||
const std::vector<std::vector<double>>& srcFrames = baseCaseResults->cellScalarResults( nativeAddress );
|
||||
std::vector<std::vector<double>>* diffResultFrames =
|
||||
baseCaseResults->modifiableCellScalarResultTimesteps( address );
|
||||
const std::vector<std::vector<double>>& srcFrames = baseCaseResults->cellScalarResults( nativeAddress );
|
||||
std::vector<std::vector<double>>* diffResultFrames = baseCaseResults->modifiableCellScalarResultTimesteps( address );
|
||||
diffResultFrames->resize( srcFrames.size() );
|
||||
for ( size_t fIdx = 0; fIdx < srcFrames.size(); ++fIdx )
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -70,16 +70,16 @@ public:
|
||||
// Access the results data
|
||||
|
||||
const std::vector<std::vector<double>>& cellScalarResults( const RigEclipseResultAddress& resVarAddr ) const;
|
||||
const std::vector<double>& cellScalarResults( const RigEclipseResultAddress& resVarAddr, size_t timeStepIndex ) const;
|
||||
std::vector<std::vector<double>>* modifiableCellScalarResultTimesteps( const RigEclipseResultAddress& resVarAddr );
|
||||
std::vector<double>* modifiableCellScalarResult( const RigEclipseResultAddress& resVarAddr, size_t timeStepIndex );
|
||||
const std::vector<double>& cellScalarResults( const RigEclipseResultAddress& resVarAddr, size_t timeStepIndex ) const;
|
||||
std::vector<std::vector<double>>* modifiableCellScalarResultTimesteps( const RigEclipseResultAddress& resVarAddr );
|
||||
std::vector<double>* modifiableCellScalarResult( const RigEclipseResultAddress& resVarAddr, size_t timeStepIndex );
|
||||
|
||||
bool isUsingGlobalActiveIndex( const RigEclipseResultAddress& resVarAddr ) const;
|
||||
|
||||
static const std::vector<double>* getResultIndexableStaticResult( RigActiveCellInfo* actCellInfo,
|
||||
RigCaseCellResultsData* gridCellResults,
|
||||
QString porvResultName,
|
||||
std::vector<double>& activeCellsResultsTempContainer );
|
||||
std::vector<double>& activeCellsResultsTempContainer );
|
||||
// Statistic values of the results
|
||||
|
||||
void recalculateStatistics( const RigEclipseResultAddress& resVarAddr );
|
||||
@@ -89,15 +89,15 @@ public:
|
||||
void posNegClosestToZero( const RigEclipseResultAddress& resVarAddr, size_t timeStepIndex, double& pos, double& neg );
|
||||
const std::vector<size_t>& cellScalarValuesHistogram( const RigEclipseResultAddress& resVarAddr );
|
||||
const std::vector<size_t>& cellScalarValuesHistogram( const RigEclipseResultAddress& resVarAddr, size_t timeStepIndex );
|
||||
void p10p90CellScalarValues( const RigEclipseResultAddress& resVarAddr, double& p10, double& p90 );
|
||||
void p10p90CellScalarValues( const RigEclipseResultAddress& resVarAddr, double& p10, double& p90 );
|
||||
void p10p90CellScalarValues( const RigEclipseResultAddress& resVarAddr, size_t timeStepIndex, double& p10, double& p90 );
|
||||
void meanCellScalarValues( const RigEclipseResultAddress& resVarAddr, double& meanValue );
|
||||
void meanCellScalarValues( const RigEclipseResultAddress& resVarAddr, size_t timeStepIndex, double& meanValue );
|
||||
const std::vector<int>& uniqueCellScalarValues( const RigEclipseResultAddress& resVarAddr );
|
||||
void sumCellScalarValues( const RigEclipseResultAddress& resVarAddr, double& sumValue );
|
||||
void sumCellScalarValues( const RigEclipseResultAddress& resVarAddr, size_t timeStepIndex, double& sumValue );
|
||||
void mobileVolumeWeightedMean( const RigEclipseResultAddress& resVarAddr, double& meanValue );
|
||||
void mobileVolumeWeightedMean( const RigEclipseResultAddress& resVarAddr, size_t timeStepIndex, double& meanValue );
|
||||
void sumCellScalarValues( const RigEclipseResultAddress& resVarAddr, size_t timeStepIndex, double& sumValue );
|
||||
void mobileVolumeWeightedMean( const RigEclipseResultAddress& resVarAddr, double& meanValue );
|
||||
void mobileVolumeWeightedMean( const RigEclipseResultAddress& resVarAddr, size_t timeStepIndex, double& meanValue );
|
||||
|
||||
// Access meta-information about the results
|
||||
|
||||
@@ -112,8 +112,7 @@ public:
|
||||
int reportStepNumber( const RigEclipseResultAddress& resVarAddr, size_t timeStepIndex ) const;
|
||||
|
||||
std::vector<RigEclipseTimeStepInfo> timeStepInfos( const RigEclipseResultAddress& resVarAddr ) const;
|
||||
void setTimeStepInfos( const RigEclipseResultAddress& resVarAddr,
|
||||
const std::vector<RigEclipseTimeStepInfo>& timeStepInfos );
|
||||
void setTimeStepInfos( const RigEclipseResultAddress& resVarAddr, const std::vector<RigEclipseTimeStepInfo>& timeStepInfos );
|
||||
|
||||
void clearScalarResult( RiaDefines::ResultCatType type, const QString& resultName );
|
||||
void clearScalarResult( const RigEclipseResultAddress& resultAddress );
|
||||
@@ -130,8 +129,7 @@ public:
|
||||
|
||||
bool ensureKnownResultLoaded( const RigEclipseResultAddress& resultAddress );
|
||||
|
||||
bool findAndLoadResultByName( const QString& resultName,
|
||||
const std::vector<RiaDefines::ResultCatType>& resultCategorySearchOrder );
|
||||
bool findAndLoadResultByName( const QString& resultName, const std::vector<RiaDefines::ResultCatType>& resultCategorySearchOrder );
|
||||
|
||||
bool hasResultEntry( const RigEclipseResultAddress& resultAddress ) const;
|
||||
bool isResultLoaded( const RigEclipseResultAddress& resultAddress ) const;
|
||||
@@ -161,10 +159,7 @@ private:
|
||||
|
||||
size_t findScalarResultIndexFromAddress( const RigEclipseResultAddress& resVarAddr ) const;
|
||||
|
||||
size_t addStaticScalarResult( RiaDefines::ResultCatType type,
|
||||
const QString& resultName,
|
||||
bool needsToBeStored,
|
||||
size_t resultValueCount );
|
||||
size_t addStaticScalarResult( RiaDefines::ResultCatType type, const QString& resultName, bool needsToBeStored, size_t resultValueCount );
|
||||
|
||||
const std::vector<RigEclipseResultInfo>& infoForEachResultIndex();
|
||||
size_t resultCount() const;
|
||||
@@ -199,8 +194,7 @@ private:
|
||||
|
||||
RigStatisticsDataCache* statistics( const RigEclipseResultAddress& resVarAddr );
|
||||
|
||||
static void
|
||||
computeAllanResults( RigCaseCellResultsData* cellResultsData, RigMainGrid* mainGrid, bool includeInactiveCells );
|
||||
static void computeAllanResults( RigCaseCellResultsData* cellResultsData, RigMainGrid* mainGrid, bool includeInactiveCells );
|
||||
|
||||
private:
|
||||
cvf::ref<RifReaderInterface> m_readerInterface;
|
||||
|
||||
@@ -77,8 +77,7 @@ RigCaseToCaseCellMapper::RigCaseToCaseCellMapper( RigMainGrid* masterEclGrid, Ri
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const int* RigCaseToCaseCellMapper::masterCaseCellIndices( int dependentCaseReservoirCellIndex,
|
||||
int* masterCaseCellIndexCount ) const
|
||||
const int* RigCaseToCaseCellMapper::masterCaseCellIndices( int dependentCaseReservoirCellIndex, int* masterCaseCellIndexCount ) const
|
||||
{
|
||||
int seriesIndex = m_masterCellOrIntervalIndex[dependentCaseReservoirCellIndex];
|
||||
|
||||
@@ -127,9 +126,7 @@ void RigCaseToCaseCellMapper::addMapping( int depCaseCellIdx, int masterCaseMatc
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigCaseToCaseCellMapper::calculateEclToGeomCellMapping( RigMainGrid* masterEclGrid,
|
||||
RigFemPart* dependentFemPart,
|
||||
bool eclipseIsMaster )
|
||||
void RigCaseToCaseCellMapper::calculateEclToGeomCellMapping( RigMainGrid* masterEclGrid, RigFemPart* dependentFemPart, bool eclipseIsMaster )
|
||||
{
|
||||
// Find tolerance
|
||||
|
||||
@@ -171,14 +168,10 @@ void RigCaseToCaseCellMapper::calculateEclToGeomCellMapping( RigMainGrid* master
|
||||
|
||||
RigCaseToCaseCellMapperTools::elementCorners( dependentFemPart, elmIdx, elmCorners );
|
||||
|
||||
RigCaseToCaseCellMapperTools::rotateCellTopologicallyToMatchBaseCell( geoMechConvertedEclCell,
|
||||
isEclFaceNormalsOutwards,
|
||||
elmCorners );
|
||||
RigCaseToCaseCellMapperTools::rotateCellTopologicallyToMatchBaseCell( geoMechConvertedEclCell, isEclFaceNormalsOutwards, elmCorners );
|
||||
|
||||
bool isMatching = RigCaseToCaseCellMapperTools::isEclFemCellsMatching( geoMechConvertedEclCell,
|
||||
elmCorners,
|
||||
xyTolerance,
|
||||
zTolerance );
|
||||
bool isMatching =
|
||||
RigCaseToCaseCellMapperTools::isEclFemCellsMatching( geoMechConvertedEclCell, elmCorners, xyTolerance, zTolerance );
|
||||
|
||||
if ( isMatching )
|
||||
{
|
||||
|
||||
@@ -50,8 +50,8 @@ public:
|
||||
if ( offsetJ > 0 && m_baseJ == m_mainGrid->cellCountJ() - 1 ) return nullptr;
|
||||
if ( offsetK > 0 && m_baseK == m_mainGrid->cellCountK() - 1 ) return nullptr;
|
||||
|
||||
size_t gridLocalCellIndex = m_mainGrid->cellIndexFromIJK( m_baseI + offsetI, m_baseJ + offsetJ, m_baseK + offsetK );
|
||||
const RigCell& cell = m_mainGrid->globalCellArray()[gridLocalCellIndex];
|
||||
size_t gridLocalCellIndex = m_mainGrid->cellIndexFromIJK( m_baseI + offsetI, m_baseJ + offsetJ, m_baseK + offsetK );
|
||||
const RigCell& cell = m_mainGrid->globalCellArray()[gridLocalCellIndex];
|
||||
return &( cell.cornerIndices() );
|
||||
}
|
||||
|
||||
@@ -297,18 +297,14 @@ bool RigCaseToCaseCellMapperTools::elementCorners( const RigFemPart* femPart, in
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RigCaseToCaseCellMapperTools::findMatchingPOSKFaceIdx( const cvf::Vec3d baseCell[8],
|
||||
bool isBaseCellNormalsOutwards,
|
||||
const cvf::Vec3d c2[8] )
|
||||
int RigCaseToCaseCellMapperTools::findMatchingPOSKFaceIdx( const cvf::Vec3d baseCell[8], bool isBaseCellNormalsOutwards, const cvf::Vec3d c2[8] )
|
||||
{
|
||||
int faceNodeCount;
|
||||
const int* posKFace =
|
||||
RigFemTypes::localElmNodeIndicesForFace( HEX8, (int)( cvf::StructGridInterface::POS_K ), &faceNodeCount );
|
||||
const int* posKFace = RigFemTypes::localElmNodeIndicesForFace( HEX8, (int)( cvf::StructGridInterface::POS_K ), &faceNodeCount );
|
||||
|
||||
double sign = isBaseCellNormalsOutwards ? 1.0 : -1.0;
|
||||
|
||||
cvf::Vec3d posKnormal = sign * ( baseCell[posKFace[2]] - baseCell[posKFace[0]] ) ^
|
||||
( baseCell[posKFace[3]] - baseCell[posKFace[1]] );
|
||||
cvf::Vec3d posKnormal = sign * ( baseCell[posKFace[2]] - baseCell[posKFace[0]] ) ^ ( baseCell[posKFace[3]] - baseCell[posKFace[1]] );
|
||||
posKnormal.normalize();
|
||||
|
||||
double minDiff = HUGE_VAL;
|
||||
@@ -333,10 +329,7 @@ int RigCaseToCaseCellMapperTools::findMatchingPOSKFaceIdx( const cvf::Vec3d base
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigCaseToCaseCellMapperTools::isEclFemCellsMatching( const cvf::Vec3d baseCell[8],
|
||||
cvf::Vec3d cell[8],
|
||||
double xyTolerance,
|
||||
double zTolerance )
|
||||
bool RigCaseToCaseCellMapperTools::isEclFemCellsMatching( const cvf::Vec3d baseCell[8], cvf::Vec3d cell[8], double xyTolerance, double zTolerance )
|
||||
{
|
||||
bool isMatching = true;
|
||||
|
||||
@@ -358,8 +351,8 @@ bool RigCaseToCaseCellMapperTools::isEclFemCellsMatching( const cvf::Vec3d baseC
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigCaseToCaseCellMapperTools::rotateCellTopologicallyToMatchBaseCell( const cvf::Vec3d* baseCell,
|
||||
bool baseCellFaceNormalsIsOutwards,
|
||||
cvf::Vec3d* cell )
|
||||
bool baseCellFaceNormalsIsOutwards,
|
||||
cvf::Vec3d* cell )
|
||||
{
|
||||
int femDeepZFaceIdx = findMatchingPOSKFaceIdx( baseCell, baseCellFaceNormalsIsOutwards, cell );
|
||||
|
||||
@@ -377,10 +370,8 @@ void RigCaseToCaseCellMapperTools::rotateCellTopologicallyToMatchBaseCell( const
|
||||
int femShallowZFaceIdx = RigFemTypes::oppositeFace( HEX8, femDeepZFaceIdx );
|
||||
|
||||
int faceNodeCount;
|
||||
const int* localElmNodeIndicesForPOSKFace =
|
||||
RigFemTypes::localElmNodeIndicesForFace( HEX8, femDeepZFaceIdx, &faceNodeCount );
|
||||
const int* localElmNodeIndicesForNEGKFace =
|
||||
RigFemTypes::localElmNodeIndicesForFace( HEX8, femShallowZFaceIdx, &faceNodeCount );
|
||||
const int* localElmNodeIndicesForPOSKFace = RigFemTypes::localElmNodeIndicesForFace( HEX8, femDeepZFaceIdx, &faceNodeCount );
|
||||
const int* localElmNodeIndicesForNEGKFace = RigFemTypes::localElmNodeIndicesForFace( HEX8, femShallowZFaceIdx, &faceNodeCount );
|
||||
|
||||
cell[0] = tmpFemCorners[localElmNodeIndicesForNEGKFace[0]];
|
||||
cell[1] = tmpFemCorners[localElmNodeIndicesForNEGKFace[1]];
|
||||
|
||||
@@ -34,21 +34,15 @@ class RigFemPart;
|
||||
class RigCaseToCaseCellMapperTools
|
||||
{
|
||||
public:
|
||||
static void estimatedFemCellFromEclCell( const RigMainGrid* eclGrid,
|
||||
size_t reservoirCellIndex,
|
||||
cvf::Vec3d estimatedElmCorners[8] );
|
||||
static void rotateCellTopologicallyToMatchBaseCell( const cvf::Vec3d* baseCell,
|
||||
bool baseCellFaceNormalsIsOutwards,
|
||||
cvf::Vec3d* cell );
|
||||
static void estimatedFemCellFromEclCell( const RigMainGrid* eclGrid, size_t reservoirCellIndex, cvf::Vec3d estimatedElmCorners[8] );
|
||||
static void rotateCellTopologicallyToMatchBaseCell( const cvf::Vec3d* baseCell, bool baseCellFaceNormalsIsOutwards, cvf::Vec3d* cell );
|
||||
static cvf::Vec3d calculateCellCenter( cvf::Vec3d elmCorners[8] );
|
||||
static bool elementCorners( const RigFemPart* femPart, int elmIdx, cvf::Vec3d elmCorners[8] );
|
||||
static bool
|
||||
isEclFemCellsMatching( const cvf::Vec3d baseCell[8], cvf::Vec3d cell[8], double xyTolerance, double zTolerance );
|
||||
static bool isEclFemCellsMatching( const cvf::Vec3d baseCell[8], cvf::Vec3d cell[8], double xyTolerance, double zTolerance );
|
||||
|
||||
private:
|
||||
static void rotateQuad( cvf::Vec3d quad[4], int idxToNewStart );
|
||||
static void flipQuadWinding( cvf::Vec3d quad[4] );
|
||||
static int quadVxClosestToXYOfPoint( const cvf::Vec3d point, const cvf::Vec3d quad[4] );
|
||||
static int
|
||||
findMatchingPOSKFaceIdx( const cvf::Vec3d baseCell[8], bool isBaseCellNormalsOutwards, const cvf::Vec3d c2[8] );
|
||||
static int findMatchingPOSKFaceIdx( const cvf::Vec3d baseCell[8], bool isBaseCellNormalsOutwards, const cvf::Vec3d c2[8] );
|
||||
};
|
||||
|
||||
@@ -218,47 +218,43 @@ void RigCaseToCaseRangeFilterMapper::convertRangeFilterEndPoints( const RigRange
|
||||
|
||||
if ( femIsDestination )
|
||||
{
|
||||
rangeFilterMatches[cornerIdx].cellMatchType =
|
||||
findBestFemCellFromEclCell( eclGrid,
|
||||
srcRangeCube[cornerIdx][0],
|
||||
srcRangeCube[cornerIdx][1],
|
||||
srcRangeCube[cornerIdx][2],
|
||||
femPart,
|
||||
&( rangeFilterMatches[cornerIdx].ijk[0] ),
|
||||
&( rangeFilterMatches[cornerIdx].ijk[1] ),
|
||||
&( rangeFilterMatches[cornerIdx].ijk[2] ) );
|
||||
rangeFilterMatches[cornerIdx].cellMatchType = findBestFemCellFromEclCell( eclGrid,
|
||||
srcRangeCube[cornerIdx][0],
|
||||
srcRangeCube[cornerIdx][1],
|
||||
srcRangeCube[cornerIdx][2],
|
||||
femPart,
|
||||
&( rangeFilterMatches[cornerIdx].ijk[0] ),
|
||||
&( rangeFilterMatches[cornerIdx].ijk[1] ),
|
||||
&( rangeFilterMatches[cornerIdx].ijk[2] ) );
|
||||
|
||||
rangeFilterMatches[diagIdx].cellMatchType =
|
||||
findBestFemCellFromEclCell( eclGrid,
|
||||
srcRangeCube[diagIdx][0],
|
||||
srcRangeCube[diagIdx][1],
|
||||
srcRangeCube[diagIdx][2],
|
||||
femPart,
|
||||
&( rangeFilterMatches[diagIdx].ijk[0] ),
|
||||
&( rangeFilterMatches[diagIdx].ijk[1] ),
|
||||
&( rangeFilterMatches[diagIdx].ijk[2] ) );
|
||||
rangeFilterMatches[diagIdx].cellMatchType = findBestFemCellFromEclCell( eclGrid,
|
||||
srcRangeCube[diagIdx][0],
|
||||
srcRangeCube[diagIdx][1],
|
||||
srcRangeCube[diagIdx][2],
|
||||
femPart,
|
||||
&( rangeFilterMatches[diagIdx].ijk[0] ),
|
||||
&( rangeFilterMatches[diagIdx].ijk[1] ),
|
||||
&( rangeFilterMatches[diagIdx].ijk[2] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
rangeFilterMatches[cornerIdx].cellMatchType =
|
||||
findBestEclCellFromFemCell( femPart,
|
||||
srcRangeCube[cornerIdx][0],
|
||||
srcRangeCube[cornerIdx][1],
|
||||
srcRangeCube[cornerIdx][2],
|
||||
eclGrid,
|
||||
&( rangeFilterMatches[cornerIdx].ijk[0] ),
|
||||
&( rangeFilterMatches[cornerIdx].ijk[1] ),
|
||||
&( rangeFilterMatches[cornerIdx].ijk[2] ) );
|
||||
rangeFilterMatches[cornerIdx].cellMatchType = findBestEclCellFromFemCell( femPart,
|
||||
srcRangeCube[cornerIdx][0],
|
||||
srcRangeCube[cornerIdx][1],
|
||||
srcRangeCube[cornerIdx][2],
|
||||
eclGrid,
|
||||
&( rangeFilterMatches[cornerIdx].ijk[0] ),
|
||||
&( rangeFilterMatches[cornerIdx].ijk[1] ),
|
||||
&( rangeFilterMatches[cornerIdx].ijk[2] ) );
|
||||
|
||||
rangeFilterMatches[diagIdx].cellMatchType =
|
||||
findBestEclCellFromFemCell( femPart,
|
||||
srcRangeCube[diagIdx][0],
|
||||
srcRangeCube[diagIdx][1],
|
||||
srcRangeCube[diagIdx][2],
|
||||
eclGrid,
|
||||
&( rangeFilterMatches[diagIdx].ijk[0] ),
|
||||
&( rangeFilterMatches[diagIdx].ijk[1] ),
|
||||
&( rangeFilterMatches[diagIdx].ijk[2] ) );
|
||||
rangeFilterMatches[diagIdx].cellMatchType = findBestEclCellFromFemCell( femPart,
|
||||
srcRangeCube[diagIdx][0],
|
||||
srcRangeCube[diagIdx][1],
|
||||
srcRangeCube[diagIdx][2],
|
||||
eclGrid,
|
||||
&( rangeFilterMatches[diagIdx].ijk[0] ),
|
||||
&( rangeFilterMatches[diagIdx].ijk[1] ),
|
||||
&( rangeFilterMatches[diagIdx].ijk[2] ) );
|
||||
}
|
||||
|
||||
if ( rangeFilterMatches[cornerIdx].cellMatchType == EXACT && rangeFilterMatches[diagIdx].cellMatchType == EXACT )
|
||||
@@ -356,15 +352,14 @@ void RigCaseToCaseRangeFilterMapper::convertRangeFilterEndPoints( const RigRange
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Return 0 for collapsed cell 1 for
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigCaseToCaseRangeFilterMapper::CellMatchType
|
||||
RigCaseToCaseRangeFilterMapper::findBestFemCellFromEclCell( const RigMainGrid* masterEclGrid,
|
||||
size_t ei,
|
||||
size_t ej,
|
||||
size_t ek,
|
||||
const RigFemPart* dependentFemPart,
|
||||
size_t* fi,
|
||||
size_t* fj,
|
||||
size_t* fk )
|
||||
RigCaseToCaseRangeFilterMapper::CellMatchType RigCaseToCaseRangeFilterMapper::findBestFemCellFromEclCell( const RigMainGrid* masterEclGrid,
|
||||
size_t ei,
|
||||
size_t ej,
|
||||
size_t ek,
|
||||
const RigFemPart* dependentFemPart,
|
||||
size_t* fi,
|
||||
size_t* fj,
|
||||
size_t* fk )
|
||||
{
|
||||
// Find tolerance
|
||||
|
||||
@@ -411,14 +406,9 @@ RigCaseToCaseRangeFilterMapper::CellMatchType
|
||||
sqDistToClosestElmCenter = sqDist;
|
||||
}
|
||||
|
||||
RigCaseToCaseCellMapperTools::rotateCellTopologicallyToMatchBaseCell( geoMechConvertedEclCell,
|
||||
isEclFaceNormalsOutwards,
|
||||
elmCorners );
|
||||
RigCaseToCaseCellMapperTools::rotateCellTopologicallyToMatchBaseCell( geoMechConvertedEclCell, isEclFaceNormalsOutwards, elmCorners );
|
||||
|
||||
foundExactMatch = RigCaseToCaseCellMapperTools::isEclFemCellsMatching( geoMechConvertedEclCell,
|
||||
elmCorners,
|
||||
xyTolerance,
|
||||
zTolerance );
|
||||
foundExactMatch = RigCaseToCaseCellMapperTools::isEclFemCellsMatching( geoMechConvertedEclCell, elmCorners, xyTolerance, zTolerance );
|
||||
|
||||
if ( foundExactMatch )
|
||||
{
|
||||
@@ -447,15 +437,14 @@ RigCaseToCaseRangeFilterMapper::CellMatchType
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigCaseToCaseRangeFilterMapper::CellMatchType
|
||||
RigCaseToCaseRangeFilterMapper::findBestEclCellFromFemCell( const RigFemPart* dependentFemPart,
|
||||
size_t fi,
|
||||
size_t fj,
|
||||
size_t fk,
|
||||
const RigMainGrid* masterEclGrid,
|
||||
size_t* ei,
|
||||
size_t* ej,
|
||||
size_t* ek )
|
||||
RigCaseToCaseRangeFilterMapper::CellMatchType RigCaseToCaseRangeFilterMapper::findBestEclCellFromFemCell( const RigFemPart* dependentFemPart,
|
||||
size_t fi,
|
||||
size_t fj,
|
||||
size_t fk,
|
||||
const RigMainGrid* masterEclGrid,
|
||||
size_t* ei,
|
||||
size_t* ej,
|
||||
size_t* ek )
|
||||
{
|
||||
// Find tolerance
|
||||
|
||||
@@ -511,14 +500,9 @@ RigCaseToCaseRangeFilterMapper::CellMatchType
|
||||
rotatedElm[6] = elmCorners[6];
|
||||
rotatedElm[7] = elmCorners[7];
|
||||
|
||||
RigCaseToCaseCellMapperTools::rotateCellTopologicallyToMatchBaseCell( geoMechConvertedEclCell,
|
||||
isEclFaceNormalsOutwards,
|
||||
rotatedElm );
|
||||
RigCaseToCaseCellMapperTools::rotateCellTopologicallyToMatchBaseCell( geoMechConvertedEclCell, isEclFaceNormalsOutwards, rotatedElm );
|
||||
|
||||
foundExactMatch = RigCaseToCaseCellMapperTools::isEclFemCellsMatching( geoMechConvertedEclCell,
|
||||
rotatedElm,
|
||||
xyTolerance,
|
||||
zTolerance );
|
||||
foundExactMatch = RigCaseToCaseCellMapperTools::isEclFemCellsMatching( geoMechConvertedEclCell, rotatedElm, xyTolerance, zTolerance );
|
||||
|
||||
if ( foundExactMatch )
|
||||
{
|
||||
|
||||
@@ -122,8 +122,7 @@ bool RigCell::isLongPyramidCell( double maxHeightFactor, double nodeNearToleranc
|
||||
int face;
|
||||
for ( face = 0; face < 6; ++face )
|
||||
{
|
||||
cvf::StructGridInterface::cellFaceVertexIndices( static_cast<cvf::StructGridInterface::FaceType>( face ),
|
||||
faceVertexIndices );
|
||||
cvf::StructGridInterface::cellFaceVertexIndices( static_cast<cvf::StructGridInterface::FaceType>( face ), faceVertexIndices );
|
||||
int zeroLengthEdgeCount = 0;
|
||||
|
||||
const cvf::Vec3d& c0 = nodes[m_cornerIndices[faceVertexIndices[0]]];
|
||||
@@ -227,14 +226,12 @@ bool RigCell::isLongPyramidCell( double maxHeightFactor, double nodeNearToleranc
|
||||
{
|
||||
double e0SquareLength = ( c1 - c0 ).lengthSquared();
|
||||
double e2SquareLength = ( c3 - c2 ).lengthSquared();
|
||||
if ( e0SquareLength / e2SquareLength > squaredMaxHeightFactor ||
|
||||
e2SquareLength / e0SquareLength > squaredMaxHeightFactor )
|
||||
if ( e0SquareLength / e2SquareLength > squaredMaxHeightFactor || e2SquareLength / e0SquareLength > squaredMaxHeightFactor )
|
||||
{
|
||||
double e1SquareLength = ( c2 - c1 ).lengthSquared();
|
||||
double e3SquareLength = ( c0 - c3 ).lengthSquared();
|
||||
|
||||
if ( e1SquareLength / e3SquareLength > squaredMaxHeightFactor ||
|
||||
e3SquareLength / e1SquareLength > squaredMaxHeightFactor )
|
||||
if ( e1SquareLength / e3SquareLength > squaredMaxHeightFactor || e3SquareLength / e1SquareLength > squaredMaxHeightFactor )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -258,8 +255,7 @@ bool RigCell::isCollapsedCell( double nodeNearTolerance ) const
|
||||
int face;
|
||||
for ( face = 0; face < 6; face += 2 )
|
||||
{
|
||||
cvf::StructGridInterface::cellFaceVertexIndices( static_cast<cvf::StructGridInterface::FaceType>( face ),
|
||||
faceVertexIndices );
|
||||
cvf::StructGridInterface::cellFaceVertexIndices( static_cast<cvf::StructGridInterface::FaceType>( face ), faceVertexIndices );
|
||||
cvf::StructGridInterface::cellFaceVertexIndices( cvf::StructGridInterface::oppositeFace(
|
||||
static_cast<cvf::StructGridInterface::FaceType>( face ) ),
|
||||
oppFaceVertexIndices );
|
||||
@@ -376,8 +372,7 @@ int RigCell::firstIntersectionPoint( const cvf::Ray& ray, cvf::Vec3d* intersecti
|
||||
|
||||
for ( face = 0; face < 6; ++face )
|
||||
{
|
||||
cvf::StructGridInterface::cellFaceVertexIndices( static_cast<cvf::StructGridInterface::FaceType>( face ),
|
||||
faceVertexIndices );
|
||||
cvf::StructGridInterface::cellFaceVertexIndices( static_cast<cvf::StructGridInterface::FaceType>( face ), faceVertexIndices );
|
||||
cvf::Vec3d intersection;
|
||||
cvf::Vec3d faceCenter = this->faceCenter( static_cast<cvf::StructGridInterface::FaceType>( face ) );
|
||||
|
||||
|
||||
@@ -57,10 +57,7 @@ public:
|
||||
size_t parentCellIndex() const { return m_parentCellIndex; }
|
||||
void setParentCellIndex( size_t parentCellIndex ) { m_parentCellIndex = parentCellIndex; }
|
||||
size_t mainGridCellIndex() const { return m_mainGridCellIndex; }
|
||||
void setMainGridCellIndex( size_t mainGridCellContainingThisCell )
|
||||
{
|
||||
m_mainGridCellIndex = mainGridCellContainingThisCell;
|
||||
}
|
||||
void setMainGridCellIndex( size_t mainGridCellContainingThisCell ) { m_mainGridCellIndex = mainGridCellContainingThisCell; }
|
||||
|
||||
size_t coarseningBoxIndex() const { return m_coarseningBoxIndex; }
|
||||
void setCoarseningBoxIndex( size_t coarseningBoxIndex ) { m_coarseningBoxIndex = coarseningBoxIndex; }
|
||||
|
||||
@@ -31,8 +31,7 @@ RigCellEdgeResultAccessor::RigCellEdgeResultAccessor()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigCellEdgeResultAccessor::setDataAccessObjectForFace( cvf::StructGridInterface::FaceType faceId,
|
||||
RigResultAccessor* resultAccessObject )
|
||||
void RigCellEdgeResultAccessor::setDataAccessObjectForFace( cvf::StructGridInterface::FaceType faceId, RigResultAccessor* resultAccessObject )
|
||||
{
|
||||
m_resultAccessObjects[faceId] = resultAccessObject;
|
||||
}
|
||||
|
||||
@@ -32,12 +32,11 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::StructGridInterface::FaceType
|
||||
RigCellFaceGeometryTools::calculateCellFaceOverlap( const RigCell& c1,
|
||||
const RigCell& c2,
|
||||
const RigMainGrid& mainGrid,
|
||||
std::vector<size_t>* connectionPolygon,
|
||||
std::vector<cvf::Vec3d>* connectionIntersections )
|
||||
cvf::StructGridInterface::FaceType RigCellFaceGeometryTools::calculateCellFaceOverlap( const RigCell& c1,
|
||||
const RigCell& c2,
|
||||
const RigMainGrid& mainGrid,
|
||||
std::vector<size_t>* connectionPolygon,
|
||||
std::vector<cvf::Vec3d>* connectionIntersections )
|
||||
{
|
||||
// Try to find the shared face
|
||||
|
||||
@@ -59,12 +58,10 @@ cvf::StructGridInterface::FaceType
|
||||
isPossibleNeighborInDirection[cvf::StructGridInterface::POS_K] = ( ( k1 + 1 ) == k2 );
|
||||
isPossibleNeighborInDirection[cvf::StructGridInterface::NEG_K] = ( ( k2 + 1 ) == k1 );
|
||||
|
||||
hasNeighbourInAnyDirection = isPossibleNeighborInDirection[cvf::StructGridInterface::POS_I] +
|
||||
isPossibleNeighborInDirection[cvf::StructGridInterface::NEG_I] +
|
||||
isPossibleNeighborInDirection[cvf::StructGridInterface::POS_J] +
|
||||
isPossibleNeighborInDirection[cvf::StructGridInterface::NEG_J] +
|
||||
isPossibleNeighborInDirection[cvf::StructGridInterface::POS_K] +
|
||||
isPossibleNeighborInDirection[cvf::StructGridInterface::NEG_K];
|
||||
hasNeighbourInAnyDirection =
|
||||
isPossibleNeighborInDirection[cvf::StructGridInterface::POS_I] + isPossibleNeighborInDirection[cvf::StructGridInterface::NEG_I] +
|
||||
isPossibleNeighborInDirection[cvf::StructGridInterface::POS_J] + isPossibleNeighborInDirection[cvf::StructGridInterface::NEG_J] +
|
||||
isPossibleNeighborInDirection[cvf::StructGridInterface::POS_K] + isPossibleNeighborInDirection[cvf::StructGridInterface::NEG_K];
|
||||
|
||||
// If cell 2 is not adjancent with respect to any of the six ijk directions,
|
||||
// assume that we have no overlapping area.
|
||||
@@ -97,14 +94,13 @@ cvf::StructGridInterface::FaceType
|
||||
c1.faceIndices( ( cvf::StructGridInterface::FaceType )( fIdx ), &face1 );
|
||||
c2.faceIndices( cvf::StructGridInterface::oppositeFace( ( cvf::StructGridInterface::FaceType )( fIdx ) ), &face2 );
|
||||
|
||||
bool foundOverlap =
|
||||
cvf::GeometryTools::calculateOverlapPolygonOfTwoQuads( &polygon,
|
||||
&intersections,
|
||||
(cvf::EdgeIntersectStorage<size_t>*)nullptr,
|
||||
cvf::wrapArrayConst( &mainGrid.nodes() ),
|
||||
face1.data(),
|
||||
face2.data(),
|
||||
1e-6 );
|
||||
bool foundOverlap = cvf::GeometryTools::calculateOverlapPolygonOfTwoQuads( &polygon,
|
||||
&intersections,
|
||||
(cvf::EdgeIntersectStorage<size_t>*)nullptr,
|
||||
cvf::wrapArrayConst( &mainGrid.nodes() ),
|
||||
face1.data(),
|
||||
face2.data(),
|
||||
1e-6 );
|
||||
|
||||
if ( foundOverlap )
|
||||
{
|
||||
@@ -320,8 +316,7 @@ void RigCellFaceGeometryTools::extractConnectionsForFace( const RigFault::FaultF
|
||||
// Test if this pair of cells already has a connection. Check both combinations of cell index ordering to avoid
|
||||
// duplicate NNC geometry for the same pair of cells
|
||||
|
||||
auto candidate = std::make_pair( static_cast<unsigned>( sourceReservoirCellIndex ),
|
||||
static_cast<unsigned>( candidateCellIndex ) );
|
||||
auto candidate = std::make_pair( static_cast<unsigned>( sourceReservoirCellIndex ), static_cast<unsigned>( candidateCellIndex ) );
|
||||
|
||||
if ( nativeCellPairs.count( candidate ) > 0 )
|
||||
{
|
||||
@@ -341,14 +336,13 @@ void RigCellFaceGeometryTools::extractConnectionsForFace( const RigFault::FaultF
|
||||
std::array<size_t, 4> candidateFaceIndices;
|
||||
mainGrid->globalCellArray()[candidateCellIndex].faceIndices( candidateFace, &candidateFaceIndices );
|
||||
|
||||
bool foundOverlap =
|
||||
cvf::GeometryTools::calculateOverlapPolygonOfTwoQuads( &polygon,
|
||||
&intersections,
|
||||
(cvf::EdgeIntersectStorage<size_t>*)nullptr,
|
||||
cvf::wrapArrayConst( &mainGridNodes ),
|
||||
sourceFaceIndices.data(),
|
||||
candidateFaceIndices.data(),
|
||||
1e-6 );
|
||||
bool foundOverlap = cvf::GeometryTools::calculateOverlapPolygonOfTwoQuads( &polygon,
|
||||
&intersections,
|
||||
(cvf::EdgeIntersectStorage<size_t>*)nullptr,
|
||||
cvf::wrapArrayConst( &mainGridNodes ),
|
||||
sourceFaceIndices.data(),
|
||||
candidateFaceIndices.data(),
|
||||
1e-6 );
|
||||
|
||||
if ( foundOverlap )
|
||||
{
|
||||
|
||||
@@ -106,8 +106,7 @@ bool RigCellGeometryTools::estimateHexOverlapWithBoundingBox( const std::array<c
|
||||
if ( uniqueBottomEnd - uniqueBottomPoints.begin() < 3u ) return false;
|
||||
|
||||
cvf::Plane bottomPlane;
|
||||
if ( !bottomPlane.setFromPoints( uniqueBottomPoints[0], uniqueBottomPoints[1], uniqueBottomPoints[2] ) )
|
||||
return false;
|
||||
if ( !bottomPlane.setFromPoints( uniqueBottomPoints[0], uniqueBottomPoints[1], uniqueBottomPoints[2] ) ) return false;
|
||||
|
||||
const cvf::Vec3d& boundingMin = boundingBox.min();
|
||||
const cvf::Vec3d& boundingMax = boundingBox.max();
|
||||
@@ -162,8 +161,8 @@ bool RigCellGeometryTools::estimateHexOverlapWithBoundingBox( const std::array<c
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigCellGeometryTools::createPolygonFromLineSegments( std::list<std::pair<cvf::Vec3d, cvf::Vec3d>>& intersectionLineSegments,
|
||||
std::vector<std::vector<cvf::Vec3d>>& polygons,
|
||||
double tolerance )
|
||||
std::vector<std::vector<cvf::Vec3d>>& polygons,
|
||||
double tolerance )
|
||||
{
|
||||
bool startNewPolygon = true;
|
||||
while ( !intersectionLineSegments.empty() )
|
||||
@@ -382,9 +381,7 @@ double RigCellGeometryTools::polygonLengthInLocalXdirWeightedByArea( const std::
|
||||
{
|
||||
areaVector = cvf::GeometryTools::polygonAreaNormal3D( clippedPolygon );
|
||||
area += areaVector.length();
|
||||
length += ( getLengthOfPolygonAlongLine( line1, clippedPolygon ) +
|
||||
getLengthOfPolygonAlongLine( line2, clippedPolygon ) ) /
|
||||
2;
|
||||
length += ( getLengthOfPolygonAlongLine( line1, clippedPolygon ) + getLengthOfPolygonAlongLine( line2, clippedPolygon ) ) / 2;
|
||||
}
|
||||
areasOfPolygonContributions.push_back( area );
|
||||
lengthOfPolygonContributions.push_back( length );
|
||||
@@ -481,9 +478,8 @@ std::vector<std::vector<cvf::Vec3d>>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<std::vector<cvf::Vec3d>>
|
||||
RigCellGeometryTools::intersectionWithPolygon( const std::vector<cvf::Vec3d>& polygon1,
|
||||
const std::vector<cvf::Vec3d>& polygon2 )
|
||||
std::vector<std::vector<cvf::Vec3d>> RigCellGeometryTools::intersectionWithPolygon( const std::vector<cvf::Vec3d>& polygon1,
|
||||
const std::vector<cvf::Vec3d>& polygon2 )
|
||||
{
|
||||
return intersectionWithPolygons( polygon1, { polygon2 } );
|
||||
}
|
||||
@@ -491,9 +487,8 @@ std::vector<std::vector<cvf::Vec3d>>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<std::vector<cvf::Vec3d>>
|
||||
RigCellGeometryTools::subtractPolygons( const std::vector<cvf::Vec3d>& sourcePolygon,
|
||||
const std::vector<std::vector<cvf::Vec3d>>& polygonsToSubtract )
|
||||
std::vector<std::vector<cvf::Vec3d>> RigCellGeometryTools::subtractPolygons( const std::vector<cvf::Vec3d>& sourcePolygon,
|
||||
const std::vector<std::vector<cvf::Vec3d>>& polygonsToSubtract )
|
||||
{
|
||||
ClipperLib::Clipper clpr;
|
||||
|
||||
@@ -606,7 +601,7 @@ void fillUndefinedZ( ClipperLib::IntPoint& e1bot,
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<std::vector<cvf::Vec3d>> RigCellGeometryTools::clipPolylineByPolygon( const std::vector<cvf::Vec3d>& polyLine,
|
||||
const std::vector<cvf::Vec3d>& polygon,
|
||||
ZInterpolationType interpolType )
|
||||
ZInterpolationType interpolType )
|
||||
{
|
||||
std::vector<std::vector<cvf::Vec3d>> clippedPolyline;
|
||||
|
||||
@@ -665,7 +660,7 @@ std::vector<std::vector<cvf::Vec3d>> RigCellGeometryTools::clipPolylineByPolygon
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::pair<cvf::Vec3d, cvf::Vec3d> RigCellGeometryTools::getLineThroughBoundingBox( const cvf::Vec3d& lineDirection,
|
||||
std::pair<cvf::Vec3d, cvf::Vec3d> RigCellGeometryTools::getLineThroughBoundingBox( const cvf::Vec3d& lineDirection,
|
||||
const cvf::BoundingBox& polygonBBox,
|
||||
const cvf::Vec3d& pointOnLine )
|
||||
{
|
||||
@@ -699,8 +694,7 @@ std::pair<cvf::Vec3d, cvf::Vec3d> RigCellGeometryTools::getLineThroughBoundingBo
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigCellGeometryTools::getLengthOfPolygonAlongLine( const std::pair<cvf::Vec3d, cvf::Vec3d>& line,
|
||||
const std::vector<cvf::Vec3d>& polygon )
|
||||
double RigCellGeometryTools::getLengthOfPolygonAlongLine( const std::pair<cvf::Vec3d, cvf::Vec3d>& line, const std::vector<cvf::Vec3d>& polygon )
|
||||
{
|
||||
cvf::BoundingBox lineBoundingBox;
|
||||
|
||||
@@ -754,9 +748,8 @@ std::vector<cvf::Vec3d> RigCellGeometryTools::unionOfPolygons( const std::vector
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<cvf::Vec3d>
|
||||
RigCellGeometryTools::ajustPolygonToAvoidIntersectionsAtVertex( const std::vector<cvf::Vec3d>& polyLine,
|
||||
const std::vector<cvf::Vec3d>& polygon )
|
||||
std::vector<cvf::Vec3d> RigCellGeometryTools::ajustPolygonToAvoidIntersectionsAtVertex( const std::vector<cvf::Vec3d>& polyLine,
|
||||
const std::vector<cvf::Vec3d>& polygon )
|
||||
{
|
||||
std::vector<cvf::Vec3d> adjustedPolygon;
|
||||
|
||||
@@ -794,11 +787,9 @@ std::vector<cvf::Vec3d>
|
||||
/// <0 for P3 right of the line
|
||||
/// ref. http://geomalgorithms.com/a01-_area.html
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
inline double
|
||||
RigCellGeometryTools::isLeftOfLine2D( const cvf::Vec3d& point1, const cvf::Vec3d& point2, const cvf::Vec3d& point3 )
|
||||
inline double RigCellGeometryTools::isLeftOfLine2D( const cvf::Vec3d& point1, const cvf::Vec3d& point2, const cvf::Vec3d& point3 )
|
||||
{
|
||||
return ( ( point2.x() - point1.x() ) * ( point3.y() - point1.y() ) -
|
||||
( point3.x() - point1.x() ) * ( point2.y() - point1.y() ) );
|
||||
return ( ( point2.x() - point1.x() ) * ( point3.y() - point1.y() ) - ( point3.x() - point1.x() ) * ( point2.y() - point1.y() ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -48,15 +48,13 @@ public:
|
||||
|
||||
static double polygonLengthInLocalXdirWeightedByArea( const std::vector<cvf::Vec3d>& polygon2d );
|
||||
|
||||
static std::vector<std::vector<cvf::Vec3d>>
|
||||
intersectionWithPolygons( const std::vector<cvf::Vec3d>& polygon1,
|
||||
const std::vector<std::vector<cvf::Vec3d>>& polygonToIntersectWith );
|
||||
static std::vector<std::vector<cvf::Vec3d>> intersectionWithPolygons( const std::vector<cvf::Vec3d>& polygon1,
|
||||
const std::vector<std::vector<cvf::Vec3d>>& polygonToIntersectWith );
|
||||
|
||||
static std::vector<std::vector<cvf::Vec3d>> intersectionWithPolygon( const std::vector<cvf::Vec3d>& polygon1,
|
||||
const std::vector<cvf::Vec3d>& polygon2 );
|
||||
|
||||
static std::vector<std::vector<cvf::Vec3d>>
|
||||
subtractPolygons( const std::vector<cvf::Vec3d>& sourcePolygon,
|
||||
static std::vector<std::vector<cvf::Vec3d>> subtractPolygons( const std::vector<cvf::Vec3d>& sourcePolygon,
|
||||
const std::vector<std::vector<cvf::Vec3d>>& polygonsToSubtract );
|
||||
static std::vector<std::vector<cvf::Vec3d>> subtractPolygon( const std::vector<cvf::Vec3d>& sourcePolygon,
|
||||
const std::vector<cvf::Vec3d>& polygonToSubtract );
|
||||
@@ -69,14 +67,12 @@ public:
|
||||
};
|
||||
static std::vector<std::vector<cvf::Vec3d>> clipPolylineByPolygon( const std::vector<cvf::Vec3d>& polyLine,
|
||||
const std::vector<cvf::Vec3d>& polygon,
|
||||
ZInterpolationType interpolType = USE_ZERO );
|
||||
ZInterpolationType interpolType = USE_ZERO );
|
||||
|
||||
static std::pair<cvf::Vec3d, cvf::Vec3d> getLineThroughBoundingBox( const cvf::Vec3d& lineDirection,
|
||||
const cvf::BoundingBox& polygonBBox,
|
||||
const cvf::Vec3d& pointOnLine );
|
||||
static std::pair<cvf::Vec3d, cvf::Vec3d>
|
||||
getLineThroughBoundingBox( const cvf::Vec3d& lineDirection, const cvf::BoundingBox& polygonBBox, const cvf::Vec3d& pointOnLine );
|
||||
|
||||
static double getLengthOfPolygonAlongLine( const std::pair<cvf::Vec3d, cvf::Vec3d>& line,
|
||||
const std::vector<cvf::Vec3d>& polygon );
|
||||
static double getLengthOfPolygonAlongLine( const std::pair<cvf::Vec3d, cvf::Vec3d>& line, const std::vector<cvf::Vec3d>& polygon );
|
||||
|
||||
static std::vector<cvf::Vec3d> unionOfPolygons( const std::vector<std::vector<cvf::Vec3d>>& polygons );
|
||||
|
||||
|
||||
@@ -154,8 +154,7 @@ double RigCombTransResultAccessor::cellScalarGlobIdx( size_t globCellIndex ) con
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigCombTransResultAccessor::cellFaceScalarGlobIdx( size_t globCellIndex,
|
||||
cvf::StructGridInterface::FaceType faceId ) const
|
||||
double RigCombTransResultAccessor::cellFaceScalarGlobIdx( size_t globCellIndex, cvf::StructGridInterface::FaceType faceId ) const
|
||||
{
|
||||
size_t gridLocalCellIndex = m_grid->mainGrid()->cell( globCellIndex ).gridLocalCellIndex();
|
||||
return this->cellFaceScalar( gridLocalCellIndex, faceId );
|
||||
|
||||
@@ -33,9 +33,7 @@ class RigCombTransResultAccessor : public RigResultAccessor
|
||||
public:
|
||||
explicit RigCombTransResultAccessor( const RigGridBase* grid );
|
||||
|
||||
void setTransResultAccessors( RigResultAccessor* xTransAccessor,
|
||||
RigResultAccessor* yTransAccessor,
|
||||
RigResultAccessor* zTransAccessor );
|
||||
void setTransResultAccessors( RigResultAccessor* xTransAccessor, RigResultAccessor* yTransAccessor, RigResultAccessor* zTransAccessor );
|
||||
|
||||
double cellScalar( size_t gridLocalCellIndex ) const override;
|
||||
double cellFaceScalar( size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId ) const override;
|
||||
@@ -43,9 +41,7 @@ public:
|
||||
double cellFaceScalarGlobIdx( size_t globCellIndex, cvf::StructGridInterface::FaceType faceId ) const override;
|
||||
|
||||
private:
|
||||
double neighborCellTran( size_t gridLocalCellIndex,
|
||||
cvf::StructGridInterface::FaceType faceId,
|
||||
const RigResultAccessor* transAccessor ) const;
|
||||
double neighborCellTran( size_t gridLocalCellIndex, cvf::StructGridInterface::FaceType faceId, const RigResultAccessor* transAccessor ) const;
|
||||
|
||||
cvf::ref<RigResultAccessor> m_xTransAccessor;
|
||||
cvf::ref<RigResultAccessor> m_yTransAccessor;
|
||||
|
||||
@@ -60,9 +60,7 @@ std::vector<cvf::Vec3d> RigConvexHull::compute2d( const std::vector<cvf::Vec3d>&
|
||||
std::vector<cvf::Vec3d> RigConvexHull::sortPoints( const std::vector<cvf::Vec3d>& unsorted )
|
||||
{
|
||||
// Returns true if a is left of b
|
||||
auto isLeftOf = []( const cvf::Vec3d& a, const cvf::Vec3d& b ) {
|
||||
return ( a.x() < b.x() || ( a.x() == b.x() && a.y() < b.y() ) );
|
||||
};
|
||||
auto isLeftOf = []( const cvf::Vec3d& a, const cvf::Vec3d& b ) { return ( a.x() < b.x() || ( a.x() == b.x() && a.y() < b.y() ) ); };
|
||||
|
||||
std::vector<cvf::Vec3d> sorted = unsorted;
|
||||
std::sort( sorted.begin(), sorted.end(), isLeftOf );
|
||||
|
||||
@@ -33,5 +33,5 @@ public:
|
||||
|
||||
private:
|
||||
static std::vector<cvf::Vec3d> sortPoints( const std::vector<cvf::Vec3d>& unsorted );
|
||||
static void removePointsWithoutConvexAngle( std::vector<cvf::Vec3d>& points, const cvf::Vec3d& current );
|
||||
static void removePointsWithoutConvexAngle( std::vector<cvf::Vec3d>& points, const cvf::Vec3d& current );
|
||||
};
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigEclipseAllanFaultsStatCalc::RigEclipseAllanFaultsStatCalc( RigNNCData* cellResultsData,
|
||||
const RigEclipseResultAddress& scalarResultIndex )
|
||||
RigEclipseAllanFaultsStatCalc::RigEclipseAllanFaultsStatCalc( RigNNCData* cellResultsData, const RigEclipseResultAddress& scalarResultIndex )
|
||||
: m_caseData( cellResultsData )
|
||||
, m_resultAddress( scalarResultIndex )
|
||||
{
|
||||
@@ -73,8 +72,7 @@ void RigEclipseAllanFaultsStatCalc::valueSumAndSampleCount( size_t timeStepIndex
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseAllanFaultsStatCalc::addDataToHistogramCalculator( size_t timeStepIndex,
|
||||
RigHistogramCalculator& histogramCalculator )
|
||||
void RigEclipseAllanFaultsStatCalc::addDataToHistogramCalculator( size_t timeStepIndex, RigHistogramCalculator& histogramCalculator )
|
||||
{
|
||||
traverseCells( histogramCalculator, timeStepIndex );
|
||||
}
|
||||
|
||||
@@ -487,9 +487,8 @@ bool RigEclipseCaseData::hasSimulationWell( const QString& simWellName ) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<const RigWellPath*> RigEclipseCaseData::simulationWellBranches( const QString& simWellName,
|
||||
bool includeAllCellCenters,
|
||||
bool useAutoDetectionOfBranches ) const
|
||||
std::vector<const RigWellPath*>
|
||||
RigEclipseCaseData::simulationWellBranches( const QString& simWellName, bool includeAllCellCenters, bool useAutoDetectionOfBranches ) const
|
||||
{
|
||||
std::vector<const RigWellPath*> branches;
|
||||
|
||||
@@ -501,8 +500,7 @@ std::vector<const RigWellPath*> RigEclipseCaseData::simulationWellBranches( cons
|
||||
const RigSimWellData* simWellData = findSimWellData( simWellName );
|
||||
if ( !simWellData ) return branches;
|
||||
|
||||
std::tuple<QString, bool, bool> simWellSeachItem =
|
||||
std::make_tuple( simWellName, includeAllCellCenters, useAutoDetectionOfBranches );
|
||||
std::tuple<QString, bool, bool> simWellSeachItem = std::make_tuple( simWellName, includeAllCellCenters, useAutoDetectionOfBranches );
|
||||
|
||||
if ( m_simWellBranchCache.find( simWellSeachItem ) == m_simWellBranchCache.end() )
|
||||
{
|
||||
@@ -523,8 +521,7 @@ std::vector<const RigWellPath*> RigEclipseCaseData::simulationWellBranches( cons
|
||||
{
|
||||
auto wellMdCalculator = RigSimulationWellCoordsAndMD( pipeBranchesCLCoords[brIdx] );
|
||||
|
||||
cvf::ref<RigWellPath> newWellPath =
|
||||
new RigWellPath( wellMdCalculator.wellPathPoints(), wellMdCalculator.measuredDepths() );
|
||||
cvf::ref<RigWellPath> newWellPath = new RigWellPath( wellMdCalculator.wellPathPoints(), wellMdCalculator.measuredDepths() );
|
||||
|
||||
m_simWellBranchCache[simWellSeachItem].push_back( newWellPath.p() );
|
||||
}
|
||||
@@ -541,8 +538,7 @@ std::vector<const RigWellPath*> RigEclipseCaseData::simulationWellBranches( cons
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseCaseData::setVirtualPerforationTransmissibilities(
|
||||
RigVirtualPerforationTransmissibilities* virtualPerforationTransmissibilities )
|
||||
void RigEclipseCaseData::setVirtualPerforationTransmissibilities( RigVirtualPerforationTransmissibilities* virtualPerforationTransmissibilities )
|
||||
{
|
||||
m_virtualPerforationTransmissibilities = virtualPerforationTransmissibilities;
|
||||
}
|
||||
@@ -558,8 +554,7 @@ const RigVirtualPerforationTransmissibilities* RigEclipseCaseData::virtualPerfor
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseCaseData::ensureDeckIsParsedForEquilData( const QString& dataDeckFile,
|
||||
const QString& includeFileAbsolutePathPrefix )
|
||||
void RigEclipseCaseData::ensureDeckIsParsedForEquilData( const QString& dataDeckFile, const QString& includeFileAbsolutePathPrefix )
|
||||
{
|
||||
if ( !m_hasParsedDeckForEquilData )
|
||||
{
|
||||
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
|
||||
RigActiveCellInfo* activeCellInfo( RiaDefines::PorosityModelType porosityModel );
|
||||
const RigActiveCellInfo* activeCellInfo( RiaDefines::PorosityModelType porosityModel ) const;
|
||||
void setActiveCellInfo( RiaDefines::PorosityModelType porosityModel, RigActiveCellInfo* activeCellInfo );
|
||||
void setActiveCellInfo( RiaDefines::PorosityModelType porosityModel, RigActiveCellInfo* activeCellInfo );
|
||||
|
||||
bool hasFractureResults() const;
|
||||
|
||||
@@ -111,16 +111,15 @@ public:
|
||||
std::vector<QString> simulationWellNames() const;
|
||||
bool hasSimulationWell( const QString& simWellName ) const;
|
||||
|
||||
std::vector<const RigWellPath*> simulationWellBranches( const QString& simWellName,
|
||||
bool includeAllCellCenters,
|
||||
bool useAutoDetectionOfBranches ) const;
|
||||
std::vector<const RigWellPath*>
|
||||
simulationWellBranches( const QString& simWellName, bool includeAllCellCenters, bool useAutoDetectionOfBranches ) const;
|
||||
|
||||
void setVirtualPerforationTransmissibilities( RigVirtualPerforationTransmissibilities* virtualPerforationTransmissibilities );
|
||||
void setVirtualPerforationTransmissibilities( RigVirtualPerforationTransmissibilities* virtualPerforationTransmissibilities );
|
||||
const RigVirtualPerforationTransmissibilities* virtualPerforationTransmissibilities() const;
|
||||
|
||||
void clearWellCellsInGridCache() { m_wellCellsInGrid.clear(); }
|
||||
|
||||
void ensureDeckIsParsedForEquilData( const QString& dataDeckFile, const QString& includeFileAbsolutePathPrefix );
|
||||
void ensureDeckIsParsedForEquilData( const QString& dataDeckFile, const QString& includeFileAbsolutePathPrefix );
|
||||
std::vector<RigEquil> equilData() const;
|
||||
void setEquilData( const std::vector<RigEquil>& equilObjects );
|
||||
|
||||
|
||||
@@ -104,15 +104,13 @@ RigEclipseCrossPlotResult RigEclipseCrossPlotDataExtractor::extract( RigEclipseC
|
||||
int xIndex = timeStep >= (int)xValuesForAllSteps.size() ? 0 : timeStep;
|
||||
int yIndex = timeStep >= (int)yValuesForAllSteps.size() ? 0 : timeStep;
|
||||
|
||||
RigActiveCellsResultAccessor xAccessor( mainGrid, &xValuesForAllSteps[xIndex], activeCellInfo );
|
||||
RigActiveCellsResultAccessor yAccessor( mainGrid, &yValuesForAllSteps[yIndex], activeCellInfo );
|
||||
RigActiveCellsResultAccessor xAccessor( mainGrid, &xValuesForAllSteps[xIndex], activeCellInfo );
|
||||
RigActiveCellsResultAccessor yAccessor( mainGrid, &yValuesForAllSteps[yIndex], activeCellInfo );
|
||||
std::unique_ptr<RigActiveCellsResultAccessor> catAccessor;
|
||||
if ( catValuesForAllSteps )
|
||||
{
|
||||
int catIndex = timeStep >= (int)catValuesForAllSteps->size() ? 0 : timeStep;
|
||||
catAccessor.reset( new RigActiveCellsResultAccessor( mainGrid,
|
||||
&( catValuesForAllSteps->at( catIndex ) ),
|
||||
activeCellInfo ) );
|
||||
catAccessor.reset( new RigActiveCellsResultAccessor( mainGrid, &( catValuesForAllSteps->at( catIndex ) ), activeCellInfo ) );
|
||||
}
|
||||
|
||||
for ( size_t globalCellIdx = 0; globalCellIdx < activeCellInfo->reservoirCellCount(); ++globalCellIdx )
|
||||
|
||||
@@ -83,8 +83,7 @@ void RigEclipseMultiPropertyStatCalc::valueSumAndSampleCount( size_t timeStepInd
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseMultiPropertyStatCalc::addDataToHistogramCalculator( size_t timeStepIndex,
|
||||
RigHistogramCalculator& histogramCalculator )
|
||||
void RigEclipseMultiPropertyStatCalc::addDataToHistogramCalculator( size_t timeStepIndex, RigHistogramCalculator& histogramCalculator )
|
||||
{
|
||||
for ( size_t i = 0; i < m_nativeStatisticsCalculators.size(); i++ )
|
||||
{
|
||||
|
||||
@@ -38,8 +38,7 @@ class RigEclipseMultiPropertyStatCalc : public RigStatisticsCalculator
|
||||
public:
|
||||
RigEclipseMultiPropertyStatCalc();
|
||||
void addStatisticsCalculator( RigStatisticsCalculator* statisticsCalculator );
|
||||
void addNativeStatisticsCalculator( RigCaseCellResultsData* cellResultsData,
|
||||
const RigEclipseResultAddress& scalarResultIndices );
|
||||
void addNativeStatisticsCalculator( RigCaseCellResultsData* cellResultsData, const RigEclipseResultAddress& scalarResultIndices );
|
||||
|
||||
void minMaxCellScalarValues( size_t timeStepIndex, double& min, double& max ) override;
|
||||
void posNegClosestToZero( size_t timeStepIndex, double& pos, double& neg ) override;
|
||||
|
||||
@@ -28,8 +28,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigEclipseNativeStatCalc::RigEclipseNativeStatCalc( RigCaseCellResultsData* cellResultsData,
|
||||
const RigEclipseResultAddress& eclipseResultAddress )
|
||||
RigEclipseNativeStatCalc::RigEclipseNativeStatCalc( RigCaseCellResultsData* cellResultsData, const RigEclipseResultAddress& eclipseResultAddress )
|
||||
: m_resultsData( cellResultsData )
|
||||
, m_eclipseResultAddress( eclipseResultAddress )
|
||||
{
|
||||
@@ -122,8 +121,7 @@ void RigEclipseNativeStatCalc::posNegClosestToZero( size_t timeStepIndex, double
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseNativeStatCalc::addDataToHistogramCalculator( size_t timeStepIndex,
|
||||
RigHistogramCalculator& histogramCalculator )
|
||||
void RigEclipseNativeStatCalc::addDataToHistogramCalculator( size_t timeStepIndex, RigHistogramCalculator& histogramCalculator )
|
||||
{
|
||||
traverseCells( histogramCalculator, timeStepIndex );
|
||||
}
|
||||
@@ -162,8 +160,7 @@ size_t RigEclipseNativeStatCalc::timeStepCount()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseNativeStatCalc::mobileVolumeWeightedMean( size_t timeStepIndex, double& mean )
|
||||
{
|
||||
RigEclipseResultAddress mobPorvAddress( RiaDefines::ResultCatType::STATIC_NATIVE,
|
||||
RiaResultNames::mobilePoreVolumeName() );
|
||||
RigEclipseResultAddress mobPorvAddress( RiaDefines::ResultCatType::STATIC_NATIVE, RiaResultNames::mobilePoreVolumeName() );
|
||||
|
||||
// For statistics result cases, the pore volume is not available, as
|
||||
// RigCaseCellResultsData::createPlaceholderResultEntries has not been executed
|
||||
|
||||
@@ -29,9 +29,9 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigEclipseNativeVisibleCellsStatCalc::RigEclipseNativeVisibleCellsStatCalc( RigCaseCellResultsData* cellResultsData,
|
||||
RigEclipseNativeVisibleCellsStatCalc::RigEclipseNativeVisibleCellsStatCalc( RigCaseCellResultsData* cellResultsData,
|
||||
const RigEclipseResultAddress& scalarResultIndex,
|
||||
const cvf::UByteArray* cellVisibilities )
|
||||
const cvf::UByteArray* cellVisibilities )
|
||||
: m_caseData( cellResultsData )
|
||||
, m_resultAddress( scalarResultIndex )
|
||||
, m_cellVisibilities( cellVisibilities )
|
||||
@@ -107,8 +107,7 @@ void RigEclipseNativeVisibleCellsStatCalc::valueSumAndSampleCount( size_t timeSt
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseNativeVisibleCellsStatCalc::addDataToHistogramCalculator( size_t timeStepIndex,
|
||||
RigHistogramCalculator& histogramCalculator )
|
||||
void RigEclipseNativeVisibleCellsStatCalc::addDataToHistogramCalculator( size_t timeStepIndex, RigHistogramCalculator& histogramCalculator )
|
||||
{
|
||||
traverseCells( histogramCalculator, timeStepIndex );
|
||||
}
|
||||
@@ -136,8 +135,7 @@ size_t RigEclipseNativeVisibleCellsStatCalc::timeStepCount()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseNativeVisibleCellsStatCalc::mobileVolumeWeightedMean( size_t timeStepIndex, double& result )
|
||||
{
|
||||
RigEclipseResultAddress mobPorvAddress( RiaDefines::ResultCatType::STATIC_NATIVE,
|
||||
RiaResultNames::mobilePoreVolumeName() );
|
||||
RigEclipseResultAddress mobPorvAddress( RiaDefines::ResultCatType::STATIC_NATIVE, RiaResultNames::mobilePoreVolumeName() );
|
||||
|
||||
// For statistics result cases, the pore volume is not available, as
|
||||
// RigCaseCellResultsData::createPlaceholderResultEntries has not been executed
|
||||
|
||||
@@ -58,8 +58,8 @@ private:
|
||||
if ( !m_caseData->hasResultEntry( m_resultAddress ) ) return;
|
||||
if ( m_caseData->timeStepCount( m_resultAddress ) == 0 ) return;
|
||||
|
||||
size_t clampedTimeStepIndex = std::min( timeStepIndex, m_caseData->timeStepCount( m_resultAddress ) - 1 );
|
||||
const std::vector<double>& values = m_caseData->cellScalarResults( m_resultAddress, clampedTimeStepIndex );
|
||||
size_t clampedTimeStepIndex = std::min( timeStepIndex, m_caseData->timeStepCount( m_resultAddress ) - 1 );
|
||||
const std::vector<double>& values = m_caseData->cellScalarResults( m_resultAddress, clampedTimeStepIndex );
|
||||
|
||||
if ( values.empty() )
|
||||
{
|
||||
|
||||
@@ -115,8 +115,8 @@ public:
|
||||
bool operator==( const RigEclipseResultAddress& other ) const
|
||||
{
|
||||
if ( m_resultCatType != other.m_resultCatType || m_resultName != other.m_resultName ||
|
||||
m_timeLapseBaseFrameIdx != other.m_timeLapseBaseFrameIdx ||
|
||||
m_differenceCaseId != other.m_differenceCaseId || m_divideByCellFaceArea != other.m_divideByCellFaceArea )
|
||||
m_timeLapseBaseFrameIdx != other.m_timeLapseBaseFrameIdx || m_differenceCaseId != other.m_differenceCaseId ||
|
||||
m_divideByCellFaceArea != other.m_divideByCellFaceArea )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -33,10 +33,9 @@ RigEclipseTimeStepInfo::RigEclipseTimeStepInfo( const QDateTime& date, int repor
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RigEclipseTimeStepInfo>
|
||||
RigEclipseTimeStepInfo::createTimeStepInfos( std::vector<QDateTime> dates,
|
||||
std::vector<int> reportNumbers,
|
||||
std::vector<double> daysSinceSimulationStarts )
|
||||
std::vector<RigEclipseTimeStepInfo> RigEclipseTimeStepInfo::createTimeStepInfos( std::vector<QDateTime> dates,
|
||||
std::vector<int> reportNumbers,
|
||||
std::vector<double> daysSinceSimulationStarts )
|
||||
{
|
||||
CVF_ASSERT( dates.size() == reportNumbers.size() );
|
||||
CVF_ASSERT( dates.size() == daysSinceSimulationStarts.size() );
|
||||
|
||||
@@ -35,9 +35,8 @@ class RigEclipseTimeStepInfo
|
||||
public:
|
||||
RigEclipseTimeStepInfo( const QDateTime& date, int reportNumber, double daysSinceSimulationStart );
|
||||
|
||||
static std::vector<RigEclipseTimeStepInfo> createTimeStepInfos( std::vector<QDateTime> dates,
|
||||
std::vector<int> reportNumbers,
|
||||
std::vector<double> daysSinceSimulationStarts );
|
||||
static std::vector<RigEclipseTimeStepInfo>
|
||||
createTimeStepInfos( std::vector<QDateTime> dates, std::vector<int> reportNumbers, std::vector<double> daysSinceSimulationStarts );
|
||||
|
||||
public:
|
||||
QDateTime m_date;
|
||||
|
||||
@@ -136,10 +136,7 @@ void RigEclipseWellLogExtractor::calculateIntersection()
|
||||
// Mark the first well path point as entering the cell
|
||||
|
||||
bool isEntering = true;
|
||||
HexIntersectionInfo info( firstPoint,
|
||||
isEntering,
|
||||
cvf::StructGridInterface::NO_FACE,
|
||||
globalCellIndex );
|
||||
HexIntersectionInfo info( firstPoint, isEntering, cvf::StructGridInterface::NO_FACE, globalCellIndex );
|
||||
RigMDCellIdxEnterLeaveKey enterLeaveKey( m_wellPathGeometry->measuredDepths().front(),
|
||||
globalCellIndex,
|
||||
isEntering,
|
||||
@@ -151,8 +148,8 @@ void RigEclipseWellLogExtractor::calculateIntersection()
|
||||
{
|
||||
// Mark the last well path point as leaving cell
|
||||
|
||||
bool isEntering = false;
|
||||
HexIntersectionInfo info( lastPoint, isEntering, cvf::StructGridInterface::NO_FACE, globalCellIndex );
|
||||
bool isEntering = false;
|
||||
HexIntersectionInfo info( lastPoint, isEntering, cvf::StructGridInterface::NO_FACE, globalCellIndex );
|
||||
RigMDCellIdxEnterLeaveKey enterLeaveKey( m_wellPathGeometry->measuredDepths().back(),
|
||||
globalCellIndex,
|
||||
isEntering,
|
||||
@@ -163,8 +160,7 @@ void RigEclipseWellLogExtractor::calculateIntersection()
|
||||
}
|
||||
else
|
||||
{
|
||||
QString txt =
|
||||
"Detected two points assumed to be in the same cell, but they are in two different cells";
|
||||
QString txt = "Detected two points assumed to be in the same cell, but they are in two different cells";
|
||||
RiaLogging::debug( txt );
|
||||
}
|
||||
}
|
||||
@@ -204,9 +200,7 @@ std::vector<size_t> RigEclipseWellLogExtractor::findCloseCellIndices( const cvf:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Vec3d RigEclipseWellLogExtractor::calculateLengthInCell( size_t cellIndex,
|
||||
const cvf::Vec3d& startPoint,
|
||||
const cvf::Vec3d& endPoint ) const
|
||||
cvf::Vec3d RigEclipseWellLogExtractor::calculateLengthInCell( size_t cellIndex, const cvf::Vec3d& startPoint, const cvf::Vec3d& endPoint ) const
|
||||
{
|
||||
std::array<cvf::Vec3d, 8> hexCorners;
|
||||
m_caseData->mainGrid()->cellCornerVertices( cellIndex, hexCorners.data() );
|
||||
@@ -226,8 +220,7 @@ double RigEclipseWellLogExtractor::computeLengthThreshold() const
|
||||
// If not, the intersection will be considered as non-valid cell edge intersection and discarded
|
||||
// https://github.com/OPM/ResInsight/issues/9244
|
||||
|
||||
auto gridCellResult =
|
||||
const_cast<RigCaseCellResultsData*>( m_caseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL ) );
|
||||
auto gridCellResult = const_cast<RigCaseCellResultsData*>( m_caseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL ) );
|
||||
|
||||
auto resultAdr = RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, "DZ" );
|
||||
if ( gridCellResult && gridCellResult->hasResultEntry( resultAdr ) )
|
||||
|
||||
@@ -46,8 +46,7 @@ public:
|
||||
private:
|
||||
void calculateIntersection();
|
||||
std::vector<size_t> findCloseCellIndices( const cvf::BoundingBox& bb );
|
||||
cvf::Vec3d
|
||||
calculateLengthInCell( size_t cellIndex, const cvf::Vec3d& startPoint, const cvf::Vec3d& endPoint ) const override;
|
||||
cvf::Vec3d calculateLengthInCell( size_t cellIndex, const cvf::Vec3d& startPoint, const cvf::Vec3d& endPoint ) const override;
|
||||
|
||||
double computeLengthThreshold() const;
|
||||
|
||||
|
||||
@@ -148,8 +148,7 @@ const std::vector<double>& RigElasticProperties::getVector( RiaDefines::CurvePro
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::pair<double, bool>
|
||||
RigElasticProperties::getValueForPorosity( RiaDefines::CurveProperty property, double porosity, double scale ) const
|
||||
std::pair<double, bool> RigElasticProperties::getValueForPorosity( RiaDefines::CurveProperty property, double porosity, double scale ) const
|
||||
{
|
||||
const std::vector<double>& unscaledValues = getVector( property );
|
||||
std::vector<double> scaledValues;
|
||||
@@ -159,7 +158,6 @@ std::pair<double, bool>
|
||||
}
|
||||
|
||||
bool isExtrapolated = porosity > porosityMax() || porosity < porosityMin();
|
||||
double value =
|
||||
RiaInterpolationTools::linear( m_porosity, scaledValues, porosity, RiaInterpolationTools::ExtrapolationMode::CLOSEST );
|
||||
double value = RiaInterpolationTools::linear( m_porosity, scaledValues, porosity, RiaInterpolationTools::ExtrapolationMode::CLOSEST );
|
||||
return std::make_pair( value, isExtrapolated );
|
||||
}
|
||||
|
||||
@@ -46,10 +46,9 @@ public:
|
||||
double spurtLoss,
|
||||
double immobileFluidSaturation );
|
||||
|
||||
size_t numValues() const;
|
||||
double getValue( RiaDefines::CurveProperty property, size_t index, double scale = 1.0 ) const;
|
||||
std::pair<double, bool>
|
||||
getValueForPorosity( RiaDefines::CurveProperty property, double porosity, double scale = 1.0 ) const;
|
||||
size_t numValues() const;
|
||||
double getValue( RiaDefines::CurveProperty property, size_t index, double scale = 1.0 ) const;
|
||||
std::pair<double, bool> getValueForPorosity( RiaDefines::CurveProperty property, double porosity, double scale = 1.0 ) const;
|
||||
|
||||
const std::vector<double>& porosity() const;
|
||||
double porosityMin() const;
|
||||
|
||||
@@ -59,8 +59,8 @@ void caf::AppEnum<RigEnsembleFractureStatisticsCalculator::PropertyType>::setUp(
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigHistogramData RigEnsembleFractureStatisticsCalculator::createStatisticsData( const RimEnsembleFractureStatistics* esf,
|
||||
PropertyType propertyType,
|
||||
int numBins )
|
||||
PropertyType propertyType,
|
||||
int numBins )
|
||||
{
|
||||
std::vector<cvf::ref<RigStimPlanFractureDefinition>> fractureDefinitions = esf->readFractureDefinitions();
|
||||
|
||||
@@ -75,10 +75,10 @@ RigHistogramData RigEnsembleFractureStatisticsCalculator::createStatisticsData(
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigHistogramData RigEnsembleFractureStatisticsCalculator::createStatisticsData(
|
||||
const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& fractureDefinitions,
|
||||
PropertyType propertyType,
|
||||
int numBins )
|
||||
RigHistogramData
|
||||
RigEnsembleFractureStatisticsCalculator::createStatisticsData( const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& fractureDefinitions,
|
||||
PropertyType propertyType,
|
||||
int numBins )
|
||||
{
|
||||
std::vector<double> samples = calculateProperty( fractureDefinitions, propertyType );
|
||||
|
||||
@@ -87,13 +87,7 @@ RigHistogramData RigEnsembleFractureStatisticsCalculator::createStatisticsData(
|
||||
double sum;
|
||||
double range;
|
||||
double dev;
|
||||
RigStatisticsMath::calculateBasicStatistics( samples,
|
||||
&histogramData.min,
|
||||
&histogramData.max,
|
||||
&sum,
|
||||
&range,
|
||||
&histogramData.mean,
|
||||
&dev );
|
||||
RigStatisticsMath::calculateBasicStatistics( samples, &histogramData.min, &histogramData.max, &sum, &range, &histogramData.mean, &dev );
|
||||
|
||||
double p50;
|
||||
double mean;
|
||||
@@ -117,9 +111,9 @@ RigHistogramData RigEnsembleFractureStatisticsCalculator::createStatisticsData(
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RigEnsembleFractureStatisticsCalculator::calculateProperty(
|
||||
const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& fractureDefinitions,
|
||||
PropertyType propertyType )
|
||||
std::vector<double>
|
||||
RigEnsembleFractureStatisticsCalculator::calculateProperty( const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& fractureDefinitions,
|
||||
PropertyType propertyType )
|
||||
{
|
||||
std::vector<double> samples;
|
||||
if ( propertyType == PropertyType::HEIGHT )
|
||||
@@ -132,14 +126,12 @@ std::vector<double> RigEnsembleFractureStatisticsCalculator::calculateProperty(
|
||||
}
|
||||
else if ( propertyType == PropertyType::WIDTH )
|
||||
{
|
||||
samples = calculateAreaWeightedStatistics( fractureDefinitions,
|
||||
&RigEnsembleFractureStatisticsCalculator::calculateAreaWeightedWidth );
|
||||
samples = calculateAreaWeightedStatistics( fractureDefinitions, &RigEnsembleFractureStatisticsCalculator::calculateAreaWeightedWidth );
|
||||
}
|
||||
else if ( propertyType == PropertyType::PERMEABILITY )
|
||||
{
|
||||
samples =
|
||||
calculateAreaWeightedStatistics( fractureDefinitions,
|
||||
&RigEnsembleFractureStatisticsCalculator::calculateAreaWeightedPermeability );
|
||||
samples = calculateAreaWeightedStatistics( fractureDefinitions,
|
||||
&RigEnsembleFractureStatisticsCalculator::calculateAreaWeightedPermeability );
|
||||
}
|
||||
else if ( propertyType == PropertyType::XF )
|
||||
{
|
||||
@@ -274,8 +266,7 @@ std::vector<double> RigEnsembleFractureStatisticsCalculator::calculateAreaWeight
|
||||
conductivityResultName,
|
||||
RimEnsembleFractureStatistics::MeshAlignmentType::PERFORATION_DEPTH );
|
||||
|
||||
auto [widthResultName, widthResultUnit] =
|
||||
RimStimPlanFractureTemplate::widthParameterNameAndUnit( fractureDefinitions[0] );
|
||||
auto [widthResultName, widthResultUnit] = RimStimPlanFractureTemplate::widthParameterNameAndUnit( fractureDefinitions[0] );
|
||||
std::vector<cvf::cref<RigFractureGrid>> widthGrids =
|
||||
RimEnsembleFractureStatistics::createFractureGrids( fractureDefinitions,
|
||||
RiaDefines::EclipseUnitSystem::UNITS_METRIC,
|
||||
@@ -296,8 +287,8 @@ std::vector<double> RigEnsembleFractureStatisticsCalculator::calculateAreaWeight
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigEnsembleFractureStatisticsCalculator::calculateAreaWeightedWidth( cvf::cref<RigFractureGrid> conductivityGrid,
|
||||
cvf::cref<RigFractureGrid> widthGrid,
|
||||
double RigEnsembleFractureStatisticsCalculator::calculateAreaWeightedWidth( cvf::cref<RigFractureGrid> conductivityGrid,
|
||||
cvf::cref<RigFractureGrid> widthGrid,
|
||||
RiaDefines::EclipseUnitSystem widthUnitSystem,
|
||||
const QString& widthUnit )
|
||||
{
|
||||
@@ -324,10 +315,10 @@ double RigEnsembleFractureStatisticsCalculator::calculateAreaWeightedWidth( cvf:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigEnsembleFractureStatisticsCalculator::calculateAreaWeightedPermeability( cvf::cref<RigFractureGrid> conductivityGrid,
|
||||
cvf::cref<RigFractureGrid> widthGrid,
|
||||
double RigEnsembleFractureStatisticsCalculator::calculateAreaWeightedPermeability( cvf::cref<RigFractureGrid> conductivityGrid,
|
||||
cvf::cref<RigFractureGrid> widthGrid,
|
||||
RiaDefines::EclipseUnitSystem widthUnitSystem,
|
||||
const QString& widthUnit )
|
||||
const QString& widthUnit )
|
||||
{
|
||||
RiaWeightedMeanCalculator<double> calc;
|
||||
const std::vector<RigFractureCell>& conductivityCells = conductivityGrid->fractureCells();
|
||||
@@ -371,8 +362,8 @@ double RigEnsembleFractureStatisticsCalculator::calculateXf( cvf::cref<RigFractu
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RigEnsembleFractureStatisticsCalculator::calculateFormationDip(
|
||||
const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& fractureDefinitions )
|
||||
std::vector<double>
|
||||
RigEnsembleFractureStatisticsCalculator::calculateFormationDip( const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& fractureDefinitions )
|
||||
{
|
||||
std::vector<double> formationDips;
|
||||
for ( auto fractureDefinition : fractureDefinitions )
|
||||
@@ -386,9 +377,7 @@ std::vector<double> RigEnsembleFractureStatisticsCalculator::calculateFormationD
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigEnsembleFractureStatisticsCalculator::convertUnit( double value,
|
||||
RiaDefines::EclipseUnitSystem unitSystem,
|
||||
const QString& unitName )
|
||||
double RigEnsembleFractureStatisticsCalculator::convertUnit( double value, RiaDefines::EclipseUnitSystem unitSystem, const QString& unitName )
|
||||
{
|
||||
if ( unitSystem == RiaDefines::EclipseUnitSystem::UNITS_METRIC )
|
||||
{
|
||||
@@ -408,8 +397,7 @@ std::vector<cvf::ref<RigStimPlanFractureDefinition>> RigEnsembleFractureStatisti
|
||||
const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& fractureDefinitions )
|
||||
{
|
||||
std::vector<double> samples =
|
||||
calculateAreaWeightedStatistics( fractureDefinitions,
|
||||
&RigEnsembleFractureStatisticsCalculator::calculateAreaWeightedWidth );
|
||||
calculateAreaWeightedStatistics( fractureDefinitions, &RigEnsembleFractureStatisticsCalculator::calculateAreaWeightedWidth );
|
||||
|
||||
std::vector<cvf::ref<RigStimPlanFractureDefinition>> filteredFractureDefinitions;
|
||||
|
||||
@@ -446,8 +434,7 @@ std::vector<RigEnsembleFractureStatisticsCalculator::PropertyType> RigEnsembleFr
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::pair<RiaNumberFormat::NumberFormatType, int>
|
||||
RigEnsembleFractureStatisticsCalculator::numberFormatForProperty( PropertyType propertyType )
|
||||
std::pair<RiaNumberFormat::NumberFormatType, int> RigEnsembleFractureStatisticsCalculator::numberFormatForProperty( PropertyType propertyType )
|
||||
{
|
||||
if ( propertyType == PropertyType::WIDTH )
|
||||
return std::make_pair( RiaNumberFormat::NumberFormatType::FIXED, 4 );
|
||||
|
||||
@@ -50,39 +50,31 @@ public:
|
||||
FORMATION_DIP
|
||||
};
|
||||
|
||||
static RigHistogramData
|
||||
createStatisticsData( const RimEnsembleFractureStatistics* esf, PropertyType propertyType, int numBins );
|
||||
static RigHistogramData createStatisticsData( const RimEnsembleFractureStatistics* esf, PropertyType propertyType, int numBins );
|
||||
|
||||
static RigHistogramData
|
||||
createStatisticsData( const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& fractureDefinitions,
|
||||
PropertyType propertyType,
|
||||
int numBins );
|
||||
static RigHistogramData createStatisticsData( const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& fractureDefinitions,
|
||||
PropertyType propertyType,
|
||||
int numBins );
|
||||
|
||||
static std::vector<cvf::ref<RigStimPlanFractureDefinition>>
|
||||
removeZeroWidthDefinitions( const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& fractureDefinitions );
|
||||
|
||||
static std::vector<double>
|
||||
calculateProperty( const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& fractureDefinitions,
|
||||
PropertyType propertyType );
|
||||
static std::vector<double> calculateProperty( const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& fractureDefinitions,
|
||||
PropertyType propertyType );
|
||||
|
||||
static std::vector<RigEnsembleFractureStatisticsCalculator::PropertyType> propertyTypes();
|
||||
|
||||
static std::pair<RiaNumberFormat::NumberFormatType, int> numberFormatForProperty( PropertyType propertyType );
|
||||
|
||||
private:
|
||||
static std::vector<double>
|
||||
calculateGridStatistics( const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& fractureDefinitions,
|
||||
double( func )( cvf::cref<RigFractureGrid> ) );
|
||||
static std::vector<double> calculateGridStatistics( const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& fractureDefinitions,
|
||||
double( func )( cvf::cref<RigFractureGrid> ) );
|
||||
|
||||
static std::vector<double>
|
||||
calculateAreaWeightedStatistics( const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& fractureDefinitions,
|
||||
double( func )( cvf::cref<RigFractureGrid>,
|
||||
cvf::cref<RigFractureGrid>,
|
||||
RiaDefines::EclipseUnitSystem,
|
||||
const QString& ) );
|
||||
static std::vector<double> calculateAreaWeightedStatistics(
|
||||
const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& fractureDefinitions,
|
||||
double( func )( cvf::cref<RigFractureGrid>, cvf::cref<RigFractureGrid>, RiaDefines::EclipseUnitSystem, const QString& ) );
|
||||
|
||||
static std::vector<double>
|
||||
calculateFormationDip( const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& fractureDefinitions );
|
||||
static std::vector<double> calculateFormationDip( const std::vector<cvf::ref<RigStimPlanFractureDefinition>>& fractureDefinitions );
|
||||
|
||||
static double calculateHeight( cvf::cref<RigFractureGrid> fractureGrid );
|
||||
static double calculateArea( cvf::cref<RigFractureGrid> fractureGrid );
|
||||
|
||||
@@ -198,9 +198,7 @@ void RigFault::accumulateFaultsPrCell( RigFaultsPrCellAccumulator* faultsPrCellA
|
||||
// >= 0)
|
||||
|
||||
faultsPrCellAcc->setFaultIdx( ff.m_nativeReservoirCellIndex, ff.m_nativeFace, faultIdx );
|
||||
faultsPrCellAcc->setFaultIdx( ff.m_oppositeReservoirCellIndex,
|
||||
cvf::StructGridInterface::oppositeFace( ff.m_nativeFace ),
|
||||
faultIdx );
|
||||
faultsPrCellAcc->setFaultIdx( ff.m_oppositeReservoirCellIndex, cvf::StructGridInterface::oppositeFace( ff.m_nativeFace ), faultIdx );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -66,9 +66,7 @@ public:
|
||||
|
||||
struct FaultFace
|
||||
{
|
||||
FaultFace( size_t nativeReservoirCellIndex,
|
||||
cvf::StructGridInterface::FaceType nativeFace,
|
||||
size_t oppositeReservoirCellIndex )
|
||||
FaultFace( size_t nativeReservoirCellIndex, cvf::StructGridInterface::FaceType nativeFace, size_t oppositeReservoirCellIndex )
|
||||
: m_nativeReservoirCellIndex( nativeReservoirCellIndex )
|
||||
, m_nativeFace( nativeFace )
|
||||
, m_oppositeReservoirCellIndex( oppositeReservoirCellIndex )
|
||||
|
||||
@@ -42,9 +42,8 @@ std::vector<std::pair<cvf::Vec3d, double>> RigFisbonesGeometry::coordsForLateral
|
||||
|
||||
const auto& subAndLateralIndices = m_fishbonesSub->installedLateralIndices();
|
||||
|
||||
bool found = std::find( subAndLateralIndices.begin(),
|
||||
subAndLateralIndices.end(),
|
||||
std::make_pair( subIndex, lateralIndex ) ) != subAndLateralIndices.end();
|
||||
bool found = std::find( subAndLateralIndices.begin(), subAndLateralIndices.end(), std::make_pair( subIndex, lateralIndex ) ) !=
|
||||
subAndLateralIndices.end();
|
||||
|
||||
CVF_ASSERT( found );
|
||||
|
||||
@@ -103,8 +102,7 @@ void RigFisbonesGeometry::computeLateralPositionAndOrientation( size_t subI
|
||||
double initialRotationAngle = m_fishbonesSub->rotationAngle( subIndex );
|
||||
double lateralOffsetDegrees = 360.0 / m_fishbonesSub->lateralLengths().size();
|
||||
|
||||
double lateralOffsetRadians =
|
||||
cvf::Math::toRadians( initialRotationAngle + lateralOffsetDegrees * lateralIndex );
|
||||
double lateralOffsetRadians = cvf::Math::toRadians( initialRotationAngle + lateralOffsetDegrees * lateralIndex );
|
||||
|
||||
cvf::Mat4d lateralOffsetMatrix = cvf::Mat4d::fromRotation( alongWellPath, lateralOffsetRadians );
|
||||
|
||||
@@ -131,12 +129,11 @@ void RigFisbonesGeometry::computeLateralPositionAndOrientation( size_t subI
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<std::pair<cvf::Vec3d, double>>
|
||||
RigFisbonesGeometry::computeCoordsAlongLateral( double startMeasuredDepth,
|
||||
double lateralLength,
|
||||
const cvf::Vec3d& startCoord,
|
||||
const cvf::Vec3d& startDirection,
|
||||
const cvf::Mat4d& buildAngleMatrix )
|
||||
std::vector<std::pair<cvf::Vec3d, double>> RigFisbonesGeometry::computeCoordsAlongLateral( double startMeasuredDepth,
|
||||
double lateralLength,
|
||||
const cvf::Vec3d& startCoord,
|
||||
const cvf::Vec3d& startDirection,
|
||||
const cvf::Mat4d& buildAngleMatrix )
|
||||
{
|
||||
std::vector<std::pair<cvf::Vec3d, double>> coords;
|
||||
|
||||
|
||||
@@ -88,10 +88,9 @@ inline Opm::FlowDiagnostics::ConnectionValues
|
||||
return flux;
|
||||
}
|
||||
|
||||
inline Opm::FlowDiagnostics::ConnectionValues
|
||||
extractFluxFieldFromRestartFile( const Opm::ECLGraph& G,
|
||||
const Opm::ECLRestartData& rstrt,
|
||||
RigFlowDiagResultAddress::PhaseSelection phaseSelection )
|
||||
inline Opm::FlowDiagnostics::ConnectionValues extractFluxFieldFromRestartFile( const Opm::ECLGraph& G,
|
||||
const Opm::ECLRestartData& rstrt,
|
||||
RigFlowDiagResultAddress::PhaseSelection phaseSelection )
|
||||
{
|
||||
auto getFlux = [&G, &rstrt]( const Opm::ECLPhaseIndex p ) { return G.flux( rstrt, p ); };
|
||||
|
||||
|
||||
@@ -49,9 +49,7 @@ public:
|
||||
|
||||
typedef caf::AppEnum<PhaseSelection> PhaseSelectionEnum;
|
||||
|
||||
RigFlowDiagResultAddress( const std::string& aVariableName,
|
||||
PhaseSelection phaseSelection,
|
||||
const std::set<std::string>& someSelectedTracerNames )
|
||||
RigFlowDiagResultAddress( const std::string& aVariableName, PhaseSelection phaseSelection, const std::set<std::string>& someSelectedTracerNames )
|
||||
: variableName( aVariableName )
|
||||
, selectedTracerNames( someSelectedTracerNames )
|
||||
, phaseSelection( phaseSelection )
|
||||
|
||||
@@ -68,8 +68,7 @@ RigFlowDiagResults::~RigFlowDiagResults()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<double>* RigFlowDiagResults::resultValues( const RigFlowDiagResultAddress& resVarAddr,
|
||||
size_t timeStepIndex )
|
||||
const std::vector<double>* RigFlowDiagResults::resultValues( const RigFlowDiagResultAddress& resVarAddr, size_t timeStepIndex )
|
||||
{
|
||||
CVF_ASSERT( m_timeStepCount != cvf::UNDEFINED_SIZE_T ); // Forgotten to call init
|
||||
|
||||
@@ -91,8 +90,7 @@ const RigActiveCellInfo* RigFlowDiagResults::activeCellInfo( const RigFlowDiagRe
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<double>* RigFlowDiagResults::findOrCalculateResult( const RigFlowDiagResultAddress& resVarAddr,
|
||||
size_t timeStepIndex )
|
||||
const std::vector<double>* RigFlowDiagResults::findOrCalculateResult( const RigFlowDiagResultAddress& resVarAddr, size_t timeStepIndex )
|
||||
{
|
||||
std::vector<double>* frameData = findScalarResultFrame( resVarAddr, timeStepIndex );
|
||||
|
||||
@@ -114,7 +112,7 @@ const std::vector<double>* RigFlowDiagResults::findOrCalculateResult( const RigF
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFlowDiagResults::calculateNativeResultsIfNotPreviouslyAttempted( size_t timeStepIndex,
|
||||
void RigFlowDiagResults::calculateNativeResultsIfNotPreviouslyAttempted( size_t timeStepIndex,
|
||||
RigFlowDiagResultAddress::PhaseSelection phaseSelection )
|
||||
{
|
||||
if ( timeStepIndex >= m_hasAtemptedNativeResults.size() ) return;
|
||||
@@ -138,8 +136,7 @@ void RigFlowDiagResults::calculateNativeResultsIfNotPreviouslyAttempted( size_t
|
||||
nativeResFrames->frameData( timeStepIndex ).swap( resIt.second );
|
||||
}
|
||||
|
||||
m_injProdPairFluxCommunicationTimesteps[timeStepIndex][phaseSelection].swap(
|
||||
nativeTimestepResults.injProdWellPairFluxes() );
|
||||
m_injProdPairFluxCommunicationTimesteps[timeStepIndex][phaseSelection].swap( nativeTimestepResults.injProdWellPairFluxes() );
|
||||
|
||||
m_hasAtemptedNativeResults[timeStepIndex][phaseSelection] = true;
|
||||
}
|
||||
@@ -148,8 +145,7 @@ void RigFlowDiagResults::calculateNativeResultsIfNotPreviouslyAttempted( size_t
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double>* RigFlowDiagResults::findScalarResultFrame( const RigFlowDiagResultAddress& resVarAddr,
|
||||
size_t timeStepIndex )
|
||||
std::vector<double>* RigFlowDiagResults::findScalarResultFrame( const RigFlowDiagResultAddress& resVarAddr, size_t timeStepIndex )
|
||||
{
|
||||
RigFlowDiagResultFrames* resFrames = findScalarResult( resVarAddr );
|
||||
|
||||
@@ -198,8 +194,7 @@ RigFlowDiagResultFrames* RigFlowDiagResults::findScalarResult( const RigFlowDiag
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double>* RigFlowDiagResults::calculateDerivedResult( const RigFlowDiagResultAddress& resVarAddr,
|
||||
size_t timeStepIndex )
|
||||
std::vector<double>* RigFlowDiagResults::calculateDerivedResult( const RigFlowDiagResultAddress& resVarAddr, size_t timeStepIndex )
|
||||
{
|
||||
if ( resVarAddr.isNativeResult() ) return nullptr;
|
||||
|
||||
@@ -231,47 +226,26 @@ std::vector<double>* RigFlowDiagResults::calculateDerivedResult( const RigFlowDi
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double>* RigFlowDiagResults::calculateAverageTOFResult( const RigFlowDiagResultAddress& resVarAddr,
|
||||
size_t timeStepIndex )
|
||||
std::vector<double>* RigFlowDiagResults::calculateAverageTOFResult( const RigFlowDiagResultAddress& resVarAddr, size_t timeStepIndex )
|
||||
{
|
||||
std::vector<const std::vector<double>*> injectorTOFs =
|
||||
findResultsForSelectedTracers( resVarAddr,
|
||||
timeStepIndex,
|
||||
RIG_FLD_TOF_RESNAME,
|
||||
RimFlowDiagSolution::TracerStatusType::INJECTOR );
|
||||
findResultsForSelectedTracers( resVarAddr, timeStepIndex, RIG_FLD_TOF_RESNAME, RimFlowDiagSolution::TracerStatusType::INJECTOR );
|
||||
std::vector<const std::vector<double>*> injectorFractions =
|
||||
findResultsForSelectedTracers( resVarAddr,
|
||||
timeStepIndex,
|
||||
RIG_FLD_CELL_FRACTION_RESNAME,
|
||||
RimFlowDiagSolution::TracerStatusType::INJECTOR );
|
||||
findResultsForSelectedTracers( resVarAddr, timeStepIndex, RIG_FLD_CELL_FRACTION_RESNAME, RimFlowDiagSolution::TracerStatusType::INJECTOR );
|
||||
|
||||
std::vector<const std::vector<double>*> producerTOFs =
|
||||
findResultsForSelectedTracers( resVarAddr,
|
||||
timeStepIndex,
|
||||
RIG_FLD_TOF_RESNAME,
|
||||
RimFlowDiagSolution::TracerStatusType::PRODUCER );
|
||||
findResultsForSelectedTracers( resVarAddr, timeStepIndex, RIG_FLD_TOF_RESNAME, RimFlowDiagSolution::TracerStatusType::PRODUCER );
|
||||
std::vector<const std::vector<double>*> producerFractions =
|
||||
findResultsForSelectedTracers( resVarAddr,
|
||||
timeStepIndex,
|
||||
RIG_FLD_CELL_FRACTION_RESNAME,
|
||||
RimFlowDiagSolution::TracerStatusType::PRODUCER );
|
||||
findResultsForSelectedTracers( resVarAddr, timeStepIndex, RIG_FLD_CELL_FRACTION_RESNAME, RimFlowDiagSolution::TracerStatusType::PRODUCER );
|
||||
size_t activeCellCount = this->activeCellInfo( resVarAddr )->reservoirActiveCellCount();
|
||||
|
||||
std::vector<double> injectorTotalFractions;
|
||||
std::vector<double> injectorFractMultTof;
|
||||
calculateSumOfFractionAndFractionMultTOF( activeCellCount,
|
||||
injectorFractions,
|
||||
injectorTOFs,
|
||||
&injectorTotalFractions,
|
||||
&injectorFractMultTof );
|
||||
calculateSumOfFractionAndFractionMultTOF( activeCellCount, injectorFractions, injectorTOFs, &injectorTotalFractions, &injectorFractMultTof );
|
||||
|
||||
std::vector<double> producerTotalFractions;
|
||||
std::vector<double> producerFractMultTof;
|
||||
calculateSumOfFractionAndFractionMultTOF( activeCellCount,
|
||||
producerFractions,
|
||||
producerTOFs,
|
||||
&producerTotalFractions,
|
||||
&producerFractMultTof );
|
||||
calculateSumOfFractionAndFractionMultTOF( activeCellCount, producerFractions, producerTOFs, &producerTotalFractions, &producerFractMultTof );
|
||||
|
||||
RigFlowDiagResultFrames* averageTofFrames = this->createScalarResult( resVarAddr );
|
||||
std::vector<double>& averageTof = averageTofFrames->frameData( timeStepIndex );
|
||||
@@ -286,10 +260,8 @@ std::vector<double>* RigFlowDiagResults::calculateAverageTOFResult( const RigFlo
|
||||
else
|
||||
{
|
||||
double retVal = 0.0;
|
||||
if ( injectorTotalFractions[acIdx] != 0.0 )
|
||||
retVal += ( 1.0 / injectorTotalFractions[acIdx] ) * injectorFractMultTof[acIdx];
|
||||
if ( producerTotalFractions[acIdx] != 0.0 )
|
||||
retVal += ( 1.0 / producerTotalFractions[acIdx] ) * producerFractMultTof[acIdx];
|
||||
if ( injectorTotalFractions[acIdx] != 0.0 ) retVal += ( 1.0 / injectorTotalFractions[acIdx] ) * injectorFractMultTof[acIdx];
|
||||
if ( producerTotalFractions[acIdx] != 0.0 ) retVal += ( 1.0 / producerTotalFractions[acIdx] ) * producerFractMultTof[acIdx];
|
||||
averageTof[acIdx] = retVal;
|
||||
}
|
||||
}
|
||||
@@ -303,11 +275,11 @@ std::vector<double>* RigFlowDiagResults::calculateAverageTOFResult( const RigFlo
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFlowDiagResults::calculateSumOfFractionAndFractionMultTOF( size_t activeCellCount,
|
||||
void RigFlowDiagResults::calculateSumOfFractionAndFractionMultTOF( size_t activeCellCount,
|
||||
const std::vector<const std::vector<double>*>& fractions,
|
||||
const std::vector<const std::vector<double>*>& TOFs,
|
||||
std::vector<double>* sumOfFractions,
|
||||
std::vector<double>* fractionMultTOF )
|
||||
std::vector<double>* sumOfFractions,
|
||||
std::vector<double>* fractionMultTOF )
|
||||
{
|
||||
sumOfFractions->resize( activeCellCount, 0.0 );
|
||||
fractionMultTOF->resize( activeCellCount, 0.0 );
|
||||
@@ -332,14 +304,12 @@ void RigFlowDiagResults::calculateSumOfFractionAndFractionMultTOF( size_t active
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double>* RigFlowDiagResults::calculateSumOfFractionsResult( const RigFlowDiagResultAddress& resVarAddr,
|
||||
size_t timeStepIndex )
|
||||
std::vector<double>* RigFlowDiagResults::calculateSumOfFractionsResult( const RigFlowDiagResultAddress& resVarAddr, size_t timeStepIndex )
|
||||
{
|
||||
std::vector<const std::vector<double>*> fractions =
|
||||
findResultsForSelectedTracers( resVarAddr,
|
||||
timeStepIndex,
|
||||
RIG_FLD_CELL_FRACTION_RESNAME,
|
||||
RimFlowDiagSolution::TracerStatusType::UNDEFINED );
|
||||
std::vector<const std::vector<double>*> fractions = findResultsForSelectedTracers( resVarAddr,
|
||||
timeStepIndex,
|
||||
RIG_FLD_CELL_FRACTION_RESNAME,
|
||||
RimFlowDiagSolution::TracerStatusType::UNDEFINED );
|
||||
|
||||
RigFlowDiagResultFrames* sumOfFractionsFrames = this->createScalarResult( resVarAddr );
|
||||
std::vector<double>& sumOfFractions = sumOfFractionsFrames->frameData( timeStepIndex );
|
||||
@@ -354,8 +324,7 @@ std::vector<double>* RigFlowDiagResults::calculateSumOfFractionsResult( const Ri
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double>* RigFlowDiagResults::calculateTracerWithMaxFractionResult( const RigFlowDiagResultAddress& resVarAddr,
|
||||
size_t timeStepIndex )
|
||||
std::vector<double>* RigFlowDiagResults::calculateTracerWithMaxFractionResult( const RigFlowDiagResultAddress& resVarAddr, size_t timeStepIndex )
|
||||
{
|
||||
std::vector<std::pair<std::string, const std::vector<double>*>> fractions =
|
||||
findNamedResultsForSelectedTracers( resVarAddr,
|
||||
@@ -419,19 +388,12 @@ std::vector<double>* RigFlowDiagResults::calculateTracerWithMaxFractionResult( c
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double>* RigFlowDiagResults::calculateCommunicationResult( const RigFlowDiagResultAddress& resVarAddr,
|
||||
size_t timeStepIndex )
|
||||
std::vector<double>* RigFlowDiagResults::calculateCommunicationResult( const RigFlowDiagResultAddress& resVarAddr, size_t timeStepIndex )
|
||||
{
|
||||
std::vector<const std::vector<double>*> injectorFractions =
|
||||
findResultsForSelectedTracers( resVarAddr,
|
||||
timeStepIndex,
|
||||
RIG_FLD_CELL_FRACTION_RESNAME,
|
||||
RimFlowDiagSolution::TracerStatusType::INJECTOR );
|
||||
findResultsForSelectedTracers( resVarAddr, timeStepIndex, RIG_FLD_CELL_FRACTION_RESNAME, RimFlowDiagSolution::TracerStatusType::INJECTOR );
|
||||
std::vector<const std::vector<double>*> producerFractions =
|
||||
findResultsForSelectedTracers( resVarAddr,
|
||||
timeStepIndex,
|
||||
RIG_FLD_CELL_FRACTION_RESNAME,
|
||||
RimFlowDiagSolution::TracerStatusType::PRODUCER );
|
||||
findResultsForSelectedTracers( resVarAddr, timeStepIndex, RIG_FLD_CELL_FRACTION_RESNAME, RimFlowDiagSolution::TracerStatusType::PRODUCER );
|
||||
size_t activeCellCount = this->activeCellInfo( resVarAddr )->reservoirActiveCellCount();
|
||||
|
||||
std::vector<double> sumOfInjectorFractions;
|
||||
@@ -481,11 +443,10 @@ void RigFlowDiagResults::calculateNumFloodedPV( const RigFlowDiagResultAddress&
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<const std::vector<double>*>
|
||||
RigFlowDiagResults::findResultsForSelectedTracers( const RigFlowDiagResultAddress& resVarAddr,
|
||||
size_t timeStepIndex,
|
||||
const std::string& nativeResultName,
|
||||
RimFlowDiagSolution::TracerStatusType wantedTracerType )
|
||||
std::vector<const std::vector<double>*> RigFlowDiagResults::findResultsForSelectedTracers( const RigFlowDiagResultAddress& resVarAddr,
|
||||
size_t timeStepIndex,
|
||||
const std::string& nativeResultName,
|
||||
RimFlowDiagSolution::TracerStatusType wantedTracerType )
|
||||
{
|
||||
std::vector<const std::vector<double>*> selectedTracersResults;
|
||||
|
||||
@@ -498,8 +459,7 @@ std::vector<const std::vector<double>*>
|
||||
( tracerType == wantedTracerType || wantedTracerType == RimFlowDiagSolution::TracerStatusType::UNDEFINED ) )
|
||||
{
|
||||
selectedTracersResults.push_back(
|
||||
findOrCalculateResult( RigFlowDiagResultAddress( nativeResultName, resVarAddr.phaseSelection, tracerName ),
|
||||
timeStepIndex ) );
|
||||
findOrCalculateResult( RigFlowDiagResultAddress( nativeResultName, resVarAddr.phaseSelection, tracerName ), timeStepIndex ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -527,9 +487,7 @@ std::vector<std::pair<std::string, const std::vector<double>*>>
|
||||
{
|
||||
selectedTracersResults.push_back(
|
||||
std::make_pair( tracerName,
|
||||
findOrCalculateResult( RigFlowDiagResultAddress( nativeResultName,
|
||||
resVarAddr.phaseSelection,
|
||||
tracerName ),
|
||||
findOrCalculateResult( RigFlowDiagResultAddress( nativeResultName, resVarAddr.phaseSelection, tracerName ),
|
||||
timeStepIndex ) ) );
|
||||
}
|
||||
}
|
||||
@@ -582,10 +540,7 @@ void RigFlowDiagResults::calculateSumOfFractions( const std::vector<const std::v
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFlowDiagResults::minMaxScalarValues( const RigFlowDiagResultAddress& resVarAddr,
|
||||
int timeStepIndex,
|
||||
double* localMin,
|
||||
double* localMax )
|
||||
void RigFlowDiagResults::minMaxScalarValues( const RigFlowDiagResultAddress& resVarAddr, int timeStepIndex, double* localMin, double* localMax )
|
||||
{
|
||||
this->statistics( resVarAddr )->minMaxCellScalarValues( timeStepIndex, *localMin, *localMax );
|
||||
}
|
||||
@@ -648,10 +603,7 @@ void RigFlowDiagResults::p10p90ScalarValues( const RigFlowDiagResultAddress& res
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFlowDiagResults::p10p90ScalarValues( const RigFlowDiagResultAddress& resVarAddr,
|
||||
int timeStepIndex,
|
||||
double* p10,
|
||||
double* p90 )
|
||||
void RigFlowDiagResults::p10p90ScalarValues( const RigFlowDiagResultAddress& resVarAddr, int timeStepIndex, double* p10, double* p90 )
|
||||
{
|
||||
this->statistics( resVarAddr )->p10p90CellScalarValues( timeStepIndex, *p10, *p90 );
|
||||
}
|
||||
@@ -687,8 +639,7 @@ const std::vector<size_t>& RigFlowDiagResults::scalarValuesHistogram( const RigF
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<size_t>& RigFlowDiagResults::scalarValuesHistogram( const RigFlowDiagResultAddress& resVarAddr,
|
||||
int timeStepIndex )
|
||||
const std::vector<size_t>& RigFlowDiagResults::scalarValuesHistogram( const RigFlowDiagResultAddress& resVarAddr, int timeStepIndex )
|
||||
{
|
||||
return this->statistics( resVarAddr )->cellScalarValuesHistogram( timeStepIndex );
|
||||
}
|
||||
@@ -704,8 +655,7 @@ const std::vector<int>& RigFlowDiagResults::uniqueCellScalarValues( const RigFlo
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<int>& RigFlowDiagResults::uniqueCellScalarValues( const RigFlowDiagResultAddress& resVarAddr,
|
||||
int timeStepIndex )
|
||||
const std::vector<int>& RigFlowDiagResults::uniqueCellScalarValues( const RigFlowDiagResultAddress& resVarAddr, int timeStepIndex )
|
||||
{
|
||||
return this->statistics( resVarAddr )->uniqueCellScalarValues( timeStepIndex );
|
||||
}
|
||||
@@ -729,9 +679,8 @@ void RigFlowDiagResults::mobileVolumeWeightedMean( const RigFlowDiagResultAddres
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::pair<double, double> RigFlowDiagResults::injectorProducerPairFluxes( const std::string& injTracername,
|
||||
const std::string& prodTracerName,
|
||||
int timeStepIndex )
|
||||
std::pair<double, double>
|
||||
RigFlowDiagResults::injectorProducerPairFluxes( const std::string& injTracername, const std::string& prodTracerName, int timeStepIndex )
|
||||
{
|
||||
calculateNativeResultsIfNotPreviouslyAttempted( timeStepIndex, RigFlowDiagResultAddress::PHASE_ALL );
|
||||
|
||||
@@ -757,8 +706,7 @@ double RigFlowDiagResults::maxAbsPairFlux( int timeStepIndex )
|
||||
|
||||
if ( (size_t)timeStepIndex < m_injProdPairFluxCommunicationTimesteps.size() )
|
||||
{
|
||||
for ( const auto& commPair :
|
||||
m_injProdPairFluxCommunicationTimesteps[timeStepIndex][RigFlowDiagResultAddress::PHASE_ALL] )
|
||||
for ( const auto& commPair : m_injProdPairFluxCommunicationTimesteps[timeStepIndex][RigFlowDiagResultAddress::PHASE_ALL] )
|
||||
{
|
||||
if ( fabs( commPair.second.first ) > maxFlux ) maxFlux = fabs( commPair.second.first );
|
||||
if ( fabs( commPair.second.second ) > maxFlux ) maxFlux = fabs( commPair.second.second );
|
||||
@@ -789,21 +737,19 @@ std::vector<int> RigFlowDiagResults::calculatedTimeSteps( RigFlowDiagResultAddre
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame
|
||||
RigFlowDiagResults::flowCharacteristicsResults( int timeStepIndex,
|
||||
CellFilter cellSelection,
|
||||
const std::vector<QString>& tracerNames,
|
||||
double max_pv_fraction,
|
||||
double minCommunication,
|
||||
int maxTof )
|
||||
RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame RigFlowDiagResults::flowCharacteristicsResults( int timeStepIndex,
|
||||
CellFilter cellSelection,
|
||||
const std::vector<QString>& tracerNames,
|
||||
double max_pv_fraction,
|
||||
double minCommunication,
|
||||
int maxTof )
|
||||
{
|
||||
std::set<std::string> injectorNames;
|
||||
std::set<std::string> producerNames;
|
||||
|
||||
for ( const QString& tracerName : tracerNames )
|
||||
{
|
||||
RimFlowDiagSolution::TracerStatusType status =
|
||||
m_flowDiagSolution->tracerStatusInTimeStep( tracerName, timeStepIndex );
|
||||
RimFlowDiagSolution::TracerStatusType status = m_flowDiagSolution->tracerStatusInTimeStep( tracerName, timeStepIndex );
|
||||
if ( status == RimFlowDiagSolution::TracerStatusType::INJECTOR )
|
||||
{
|
||||
injectorNames.insert( tracerName.toStdString() );
|
||||
@@ -830,9 +776,7 @@ RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame
|
||||
allTracers.insert( injectorNames.begin(), injectorNames.end() );
|
||||
allTracers.insert( producerNames.begin(), producerNames.end() );
|
||||
|
||||
RigFlowDiagResultAddress communicationAddress( RIG_FLD_COMMUNICATION_RESNAME,
|
||||
RigFlowDiagResultAddress::PHASE_ALL,
|
||||
allTracers );
|
||||
RigFlowDiagResultAddress communicationAddress( RIG_FLD_COMMUNICATION_RESNAME, RigFlowDiagResultAddress::PHASE_ALL, allTracers );
|
||||
const std::vector<double>* communicationResult = resultValues( communicationAddress, timeStepIndex );
|
||||
|
||||
for ( size_t i = 0; i < communicationResult->size(); ++i )
|
||||
@@ -900,19 +844,14 @@ RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame
|
||||
}
|
||||
}
|
||||
|
||||
return solverInterface()->calculateFlowCharacteristics( &injectorResults,
|
||||
&producerResults,
|
||||
selectedCellIndices,
|
||||
max_pv_fraction );
|
||||
return solverInterface()->calculateFlowCharacteristics( &injectorResults, &producerResults, selectedCellIndices, max_pv_fraction );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame
|
||||
RigFlowDiagResults::flowCharacteristicsResults( int timeStepIndex,
|
||||
const std::vector<char>& visibleActiveCells,
|
||||
double max_pv_fraction )
|
||||
RigFlowDiagResults::flowCharacteristicsResults( int timeStepIndex, const std::vector<char>& visibleActiveCells, double max_pv_fraction )
|
||||
{
|
||||
std::vector<QString> tracerNames = m_flowDiagSolution->tracerNames();
|
||||
|
||||
@@ -921,8 +860,7 @@ RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame
|
||||
|
||||
for ( const QString& tracerName : tracerNames )
|
||||
{
|
||||
RimFlowDiagSolution::TracerStatusType status =
|
||||
m_flowDiagSolution->tracerStatusInTimeStep( tracerName, timeStepIndex );
|
||||
RimFlowDiagSolution::TracerStatusType status = m_flowDiagSolution->tracerStatusInTimeStep( tracerName, timeStepIndex );
|
||||
if ( status == RimFlowDiagSolution::TracerStatusType::INJECTOR )
|
||||
{
|
||||
injectorNames.insert( tracerName.toStdString() );
|
||||
@@ -953,10 +891,7 @@ RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame
|
||||
}
|
||||
}
|
||||
|
||||
return solverInterface()->calculateFlowCharacteristics( &injectorResults,
|
||||
&producerResults,
|
||||
selectedCellIndices,
|
||||
max_pv_fraction );
|
||||
return solverInterface()->calculateFlowCharacteristics( &injectorResults, &producerResults, selectedCellIndices, max_pv_fraction );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -65,9 +65,7 @@ public:
|
||||
int timeStepIndex,
|
||||
double* localPosClosestToZero,
|
||||
double* localNegClosestToZero );
|
||||
void posNegClosestToZero( const RigFlowDiagResultAddress& resVarAddr,
|
||||
double* globalPosClosestToZero,
|
||||
double* globalNegClosestToZero );
|
||||
void posNegClosestToZero( const RigFlowDiagResultAddress& resVarAddr, double* globalPosClosestToZero, double* globalNegClosestToZero );
|
||||
void meanScalarValue( const RigFlowDiagResultAddress& resVarAddr, double* meanValue );
|
||||
void meanScalarValue( const RigFlowDiagResultAddress& resVarAddr, int timeStepIndex, double* meanValue );
|
||||
void p10p90ScalarValues( const RigFlowDiagResultAddress& resVarAddr, double* p10, double* p90 );
|
||||
@@ -78,23 +76,21 @@ public:
|
||||
const std::vector<size_t>& scalarValuesHistogram( const RigFlowDiagResultAddress& resVarAddr, int timeStepIndex );
|
||||
const std::vector<int>& uniqueCellScalarValues( const RigFlowDiagResultAddress& resVarAddr );
|
||||
const std::vector<int>& uniqueCellScalarValues( const RigFlowDiagResultAddress& resVarAddr, int timeStepIndex );
|
||||
void mobileVolumeWeightedMean( const RigFlowDiagResultAddress& resVarAddr, int timeStepIndex, double* mean );
|
||||
void mobileVolumeWeightedMean( const RigFlowDiagResultAddress& resVarAddr, double* mean );
|
||||
void mobileVolumeWeightedMean( const RigFlowDiagResultAddress& resVarAddr, int timeStepIndex, double* mean );
|
||||
void mobileVolumeWeightedMean( const RigFlowDiagResultAddress& resVarAddr, double* mean );
|
||||
|
||||
std::pair<double, double> injectorProducerPairFluxes( const std::string& injTracername,
|
||||
const std::string& prodTracerName,
|
||||
int timeStepIndex );
|
||||
double maxAbsPairFlux( int timeStepIndex );
|
||||
std::pair<double, double>
|
||||
injectorProducerPairFluxes( const std::string& injTracername, const std::string& prodTracerName, int timeStepIndex );
|
||||
double maxAbsPairFlux( int timeStepIndex );
|
||||
|
||||
std::vector<int> calculatedTimeSteps( RigFlowDiagResultAddress::PhaseSelection phaseSelection );
|
||||
|
||||
RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame
|
||||
flowCharacteristicsResults( int timeStepIndex,
|
||||
CellFilter cellSelection,
|
||||
const std::vector<QString>& tracerNames,
|
||||
double max_pv_fraction,
|
||||
double minCommunication,
|
||||
int maxTof );
|
||||
RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame flowCharacteristicsResults( int timeStepIndex,
|
||||
CellFilter cellSelection,
|
||||
const std::vector<QString>& tracerNames,
|
||||
double max_pv_fraction,
|
||||
double minCommunication,
|
||||
int maxTof );
|
||||
|
||||
RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame
|
||||
flowCharacteristicsResults( int timeStepIndex, const std::vector<char>& visibleActiveCells, double max_pv_fraction );
|
||||
@@ -105,23 +101,20 @@ public:
|
||||
|
||||
private:
|
||||
const std::vector<double>* findOrCalculateResult( const RigFlowDiagResultAddress& resVarAddr, size_t timeStepIndex );
|
||||
void calculateNativeResultsIfNotPreviouslyAttempted( size_t timeStepIndex,
|
||||
RigFlowDiagResultAddress::PhaseSelection phaseSelection );
|
||||
void calculateNativeResultsIfNotPreviouslyAttempted( size_t timeStepIndex, RigFlowDiagResultAddress::PhaseSelection phaseSelection );
|
||||
|
||||
std::vector<double>* calculateDerivedResult( const RigFlowDiagResultAddress& resVarAddr, size_t timeStepIndex );
|
||||
|
||||
std::vector<double>* calculateAverageTOFResult( const RigFlowDiagResultAddress& resVarAddr, size_t timeStepIndex );
|
||||
std::vector<double>* calculateSumOfFractionsResult( const RigFlowDiagResultAddress& resVarAddr, size_t timeStepIndex );
|
||||
std::vector<double>* calculateTracerWithMaxFractionResult( const RigFlowDiagResultAddress& resVarAddr,
|
||||
size_t timeStepIndex );
|
||||
std::vector<double>* calculateTracerWithMaxFractionResult( const RigFlowDiagResultAddress& resVarAddr, size_t timeStepIndex );
|
||||
std::vector<double>* calculateCommunicationResult( const RigFlowDiagResultAddress& resVarAddr, size_t timeStepIndex );
|
||||
void calculateNumFloodedPV( const RigFlowDiagResultAddress& resVarAddr );
|
||||
|
||||
std::vector<const std::vector<double>*>
|
||||
findResultsForSelectedTracers( const RigFlowDiagResultAddress& resVarAddr,
|
||||
size_t timeStepIndex,
|
||||
const std::string& nativeResultName,
|
||||
RimFlowDiagSolution::TracerStatusType wantedTracerType );
|
||||
std::vector<const std::vector<double>*> findResultsForSelectedTracers( const RigFlowDiagResultAddress& resVarAddr,
|
||||
size_t timeStepIndex,
|
||||
const std::string& nativeResultName,
|
||||
RimFlowDiagSolution::TracerStatusType wantedTracerType );
|
||||
std::vector<std::pair<std::string, const std::vector<double>*>>
|
||||
findNamedResultsForSelectedTracers( const RigFlowDiagResultAddress& resVarAddr,
|
||||
size_t timeStepIndex,
|
||||
@@ -131,8 +124,8 @@ private:
|
||||
void calculateSumOfFractionAndFractionMultTOF( size_t activeCellCount,
|
||||
const std::vector<const std::vector<double>*>& injectorFractions,
|
||||
const std::vector<const std::vector<double>*>& injectorTOFs,
|
||||
std::vector<double>* injectorTotalFractions,
|
||||
std::vector<double>* injectorFractMultTof );
|
||||
std::vector<double>* injectorTotalFractions,
|
||||
std::vector<double>* injectorFractMultTof );
|
||||
|
||||
void calculateSumOfFractions( const std::vector<const std::vector<double>*>& fractions,
|
||||
size_t activeCellCount,
|
||||
|
||||
@@ -115,9 +115,7 @@ void RigFlowDiagTimeStepResult::addResult( const RigFlowDiagResultAddress& resAd
|
||||
class RigOpmFlowDiagStaticData : public cvf::Object
|
||||
{
|
||||
public:
|
||||
RigOpmFlowDiagStaticData( const ecl_grid_type* mainGrid,
|
||||
const std::wstring& init,
|
||||
RiaDefines::EclipseUnitSystem caseUnitSystem )
|
||||
RigOpmFlowDiagStaticData( const ecl_grid_type* mainGrid, const std::wstring& init, RiaDefines::EclipseUnitSystem caseUnitSystem )
|
||||
{
|
||||
Opm::ECLInitFileData initData( init );
|
||||
|
||||
@@ -225,14 +223,13 @@ std::string addCrossFlowEnding( std::string tracerName )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate( size_t timeStepIndex,
|
||||
RigFlowDiagResultAddress::PhaseSelection phaseSelection,
|
||||
std::map<std::string, std::vector<int>> injectorTracers,
|
||||
std::map<std::string, std::vector<int>> producerTracers )
|
||||
std::map<std::string, std::vector<int>> injectorTracers,
|
||||
std::map<std::string, std::vector<int>> producerTracers )
|
||||
{
|
||||
using namespace Opm::FlowDiagnostics;
|
||||
|
||||
RigFlowDiagTimeStepResult result( m_eclipseCase->eclipseCaseData()
|
||||
->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL )
|
||||
->reservoirActiveCellCount() );
|
||||
RigFlowDiagTimeStepResult result(
|
||||
m_eclipseCase->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL )->reservoirActiveCellCount() );
|
||||
|
||||
caf::ProgressInfo progressInfo( 8, "Calculating Flow Diagnostics" );
|
||||
|
||||
@@ -264,11 +261,9 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate( size_t
|
||||
QStringList m_filesWithSameBaseName;
|
||||
|
||||
QString gridFileName = m_eclipseCase->gridFileName();
|
||||
if ( !RifEclipseOutputFileTools::findSiblingFilesWithSameBaseName( gridFileName, &m_filesWithSameBaseName ) )
|
||||
return result;
|
||||
if ( !RifEclipseOutputFileTools::findSiblingFilesWithSameBaseName( gridFileName, &m_filesWithSameBaseName ) ) return result;
|
||||
|
||||
QString firstRestartFileName =
|
||||
RifEclipseOutputFileTools::firstFileNameOfType( m_filesWithSameBaseName, ECL_UNIFIED_RESTART_FILE );
|
||||
QString firstRestartFileName = RifEclipseOutputFileTools::firstFileNameOfType( m_filesWithSameBaseName, ECL_UNIFIED_RESTART_FILE );
|
||||
if ( !firstRestartFileName.isEmpty() )
|
||||
{
|
||||
m_opmFlowDiagStaticData->m_unifiedRestartData.reset(
|
||||
@@ -277,8 +272,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate( size_t
|
||||
}
|
||||
else
|
||||
{
|
||||
QStringList restartFileNames =
|
||||
RifEclipseOutputFileTools::filterFileNamesOfType( m_filesWithSameBaseName, ECL_RESTART_FILE );
|
||||
QStringList restartFileNames = RifEclipseOutputFileTools::filterFileNamesOfType( m_filesWithSameBaseName, ECL_RESTART_FILE );
|
||||
|
||||
size_t restartFileCount = static_cast<size_t>( restartFileNames.size() );
|
||||
size_t maxTimeStepCount =
|
||||
@@ -300,8 +294,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate( size_t
|
||||
|
||||
for ( const auto& restartFileName : restartFileNames )
|
||||
{
|
||||
m_opmFlowDiagStaticData->m_singleRestartDataTimeSteps.push_back(
|
||||
Opm::ECLRestartData( restartFileName.toStdString() ) );
|
||||
m_opmFlowDiagStaticData->m_singleRestartDataTimeSteps.push_back( Opm::ECLRestartData( restartFileName.toStdString() ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -330,9 +323,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate( size_t
|
||||
CVF_ASSERT( currentRestartData );
|
||||
|
||||
RigEclipseResultAddress addrToMaxTimeStepCountResult;
|
||||
m_eclipseCase->eclipseCaseData()
|
||||
->results( RiaDefines::PorosityModelType::MATRIX_MODEL )
|
||||
->maxTimeStepCount( &addrToMaxTimeStepCountResult );
|
||||
m_eclipseCase->eclipseCaseData()->results( RiaDefines::PorosityModelType::MATRIX_MODEL )->maxTimeStepCount( &addrToMaxTimeStepCountResult );
|
||||
|
||||
int reportStepNumber = m_eclipseCase->eclipseCaseData()
|
||||
->results( RiaDefines::PorosityModelType::MATRIX_MODEL )
|
||||
@@ -365,10 +356,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate( size_t
|
||||
{
|
||||
Opm::ECLInitFileData init( getInitFileName() );
|
||||
Opm::FlowDiagnostics::ConnectionValues connectionVals =
|
||||
RigFlowDiagInterfaceTools::calculateFluxField( ( *m_opmFlowDiagStaticData->m_eclGraph ),
|
||||
init,
|
||||
*currentRestartData,
|
||||
phaseSelection );
|
||||
RigFlowDiagInterfaceTools::calculateFluxField( ( *m_opmFlowDiagStaticData->m_eclGraph ), init, *currentRestartData, phaseSelection );
|
||||
m_opmFlowDiagStaticData->m_fldToolbox->assignConnectionFlux( connectionVals );
|
||||
}
|
||||
|
||||
@@ -380,8 +368,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate( size_t
|
||||
|
||||
const std::vector<Opm::ECLWellSolution::WellData> well_fluxes = wsol.solution( *currentRestartData, gridNames );
|
||||
|
||||
WellInFluxPrCell =
|
||||
RigFlowDiagInterfaceTools::extractWellFlows( *( m_opmFlowDiagStaticData->m_eclGraph ), well_fluxes );
|
||||
WellInFluxPrCell = RigFlowDiagInterfaceTools::extractWellFlows( *( m_opmFlowDiagStaticData->m_eclGraph ), well_fluxes );
|
||||
|
||||
m_opmFlowDiagStaticData->m_fldToolbox->assignInflowFlux( WellInFluxPrCell );
|
||||
}
|
||||
@@ -412,8 +399,8 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate( size_t
|
||||
injectorCellSets.push_back( CellSet( CellSetID( tracerName ), tIt.second ) );
|
||||
}
|
||||
|
||||
injectorSolution.reset( new Toolbox::Forward(
|
||||
m_opmFlowDiagStaticData->m_fldToolbox->computeInjectionDiagnostics( injectorCellSets ) ) );
|
||||
injectorSolution.reset(
|
||||
new Toolbox::Forward( m_opmFlowDiagStaticData->m_fldToolbox->computeInjectionDiagnostics( injectorCellSets ) ) );
|
||||
|
||||
for ( const CellSetID& tracerId : injectorSolution->fd.startPoints() )
|
||||
{
|
||||
@@ -446,8 +433,8 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate( size_t
|
||||
prodjCellSets.push_back( CellSet( CellSetID( tracerName ), tIt.second ) );
|
||||
}
|
||||
|
||||
producerSolution.reset( new Toolbox::Reverse(
|
||||
m_opmFlowDiagStaticData->m_fldToolbox->computeProductionDiagnostics( prodjCellSets ) ) );
|
||||
producerSolution.reset(
|
||||
new Toolbox::Reverse( m_opmFlowDiagStaticData->m_fldToolbox->computeProductionDiagnostics( prodjCellSets ) ) );
|
||||
|
||||
for ( const CellSetID& tracerId : producerSolution->fd.startPoints() )
|
||||
{
|
||||
@@ -485,12 +472,9 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate( size_t
|
||||
std::string injTracerName = injCellSet.id().to_string();
|
||||
CellSetID injID( injTracerName );
|
||||
|
||||
std::pair<double, double> fluxPair = injectorProducerPairFlux( *( injectorSolution.get() ),
|
||||
*( producerSolution.get() ),
|
||||
injID,
|
||||
prodID,
|
||||
WellInFluxPrCell );
|
||||
std::string uiInjectorTracerName = injTracerName;
|
||||
std::pair<double, double> fluxPair =
|
||||
injectorProducerPairFlux( *( injectorSolution.get() ), *( producerSolution.get() ), injID, prodID, WellInFluxPrCell );
|
||||
std::string uiInjectorTracerName = injTracerName;
|
||||
|
||||
if ( injectorCrossFlowTracers.count( injTracerName ) )
|
||||
{
|
||||
@@ -538,7 +522,7 @@ bool RigFlowDiagSolverInterface::ensureStaticDataObjectInstanceCreated()
|
||||
}
|
||||
|
||||
RiaDefines::EclipseUnitSystem caseUnitSystem = eclipseCaseData->unitsType();
|
||||
m_opmFlowDiagStaticData = new RigOpmFlowDiagStaticData( mainGrid, initFileName, caseUnitSystem );
|
||||
m_opmFlowDiagStaticData = new RigOpmFlowDiagStaticData( mainGrid, initFileName, caseUnitSystem );
|
||||
|
||||
ecl_grid_free( mainGrid );
|
||||
}
|
||||
@@ -551,8 +535,7 @@ bool RigFlowDiagSolverInterface::ensureStaticDataObjectInstanceCreated()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFlowDiagSolverInterface::assignPhaseCorrecedPORV( RigFlowDiagResultAddress::PhaseSelection phaseSelection,
|
||||
size_t timeStepIdx )
|
||||
void RigFlowDiagSolverInterface::assignPhaseCorrecedPORV( RigFlowDiagResultAddress::PhaseSelection phaseSelection, size_t timeStepIdx )
|
||||
{
|
||||
RigEclipseCaseData* eclipseCaseData = m_eclipseCase->eclipseCaseData();
|
||||
|
||||
@@ -649,8 +632,7 @@ RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame
|
||||
|
||||
try
|
||||
{
|
||||
Graph flowCapStorCapCurve =
|
||||
flowCapacityStorageCapacityCurve( *injector_tof, *producer_tof, poreVolume, max_pv_fraction );
|
||||
Graph flowCapStorCapCurve = flowCapacityStorageCapacityCurve( *injector_tof, *producer_tof, poreVolume, max_pv_fraction );
|
||||
|
||||
result.m_storageCapFlowCapCurve = flowCapStorCapCurve;
|
||||
result.m_lorenzCoefficient = lorenzCoefficient( flowCapStorCapCurve );
|
||||
@@ -667,8 +649,7 @@ RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RigFlowDiagSolverInterface::RelPermCurve>
|
||||
RigFlowDiagSolverInterface::calculateRelPermCurves( size_t activeCellIndex )
|
||||
std::vector<RigFlowDiagSolverInterface::RelPermCurve> RigFlowDiagSolverInterface::calculateRelPermCurves( size_t activeCellIndex )
|
||||
{
|
||||
std::vector<RelPermCurve> retCurveArr;
|
||||
|
||||
@@ -734,9 +715,7 @@ std::vector<RigFlowDiagSolverInterface::RelPermCurve>
|
||||
scaling.enable = static_cast<unsigned char>( 0 );
|
||||
}
|
||||
std::vector<Opm::FlowDiagnostics::Graph> graphArr =
|
||||
m_opmFlowDiagStaticData->m_eclSaturationFunc->getSatFuncCurve( satFuncRequests,
|
||||
static_cast<int>( activeCellIndex ),
|
||||
scaling );
|
||||
m_opmFlowDiagStaticData->m_eclSaturationFunc->getSatFuncCurve( satFuncRequests, static_cast<int>( activeCellIndex ), scaling );
|
||||
for ( size_t i = 0; i < graphArr.size(); i++ )
|
||||
{
|
||||
const RelPermCurve::Ident curveIdent = curveIdentNameArr[i].first;
|
||||
@@ -763,8 +742,7 @@ std::vector<RigFlowDiagSolverInterface::RelPermCurve>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RigFlowDiagSolverInterface::PvtCurve>
|
||||
RigFlowDiagSolverInterface::calculatePvtCurves( PvtCurveType pvtCurveType, int pvtNum )
|
||||
std::vector<RigFlowDiagSolverInterface::PvtCurve> RigFlowDiagSolverInterface::calculatePvtCurves( PvtCurveType pvtCurveType, int pvtNum )
|
||||
{
|
||||
std::vector<PvtCurve> retCurveArr;
|
||||
|
||||
@@ -794,8 +772,7 @@ std::vector<RigFlowDiagSolverInterface::PvtCurve>
|
||||
{
|
||||
if ( srcGraph.press.size() > 0 )
|
||||
{
|
||||
retCurveArr.push_back(
|
||||
{ PvtCurve::Bo, PvtCurve::OIL, srcGraph.press, srcGraph.value, srcGraph.mixRat } );
|
||||
retCurveArr.push_back( { PvtCurve::Bo, PvtCurve::OIL, srcGraph.press, srcGraph.value, srcGraph.mixRat } );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -810,8 +787,7 @@ std::vector<RigFlowDiagSolverInterface::PvtCurve>
|
||||
{
|
||||
if ( srcGraph.press.size() > 0 )
|
||||
{
|
||||
retCurveArr.push_back(
|
||||
{ PvtCurve::Bg, PvtCurve::GAS, srcGraph.press, srcGraph.value, srcGraph.mixRat } );
|
||||
retCurveArr.push_back( { PvtCurve::Bg, PvtCurve::GAS, srcGraph.press, srcGraph.value, srcGraph.mixRat } );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -829,8 +805,7 @@ std::vector<RigFlowDiagSolverInterface::PvtCurve>
|
||||
{
|
||||
if ( srcGraph.press.size() > 0 )
|
||||
{
|
||||
retCurveArr.push_back(
|
||||
{ PvtCurve::Visc_o, PvtCurve::OIL, srcGraph.press, srcGraph.value, srcGraph.mixRat } );
|
||||
retCurveArr.push_back( { PvtCurve::Visc_o, PvtCurve::OIL, srcGraph.press, srcGraph.value, srcGraph.mixRat } );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -845,8 +820,7 @@ std::vector<RigFlowDiagSolverInterface::PvtCurve>
|
||||
{
|
||||
if ( srcGraph.press.size() > 0 )
|
||||
{
|
||||
retCurveArr.push_back(
|
||||
{ PvtCurve::Visc_g, PvtCurve::GAS, srcGraph.press, srcGraph.value, srcGraph.mixRat } );
|
||||
retCurveArr.push_back( { PvtCurve::Visc_g, PvtCurve::GAS, srcGraph.press, srcGraph.value, srcGraph.mixRat } );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -864,12 +838,7 @@ std::vector<RigFlowDiagSolverInterface::PvtCurve>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigFlowDiagSolverInterface::calculatePvtDynamicPropertiesFvf( int pvtNum,
|
||||
double pressure,
|
||||
double rs,
|
||||
double rv,
|
||||
double* bo,
|
||||
double* bg )
|
||||
bool RigFlowDiagSolverInterface::calculatePvtDynamicPropertiesFvf( int pvtNum, double pressure, double rs, double rv, double* bo, double* bg )
|
||||
{
|
||||
if ( bo ) *bo = HUGE_VAL;
|
||||
if ( bg ) *bg = HUGE_VAL;
|
||||
@@ -931,12 +900,7 @@ bool RigFlowDiagSolverInterface::calculatePvtDynamicPropertiesFvf( int pvtNu
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigFlowDiagSolverInterface::calculatePvtDynamicPropertiesViscosity( int pvtNum,
|
||||
double pressure,
|
||||
double rs,
|
||||
double rv,
|
||||
double* mu_o,
|
||||
double* mu_g )
|
||||
bool RigFlowDiagSolverInterface::calculatePvtDynamicPropertiesViscosity( int pvtNum, double pressure, double rs, double rv, double* mu_o, double* mu_g )
|
||||
{
|
||||
if ( mu_o ) *mu_o = HUGE_VAL;
|
||||
if ( mu_g ) *mu_g = HUGE_VAL;
|
||||
@@ -1004,8 +968,7 @@ std::wstring RigFlowDiagSolverInterface::getInitFileName() const
|
||||
|
||||
QStringList m_filesWithSameBaseName;
|
||||
|
||||
if ( !RifEclipseOutputFileTools::findSiblingFilesWithSameBaseName( gridFileName, &m_filesWithSameBaseName ) )
|
||||
return std::wstring();
|
||||
if ( !RifEclipseOutputFileTools::findSiblingFilesWithSameBaseName( gridFileName, &m_filesWithSameBaseName ) ) return std::wstring();
|
||||
|
||||
QString initFileName = RifEclipseOutputFileTools::firstFileNameOfType( m_filesWithSameBaseName, ECL_INIT_FILE );
|
||||
|
||||
|
||||
@@ -47,11 +47,8 @@ public:
|
||||
using Curve = std::pair<std::vector<double>, std::vector<double>>;
|
||||
|
||||
// Used to "steal" the data from this one using swap
|
||||
std::map<RigFlowDiagResultAddress, std::vector<double>>& nativeResults() { return m_nativeResults; }
|
||||
std::map<std::pair<std::string, std::string>, std::pair<double, double>>& injProdWellPairFluxes()
|
||||
{
|
||||
return m_injProdWellPairFluxes;
|
||||
}
|
||||
std::map<RigFlowDiagResultAddress, std::vector<double>>& nativeResults() { return m_nativeResults; }
|
||||
std::map<std::pair<std::string, std::string>, std::pair<double, double>>& injProdWellPairFluxes() { return m_injProdWellPairFluxes; }
|
||||
|
||||
private:
|
||||
void addResult( const RigFlowDiagResultAddress& resAddr, const std::map<int, double>& cellValues );
|
||||
@@ -149,7 +146,7 @@ public:
|
||||
std::vector<RelPermCurve> calculateRelPermCurves( size_t activeCellIndex );
|
||||
|
||||
std::vector<PvtCurve> calculatePvtCurves( PvtCurveType pvtCurveType, int pvtNum );
|
||||
bool calculatePvtDynamicPropertiesFvf( int pvtNum, double pressure, double rs, double rv, double* bo, double* bg );
|
||||
bool calculatePvtDynamicPropertiesFvf( int pvtNum, double pressure, double rs, double rv, double* bo, double* bg );
|
||||
bool calculatePvtDynamicPropertiesViscosity( int pvtNum, double pressure, double rs, double rv, double* mu_o, double* mu_g );
|
||||
|
||||
private:
|
||||
|
||||
@@ -119,8 +119,7 @@ void RigFlowDiagStatCalc::mobileVolumeWeightedMean( size_t timeStepIndex, double
|
||||
if ( !eclCase ) return;
|
||||
|
||||
RigCaseCellResultsData* caseCellResultsData = eclCase->results( RiaDefines::PorosityModelType::MATRIX_MODEL );
|
||||
RigEclipseResultAddress mobPoreVolResAddr( RiaDefines::ResultCatType::STATIC_NATIVE,
|
||||
RiaResultNames::mobilePoreVolumeName() );
|
||||
RigEclipseResultAddress mobPoreVolResAddr( RiaDefines::ResultCatType::STATIC_NATIVE, RiaResultNames::mobilePoreVolumeName() );
|
||||
|
||||
caseCellResultsData->ensureKnownResultLoaded( mobPoreVolResAddr );
|
||||
|
||||
|
||||
@@ -76,8 +76,7 @@ void RigFlowDiagVisibleCellsStatCalc::valueSumAndSampleCount( size_t timeStepInd
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFlowDiagVisibleCellsStatCalc::addDataToHistogramCalculator( size_t timeStepIndex,
|
||||
RigHistogramCalculator& histogramCalculator )
|
||||
void RigFlowDiagVisibleCellsStatCalc::addDataToHistogramCalculator( size_t timeStepIndex, RigHistogramCalculator& histogramCalculator )
|
||||
{
|
||||
traverseElementNodes( histogramCalculator, timeStepIndex );
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
|
||||
private:
|
||||
static cvf::Color3f undefinedColor();
|
||||
void appendFormationRangeWithColor( const QString& name, cvf::Color3f color, int kStartIdx, int kEndIdx );
|
||||
void appendFormationRangeWithColor( const QString& name, cvf::Color3f color, int kStartIdx, int kEndIdx );
|
||||
|
||||
private:
|
||||
std::vector<int> m_nameIndexPrKLayer;
|
||||
|
||||
@@ -169,9 +169,7 @@ double RigGeoMechBoreHoleStressCalculator::sigmaTMinOfMin( double wellPressure,
|
||||
double sigma_theta = stressComponentsForAngle[1] - wellPressure;
|
||||
const double& sigma_z = stressComponentsForAngle[2];
|
||||
double tauSqrx4 = std::pow( stressComponentsForAngle[3], 2 ) * 4.0;
|
||||
double sigma_t_min =
|
||||
0.5 * ( ( sigma_z + sigma_theta ) - std::sqrt( std::pow( sigma_z - sigma_theta, 2 ) + tauSqrx4 ) ) -
|
||||
m_porePressure;
|
||||
double sigma_t_min = 0.5 * ( ( sigma_z + sigma_theta ) - std::sqrt( std::pow( sigma_z - sigma_theta, 2 ) + tauSqrx4 ) ) - m_porePressure;
|
||||
if ( sigma_t_min < sigma_t_min_min )
|
||||
{
|
||||
sigma_t_min_min = sigma_t_min;
|
||||
@@ -195,13 +193,10 @@ double RigGeoMechBoreHoleStressCalculator::stassiDalia( double wellPressure, dou
|
||||
double tauSqrx4 = std::pow( stressComponentsForAngle[3], 2 ) * 4.0;
|
||||
|
||||
double sigma_1 = wellPressure - m_porePressure;
|
||||
double sigma_2 = 0.5 * ( ( sigma_z + sigma_theta ) + std::sqrt( std::pow( sigma_z - sigma_theta, 2 ) + tauSqrx4 ) ) -
|
||||
m_porePressure;
|
||||
double sigma_3 = 0.5 * ( ( sigma_z + sigma_theta ) - std::sqrt( std::pow( sigma_z - sigma_theta, 2 ) + tauSqrx4 ) ) -
|
||||
m_porePressure;
|
||||
double sigma_2 = 0.5 * ( ( sigma_z + sigma_theta ) + std::sqrt( std::pow( sigma_z - sigma_theta, 2 ) + tauSqrx4 ) ) - m_porePressure;
|
||||
double sigma_3 = 0.5 * ( ( sigma_z + sigma_theta ) - std::sqrt( std::pow( sigma_z - sigma_theta, 2 ) + tauSqrx4 ) ) - m_porePressure;
|
||||
|
||||
double stassiDalia = std::pow( sigma_1 - sigma_2, 2 ) + std::pow( sigma_2 - sigma_3, 2 ) +
|
||||
std::pow( sigma_1 - sigma_3, 2 ) -
|
||||
double stassiDalia = std::pow( sigma_1 - sigma_2, 2 ) + std::pow( sigma_2 - sigma_3, 2 ) + std::pow( sigma_1 - sigma_3, 2 ) -
|
||||
2 * m_uniaxialCompressiveStrength * ( sigma_1 + sigma_2 + sigma_3 );
|
||||
|
||||
if ( stassiDalia < minStassiDalia )
|
||||
|
||||
@@ -91,12 +91,10 @@ void RigGeoMechWellLogExtractor::performCurveDataSmoothing( int
|
||||
RigFemResultAddress porBarResAddr( RIG_ELEMENT_NODAL, "POR-Bar", "" );
|
||||
|
||||
const std::vector<float>& unscaledShValues = resultCollection->resultValues( shAddr, 0, timeStepIndex, frameIndex );
|
||||
const std::vector<float>& porePressures = resultCollection->resultValues( porBarResAddr, 0, timeStepIndex, frameIndex );
|
||||
const std::vector<float>& porePressures = resultCollection->resultValues( porBarResAddr, 0, timeStepIndex, frameIndex );
|
||||
|
||||
std::vector<float> interfaceShValues =
|
||||
interpolateInterfaceValues( shAddr, timeStepIndex, frameIndex, unscaledShValues );
|
||||
std::vector<float> interfacePorePressures =
|
||||
interpolateInterfaceValues( porBarResAddr, timeStepIndex, frameIndex, porePressures );
|
||||
std::vector<float> interfaceShValues = interpolateInterfaceValues( shAddr, timeStepIndex, frameIndex, unscaledShValues );
|
||||
std::vector<float> interfacePorePressures = interpolateInterfaceValues( porBarResAddr, timeStepIndex, frameIndex, porePressures );
|
||||
|
||||
std::vector<double> interfaceShValuesDbl( interfaceShValues.size(), std::numeric_limits<double>::infinity() );
|
||||
std::vector<double> interfacePorePressuresDbl( interfacePorePressures.size(), std::numeric_limits<double>::infinity() );
|
||||
@@ -119,10 +117,7 @@ void RigGeoMechWellLogExtractor::performCurveDataSmoothing( int
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Get curve data for a given parameter. Returns the output units of the data.
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RigGeoMechWellLogExtractor::curveData( const RigFemResultAddress& resAddr,
|
||||
int timeStepIndex,
|
||||
int frameIndex,
|
||||
std::vector<double>* values )
|
||||
QString RigGeoMechWellLogExtractor::curveData( const RigFemResultAddress& resAddr, int timeStepIndex, int frameIndex, std::vector<double>* values )
|
||||
{
|
||||
CVF_TIGHT_ASSERT( values );
|
||||
|
||||
@@ -215,13 +210,11 @@ QString RigGeoMechWellLogExtractor::curveData( const RigFemResultAddress& resAdd
|
||||
|
||||
CVF_ASSERT( resAddr.resultPosType != RIG_WELLPATH_DERIVED );
|
||||
|
||||
const std::vector<float>& resultValues =
|
||||
m_caseData->femPartResults()->resultValues( convResAddr, 0, timeStepIndex, frameIndex );
|
||||
const std::vector<float>& resultValues = m_caseData->femPartResults()->resultValues( convResAddr, 0, timeStepIndex, frameIndex );
|
||||
|
||||
if ( !resultValues.empty() )
|
||||
{
|
||||
std::vector<float> interfaceValues =
|
||||
interpolateInterfaceValues( convResAddr, timeStepIndex, frameIndex, resultValues );
|
||||
std::vector<float> interfaceValues = interpolateInterfaceValues( convResAddr, timeStepIndex, frameIndex, resultValues );
|
||||
|
||||
values->resize( interfaceValues.size(), std::numeric_limits<double>::infinity() );
|
||||
|
||||
@@ -268,9 +261,8 @@ std::vector<RigGeoMechWellLogExtractor::WbsParameterSource>
|
||||
{
|
||||
RigFemResultAddress nativeAddr = parameter.femAddress( RigWbsParameter::GRID );
|
||||
|
||||
const std::vector<float>& unscaledResultValues =
|
||||
resultCollection->resultValues( nativeAddr, 0, timeStepIndex, frameIndex );
|
||||
std::vector<float> interpolatedInterfaceValues =
|
||||
const std::vector<float>& unscaledResultValues = resultCollection->resultValues( nativeAddr, 0, timeStepIndex, frameIndex );
|
||||
std::vector<float> interpolatedInterfaceValues =
|
||||
interpolateInterfaceValues( nativeAddr, timeStepIndex, frameIndex, unscaledResultValues );
|
||||
gridValues.resize( m_intersections.size(), std::numeric_limits<double>::infinity() );
|
||||
|
||||
@@ -300,8 +292,7 @@ std::vector<RigGeoMechWellLogExtractor::WbsParameterSource>
|
||||
tvdRKBs.push_back( tvdValue + m_wellPathGeometry->rkbDiff() );
|
||||
}
|
||||
RigFemResultAddress elementPropertyAddr = parameter.femAddress( RigWbsParameter::ELEMENT_PROPERTY_TABLE );
|
||||
elementPropertyValuesInput =
|
||||
&( resultCollection->resultValues( elementPropertyAddr, 0, timeStepIndex, frameIndex ) );
|
||||
elementPropertyValuesInput = &( resultCollection->resultValues( elementPropertyAddr, 0, timeStepIndex, frameIndex ) );
|
||||
if ( elementPropertyValuesInput )
|
||||
{
|
||||
RiaWellLogUnitTools<float>::convertValues( tvdRKBs,
|
||||
@@ -323,8 +314,7 @@ std::vector<RigGeoMechWellLogExtractor::WbsParameterSource>
|
||||
{
|
||||
if ( *it == RigWbsParameter::GRID ) // Priority 0: Grid
|
||||
{
|
||||
if ( intersectionIdx < (int64_t)gridValues.size() &&
|
||||
gridValues[intersectionIdx] != std::numeric_limits<double>::infinity() )
|
||||
if ( intersectionIdx < (int64_t)gridValues.size() && gridValues[intersectionIdx] != std::numeric_limits<double>::infinity() )
|
||||
{
|
||||
unscaledValues[intersectionIdx] = gridValues[intersectionIdx];
|
||||
finalSourcesPerSegment[intersectionIdx] = RigWbsParameter::GRID;
|
||||
@@ -392,8 +382,7 @@ std::vector<RigGeoMechWellLogExtractor::WbsParameterSource>
|
||||
|
||||
if ( source == RigWbsParameter::ELEMENT_PROPERTY_TABLE || source == RigWbsParameter::GRID )
|
||||
{
|
||||
( *outputValues )[intersectionIdx] =
|
||||
unscaledValues[intersectionIdx] / hydroStaticPorePressureForSegment( intersectionIdx );
|
||||
( *outputValues )[intersectionIdx] = unscaledValues[intersectionIdx] / hydroStaticPorePressureForSegment( intersectionIdx );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -465,8 +454,7 @@ void RigGeoMechWellLogExtractor::wellPathAngles( const RigFemResultAddress& resA
|
||||
cvf::Vec3d wellPathTangent = calculateWellPathTangent( intersectionIdx, TangentFollowWellPathSegments );
|
||||
|
||||
// Deviation from vertical. Since well path is tending downwards we compare with negative z.
|
||||
double inclination =
|
||||
cvf::Math::toDegrees( std::acos( cvf::Vec3d( 0.0, 0.0, -1.0 ) * wellPathTangent.getNormalized() ) );
|
||||
double inclination = cvf::Math::toDegrees( std::acos( cvf::Vec3d( 0.0, 0.0, -1.0 ) * wellPathTangent.getNormalized() ) );
|
||||
|
||||
if ( resAddr.fieldName == "Azimuth" )
|
||||
{
|
||||
@@ -520,7 +508,7 @@ std::vector<RigGeoMechWellLogExtractor::WbsParameterSource>
|
||||
int timeStepIndex,
|
||||
int frameIndex,
|
||||
std::vector<double>* values,
|
||||
bool forceGridSourceForPPReservoir /*=false*/ )
|
||||
bool forceGridSourceForPPReservoir /*=false*/ )
|
||||
{
|
||||
CVF_ASSERT( values );
|
||||
|
||||
@@ -536,19 +524,13 @@ std::vector<RigGeoMechWellLogExtractor::WbsParameterSource>
|
||||
std::vector<WbsParameterSource> ppSandSources;
|
||||
if ( forceGridSourceForPPReservoir )
|
||||
{
|
||||
ppSandSources = calculateWbsParameterForAllSegments( RigWbsParameter::PP_Reservoir(),
|
||||
RigWbsParameter::GRID,
|
||||
frameIndex,
|
||||
&ppSandValues,
|
||||
true );
|
||||
ppSandSources =
|
||||
calculateWbsParameterForAllSegments( RigWbsParameter::PP_Reservoir(), RigWbsParameter::GRID, frameIndex, &ppSandValues, true );
|
||||
}
|
||||
else
|
||||
{
|
||||
ppSandSources = calculateWbsParameterForAllSegments( RigWbsParameter::PP_Reservoir(),
|
||||
timeStepIndex,
|
||||
frameIndex,
|
||||
&ppSandValues,
|
||||
true );
|
||||
ppSandSources =
|
||||
calculateWbsParameterForAllSegments( RigWbsParameter::PP_Reservoir(), timeStepIndex, frameIndex, &ppSandValues, true );
|
||||
}
|
||||
|
||||
std::vector<WbsParameterSource> ppShaleSources =
|
||||
@@ -623,12 +605,9 @@ void RigGeoMechWellLogExtractor::wellBoreWallCurveData( const RigFemResultAddres
|
||||
|
||||
values->resize( m_intersections.size(), std::numeric_limits<float>::infinity() );
|
||||
|
||||
std::vector<double> ppSandAllSegments( m_intersections.size(), std::numeric_limits<double>::infinity() );
|
||||
std::vector<WbsParameterSource> ppSources = calculateWbsParameterForAllSegments( RigWbsParameter::PP_Reservoir(),
|
||||
RigWbsParameter::GRID,
|
||||
frameIndex,
|
||||
&ppSandAllSegments,
|
||||
false );
|
||||
std::vector<double> ppSandAllSegments( m_intersections.size(), std::numeric_limits<double>::infinity() );
|
||||
std::vector<WbsParameterSource> ppSources =
|
||||
calculateWbsParameterForAllSegments( RigWbsParameter::PP_Reservoir(), RigWbsParameter::GRID, frameIndex, &ppSandAllSegments, false );
|
||||
|
||||
std::vector<double> poissonAllSegments( m_intersections.size(), std::numeric_limits<double>::infinity() );
|
||||
calculateWbsParameterForAllSegments( RigWbsParameter::poissonRatio(), timeStepIndex, frameIndex, &poissonAllSegments, false );
|
||||
@@ -654,10 +633,8 @@ void RigGeoMechWellLogExtractor::wellBoreWallCurveData( const RigFemResultAddres
|
||||
double ucsBar = ucsAllSegments[intersectionIdx];
|
||||
|
||||
caf::Ten3d segmentStress;
|
||||
bool validSegmentStress = averageIntersectionValuesToSegmentValue( intersectionIdx,
|
||||
interpolatedInterfaceStressBar,
|
||||
caf::Ten3d::invalid(),
|
||||
&segmentStress );
|
||||
bool validSegmentStress =
|
||||
averageIntersectionValuesToSegmentValue( intersectionIdx, interpolatedInterfaceStressBar, caf::Ten3d::invalid(), &segmentStress );
|
||||
|
||||
cvf::Vec3d wellPathTangent = calculateWellPathTangent( intersectionIdx, TangentConstantWithinCell );
|
||||
caf::Ten3d wellPathStressFloat = transformTensorToWellPathOrientation( wellPathTangent, segmentStress );
|
||||
@@ -715,8 +692,7 @@ void RigGeoMechWellLogExtractor::wellBoreFGShale( int timeStepIndex, int frameIn
|
||||
{
|
||||
if ( !isValid( ( *values )[intersectionIdx] ) )
|
||||
{
|
||||
if ( isValid( PP0[intersectionIdx] ) && isValid( OBG0[intersectionIdx] ) &&
|
||||
isValid( K0_FG[intersectionIdx] ) )
|
||||
if ( isValid( PP0[intersectionIdx] ) && isValid( OBG0[intersectionIdx] ) && isValid( K0_FG[intersectionIdx] ) )
|
||||
{
|
||||
( *values )[intersectionIdx] =
|
||||
( K0_FG[intersectionIdx] * ( OBG0[intersectionIdx] - PP0[intersectionIdx] ) + PP0[intersectionIdx] );
|
||||
@@ -770,9 +746,8 @@ void RigGeoMechWellLogExtractor::wellBoreSH_MatthewsKelly( int timeStepIndex, in
|
||||
if ( isValid( PP[intersectionIdx] ) && isValid( PP0[intersectionIdx] ) && isValid( OBG0[intersectionIdx] ) &&
|
||||
isValid( K0_SH[intersectionIdx] ) && isValid( DF[intersectionIdx] ) )
|
||||
{
|
||||
( *values )[intersectionIdx] =
|
||||
( K0_SH[intersectionIdx] * ( OBG0[intersectionIdx] - PP0[intersectionIdx] ) + PP0[intersectionIdx] +
|
||||
DF[intersectionIdx] * ( PP[intersectionIdx] - PP0[intersectionIdx] ) );
|
||||
( *values )[intersectionIdx] = ( K0_SH[intersectionIdx] * ( OBG0[intersectionIdx] - PP0[intersectionIdx] ) +
|
||||
PP0[intersectionIdx] + DF[intersectionIdx] * ( PP[intersectionIdx] - PP0[intersectionIdx] ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -788,8 +763,7 @@ const RigGeoMechCaseData* RigGeoMechWellLogExtractor::caseData()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigGeoMechWellLogExtractor::setWbsLasValues( const RigWbsParameter& parameter,
|
||||
const std::vector<std::pair<double, double>>& values )
|
||||
void RigGeoMechWellLogExtractor::setWbsLasValues( const RigWbsParameter& parameter, const std::vector<std::pair<double, double>>& values )
|
||||
{
|
||||
m_lasFileValues[parameter] = values;
|
||||
}
|
||||
@@ -815,8 +789,7 @@ void RigGeoMechWellLogExtractor::setWbsUserDefinedValue( RigWbsParameter paramet
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RigGeoMechWellLogExtractor::parameterInputUnits( const RigWbsParameter& parameter )
|
||||
{
|
||||
if ( parameter == RigWbsParameter::PP_NonReservoir() || parameter == RigWbsParameter::PP_Reservoir() ||
|
||||
parameter == RigWbsParameter::UCS() )
|
||||
if ( parameter == RigWbsParameter::PP_NonReservoir() || parameter == RigWbsParameter::PP_Reservoir() || parameter == RigWbsParameter::UCS() )
|
||||
{
|
||||
return RiaWellLogUnitTools<double>::barUnitString();
|
||||
}
|
||||
@@ -922,13 +895,12 @@ T RigGeoMechWellLogExtractor::interpolateGridResultValue( RigFemResultPosEnum
|
||||
}
|
||||
// TODO: Should interpolate within the whole hexahedron. This requires converting to locals coordinates.
|
||||
// For now just pick the average value for the cell.
|
||||
size_t gridResultValueIdx =
|
||||
femPart->resultValueIdxFromResultPosType( resultPosType, static_cast<int>( elmIdx ), 0 );
|
||||
T sumOfVertexValues = gridResultValues[gridResultValueIdx];
|
||||
size_t gridResultValueIdx = femPart->resultValueIdxFromResultPosType( resultPosType, static_cast<int>( elmIdx ), 0 );
|
||||
T sumOfVertexValues = gridResultValues[gridResultValueIdx];
|
||||
for ( int i = 1; i < 8; ++i )
|
||||
{
|
||||
gridResultValueIdx = femPart->resultValueIdxFromResultPosType( resultPosType, static_cast<int>( elmIdx ), i );
|
||||
sumOfVertexValues = sumOfVertexValues + gridResultValues[gridResultValueIdx];
|
||||
sumOfVertexValues = sumOfVertexValues + gridResultValues[gridResultValueIdx];
|
||||
}
|
||||
return sumOfVertexValues * ( 1.0 / 8.0 );
|
||||
}
|
||||
@@ -952,9 +924,8 @@ T RigGeoMechWellLogExtractor::interpolateGridResultValue( RigFemResultPosEnum
|
||||
}
|
||||
else
|
||||
{
|
||||
nodeResIdx[i] = femPart->resultValueIdxFromResultPosType( resultPosType,
|
||||
static_cast<int>( elmIdx ),
|
||||
elementLocalIndicesForFace[i] );
|
||||
nodeResIdx[i] =
|
||||
femPart->resultValueIdxFromResultPosType( resultPosType, static_cast<int>( elmIdx ), elementLocalIndicesForFace[i] );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -980,9 +951,7 @@ T RigGeoMechWellLogExtractor::interpolateGridResultValue( RigFemResultPosEnum
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RigGeoMechWellLogExtractor::gridResultIndexFace( size_t elementIdx,
|
||||
cvf::StructGridInterface::FaceType cellFace,
|
||||
int faceLocalNodeIdx ) const
|
||||
size_t RigGeoMechWellLogExtractor::gridResultIndexFace( size_t elementIdx, cvf::StructGridInterface::FaceType cellFace, int faceLocalNodeIdx ) const
|
||||
{
|
||||
CVF_ASSERT( cellFace != cvf::StructGridInterface::NO_FACE && faceLocalNodeIdx < 4 );
|
||||
return elementIdx * 24 + static_cast<int>( cellFace ) * 4 + faceLocalNodeIdx;
|
||||
@@ -1068,9 +1037,7 @@ std::vector<size_t> RigGeoMechWellLogExtractor::findCloseCells( const cvf::Bound
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Vec3d RigGeoMechWellLogExtractor::calculateLengthInCell( size_t cellIndex,
|
||||
const cvf::Vec3d& startPoint,
|
||||
const cvf::Vec3d& endPoint ) const
|
||||
cvf::Vec3d RigGeoMechWellLogExtractor::calculateLengthInCell( size_t cellIndex, const cvf::Vec3d& startPoint, const cvf::Vec3d& endPoint ) const
|
||||
{
|
||||
std::array<cvf::Vec3d, 8> hexCorners;
|
||||
|
||||
@@ -1093,8 +1060,7 @@ cvf::Vec3d RigGeoMechWellLogExtractor::calculateLengthInCell( size_t
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Vec3d RigGeoMechWellLogExtractor::calculateWellPathTangent( int64_t intersectionIdx,
|
||||
WellPathTangentCalculation calculationType ) const
|
||||
cvf::Vec3d RigGeoMechWellLogExtractor::calculateWellPathTangent( int64_t intersectionIdx, WellPathTangentCalculation calculationType ) const
|
||||
{
|
||||
if ( calculationType == TangentFollowWellPathSegments )
|
||||
{
|
||||
@@ -1121,8 +1087,7 @@ cvf::Vec3d RigGeoMechWellLogExtractor::calculateWellPathTangent( int64_t
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::Ten3d RigGeoMechWellLogExtractor::transformTensorToWellPathOrientation( const cvf::Vec3d& wellPathTangent,
|
||||
const caf::Ten3d& tensor )
|
||||
caf::Ten3d RigGeoMechWellLogExtractor::transformTensorToWellPathOrientation( const cvf::Vec3d& wellPathTangent, const caf::Ten3d& tensor )
|
||||
{
|
||||
// Create local coordinate system for well path segment
|
||||
cvf::Vec3d local_z = wellPathTangent;
|
||||
@@ -1159,7 +1124,7 @@ cvf::Vec3f RigGeoMechWellLogExtractor::cellCentroid( size_t intersectionIdx ) co
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigGeoMechWellLogExtractor::getWellLogIntersectionValue( size_t intersectionIdx,
|
||||
double RigGeoMechWellLogExtractor::getWellLogIntersectionValue( size_t intersectionIdx,
|
||||
const std::vector<std::pair<double, double>>& wellLogValues ) const
|
||||
{
|
||||
const double eps = 1.0e-4;
|
||||
@@ -1224,7 +1189,7 @@ template <typename T>
|
||||
bool RigGeoMechWellLogExtractor::averageIntersectionValuesToSegmentValue( size_t intersectionIdx,
|
||||
const std::vector<T>& values,
|
||||
const T& invalidValue,
|
||||
T* averagedCellValue ) const
|
||||
T* averagedCellValue ) const
|
||||
{
|
||||
CVF_ASSERT( values.size() >= 2 );
|
||||
|
||||
@@ -1330,8 +1295,7 @@ void RigGeoMechWellLogExtractor::smoothSegments( std::vector<double>*
|
||||
bool smoothSegment = smoothSegments[i] != 0u;
|
||||
|
||||
double diffMd = std::fabs( ( *mds )[i + 1] - ( *mds )[i] ) / std::max( eps, ( *mds )[i] );
|
||||
double diffSh =
|
||||
std::fabs( interfaceShValues[i + 1] - interfaceShValues[i] ) / std::max( eps, interfaceShValues[i] );
|
||||
double diffSh = std::fabs( interfaceShValues[i + 1] - interfaceShValues[i] ) / std::max( eps, interfaceShValues[i] );
|
||||
|
||||
bool leapSh = diffSh > smoothingThreshold && diffMd < eps;
|
||||
if ( smoothSegment )
|
||||
@@ -1383,16 +1347,15 @@ void RigGeoMechWellLogExtractor::smoothSegments( std::vector<double>*
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Note that this is unsigned char because std::vector<bool> is not thread safe
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<unsigned char>
|
||||
RigGeoMechWellLogExtractor::determineFilteringOrSmoothing( const std::vector<double>& porePressures )
|
||||
std::vector<unsigned char> RigGeoMechWellLogExtractor::determineFilteringOrSmoothing( const std::vector<double>& porePressures )
|
||||
{
|
||||
std::vector<unsigned char> smoothOrFilterSegments( porePressures.size(), false );
|
||||
#pragma omp parallel for
|
||||
for ( int64_t i = 1; i < int64_t( porePressures.size() - 1 ); ++i )
|
||||
{
|
||||
bool validPP_im1 = porePressures[i - 1] >= 0.0 && porePressures[i - 1] != std::numeric_limits<double>::infinity();
|
||||
bool validPP_i = porePressures[i] >= 0.0 && porePressures[i] != std::numeric_limits<double>::infinity();
|
||||
bool validPP_ip1 = porePressures[i + 1] >= 0.0 && porePressures[i + 1] != std::numeric_limits<double>::infinity();
|
||||
bool validPP_im1 = porePressures[i - 1] >= 0.0 && porePressures[i - 1] != std::numeric_limits<double>::infinity();
|
||||
bool validPP_i = porePressures[i] >= 0.0 && porePressures[i] != std::numeric_limits<double>::infinity();
|
||||
bool validPP_ip1 = porePressures[i + 1] >= 0.0 && porePressures[i + 1] != std::numeric_limits<double>::infinity();
|
||||
bool anyValidPP = validPP_im1 || validPP_i || validPP_ip1;
|
||||
smoothOrFilterSegments[i] = !anyValidPP;
|
||||
}
|
||||
@@ -1402,8 +1365,7 @@ std::vector<unsigned char>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigGeoMechWellLogExtractor::hydroStaticPorePressureForIntersection( size_t intersectionIdx,
|
||||
double waterDensityGCM3 ) const
|
||||
double RigGeoMechWellLogExtractor::hydroStaticPorePressureForIntersection( size_t intersectionIdx, double waterDensityGCM3 ) const
|
||||
{
|
||||
double trueVerticalDepth = m_intersectionTVDs[intersectionIdx];
|
||||
double effectiveDepthMeters = trueVerticalDepth + m_wellPathGeometry->rkbDiff();
|
||||
|
||||
@@ -81,11 +81,9 @@ public:
|
||||
std::vector<double> poissonSourceRegions( int timeStepIndex, int frameIndex );
|
||||
std::vector<double> ucsSourceRegions( int timeStepIndex, int frameIndex );
|
||||
|
||||
static caf::Ten3d transformTensorToWellPathOrientation( const cvf::Vec3d& wellPathTangent,
|
||||
const caf::Ten3d& wellPathTensor );
|
||||
static caf::Ten3d transformTensorToWellPathOrientation( const cvf::Vec3d& wellPathTangent, const caf::Ten3d& wellPathTensor );
|
||||
|
||||
static double hydroStaticPorePressureAtDepth( double effectiveDepthMeters,
|
||||
double waterDensityGCM3 = PURE_WATER_DENSITY_GCM3 );
|
||||
static double hydroStaticPorePressureAtDepth( double effectiveDepthMeters, double waterDensityGCM3 = PURE_WATER_DENSITY_GCM3 );
|
||||
|
||||
double waterDepth() const;
|
||||
double estimateWaterDepth() const;
|
||||
@@ -112,36 +110,29 @@ private:
|
||||
int timeStepIndex,
|
||||
int frameIndex,
|
||||
std::vector<double>* values,
|
||||
bool allowNormalization );
|
||||
bool allowNormalization );
|
||||
|
||||
void wellPathAngles( const RigFemResultAddress& resAddr, std::vector<double>* values );
|
||||
std::vector<WbsParameterSource> wellPathScaledCurveData( const RigFemResultAddress& resAddr,
|
||||
int timeStepIndex,
|
||||
int frameIndex,
|
||||
std::vector<double>* values,
|
||||
bool forceGridSourceforPPReservoir = false );
|
||||
void wellBoreWallCurveData( const RigFemResultAddress& resAddr,
|
||||
int timeStepIndex,
|
||||
int frameIndex,
|
||||
std::vector<double>* values );
|
||||
bool forceGridSourceforPPReservoir = false );
|
||||
void wellBoreWallCurveData( const RigFemResultAddress& resAddr, int timeStepIndex, int frameIndex, std::vector<double>* values );
|
||||
|
||||
void wellBoreFGShale( int timeStepIndex, int frameIndex, std::vector<double>* values );
|
||||
void wellBoreSH_MatthewsKelly( int timeStepIndex, int frameIndex, std::vector<double>* values );
|
||||
|
||||
template <typename T>
|
||||
T interpolateGridResultValue( RigFemResultPosEnum resultPosType,
|
||||
const std::vector<T>& gridResultValues,
|
||||
int64_t intersectionIdx ) const;
|
||||
size_t gridResultIndexFace( size_t elementIdx, cvf::StructGridInterface::FaceType cellFace, int faceLocalNodeIdx ) const;
|
||||
T interpolateGridResultValue( RigFemResultPosEnum resultPosType, const std::vector<T>& gridResultValues, int64_t intersectionIdx ) const;
|
||||
size_t gridResultIndexFace( size_t elementIdx, cvf::StructGridInterface::FaceType cellFace, int faceLocalNodeIdx ) const;
|
||||
void calculateIntersection();
|
||||
std::vector<size_t> findCloseCells( const cvf::BoundingBox& bb );
|
||||
cvf::Vec3d
|
||||
calculateLengthInCell( size_t cellIndex, const cvf::Vec3d& startPoint, const cvf::Vec3d& endPoint ) const override;
|
||||
cvf::Vec3d calculateWellPathTangent( int64_t intersectionIdx, WellPathTangentCalculation calculationType ) const;
|
||||
cvf::Vec3d calculateLengthInCell( size_t cellIndex, const cvf::Vec3d& startPoint, const cvf::Vec3d& endPoint ) const override;
|
||||
cvf::Vec3d calculateWellPathTangent( int64_t intersectionIdx, WellPathTangentCalculation calculationType ) const;
|
||||
|
||||
cvf::Vec3f cellCentroid( size_t intersectionIdx ) const;
|
||||
double getWellLogIntersectionValue( size_t intersectionIdx,
|
||||
const std::vector<std::pair<double, double>>& wellLogValues ) const;
|
||||
double getWellLogIntersectionValue( size_t intersectionIdx, const std::vector<std::pair<double, double>>& wellLogValues ) const;
|
||||
|
||||
template <typename T>
|
||||
bool averageIntersectionValuesToSegmentValue( size_t intersectionIdx,
|
||||
@@ -168,10 +159,8 @@ private:
|
||||
|
||||
std::vector<unsigned char> determineFilteringOrSmoothing( const std::vector<double>& porePressures );
|
||||
|
||||
double hydroStaticPorePressureForIntersection( size_t intersectionIdx,
|
||||
double waterDensityGCM3 = PURE_WATER_DENSITY_GCM3 ) const;
|
||||
double hydroStaticPorePressureForSegment( size_t intersectionIdx,
|
||||
double waterDensityGCM3 = PURE_WATER_DENSITY_GCM3 ) const;
|
||||
double hydroStaticPorePressureForIntersection( size_t intersectionIdx, double waterDensityGCM3 = PURE_WATER_DENSITY_GCM3 ) const;
|
||||
double hydroStaticPorePressureForSegment( size_t intersectionIdx, double waterDensityGCM3 = PURE_WATER_DENSITY_GCM3 ) const;
|
||||
|
||||
double wbsCurveValuesAtMsl() const;
|
||||
|
||||
|
||||
@@ -76,8 +76,7 @@ void RigGocadData::setGeometryData( const std::vector<cvf::Vec3d>& nodeCoord, co
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigGocadData::addPropertyData( const std::vector<QString>& propertyNames,
|
||||
std::vector<std::vector<float>>& propertyValues )
|
||||
void RigGocadData::addPropertyData( const std::vector<QString>& propertyNames, std::vector<std::vector<float>>& propertyValues )
|
||||
{
|
||||
m_propertyNames = propertyNames;
|
||||
m_propertyValues = propertyValues;
|
||||
|
||||
@@ -173,8 +173,7 @@ size_t RigGridBase::cellIndexFromIJK( size_t i, size_t j, size_t k ) const
|
||||
CVF_TIGHT_ASSERT( i != cvf::UNDEFINED_SIZE_T && j != cvf::UNDEFINED_SIZE_T && k != cvf::UNDEFINED_SIZE_T );
|
||||
CVF_TIGHT_ASSERT( i < m_gridPointDimensions.x() && j < m_gridPointDimensions.y() && k < m_gridPointDimensions.z() );
|
||||
|
||||
size_t ci = i + j * ( m_gridPointDimensions.x() - 1 ) +
|
||||
k * ( ( m_gridPointDimensions.x() - 1 ) * ( m_gridPointDimensions.y() - 1 ) );
|
||||
size_t ci = i + j * ( m_gridPointDimensions.x() - 1 ) + k * ( ( m_gridPointDimensions.x() - 1 ) * ( m_gridPointDimensions.y() - 1 ) );
|
||||
return ci;
|
||||
}
|
||||
|
||||
@@ -183,8 +182,7 @@ size_t RigGridBase::cellIndexFromIJK( size_t i, size_t j, size_t k ) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RigGridBase::cellIndexFromIJKUnguarded( size_t i, size_t j, size_t k ) const
|
||||
{
|
||||
size_t ci = i + j * ( m_gridPointDimensions.x() - 1 ) +
|
||||
k * ( ( m_gridPointDimensions.x() - 1 ) * ( m_gridPointDimensions.y() - 1 ) );
|
||||
size_t ci = i + j * ( m_gridPointDimensions.x() - 1 ) + k * ( ( m_gridPointDimensions.x() - 1 ) * ( m_gridPointDimensions.y() - 1 ) );
|
||||
return ci;
|
||||
}
|
||||
|
||||
@@ -448,13 +446,7 @@ size_t RigGridBase::addCoarseningBox( size_t i1, size_t i2, size_t j1, size_t j2
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigGridBase::coarseningBox( size_t coarseningBoxIndex,
|
||||
size_t* i1,
|
||||
size_t* i2,
|
||||
size_t* j1,
|
||||
size_t* j2,
|
||||
size_t* k1,
|
||||
size_t* k2 ) const
|
||||
void RigGridBase::coarseningBox( size_t coarseningBoxIndex, size_t* i1, size_t* i2, size_t* j1, size_t* j2, size_t* k1, size_t* k2 ) const
|
||||
{
|
||||
CVF_ASSERT( coarseningBoxIndex < m_coarseningBoxInfo.size() );
|
||||
|
||||
@@ -531,7 +523,7 @@ bool RigGridCellFaceVisibilityFilter::isFaceVisible( size_t
|
||||
// Do not show cell geometry if a fault is present to avoid z fighting between surfaces
|
||||
// It will always be a better solution to avoid geometry creation instead of part priority and polygon offset
|
||||
size_t nativeResvCellIndex = m_grid->reservoirCellIndex( cellIndex );
|
||||
const RigFault* fault = m_grid->mainGrid()->findFaultFromCellIndexAndCellFace( nativeResvCellIndex, face );
|
||||
const RigFault* fault = m_grid->mainGrid()->findFaultFromCellIndexAndCellFace( nativeResvCellIndex, face );
|
||||
if ( fault )
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -109,9 +109,9 @@ public:
|
||||
void cellIJKNeighborUnguarded( size_t i, size_t j, size_t k, FaceType face, size_t* neighborCellIndex ) const;
|
||||
|
||||
private:
|
||||
std::string m_gridName;
|
||||
cvf::Vec3st m_gridPointDimensions;
|
||||
size_t m_indexToStartOfCells; ///< Index into the global cell array stored in main-grid where this grids cells starts.
|
||||
std::string m_gridName;
|
||||
cvf::Vec3st m_gridPointDimensions;
|
||||
size_t m_indexToStartOfCells; ///< Index into the global cell array stored in main-grid where this grids cells starts.
|
||||
size_t m_gridIndex; ///< The LGR index of this grid. Starts with 1. Main grid has index 0.
|
||||
int m_gridId; ///< The LGR id of this grid. Main grid has id 0.
|
||||
RigMainGrid* m_mainGrid;
|
||||
@@ -128,11 +128,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
bool isFaceVisible( size_t i,
|
||||
size_t j,
|
||||
size_t k,
|
||||
cvf::StructGridInterface::FaceType face,
|
||||
const cvf::UByteArray* cellVisibility ) const override;
|
||||
bool isFaceVisible( size_t i, size_t j, size_t k, cvf::StructGridInterface::FaceType face, const cvf::UByteArray* cellVisibility ) const override;
|
||||
|
||||
private:
|
||||
const RigGridBase* m_grid;
|
||||
|
||||
@@ -49,8 +49,7 @@ private:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigGridAllCellsScalarDataAccess::RigGridAllCellsScalarDataAccess( const RigGridBase* grid,
|
||||
std::vector<double>* reservoirResultValues )
|
||||
RigGridAllCellsScalarDataAccess::RigGridAllCellsScalarDataAccess( const RigGridBase* grid, std::vector<double>* reservoirResultValues )
|
||||
: m_grid( grid )
|
||||
, m_reservoirResultValues( reservoirResultValues )
|
||||
{
|
||||
@@ -88,9 +87,7 @@ void RigGridAllCellsScalarDataAccess::setCellScalar( size_t gridLocalCellIndex,
|
||||
class RigGridActiveCellsScalarDataAccess : public cvf::StructGridScalarDataAccess
|
||||
{
|
||||
public:
|
||||
RigGridActiveCellsScalarDataAccess( const RigGridBase* grid,
|
||||
std::vector<double>* reservoirResultValues,
|
||||
const RigActiveCellInfo* activeCellInfo )
|
||||
RigGridActiveCellsScalarDataAccess( const RigGridBase* grid, std::vector<double>* reservoirResultValues, const RigActiveCellInfo* activeCellInfo )
|
||||
: m_grid( grid )
|
||||
, m_reservoirResultValues( reservoirResultValues )
|
||||
, m_activeCellInfo( activeCellInfo )
|
||||
@@ -144,8 +141,8 @@ cvf::ref<cvf::StructGridScalarDataAccess>
|
||||
RigResultAccessObjectFactory::createNativeDataAccessObject( RigCaseData* eclipseCase,
|
||||
size_t gridIndex,
|
||||
RifReaderInterface::PorosityModelResultType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
size_t scalarSetIndex )
|
||||
size_t timeStepIndex,
|
||||
size_t scalarSetIndex )
|
||||
{
|
||||
CVF_ASSERT( gridIndex < eclipseCase->gridCount() );
|
||||
CVF_ASSERT( eclipseCase );
|
||||
@@ -159,8 +156,7 @@ cvf::ref<cvf::StructGridScalarDataAccess>
|
||||
return NULL;
|
||||
}
|
||||
|
||||
std::vector<std::vector<double>>& scalarSetResults =
|
||||
eclipseCase->results( porosityModel )->cellScalarResults( scalarSetIndex );
|
||||
std::vector<std::vector<double>>& scalarSetResults = eclipseCase->results( porosityModel )->cellScalarResults( scalarSetIndex );
|
||||
|
||||
// A generated result with a generated results for a subset of time steps, will end up with a result container with
|
||||
// less entries than time steps See RiaSetGridProperty command in RiaPropertyDataCommands
|
||||
|
||||
@@ -41,8 +41,7 @@ int RigHexIntersectionTools::lineHexCellIntersection( const cvf::Vec3d
|
||||
for ( int face = 0; face < 6; ++face )
|
||||
{
|
||||
cvf::ubyte faceVertexIndices[4];
|
||||
cvf::StructGridInterface::cellFaceVertexIndices( static_cast<cvf::StructGridInterface::FaceType>( face ),
|
||||
faceVertexIndices );
|
||||
cvf::StructGridInterface::cellFaceVertexIndices( static_cast<cvf::StructGridInterface::FaceType>( face ), faceVertexIndices );
|
||||
|
||||
cvf::Vec3d intersection;
|
||||
bool isEntering = false;
|
||||
@@ -64,10 +63,8 @@ int RigHexIntersectionTools::lineHexCellIntersection( const cvf::Vec3d
|
||||
&isEntering );
|
||||
if ( intsStatus == 1 )
|
||||
{
|
||||
uniqueIntersections.insert( HexIntersectionInfo( intersection,
|
||||
isEntering,
|
||||
static_cast<cvf::StructGridInterface::FaceType>( face ),
|
||||
hexIndex ) );
|
||||
uniqueIntersections.insert(
|
||||
HexIntersectionInfo( intersection, isEntering, static_cast<cvf::StructGridInterface::FaceType>( face ), hexIndex ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -85,15 +82,12 @@ int RigHexIntersectionTools::lineHexCellIntersection( const cvf::Vec3d
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigHexIntersectionTools::lineIntersectsHexCell( const cvf::Vec3d p1,
|
||||
const cvf::Vec3d p2,
|
||||
const cvf::Vec3d hexCorners[8] )
|
||||
bool RigHexIntersectionTools::lineIntersectsHexCell( const cvf::Vec3d p1, const cvf::Vec3d p2, const cvf::Vec3d hexCorners[8] )
|
||||
{
|
||||
for ( int face = 0; face < 6; ++face )
|
||||
{
|
||||
cvf::ubyte faceVertexIndices[4];
|
||||
cvf::StructGridInterface::cellFaceVertexIndices( static_cast<cvf::StructGridInterface::FaceType>( face ),
|
||||
faceVertexIndices );
|
||||
cvf::StructGridInterface::cellFaceVertexIndices( static_cast<cvf::StructGridInterface::FaceType>( face ), faceVertexIndices );
|
||||
|
||||
cvf::Vec3d intersection;
|
||||
bool isEntering = false;
|
||||
@@ -134,8 +128,7 @@ bool RigHexIntersectionTools::isPointInCell( const cvf::Vec3d point, const cvf::
|
||||
for ( int face = 0; face < 6; ++face )
|
||||
{
|
||||
cvf::ubyte faceVertexIndices[4];
|
||||
cvf::StructGridInterface::cellFaceVertexIndices( static_cast<cvf::StructGridInterface::FaceType>( face ),
|
||||
faceVertexIndices );
|
||||
cvf::StructGridInterface::cellFaceVertexIndices( static_cast<cvf::StructGridInterface::FaceType>( face ), faceVertexIndices );
|
||||
cvf::Vec3d faceCenter = cvf::GeometryTools::computeFaceCenter( hexCorners[faceVertexIndices[0]],
|
||||
hexCorners[faceVertexIndices[1]],
|
||||
hexCorners[faceVertexIndices[2]],
|
||||
@@ -168,8 +161,7 @@ bool RigHexIntersectionTools::planeHexCellIntersection( cvf::Vec3d*
|
||||
|
||||
for ( int face = 0; face < 6; ++face )
|
||||
{
|
||||
cvf::StructGridInterface::cellFaceVertexIndices( static_cast<cvf::StructGridInterface::FaceType>( face ),
|
||||
faceVertexIndices );
|
||||
cvf::StructGridInterface::cellFaceVertexIndices( static_cast<cvf::StructGridInterface::FaceType>( face ), faceVertexIndices );
|
||||
|
||||
cvf::Vec3d faceCenter = cvf::GeometryTools::computeFaceCenter( hexCorners[faceVertexIndices[0]],
|
||||
hexCorners[faceVertexIndices[1]],
|
||||
@@ -180,17 +172,16 @@ bool RigHexIntersectionTools::planeHexCellIntersection( cvf::Vec3d*
|
||||
{
|
||||
int next = i < 3 ? i + 1 : 0;
|
||||
|
||||
bool isIntersectingPlane =
|
||||
caf::HexGridIntersectionTools::planeTriangleIntersection( fracturePlane,
|
||||
hexCorners[faceVertexIndices[i]],
|
||||
0,
|
||||
hexCorners[faceVertexIndices[next]],
|
||||
1,
|
||||
faceCenter,
|
||||
2,
|
||||
&triangleIntersectionPoint1,
|
||||
&triangleIntersectionPoint2,
|
||||
&isMostVxesOnPositiveSideOfP1 );
|
||||
bool isIntersectingPlane = caf::HexGridIntersectionTools::planeTriangleIntersection( fracturePlane,
|
||||
hexCorners[faceVertexIndices[i]],
|
||||
0,
|
||||
hexCorners[faceVertexIndices[next]],
|
||||
1,
|
||||
faceCenter,
|
||||
2,
|
||||
&triangleIntersectionPoint1,
|
||||
&triangleIntersectionPoint2,
|
||||
&isMostVxesOnPositiveSideOfP1 );
|
||||
|
||||
if ( isIntersectingPlane )
|
||||
{
|
||||
@@ -205,15 +196,14 @@ bool RigHexIntersectionTools::planeHexCellIntersection( cvf::Vec3d*
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigHexIntersectionTools::planeHexIntersectionPolygons( std::array<cvf::Vec3d, 8> hexCorners,
|
||||
cvf::Mat4d transformMatrixForPlane,
|
||||
bool RigHexIntersectionTools::planeHexIntersectionPolygons( std::array<cvf::Vec3d, 8> hexCorners,
|
||||
cvf::Mat4d transformMatrixForPlane,
|
||||
std::vector<std::vector<cvf::Vec3d>>& polygons )
|
||||
{
|
||||
bool isCellIntersected = false;
|
||||
|
||||
cvf::Plane fracturePlane;
|
||||
fracturePlane.setFromPointAndNormal( transformMatrixForPlane.translation(),
|
||||
static_cast<cvf::Vec3d>( transformMatrixForPlane.col( 2 ) ) );
|
||||
fracturePlane.setFromPointAndNormal( transformMatrixForPlane.translation(), static_cast<cvf::Vec3d>( transformMatrixForPlane.col( 2 ) ) );
|
||||
|
||||
// Find line-segments where cell and fracture plane intersects
|
||||
std::list<std::pair<cvf::Vec3d, cvf::Vec3d>> intersectionLineSegments;
|
||||
@@ -234,8 +224,7 @@ bool operator<( const HexIntersectionInfo& hi1, const HexIntersectionInfo& hi2 )
|
||||
|
||||
if ( hi1.m_hexIndex != hi2.m_hexIndex ) return hi1.m_hexIndex < hi2.m_hexIndex;
|
||||
if ( hi1.m_face != hi2.m_face ) return hi1.m_face < hi2.m_face;
|
||||
if ( hi1.m_isIntersectionEntering != hi2.m_isIntersectionEntering )
|
||||
return hi1.m_isIntersectionEntering < hi2.m_isIntersectionEntering;
|
||||
if ( hi1.m_isIntersectionEntering != hi2.m_isIntersectionEntering ) return hi1.m_isIntersectionEntering < hi2.m_isIntersectionEntering;
|
||||
if ( hi1.m_face != hi2.m_face ) return hi1.m_face < hi2.m_face;
|
||||
|
||||
if ( cvf::Math::abs( hi2.m_intersectionPoint.x() - hi1.m_intersectionPoint.x() ) > tolerance )
|
||||
|
||||
@@ -30,10 +30,7 @@
|
||||
struct HexIntersectionInfo
|
||||
{
|
||||
public:
|
||||
HexIntersectionInfo( cvf::Vec3d intersectionPoint,
|
||||
bool isIntersectionEntering,
|
||||
cvf::StructGridInterface::FaceType face,
|
||||
size_t hexIndex )
|
||||
HexIntersectionInfo( cvf::Vec3d intersectionPoint, bool isIntersectionEntering, cvf::StructGridInterface::FaceType face, size_t hexIndex )
|
||||
: m_intersectionPoint( intersectionPoint )
|
||||
, m_isIntersectionEntering( isIntersectionEntering )
|
||||
, m_face( face )
|
||||
|
||||
@@ -45,10 +45,7 @@ class LasWell;
|
||||
class SingleChannelData
|
||||
{
|
||||
public:
|
||||
SingleChannelData( const std::string& channelName,
|
||||
const std::string& unit,
|
||||
const std::string& comment,
|
||||
const RigWellLogCurveData* curveData )
|
||||
SingleChannelData( const std::string& channelName, const std::string& unit, const std::string& comment, const RigWellLogCurveData* curveData )
|
||||
: m_channelName( channelName )
|
||||
, m_unit( unit )
|
||||
, m_comment( comment )
|
||||
@@ -112,10 +109,7 @@ public:
|
||||
|
||||
double rkbDiff() { return m_rkbDiff; }
|
||||
|
||||
void addLogData( const std::string& channelName,
|
||||
const std::string& unit,
|
||||
const std::string& comment,
|
||||
const RigWellLogCurveData* curveData )
|
||||
void addLogData( const std::string& channelName, const std::string& unit, const std::string& comment, const RigWellLogCurveData* curveData )
|
||||
{
|
||||
m_logCurveData.push_back( SingleChannelData( channelName, unit, comment, curveData ) );
|
||||
|
||||
@@ -180,24 +174,15 @@ public:
|
||||
|
||||
if ( firstCurveData->depthUnit() == RiaDefines::DepthUnitType::UNIT_METER )
|
||||
{
|
||||
lasFile->AddLog( "DEPTH",
|
||||
"M",
|
||||
"Depth in meters",
|
||||
firstCurveData->depths( RiaDefines::DepthTypeEnum::MEASURED_DEPTH ) );
|
||||
lasFile->AddLog( "DEPTH", "M", "Depth in meters", firstCurveData->depths( RiaDefines::DepthTypeEnum::MEASURED_DEPTH ) );
|
||||
}
|
||||
else if ( firstCurveData->depthUnit() == RiaDefines::DepthUnitType::UNIT_FEET )
|
||||
{
|
||||
lasFile->AddLog( "DEPTH",
|
||||
"FT",
|
||||
"Depth in feet",
|
||||
firstCurveData->depths( RiaDefines::DepthTypeEnum::MEASURED_DEPTH ) );
|
||||
lasFile->AddLog( "DEPTH", "FT", "Depth in feet", firstCurveData->depths( RiaDefines::DepthTypeEnum::MEASURED_DEPTH ) );
|
||||
}
|
||||
else if ( firstCurveData->depthUnit() == RiaDefines::DepthUnitType::UNIT_NONE )
|
||||
{
|
||||
lasFile->AddLog( "DEPTH",
|
||||
"",
|
||||
"Depth in Connection number",
|
||||
firstCurveData->depths( RiaDefines::DepthTypeEnum::MEASURED_DEPTH ) );
|
||||
lasFile->AddLog( "DEPTH", "", "Depth in Connection number", firstCurveData->depths( RiaDefines::DepthTypeEnum::MEASURED_DEPTH ) );
|
||||
}
|
||||
|
||||
if ( firstCurveData->depths( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH ).size() )
|
||||
@@ -234,10 +219,7 @@ public:
|
||||
|
||||
double minDepth = 0.0;
|
||||
double maxDepth = 0.0;
|
||||
firstCurveData->calculateDepthRange( RiaDefines::DepthTypeEnum::MEASURED_DEPTH,
|
||||
firstCurveData->depthUnit(),
|
||||
&minDepth,
|
||||
&maxDepth );
|
||||
firstCurveData->calculateDepthRange( RiaDefines::DepthTypeEnum::MEASURED_DEPTH, firstCurveData->depthUnit(), &minDepth, &maxDepth );
|
||||
|
||||
lasFile->setStartDepth( minDepth );
|
||||
lasFile->setStopDepth( maxDepth );
|
||||
@@ -398,8 +380,7 @@ std::vector<QString> RigLasFileExporter::writeToFolder( const QString& exportFol
|
||||
if ( caf::Utils::fileExists( fullPathName ) && !alwaysOverwrite )
|
||||
{
|
||||
QString txt = QString( "File %1 exists.\n\nDo you want to overwrite the file?" ).arg( fullPathName );
|
||||
int ret =
|
||||
QMessageBox::question( nullptr, "LAS File Export", txt, QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes );
|
||||
int ret = QMessageBox::question( nullptr, "LAS File Export", txt, QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes );
|
||||
|
||||
if ( ret != QMessageBox::Yes ) continue;
|
||||
}
|
||||
@@ -418,8 +399,8 @@ std::vector<QString> RigLasFileExporter::writeToFolder( const QString& exportFol
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<SingleLasFileMetaData>
|
||||
RigLasFileExporter::createLasFileDescriptions( const std::vector<RimWellLogCurve*>& curves, bool convertCurveUnits )
|
||||
std::vector<SingleLasFileMetaData> RigLasFileExporter::createLasFileDescriptions( const std::vector<RimWellLogCurve*>& curves,
|
||||
bool convertCurveUnits )
|
||||
{
|
||||
std::vector<RimWellLogCurve*> eclipseCurves;
|
||||
std::vector<RimWellLogCurve*> geoMechCurves;
|
||||
@@ -526,8 +507,7 @@ void RigLasFileExporter::appendLasFileDescriptions( const std::vector<RimWellLog
|
||||
const RigWellLogCurveData* curveData = nullptr;
|
||||
if ( m_isResampleActive )
|
||||
{
|
||||
cvf::ref<RigWellLogCurveData> resampledData =
|
||||
curve->curveData()->calculateResampledCurveData( m_resamplingInterval );
|
||||
cvf::ref<RigWellLogCurveData> resampledData = curve->curveData()->calculateResampledCurveData( m_resamplingInterval );
|
||||
m_resampledCurveDatas.push_back( resampledData.p() );
|
||||
|
||||
curveData = resampledData.p();
|
||||
|
||||
@@ -45,8 +45,7 @@ public:
|
||||
bool convertCurveUnits = false );
|
||||
|
||||
private:
|
||||
std::vector<SingleLasFileMetaData> createLasFileDescriptions( const std::vector<RimWellLogCurve*>& curves,
|
||||
bool convertCurveUnits );
|
||||
std::vector<SingleLasFileMetaData> createLasFileDescriptions( const std::vector<RimWellLogCurve*>& curves, bool convertCurveUnits );
|
||||
void appendLasFileDescriptions( const std::vector<RimWellLogCurve*>& curves,
|
||||
std::vector<SingleLasFileMetaData>* lasFileDescriptions,
|
||||
bool convertCurveUnits );
|
||||
|
||||
@@ -556,14 +556,10 @@ void RigMainGrid::addUnNamedFaultFaces( int gcIdx,
|
||||
m_cells[neighborReservoirCellIdx].faceIndices( StructGridInterface::oppositeFace( face ), &nbFaceIdxs );
|
||||
|
||||
bool sharedFaceVertices = true;
|
||||
if ( sharedFaceVertices && vxs[faceIdxs[0]].pointDistance( vxs[nbFaceIdxs[0]] ) > tolerance )
|
||||
sharedFaceVertices = false;
|
||||
if ( sharedFaceVertices && vxs[faceIdxs[1]].pointDistance( vxs[nbFaceIdxs[3]] ) > tolerance )
|
||||
sharedFaceVertices = false;
|
||||
if ( sharedFaceVertices && vxs[faceIdxs[2]].pointDistance( vxs[nbFaceIdxs[2]] ) > tolerance )
|
||||
sharedFaceVertices = false;
|
||||
if ( sharedFaceVertices && vxs[faceIdxs[3]].pointDistance( vxs[nbFaceIdxs[1]] ) > tolerance )
|
||||
sharedFaceVertices = false;
|
||||
if ( sharedFaceVertices && vxs[faceIdxs[0]].pointDistance( vxs[nbFaceIdxs[0]] ) > tolerance ) sharedFaceVertices = false;
|
||||
if ( sharedFaceVertices && vxs[faceIdxs[1]].pointDistance( vxs[nbFaceIdxs[3]] ) > tolerance ) sharedFaceVertices = false;
|
||||
if ( sharedFaceVertices && vxs[faceIdxs[2]].pointDistance( vxs[nbFaceIdxs[2]] ) > tolerance ) sharedFaceVertices = false;
|
||||
if ( sharedFaceVertices && vxs[faceIdxs[3]].pointDistance( vxs[nbFaceIdxs[1]] ) > tolerance ) sharedFaceVertices = false;
|
||||
|
||||
if ( sharedFaceVertices )
|
||||
{
|
||||
@@ -671,10 +667,8 @@ bool RigMainGrid::isFaceNormalsOutwards() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigMainGrid::computeFaceNormalsDirection( const std::vector<size_t>& reservoirCellIndices ) const
|
||||
{
|
||||
auto isValidAndFaceNormalDir = []( const double ijSize,
|
||||
const double kSize,
|
||||
const RigCell& cell,
|
||||
cvf::StructGridInterface::FaceType face ) -> std::pair<bool, bool> {
|
||||
auto isValidAndFaceNormalDir =
|
||||
[]( const double ijSize, const double kSize, const RigCell& cell, cvf::StructGridInterface::FaceType face ) -> std::pair<bool, bool> {
|
||||
const cvf::Vec3d cellCenter = cell.center();
|
||||
const cvf::Vec3d faceCenter = cell.faceCenter( face );
|
||||
const cvf::Vec3d faceNormal = cell.faceNormalWithAreaLength( face );
|
||||
@@ -708,14 +702,10 @@ void RigMainGrid::computeFaceNormalsDirection( const std::vector<size_t>& reserv
|
||||
const double cellVolume = cell.volume();
|
||||
if ( cellVolume < characteristicVolume * 0.8 ) continue;
|
||||
|
||||
auto [isValid1, direction1] =
|
||||
isValidAndFaceNormalDir( ijSize, kSize, cell, cvf::StructGridInterface::FaceType::NEG_I );
|
||||
auto [isValid2, direction2] =
|
||||
isValidAndFaceNormalDir( ijSize, kSize, cell, cvf::StructGridInterface::FaceType::POS_I );
|
||||
auto [isValid3, direction3] =
|
||||
isValidAndFaceNormalDir( ijSize, kSize, cell, cvf::StructGridInterface::FaceType::NEG_J );
|
||||
auto [isValid4, direction4] =
|
||||
isValidAndFaceNormalDir( ijSize, kSize, cell, cvf::StructGridInterface::FaceType::POS_J );
|
||||
auto [isValid1, direction1] = isValidAndFaceNormalDir( ijSize, kSize, cell, cvf::StructGridInterface::FaceType::NEG_I );
|
||||
auto [isValid2, direction2] = isValidAndFaceNormalDir( ijSize, kSize, cell, cvf::StructGridInterface::FaceType::POS_I );
|
||||
auto [isValid3, direction3] = isValidAndFaceNormalDir( ijSize, kSize, cell, cvf::StructGridInterface::FaceType::NEG_J );
|
||||
auto [isValid4, direction4] = isValidAndFaceNormalDir( ijSize, kSize, cell, cvf::StructGridInterface::FaceType::POS_J );
|
||||
|
||||
if ( !isValid1 || !isValid2 || !isValid3 || !isValid4 ) continue;
|
||||
|
||||
@@ -746,8 +736,7 @@ void RigMainGrid::computeFaceNormalsDirection( const std::vector<size_t>& reserv
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RigFault* RigMainGrid::findFaultFromCellIndexAndCellFace( size_t reservoirCellIndex,
|
||||
cvf::StructGridInterface::FaceType face ) const
|
||||
const RigFault* RigMainGrid::findFaultFromCellIndexAndCellFace( size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face ) const
|
||||
{
|
||||
if ( m_faultsPrCellAcc.isNull() ) return nullptr;
|
||||
|
||||
@@ -904,8 +893,7 @@ void RigMainGrid::buildCellSearchTreeOptimized( size_t cellsPerBoundingBox )
|
||||
const auto& localCell = subGrid->cell( localIdx );
|
||||
if ( localCell.mainGridCellIndex() == cellIdx )
|
||||
{
|
||||
aggregatedCellIndices.push_back(
|
||||
static_cast<int>( subGrid->reservoirCellIndex( localIdx ) ) );
|
||||
aggregatedCellIndices.push_back( static_cast<int>( subGrid->reservoirCellIndex( localIdx ) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -942,9 +930,7 @@ void RigMainGrid::buildCellSearchTreeOptimized( size_t cellsPerBoundingBox )
|
||||
threadCellIndicesForBoundingBoxes[i].begin(),
|
||||
threadCellIndicesForBoundingBoxes[i].end() );
|
||||
|
||||
cellBoundingBoxes.insert( cellBoundingBoxes.end(),
|
||||
threadCellBoundingBoxes[i].begin(),
|
||||
threadCellBoundingBoxes[i].end() );
|
||||
cellBoundingBoxes.insert( cellBoundingBoxes.end(), threadCellBoundingBoxes[i].begin(), threadCellBoundingBoxes[i].end() );
|
||||
}
|
||||
|
||||
m_cellSearchTree = new cvf::BoundingBoxTree;
|
||||
|
||||
@@ -84,8 +84,7 @@ public:
|
||||
|
||||
void distributeNNCsToFaults();
|
||||
|
||||
const RigFault* findFaultFromCellIndexAndCellFace( size_t reservoirCellIndex,
|
||||
cvf::StructGridInterface::FaceType face ) const;
|
||||
const RigFault* findFaultFromCellIndexAndCellFace( size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face ) const;
|
||||
bool isFaceNormalsOutwards() const;
|
||||
void computeFaceNormalsDirection( const std::vector<size_t>& reservoirCellIndices ) const;
|
||||
|
||||
|
||||
@@ -47,9 +47,7 @@ RigNNCData::RigNNCData()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigNNCData::setSourceDataForProcessing( RigMainGrid* mainGrid,
|
||||
const RigActiveCellInfo* activeCellInfo,
|
||||
bool includeInactiveCells )
|
||||
void RigNNCData::setSourceDataForProcessing( RigMainGrid* mainGrid, const RigActiveCellInfo* activeCellInfo, bool includeInactiveCells )
|
||||
{
|
||||
m_mainGrid = mainGrid;
|
||||
m_activeCellInfo = activeCellInfo;
|
||||
@@ -77,18 +75,14 @@ void RigNNCData::buildPolygonsForEclipseConnections()
|
||||
std::vector<cvf::Vec3d> connectionIntersections;
|
||||
cvf::StructGridInterface::FaceType connectionFace = cvf::StructGridInterface::NO_FACE;
|
||||
|
||||
connectionFace = RigCellFaceGeometryTools::calculateCellFaceOverlap( c1,
|
||||
c2,
|
||||
*m_mainGrid,
|
||||
&connectionPolygon,
|
||||
&connectionIntersections );
|
||||
connectionFace =
|
||||
RigCellFaceGeometryTools::calculateCellFaceOverlap( c1, c2, *m_mainGrid, &connectionPolygon, &connectionIntersections );
|
||||
|
||||
if ( connectionFace != cvf::StructGridInterface::NO_FACE )
|
||||
{
|
||||
m_connections[cnIdx].setFace( connectionFace );
|
||||
m_connections[cnIdx].setPolygon( RigCellFaceGeometryTools::extractPolygon( m_mainGrid->nodes(),
|
||||
connectionPolygon,
|
||||
connectionIntersections ) );
|
||||
m_connections[cnIdx].setPolygon(
|
||||
RigCellFaceGeometryTools::extractPolygon( m_mainGrid->nodes(), connectionPolygon, connectionIntersections ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,9 +92,7 @@ void RigNNCData::buildPolygonsForEclipseConnections()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigNNCData::computeAdditionalNncs( const RigMainGrid* mainGrid,
|
||||
const RigActiveCellInfo* activeCellInfo,
|
||||
bool includeInactiveCells )
|
||||
void RigNNCData::computeAdditionalNncs( const RigMainGrid* mainGrid, const RigActiveCellInfo* activeCellInfo, bool includeInactiveCells )
|
||||
{
|
||||
RigConnectionContainer otherConnections =
|
||||
RigCellFaceGeometryTools::computeOtherNncs( mainGrid, m_connections, activeCellInfo, includeInactiveCells );
|
||||
@@ -143,8 +135,7 @@ size_t RigNNCData::connectionsWithNoCommonArea( QStringList& connectionTextFirst
|
||||
{
|
||||
size_t gridLocalCellIndex;
|
||||
const RigGridBase* hostGrid =
|
||||
m_mainGrid->gridAndGridLocalIdxFromGlobalCellIdx( m_connections[connIndex].c1GlobIdx(),
|
||||
&gridLocalCellIndex );
|
||||
m_mainGrid->gridAndGridLocalIdxFromGlobalCellIdx( m_connections[connIndex].c1GlobIdx(), &gridLocalCellIndex );
|
||||
|
||||
size_t i, j, k;
|
||||
if ( hostGrid->ijkFromCellIndex( gridLocalCellIndex, &i, &j, &k ) )
|
||||
@@ -166,8 +157,7 @@ size_t RigNNCData::connectionsWithNoCommonArea( QStringList& connectionTextFirst
|
||||
{
|
||||
size_t gridLocalCellIndex;
|
||||
const RigGridBase* hostGrid =
|
||||
m_mainGrid->gridAndGridLocalIdxFromGlobalCellIdx( m_connections[connIndex].c2GlobIdx(),
|
||||
&gridLocalCellIndex );
|
||||
m_mainGrid->gridAndGridLocalIdxFromGlobalCellIdx( m_connections[connIndex].c2GlobIdx(), &gridLocalCellIndex );
|
||||
|
||||
size_t i, j, k;
|
||||
if ( hostGrid->ijkFromCellIndex( gridLocalCellIndex, &i, &j, &k ) )
|
||||
@@ -363,8 +353,7 @@ std::vector<std::vector<double>>& RigNNCData::makeDynamicConnectionScalarResult(
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<std::vector<double>>*
|
||||
RigNNCData::dynamicConnectionScalarResult( const RigEclipseResultAddress& resVarAddr ) const
|
||||
const std::vector<std::vector<double>>* RigNNCData::dynamicConnectionScalarResult( const RigEclipseResultAddress& resVarAddr ) const
|
||||
{
|
||||
QString nncDataType = getNNCDataTypeFromScalarResultIndex( resVarAddr );
|
||||
if ( nncDataType.isNull() ) return nullptr;
|
||||
@@ -384,8 +373,7 @@ const std::vector<std::vector<double>>*
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<double>* RigNNCData::dynamicConnectionScalarResult( const RigEclipseResultAddress& resVarAddr,
|
||||
size_t timeStep ) const
|
||||
const std::vector<double>* RigNNCData::dynamicConnectionScalarResult( const RigEclipseResultAddress& resVarAddr, size_t timeStep ) const
|
||||
{
|
||||
QString nncDataType = getNNCDataTypeFromScalarResultIndex( resVarAddr );
|
||||
if ( nncDataType.isNull() ) return nullptr;
|
||||
@@ -444,8 +432,7 @@ std::vector<std::vector<double>>& RigNNCData::makeGeneratedConnectionScalarResul
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<std::vector<double>>*
|
||||
RigNNCData::generatedConnectionScalarResult( const RigEclipseResultAddress& resVarAddr ) const
|
||||
const std::vector<std::vector<double>>* RigNNCData::generatedConnectionScalarResult( const RigEclipseResultAddress& resVarAddr ) const
|
||||
{
|
||||
QString nncDataType = getNNCDataTypeFromScalarResultIndex( resVarAddr );
|
||||
if ( nncDataType.isNull() ) return nullptr;
|
||||
@@ -465,8 +452,7 @@ const std::vector<std::vector<double>>*
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<double>* RigNNCData::generatedConnectionScalarResult( const RigEclipseResultAddress& resVarAddr,
|
||||
size_t timeStep ) const
|
||||
const std::vector<double>* RigNNCData::generatedConnectionScalarResult( const RigEclipseResultAddress& resVarAddr, size_t timeStep ) const
|
||||
{
|
||||
QString nncDataType = getNNCDataTypeFromScalarResultIndex( resVarAddr );
|
||||
if ( nncDataType.isNull() ) return nullptr;
|
||||
@@ -539,8 +525,7 @@ const std::vector<std::vector<double>>* RigNNCData::generatedConnectionScalarRes
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<double>* RigNNCData::generatedConnectionScalarResultByName( const QString& nncDataType,
|
||||
size_t timeStep ) const
|
||||
const std::vector<double>* RigNNCData::generatedConnectionScalarResultByName( const QString& nncDataType, size_t timeStep ) const
|
||||
{
|
||||
auto it = m_connectionResults.find( nncDataType );
|
||||
if ( it != m_connectionResults.end() )
|
||||
@@ -591,13 +576,11 @@ std::vector<QString> RigNNCData::availableProperties( NNCResultType resultType )
|
||||
|
||||
for ( auto it : m_connectionResults )
|
||||
{
|
||||
if ( resultType == NNCResultType::NNC_STATIC && it.second.size() == 1 && it.second[0].size() > 0 &&
|
||||
isNative( it.first ) )
|
||||
if ( resultType == NNCResultType::NNC_STATIC && it.second.size() == 1 && it.second[0].size() > 0 && isNative( it.first ) )
|
||||
{
|
||||
properties.push_back( it.first );
|
||||
}
|
||||
else if ( resultType == NNCResultType::NNC_DYNAMIC && it.second.size() > 1 && it.second[0].size() > 0 &&
|
||||
isNative( it.first ) )
|
||||
else if ( resultType == NNCResultType::NNC_DYNAMIC && it.second.size() > 1 && it.second[0].size() > 0 && isNative( it.first ) )
|
||||
{
|
||||
properties.push_back( it.first );
|
||||
}
|
||||
@@ -661,8 +644,7 @@ bool RigNNCData::generateScalarValues( const RigEclipseResultAddress& resVarAddr
|
||||
for ( size_t dataIdx = 0; dataIdx < m_connections.size(); dataIdx++ )
|
||||
{
|
||||
double area = 0.0;
|
||||
if ( m_connections[dataIdx].hasCommonArea() )
|
||||
area = cvf::GeometryTools::polygonArea( m_connections[dataIdx].polygon() );
|
||||
if ( m_connections[dataIdx].hasCommonArea() ) area = cvf::GeometryTools::polygonArea( m_connections[dataIdx].polygon() );
|
||||
areas[dataIdx] = area;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,9 +50,7 @@ public:
|
||||
|
||||
RigNNCData();
|
||||
|
||||
void setSourceDataForProcessing( RigMainGrid* mainGrid,
|
||||
const RigActiveCellInfo* activeCellInfo,
|
||||
bool includeInactiveCells );
|
||||
void setSourceDataForProcessing( RigMainGrid* mainGrid, const RigActiveCellInfo* activeCellInfo, bool includeInactiveCells );
|
||||
|
||||
void setEclipseConnections( RigConnectionContainer& eclipseConnections );
|
||||
void buildPolygonsForEclipseConnections();
|
||||
@@ -65,25 +63,23 @@ public:
|
||||
std::vector<double>& makeStaticConnectionScalarResult( QString nncDataType );
|
||||
const std::vector<double>* staticConnectionScalarResult( const RigEclipseResultAddress& resVarAddr ) const;
|
||||
const std::vector<double>* staticConnectionScalarResultByName( const QString& nncDataType ) const;
|
||||
void makeScalarResultAndSetValues( const QString& nncDataType, const std::vector<double>& values );
|
||||
void makeScalarResultAndSetValues( const QString& nncDataType, const std::vector<double>& values );
|
||||
|
||||
std::vector<std::vector<double>>& makeDynamicConnectionScalarResult( QString nncDataType, size_t timeStepCount );
|
||||
std::vector<std::vector<double>>& makeDynamicConnectionScalarResult( QString nncDataType, size_t timeStepCount );
|
||||
const std::vector<std::vector<double>>* dynamicConnectionScalarResult( const RigEclipseResultAddress& resVarAddr ) const;
|
||||
const std::vector<double>* dynamicConnectionScalarResult( const RigEclipseResultAddress& resVarAddr,
|
||||
size_t timeStep ) const;
|
||||
const std::vector<double>* dynamicConnectionScalarResult( const RigEclipseResultAddress& resVarAddr, size_t timeStep ) const;
|
||||
const std::vector<std::vector<double>>* dynamicConnectionScalarResultByName( const QString& nncDataType ) const;
|
||||
const std::vector<double>* dynamicConnectionScalarResultByName( const QString& nncDataType, size_t timeStep ) const;
|
||||
const std::vector<double>* dynamicConnectionScalarResultByName( const QString& nncDataType, size_t timeStep ) const;
|
||||
|
||||
std::vector<std::vector<double>>& makeGeneratedConnectionScalarResult( QString nncDataType, size_t timeStepCount );
|
||||
std::vector<std::vector<double>>& makeGeneratedConnectionScalarResult( QString nncDataType, size_t timeStepCount );
|
||||
const std::vector<std::vector<double>>* generatedConnectionScalarResult( const RigEclipseResultAddress& resVarAddr ) const;
|
||||
const std::vector<double>* generatedConnectionScalarResult( const RigEclipseResultAddress& resVarAddr,
|
||||
size_t timeStep ) const;
|
||||
const std::vector<double>* generatedConnectionScalarResult( const RigEclipseResultAddress& resVarAddr, size_t timeStep ) const;
|
||||
std::vector<std::vector<double>>* generatedConnectionScalarResult( const RigEclipseResultAddress& resVarAddr );
|
||||
std::vector<double>* generatedConnectionScalarResult( const RigEclipseResultAddress& resVarAddr, size_t timeStep );
|
||||
std::vector<double>* generatedConnectionScalarResult( const RigEclipseResultAddress& resVarAddr, size_t timeStep );
|
||||
const std::vector<std::vector<double>>* generatedConnectionScalarResultByName( const QString& nncDataType ) const;
|
||||
const std::vector<double>* generatedConnectionScalarResultByName( const QString& nncDataType, size_t timeStep ) const;
|
||||
std::vector<std::vector<double>>* generatedConnectionScalarResultByName( const QString& nncDataType );
|
||||
std::vector<double>* generatedConnectionScalarResultByName( const QString& nncDataType, size_t timeStep );
|
||||
const std::vector<double>* generatedConnectionScalarResultByName( const QString& nncDataType, size_t timeStep ) const;
|
||||
std::vector<std::vector<double>>* generatedConnectionScalarResultByName( const QString& nncDataType );
|
||||
std::vector<double>* generatedConnectionScalarResultByName( const QString& nncDataType, size_t timeStep );
|
||||
|
||||
std::vector<QString> availableProperties( NNCResultType resultType ) const;
|
||||
|
||||
@@ -97,9 +93,7 @@ private:
|
||||
const QString getNNCDataTypeFromScalarResultIndex( const RigEclipseResultAddress& resVarAddr ) const;
|
||||
bool isNative( QString nncDataType ) const;
|
||||
|
||||
void computeAdditionalNncs( const RigMainGrid* mainGrid,
|
||||
const RigActiveCellInfo* activeCellInfo,
|
||||
bool includeInactiveCells );
|
||||
void computeAdditionalNncs( const RigMainGrid* mainGrid, const RigActiveCellInfo* activeCellInfo, bool includeInactiveCells );
|
||||
|
||||
size_t connectionsWithNoCommonArea( QStringList& connectionTextFirstItems, size_t maxItemCount );
|
||||
|
||||
|
||||
@@ -59,10 +59,7 @@ RigConnection::RigConnection( unsigned c1GlobIdx,
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigConnection::RigConnection( size_t c1GlobIdx,
|
||||
size_t c2GlobIdx,
|
||||
cvf::StructGridInterface::FaceType c1Face,
|
||||
const std::vector<cvf::Vec3f>& polygon )
|
||||
RigConnection::RigConnection( size_t c1GlobIdx, size_t c2GlobIdx, cvf::StructGridInterface::FaceType c1Face, const std::vector<cvf::Vec3f>& polygon )
|
||||
: m_c1GlobIdx( static_cast<unsigned>( c1GlobIdx ) )
|
||||
, m_c2GlobIdx( static_cast<unsigned>( c2GlobIdx ) )
|
||||
, m_c1Face( static_cast<unsigned char>( c1Face ) )
|
||||
|
||||
@@ -50,10 +50,7 @@ public:
|
||||
|
||||
inline size_t c1GlobIdx() const { return m_c1GlobIdx; }
|
||||
inline size_t c2GlobIdx() const { return m_c2GlobIdx; }
|
||||
inline cvf::StructGridInterface::FaceType face() const
|
||||
{
|
||||
return static_cast<cvf::StructGridInterface::FaceType>( m_c1Face );
|
||||
}
|
||||
inline cvf::StructGridInterface::FaceType face() const { return static_cast<cvf::StructGridInterface::FaceType>( m_c1Face ); }
|
||||
inline void setFace( cvf::StructGridInterface::FaceType face ) { m_c1Face = static_cast<unsigned char>( face ); }
|
||||
inline const std::vector<cvf::Vec3f>& polygon() const { return m_polygon; }
|
||||
inline void setPolygon( const std::vector<cvf::Vec3f>& polygon ) { m_polygon = polygon; }
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigNumberOfFloodedPoreVolumesCalculator::RigNumberOfFloodedPoreVolumesCalculator( RimEclipseCase* caseToApply,
|
||||
RigNumberOfFloodedPoreVolumesCalculator::RigNumberOfFloodedPoreVolumesCalculator( RimEclipseCase* caseToApply,
|
||||
const std::vector<QString>& tracerNames )
|
||||
{
|
||||
RigMainGrid* mainGrid = caseToApply->eclipseCaseData()->mainGrid();
|
||||
@@ -45,32 +45,24 @@ RigNumberOfFloodedPoreVolumesCalculator::RigNumberOfFloodedPoreVolumesCalculator
|
||||
RigEclipseCaseData* eclipseCaseData = caseToApply->eclipseCaseData();
|
||||
RigCaseCellResultsData* gridCellResults = caseToApply->results( RiaDefines::PorosityModelType::MATRIX_MODEL );
|
||||
|
||||
RigActiveCellInfo* actCellInfo =
|
||||
caseToApply->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
|
||||
size_t resultCellCount = actCellInfo->reservoirActiveCellCount();
|
||||
RigActiveCellInfo* actCellInfo = caseToApply->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
|
||||
size_t resultCellCount = actCellInfo->reservoirActiveCellCount();
|
||||
|
||||
size_t timeStepCount =
|
||||
caseToApply->eclipseCaseData()->results( RiaDefines::PorosityModelType::MATRIX_MODEL )->maxTimeStepCount();
|
||||
size_t totalProgress = tracerNames.size() + 8 + timeStepCount + 2 * timeStepCount;
|
||||
size_t timeStepCount = caseToApply->eclipseCaseData()->results( RiaDefines::PorosityModelType::MATRIX_MODEL )->maxTimeStepCount();
|
||||
size_t totalProgress = tracerNames.size() + 8 + timeStepCount + 2 * timeStepCount;
|
||||
caf::ProgressInfo progress( totalProgress, "Calculating number of flooded mobile pore volumes." );
|
||||
progress.setProgressDescription( "Loading required results" );
|
||||
// PORV
|
||||
const std::vector<double>* porvResults = nullptr;
|
||||
std::vector<double> porvActiveCellsResultStorage;
|
||||
porvResults = RigCaseCellResultsData::getResultIndexableStaticResult( actCellInfo,
|
||||
gridCellResults,
|
||||
"PORV",
|
||||
porvActiveCellsResultStorage );
|
||||
porvResults = RigCaseCellResultsData::getResultIndexableStaticResult( actCellInfo, gridCellResults, "PORV", porvActiveCellsResultStorage );
|
||||
|
||||
progress.incrementProgress();
|
||||
|
||||
// SWCR if defined
|
||||
|
||||
const std::vector<double>* swcrResults = nullptr;
|
||||
swcrResults = RigCaseCellResultsData::getResultIndexableStaticResult( actCellInfo,
|
||||
gridCellResults,
|
||||
"SWCR",
|
||||
porvActiveCellsResultStorage );
|
||||
swcrResults = RigCaseCellResultsData::getResultIndexableStaticResult( actCellInfo, gridCellResults, "SWCR", porvActiveCellsResultStorage );
|
||||
progress.incrementProgress();
|
||||
|
||||
std::vector<RigEclipseResultAddress> tracerResAddrs;
|
||||
@@ -122,24 +114,24 @@ RigNumberOfFloodedPoreVolumesCalculator::RigNumberOfFloodedPoreVolumesCalculator
|
||||
const std::vector<double>* flowrateI = nullptr;
|
||||
if ( hasFlowrateI )
|
||||
{
|
||||
flowrateI = &( eclipseCaseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL )
|
||||
->cellScalarResults( flrWatIAddr, timeStep ) );
|
||||
flowrateI =
|
||||
&( eclipseCaseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL )->cellScalarResults( flrWatIAddr, timeStep ) );
|
||||
}
|
||||
flowrateIatAllTimeSteps.push_back( flowrateI );
|
||||
|
||||
const std::vector<double>* flowrateJ = nullptr;
|
||||
if ( hasFlowrateJ )
|
||||
{
|
||||
flowrateJ = &( eclipseCaseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL )
|
||||
->cellScalarResults( flrWatJAddr, timeStep ) );
|
||||
flowrateJ =
|
||||
&( eclipseCaseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL )->cellScalarResults( flrWatJAddr, timeStep ) );
|
||||
}
|
||||
flowrateJatAllTimeSteps.push_back( flowrateJ );
|
||||
|
||||
const std::vector<double>* flowrateK = nullptr;
|
||||
if ( hasFlowrateK )
|
||||
{
|
||||
flowrateK = &( eclipseCaseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL )
|
||||
->cellScalarResults( flrWatKAddr, timeStep ) );
|
||||
flowrateK =
|
||||
&( eclipseCaseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL )->cellScalarResults( flrWatKAddr, timeStep ) );
|
||||
}
|
||||
flowrateKatAllTimeSteps.push_back( flowrateK );
|
||||
|
||||
@@ -153,8 +145,7 @@ RigNumberOfFloodedPoreVolumesCalculator::RigNumberOfFloodedPoreVolumesCalculator
|
||||
for ( const RigEclipseResultAddress& tracerResAddr : tracerResAddrs )
|
||||
{
|
||||
const std::vector<double>* tracerResult =
|
||||
&( eclipseCaseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL )
|
||||
->cellScalarResults( tracerResAddr, timeStep ) );
|
||||
&( eclipseCaseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL )->cellScalarResults( tracerResAddr, timeStep ) );
|
||||
|
||||
for ( size_t i = 0; i < summedTracerValues.size(); i++ )
|
||||
{
|
||||
@@ -193,22 +184,21 @@ std::vector<std::vector<double>>& RigNumberOfFloodedPoreVolumesCalculator::numbe
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigNumberOfFloodedPoreVolumesCalculator::calculate( RigMainGrid* mainGrid,
|
||||
RimEclipseCase* caseToApply,
|
||||
std::vector<double> daysSinceSimulationStart,
|
||||
const std::vector<double>* porvResultsActiveCellsOnly,
|
||||
const std::vector<double>* swcrResults,
|
||||
void RigNumberOfFloodedPoreVolumesCalculator::calculate( RigMainGrid* mainGrid,
|
||||
RimEclipseCase* caseToApply,
|
||||
std::vector<double> daysSinceSimulationStart,
|
||||
const std::vector<double>* porvResultsActiveCellsOnly,
|
||||
const std::vector<double>* swcrResults,
|
||||
std::vector<const std::vector<double>*> flowrateIatAllTimeSteps,
|
||||
std::vector<const std::vector<double>*> flowrateJatAllTimeSteps,
|
||||
std::vector<const std::vector<double>*> flowrateKatAllTimeSteps,
|
||||
const RigConnectionContainer& connections,
|
||||
std::vector<const std::vector<double>*> flowrateNNCatAllTimeSteps,
|
||||
std::vector<std::vector<double>> summedTracersAtAllTimesteps )
|
||||
std::vector<std::vector<double>> summedTracersAtAllTimesteps )
|
||||
{
|
||||
// size_t totalNumberOfCells = mainGrid->globalCellArray().size();
|
||||
RigActiveCellInfo* actCellInfo =
|
||||
caseToApply->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
|
||||
size_t resultCellCount = actCellInfo->reservoirActiveCellCount();
|
||||
RigActiveCellInfo* actCellInfo = caseToApply->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
|
||||
size_t resultCellCount = actCellInfo->reservoirActiveCellCount();
|
||||
|
||||
caf::ProgressInfo progress( 2 * daysSinceSimulationStart.size(), "" );
|
||||
|
||||
@@ -245,11 +235,7 @@ void RigNumberOfFloodedPoreVolumesCalculator::calculate( RigMainGrid*
|
||||
|
||||
if ( flowrateNNC && flowrateNNC->size() > 0 )
|
||||
{
|
||||
distributeNNCflow( connections,
|
||||
caseToApply,
|
||||
summedTracersAtAllTimesteps[timeStep - 1],
|
||||
flowrateNNC,
|
||||
totoalFlowrateIntoCell );
|
||||
distributeNNCflow( connections, caseToApply, summedTracersAtAllTimesteps[timeStep - 1], flowrateNNC, totoalFlowrateIntoCell );
|
||||
}
|
||||
|
||||
std::vector<double> CellQwIn( resultCellCount );
|
||||
@@ -301,8 +287,7 @@ void RigNumberOfFloodedPoreVolumesCalculator::distributeNNCflow( const RigConnec
|
||||
const std::vector<double>* flowrateNNC,
|
||||
std::vector<double>& flowrateIntoCell )
|
||||
{
|
||||
RigActiveCellInfo* actCellInfo =
|
||||
caseToApply->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
|
||||
RigActiveCellInfo* actCellInfo = caseToApply->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
|
||||
|
||||
// Find max count for connections with result. Allen results introduce connections without results
|
||||
size_t connectionsWithResultCount = std::min( flowrateNNC->size(), connections.size() );
|
||||
@@ -340,10 +325,9 @@ void RigNumberOfFloodedPoreVolumesCalculator::distributeNeighbourCellFlow( RigMa
|
||||
const std::vector<double>* flrWatResultI,
|
||||
const std::vector<double>* flrWatResultJ,
|
||||
const std::vector<double>* flrWatResultK,
|
||||
std::vector<double>& totalFlowrateIntoCell )
|
||||
std::vector<double>& totalFlowrateIntoCell )
|
||||
{
|
||||
RigActiveCellInfo* actCellInfo =
|
||||
caseToApply->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
|
||||
RigActiveCellInfo* actCellInfo = caseToApply->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
|
||||
|
||||
for ( size_t globalCellIndex = 0; globalCellIndex < mainGrid->globalCellArray().size(); globalCellIndex++ )
|
||||
{
|
||||
|
||||
@@ -86,9 +86,7 @@ std::vector<std::pair<double, double>> RigPressureDepthData::getPressureDepthVal
|
||||
std::vector<double> RigPressureDepthData::tvdmsl() const
|
||||
{
|
||||
std::vector<double> vals;
|
||||
std::transform( std::begin( m_values ), std::end( m_values ), std::back_inserter( vals ), []( auto const& v ) {
|
||||
return v.second;
|
||||
} );
|
||||
std::transform( std::begin( m_values ), std::end( m_values ), std::back_inserter( vals ), []( auto const& v ) { return v.second; } );
|
||||
return vals;
|
||||
}
|
||||
|
||||
@@ -98,8 +96,6 @@ std::vector<double> RigPressureDepthData::tvdmsl() const
|
||||
std::vector<double> RigPressureDepthData::pressure() const
|
||||
{
|
||||
std::vector<double> vals;
|
||||
std::transform( std::begin( m_values ), std::end( m_values ), std::back_inserter( vals ), []( auto const& v ) {
|
||||
return v.first;
|
||||
} );
|
||||
std::transform( std::begin( m_values ), std::end( m_values ), std::back_inserter( vals ), []( auto const& v ) { return v.first; } );
|
||||
return vals;
|
||||
}
|
||||
|
||||
@@ -141,10 +141,7 @@ void RigReservoirBuilderMock::appendCubeNodes( const cvf::Vec3d& min, const cvf:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigReservoirBuilderMock::appendCells( size_t nodeStartIndex,
|
||||
size_t cellCount,
|
||||
RigGridBase* hostGrid,
|
||||
std::vector<RigCell>& cells )
|
||||
void RigReservoirBuilderMock::appendCells( size_t nodeStartIndex, size_t cellCount, RigGridBase* hostGrid, std::vector<RigCell>& cells )
|
||||
{
|
||||
size_t cellIndexStart = cells.size();
|
||||
cells.resize( cells.size() + cellCount );
|
||||
@@ -216,14 +213,14 @@ void RigReservoirBuilderMock::populateReservoir( RigEclipseCaseData* eclipseCase
|
||||
localGrid->setParentGrid( eclipseCase->mainGrid() );
|
||||
|
||||
localGrid->setIndexToStartOfCells( mainGridNodes.size() / 8 );
|
||||
cvf::Vec3st gridPointDimensions( lgr.m_singleCellRefinementFactors.x() * ( lgr.m_mainGridMaxCellPosition.x() -
|
||||
lgr.m_mainGridMinCellPosition.x() + 1 ) +
|
||||
cvf::Vec3st gridPointDimensions( lgr.m_singleCellRefinementFactors.x() *
|
||||
( lgr.m_mainGridMaxCellPosition.x() - lgr.m_mainGridMinCellPosition.x() + 1 ) +
|
||||
1,
|
||||
lgr.m_singleCellRefinementFactors.y() * ( lgr.m_mainGridMaxCellPosition.y() -
|
||||
lgr.m_mainGridMinCellPosition.y() + 1 ) +
|
||||
lgr.m_singleCellRefinementFactors.y() *
|
||||
( lgr.m_mainGridMaxCellPosition.y() - lgr.m_mainGridMinCellPosition.y() + 1 ) +
|
||||
1,
|
||||
lgr.m_singleCellRefinementFactors.z() * ( lgr.m_mainGridMaxCellPosition.z() -
|
||||
lgr.m_mainGridMinCellPosition.z() + 1 ) +
|
||||
lgr.m_singleCellRefinementFactors.z() *
|
||||
( lgr.m_mainGridMaxCellPosition.z() - lgr.m_mainGridMinCellPosition.z() + 1 ) +
|
||||
1 );
|
||||
localGrid->setGridPointDimensions( gridPointDimensions );
|
||||
|
||||
@@ -302,9 +299,7 @@ void RigReservoirBuilderMock::setWorldCoordinates( cvf::Vec3d minWorldCoordinate
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigReservoirBuilderMock::inputProperty( RigEclipseCaseData* eclipseCase,
|
||||
const QString& propertyName,
|
||||
std::vector<double>* values )
|
||||
bool RigReservoirBuilderMock::inputProperty( RigEclipseCaseData* eclipseCase, const QString& propertyName, std::vector<double>* values )
|
||||
{
|
||||
size_t k;
|
||||
|
||||
@@ -341,10 +336,7 @@ bool RigReservoirBuilderMock::staticResult( RigEclipseCaseData* eclipseCase, con
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigReservoirBuilderMock::dynamicResult( RigEclipseCaseData* eclipseCase,
|
||||
const QString& result,
|
||||
size_t stepIndex,
|
||||
std::vector<double>* values )
|
||||
bool RigReservoirBuilderMock::dynamicResult( RigEclipseCaseData* eclipseCase, const QString& result, size_t stepIndex, std::vector<double>* values )
|
||||
{
|
||||
int resultIndex = 1;
|
||||
|
||||
@@ -363,8 +355,7 @@ bool RigReservoirBuilderMock::dynamicResult( RigEclipseCaseData* eclipseCase,
|
||||
#pragma omp parallel for
|
||||
for ( long long k = 0; k < static_cast<long long>( eclipseCase->mainGrid()->globalCellArray().size() ); k++ )
|
||||
{
|
||||
double val = offsetValue +
|
||||
scaleValue * ( ( stepIndex * 1000 + k ) % eclipseCase->mainGrid()->globalCellArray().size() );
|
||||
double val = offsetValue + scaleValue * ( ( stepIndex * 1000 + k ) % eclipseCase->mainGrid()->globalCellArray().size() );
|
||||
values->at( k ) = val;
|
||||
}
|
||||
|
||||
@@ -560,8 +551,7 @@ void RigReservoirBuilderMock::addFaults( RigEclipseCaseData* eclipseCase )
|
||||
|
||||
grid->nncData()->setEclipseConnections( nncConnections );
|
||||
|
||||
std::vector<double>& tranVals =
|
||||
grid->nncData()->makeStaticConnectionScalarResult( RiaDefines::propertyNameCombTrans() );
|
||||
std::vector<double>& tranVals = grid->nncData()->makeStaticConnectionScalarResult( RiaDefines::propertyNameCombTrans() );
|
||||
for ( size_t cIdx = 0; cIdx < tranVals.size(); ++cIdx )
|
||||
{
|
||||
tranVals[cIdx] = 0.2;
|
||||
@@ -579,14 +569,7 @@ void RigReservoirBuilderMock::enableWellData( bool enableWellData )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigReservoirBuilderMock::addNnc( RigMainGrid* grid,
|
||||
size_t i1,
|
||||
size_t j1,
|
||||
size_t k1,
|
||||
size_t i2,
|
||||
size_t j2,
|
||||
size_t k2,
|
||||
RigConnectionContainer& nncConnections )
|
||||
void RigReservoirBuilderMock::addNnc( RigMainGrid* grid, size_t i1, size_t j1, size_t k1, size_t i2, size_t j2, size_t k2, RigConnectionContainer& nncConnections )
|
||||
{
|
||||
size_t c1GlobalIndex = grid->cellIndexFromIJK( i1, j1, k1 );
|
||||
size_t c2GlobalIndex = grid->cellIndexFromIJK( i2, j2, k2 );
|
||||
|
||||
@@ -38,9 +38,7 @@ class QString;
|
||||
class LocalGridRefinement
|
||||
{
|
||||
public:
|
||||
LocalGridRefinement( const cvf::Vec3st& mainGridMin,
|
||||
const cvf::Vec3st& mainGridMax,
|
||||
const cvf::Vec3st& singleCellRefinementFactors )
|
||||
LocalGridRefinement( const cvf::Vec3st& mainGridMin, const cvf::Vec3st& mainGridMax, const cvf::Vec3st& singleCellRefinementFactors )
|
||||
{
|
||||
m_mainGridMinCellPosition = mainGridMin;
|
||||
m_mainGridMaxCellPosition = mainGridMax;
|
||||
@@ -79,21 +77,12 @@ public:
|
||||
private:
|
||||
void addFaults( RigEclipseCaseData* eclipseCase );
|
||||
|
||||
static void addNnc( RigMainGrid* grid,
|
||||
size_t i1,
|
||||
size_t j1,
|
||||
size_t k1,
|
||||
size_t i2,
|
||||
size_t j2,
|
||||
size_t k2,
|
||||
RigConnectionContainer& nncConnections );
|
||||
static void
|
||||
addNnc( RigMainGrid* grid, size_t i1, size_t j1, size_t k1, size_t i2, size_t j2, size_t k2, RigConnectionContainer& nncConnections );
|
||||
void addWellData( RigEclipseCaseData* eclipseCase, RigGridBase* grid );
|
||||
static void appendCells( size_t nodeStartIndex, size_t cellCount, RigGridBase* hostGrid, std::vector<RigCell>& cells );
|
||||
|
||||
static void appendNodes( const cvf::Vec3d& min,
|
||||
const cvf::Vec3d& max,
|
||||
const cvf::Vec3st& cubeDimension,
|
||||
std::vector<cvf::Vec3d>& nodes );
|
||||
static void appendNodes( const cvf::Vec3d& min, const cvf::Vec3d& max, const cvf::Vec3st& cubeDimension, std::vector<cvf::Vec3d>& nodes );
|
||||
static void appendCubeNodes( const cvf::Vec3d& min, const cvf::Vec3d& max, std::vector<cvf::Vec3d>& nodes );
|
||||
|
||||
size_t cellIndexFromIJK( size_t i, size_t j, size_t k ) const
|
||||
@@ -102,8 +91,7 @@ private:
|
||||
CVF_TIGHT_ASSERT( j < ( m_gridPointDimensions.y() - 1 ) );
|
||||
CVF_TIGHT_ASSERT( k < ( m_gridPointDimensions.z() - 1 ) );
|
||||
|
||||
size_t ci = i + j * ( m_gridPointDimensions.x() - 1 ) +
|
||||
k * ( ( m_gridPointDimensions.x() - 1 ) * ( m_gridPointDimensions.y() - 1 ) );
|
||||
size_t ci = i + j * ( m_gridPointDimensions.x() - 1 ) + k * ( ( m_gridPointDimensions.x() - 1 ) * ( m_gridPointDimensions.y() - 1 ) );
|
||||
return ci;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,11 +39,10 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<RigResultAccessor>
|
||||
RigResultAccessorFactory::createFromResultDefinition( const RigEclipseCaseData* eclipseCase,
|
||||
size_t gridIndex,
|
||||
size_t timeStepIndex,
|
||||
const RimEclipseResultDefinition* resultDefinition )
|
||||
cvf::ref<RigResultAccessor> RigResultAccessorFactory::createFromResultDefinition( const RigEclipseCaseData* eclipseCase,
|
||||
size_t gridIndex,
|
||||
size_t timeStepIndex,
|
||||
const RimEclipseResultDefinition* resultDefinition )
|
||||
{
|
||||
if ( resultDefinition->isFlowDiagOrInjectionFlooding() )
|
||||
{
|
||||
@@ -59,9 +58,7 @@ cvf::ref<RigResultAccessor>
|
||||
if ( !grid ) return new RigHugeValResultAccessor;
|
||||
|
||||
cvf::ref<RigResultAccessor> object =
|
||||
new RigActiveCellsResultAccessor( grid,
|
||||
resultValues,
|
||||
eclipseCase->activeCellInfo( resultDefinition->porosityModel() ) );
|
||||
new RigActiveCellsResultAccessor( grid, resultValues, eclipseCase->activeCellInfo( resultDefinition->porosityModel() ) );
|
||||
|
||||
return object;
|
||||
}
|
||||
@@ -78,10 +75,10 @@ cvf::ref<RigResultAccessor>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<RigResultAccessor> RigResultAccessorFactory::createFromResultAddress( const RigEclipseCaseData* eclipseCase,
|
||||
size_t gridIndex,
|
||||
RiaDefines::PorosityModelType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
cvf::ref<RigResultAccessor> RigResultAccessorFactory::createFromResultAddress( const RigEclipseCaseData* eclipseCase,
|
||||
size_t gridIndex,
|
||||
RiaDefines::PorosityModelType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
const RigEclipseResultAddress& resVarAddr )
|
||||
{
|
||||
if ( !eclipseCase || !eclipseCase->results( porosityModel ) || !eclipseCase->activeCellInfo( porosityModel ) )
|
||||
@@ -120,12 +117,11 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createFromResultAddress( c
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<RigResultAccessor>
|
||||
RigResultAccessorFactory::createCombinedResultAccessor( const RigEclipseCaseData* eclipseCase,
|
||||
size_t gridIndex,
|
||||
RiaDefines::PorosityModelType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
const RigEclipseResultAddress& resVarAddr )
|
||||
cvf::ref<RigResultAccessor> RigResultAccessorFactory::createCombinedResultAccessor( const RigEclipseCaseData* eclipseCase,
|
||||
size_t gridIndex,
|
||||
RiaDefines::PorosityModelType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
const RigEclipseResultAddress& resVarAddr )
|
||||
{
|
||||
CVF_ASSERT( gridIndex < eclipseCase->gridCount() );
|
||||
CVF_ASSERT( eclipseCase );
|
||||
@@ -142,25 +138,13 @@ cvf::ref<RigResultAccessor>
|
||||
cvf::ref<RigCombTransResultAccessor> cellFaceAccessObject = new RigCombTransResultAccessor( grid );
|
||||
nativeAddr.setResultName( "TRANX" );
|
||||
cvf::ref<RigResultAccessor> xTransAccessor =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
nativeAddr.setResultName( "TRANY" );
|
||||
cvf::ref<RigResultAccessor> yTransAccessor =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
nativeAddr.setResultName( "TRANZ" );
|
||||
cvf::ref<RigResultAccessor> zTransAccessor =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
|
||||
cellFaceAccessObject->setTransResultAccessors( xTransAccessor.p(), yTransAccessor.p(), zTransAccessor.p() );
|
||||
|
||||
@@ -173,44 +157,25 @@ cvf::ref<RigResultAccessor>
|
||||
cvf::ref<RigCombMultResultAccessor> cellFaceAccessObject = new RigCombMultResultAccessor( grid );
|
||||
|
||||
nativeAddr.setResultName( "MULTX" );
|
||||
cvf::ref<RigResultAccessor> multXPos = RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
cvf::ref<RigResultAccessor> multXPos =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
nativeAddr.setResultName( "MULTX-" );
|
||||
cvf::ref<RigResultAccessor> multXNeg = RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
cvf::ref<RigResultAccessor> multXNeg =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
nativeAddr.setResultName( "MULTY" );
|
||||
cvf::ref<RigResultAccessor> multYPos = RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
cvf::ref<RigResultAccessor> multYPos =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
nativeAddr.setResultName( "MULTY-" );
|
||||
cvf::ref<RigResultAccessor> multYNeg = RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
cvf::ref<RigResultAccessor> multYNeg =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
nativeAddr.setResultName( "MULTZ" );
|
||||
cvf::ref<RigResultAccessor> multZPos = RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
cvf::ref<RigResultAccessor> multZPos =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
nativeAddr.setResultName( "MULTZ-" );
|
||||
cvf::ref<RigResultAccessor> multZNeg = RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
cvf::ref<RigResultAccessor> multZNeg =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
|
||||
cellFaceAccessObject
|
||||
->setMultResultAccessors( multXPos.p(), multXNeg.p(), multYPos.p(), multYNeg.p(), multZPos.p(), multZNeg.p() );
|
||||
cellFaceAccessObject->setMultResultAccessors( multXPos.p(), multXNeg.p(), multYPos.p(), multYNeg.p(), multZPos.p(), multZNeg.p() );
|
||||
|
||||
return cellFaceAccessObject;
|
||||
}
|
||||
@@ -222,25 +187,13 @@ cvf::ref<RigResultAccessor>
|
||||
|
||||
nativeAddr.setResultName( RiaResultNames::riTranXResultName() );
|
||||
cvf::ref<RigResultAccessor> xTransAccessor =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
nativeAddr.setResultName( RiaResultNames::riTranYResultName() );
|
||||
cvf::ref<RigResultAccessor> yTransAccessor =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
nativeAddr.setResultName( RiaResultNames::riTranZResultName() );
|
||||
cvf::ref<RigResultAccessor> zTransAccessor =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
|
||||
cellFaceAccessObject->setTransResultAccessors( xTransAccessor.p(), yTransAccessor.p(), zTransAccessor.p() );
|
||||
|
||||
@@ -253,25 +206,13 @@ cvf::ref<RigResultAccessor>
|
||||
cvf::ref<RigCombTransResultAccessor> cellFaceAccessObject = new RigCombTransResultAccessor( grid );
|
||||
nativeAddr.setResultName( RiaResultNames::riMultXResultName() );
|
||||
cvf::ref<RigResultAccessor> xRiMultAccessor =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
nativeAddr.setResultName( RiaResultNames::riMultYResultName() );
|
||||
cvf::ref<RigResultAccessor> yRiMultAccessor =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
nativeAddr.setResultName( RiaResultNames::riMultZResultName() );
|
||||
cvf::ref<RigResultAccessor> zRiMultAccessor =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
|
||||
cellFaceAccessObject->setTransResultAccessors( xRiMultAccessor.p(), yRiMultAccessor.p(), zRiMultAccessor.p() );
|
||||
|
||||
@@ -286,29 +227,15 @@ cvf::ref<RigResultAccessor>
|
||||
|
||||
nativeAddr.setResultName( RiaResultNames::riAreaNormTranXResultName() );
|
||||
cvf::ref<RigResultAccessor> xRiAreaNormTransAccessor =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
nativeAddr.setResultName( RiaResultNames::riAreaNormTranYResultName() );
|
||||
cvf::ref<RigResultAccessor> yRiAreaNormTransAccessor =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
nativeAddr.setResultName( RiaResultNames::riAreaNormTranZResultName() );
|
||||
cvf::ref<RigResultAccessor> zRiAreaNormTransAccessor =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
|
||||
cellFaceAccessObject->setTransResultAccessors( xRiAreaNormTransAccessor.p(),
|
||||
yRiAreaNormTransAccessor.p(),
|
||||
zRiAreaNormTransAccessor.p() );
|
||||
cellFaceAccessObject->setTransResultAccessors( xRiAreaNormTransAccessor.p(), yRiAreaNormTransAccessor.p(), zRiAreaNormTransAccessor.p() );
|
||||
|
||||
return cellFaceAccessObject;
|
||||
}
|
||||
@@ -319,29 +246,15 @@ cvf::ref<RigResultAccessor>
|
||||
|
||||
nativeAddr.setResultName( "FLRWATI+" );
|
||||
cvf::ref<RigResultAccessor> xRiAreaNormTransAccessor =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
nativeAddr.setResultName( "FLRWATJ+" );
|
||||
cvf::ref<RigResultAccessor> yRiAreaNormTransAccessor =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
nativeAddr.setResultName( "FLRWATK+" );
|
||||
cvf::ref<RigResultAccessor> zRiAreaNormTransAccessor =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
|
||||
cellFaceAccessObject->setTransResultAccessors( xRiAreaNormTransAccessor.p(),
|
||||
yRiAreaNormTransAccessor.p(),
|
||||
zRiAreaNormTransAccessor.p() );
|
||||
cellFaceAccessObject->setTransResultAccessors( xRiAreaNormTransAccessor.p(), yRiAreaNormTransAccessor.p(), zRiAreaNormTransAccessor.p() );
|
||||
|
||||
return cellFaceAccessObject;
|
||||
}
|
||||
@@ -351,29 +264,15 @@ cvf::ref<RigResultAccessor>
|
||||
|
||||
nativeAddr.setResultName( "FLROILI+" );
|
||||
cvf::ref<RigResultAccessor> xRiAreaNormTransAccessor =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
nativeAddr.setResultName( "FLROILJ+" );
|
||||
cvf::ref<RigResultAccessor> yRiAreaNormTransAccessor =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
nativeAddr.setResultName( "FLROILK+" );
|
||||
cvf::ref<RigResultAccessor> zRiAreaNormTransAccessor =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
|
||||
cellFaceAccessObject->setTransResultAccessors( xRiAreaNormTransAccessor.p(),
|
||||
yRiAreaNormTransAccessor.p(),
|
||||
zRiAreaNormTransAccessor.p() );
|
||||
cellFaceAccessObject->setTransResultAccessors( xRiAreaNormTransAccessor.p(), yRiAreaNormTransAccessor.p(), zRiAreaNormTransAccessor.p() );
|
||||
|
||||
return cellFaceAccessObject;
|
||||
}
|
||||
@@ -383,55 +282,32 @@ cvf::ref<RigResultAccessor>
|
||||
|
||||
nativeAddr.setResultName( "FLRGASI+" );
|
||||
cvf::ref<RigResultAccessor> xRiAreaNormTransAccessor =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
nativeAddr.setResultName( "FLRGASJ+" );
|
||||
cvf::ref<RigResultAccessor> yRiAreaNormTransAccessor =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
nativeAddr.setResultName( "FLRGASK+" );
|
||||
cvf::ref<RigResultAccessor> zRiAreaNormTransAccessor =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
|
||||
cellFaceAccessObject->setTransResultAccessors( xRiAreaNormTransAccessor.p(),
|
||||
yRiAreaNormTransAccessor.p(),
|
||||
zRiAreaNormTransAccessor.p() );
|
||||
cellFaceAccessObject->setTransResultAccessors( xRiAreaNormTransAccessor.p(), yRiAreaNormTransAccessor.p(), zRiAreaNormTransAccessor.p() );
|
||||
|
||||
return cellFaceAccessObject;
|
||||
}
|
||||
else if ( resVarAddr.resultName().endsWith( "IJK" ) )
|
||||
{
|
||||
cvf::ref<RigCombTransResultAccessor> cellFaceAccessObject = new RigCombTransResultAccessor( grid );
|
||||
QString baseName = resVarAddr.resultName().left( resVarAddr.resultName().size() - 3 );
|
||||
QString baseName = resVarAddr.resultName().left( resVarAddr.resultName().size() - 3 );
|
||||
|
||||
nativeAddr.setResultName( QString( "%1I" ).arg( baseName ) );
|
||||
cvf::ref<RigResultAccessor> iAccessor = RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
cvf::ref<RigResultAccessor> iAccessor =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
nativeAddr.setResultName( QString( "%1J" ).arg( baseName ) );
|
||||
cvf::ref<RigResultAccessor> jAccessor = RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
cvf::ref<RigResultAccessor> jAccessor =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
nativeAddr.setResultName( QString( "%1K" ).arg( baseName ) );
|
||||
cvf::ref<RigResultAccessor> kAccessor = RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
timeStepIndex,
|
||||
nativeAddr );
|
||||
cvf::ref<RigResultAccessor> kAccessor =
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( eclipseCase, gridIndex, porosityModel, timeStepIndex, nativeAddr );
|
||||
|
||||
cellFaceAccessObject->setTransResultAccessors( iAccessor.p(), jAccessor.p(), kAccessor.p() );
|
||||
|
||||
@@ -444,12 +320,11 @@ cvf::ref<RigResultAccessor>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<RigResultAccessor>
|
||||
RigResultAccessorFactory::createNativeFromResultAddress( const RigEclipseCaseData* eclipseCase,
|
||||
size_t gridIndex,
|
||||
RiaDefines::PorosityModelType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
const RigEclipseResultAddress& resultAddress )
|
||||
cvf::ref<RigResultAccessor> RigResultAccessorFactory::createNativeFromResultAddress( const RigEclipseCaseData* eclipseCase,
|
||||
size_t gridIndex,
|
||||
RiaDefines::PorosityModelType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
const RigEclipseResultAddress& resultAddress )
|
||||
{
|
||||
if ( !eclipseCase || !eclipseCase->results( porosityModel ) || !eclipseCase->activeCellInfo( porosityModel ) )
|
||||
{
|
||||
@@ -472,8 +347,7 @@ cvf::ref<RigResultAccessor>
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const std::vector<std::vector<double>>& scalarSetResults =
|
||||
eclipseCase->results( porosityModel )->cellScalarResults( resultAddress );
|
||||
const std::vector<std::vector<double>>& scalarSetResults = eclipseCase->results( porosityModel )->cellScalarResults( resultAddress );
|
||||
|
||||
if ( timeStepIndex >= scalarSetResults.size() )
|
||||
{
|
||||
|
||||
@@ -62,9 +62,7 @@ private:
|
||||
class RigActiveCellsResultModifier : public RigResultModifier
|
||||
{
|
||||
public:
|
||||
RigActiveCellsResultModifier( const RigGridBase* grid,
|
||||
const RigActiveCellInfo* activeCellInfo,
|
||||
std::vector<double>* reservoirResultValues )
|
||||
RigActiveCellsResultModifier( const RigGridBase* grid, const RigActiveCellInfo* activeCellInfo, std::vector<double>* reservoirResultValues )
|
||||
: m_grid( grid )
|
||||
, m_activeCellInfo( activeCellInfo )
|
||||
, m_reservoirResultValues( reservoirResultValues )
|
||||
|
||||
@@ -28,10 +28,10 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<RigResultModifier> RigResultModifierFactory::createResultModifier( RigEclipseCaseData* eclipseCase,
|
||||
size_t gridIndex,
|
||||
RiaDefines::PorosityModelType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
cvf::ref<RigResultModifier> RigResultModifierFactory::createResultModifier( RigEclipseCaseData* eclipseCase,
|
||||
size_t gridIndex,
|
||||
RiaDefines::PorosityModelType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
const RigEclipseResultAddress& resVarAddr )
|
||||
{
|
||||
if ( !eclipseCase ) return nullptr;
|
||||
|
||||
@@ -141,8 +141,8 @@ bool RigSimWellData::hasAnyValidCells( size_t resultTimeStepIndex ) const
|
||||
|
||||
bool operator==( const RigWellResultPoint& p1, const RigWellResultPoint& p2 )
|
||||
{
|
||||
return p1.m_gridIndex == p2.m_gridIndex && p1.m_gridCellIndex == p2.m_gridCellIndex &&
|
||||
p1.m_ertBranchId == p2.m_ertBranchId && p1.m_ertSegmentId == p2.m_ertSegmentId;
|
||||
return p1.m_gridIndex == p2.m_gridIndex && p1.m_gridCellIndex == p2.m_gridCellIndex && p1.m_ertBranchId == p2.m_ertBranchId &&
|
||||
p1.m_ertSegmentId == p2.m_ertSegmentId;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -159,9 +159,8 @@ void RigSimWellData::computeStaticWellCellPath() const
|
||||
|
||||
for ( size_t bIdx = 0; bIdx < m_wellCellsTimeSteps[0].m_wellResultBranches.size(); ++bIdx )
|
||||
{
|
||||
int branchErtId = m_wellCellsTimeSteps[0].m_wellResultBranches[bIdx].m_ertBranchId;
|
||||
const std::vector<RigWellResultPoint>& frameCells =
|
||||
m_wellCellsTimeSteps[0].m_wellResultBranches[bIdx].m_branchResultPoints;
|
||||
int branchErtId = m_wellCellsTimeSteps[0].m_wellResultBranches[bIdx].m_ertBranchId;
|
||||
const std::vector<RigWellResultPoint>& frameCells = m_wellCellsTimeSteps[0].m_wellResultBranches[bIdx].m_branchResultPoints;
|
||||
|
||||
std::list<RigWellResultPoint>& branch = staticWellBranches[branchErtId];
|
||||
|
||||
@@ -177,9 +176,8 @@ void RigSimWellData::computeStaticWellCellPath() const
|
||||
|
||||
for ( size_t bIdx = 0; bIdx < m_wellCellsTimeSteps[tIdx].m_wellResultBranches.size(); ++bIdx )
|
||||
{
|
||||
int branchId = m_wellCellsTimeSteps[tIdx].m_wellResultBranches[bIdx].m_ertBranchId;
|
||||
const std::vector<RigWellResultPoint>& resBranch =
|
||||
m_wellCellsTimeSteps[tIdx].m_wellResultBranches[bIdx].m_branchResultPoints;
|
||||
int branchId = m_wellCellsTimeSteps[tIdx].m_wellResultBranches[bIdx].m_ertBranchId;
|
||||
const std::vector<RigWellResultPoint>& resBranch = m_wellCellsTimeSteps[tIdx].m_wellResultBranches[bIdx].m_branchResultPoints;
|
||||
|
||||
std::list<RigWellResultPoint>& stBranch = staticWellBranches[branchId];
|
||||
std::list<RigWellResultPoint>::iterator sEndIt;
|
||||
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
public: // Todo: Clean up this regarding public members and constness etc.
|
||||
QString m_wellName;
|
||||
|
||||
std::vector<size_t> m_resultTimeStepIndexToWellTimeStepIndex; // Well result timesteps may differ from result timesteps
|
||||
std::vector<size_t> m_resultTimeStepIndexToWellTimeStepIndex; // Well result timesteps may differ from result timesteps
|
||||
std::vector<RigWellResultFrame> m_wellCellsTimeSteps;
|
||||
|
||||
private:
|
||||
|
||||
@@ -43,10 +43,9 @@
|
||||
/// The returned CellIds is one less than the number of centerline points,
|
||||
/// and are describing the lines between the points, starting with the first line
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigSimulationWellCenterLineCalculator::calculateWellPipeStaticCenterline(
|
||||
RimSimWellInView* rimWell,
|
||||
std::vector<std::vector<cvf::Vec3d>>& pipeBranchesCLCoords,
|
||||
std::vector<std::vector<RigWellResultPoint>>& pipeBranchesCellIds )
|
||||
void RigSimulationWellCenterLineCalculator::calculateWellPipeStaticCenterline( RimSimWellInView* rimWell,
|
||||
std::vector<std::vector<cvf::Vec3d>>& pipeBranchesCLCoords,
|
||||
std::vector<std::vector<RigWellResultPoint>>& pipeBranchesCellIds )
|
||||
{
|
||||
CVF_ASSERT( rimWell );
|
||||
|
||||
@@ -283,8 +282,7 @@ void RigSimulationWellCenterLineCalculator::calculateWellPipeCenterlineFromWellF
|
||||
|
||||
// First make sure this cell is not starting a new "display" branch for none MSW's
|
||||
|
||||
if ( isMultiSegmentWell || !isAutoDetectBranches || ( prevWellResPoint == whResCell ) ||
|
||||
distanceToWellHeadIsLonger )
|
||||
if ( isMultiSegmentWell || !isAutoDetectBranches || ( prevWellResPoint == whResCell ) || distanceToWellHeadIsLonger )
|
||||
{
|
||||
// Not starting a "display" branch for normal wells
|
||||
// Calculate the exit of the previous cell, and the entry point into this cell
|
||||
@@ -302,7 +300,7 @@ void RigSimulationWellCenterLineCalculator::calculateWellPipeCenterlineFromWellF
|
||||
|
||||
// Intersect with the current cell to find a better entry point than the cell center
|
||||
|
||||
int intersectionCount = cell.firstIntersectionPoint( rayToThisCell, &intoThisCell );
|
||||
int intersectionCount = cell.firstIntersectionPoint( rayToThisCell, &intoThisCell );
|
||||
bool isPreviousResPointInsideCurrentCell = ( intersectionCount % 2 ); // Must intersect uneven
|
||||
// times to be inside. (1
|
||||
// % 2 = 1)
|
||||
@@ -401,8 +399,8 @@ void RigSimulationWellCenterLineCalculator::calculateWellPipeCenterlineFromWellF
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigSimulationWellCenterLineCalculator::addCellCenterPoints( const RigEclipseCaseData* eclipseCaseData,
|
||||
std::vector<std::vector<cvf::Vec3d>>& pipeBranchesCLCoords,
|
||||
void RigSimulationWellCenterLineCalculator::addCellCenterPoints( const RigEclipseCaseData* eclipseCaseData,
|
||||
std::vector<std::vector<cvf::Vec3d>>& pipeBranchesCLCoords,
|
||||
std::vector<std::vector<RigWellResultPoint>>& pipeBranchesCellIds )
|
||||
{
|
||||
for ( size_t brIdx = 0; brIdx < pipeBranchesCellIds.size(); brIdx++ )
|
||||
@@ -491,9 +489,7 @@ public:
|
||||
class DistToEndPoint
|
||||
{
|
||||
public:
|
||||
DistToEndPoint( double adist,
|
||||
std::list<std::pair<bool, std::deque<size_t>>>::iterator aBranchLineIt,
|
||||
bool aToFrontOfBranchLine2 )
|
||||
DistToEndPoint( double adist, std::list<std::pair<bool, std::deque<size_t>>>::iterator aBranchLineIt, bool aToFrontOfBranchLine2 )
|
||||
: dist( adist )
|
||||
, branchLineIt( aBranchLineIt )
|
||||
, toFrontOfBranchLine( aToFrontOfBranchLine2 )
|
||||
@@ -517,31 +513,28 @@ public:
|
||||
|
||||
/// Creating useful lambda functions
|
||||
|
||||
auto buildResBranchToBranchLineEndsDistMap = [&unusedBranchLineIterators,
|
||||
&resBranchIdxToBranchLineEndPointsDists,
|
||||
this]( const cvf::Vec3d& fromPoint, int resultBranchIndex ) {
|
||||
for ( auto it : unusedBranchLineIterators )
|
||||
{
|
||||
auto buildResBranchToBranchLineEndsDistMap =
|
||||
[&unusedBranchLineIterators, &resBranchIdxToBranchLineEndPointsDists, this]( const cvf::Vec3d& fromPoint, int resultBranchIndex ) {
|
||||
for ( auto it : unusedBranchLineIterators )
|
||||
{
|
||||
double dist = calculateFrontToPointDistance( it->second, fromPoint );
|
||||
resBranchIdxToBranchLineEndPointsDists[resultBranchIndex].insert( DistToEndPoint( dist, it, true ) );
|
||||
}
|
||||
{
|
||||
double dist = calculateFrontToPointDistance( it->second, fromPoint );
|
||||
resBranchIdxToBranchLineEndPointsDists[resultBranchIndex].insert( DistToEndPoint( dist, it, true ) );
|
||||
}
|
||||
|
||||
{
|
||||
double dist = calculateEndToPointDistance( it->second, fromPoint );
|
||||
resBranchIdxToBranchLineEndPointsDists[resultBranchIndex].insert( DistToEndPoint( dist, it, false ) );
|
||||
{
|
||||
double dist = calculateEndToPointDistance( it->second, fromPoint );
|
||||
resBranchIdxToBranchLineEndPointsDists[resultBranchIndex].insert( DistToEndPoint( dist, it, false ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
auto removeBranchLineFromDistanceMap =
|
||||
[&resBranchIdxToBranchLineEndPointsDists](
|
||||
std::list<std::pair<bool, std::deque<size_t>>>::iterator branchLineToMergeIt ) {
|
||||
[&resBranchIdxToBranchLineEndPointsDists]( std::list<std::pair<bool, std::deque<size_t>>>::iterator branchLineToMergeIt ) {
|
||||
for ( auto& brIdx_DistToEndPointSet : resBranchIdxToBranchLineEndPointsDists )
|
||||
{
|
||||
std::vector<std::multiset<DistToEndPoint>::iterator> iteratorsToErase;
|
||||
for ( auto it = brIdx_DistToEndPointSet.second.begin(); it != brIdx_DistToEndPointSet.second.end();
|
||||
++it )
|
||||
for ( auto it = brIdx_DistToEndPointSet.second.begin(); it != brIdx_DistToEndPointSet.second.end(); ++it )
|
||||
{
|
||||
if ( it->branchLineIt == branchLineToMergeIt )
|
||||
{
|
||||
@@ -568,7 +561,7 @@ public:
|
||||
|
||||
// Calculate wellhead to branch line ends distances
|
||||
{
|
||||
const RigCell& whCell = m_eclipseCaseData->cellFromWellResultCell( m_orgWellResultFrame.wellHeadOrStartCell() );
|
||||
const RigCell& whCell = m_eclipseCaseData->cellFromWellResultCell( m_orgWellResultFrame.wellHeadOrStartCell() );
|
||||
cvf::Vec3d whStartPos = whCell.faceCenter( cvf::StructGridInterface::NEG_K );
|
||||
|
||||
buildResBranchToBranchLineEndsDistMap( whStartPos, -1 );
|
||||
@@ -598,8 +591,7 @@ public:
|
||||
{
|
||||
// Calculate distance from end of all currently added result branches to all branch lines
|
||||
|
||||
for ( size_t resultBranchIndex = 0; resultBranchIndex < m_branchedWell.m_wellResultBranches.size();
|
||||
++resultBranchIndex )
|
||||
for ( size_t resultBranchIndex = 0; resultBranchIndex < m_branchedWell.m_wellResultBranches.size(); ++resultBranchIndex )
|
||||
{
|
||||
if ( !resBranchIdxToBranchLineEndPointsDists.count( (int)resultBranchIndex ) &&
|
||||
m_branchedWell.m_wellResultBranches[resultBranchIndex].m_branchResultPoints.size() &&
|
||||
@@ -650,28 +642,23 @@ private:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void addBranchLineToLastWellResultBranch( std::list<std::pair<bool, std::deque<size_t>>>::iterator branchLineIt,
|
||||
bool startAtFront )
|
||||
void addBranchLineToLastWellResultBranch( std::list<std::pair<bool, std::deque<size_t>>>::iterator branchLineIt, bool startAtFront )
|
||||
{
|
||||
addBranchLineToWellResultBranch( static_cast<int>( m_branchedWell.m_wellResultBranches.size() ) - 1,
|
||||
branchLineIt,
|
||||
startAtFront );
|
||||
addBranchLineToWellResultBranch( static_cast<int>( m_branchedWell.m_wellResultBranches.size() ) - 1, branchLineIt, startAtFront );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// branchIdx == -1 creates a new branch
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void addBranchLineToWellResultBranch( int branchIdx,
|
||||
std::list<std::pair<bool, std::deque<size_t>>>::iterator branchLineIt,
|
||||
bool startAtFront )
|
||||
void addBranchLineToWellResultBranch( int branchIdx, std::list<std::pair<bool, std::deque<size_t>>>::iterator branchLineIt, bool startAtFront )
|
||||
{
|
||||
if ( branchIdx < 0 )
|
||||
{
|
||||
m_branchedWell.m_wellResultBranches.push_back( RigWellResultBranch() );
|
||||
branchIdx = static_cast<int>( m_branchedWell.m_wellResultBranches.size() ) - 1;
|
||||
RigWellResultPoint wellHeadAsPoint;
|
||||
const RigCell& whCell = m_eclipseCaseData->cellFromWellResultCell( m_orgWellResultFrame.wellHeadOrStartCell() );
|
||||
cvf::Vec3d whStartPos = whCell.faceCenter( cvf::StructGridInterface::NEG_K );
|
||||
const RigCell& whCell = m_eclipseCaseData->cellFromWellResultCell( m_orgWellResultFrame.wellHeadOrStartCell() );
|
||||
cvf::Vec3d whStartPos = whCell.faceCenter( cvf::StructGridInterface::NEG_K );
|
||||
|
||||
wellHeadAsPoint.m_bottomPosition = whStartPos;
|
||||
m_branchedWell.m_wellResultBranches[branchIdx].m_branchResultPoints.push_back( wellHeadAsPoint );
|
||||
@@ -681,8 +668,7 @@ private:
|
||||
std::deque<size_t> wellCellIndices = branchLineIt->second;
|
||||
if ( !startAtFront ) std::reverse( wellCellIndices.begin(), wellCellIndices.end() );
|
||||
|
||||
const std::vector<RigWellResultPoint>& orgWellResultPoints =
|
||||
m_orgWellResultFrame.m_wellResultBranches[0].m_branchResultPoints;
|
||||
const std::vector<RigWellResultPoint>& orgWellResultPoints = m_orgWellResultFrame.m_wellResultBranches[0].m_branchResultPoints;
|
||||
|
||||
#if 1
|
||||
if ( wellCellIndices.size() )
|
||||
@@ -690,9 +676,8 @@ private:
|
||||
if ( !branchLineIt->first ) // Is real branch, with first cell as cell *before* entry point on main branch
|
||||
{
|
||||
RigWellResultPoint branchStartAsResultPoint;
|
||||
const RigCell& branchStartCell =
|
||||
m_eclipseCaseData->cellFromWellResultCell( orgWellResultPoints[wellCellIndices.front()] );
|
||||
cvf::Vec3d branchStartPos = branchStartCell.center();
|
||||
const RigCell& branchStartCell = m_eclipseCaseData->cellFromWellResultCell( orgWellResultPoints[wellCellIndices.front()] );
|
||||
cvf::Vec3d branchStartPos = branchStartCell.center();
|
||||
|
||||
if ( wellCellIndices.size() > 1 )
|
||||
{
|
||||
@@ -736,9 +721,8 @@ private:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void buildCellSearchTree()
|
||||
{
|
||||
const std::vector<RigWellResultPoint>& orgWellResultPoints =
|
||||
m_orgWellResultFrame.m_wellResultBranches[0].m_branchResultPoints;
|
||||
size_t cellCount = orgWellResultPoints.size();
|
||||
const std::vector<RigWellResultPoint>& orgWellResultPoints = m_orgWellResultFrame.m_wellResultBranches[0].m_branchResultPoints;
|
||||
size_t cellCount = orgWellResultPoints.size();
|
||||
|
||||
m_cellBoundingBoxes.resize( cellCount );
|
||||
|
||||
@@ -769,11 +753,10 @@ private:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void buildCellsToNeighborsMap()
|
||||
{
|
||||
const std::vector<RigWellResultPoint>& orgWellResultPoints =
|
||||
m_orgWellResultFrame.m_wellResultBranches[0].m_branchResultPoints;
|
||||
size_t cellCount = orgWellResultPoints.size();
|
||||
const std::vector<cvf::Vec3d>& nodes = m_eclipseCaseData->mainGrid()->nodes();
|
||||
double cellSizeI, cellSizeJ, cellSizeK;
|
||||
const std::vector<RigWellResultPoint>& orgWellResultPoints = m_orgWellResultFrame.m_wellResultBranches[0].m_branchResultPoints;
|
||||
size_t cellCount = orgWellResultPoints.size();
|
||||
const std::vector<cvf::Vec3d>& nodes = m_eclipseCaseData->mainGrid()->nodes();
|
||||
double cellSizeI, cellSizeJ, cellSizeK;
|
||||
m_eclipseCaseData->mainGrid()->characteristicCellSizes( &cellSizeI, &cellSizeJ, &cellSizeK );
|
||||
double stdArea = cellSizeK * ( cellSizeI + cellSizeJ ) * 0.5;
|
||||
|
||||
@@ -790,16 +773,15 @@ private:
|
||||
{
|
||||
if ( idxToCloseCell != cIdx && m_cellsWithNeighbors[cIdx].count( idxToCloseCell ) == 0 )
|
||||
{
|
||||
const RigCell& c2 = m_eclipseCaseData->cellFromWellResultCell( orgWellResultPoints[idxToCloseCell] );
|
||||
const RigCell& c2 = m_eclipseCaseData->cellFromWellResultCell( orgWellResultPoints[idxToCloseCell] );
|
||||
std::vector<size_t> poygonIndices;
|
||||
std::vector<cvf::Vec3d> intersections;
|
||||
|
||||
auto contactFace =
|
||||
RigCellFaceGeometryTools::calculateCellFaceOverlap( c1,
|
||||
c2,
|
||||
*( m_eclipseCaseData->mainGrid() ),
|
||||
&poygonIndices,
|
||||
&intersections );
|
||||
auto contactFace = RigCellFaceGeometryTools::calculateCellFaceOverlap( c1,
|
||||
c2,
|
||||
*( m_eclipseCaseData->mainGrid() ),
|
||||
&poygonIndices,
|
||||
&intersections );
|
||||
|
||||
if ( contactFace != cvf::StructGridInterface::NO_FACE )
|
||||
{
|
||||
@@ -832,9 +814,8 @@ private:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void buildUnusedCellsSet()
|
||||
{
|
||||
const std::vector<RigWellResultPoint>& orgWellResultPoints =
|
||||
m_orgWellResultFrame.m_wellResultBranches[0].m_branchResultPoints;
|
||||
size_t cellCount = orgWellResultPoints.size();
|
||||
const std::vector<RigWellResultPoint>& orgWellResultPoints = m_orgWellResultFrame.m_wellResultBranches[0].m_branchResultPoints;
|
||||
size_t cellCount = orgWellResultPoints.size();
|
||||
|
||||
for ( size_t i = 0; i < cellCount; ++i )
|
||||
{
|
||||
@@ -881,10 +862,8 @@ private:
|
||||
}
|
||||
else // if ( endToGrow > 1 )
|
||||
{
|
||||
m_branchLines.push_back( std::make_pair( false,
|
||||
std::deque<size_t>{ branchList.front(),
|
||||
cellWithNeighborsPair.first,
|
||||
neighbour } ) );
|
||||
m_branchLines.push_back(
|
||||
std::make_pair( false, std::deque<size_t>{ branchList.front(), cellWithNeighborsPair.first, neighbour } ) );
|
||||
auto newBranchLineIt = std::prev( m_branchLines.end() );
|
||||
growBranchListEnd( newBranchLineIt );
|
||||
if ( newBranchLineIt->second.size() == 3 )
|
||||
@@ -906,19 +885,16 @@ private:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t findBestNeighbor( size_t cell, std::set<size_t> neighbors )
|
||||
{
|
||||
size_t posKNeighbor = cvf::UNDEFINED_SIZE_T;
|
||||
size_t firstUnused = cvf::UNDEFINED_SIZE_T;
|
||||
const std::vector<RigWellResultPoint>& orgWellResultPoints =
|
||||
m_orgWellResultFrame.m_wellResultBranches[0].m_branchResultPoints;
|
||||
size_t posKNeighbor = cvf::UNDEFINED_SIZE_T;
|
||||
size_t firstUnused = cvf::UNDEFINED_SIZE_T;
|
||||
const std::vector<RigWellResultPoint>& orgWellResultPoints = m_orgWellResultFrame.m_wellResultBranches[0].m_branchResultPoints;
|
||||
|
||||
for ( size_t neighbor : neighbors )
|
||||
{
|
||||
if ( m_unusedWellCellIndices.count( neighbor ) )
|
||||
{
|
||||
cvf::StructGridInterface::FaceType sharedFace;
|
||||
m_eclipseCaseData->findSharedSourceFace( sharedFace,
|
||||
orgWellResultPoints[cell],
|
||||
orgWellResultPoints[neighbor] );
|
||||
m_eclipseCaseData->findSharedSourceFace( sharedFace, orgWellResultPoints[cell], orgWellResultPoints[neighbor] );
|
||||
if ( sharedFace == cvf::StructGridInterface::NEG_K ) return neighbor;
|
||||
if ( sharedFace == cvf::StructGridInterface::POS_K )
|
||||
posKNeighbor = neighbor;
|
||||
@@ -1063,8 +1039,7 @@ private:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double calculateWellCellToPointDistance( size_t wellCellIdx, const cvf::Vec3d& point )
|
||||
{
|
||||
const std::vector<RigWellResultPoint>& orgWellResultPoints =
|
||||
m_orgWellResultFrame.m_wellResultBranches[0].m_branchResultPoints;
|
||||
const std::vector<RigWellResultPoint>& orgWellResultPoints = m_orgWellResultFrame.m_wellResultBranches[0].m_branchResultPoints;
|
||||
|
||||
const RigCell& c = m_eclipseCaseData->cellFromWellResultCell( orgWellResultPoints[wellCellIdx] );
|
||||
|
||||
|
||||
@@ -40,22 +40,19 @@ public:
|
||||
std::vector<std::vector<cvf::Vec3d>>& pipeBranchesCLCoords,
|
||||
std::vector<std::vector<RigWellResultPoint>>& pipeBranchesCellIds );
|
||||
|
||||
static void
|
||||
calculateWellPipeCenterlineFromWellFrame( const RigEclipseCaseData* eclipseCaseData,
|
||||
const RigSimWellData* simWellData,
|
||||
int timeStepIndex,
|
||||
bool isAutoDetectBranches,
|
||||
bool useAllCellCenters,
|
||||
std::vector<std::vector<cvf::Vec3d>>& pipeBranchesCLCoords,
|
||||
std::vector<std::vector<RigWellResultPoint>>& pipeBranchesCellIds );
|
||||
static void calculateWellPipeCenterlineFromWellFrame( const RigEclipseCaseData* eclipseCaseData,
|
||||
const RigSimWellData* simWellData,
|
||||
int timeStepIndex,
|
||||
bool isAutoDetectBranches,
|
||||
bool useAllCellCenters,
|
||||
std::vector<std::vector<cvf::Vec3d>>& pipeBranchesCLCoords,
|
||||
std::vector<std::vector<RigWellResultPoint>>& pipeBranchesCellIds );
|
||||
|
||||
private:
|
||||
static bool hasAnyValidDataCells( const RigWellResultBranch& branch );
|
||||
static void finishPipeCenterLine( std::vector<std::vector<cvf::Vec3d>>& pipeBranchesCLCoords,
|
||||
const cvf::Vec3d& lastCellCenter );
|
||||
static void finishPipeCenterLine( std::vector<std::vector<cvf::Vec3d>>& pipeBranchesCLCoords, const cvf::Vec3d& lastCellCenter );
|
||||
|
||||
static RigWellResultFrame splitIntoBranches( const RigWellResultFrame& wellResultFrame,
|
||||
const RigEclipseCaseData* eclipseCaseData );
|
||||
static RigWellResultFrame splitIntoBranches( const RigWellResultFrame& wellResultFrame, const RigEclipseCaseData* eclipseCaseData );
|
||||
static void addCellCenterPoints( const RigEclipseCaseData* eclipseCaseData,
|
||||
std::vector<std::vector<cvf::Vec3d>>& pipeBranchesCLCoords,
|
||||
std::vector<std::vector<RigWellResultPoint>>& pipeBranchesCellIds );
|
||||
|
||||
@@ -69,10 +69,8 @@ cvf::Vec3d RigSimulationWellCoordsAndMD::interpolatedPointAlongWellPath( double
|
||||
else
|
||||
{
|
||||
// Do interpolation
|
||||
double stepsize = ( measuredDepth - m_measuredDepths.at( i - 1 ) ) /
|
||||
( m_measuredDepths.at( i ) - m_measuredDepths.at( i - 1 ) );
|
||||
wellPathPoint = m_wellPathPoints.at( i - 1 ) +
|
||||
stepsize * ( m_wellPathPoints.at( i ) - m_wellPathPoints.at( i - 1 ) );
|
||||
double stepsize = ( measuredDepth - m_measuredDepths.at( i - 1 ) ) / ( m_measuredDepths.at( i ) - m_measuredDepths.at( i - 1 ) );
|
||||
wellPathPoint = m_wellPathPoints.at( i - 1 ) + stepsize * ( m_wellPathPoints.at( i ) - m_wellPathPoints.at( i - 1 ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -174,9 +174,8 @@ std::vector<double> RigStimPlanFractureDefinition::computeScaledXs( const std::v
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RigStimPlanFractureDefinition::computeScaledYs( const std::vector<double>& ys,
|
||||
double scaleFactor,
|
||||
double wellPathIntersectionY )
|
||||
std::vector<double>
|
||||
RigStimPlanFractureDefinition::computeScaledYs( const std::vector<double>& ys, double scaleFactor, double wellPathIntersectionY )
|
||||
{
|
||||
std::vector<double> scaledYs;
|
||||
|
||||
@@ -317,9 +316,8 @@ bool RigStimPlanFractureDefinition::numberOfParameterValuesOK( std::vector<std::
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double>
|
||||
RigStimPlanFractureDefinition::adjustedYCoordsAroundWellPathPosition( const std::vector<double>& ys,
|
||||
double wellPathIntersectionAtFractureDepth )
|
||||
std::vector<double> RigStimPlanFractureDefinition::adjustedYCoordsAroundWellPathPosition( const std::vector<double>& ys,
|
||||
double wellPathIntersectionAtFractureDepth )
|
||||
{
|
||||
std::vector<double> yRelativeToWellPath;
|
||||
|
||||
@@ -349,10 +347,9 @@ std::vector<std::pair<QString, QString>> RigStimPlanFractureDefinition::getStimP
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<std::vector<double>>
|
||||
RigStimPlanFractureDefinition::conductivityValuesAtTimeStep( const QString& resultName,
|
||||
int activeTimeStepIndex,
|
||||
RiaDefines::EclipseUnitSystem requiredUnitSet ) const
|
||||
std::vector<std::vector<double>> RigStimPlanFractureDefinition::conductivityValuesAtTimeStep( const QString& resultName,
|
||||
int activeTimeStepIndex,
|
||||
RiaDefines::EclipseUnitSystem requiredUnitSet ) const
|
||||
{
|
||||
std::vector<std::vector<double>> conductivityValues;
|
||||
|
||||
@@ -406,16 +403,14 @@ std::vector<std::vector<double>>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::cref<RigFractureGrid>
|
||||
RigStimPlanFractureDefinition::createFractureGrid( const QString& resultName,
|
||||
int activeTimeStepIndex,
|
||||
double xScaleFactor,
|
||||
double yScaleFactor,
|
||||
double wellPathIntersectionAtFractureDepth,
|
||||
RiaDefines::EclipseUnitSystem requiredUnitSet ) const
|
||||
cvf::cref<RigFractureGrid> RigStimPlanFractureDefinition::createFractureGrid( const QString& resultName,
|
||||
int activeTimeStepIndex,
|
||||
double xScaleFactor,
|
||||
double yScaleFactor,
|
||||
double wellPathIntersectionAtFractureDepth,
|
||||
RiaDefines::EclipseUnitSystem requiredUnitSet ) const
|
||||
{
|
||||
std::vector<std::vector<double>> conductivityValues =
|
||||
conductivityValuesAtTimeStep( resultName, activeTimeStepIndex, requiredUnitSet );
|
||||
std::vector<std::vector<double>> conductivityValues = conductivityValuesAtTimeStep( resultName, activeTimeStepIndex, requiredUnitSet );
|
||||
if ( conductivityValues.empty() )
|
||||
{
|
||||
return nullptr;
|
||||
@@ -429,8 +424,7 @@ cvf::cref<RigFractureGrid>
|
||||
std::vector<double> scaledXs = computeScaledXs( this->m_Xs, xScaleFactor );
|
||||
std::vector<double> scaledYs = computeScaledYs( this->m_Ys, yScaleFactor, -wellPathIntersectionAtFractureDepth );
|
||||
|
||||
std::vector<double> yCoordsAtNodes =
|
||||
this->adjustedYCoordsAroundWellPathPosition( scaledYs, wellPathIntersectionAtFractureDepth );
|
||||
std::vector<double> yCoordsAtNodes = this->adjustedYCoordsAroundWellPathPosition( scaledYs, wellPathIntersectionAtFractureDepth );
|
||||
|
||||
std::vector<double> xCoordsAtNodes = scaledXs;
|
||||
|
||||
@@ -495,20 +489,17 @@ cvf::cref<RigFractureGrid>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RigStimPlanFractureDefinition::fractureGridResults( const QString& resultName,
|
||||
const QString& unitName,
|
||||
size_t timeStepIndex ) const
|
||||
std::vector<double>
|
||||
RigStimPlanFractureDefinition::fractureGridResults( const QString& resultName, const QString& unitName, size_t timeStepIndex ) const
|
||||
{
|
||||
std::vector<double> fractureGridResults;
|
||||
const std::vector<std::vector<double>>& resultValuesAtTimeStep =
|
||||
this->getDataAtTimeIndex( resultName, unitName, timeStepIndex );
|
||||
const std::vector<std::vector<double>>& resultValuesAtTimeStep = this->getDataAtTimeIndex( resultName, unitName, timeStepIndex );
|
||||
|
||||
for ( int i = 0; i < static_cast<int>( xCount() ) - 2; i++ )
|
||||
{
|
||||
for ( int j = 0; j < static_cast<int>( yCount() ) - 2; j++ )
|
||||
{
|
||||
if ( j + 1 < static_cast<int>( resultValuesAtTimeStep.size() ) &&
|
||||
i + 1 < static_cast<int>( resultValuesAtTimeStep[j + 1].size() ) )
|
||||
if ( j + 1 < static_cast<int>( resultValuesAtTimeStep.size() ) && i + 1 < static_cast<int>( resultValuesAtTimeStep[j + 1].size() ) )
|
||||
{
|
||||
fractureGridResults.push_back( resultValuesAtTimeStep[j + 1][i + 1] );
|
||||
}
|
||||
@@ -525,10 +516,10 @@ std::vector<double> RigStimPlanFractureDefinition::fractureGridResults( const QS
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigStimPlanFractureDefinition::createFractureTriangleGeometry( double xScaleFactor,
|
||||
double yScaleFactor,
|
||||
double wellPathIntersectionAtFractureDepth,
|
||||
const QString& fractureUserName,
|
||||
void RigStimPlanFractureDefinition::createFractureTriangleGeometry( double xScaleFactor,
|
||||
double yScaleFactor,
|
||||
double wellPathIntersectionAtFractureDepth,
|
||||
const QString& fractureUserName,
|
||||
std::vector<cvf::Vec3f>* vertices,
|
||||
std::vector<cvf::uint>* triangleIndices ) const
|
||||
{
|
||||
@@ -538,8 +529,7 @@ void RigStimPlanFractureDefinition::createFractureTriangleGeometry( double
|
||||
std::vector<double> xCoords = scaledXs;
|
||||
cvf::uint lenXcoords = static_cast<cvf::uint>( xCoords.size() );
|
||||
|
||||
std::vector<double> adjustedYs =
|
||||
this->adjustedYCoordsAroundWellPathPosition( scaledYs, wellPathIntersectionAtFractureDepth );
|
||||
std::vector<double> adjustedYs = this->adjustedYCoordsAroundWellPathPosition( scaledYs, wellPathIntersectionAtFractureDepth );
|
||||
|
||||
for ( cvf::uint k = 0; k < adjustedYs.size(); k++ )
|
||||
{
|
||||
@@ -678,9 +668,8 @@ void RigStimPlanFractureDefinition::setDataAtTimeValue( const QString&
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<std::vector<double>>& RigStimPlanFractureDefinition::getDataAtTimeIndex( const QString& resultName,
|
||||
const QString& unit,
|
||||
size_t timeStepIndex ) const
|
||||
const std::vector<std::vector<double>>&
|
||||
RigStimPlanFractureDefinition::getDataAtTimeIndex( const QString& resultName, const QString& unit, size_t timeStepIndex ) const
|
||||
{
|
||||
size_t resIndex = resultIndex( resultName, unit );
|
||||
|
||||
|
||||
@@ -111,13 +111,9 @@ public:
|
||||
|
||||
std::vector<std::pair<QString, QString>> getStimPlanPropertyNamesUnits() const;
|
||||
|
||||
void setDataAtTimeValue( const QString& resultName,
|
||||
const QString& unit,
|
||||
const std::vector<std::vector<double>>& data,
|
||||
double timeStepValue );
|
||||
void setDataAtTimeValue( const QString& resultName, const QString& unit, const std::vector<std::vector<double>>& data, double timeStepValue );
|
||||
|
||||
const std::vector<std::vector<double>>&
|
||||
getDataAtTimeIndex( const QString& resultName, const QString& unit, size_t timeStepIndex ) const;
|
||||
const std::vector<std::vector<double>>& getDataAtTimeIndex( const QString& resultName, const QString& unit, size_t timeStepIndex ) const;
|
||||
|
||||
std::vector<double> fractureGridResults( const QString& resultName, const QString& unitName, size_t timeStepIndex ) const;
|
||||
|
||||
@@ -134,17 +130,16 @@ private:
|
||||
size_t resultIndex( const QString& resultName, const QString& unit ) const;
|
||||
void generateXsFromFileXs( bool xMirrorMode );
|
||||
std::vector<std::vector<double>> generateDataLayoutFromFileDataLayout( std::vector<std::vector<double>> rawXYData ) const;
|
||||
bool numberOfParameterValuesOK( std::vector<std::vector<double>> propertyValuesAtTimestep ) const;
|
||||
double minY() const;
|
||||
double maxY() const;
|
||||
bool numberOfParameterValuesOK( std::vector<std::vector<double>> propertyValuesAtTimestep ) const;
|
||||
double minY() const;
|
||||
double maxY() const;
|
||||
|
||||
static std::vector<double> adjustedYCoordsAroundWellPathPosition( const std::vector<double>& yCoords,
|
||||
double wellPathIntersectionAtFractureDepth );
|
||||
double wellPathIntersectionAtFractureDepth );
|
||||
|
||||
static std::vector<double> computeScaledXs( const std::vector<double>& xs, double scaleFactor );
|
||||
|
||||
static std::vector<double>
|
||||
computeScaledYs( const std::vector<double>& ys, double scaleFactor, double wellPathIntersectionAtFractureDepth );
|
||||
static std::vector<double> computeScaledYs( const std::vector<double>& ys, double scaleFactor, double wellPathIntersectionAtFractureDepth );
|
||||
|
||||
std::vector<std::vector<double>> conductivityValuesAtTimeStep( const QString& resultName,
|
||||
int activeTimeStepIndex,
|
||||
|
||||
@@ -103,10 +103,9 @@ double RigStimPlanModelTools::calculateFormationDip( const cvf::Vec3d& direction
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::tuple<const RigFault*, double, cvf::Vec3d, double>
|
||||
RigStimPlanModelTools::findClosestFaultBarrier( RigEclipseCaseData* eclipseCaseData,
|
||||
const cvf::Vec3d& position,
|
||||
const cvf::Vec3d& directionToBarrier )
|
||||
std::tuple<const RigFault*, double, cvf::Vec3d, double> RigStimPlanModelTools::findClosestFaultBarrier( RigEclipseCaseData* eclipseCaseData,
|
||||
const cvf::Vec3d& position,
|
||||
const cvf::Vec3d& directionToBarrier )
|
||||
{
|
||||
std::vector<WellPathCellIntersectionInfo> intersections =
|
||||
RigStimPlanModelTools::generateBarrierIntersections( eclipseCaseData, position, directionToBarrier );
|
||||
@@ -123,8 +122,7 @@ std::tuple<const RigFault*, double, cvf::Vec3d, double>
|
||||
{
|
||||
// Find the closest cell face which is a fault
|
||||
double distance = position.pointDistance( intersection.startPoint );
|
||||
const RigFault* fault = mainGrid->findFaultFromCellIndexAndCellFace( intersection.globCellIndex,
|
||||
intersection.intersectedCellFaceIn );
|
||||
const RigFault* fault = mainGrid->findFaultFromCellIndexAndCellFace( intersection.globCellIndex, intersection.intersectedCellFaceIn );
|
||||
if ( fault && distance < shortestDistance )
|
||||
{
|
||||
foundFault = fault;
|
||||
@@ -143,10 +141,9 @@ std::tuple<const RigFault*, double, cvf::Vec3d, double>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<WellPathCellIntersectionInfo>
|
||||
RigStimPlanModelTools::generateBarrierIntersections( RigEclipseCaseData* eclipseCaseData,
|
||||
const cvf::Vec3d& position,
|
||||
const cvf::Vec3d& directionToBarrier )
|
||||
std::vector<WellPathCellIntersectionInfo> RigStimPlanModelTools::generateBarrierIntersections( RigEclipseCaseData* eclipseCaseData,
|
||||
const cvf::Vec3d& position,
|
||||
const cvf::Vec3d& directionToBarrier )
|
||||
{
|
||||
double randoDistance = 10000.0;
|
||||
cvf::Vec3d forwardPosition = position + ( directionToBarrier * randoDistance );
|
||||
@@ -164,10 +161,9 @@ std::vector<WellPathCellIntersectionInfo>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<WellPathCellIntersectionInfo>
|
||||
RigStimPlanModelTools::generateBarrierIntersectionsBetweenPoints( RigEclipseCaseData* eclipseCaseData,
|
||||
const cvf::Vec3d& startPosition,
|
||||
const cvf::Vec3d& endPosition )
|
||||
std::vector<WellPathCellIntersectionInfo> RigStimPlanModelTools::generateBarrierIntersectionsBetweenPoints( RigEclipseCaseData* eclipseCaseData,
|
||||
const cvf::Vec3d& startPosition,
|
||||
const cvf::Vec3d& endPosition )
|
||||
{
|
||||
// Create a fake well path from the anchor point to
|
||||
// a point far away in the direction barrier direction
|
||||
@@ -277,11 +273,10 @@ double RigStimPlanModelTools::calculatePerforationLength( const cvf::Vec3d& dire
|
||||
|
||||
double correctedPerforationLength = perforationLength * std::cos( inclination );
|
||||
|
||||
RiaLogging::info(
|
||||
QString( "Perforation length correction: original length: %1 inclination: %2 corrected length: %3" )
|
||||
.arg( perforationLength )
|
||||
.arg( cvf::Math::toDegrees( inclination ) )
|
||||
.arg( correctedPerforationLength ) );
|
||||
RiaLogging::info( QString( "Perforation length correction: original length: %1 inclination: %2 corrected length: %3" )
|
||||
.arg( perforationLength )
|
||||
.arg( cvf::Math::toDegrees( inclination ) )
|
||||
.arg( correctedPerforationLength ) );
|
||||
|
||||
// Handle well inclination close to 90 dgr to ensure visual perforation interval in StimPlan model plot
|
||||
if ( std::fabs( cvf::Math::toDegrees( inclination ) - 90.0 ) < 0.1 )
|
||||
|
||||
@@ -55,18 +55,14 @@ public:
|
||||
static QString vecToString( const cvf::Vec3d& vec );
|
||||
|
||||
static std::tuple<const RigFault*, double, cvf::Vec3d, double>
|
||||
findClosestFaultBarrier( RigEclipseCaseData* eclipseCaseData,
|
||||
const cvf::Vec3d& position,
|
||||
const cvf::Vec3d& directionToBarrier );
|
||||
|
||||
static std::vector<WellPathCellIntersectionInfo> generateBarrierIntersections( RigEclipseCaseData* eclipseCaseData,
|
||||
const cvf::Vec3d& position,
|
||||
const cvf::Vec3d& directionToBarrier );
|
||||
findClosestFaultBarrier( RigEclipseCaseData* eclipseCaseData, const cvf::Vec3d& position, const cvf::Vec3d& directionToBarrier );
|
||||
|
||||
static std::vector<WellPathCellIntersectionInfo>
|
||||
generateBarrierIntersectionsBetweenPoints( RigEclipseCaseData* eclipseCaseData,
|
||||
const cvf::Vec3d& startPosition,
|
||||
const cvf::Vec3d& endPosition );
|
||||
generateBarrierIntersections( RigEclipseCaseData* eclipseCaseData, const cvf::Vec3d& position, const cvf::Vec3d& directionToBarrier );
|
||||
|
||||
static std::vector<WellPathCellIntersectionInfo> generateBarrierIntersectionsBetweenPoints( RigEclipseCaseData* eclipseCaseData,
|
||||
const cvf::Vec3d& startPosition,
|
||||
const cvf::Vec3d& endPosition );
|
||||
|
||||
static double calculatePerforationLength( const cvf::Vec3d& wellPathDirection, double perforationLength );
|
||||
};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user