From 1129e95a16f1cf93ec147c36e3d19c99e0384f4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Mon, 13 Nov 2023 09:12:05 +0100 Subject: [PATCH] Store Peaceman Denominator and Connection Length in Restart File This commit writes the value of the denominator expression in Peaceman's formula to SCON[6] and the connection's interval length to SCON[31] in the restart file. Using this information at restart time is the subject of follow-up work. --- opm/output/eclipse/VectorItems/connection.hpp | 7 +++++++ src/opm/output/eclipse/AggregateConnectionData.cpp | 9 +++++++-- tests/test_AggregateConnectionData.cpp | 6 ++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/opm/output/eclipse/VectorItems/connection.hpp b/opm/output/eclipse/VectorItems/connection.hpp index 5c95c1b27..6741f6df8 100644 --- a/opm/output/eclipse/VectorItems/connection.hpp +++ b/opm/output/eclipse/VectorItems/connection.hpp @@ -50,6 +50,10 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems EffectiveKH = 3, // Effective Kh product of connection SkinFactor = 4, // Skinfactor - item 'SKIN' from COMPDAT + + CFDenom = 6, // Denominator in connection transmissibility + // factor expression + item12 = 11, // Connection transmissibility factor SegDistEnd = 20, // Distance to end of connection in segment @@ -57,6 +61,9 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems item30 = 29, // Unknown item31 = 30, // Unknown + + EffectiveLength = 31, // Effective length of connection's perforation interval. + CFInDeck = 40, // = 0 for connection factor not defined, = 1 for connection factor defined }; } // SConn diff --git a/src/opm/output/eclipse/AggregateConnectionData.cpp b/src/opm/output/eclipse/AggregateConnectionData.cpp index a2b2227cd..808978469 100644 --- a/src/opm/output/eclipse/AggregateConnectionData.cpp +++ b/src/opm/output/eclipse/AggregateConnectionData.cpp @@ -191,8 +191,9 @@ namespace { sConn[Ix::SkinFactor] = conn.skinFactor(); - sConn[Ix::item12] = sConn[Ix::ConnTrans]; + sConn[Ix::CFDenom] = conn.ctfProperties().peaceman_denom; + sConn[Ix::item12] = sConn[Ix::ConnTrans]; if (conn.attachedToSegment()) { const auto& [start, end] = *conn.perf_range(); @@ -202,7 +203,11 @@ namespace { sConn[Ix::item30] = -1.0e+20f; sConn[Ix::item31] = -1.0e+20f; - sConn[Ix::CFInDeck] = (conn.ctfAssignedFromInput()) ? 1 : 0; + + sConn[Ix::EffectiveLength] = + scprop(M::length, conn.connectionLength()); + + sConn[Ix::CFInDeck] = conn.ctfAssignedFromInput() ? 1.0f : 0.0f; } template diff --git a/tests/test_AggregateConnectionData.cpp b/tests/test_AggregateConnectionData.cpp index f8376969a..82056efb8 100644 --- a/tests/test_AggregateConnectionData.cpp +++ b/tests/test_AggregateConnectionData.cpp @@ -687,11 +687,13 @@ BOOST_AUTO_TEST_CASE(Declared_Connection_Data) BOOST_CHECK_CLOSE(sconn[i0 + Ix::Depth], 7050., 1.0e-5); // PROD - conn 1 : Centre depth BOOST_CHECK_CLOSE(sconn[i0 + Ix::Diameter], 0.20, 1.0e-5); // PROD - conn 1 : diameter BOOST_CHECK_CLOSE(sconn[i0 + Ix::EffectiveKH], 1581.13879, 1.0e-5); // PROD - conn 1 : effective kh-product + BOOST_CHECK_CLOSE(sconn[i0 + Ix::CFDenom], 4.37696314, 1.0e-5); BOOST_CHECK_CLOSE(sconn[i0 + Ix::item12], 2.55826545, 1.0e-5); // PROD - conn 1 : Transmissibility factor BOOST_CHECK_CLOSE( sconn[i0 + Ix::SegDistEnd], 130., 1.0e-5); // PROD - conn 1 : Distance to end of connection in segment BOOST_CHECK_CLOSE( sconn[i0 + Ix::SegDistStart], 30., 1.0e-5); // PROD - conn 1 : Distance to start of connection in segment + BOOST_CHECK_CLOSE(sconn[i0 + Ix::EffectiveLength], 100.0, 1.0e-5); // Well no 2 - WINJ well connNo = 3; @@ -700,11 +702,13 @@ BOOST_AUTO_TEST_CASE(Declared_Connection_Data) BOOST_CHECK_CLOSE(sconn[i0 + Ix::Depth], 7250., 1.0e-5); // WINJ - conn 3 : Centre depth BOOST_CHECK_CLOSE(sconn[i0 + Ix::Diameter], 0.20, 1.0e-5); // WINJ - conn 3 : diameter BOOST_CHECK_CLOSE(sconn[i0 + Ix::EffectiveKH], 1581.13879, 1.0e-5); // WINJ - conn 3 : effective kh-product + BOOST_CHECK_CLOSE(sconn[i0 + Ix::CFDenom], 4.37696314, 1.0e-5); BOOST_CHECK_CLOSE(sconn[i0 + Ix::item12], 2.55826545, 1.0e-5); // WINJ - conn 3 : Transmissibility factor BOOST_CHECK_CLOSE( sconn[i0 + Ix::SegDistEnd], 0., 1.0e-5); // WINJ - conn 3 : Distance to end of connection in segment BOOST_CHECK_CLOSE( sconn[i0 + Ix::SegDistStart], 0., 1.0e-5); // WINJ - conn 3 : Distance to start of connection in segment + BOOST_CHECK_CLOSE(sconn[i0 + Ix::EffectiveLength], 100.0, 1.0e-5); connNo = 4; i0 = ih.ncwmax * ih.nsconz + (connNo - 1) * ih.nsconz; @@ -712,11 +716,13 @@ BOOST_AUTO_TEST_CASE(Declared_Connection_Data) BOOST_CHECK_CLOSE(sconn[i0 + Ix::Depth], 7250., 1.0e-5); // WINJ - conn 4 : Centre depth BOOST_CHECK_CLOSE(sconn[i0 + Ix::Diameter], 0.20, 1.0e-5); // WINJ - conn 4 : diameter BOOST_CHECK_CLOSE(sconn[i0 + Ix::EffectiveKH], 1581.13879, 1.0e-5); // WINJ - conn 4 : effective kh-product + BOOST_CHECK_CLOSE(sconn[i0 + Ix::CFDenom], 4.37696314, 1.0e-5); BOOST_CHECK_CLOSE(sconn[i0 + Ix::item12], 2.55826545, 1.0e-5); // WINJ - conn 4 : Transmissibility factor BOOST_CHECK_CLOSE( sconn[i0 + Ix::SegDistEnd], 0., 1.0e-5); // WINJ - conn 4 : Distance to end of connection in segment BOOST_CHECK_CLOSE( sconn[i0 + Ix::SegDistStart], 0., 1.0e-5); // WINJ - conn 4 : Distance to start of connection in segment + BOOST_CHECK_CLOSE(sconn[i0 + Ix::EffectiveLength], 100.0, 1.0e-5); } // XCONN (PROD) + (WINJ)