mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix problem in RigWellPathGeometry::interpolateMdFromTvd starting at 0.0 MD.
The spline has to be extended to 0.0 regardless of the value of TVD.
This commit is contained in:
parent
3e43ca2b65
commit
e7d7a40251
@ -325,7 +325,7 @@ QwtSpline RigWellPathGeometryTools::createSpline( const std::vector<double>& ori
|
|||||||
// Extend spline from 0.0 (if it does not already exist) to a large value for MD
|
// Extend spline from 0.0 (if it does not already exist) to a large value for MD
|
||||||
// This is to force a specific and known extrapolation.
|
// This is to force a specific and known extrapolation.
|
||||||
// Otherwise we get an undefined and unknown extrapolation.
|
// Otherwise we get an undefined and unknown extrapolation.
|
||||||
if ( !( splinePoints[0].x() == 0.0 && splinePoints[0].y() == 0.0 ) )
|
if ( !( splinePoints[0].x() == 0.0 ) )
|
||||||
{
|
{
|
||||||
double x1 = splinePoints[0].x();
|
double x1 = splinePoints[0].x();
|
||||||
double x2 = splinePoints[1].x();
|
double x2 = splinePoints[1].x();
|
||||||
|
@ -74,6 +74,22 @@ TEST( RigWellPathGeometryTools, LinearPathStartingAtZero )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST( RigWellPathGeometryTools, ShortLinearPathStartingAtZero )
|
||||||
|
{
|
||||||
|
std::vector<double> mdValues = { 0, 1000.0 };
|
||||||
|
std::vector<double> tvdValues = { 2000.0, 4000 };
|
||||||
|
std::vector<double> fullTVDValues = { 0, 2000.0, 3000, 4000.0 };
|
||||||
|
std::vector<double> expectedMDValues = { 0.0, 0.0, 500, 1000.0 };
|
||||||
|
|
||||||
|
std::vector<double> fullMDValues = RigWellPathGeometryTools::interpolateMdFromTvd( mdValues, tvdValues, fullTVDValues );
|
||||||
|
|
||||||
|
EXPECT_EQ( fullTVDValues.size(), fullMDValues.size() );
|
||||||
|
for ( size_t i = 0; i < fullTVDValues.size(); ++i )
|
||||||
|
{
|
||||||
|
EXPECT_NEAR( expectedMDValues[i], fullMDValues[i], TOLERANCE );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
double quadraticFunction( double x )
|
double quadraticFunction( double x )
|
||||||
{
|
{
|
||||||
return 0.0015 * std::pow( x, 2 ) - 0.25 * x + 100;
|
return 0.0015 * std::pow( x, 2 ) - 0.25 * x + 100;
|
||||||
|
Loading…
Reference in New Issue
Block a user