mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #2305 from akva2/fix_thermal
Parallel thermal simulations
This commit is contained in:
commit
645b07bf7f
@ -505,4 +505,11 @@ if(MPI_FOUND)
|
|||||||
SIMULATOR flow
|
SIMULATOR flow
|
||||||
ABS_TOL ${abs_tol}
|
ABS_TOL ${abs_tol}
|
||||||
REL_TOL ${rel_tol})
|
REL_TOL ${rel_tol})
|
||||||
|
|
||||||
|
add_test_compare_parallel_simulation(CASENAME spe1_thermal
|
||||||
|
FILENAME SPE1CASE2_THERMAL
|
||||||
|
SIMULATOR flow
|
||||||
|
ABS_TOL ${abs_tol_parallel}
|
||||||
|
REL_TOL 1e-1
|
||||||
|
DIR spe1)
|
||||||
endif()
|
endif()
|
||||||
|
@ -2387,7 +2387,6 @@ private:
|
|||||||
|
|
||||||
const auto& simulator = this->simulator();
|
const auto& simulator = this->simulator();
|
||||||
const auto& vanguard = simulator.vanguard();
|
const auto& vanguard = simulator.vanguard();
|
||||||
const auto& deck = vanguard.deck();
|
|
||||||
const auto& eclState = vanguard.eclState();
|
const auto& eclState = vanguard.eclState();
|
||||||
|
|
||||||
// fluid-matrix interactions (saturation functions; relperm/capillary pressure)
|
// fluid-matrix interactions (saturation functions; relperm/capillary pressure)
|
||||||
@ -2397,7 +2396,7 @@ private:
|
|||||||
compressedToCartesianElemIdx[elemIdx] = vanguard.cartesianIndex(elemIdx);
|
compressedToCartesianElemIdx[elemIdx] = vanguard.cartesianIndex(elemIdx);
|
||||||
|
|
||||||
thermalLawManager_ = std::make_shared<EclThermalLawManager>();
|
thermalLawManager_ = std::make_shared<EclThermalLawManager>();
|
||||||
thermalLawManager_->initFromDeck(deck, eclState, compressedToCartesianElemIdx);
|
thermalLawManager_->initParamsForElements(eclState, compressedToCartesianElemIdx);
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateReferencePorosity_()
|
void updateReferencePorosity_()
|
||||||
@ -3023,7 +3022,7 @@ private:
|
|||||||
for (const auto& bcface : bcconfig) {
|
for (const auto& bcface : bcconfig) {
|
||||||
const auto& type = bcface.bctype;
|
const auto& type = bcface.bctype;
|
||||||
if (type == BCType::RATE) {
|
if (type == BCType::RATE) {
|
||||||
int compIdx;
|
int compIdx = 0;
|
||||||
|
|
||||||
switch (bcface.component) {
|
switch (bcface.component) {
|
||||||
case BCComponent::OIL:
|
case BCComponent::OIL:
|
||||||
|
@ -322,7 +322,7 @@ std::size_t packSize(const std::vector<T,A>& data, Dune::MPIHelper::MPICommunica
|
|||||||
std::size_t size = packSize(data.size(), comm);
|
std::size_t size = packSize(data.size(), comm);
|
||||||
|
|
||||||
for (const auto& entry: data)
|
for (const auto& entry: data)
|
||||||
size+=packSize(entry, comm);
|
size += packSize(entry, comm);
|
||||||
|
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
@ -1027,13 +1027,13 @@ std::size_t packSize(const OilPvtThermal<Scalar>& data,
|
|||||||
template std::size_t packSize(const OilPvtThermal<double>& data,
|
template std::size_t packSize(const OilPvtThermal<double>& data,
|
||||||
Dune::MPIHelper::MPICommunicator comm);
|
Dune::MPIHelper::MPICommunicator comm);
|
||||||
|
|
||||||
template<class Scalar, bool enableThermal>
|
template<class Scalar, bool enableThermal, bool enableBrine>
|
||||||
std::size_t packSize(const WaterPvtMultiplexer<Scalar,enableThermal>& data,
|
std::size_t packSize(const WaterPvtMultiplexer<Scalar,enableThermal,enableBrine>& data,
|
||||||
Dune::MPIHelper::MPICommunicator comm)
|
Dune::MPIHelper::MPICommunicator comm)
|
||||||
{
|
{
|
||||||
std::size_t size = packSize(data.approach(), comm);
|
std::size_t size = packSize(data.approach(), comm);
|
||||||
const void* realWaterPvt = data.realWaterPvt();
|
const void* realWaterPvt = data.realWaterPvt();
|
||||||
using PvtApproach = WaterPvtMultiplexer<Scalar,enableThermal>;
|
using PvtApproach = WaterPvtMultiplexer<Scalar,enableThermal,enableBrine>;
|
||||||
if (data.approach() == PvtApproach::ConstantCompressibilityWaterPvt) {
|
if (data.approach() == PvtApproach::ConstantCompressibilityWaterPvt) {
|
||||||
const auto& pvt = *static_cast<const ConstantCompressibilityWaterPvt<Scalar>*>(realWaterPvt);
|
const auto& pvt = *static_cast<const ConstantCompressibilityWaterPvt<Scalar>*>(realWaterPvt);
|
||||||
size += packSize(pvt, comm);
|
size += packSize(pvt, comm);
|
||||||
@ -1045,9 +1045,9 @@ std::size_t packSize(const WaterPvtMultiplexer<Scalar,enableThermal>& data,
|
|||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
template std::size_t packSize(const WaterPvtMultiplexer<double,true>& data,
|
template std::size_t packSize(const WaterPvtMultiplexer<double,true,true>& data,
|
||||||
Dune::MPIHelper::MPICommunicator comm);
|
Dune::MPIHelper::MPICommunicator comm);
|
||||||
template std::size_t packSize(const WaterPvtMultiplexer<double,false>& data,
|
template std::size_t packSize(const WaterPvtMultiplexer<double,false,true>& data,
|
||||||
Dune::MPIHelper::MPICommunicator comm);
|
Dune::MPIHelper::MPICommunicator comm);
|
||||||
|
|
||||||
template<class Scalar>
|
template<class Scalar>
|
||||||
@ -1084,9 +1084,13 @@ std::size_t packSize(const WaterPvtThermal<Scalar>& data,
|
|||||||
packSize(data.enableThermalViscosity(), comm) +
|
packSize(data.enableThermalViscosity(), comm) +
|
||||||
packSize(data.enableInternalEnergy(), comm);
|
packSize(data.enableInternalEnergy(), comm);
|
||||||
size += packSize(bool(), comm);
|
size += packSize(bool(), comm);
|
||||||
|
if (data.isoThermalPvt())
|
||||||
|
size += packSize(data.isoThermalPvt()->approach(), comm);
|
||||||
|
|
||||||
using PvtApproach = WaterPvtThermal<Scalar>;
|
using PvtApproach = WaterPvtThermal<Scalar>;
|
||||||
if (data.isoThermalPvt()->approach() != PvtApproach::IsothermalPvt::NoWaterPvt)
|
if (data.isoThermalPvt()->approach() != PvtApproach::IsothermalPvt::NoWaterPvt) {
|
||||||
size += packSize(*data.isoThermalPvt(), comm);
|
size += packSize(*data.isoThermalPvt(), comm);
|
||||||
|
}
|
||||||
|
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
@ -2900,14 +2904,14 @@ template void pack(const OilPvtThermal<double>& data,
|
|||||||
std::vector<char>& buffer, int& position,
|
std::vector<char>& buffer, int& position,
|
||||||
Dune::MPIHelper::MPICommunicator comm);
|
Dune::MPIHelper::MPICommunicator comm);
|
||||||
|
|
||||||
template<class Scalar, bool enableThermal>
|
template<class Scalar, bool enableThermal, bool enableBrine>
|
||||||
void pack(const WaterPvtMultiplexer<Scalar,enableThermal>& data,
|
void pack(const WaterPvtMultiplexer<Scalar,enableThermal,enableBrine>& data,
|
||||||
std::vector<char>& buffer, int& position,
|
std::vector<char>& buffer, int& position,
|
||||||
Dune::MPIHelper::MPICommunicator comm)
|
Dune::MPIHelper::MPICommunicator comm)
|
||||||
{
|
{
|
||||||
pack(data.approach(), buffer, position, comm);
|
pack(data.approach(), buffer, position, comm);
|
||||||
const void* realWaterPvt = data.realWaterPvt();
|
const void* realWaterPvt = data.realWaterPvt();
|
||||||
using PvtApproach = WaterPvtMultiplexer<Scalar,enableThermal>;
|
using PvtApproach = WaterPvtMultiplexer<Scalar,enableThermal,enableBrine>;
|
||||||
if (data.approach() == PvtApproach::ConstantCompressibilityWaterPvt) {
|
if (data.approach() == PvtApproach::ConstantCompressibilityWaterPvt) {
|
||||||
const auto& pvt = *static_cast<const ConstantCompressibilityWaterPvt<Scalar>*>(realWaterPvt);
|
const auto& pvt = *static_cast<const ConstantCompressibilityWaterPvt<Scalar>*>(realWaterPvt);
|
||||||
pack(pvt, buffer, position, comm);
|
pack(pvt, buffer, position, comm);
|
||||||
@ -2917,10 +2921,10 @@ void pack(const WaterPvtMultiplexer<Scalar,enableThermal>& data,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template void pack(const WaterPvtMultiplexer<double,true>& data,
|
template void pack(const WaterPvtMultiplexer<double,true,true>& data,
|
||||||
std::vector<char>& buffer, int& position,
|
std::vector<char>& buffer, int& position,
|
||||||
Dune::MPIHelper::MPICommunicator comm);
|
Dune::MPIHelper::MPICommunicator comm);
|
||||||
template void pack(const WaterPvtMultiplexer<double,false>& data,
|
template void pack(const WaterPvtMultiplexer<double,false,true>& data,
|
||||||
std::vector<char>& buffer, int& position,
|
std::vector<char>& buffer, int& position,
|
||||||
Dune::MPIHelper::MPICommunicator comm);
|
Dune::MPIHelper::MPICommunicator comm);
|
||||||
|
|
||||||
@ -2963,8 +2967,11 @@ void pack(const WaterPvtThermal<Scalar>& data,
|
|||||||
pack(data.isoThermalPvt() != nullptr, buffer, position, comm);
|
pack(data.isoThermalPvt() != nullptr, buffer, position, comm);
|
||||||
|
|
||||||
using PvtApproach = WaterPvtThermal<Scalar>;
|
using PvtApproach = WaterPvtThermal<Scalar>;
|
||||||
if (data.isoThermalPvt()->approach() != PvtApproach::IsothermalPvt::NoWaterPvt)
|
if (data.isoThermalPvt())
|
||||||
|
pack(data.isoThermalPvt()->approach(), buffer, position, comm);
|
||||||
|
if (data.isoThermalPvt()->approach() != PvtApproach::IsothermalPvt::NoWaterPvt) {
|
||||||
pack(*data.isoThermalPvt(), buffer, position, comm);
|
pack(*data.isoThermalPvt(), buffer, position, comm);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template void pack(const WaterPvtThermal<double>& data,
|
template void pack(const WaterPvtThermal<double>& data,
|
||||||
@ -4064,7 +4071,7 @@ template<class T, class A>
|
|||||||
void unpack(std::vector<T,A>& data, std::vector<char>& buffer, int& position,
|
void unpack(std::vector<T,A>& data, std::vector<char>& buffer, int& position,
|
||||||
Dune::MPIHelper::MPICommunicator comm)
|
Dune::MPIHelper::MPICommunicator comm)
|
||||||
{
|
{
|
||||||
std::size_t length=0;
|
std::size_t length = 0;
|
||||||
unpack(length, buffer, position, comm);
|
unpack(length, buffer, position, comm);
|
||||||
data.resize(length);
|
data.resize(length);
|
||||||
|
|
||||||
@ -5160,14 +5167,14 @@ template void unpack(OilPvtThermal<double>& data,
|
|||||||
std::vector<char>& buffer, int& position,
|
std::vector<char>& buffer, int& position,
|
||||||
Dune::MPIHelper::MPICommunicator comm);
|
Dune::MPIHelper::MPICommunicator comm);
|
||||||
|
|
||||||
template<class Scalar, bool enableThermal>
|
template<class Scalar, bool enableThermal, bool enableBrine>
|
||||||
void unpack(WaterPvtMultiplexer<Scalar,enableThermal>& data,
|
void unpack(WaterPvtMultiplexer<Scalar,enableThermal,enableBrine>& data,
|
||||||
std::vector<char>& buffer, int& position,
|
std::vector<char>& buffer, int& position,
|
||||||
Dune::MPIHelper::MPICommunicator comm)
|
Dune::MPIHelper::MPICommunicator comm)
|
||||||
{
|
{
|
||||||
typename WaterPvtMultiplexer<Scalar,enableThermal>::WaterPvtApproach approach;
|
typename WaterPvtMultiplexer<Scalar,enableThermal,enableBrine>::WaterPvtApproach approach;
|
||||||
unpack(approach, buffer, position, comm);
|
unpack(approach, buffer, position, comm);
|
||||||
using PvtApproach = WaterPvtMultiplexer<Scalar,enableThermal>;
|
using PvtApproach = WaterPvtMultiplexer<Scalar,enableThermal,enableBrine>;
|
||||||
void* pvt = nullptr;
|
void* pvt = nullptr;
|
||||||
if (approach == PvtApproach::ConstantCompressibilityWaterPvt) {
|
if (approach == PvtApproach::ConstantCompressibilityWaterPvt) {
|
||||||
auto* realPvt = new ConstantCompressibilityWaterPvt<Scalar>;
|
auto* realPvt = new ConstantCompressibilityWaterPvt<Scalar>;
|
||||||
@ -5178,7 +5185,7 @@ void unpack(WaterPvtMultiplexer<Scalar,enableThermal>& data,
|
|||||||
unpack(*realPvt, buffer, position, comm);
|
unpack(*realPvt, buffer, position, comm);
|
||||||
pvt = realPvt;
|
pvt = realPvt;
|
||||||
}
|
}
|
||||||
data = WaterPvtMultiplexer<Scalar,enableThermal>(approach, pvt);
|
data = WaterPvtMultiplexer<Scalar,enableThermal,enableBrine>(approach, pvt);
|
||||||
}
|
}
|
||||||
|
|
||||||
template void unpack(WaterPvtMultiplexer<double,true>& data,
|
template void unpack(WaterPvtMultiplexer<double,true>& data,
|
||||||
@ -5246,7 +5253,9 @@ void unpack(WaterPvtThermal<Scalar>& data,
|
|||||||
if (isothermal) {
|
if (isothermal) {
|
||||||
pvt = new typename WaterPvtThermal<Scalar>::IsothermalPvt;
|
pvt = new typename WaterPvtThermal<Scalar>::IsothermalPvt;
|
||||||
using PvtApproach = WaterPvtThermal<Scalar>;
|
using PvtApproach = WaterPvtThermal<Scalar>;
|
||||||
if (pvt->approach() != PvtApproach::IsothermalPvt::NoWaterPvt)
|
typename PvtApproach::IsothermalPvt::WaterPvtApproach approach;
|
||||||
|
unpack(approach, buffer, position, comm);
|
||||||
|
if (approach != PvtApproach::IsothermalPvt::NoWaterPvt)
|
||||||
unpack(*pvt, buffer, position, comm);
|
unpack(*pvt, buffer, position, comm);
|
||||||
}
|
}
|
||||||
data = WaterPvtThermal<Scalar>(pvt, viscrefPress, watdentRefTemp,
|
data = WaterPvtThermal<Scalar>(pvt, viscrefPress, watdentRefTemp,
|
||||||
|
@ -75,8 +75,6 @@ namespace Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Aqudims;
|
class Aqudims;
|
||||||
class BCConfig;
|
|
||||||
class BCConfig::BCFace;
|
|
||||||
class BrineDensityTable;
|
class BrineDensityTable;
|
||||||
class ColumnSchema;
|
class ColumnSchema;
|
||||||
class Connection;
|
class Connection;
|
||||||
@ -293,8 +291,8 @@ std::size_t packSize(const LiveOilPvt<Scalar>& data,
|
|||||||
template<class Scalar>
|
template<class Scalar>
|
||||||
std::size_t packSize(const OilPvtThermal<Scalar>& data, Dune::MPIHelper::MPICommunicator comm);
|
std::size_t packSize(const OilPvtThermal<Scalar>& data, Dune::MPIHelper::MPICommunicator comm);
|
||||||
|
|
||||||
template<class Scalar, bool enableThermal>
|
template<class Scalar, bool enableThermal, bool enableBrine>
|
||||||
std::size_t packSize(const WaterPvtMultiplexer<Scalar,enableThermal>& data,
|
std::size_t packSize(const WaterPvtMultiplexer<Scalar,enableThermal,enableBrine>& data,
|
||||||
Dune::MPIHelper::MPICommunicator comm);
|
Dune::MPIHelper::MPICommunicator comm);
|
||||||
|
|
||||||
template<class Scalar>
|
template<class Scalar>
|
||||||
@ -453,8 +451,8 @@ template<class Scalar>
|
|||||||
void pack(const OilPvtThermal<Scalar>& data, std::vector<char>& buffer,
|
void pack(const OilPvtThermal<Scalar>& data, std::vector<char>& buffer,
|
||||||
int& position, Dune::MPIHelper::MPICommunicator comm);
|
int& position, Dune::MPIHelper::MPICommunicator comm);
|
||||||
|
|
||||||
template<class Scalar, bool enableThermal>
|
template<class Scalar, bool enableThermal, bool enableBrine>
|
||||||
void pack(const WaterPvtMultiplexer<Scalar,enableThermal>& data,
|
void pack(const WaterPvtMultiplexer<Scalar,enableThermal,enableBrine>& data,
|
||||||
const std::vector<char>& buffer, int& position,
|
const std::vector<char>& buffer, int& position,
|
||||||
Dune::MPIHelper::MPICommunicator comm);
|
Dune::MPIHelper::MPICommunicator comm);
|
||||||
|
|
||||||
@ -617,8 +615,8 @@ template<class Scalar>
|
|||||||
void unpack(OilPvtThermal<Scalar>& data, std::vector<char>& buffer,
|
void unpack(OilPvtThermal<Scalar>& data, std::vector<char>& buffer,
|
||||||
int& position, Dune::MPIHelper::MPICommunicator comm);
|
int& position, Dune::MPIHelper::MPICommunicator comm);
|
||||||
|
|
||||||
template<class Scalar, bool enableThermal>
|
template<class Scalar, bool enableThermal, bool enableBrine>
|
||||||
void unpack(WaterPvtMultiplexer<Scalar,enableThermal>& data,
|
void unpack(WaterPvtMultiplexer<Scalar,enableThermal,enableBrine>& data,
|
||||||
const std::vector<char>& buffer, int& position,
|
const std::vector<char>& buffer, int& position,
|
||||||
Dune::MPIHelper::MPICommunicator comm);
|
Dune::MPIHelper::MPICommunicator comm);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user