Use correct result name for Void ratio (#10969)

Use correct result name for Void ratio
Enable porosity calculator for imported inp data
Add model validation check for export/show model
Fix last res. layer not being splitted into subelements
Add model validation check in file exporter
Bump version to dev.04
This commit is contained in:
jonjenssen 2023-12-18 15:03:08 +01:00 committed by GitHub
parent 9e1a09bcf9
commit 858c1227bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 41 additions and 46 deletions

View File

@ -62,14 +62,6 @@ void RicRunFaultReactModelingFeature::onActionTriggered( bool isChecked )
runProgress.setProgressDescription( "Writing input files." );
auto [modelOk, errorMsg] = model->validateBeforeRun();
if ( !modelOk )
{
QMessageBox::critical( nullptr, frmTitle, QString::fromStdString( errorMsg ) );
return;
}
QString exportFile = model->inputFilename();
auto [result, errText] = RifFaultReactivationModelExporter::exportToFile( exportFile.toStdString(), *model );

View File

@ -45,6 +45,9 @@ std::pair<bool, std::string> RifFaultReactivationModelExporter::exportToStream(
const std::string& exportDirectory,
const RimFaultReactivationModel& rimModel )
{
auto [modelOk, errorMsg] = rimModel.validateModel();
if ( !modelOk ) return { false, errorMsg };
auto dataAccess = extractAndExportModelData( rimModel );
if ( !dataAccess ) return { false, "Unable to get necessary data from the input case." };

View File

@ -573,6 +573,7 @@ std::map<std::string, std::vector<std::string>> RigFemPartResultsCollection::sca
{
fieldCompNames = m_readerInterface->scalarNodeFieldAndComponentNames();
fieldCompNames[RigFemAddressDefines::porBar()];
if ( fieldCompNames.contains( "VOIDR" ) ) fieldCompNames["PORO-PERM"].push_back( "PHI0" );
if ( m_readerInterface->populateDerivedResultNames() )
{
@ -584,7 +585,10 @@ std::map<std::string, std::vector<std::string>> RigFemPartResultsCollection::sca
{
fieldCompNames = m_readerInterface->scalarElementNodeFieldAndComponentNames();
if ( !m_readerInterface->populateDerivedResultNames() ) return fieldCompNames;
if ( !m_readerInterface->populateDerivedResultNames() )
{
return fieldCompNames;
}
fieldCompNames["SE"].push_back( "SM" );
fieldCompNames["SE"].push_back( "SFI" );

View File

@ -302,7 +302,7 @@ RigElementType RifInpReader::read( std::istream&
else if ( prevline.starts_with( "*INITIAL" ) )
{
auto label = parseLabel( prevline, "type" );
if ( label == "RATIO" ) propertyName = "RATIO";
if ( label == "RATIO" ) propertyName = "VOIDR";
resultType = RigFemResultPosEnum::RIG_NODAL;
}
if ( propertyName.empty() )

View File

@ -193,7 +193,7 @@ caf::PdmFieldHandle* RimFaultReactivationModel::userDescriptionField()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::pair<bool, std::string> RimFaultReactivationModel::validateBeforeRun() const
std::pair<bool, std::string> RimFaultReactivationModel::validateModel() const
{
if ( fault() == nullptr )
{
@ -425,7 +425,9 @@ void RimFaultReactivationModel::defineUiOrdering( QString uiConfigName, caf::Pdm
sizeModelGrp->add( &m_modelMinZ );
sizeModelGrp->add( &m_modelBelowSize );
if ( m_geomechCase() != nullptr )
const bool hasGeoMechCase = ( m_geomechCase() != nullptr );
if ( hasGeoMechCase )
{
m_modelMinZ.setValue( std::abs( m_geomechCase->allCellsBoundingBox().max().z() ) );
m_modelMinZ.uiCapability()->setUiReadOnly( true );
@ -462,14 +464,14 @@ void RimFaultReactivationModel::defineUiOrdering( QString uiConfigName, caf::Pdm
propertiesGrp->add( &m_useGridPorePressure );
propertiesGrp->add( &m_useGridVoidRatio );
propertiesGrp->add( &m_useGridTemperature );
propertiesGrp->add( &m_useGridDensity );
propertiesGrp->add( &m_useGridElasticProperties );
propertiesGrp->add( &m_useGridStress );
propertiesGrp->add( &m_waterDensity );
auto trgGroup = uiOrdering.addNewGroup( "Debug" );
trgGroup->setCollapsedByDefault();
trgGroup->add( &m_targets );
if ( hasGeoMechCase )
{
propertiesGrp->add( &m_useGridDensity );
propertiesGrp->add( &m_useGridElasticProperties );
propertiesGrp->add( &m_useGridStress );
propertiesGrp->add( &m_waterDensity );
}
uiOrdering.skipRemainingFields();
}

View File

@ -75,7 +75,7 @@ public:
QString userDescription();
void setUserDescription( QString description );
std::pair<bool, std::string> validateBeforeRun() const;
std::pair<bool, std::string> validateModel() const;
void setFaultInformation( RimFaultInView* fault, size_t cellIndex, cvf::StructGridInterface::FaceType face );
RimFaultInView* fault() const;

View File

@ -33,6 +33,8 @@
#include "cafHexGridIntersectionTools/cafHexGridIntersectionTools.h"
#include <ranges>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -572,39 +574,31 @@ void RigFaultReactivationModelGenerator::splitLargeLayers( std::map<double, cvf:
{
std::vector<cvf::Vec3d> additionalPoints;
std::pair<double, cvf::Vec3d> prevLayer;
std::vector<int> newKLayers;
std::vector<int> newKLayers;
bool first = true;
int k = 0;
const int nLayers = (int)layers.size();
const int nKLayers = (int)kLayers.size();
const int nLayers = (int)layers.size();
int n = 0;
auto kv = std::views::keys( layers );
std::vector<double> keys{ kv.begin(), kv.end() };
auto vv = std::views::values( layers );
std::vector<cvf::Vec3d> vals{ vv.begin(), vv.end() };
for ( auto& layer : layers )
for ( int k = 0; k < nLayers; k++ )
{
if ( n++ == ( nLayers - 1 ) ) break;
if ( first )
if ( k > 0 )
{
prevLayer = layer;
first = false;
newKLayers.push_back( kLayers[k++] );
continue;
}
if ( std::abs( prevLayer.first - layer.first ) > maxHeight )
{
const auto& points = interpolateExtraPoints( prevLayer.second, layer.second, maxHeight );
for ( auto& p : points )
if ( std::abs( keys[k] - keys[k - 1] ) > maxHeight )
{
additionalPoints.push_back( p );
newKLayers.push_back( kLayers[k - 1] );
const auto& points = interpolateExtraPoints( vals[k - 1], vals[k], maxHeight );
for ( auto& p : points )
{
additionalPoints.push_back( p );
newKLayers.push_back( kLayers[k - 1] );
}
}
}
prevLayer = layer;
newKLayers.push_back( kLayers[k++] );
if ( k < nKLayers ) newKLayers.push_back( kLayers[k] );
}
for ( auto& p : additionalPoints )

View File

@ -11,7 +11,7 @@ set(RESINSIGHT_VERSION_TEXT "-dev")
# Must be unique and increasing within one combination of major/minor/patch version
# The uniqueness of this text is independent of RESINSIGHT_VERSION_TEXT
# Format of text must be ".xx"
set(RESINSIGHT_DEV_VERSION ".03")
set(RESINSIGHT_DEV_VERSION ".04")
# https://github.com/CRAVA/crava/tree/master/libs/nrlib
set(NRLIB_GITHUB_SHA "ba35d4359882f1c6f5e9dc30eb95fe52af50fd6f")