mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Thermal Fracture: Improve handling of result names and units.
This commit is contained in:
parent
8193f24a55
commit
3dad3c65cb
@ -23,6 +23,7 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaNncDefines.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPlotDefines.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaStimPlanModelDefines.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaThermalFractureDefines.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaResultNames.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaNumberFormat.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaRftDefines.h
|
||||
@ -56,6 +57,7 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaNncDefines.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaPlotDefines.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaStimPlanModelDefines.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaThermalFractureDefines.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaResultNames.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaNumberFormat.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaRftDefines.cpp
|
||||
|
123
ApplicationLibCode/Application/RiaThermalFractureDefines.cpp
Normal file
123
ApplicationLibCode/Application/RiaThermalFractureDefines.cpp
Normal file
@ -0,0 +1,123 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2022- Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiaThermalFractureDefines.h"
|
||||
#include "RiaFractureDefines.h"
|
||||
|
||||
#include "cafAssert.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
namespace RiaDefines
|
||||
{
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString leakoffPressureDropResultName()
|
||||
{
|
||||
return "LeakoffPressureDrop";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString filtratePressureDropResultName()
|
||||
{
|
||||
return "FiltratePressureDrop";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString leakoffMobilityResultName()
|
||||
{
|
||||
return "LeakoffMobility";
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString filterCakeMobilityResultName()
|
||||
{
|
||||
return "FilterCakeMobility";
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString injectivityDeclineResultName()
|
||||
{
|
||||
return "InjectivityDecline";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString viscosityResultName()
|
||||
{
|
||||
return "Viscosity";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString getExpectedThermalFractureUnit( const QString& name, RiaDefines::EclipseUnitSystem unitSystem )
|
||||
{
|
||||
CAF_ASSERT( unitSystem == RiaDefines::EclipseUnitSystem::UNITS_METRIC ||
|
||||
unitSystem == RiaDefines::EclipseUnitSystem::UNITS_FIELD );
|
||||
|
||||
// parameter name --> { metric unit, field unit }
|
||||
std::map<QString, std::pair<QString, QString>> mapping =
|
||||
{ { "XCoord", { "m", "feet" } },
|
||||
{ "YCoord", { "m", "feet" } },
|
||||
{ "ZCoord", { "m", "feet" } },
|
||||
{ "Width", { "cm", "inches" } },
|
||||
{ "Pressure", { "BARa", "psia" } },
|
||||
{ "Temperature", { "deg C", "deg F" } },
|
||||
{ "Stress", { "BARa", "psia" } },
|
||||
{ "Density", { "Kg/m3", "lb/ft3" } },
|
||||
{ RiaDefines::viscosityResultName(), { "mPa.s", "centipoise" } },
|
||||
{ RiaDefines::leakoffMobilityResultName(), { "m/day/bar", "ft/day/psi" } },
|
||||
{ "Conductivity",
|
||||
{ RiaDefines::unitStringConductivity( RiaDefines::EclipseUnitSystem::UNITS_METRIC ),
|
||||
RiaDefines::unitStringConductivity( RiaDefines::EclipseUnitSystem::UNITS_FIELD ) } },
|
||||
{ "Velocity", { "m/sec", "ft/sec" } },
|
||||
{ "ResPressure", { "BARa", "psia" } },
|
||||
{ "ResTemperature", { "deg C", "deg F" } },
|
||||
{ "FiltrateThickness", { "cm", "inches" } },
|
||||
{ RiaDefines::filtratePressureDropResultName(), { "bar", "psi" } },
|
||||
{ "EffectiveResStress", { "bar", "psi" } },
|
||||
{ "EffectiveFracStress", { "bar", "psi" } },
|
||||
{ RiaDefines::leakoffPressureDropResultName(), { "bar", "psi" } },
|
||||
{ RiaDefines::injectivityDeclineResultName(), { "factor", "factor" } },
|
||||
{ RiaDefines::filterCakeMobilityResultName(), { "m/day/bar", "ft/day/psi" } } };
|
||||
|
||||
auto res = std::find_if( mapping.begin(), mapping.end(), [&]( const auto& val ) { return val.first == name; } );
|
||||
|
||||
if ( res != mapping.end() )
|
||||
{
|
||||
if ( unitSystem == RiaDefines::EclipseUnitSystem::UNITS_METRIC )
|
||||
return res->second.first;
|
||||
else
|
||||
return res->second.second;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
}; // namespace RiaDefines
|
38
ApplicationLibCode/Application/RiaThermalFractureDefines.h
Normal file
38
ApplicationLibCode/Application/RiaThermalFractureDefines.h
Normal file
@ -0,0 +1,38 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2022- Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaDefines.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
|
||||
|
||||
namespace RiaDefines
|
||||
{
|
||||
QString leakoffPressureDropResultName();
|
||||
QString filtratePressureDropResultName();
|
||||
QString leakoffMobilityResultName();
|
||||
QString filterCakeMobilityResultName();
|
||||
QString injectivityDeclineResultName();
|
||||
QString viscosityResultName();
|
||||
|
||||
QString getExpectedThermalFractureUnit( const QString& name, RiaDefines::EclipseUnitSystem unitSystem );
|
||||
|
||||
}; // namespace RiaDefines
|
@ -21,6 +21,7 @@
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaFractureDefines.h"
|
||||
#include "RiaTextStringTools.h"
|
||||
#include "RiaThermalFractureDefines.h"
|
||||
|
||||
#include "RigThermalFractureDefinition.h"
|
||||
|
||||
@ -261,9 +262,10 @@ RiaDefines::EclipseUnitSystem
|
||||
if ( res != namesAndUnits.end() )
|
||||
{
|
||||
QString unit = res->second;
|
||||
if ( unit == getExpectedUnit( targetName, RiaDefines::EclipseUnitSystem::UNITS_METRIC ) )
|
||||
if ( unit == RiaDefines::getExpectedThermalFractureUnit( targetName, RiaDefines::EclipseUnitSystem::UNITS_METRIC ) )
|
||||
return RiaDefines::EclipseUnitSystem::UNITS_METRIC;
|
||||
else if ( unit == getExpectedUnit( targetName, RiaDefines::EclipseUnitSystem::UNITS_FIELD ) )
|
||||
else if ( unit ==
|
||||
RiaDefines::getExpectedThermalFractureUnit( targetName, RiaDefines::EclipseUnitSystem::UNITS_FIELD ) )
|
||||
return RiaDefines::EclipseUnitSystem::UNITS_FIELD;
|
||||
}
|
||||
|
||||
@ -279,54 +281,9 @@ bool RifThermalFractureReader::checkUnits( std::shared_ptr<const RigThermalFract
|
||||
auto namesAndUnits = definition->getPropertyNamesUnits();
|
||||
for ( auto [name, unit] : namesAndUnits )
|
||||
{
|
||||
auto expectedUnit = getExpectedUnit( name, unitSystem );
|
||||
auto expectedUnit = RiaDefines::getExpectedThermalFractureUnit( name, unitSystem );
|
||||
if ( expectedUnit != unit ) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RifThermalFractureReader::getExpectedUnit( const QString& name, RiaDefines::EclipseUnitSystem unitSystem )
|
||||
{
|
||||
CAF_ASSERT( unitSystem == RiaDefines::EclipseUnitSystem::UNITS_METRIC ||
|
||||
unitSystem == RiaDefines::EclipseUnitSystem::UNITS_FIELD );
|
||||
|
||||
// parameter name --> { metric unit, field unit }
|
||||
std::map<QString, std::pair<QString, QString>> mapping =
|
||||
{ { "XCoord", { "m", "feet" } },
|
||||
{ "YCoord", { "m", "feet" } },
|
||||
{ "ZCoord", { "m", "feet" } },
|
||||
{ "Width", { "cm", "inches" } },
|
||||
{ "Pressure", { "BARa", "psia" } },
|
||||
{ "Temperature", { "deg C", "deg F" } },
|
||||
{ "Stress", { "BARa", "psia" } },
|
||||
{ "Density", { "Kg/m3", "lb/ft3" } },
|
||||
{ "Viscosity", { "mPa.s", "centipoise" } },
|
||||
{ "LeakoffMobility", { "m/day/bar", "ft/day/psi" } },
|
||||
{ "Conductivity",
|
||||
{ RiaDefines::unitStringConductivity( RiaDefines::EclipseUnitSystem::UNITS_METRIC ),
|
||||
RiaDefines::unitStringConductivity( RiaDefines::EclipseUnitSystem::UNITS_FIELD ) } },
|
||||
{ "Velocity", { "m/sec", "ft/sec" } },
|
||||
{ "ResPressure", { "BARa", "psia" } },
|
||||
{ "ResTemperature", { "deg C", "deg F" } },
|
||||
{ "FiltrateThickness", { "cm", "inches" } },
|
||||
{ "FiltratePressureDrop", { "bar", "psi" } },
|
||||
{ "EffectiveResStress", { "bar", "psi" } },
|
||||
{ "EffectiveFracStress", { "bar", "psi" } },
|
||||
{ "LeakoffPressureDrop", { "bar", "psi" } } };
|
||||
|
||||
auto res = std::find_if( mapping.begin(), mapping.end(), [&]( const auto& val ) { return val.first == name; } );
|
||||
|
||||
if ( res != mapping.end() )
|
||||
{
|
||||
if ( unitSystem == RiaDefines::EclipseUnitSystem::UNITS_METRIC )
|
||||
return res->second.first;
|
||||
else
|
||||
return res->second.second;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
#include "RiaFractureDefines.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaThermalFractureDefines.h"
|
||||
|
||||
#include "RifThermalFractureReader.h"
|
||||
|
||||
@ -33,8 +34,6 @@
|
||||
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimFracture.h"
|
||||
#include "RimFractureContainment.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimStimPlanColors.h"
|
||||
#include "RimWellPath.h"
|
||||
|
||||
@ -166,10 +165,11 @@ void RimThermalFractureTemplate::loadDataAndUpdate()
|
||||
if ( m_fractureDefinitionData )
|
||||
{
|
||||
auto addInjectivityDecline = []( std::shared_ptr<RigThermalFractureDefinition> def ) {
|
||||
int leakoffPressureDropIndex = def->getPropertyIndex( "LeakoffPressureDrop" );
|
||||
int filtratePressureDropIndex = def->getPropertyIndex( "FiltratePressureDrop" );
|
||||
QString injectivityValueTag = "InjectivityDecline";
|
||||
def->addProperty( injectivityValueTag, "factor" );
|
||||
int leakoffPressureDropIndex = def->getPropertyIndex( RiaDefines::leakoffPressureDropResultName() );
|
||||
int filtratePressureDropIndex = def->getPropertyIndex( RiaDefines::filtratePressureDropResultName() );
|
||||
QString injectivityValueTag = RiaDefines::injectivityDeclineResultName();
|
||||
def->addProperty( injectivityValueTag,
|
||||
RiaDefines::getExpectedThermalFractureUnit( injectivityValueTag, def->unitSystem() ) );
|
||||
|
||||
int injectivityDeclineIndex = def->getPropertyIndex( injectivityValueTag );
|
||||
|
||||
@ -189,11 +189,12 @@ void RimThermalFractureTemplate::loadDataAndUpdate()
|
||||
};
|
||||
|
||||
auto addFilterCakeMobility = []( std::shared_ptr<RigThermalFractureDefinition> def ) {
|
||||
int leakoffPressureDropIndex = def->getPropertyIndex( "LeakoffPressureDrop" );
|
||||
int filtratePressureDropIndex = def->getPropertyIndex( "FiltratePressureDrop" );
|
||||
int leakoffMobilityIndex = def->getPropertyIndex( "LeakoffMobility" );
|
||||
QString filterCakeMobilityValueTag = "FilterCakeMobility";
|
||||
def->addProperty( filterCakeMobilityValueTag, "m/day/bar" );
|
||||
int leakoffPressureDropIndex = def->getPropertyIndex( RiaDefines::leakoffPressureDropResultName() );
|
||||
int filtratePressureDropIndex = def->getPropertyIndex( RiaDefines::filtratePressureDropResultName() );
|
||||
int leakoffMobilityIndex = def->getPropertyIndex( RiaDefines::leakoffMobilityResultName() );
|
||||
QString filterCakeMobilityValueTag = RiaDefines::filterCakeMobilityResultName();
|
||||
def->addProperty( filterCakeMobilityValueTag,
|
||||
RiaDefines::getExpectedThermalFractureUnit( filterCakeMobilityValueTag, def->unitSystem() ) );
|
||||
|
||||
int filterCakeMobilityDeclineIndex = def->getPropertyIndex( filterCakeMobilityValueTag );
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "RigEclipseToStimPlanCalculator.h"
|
||||
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaThermalFractureDefines.h"
|
||||
#include "RiaWeightedMeanCalculator.h"
|
||||
|
||||
#include "RigActiveCellInfo.h"
|
||||
@ -33,6 +34,7 @@
|
||||
#include "RigHexIntersectionTools.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigResultAccessorFactory.h"
|
||||
#include "RigThermalFractureDefinition.h"
|
||||
#include "RigTransmissibilityCondenser.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
@ -81,25 +83,41 @@ void RigEclipseToStimPlanCalculator::computeValues()
|
||||
RimThermalFractureTemplate* thermalFractureTemplate =
|
||||
dynamic_cast<RimThermalFractureTemplate*>( m_fracture->fractureTemplate() );
|
||||
|
||||
size_t timeStep = thermalFractureTemplate->activeTimeStepIndex();
|
||||
int cellI = fractureCell.getI();
|
||||
int cellJ = fractureCell.getJ();
|
||||
size_t timeStep = thermalFractureTemplate->activeTimeStepIndex();
|
||||
int cellI = fractureCell.getI();
|
||||
int cellJ = fractureCell.getJ();
|
||||
auto unitSystem = thermalFractureTemplate->fractureDefinition()->unitSystem();
|
||||
|
||||
double injectivityDecline = thermalFractureTemplate->resultValueAtIJ( &m_fractureGrid,
|
||||
"InjectivityDecline",
|
||||
"factor",
|
||||
timeStep,
|
||||
cellI,
|
||||
cellJ );
|
||||
double injectivityDecline =
|
||||
thermalFractureTemplate
|
||||
->resultValueAtIJ( &m_fractureGrid,
|
||||
RiaDefines::injectivityDeclineResultName(),
|
||||
RiaDefines::getExpectedThermalFractureUnit( RiaDefines::injectivityDeclineResultName(),
|
||||
unitSystem ),
|
||||
|
||||
timeStep,
|
||||
cellI,
|
||||
cellJ );
|
||||
double viscosity =
|
||||
thermalFractureTemplate->resultValueAtIJ( &m_fractureGrid, "Viscosity", "mPa.s", timeStep, cellI, cellJ );
|
||||
thermalFractureTemplate
|
||||
->resultValueAtIJ( &m_fractureGrid,
|
||||
RiaDefines::viscosityResultName(),
|
||||
RiaDefines::getExpectedThermalFractureUnit( RiaDefines::viscosityResultName(),
|
||||
unitSystem ),
|
||||
|
||||
double filterCakeMobility = thermalFractureTemplate->resultValueAtIJ( &m_fractureGrid,
|
||||
"FilterCakeMobility",
|
||||
"m/day/bar",
|
||||
timeStep,
|
||||
cellI,
|
||||
cellJ );
|
||||
timeStep,
|
||||
cellI,
|
||||
cellJ );
|
||||
|
||||
double filterCakeMobility =
|
||||
thermalFractureTemplate
|
||||
->resultValueAtIJ( &m_fractureGrid,
|
||||
RiaDefines::filterCakeMobilityResultName(),
|
||||
RiaDefines::getExpectedThermalFractureUnit( RiaDefines::filterCakeMobilityResultName(),
|
||||
unitSystem ),
|
||||
timeStep,
|
||||
cellI,
|
||||
cellJ );
|
||||
|
||||
// Assumed value
|
||||
double relativePermeability = 1.0;
|
||||
|
Loading…
Reference in New Issue
Block a user