Merge pull request #2318 from akva2/fix_brine_module_init

fixed: call initFromDeck for Brine module
This commit is contained in:
Tor Harald Sandve 2020-02-17 14:17:17 +01:00 committed by GitHub
commit 76682497e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 116 additions and 12 deletions

View File

@ -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()

View File

@ -447,6 +447,7 @@ class EclProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
typedef BlackOilSolventModule<TypeTag> SolventModule;
typedef BlackOilPolymerModule<TypeTag> PolymerModule;
typedef BlackOilFoamModule<TypeTag> FoamModule;
typedef BlackOilBrineModule<TypeTag> BrineModule;
typedef typename EclEquilInitializer<TypeTag>::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<SolventModule>();
ser.staticBroadcast<PolymerModule>();
ser.staticBroadcast<FoamModule>();
ser.staticBroadcast<BrineModule>();
// create the ECL writer
eclWriter_.reset(new EclWriterType(simulator));

View File

@ -515,7 +515,6 @@ namespace MissingFeatures {
"PLYVISCS",
"PLYVISCT",
"PLYVSCST",
"PVTWSALT",
"PVZG",
"PMAX",
"PRIORITY",

View File

@ -1010,6 +1010,9 @@ std::size_t packSize(const WaterPvtMultiplexer<Scalar,enableThermal,enableBrine>
} else if (data.approach() == PvtApproach::ThermalWaterPvt) {
const auto& pvt = *static_cast<const WaterPvtThermal<Scalar>*>(realWaterPvt);
size += packSize(pvt, comm);
} else if (data.approach() == PvtApproach::ConstantCompressibilityBrinePvt) {
const auto& pvt = *static_cast<const ConstantCompressibilityBrinePvt<Scalar>*>(realWaterPvt);
size += packSize(pvt, comm);
}
return size;
@ -1057,6 +1060,18 @@ std::size_t packSize(const WaterPvtThermal<Scalar>& data,
return size;
}
template<class Scalar>
std::size_t packSize(const ConstantCompressibilityBrinePvt<Scalar>& 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<class Scalar>
std::size_t packSize(const EclEpsScalingPointsInfo<Scalar>& data,
Dune::MPIHelper::MPICommunicator comm)
@ -2769,6 +2784,9 @@ void pack(const WaterPvtMultiplexer<Scalar,enableThermal,enableBrine>& data,
} else if (data.approach() == PvtApproach::ThermalWaterPvt) {
const auto& pvt = *static_cast<const WaterPvtThermal<Scalar>*>(realWaterPvt);
pack(pvt, buffer, position, comm);
} else if (data.approach() == PvtApproach::ConstantCompressibilityBrinePvt) {
const auto& pvt = *static_cast<const ConstantCompressibilityBrinePvt<Scalar>*>(realWaterPvt);
pack(pvt, buffer, position, comm);
}
}
@ -2785,6 +2803,19 @@ void pack(const ConstantCompressibilityWaterPvt<Scalar>& data,
pack(data.waterViscosibility(), buffer, position, comm);
}
template<class Scalar>
void pack(const ConstantCompressibilityBrinePvt<Scalar>& data,
std::vector<char>& 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<class Scalar>
void pack(const WaterPvtThermal<Scalar>& data,
std::vector<char>& buffer, int& position,
@ -4912,6 +4943,10 @@ void unpack(WaterPvtMultiplexer<Scalar,enableThermal,enableBrine>& data,
auto* realPvt = new WaterPvtThermal<Scalar>;
unpack(*realPvt, buffer, position, comm);
pvt = realPvt;
} else if (approach == PvtApproach::ConstantCompressibilityBrinePvt) {
auto* realPvt = new ConstantCompressibilityBrinePvt<Scalar>;
unpack(*realPvt, buffer, position, comm);
pvt = realPvt;
}
data = WaterPvtMultiplexer<Scalar,enableThermal,enableBrine>(approach, pvt);
}
@ -4939,6 +4974,30 @@ void unpack(ConstantCompressibilityWaterPvt<Scalar>& data,
waterViscosibility);
}
template<class Scalar>
void unpack(ConstantCompressibilityBrinePvt<Scalar>& data,
std::vector<char>& buffer, int& position,
Dune::MPIHelper::MPICommunicator comm)
{
using TabulatedFunction = typename ConstantCompressibilityBrinePvt<Scalar>::TabulatedFunction;
std::vector<Scalar> waterReferenceDensity, referencePressure;
std::vector<TabulatedFunction> 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<Scalar>(waterReferenceDensity,
referencePressure,
formationVolumeTables,
compressibilityTables,
viscosityTables,
viscosibilityTables);
}
template<class Scalar>
void unpack(WaterPvtThermal<Scalar>& data,
std::vector<char>& buffer, int& position,
@ -6442,7 +6501,7 @@ INSTANTIATE_PACK(WaterPvtMultiplexer<double,true,true>)
INSTANTIATE_PACK(WaterPvtMultiplexer<double,false,true>)
INSTANTIATE_PACK(ConstantCompressibilityWaterPvt<double>)
INSTANTIATE_PACK(WaterPvtThermal<double>)
INSTANTIATE_PACK(ConstantCompressibilityBrinePvt<double>)
#undef INSTANTIATE_PACK
} // end namespace Mpi

View File

@ -26,6 +26,7 @@
#include <opm/material/common/Tabulated1DFunction.hpp>
#include <opm/material/common/IntervalTabulated2DFunction.hpp>
#include <opm/material/common/UniformXTabulated2DFunction.hpp>
#include <opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityBrinePvt.hpp>
#include <opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityOilPvt.hpp>
#include <opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityWaterPvt.hpp>
#include <opm/material/fluidsystems/blackoilpvt/DeadOilPvt.hpp>
@ -298,6 +299,10 @@ template<class Scalar>
std::size_t packSize(const ConstantCompressibilityWaterPvt<Scalar>& data,
Dune::MPIHelper::MPICommunicator comm);
template<class Scalar>
std::size_t packSize(const ConstantCompressibilityBrinePvt<Scalar>& data,
Dune::MPIHelper::MPICommunicator comm);
template<class Scalar>
std::size_t packSize(const WaterPvtThermal<Scalar>& data, Dune::MPIHelper::MPICommunicator comm);
@ -460,6 +465,11 @@ void pack(const ConstantCompressibilityWaterPvt<Scalar>& data,
std::vector<char>& buffer, int& position,
Dune::MPIHelper::MPICommunicator comm);
template<class Scalar>
void pack(const ConstantCompressibilityBrinePvt<Scalar>& data,
std::vector<char>& buffer, int& position,
Dune::MPIHelper::MPICommunicator comm);
template<class Scalar>
void pack(const WaterPvtThermal<Scalar>& data, std::vector<char>& buffer,
int& position, Dune::MPIHelper::MPICommunicator comm);
@ -627,6 +637,10 @@ template<class Scalar>
void unpack(ConstantCompressibilityWaterPvt<Scalar>& data, std::vector<char>& buffer,
int& position, Dune::MPIHelper::MPICommunicator comm);
template<class Scalar>
void unpack(ConstantCompressibilityBrinePvt<Scalar>& data, std::vector<char>& buffer,
int& position, Dune::MPIHelper::MPICommunicator comm);
template<class T>
void unpack(IOrderSet<T>& data, std::vector<char>& buffer,
int& position, Dune::MPIHelper::MPICommunicator comm);

View File

@ -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 ..

View File

@ -1325,6 +1325,20 @@ BOOST_AUTO_TEST_CASE(ConstantCompressibilityWaterPvt)
}
BOOST_AUTO_TEST_CASE(ConstantCompressibilityBrinePvt)
{
#ifdef HAVE_MPI
Opm::Tabulated1DFunction<double> func(2, std::vector<double>{1.0, 2.0},
std::vector<double>{3.0, 4.0});
Opm::ConstantCompressibilityBrinePvt<double> 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