mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #284 from totto82/MoveWell
Some more cleaning in the output code in opm-output, ewoms and opm-simulator
This commit is contained in:
commit
05d4986d7f
@ -174,6 +174,69 @@ void test_summary()
|
||||
CHECK_CLOSE(roip2, ecl_sum_get_general_var( resp, 1, "ROIP:2" ), 1e-3 );
|
||||
}
|
||||
|
||||
void test_readWriteWells() {
|
||||
|
||||
using opt = Opm::data::Rates::opt;
|
||||
|
||||
Opm::data::Rates r1, r2, rc1, rc2, rc3;
|
||||
r1.set( opt::wat, 5.67 );
|
||||
r1.set( opt::oil, 6.78 );
|
||||
r1.set( opt::gas, 7.89 );
|
||||
|
||||
r2.set( opt::wat, 8.90 );
|
||||
r2.set( opt::oil, 9.01 );
|
||||
r2.set( opt::gas, 10.12 );
|
||||
|
||||
rc1.set( opt::wat, 20.41 );
|
||||
rc1.set( opt::oil, 21.19 );
|
||||
rc1.set( opt::gas, 22.41 );
|
||||
|
||||
rc2.set( opt::wat, 23.19 );
|
||||
rc2.set( opt::oil, 24.41 );
|
||||
rc2.set( opt::gas, 25.19 );
|
||||
|
||||
rc3.set( opt::wat, 26.41 );
|
||||
rc3.set( opt::oil, 27.19 );
|
||||
rc3.set( opt::gas, 28.41 );
|
||||
|
||||
Opm::data::Well w1, w2;
|
||||
w1.rates = r1;
|
||||
w1.bhp = 1.23;
|
||||
w1.temperature = 3.45;
|
||||
w1.control = 1;
|
||||
|
||||
/*
|
||||
* the completion keys (active indices) and well names correspond to the
|
||||
* input deck. All other entries in the well structures are arbitrary.
|
||||
*/
|
||||
w1.completions.push_back( { 88, rc1, 30.45, 123.45 } );
|
||||
w1.completions.push_back( { 288, rc2, 33.19, 67.89 } );
|
||||
|
||||
w2.rates = r2;
|
||||
w2.bhp = 2.34;
|
||||
w2.temperature = 4.56;
|
||||
w2.control = 2;
|
||||
w2.completions.push_back( { 188, rc3, 36.22, 19.28 } );
|
||||
|
||||
Opm::data::Wells wellRates;
|
||||
|
||||
wellRates["OP_1"] = w1;
|
||||
wellRates["OP_2"] = w2;
|
||||
|
||||
typedef Dune :: Point2PointCommunicator< Dune :: SimpleMessageBuffer > P2PCommunicatorType;
|
||||
typedef typename P2PCommunicatorType :: MessageBufferType MessageBufferType;
|
||||
MessageBufferType buffer;
|
||||
|
||||
wellRates.write(buffer);
|
||||
|
||||
Opm::data::Wells wellRatesCopy;
|
||||
wellRatesCopy.read(buffer);
|
||||
|
||||
CHECK( wellRatesCopy.get( "OP_1" , opt::wat) , wellRates.get( "OP_1" , opt::wat));
|
||||
CHECK( wellRatesCopy.get( "OP_2" , 188 , opt::wat) , wellRates.get( "OP_2" , 188 , opt::wat));
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
#if HAVE_DUNE_FEM
|
||||
@ -185,6 +248,7 @@ int main(int argc, char** argv)
|
||||
typedef TTAG(TestEclOutputTypeTag) TypeTag;
|
||||
Ewoms::registerAllParameters_<TypeTag>();
|
||||
test_summary();
|
||||
test_readWriteWells();
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user