#9039: Thermal Fractures: add file reader

This commit is contained in:
Kristian Bendiksen
2022-06-15 10:18:05 +02:00
committed by Magne Sjaastad
parent 6d65554a77
commit 94124d4eac
9 changed files with 2893 additions and 0 deletions

View File

@@ -72,6 +72,7 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RifElasticPropertiesReader-Test.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaStatisticsTools-Test.cpp
${CMAKE_CURRENT_LIST_DIR}/RifStimPlanXmlReader-Test.cpp
${CMAKE_CURRENT_LIST_DIR}/RifThermalFractureReader-Test.cpp
${CMAKE_CURRENT_LIST_DIR}/RigWellPathGeometryExporter-Test.cpp
${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelDeviationFrkExporter-Test.cpp
${CMAKE_CURRENT_LIST_DIR}/RifSummaryDataReader-Test.cpp

View File

@@ -0,0 +1,45 @@
#include "gtest/gtest.h"
#include "RiaTestDataDirectory.h"
#include "RifThermalFractureReader.h"
#include "RigThermalFractureDefinition.h"
static const QString CASE_REAL_TEST_DATA_DIRECTORY = QString( "%1/RifThermalFractureReader/" ).arg( TEST_DATA_DIR );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
TEST( RifThermalFractureReaderTest, LoadFile )
{
QString fileName = CASE_REAL_TEST_DATA_DIRECTORY + "fracture_metric.csv";
auto [fractureData, errorMessage] = RifThermalFractureReader::readFractureCsvFile( fileName );
EXPECT_TRUE( errorMessage.isEmpty() );
EXPECT_TRUE( fractureData.get() );
EXPECT_EQ( "frac01", fractureData->name().toStdString() );
EXPECT_EQ( fractureData->numNodes(), 57u );
EXPECT_EQ( fractureData->numTimeSteps(), 29u );
auto properties = fractureData->getPropertyNamesUnits();
EXPECT_EQ( properties.size(), 19u );
EXPECT_EQ( properties[0].first.toStdString(), "XCoord" );
EXPECT_EQ( properties[0].second.toStdString(), "m" );
// The location of the center node is the same for all timesteps
double centerNodeX = 459352.0;
double centerNodeY = -7.32599e+06;
double centerNodeZ = 2735.0;
int nodeIndex = 0;
for ( size_t timeStepIndex = 0; timeStepIndex < fractureData->numTimeSteps(); timeStepIndex++ )
{
EXPECT_DOUBLE_EQ( centerNodeX, fractureData->getPropertyValue( 0, nodeIndex, static_cast<int>( timeStepIndex ) ) );
EXPECT_DOUBLE_EQ( centerNodeY, fractureData->getPropertyValue( 1, nodeIndex, static_cast<int>( timeStepIndex ) ) );
EXPECT_DOUBLE_EQ( centerNodeZ, fractureData->getPropertyValue( 2, nodeIndex, static_cast<int>( timeStepIndex ) ) );
}
}