Exemplo n.º 1
0
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseInputCaseOpm::importEclipseGridAndProperties(const QString& fileName)
{
    if (this->reservoirData() == NULL)
    {
        this->setReservoirData(new RigCaseData);

        RifReaderOpmParserInput::importGridPropertiesFaults(fileName, reservoirData());

        if (this->reservoirData()->mainGrid() == NULL)
        {
            return;
        }

        this->reservoirData()->mainGrid()->setFlipAxis(flipXAxis, flipYAxis);

        computeCachedData();

        RiaApplication* app = RiaApplication::instance();
        if (app->preferences()->autocomputeDepthRelatedProperties)
        {
            RimReservoirCellResultsStorage* matrixResults = results(RifReaderInterface::MATRIX_RESULTS);
            RimReservoirCellResultsStorage* fractureResults = results(RifReaderInterface::FRACTURE_RESULTS);

            matrixResults->computeDepthRelatedResults();
            fractureResults->computeDepthRelatedResults();
        }
    }
}
Exemplo n.º 2
0
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimEclipseInputCase::openEclipseGridFile()
{
    // Early exit if reservoir data is created
    if (this->reservoirData() == NULL)
    {
        cvf::ref<RifReaderInterface> readerInterface;

        if (m_gridFileName().contains(RimDefines::mockModelBasicInputCase()))
        {
            readerInterface = this->createMockModel(this->m_gridFileName());
        }
        else
        {
            RiaPreferences* prefs = RiaApplication::instance()->preferences();
            readerInterface = new RifReaderEclipseInput;
            readerInterface->setReaderSetting(prefs->readerSettings());

            cvf::ref<RigCaseData> eclipseCase = new RigCaseData;
            if (!readerInterface->open(m_gridFileName, eclipseCase.p()))
            {
                return false;
            }

            this->setReservoirData( eclipseCase.p() );
        }

        CVF_ASSERT(this->reservoirData());
        CVF_ASSERT(readerInterface.notNull());

        results(RifReaderInterface::MATRIX_RESULTS)->setReaderInterface(readerInterface.p());
        results(RifReaderInterface::FRACTURE_RESULTS)->setReaderInterface(readerInterface.p());

        this->reservoirData()->mainGrid()->setFlipAxis(flipXAxis, flipYAxis);
        
        computeCachedData();
        loadAndSyncronizeInputProperties();
    }

    
    RiaApplication* app = RiaApplication::instance();
    if (app->preferences()->autocomputeDepthRelatedProperties)
    {
        RimReservoirCellResultsStorage* matrixResults = results(RifReaderInterface::MATRIX_RESULTS);
        RimReservoirCellResultsStorage* fractureResults = results(RifReaderInterface::FRACTURE_RESULTS);

        matrixResults->computeDepthRelatedResults();
        fractureResults->computeDepthRelatedResults();
    }

    return true;
 }
Exemplo n.º 3
0
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
bool RimCase::openReserviorCase()
{
    // If read already, return

    if (this->reservoirData() != NULL) return true;
    
    if (!openEclipseGridFile())
    {
        return false;
    }

    {
        RimReservoirCellResultsStorage* results = this->results(RifReaderInterface::MATRIX_RESULTS);
        if (results->cellResults())
        {
            results->cellResults()->createPlaceholderResultEntries();
            // After the placeholder result for combined transmissibility is created, 
            // make sure the nnc transmissibilities can be addressed by this scalarResultIndex as well
            size_t combinedTransResIdx = results->cellResults()->findScalarResultIndex(RimDefines::STATIC_NATIVE, RimDefines::combinedTransmissibilityResultName());
            if (combinedTransResIdx != cvf::UNDEFINED_SIZE_T)
            {
                reservoirData()->mainGrid()->nncData()->setCombTransmisibilityScalarResultIndex(combinedTransResIdx);
            }
        }

    }
    {
        RimReservoirCellResultsStorage* results = this->results(RifReaderInterface::FRACTURE_RESULTS);
        if (results->cellResults()) results->cellResults()->createPlaceholderResultEntries();
    }

    return true;
}
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void RimEclipsePropertyFilter::computeResultValueRange()
{
    CVF_ASSERT(parentContainer());

    double min = 0.0;
    double max = 0.0;

    clearCategories();

    size_t scalarIndex = resultDefinition->scalarResultIndex();
    if (scalarIndex != cvf::UNDEFINED_SIZE_T)
    {
        RimReservoirCellResultsStorage* results = resultDefinition->currentGridCellResults();
        if (results)
        {
            results->cellResults()->minMaxCellScalarValues(scalarIndex, min, max);

            if (resultDefinition->hasCategoryResult())
            {
                if (resultDefinition->resultType() != RimDefines::FORMATION_NAMES)
                {
                    setCategoryValues(results->cellResults()->uniqueCellScalarValues(scalarIndex));
                }
                else
                {
                    CVF_ASSERT(parentContainer()->reservoirView()->eclipseCase()->reservoirData());
                    CVF_ASSERT(parentContainer()->reservoirView()->eclipseCase()->reservoirData()->activeFormationNames());

                    const std::vector<QString>& fnVector = parentContainer()->reservoirView()->eclipseCase()->reservoirData()->activeFormationNames()->formationNames();
                    setCategoryNames(fnVector);
                }
            }
        }
    }

    m_maximumResultValue = max;
    m_minimumResultValue = min;

    m_lowerBound.uiCapability()->setUiName(QString("Min (%1)").arg(min));
    m_upperBound.uiCapability()->setUiName(QString("Max (%1)").arg(max));
}
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void RimCellPropertyFilter::computeResultValueRange()
{
    CVF_ASSERT(m_parentContainer);

    double min = 0.0;
    double max = 0.0;

    size_t scalarIndex = resultDefinition->scalarResultIndex();
    if (scalarIndex != cvf::UNDEFINED_SIZE_T)
    {
        RimReservoirCellResultsStorage* results = resultDefinition->currentGridCellResults();
        if (results)
        {
            results->cellResults()->minMaxCellScalarValues(scalarIndex, min, max);
        }
    }

    m_maximumResultValue = max;
    m_minimumResultValue = min;

    lowerBound.setUiName(QString("Min (%1)").arg(min));
    upperBound.setUiName(QString("Max (%1)").arg(max));
}