diff --git a/CMakeLists.txt b/CMakeLists.txt index 4dd0cd4fab..c091e1377f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -641,6 +641,16 @@ opm_add_test(flow_blackoil_polyhedralgrid flow/flow_blackoil_polyhedralgrid.cpp $) +opm_add_test(flow_blackoil_nohyst + ONLY_COMPILE + ALWAYS_ENABLE + DEFAULT_ENABLE_IF ${FLOW_POLY_ONLY_DEFAULT_ENABLE_IF} + DEPENDS opmsimulators + LIBRARIES opmsimulators + SOURCES + flow/flow_blackoil_nohyst.cpp + $) + opm_add_test(flow_distribute_z ONLY_COMPILE ALWAYS_ENABLE diff --git a/flow/flow_blackoil_nohyst.cpp b/flow/flow_blackoil_nohyst.cpp new file mode 100644 index 0000000000..48be5b672c --- /dev/null +++ b/flow/flow_blackoil_nohyst.cpp @@ -0,0 +1,67 @@ +/* + This file is part of the Open Porous Media project (OPM). + + OPM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OPM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OPM. If not, see . +*/ +#include "config.h" + +#include + +#include +#include +#include +#include + +#include +#include + + +namespace Opm { +namespace Properties { + namespace TTag { + struct FlowProblemNoHystNoEps { + using InheritsFrom = std::tuple; + }; + } + template + struct Linearizer { using type = TpfaLinearizer; }; + + template + struct LocalResidual { using type = BlackOilLocalResidualTPFA; }; + + template + struct EnableDiffusion { static constexpr bool value = false; }; + + template + struct EnableHysteresis { static constexpr bool value = false; }; + + template + struct EnableEndpointScaling { static constexpr bool value = true; }; + + template + struct AvoidElementContext { static constexpr bool value = true; }; + +} +} // namespace Opm + + +int main(int argc, char** argv) +{ + using TypeTag = Opm::Properties::TTag::FlowProblemNoHystNoEps; + auto mainObject = std::make_unique(argc, argv); + auto ret = mainObject->runStatic(); + // Destruct mainObject as the destructor calls MPI_Finalize! + mainObject.reset(); + return ret; +} diff --git a/opm/simulators/flow/equil/EquilibrationHelpers.cpp b/opm/simulators/flow/equil/EquilibrationHelpers.cpp index 35927cb985..35ea12af56 100644 --- a/opm/simulators/flow/equil/EquilibrationHelpers.cpp +++ b/opm/simulators/flow/equil/EquilibrationHelpers.cpp @@ -27,13 +27,10 @@ namespace Opm { namespace EQUIL { -template -using MatLaw = EclMaterialLaw::Manager>; template using FS = BlackOilFluidSystem; -#define INSTANTIATE_TYPE(T) \ +#define INSTANTIATE_TYPE1(T, MatLaw) \ template struct PcEq,MatLaw>; \ - template class EquilReg; \ template T satFromPc,MatLaw>(const MatLaw&, \ const int,const int, \ const T,const bool); \ @@ -43,7 +40,10 @@ template using FS = BlackOilFluidSystem; template T satFromDepth,MatLaw>(const MatLaw&, \ const T,const T, \ const int,const int,const bool); \ - template bool isConstPc,MatLaw>(const MatLaw&,const int,const int); \ + template bool isConstPc,MatLaw>(const MatLaw&,const int,const int); + +#define INSTANTIATE_TYPE2(T) \ + template class EquilReg; \ template class Miscibility::PBVD>; \ template class Miscibility::PDVD>; \ template class Miscibility::RsVD>; \ @@ -53,10 +53,20 @@ template using FS = BlackOilFluidSystem; template class Miscibility::RvVD>; \ template class Miscibility::RvwVD>; -INSTANTIATE_TYPE(double) +#define INSTANTIATE_TYPE(T, ML1, ML2) \ +INSTANTIATE_TYPE1(T, ML1) \ +INSTANTIATE_TYPE1(T, ML2) \ +INSTANTIATE_TYPE2(T) + +template +using MatLaw1 = EclMaterialLaw::Manager>; +template +using MatLaw2 = EclMaterialLaw::Manager>; + +INSTANTIATE_TYPE(double, MatLaw1, MatLaw2) #if FLOW_INSTANTIATE_FLOAT -INSTANTIATE_TYPE(float) +INSTANTIATE_TYPE(float, MatLaw1, MatLaw2) #endif } // namespace Equil diff --git a/opm/simulators/flow/equil/InitStateEquil.cpp b/opm/simulators/flow/equil/InitStateEquil.cpp index f3c329f016..8573f7b5b1 100644 --- a/opm/simulators/flow/equil/InitStateEquil.cpp +++ b/opm/simulators/flow/equil/InitStateEquil.cpp @@ -35,17 +35,21 @@ namespace Opm { template -using MatLaw = EclMaterialLaw::Manager>; +using MatLaw1 = EclMaterialLaw::Manager>; +template +using MatLaw2 = EclMaterialLaw::Manager>; namespace EQUIL { namespace DeckDependent { -#define INSTANTIATE_COMP(T, GridView, Mapper) \ +#define INSTANTIATE_COMP1(T, GridView, Mapper) \ template class InitialStateComputer, \ Dune::CpGrid, \ GridView, \ Mapper, \ - Dune::CartesianIndexMapper>; \ + Dune::CartesianIndexMapper>; + +#define INSTANTIATE_COMP2(T, MatLaw, GridView, Mapper) \ template InitialStateComputer, \ Dune::CpGrid, \ GridView, \ @@ -60,12 +64,17 @@ namespace DeckDependent { const int, \ const bool); +#define INSTANTIATE_COMP(T, ML1, ML2, GridView, Mapper) \ +INSTANTIATE_COMP1(T, GridView, Mapper) \ +INSTANTIATE_COMP2(T, ML1, GridView, Mapper) \ +INSTANTIATE_COMP2(T, ML2, GridView, Mapper) + using GridView = Dune::GridView>; using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper; -INSTANTIATE_COMP(double, GridView, Mapper) +INSTANTIATE_COMP(double, MatLaw1, MatLaw2, GridView, Mapper) #if FLOW_INSTANTIATE_FLOAT -INSTANTIATE_COMP(float, GridView, Mapper) +INSTANTIATE_COMP(float, MatLaw1, MatLaw2, GridView, Mapper) #endif #if HAVE_DUNE_FEM @@ -74,10 +83,10 @@ using GridViewFem = Dune::Fem::AdaptiveLeafGridPart; using MapperFem = Dune::MultipleCodimMultipleGeomTypeMapper; -INSTANTIATE_COMP(double, GridViewFem, MapperFem) +INSTANTIATE_COMP(double, MatLaw1, MatLaw2, GridViewFem, MapperFem) #if FLOW_INSTANTIATE_FLOAT -INSTANTIATE_COMP(float, GridViewFem, MapperFem) +INSTANTIATE_COMP(float, MatLaw1, MatLaw2, GridViewFem, MapperFem) #endif #endif // HAVE_DUNE_FEM @@ -85,20 +94,22 @@ INSTANTIATE_COMP(float, GridViewFem, MapperFem) } // namespace DeckDependent namespace Details { -#define INSTANTIATE_TYPE(T) \ +#define INSTANTIATE_TYPE(T, MatLaw1, MatLaw2) \ template class PressureTable,EquilReg>; \ template void verticalExtent(const std::vector&, \ const std::vector>&, \ const Parallel::Communication&, \ std::array&); \ - template class PhaseSaturations,BlackOilFluidSystem, \ + template class PhaseSaturations,BlackOilFluidSystem, \ + EquilReg,std::size_t>; \ + template class PhaseSaturations,BlackOilFluidSystem, \ EquilReg,std::size_t>; \ template std::pair cellZMinMax(const Dune::cpgrid::Entity<0>&); -INSTANTIATE_TYPE(double) +INSTANTIATE_TYPE(double, MatLaw1, MatLaw2) #if FLOW_INSTANTIATE_FLOAT -INSTANTIATE_TYPE(float) +INSTANTIATE_TYPE(float, MatLaw1, MatLaw2) #endif }