we do not support entering multiple segments with ABS type
in keyword WELSEGS. Before we fix it, we throw here.
This commit is contained in:
@@ -196,8 +196,8 @@ namespace Opm {
|
||||
// Meaningless value to indicate unspecified values.
|
||||
const double invalid_value = Segment::invalidValue();
|
||||
|
||||
const double depth_top = record1.getItem("DEPTH").getSIDouble(0);
|
||||
const double length_top = record1.getItem("LENGTH").getSIDouble(0);
|
||||
const double depth_top = record1.getItem("TOP_DEPTH").getSIDouble(0);
|
||||
const double length_top = record1.getItem("TOP_LENGTH").getSIDouble(0);
|
||||
const double volume_top = record1.getItem("WELLBORE_VOLUME").getSIDouble(0);
|
||||
const LengthDepth length_depth_type = LengthDepthFromString(record1.getItem("INFO_TYPE").getTrimmedString(0));
|
||||
m_comp_pressure_drop = CompPressureDropFromString(record1.getItem("PRESSURE_COMPONENTS").getTrimmedString(0));
|
||||
@@ -258,6 +258,13 @@ namespace Opm {
|
||||
};
|
||||
}
|
||||
|
||||
if ((segment1 != segment2) && (length_depth_type == LengthDepth::ABS)) {
|
||||
throw std::logic_error{
|
||||
fmt::format("In WELSEGS, it is not supported to enter multiple segments in one record "
|
||||
"with ABS type of tubing length and depth information")
|
||||
};
|
||||
}
|
||||
|
||||
const int branch = record.getItem("BRANCH").get<int>(0);
|
||||
if (branch < 1) {
|
||||
throw std::logic_error {
|
||||
@@ -275,15 +282,13 @@ namespace Opm {
|
||||
}
|
||||
}
|
||||
|
||||
// If the values are incremental values, then we can just use
|
||||
// the values if the values are absolute values, then we need to
|
||||
// calculate them during the next process only the value for the
|
||||
// last segment in the range is recorded
|
||||
const double segment_length = record.getItem("SEGMENT_LENGTH").getSIDouble(0);
|
||||
// If the length_depth_type is INC, then the length is the length of the segment,
|
||||
// If the length_depth_type is ABS, then the length is the length of the last segment node in the range.
|
||||
const double length = record.getItem("LENGTH").getSIDouble(0);
|
||||
|
||||
// The naming is a little confusing here. Naming following the
|
||||
// definition from the current keyword for the moment.
|
||||
const double depth_change = record.getItem("DEPTH_CHANGE").getSIDouble(0);
|
||||
// If the length_depth_type is INC, then the depth is the depth change of the segment from the outlet segment.
|
||||
// If the length_depth_type is ABS, then the depth is the absolute depth of last the segment node in the range.
|
||||
const double depth = record.getItem("DEPTH").getSIDouble(0);
|
||||
|
||||
double volume = invalid_value;
|
||||
{
|
||||
@@ -292,7 +297,7 @@ namespace Opm {
|
||||
volume = itemVolume.getSIDouble(0);
|
||||
}
|
||||
else if (length_depth_type == LengthDepth::INC) {
|
||||
volume = area * segment_length;
|
||||
volume = area * length;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,7 +319,7 @@ namespace Opm {
|
||||
&& (segment_number == segment2);
|
||||
|
||||
this->addSegment(segment_number, branch, outlet_segment,
|
||||
segment_length, depth_change, diameter,
|
||||
length, depth, diameter,
|
||||
roughness, area, volume, data_ready,
|
||||
node_X, node_Y);
|
||||
}
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
"value_type": "STRING"
|
||||
},
|
||||
{
|
||||
"name": "DEPTH",
|
||||
"name": "TOP_DEPTH",
|
||||
"value_type": "DOUBLE",
|
||||
"dimension": "Length"
|
||||
},
|
||||
{
|
||||
"name": "LENGTH",
|
||||
"name": "TOP_LENGTH",
|
||||
"value_type": "DOUBLE",
|
||||
"dimension": "Length",
|
||||
"default": 0
|
||||
@@ -71,12 +71,12 @@
|
||||
"value_type": "INT"
|
||||
},
|
||||
{
|
||||
"name": "SEGMENT_LENGTH",
|
||||
"name": "LENGTH",
|
||||
"value_type": "DOUBLE",
|
||||
"dimension": "Length"
|
||||
},
|
||||
{
|
||||
"name": "DEPTH_CHANGE",
|
||||
"name": "DEPTH",
|
||||
"value_type": "DOUBLE",
|
||||
"dimension": "Length"
|
||||
},
|
||||
|
||||
@@ -855,7 +855,10 @@ WELSEGS
|
||||
'PROD01' 2512.5 2512.5 1.0e-5 'ABS' 'HF-' 'HO' 123.456 789.012 /
|
||||
2 2 1 1 2537.5 2537.5 0.3 0.00010 2* 123.456 789.012 /
|
||||
3 3 1 2 2562.5 2562.5 0.2 0.00010 2* 123.456 789.012 /
|
||||
4 7 2 2 2737.5 2537.5 0.2 0.00010 2* 123.456 789.012 /
|
||||
4 4 2 2 2587.5 2537.5 0.2 0.00010 2* 123.456 789.012 /
|
||||
5 5 2 4 2637.5 2537.5 0.2 0.00010 2* 123.456 789.012 /
|
||||
6 6 2 5 2687.5 2537.5 0.2 0.00010 2* 123.456 789.012 /
|
||||
7 7 2 6 2737.5 2537.5 0.2 0.00010 2* 123.456 789.012 /
|
||||
8 8 3 7 3337.6 2534.5 0.2 0.00015 2* 123.456 789.012 /
|
||||
/
|
||||
|
||||
|
||||
@@ -469,8 +469,8 @@ BOOST_AUTO_TEST_CASE( MULTISEGMENT_ABS ) {
|
||||
const auto& rec1 = kw.getRecord(0); // top segment
|
||||
|
||||
const std::string well_name = rec1.getItem("WELL").getTrimmedString(0);
|
||||
const double depth_top = rec1.getItem("DEPTH").get< double >(0);
|
||||
const double length_top = rec1.getItem("LENGTH").get< double >(0);
|
||||
const double depth_top = rec1.getItem("TOP_DEPTH").get< double >(0);
|
||||
const double length_top = rec1.getItem("TOP_LENGTH").get< double >(0);
|
||||
const double volume_top = rec1.getItem("WELLBORE_VOLUME").get< double >(0);
|
||||
const WellSegments::LengthDepth length_depth_type = WellSegments::LengthDepthFromString(rec1.getItem("INFO_TYPE").getTrimmedString(0));
|
||||
const WellSegments::CompPressureDrop comp_pressure_drop = WellSegments::CompPressureDropFromString(rec1.getItem("PRESSURE_COMPONENTS").getTrimmedString(0));
|
||||
@@ -498,8 +498,8 @@ BOOST_AUTO_TEST_CASE( MULTISEGMENT_ABS ) {
|
||||
BOOST_CHECK_EQUAL( 2, segment2 );
|
||||
const int branch = rec2.getItem("BRANCH").get< int >(0);
|
||||
const int outlet_segment = rec2.getItem("JOIN_SEGMENT").get< int >(0);
|
||||
const double segment_length = rec2.getItem("SEGMENT_LENGTH").get< double >(0);
|
||||
const double depth_change = rec2.getItem("DEPTH_CHANGE").get< double >(0);
|
||||
const double segment_length = rec2.getItem("LENGTH").get< double >(0);
|
||||
const double depth_change = rec2.getItem("DEPTH").get< double >(0);
|
||||
const double diameter = rec2.getItem("DIAMETER").get< double >(0);
|
||||
const double roughness = rec2.getItem("ROUGHNESS").get< double >(0);
|
||||
BOOST_CHECK_EQUAL( 1, branch );
|
||||
@@ -518,8 +518,8 @@ BOOST_AUTO_TEST_CASE( MULTISEGMENT_ABS ) {
|
||||
BOOST_CHECK_EQUAL( 6, segment2 );
|
||||
const int branch = rec6.getItem("BRANCH").get< int >(0);
|
||||
const int outlet_segment = rec6.getItem("JOIN_SEGMENT").get< int >(0);
|
||||
const double segment_length = rec6.getItem("SEGMENT_LENGTH").get< double >(0);
|
||||
const double depth_change = rec6.getItem("DEPTH_CHANGE").get< double >(0);
|
||||
const double segment_length = rec6.getItem("LENGTH").get< double >(0);
|
||||
const double depth_change = rec6.getItem("DEPTH").get< double >(0);
|
||||
const double diameter = rec6.getItem("DIAMETER").get< double >(0);
|
||||
const double roughness = rec6.getItem("ROUGHNESS").get< double >(0);
|
||||
BOOST_CHECK_EQUAL( 2, branch );
|
||||
@@ -538,8 +538,8 @@ BOOST_AUTO_TEST_CASE( MULTISEGMENT_ABS ) {
|
||||
BOOST_CHECK_EQUAL( 8, segment2 );
|
||||
const int branch = rec7.getItem("BRANCH").get< int >(0);
|
||||
const int outlet_segment = rec7.getItem("JOIN_SEGMENT").get< int >(0);
|
||||
const double segment_length = rec7.getItem("SEGMENT_LENGTH").get< double >(0);
|
||||
const double depth_change = rec7.getItem("DEPTH_CHANGE").get< double >(0);
|
||||
const double segment_length = rec7.getItem("LENGTH").get< double >(0);
|
||||
const double depth_change = rec7.getItem("DEPTH").get< double >(0);
|
||||
const double diameter = rec7.getItem("DIAMETER").get< double >(0);
|
||||
const double roughness = rec7.getItem("ROUGHNESS").get< double >(0);
|
||||
BOOST_CHECK_EQUAL( 3, branch );
|
||||
|
||||
Reference in New Issue
Block a user