diff --git a/compareECLFiles.cmake b/compareECLFiles.cmake index 67025a0b7..9bf18d1b0 100755 --- a/compareECLFiles.cmake +++ b/compareECLFiles.cmake @@ -475,48 +475,63 @@ if(MPI_FOUND) FILENAME SPE1CASE2 SIMULATOR flow ABS_TOL ${abs_tol_parallel} - REL_TOL ${rel_tol_parallel}) + REL_TOL ${rel_tol_parallel} + TEST_ARGS --linear-solver-reduction=1e-7 --tolerance-cnv=5e-6 --tolerance-mb=1e-8) add_test_compare_parallel_simulation(CASENAME spe9 FILENAME SPE9_CP_SHORT SIMULATOR flow ABS_TOL ${abs_tol_parallel} - REL_TOL ${rel_tol_parallel}) + REL_TOL ${rel_tol_parallel} + TEST_ARGS --linear-solver-reduction=1e-7 --tolerance-cnv=5e-6 --tolerance-mb=1e-8) add_test_compare_parallel_simulation(CASENAME spe9group FILENAME SPE9_CP_GROUP SIMULATOR flow ABS_TOL ${abs_tol_parallel} - REL_TOL ${coarse_rel_tol_parallel}) + REL_TOL ${coarse_rel_tol_parallel} + TEST_ARGS --linear-solver-reduction=1e-7 --tolerance-cnv=5e-6 --tolerance-mb=1e-8) add_test_compare_parallel_simulation(CASENAME spe3 FILENAME SPE3CASE1 SIMULATOR flow ABS_TOL ${abs_tol_parallel} - REL_TOL ${coarse_rel_tol_parallel}) + REL_TOL ${coarse_rel_tol_parallel} + TEST_ARGS --linear-solver-reduction=1e-7 --tolerance-cnv=5e-6 --tolerance-mb=1e-8) add_test_compare_parallel_simulation(CASENAME spe1_solvent FILENAME SPE1CASE2_SOLVENT SIMULATOR flow ABS_TOL ${abs_tol_parallel} - REL_TOL ${coarse_rel_tol_parallel}) + REL_TOL ${coarse_rel_tol_parallel} + TEST_ARGS --linear-solver-reduction=1e-7 --tolerance-cnv=5e-6 --tolerance-mb=1e-8) add_test_compare_parallel_simulation(CASENAME polymer_simple2D FILENAME 2D_THREEPHASE_POLY_HETER SIMULATOR flow ABS_TOL ${abs_tol} - REL_TOL ${coarse_rel_tol}) + REL_TOL ${coarse_rel_tol} + TEST_ARGS --linear-solver-reduction=1e-7 --tolerance-cnv=5e-6 --tolerance-mb=1e-8) add_test_compare_parallel_simulation(CASENAME spe1_foam FILENAME SPE1FOAM SIMULATOR flow ABS_TOL ${abs_tol} - REL_TOL ${rel_tol}) + REL_TOL ${rel_tol} + TEST_ARGS --linear-solver-reduction=1e-7 --tolerance-cnv=5e-6 --tolerance-mb=1e-8) add_test_compare_parallel_simulation(CASENAME spe1_thermal FILENAME SPE1CASE2_THERMAL SIMULATOR flow ABS_TOL ${abs_tol_parallel} REL_TOL 1e-1 - DIR spe1) + DIR spe1 + TEST_ARGS --linear-solver-reduction=1e-7 --tolerance-cnv=5e-6 --tolerance-mb=1e-8) + + add_test_compare_parallel_simulation(CASENAME spe1_brine + FILENAME SPE1CASE1_BRINE + SIMULATOR flow + ABS_TOL ${abs_tol_parallel} + REL_TOL ${rel_tol_parallel} + TEST_ARGS --linear-solver-reduction=1e-7 --tolerance-cnv=5e-6 --tolerance-mb=1e-6) endif() diff --git a/ebos/eclproblem.hh b/ebos/eclproblem.hh index 91d88ec94..9add9748c 100644 --- a/ebos/eclproblem.hh +++ b/ebos/eclproblem.hh @@ -447,6 +447,7 @@ class EclProblem : public GET_PROP_TYPE(TypeTag, BaseProblem) typedef BlackOilSolventModule SolventModule; typedef BlackOilPolymerModule PolymerModule; typedef BlackOilFoamModule FoamModule; + typedef BlackOilBrineModule BrineModule; typedef typename EclEquilInitializer::ScalarFluidState InitialFluidState; @@ -612,12 +613,14 @@ public: SolventModule::initFromDeck(vanguard.deck(), vanguard.eclState()); PolymerModule::initFromDeck(vanguard.deck(), vanguard.eclState()); FoamModule::initFromDeck(vanguard.deck(), vanguard.eclState()); + BrineModule::initFromDeck(vanguard.deck(), vanguard.eclState()); } EclMpiSerializer ser(comm); ser.staticBroadcast(); ser.staticBroadcast(); ser.staticBroadcast(); + ser.staticBroadcast(); // create the ECL writer eclWriter_.reset(new EclWriterType(simulator)); diff --git a/opm/simulators/flow/MissingFeatures.cpp b/opm/simulators/flow/MissingFeatures.cpp index dbc0b8966..fcbfd2320 100644 --- a/opm/simulators/flow/MissingFeatures.cpp +++ b/opm/simulators/flow/MissingFeatures.cpp @@ -515,7 +515,6 @@ namespace MissingFeatures { "PLYVISCS", "PLYVISCT", "PLYVSCST", - "PVTWSALT", "PVZG", "PMAX", "PRIORITY", diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 9dda2019e..475d6950c 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -1010,6 +1010,9 @@ std::size_t packSize(const WaterPvtMultiplexer } else if (data.approach() == PvtApproach::ThermalWaterPvt) { const auto& pvt = *static_cast*>(realWaterPvt); size += packSize(pvt, comm); + } else if (data.approach() == PvtApproach::ConstantCompressibilityBrinePvt) { + const auto& pvt = *static_cast*>(realWaterPvt); + size += packSize(pvt, comm); } return size; @@ -1057,6 +1060,18 @@ std::size_t packSize(const WaterPvtThermal& data, return size; } +template +std::size_t packSize(const ConstantCompressibilityBrinePvt& data, + Dune::MPIHelper::MPICommunicator comm) +{ + return packSize(data.waterReferenceDensity(), comm) + + packSize(data.referencePressure(), comm) + + packSize(data.formationVolumeTables(), comm) + + packSize(data.compressibilityTables(), comm) + + packSize(data.viscosityTables(), comm) + + packSize(data.viscosibilityTables(), comm); +} + template std::size_t packSize(const EclEpsScalingPointsInfo& data, Dune::MPIHelper::MPICommunicator comm) @@ -2769,6 +2784,9 @@ void pack(const WaterPvtMultiplexer& data, } else if (data.approach() == PvtApproach::ThermalWaterPvt) { const auto& pvt = *static_cast*>(realWaterPvt); pack(pvt, buffer, position, comm); + } else if (data.approach() == PvtApproach::ConstantCompressibilityBrinePvt) { + const auto& pvt = *static_cast*>(realWaterPvt); + pack(pvt, buffer, position, comm); } } @@ -2785,6 +2803,19 @@ void pack(const ConstantCompressibilityWaterPvt& data, pack(data.waterViscosibility(), buffer, position, comm); } +template +void pack(const ConstantCompressibilityBrinePvt& data, + std::vector& buffer, int& position, + Dune::MPIHelper::MPICommunicator comm) +{ + pack(data.waterReferenceDensity(), buffer, position, comm); + pack(data.referencePressure(), buffer, position, comm); + pack(data.formationVolumeTables(), buffer, position, comm); + pack(data.compressibilityTables(), buffer, position, comm); + pack(data.viscosityTables(), buffer, position, comm); + pack(data.viscosibilityTables(), buffer, position, comm); +} + template void pack(const WaterPvtThermal& data, std::vector& buffer, int& position, @@ -4912,6 +4943,10 @@ void unpack(WaterPvtMultiplexer& data, auto* realPvt = new WaterPvtThermal; unpack(*realPvt, buffer, position, comm); pvt = realPvt; + } else if (approach == PvtApproach::ConstantCompressibilityBrinePvt) { + auto* realPvt = new ConstantCompressibilityBrinePvt; + unpack(*realPvt, buffer, position, comm); + pvt = realPvt; } data = WaterPvtMultiplexer(approach, pvt); } @@ -4939,6 +4974,30 @@ void unpack(ConstantCompressibilityWaterPvt& data, waterViscosibility); } +template +void unpack(ConstantCompressibilityBrinePvt& data, + std::vector& buffer, int& position, + Dune::MPIHelper::MPICommunicator comm) +{ + using TabulatedFunction = typename ConstantCompressibilityBrinePvt::TabulatedFunction; + std::vector waterReferenceDensity, referencePressure; + std::vector formationVolumeTables, compressibilityTables, + viscosityTables, viscosibilityTables; + + unpack(waterReferenceDensity, buffer, position, comm); + unpack(referencePressure, buffer, position, comm); + unpack(formationVolumeTables, buffer, position, comm); + unpack(compressibilityTables, buffer, position, comm); + unpack(viscosityTables, buffer, position, comm); + unpack(viscosibilityTables, buffer, position, comm); + data = ConstantCompressibilityBrinePvt(waterReferenceDensity, + referencePressure, + formationVolumeTables, + compressibilityTables, + viscosityTables, + viscosibilityTables); +} + template void unpack(WaterPvtThermal& data, std::vector& buffer, int& position, @@ -6442,7 +6501,7 @@ INSTANTIATE_PACK(WaterPvtMultiplexer) INSTANTIATE_PACK(WaterPvtMultiplexer) INSTANTIATE_PACK(ConstantCompressibilityWaterPvt) INSTANTIATE_PACK(WaterPvtThermal) - +INSTANTIATE_PACK(ConstantCompressibilityBrinePvt) #undef INSTANTIATE_PACK } // end namespace Mpi diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 1a5476a34..dd2a8f0d6 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -298,6 +299,10 @@ template std::size_t packSize(const ConstantCompressibilityWaterPvt& data, Dune::MPIHelper::MPICommunicator comm); +template +std::size_t packSize(const ConstantCompressibilityBrinePvt& data, + Dune::MPIHelper::MPICommunicator comm); + template std::size_t packSize(const WaterPvtThermal& data, Dune::MPIHelper::MPICommunicator comm); @@ -460,6 +465,11 @@ void pack(const ConstantCompressibilityWaterPvt& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); +template +void pack(const ConstantCompressibilityBrinePvt& data, + std::vector& buffer, int& position, + Dune::MPIHelper::MPICommunicator comm); + template void pack(const WaterPvtThermal& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); @@ -627,6 +637,10 @@ template void unpack(ConstantCompressibilityWaterPvt& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); +template +void unpack(ConstantCompressibilityBrinePvt& data, std::vector& buffer, + int& position, Dune::MPIHelper::MPICommunicator comm); + template void unpack(IOrderSet& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); diff --git a/tests/run-parallel-regressionTest.sh b/tests/run-parallel-regressionTest.sh index 9b2e7ccb4..9e446c71e 100755 --- a/tests/run-parallel-regressionTest.sh +++ b/tests/run-parallel-regressionTest.sh @@ -18,12 +18,12 @@ TEST_ARGS="$@" rm -Rf ${RESULT_PATH} mkdir -p ${RESULT_PATH} cd ${RESULT_PATH} -${BINPATH}/${EXE_NAME} ${TEST_ARGS}.DATA --enable-opm-rst-file=true --linear-solver-reduction=1e-7 --tolerance-cnv=5e-6 --tolerance-mb=1e-8 --output-dir=${RESULT_PATH} +${BINPATH}/${EXE_NAME} ${TEST_ARGS} --enable-opm-rst-file=true --output-dir=${RESULT_PATH} test $? -eq 0 || exit 1 mkdir mpi cd mpi -mpirun -np 4 ${BINPATH}/${EXE_NAME} ${TEST_ARGS}.DATA --enable-opm-rst-file=true --linear-solver-reduction=1e-7 --tolerance-cnv=5e-6 --tolerance-mb=1e-8 --output-dir=${RESULT_PATH}/mpi +mpirun -np 4 ${BINPATH}/${EXE_NAME} ${TEST_ARGS} --enable-opm-rst-file=true --output-dir=${RESULT_PATH}/mpi test $? -eq 0 || exit 1 cd .. diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 47fe16baa..0eaf08fdf 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1325,6 +1325,20 @@ BOOST_AUTO_TEST_CASE(ConstantCompressibilityWaterPvt) } +BOOST_AUTO_TEST_CASE(ConstantCompressibilityBrinePvt) +{ +#ifdef HAVE_MPI + Opm::Tabulated1DFunction func(2, std::vector{1.0, 2.0}, + std::vector{3.0, 4.0}); + Opm::ConstantCompressibilityBrinePvt val1({1.0, 2.0}, {3.0, 4.0}, {func}, + {func}, {func}, {func}); + auto val2 = PackUnpack(val1); + BOOST_CHECK(std::get<1>(val2) == std::get<2>(val2)); + BOOST_CHECK(val1 == std::get<0>(val2)); +#endif +} + + BOOST_AUTO_TEST_CASE(WaterPvtThermal) { #ifdef HAVE_MPI