mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6930 StimPlanModel: Warn when exporting models with more than 100 layers.
This commit is contained in:
committed by
Magne Sjaastad
parent
9ecbce4491
commit
9175806e6b
@@ -18,6 +18,8 @@
|
||||
|
||||
#include "RifStimPlanModelGeologicalFrkExporter.h"
|
||||
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RimStimPlanModel.h"
|
||||
#include "RimStimPlanModelCalculator.h"
|
||||
|
||||
@@ -91,7 +93,9 @@ bool RifStimPlanModelGeologicalFrkExporter::writeToFile( RimStimPlanModel* stimP
|
||||
}
|
||||
|
||||
std::map<QString, std::vector<double>> values;
|
||||
values["dpthlyr"] = stimPlanModel->calculator()->calculateTrueVerticalDepth();
|
||||
|
||||
std::vector<double> tvd = stimPlanModel->calculator()->calculateTrueVerticalDepth();
|
||||
values["dpthlyr"] = tvd;
|
||||
values["strs"] = stimPlanModel->calculator()->calculateStress();
|
||||
values["strsg"] = stimPlanModel->calculator()->calculateStressGradient();
|
||||
values["elyr"] = stimPlanModel->calculator()->calculateYoungsModulus();
|
||||
@@ -110,6 +114,15 @@ bool RifStimPlanModelGeologicalFrkExporter::writeToFile( RimStimPlanModel* stimP
|
||||
values["zonePoroElas"] = stimPlanModel->calculator()->calculatePoroElasticConstant();
|
||||
values["zoneThermalExp"] = stimPlanModel->calculator()->calculateThermalExpansionCoefficient();
|
||||
|
||||
// Warn if the generated model has too many layers for StimPlan
|
||||
if ( tvd.size() > MAX_STIMPLAN_LAYERS )
|
||||
{
|
||||
RiaLogging::warning(
|
||||
QString( "Exporting model with too many layers: %1. Maximum supported number of layers is %2." )
|
||||
.arg( tvd.size() )
|
||||
.arg( MAX_STIMPLAN_LAYERS ) );
|
||||
}
|
||||
|
||||
QFile data( filepath );
|
||||
if ( !data.open( QFile::WriteOnly | QFile::Truncate ) )
|
||||
{
|
||||
|
||||
@@ -30,6 +30,8 @@ class QTextStream;
|
||||
class RifStimPlanModelGeologicalFrkExporter
|
||||
{
|
||||
public:
|
||||
static const int MAX_STIMPLAN_LAYERS = 100;
|
||||
|
||||
static bool writeToFile( RimStimPlanModel* plot, bool useDetailedFluidLoss, const QString& filepath );
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user