mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
add mpi serialization for ConstantCompressibilityBrinePvt
This commit is contained in:
parent
88eae71811
commit
0be763e6b6
@ -1003,6 +1003,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;
|
||||
@ -1050,6 +1053,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)
|
||||
@ -2774,6 +2789,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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2790,6 +2808,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,
|
||||
@ -4939,6 +4970,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);
|
||||
}
|
||||
@ -4966,6 +5001,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,
|
||||
@ -6508,7 +6567,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
|
||||
|
@ -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>
|
||||
@ -300,6 +301,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);
|
||||
|
||||
@ -462,6 +467,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);
|
||||
@ -629,6 +639,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);
|
||||
|
@ -1314,6 +1314,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
|
||||
|
Loading…
Reference in New Issue
Block a user