mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add parameter value check to see if it is possible to continue or not. (#8091)
This commit is contained in:
parent
69c829dc32
commit
72ce82b08b
@ -60,7 +60,14 @@ void RicRunWellIntegrityAnalysisFeature::onActionTriggered( bool isChecked )
|
|||||||
|
|
||||||
runProgress.setProgressDescription( "Writing input files." );
|
runProgress.setProgressDescription( "Writing input files." );
|
||||||
|
|
||||||
modelSettings->extractModelData();
|
if ( !modelSettings->extractModelData() )
|
||||||
|
{
|
||||||
|
QMessageBox::critical( nullptr,
|
||||||
|
wiaTitle,
|
||||||
|
"Unable to get necessary data from the defined model box. Is the model box center "
|
||||||
|
"outside the reservoir?" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ( !RifWellIAFileWriter::writeToJsonFile( *modelSettings, outErrorText ) )
|
if ( !RifWellIAFileWriter::writeToJsonFile( *modelSettings, outErrorText ) )
|
||||||
{
|
{
|
||||||
|
@ -433,7 +433,7 @@ void RimWellIASettings::resetResInsightParameters()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimWellIASettings::updateResInsightParameters()
|
bool RimWellIASettings::updateResInsightParameters()
|
||||||
{
|
{
|
||||||
resetResInsightParameters();
|
resetResInsightParameters();
|
||||||
|
|
||||||
@ -469,10 +469,25 @@ void RimWellIASettings::updateResInsightParameters()
|
|||||||
double stressValue =
|
double stressValue =
|
||||||
dataAccess.interpolatedResultValue( "ST", nativeKeys[i], RigFemResultPosEnum::RIG_ELEMENT_NODAL, position, 0 );
|
dataAccess.interpolatedResultValue( "ST", nativeKeys[i], RigFemResultPosEnum::RIG_ELEMENT_NODAL, position, 0 );
|
||||||
initialStress->addParameter( paramKeys[i], stressValue );
|
initialStress->addParameter( paramKeys[i], stressValue );
|
||||||
|
if ( std::isfinite( stressValue ) )
|
||||||
|
{
|
||||||
|
initialStress->addParameter( paramKeys[i], stressValue );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
double ppValue = dataAccess.interpolatedResultValue( "POR-Bar", "", RigFemResultPosEnum::RIG_NODAL, position, 0 );
|
double ppValue = dataAccess.interpolatedResultValue( "POR-Bar", "", RigFemResultPosEnum::RIG_NODAL, position, 0 );
|
||||||
initialStress->addParameter( "PP", ppValue );
|
if ( std::isfinite( ppValue ) )
|
||||||
|
{
|
||||||
|
initialStress->addParameter( "PP", ppValue );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
auto angles = RigWellPathGeometryTools::calculateAzimuthAndInclinationAtMd( ( m_startMD + m_endMD ) / 2.0,
|
auto angles = RigWellPathGeometryTools::calculateAzimuthAndInclinationAtMd( ( m_startMD + m_endMD ) / 2.0,
|
||||||
wellPath()->wellPathGeometry() );
|
wellPath()->wellPathGeometry() );
|
||||||
@ -480,6 +495,8 @@ void RimWellIASettings::updateResInsightParameters()
|
|||||||
initialStress->addParameter( "inclination_well", angles.second );
|
initialStress->addParameter( "inclination_well", angles.second );
|
||||||
|
|
||||||
m_parametersRI.push_back( initialStress );
|
m_parametersRI.push_back( initialStress );
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -579,11 +596,14 @@ void RimWellIASettings::generateModelBox()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimWellIASettings::extractModelData()
|
bool RimWellIASettings::extractModelData()
|
||||||
{
|
{
|
||||||
generateModelBox();
|
generateModelBox();
|
||||||
updateResInsightParameters();
|
|
||||||
resetModelData();
|
resetModelData();
|
||||||
|
if ( !updateResInsightParameters() )
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
QDateTime startDate = geostaticDate();
|
QDateTime startDate = geostaticDate();
|
||||||
|
|
||||||
@ -611,7 +631,7 @@ void RimWellIASettings::extractModelData()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::vector<cvf::Vec3d> displacements = extractDisplacments( m_modelbox.vertices(), timestep );
|
const std::vector<cvf::Vec3d> displacements = extractDisplacements( m_modelbox.vertices(), timestep );
|
||||||
|
|
||||||
for ( size_t i = 0; i < displacements.size(); i++ )
|
for ( size_t i = 0; i < displacements.size(); i++ )
|
||||||
{
|
{
|
||||||
@ -620,6 +640,8 @@ void RimWellIASettings::extractModelData()
|
|||||||
m_modelData.push_back( data );
|
m_modelData.push_back( data );
|
||||||
timestep++;
|
timestep++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -638,7 +660,7 @@ std::vector<QDateTime> RimWellIASettings::timeStepDates()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::vector<cvf::Vec3d> RimWellIASettings::extractDisplacments( std::vector<cvf::Vec3d> corners, int timeStep )
|
std::vector<cvf::Vec3d> RimWellIASettings::extractDisplacements( std::vector<cvf::Vec3d> corners, int timeStep )
|
||||||
{
|
{
|
||||||
RimWellIADataAccess dataAccess( m_geomechCase );
|
RimWellIADataAccess dataAccess( m_geomechCase );
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ public:
|
|||||||
std::vector<cvf::Vec3d> modelBoxVertices() const;
|
std::vector<cvf::Vec3d> modelBoxVertices() const;
|
||||||
std::vector<RimWellIAModelData*> modelData() const;
|
std::vector<RimWellIAModelData*> modelData() const;
|
||||||
|
|
||||||
void extractModelData();
|
bool extractModelData();
|
||||||
void updateVisualization();
|
void updateVisualization();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -107,14 +107,14 @@ private:
|
|||||||
std::vector<QDateTime> timeStepDates();
|
std::vector<QDateTime> timeStepDates();
|
||||||
|
|
||||||
void initCsvParameters();
|
void initCsvParameters();
|
||||||
void updateResInsightParameters();
|
bool updateResInsightParameters();
|
||||||
void generateModelBox();
|
void generateModelBox();
|
||||||
void resetModelData();
|
void resetModelData();
|
||||||
void resetResInsightParameters();
|
void resetResInsightParameters();
|
||||||
|
|
||||||
void addCsvGroup( QString name, QStringList timeSteps, double defaultValue = 0.0 );
|
void addCsvGroup( QString name, QStringList timeSteps, double defaultValue = 0.0 );
|
||||||
|
|
||||||
std::vector<cvf::Vec3d> extractDisplacments( std::vector<cvf::Vec3d> corners, int timeStep );
|
std::vector<cvf::Vec3d> extractDisplacements( std::vector<cvf::Vec3d> corners, int timeStep );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmProxyValueField<QString> m_nameProxy;
|
caf::PdmProxyValueField<QString> m_nameProxy;
|
||||||
|
Loading…
Reference in New Issue
Block a user