mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-10-24 22:57:42 -05:00
Add extra flow variant without hysteresis.
This commit is contained in:
1 parent
ce81e1c4d9
commit
a6555a623d
4 files changed
+116
-18
No files matched your search
@@ -641,6 +641,16 @@ opm_add_test(flow_blackoil_polyhedralgrid
|
||||
flow/flow_blackoil_polyhedralgrid.cpp
|
||||
$<TARGET_OBJECTS:moduleVersion>)
|
||||
|
||||
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
|
||||
$<TARGET_OBJECTS:moduleVersion>)
|
||||
|
||||
opm_add_test(flow_distribute_z
|
||||
ONLY_COMPILE
|
||||
ALWAYS_ENABLE
|
||||
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "config.h"
|
||||
|
||||
#include <flow/flow_blackoil.hpp>
|
||||
|
||||
#include <opm/material/common/ResetLocale.hpp>
|
||||
#include <opm/grid/CpGrid.hpp>
|
||||
#include <opm/simulators/flow/SimulatorFullyImplicitBlackoil.hpp>
|
||||
#include <opm/simulators/flow/Main.hpp>
|
||||
|
||||
#include <opm/models/blackoil/blackoillocalresidualtpfa.hh>
|
||||
#include <opm/models/discretization/common/tpfalinearizer.hh>
|
||||
|
||||
|
||||
namespace Opm {
|
||||
namespace Properties {
|
||||
namespace TTag {
|
||||
struct FlowProblemNoHystNoEps {
|
||||
using InheritsFrom = std::tuple<FlowProblem>;
|
||||
};
|
||||
}
|
||||
template<class TypeTag>
|
||||
struct Linearizer<TypeTag, TTag::FlowProblemNoHystNoEps> { using type = TpfaLinearizer<TypeTag>; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct LocalResidual<TypeTag, TTag::FlowProblemNoHystNoEps> { using type = BlackOilLocalResidualTPFA<TypeTag>; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableDiffusion<TypeTag, TTag::FlowProblemNoHystNoEps> { static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableHysteresis<TypeTag, TTag::FlowProblemNoHystNoEps> { static constexpr bool value = false; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableEndpointScaling<TypeTag, TTag::FlowProblemNoHystNoEps> { static constexpr bool value = true; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct AvoidElementContext<TypeTag, TTag::FlowProblemNoHystNoEps> { static constexpr bool value = true; };
|
||||
|
||||
}
|
||||
} // namespace Opm
|
||||
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
using TypeTag = Opm::Properties::TTag::FlowProblemNoHystNoEps;
|
||||
auto mainObject = std::make_unique<Opm::Main>(argc, argv);
|
||||
auto ret = mainObject->runStatic<TypeTag>();
|
||||
// Destruct mainObject as the destructor calls MPI_Finalize!
|
||||
mainObject.reset();
|
||||
return ret;
|
||||
}
|
||||
@@ -27,13 +27,10 @@
|
||||
namespace Opm {
|
||||
namespace EQUIL {
|
||||
|
||||
template<class Scalar>
|
||||
using MatLaw = EclMaterialLaw::Manager<ThreePhaseMaterialTraits<Scalar,0,1,2,true,true>>;
|
||||
template<class Scalar> using FS = BlackOilFluidSystem<Scalar>;
|
||||
|
||||
#define INSTANTIATE_TYPE(T) \
|
||||
#define INSTANTIATE_TYPE1(T, MatLaw) \
|
||||
template struct PcEq<FS<T>,MatLaw<T>>; \
|
||||
template class EquilReg<T>; \
|
||||
template T satFromPc<FS<T>,MatLaw<T>>(const MatLaw<T>&, \
|
||||
const int,const int, \
|
||||
const T,const bool); \
|
||||
@@ -43,7 +40,10 @@ template<class Scalar> using FS = BlackOilFluidSystem<Scalar>;
|
||||
template T satFromDepth<FS<T>,MatLaw<T>>(const MatLaw<T>&, \
|
||||
const T,const T, \
|
||||
const int,const int,const bool); \
|
||||
template bool isConstPc<FS<T>,MatLaw<T>>(const MatLaw<T>&,const int,const int); \
|
||||
template bool isConstPc<FS<T>,MatLaw<T>>(const MatLaw<T>&,const int,const int);
|
||||
|
||||
#define INSTANTIATE_TYPE2(T) \
|
||||
template class EquilReg<T>; \
|
||||
template class Miscibility::PBVD<FS<T>>; \
|
||||
template class Miscibility::PDVD<FS<T>>; \
|
||||
template class Miscibility::RsVD<FS<T>>; \
|
||||
@@ -53,10 +53,20 @@ template<class Scalar> using FS = BlackOilFluidSystem<Scalar>;
|
||||
template class Miscibility::RvVD<FS<T>>; \
|
||||
template class Miscibility::RvwVD<FS<T>>;
|
||||
|
||||
INSTANTIATE_TYPE(double)
|
||||
#define INSTANTIATE_TYPE(T, ML1, ML2) \
|
||||
INSTANTIATE_TYPE1(T, ML1) \
|
||||
INSTANTIATE_TYPE1(T, ML2) \
|
||||
INSTANTIATE_TYPE2(T)
|
||||
|
||||
template<class Scalar>
|
||||
using MatLaw1 = EclMaterialLaw::Manager<ThreePhaseMaterialTraits<Scalar,0,1,2,true,true>>;
|
||||
template<class Scalar>
|
||||
using MatLaw2 = EclMaterialLaw::Manager<ThreePhaseMaterialTraits<Scalar,0,1,2,false,true>>;
|
||||
|
||||
INSTANTIATE_TYPE(double, MatLaw1, MatLaw2)
|
||||
|
||||
#if FLOW_INSTANTIATE_FLOAT
|
||||
INSTANTIATE_TYPE(float)
|
||||
INSTANTIATE_TYPE(float, MatLaw1, MatLaw2)
|
||||
#endif
|
||||
|
||||
} // namespace Equil
|
||||
|
||||
@@ -35,17 +35,21 @@
|
||||
namespace Opm {
|
||||
|
||||
template<class Scalar>
|
||||
using MatLaw = EclMaterialLaw::Manager<ThreePhaseMaterialTraits<Scalar,0,1,2,true,true>>;
|
||||
using MatLaw1 = EclMaterialLaw::Manager<ThreePhaseMaterialTraits<Scalar,0,1,2,true,true>>;
|
||||
template<class Scalar>
|
||||
using MatLaw2 = EclMaterialLaw::Manager<ThreePhaseMaterialTraits<Scalar,0,1,2,false,true>>;
|
||||
|
||||
namespace EQUIL {
|
||||
namespace DeckDependent {
|
||||
|
||||
#define INSTANTIATE_COMP(T, GridView, Mapper) \
|
||||
#define INSTANTIATE_COMP1(T, GridView, Mapper) \
|
||||
template class InitialStateComputer<BlackOilFluidSystem<T>, \
|
||||
Dune::CpGrid, \
|
||||
GridView, \
|
||||
Mapper, \
|
||||
Dune::CartesianIndexMapper<Dune::CpGrid>>; \
|
||||
Dune::CartesianIndexMapper<Dune::CpGrid>>;
|
||||
|
||||
#define INSTANTIATE_COMP2(T, MatLaw, GridView, Mapper) \
|
||||
template InitialStateComputer<BlackOilFluidSystem<T>, \
|
||||
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<Dune::DefaultLeafGridViewTraits<Dune::CpGrid>>;
|
||||
using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>;
|
||||
|
||||
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<Dune::CpGrid,
|
||||
false>;
|
||||
using MapperFem = Dune::MultipleCodimMultipleGeomTypeMapper<GridViewFem>;
|
||||
|
||||
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<BlackOilFluidSystem<T>,EquilReg<T>>; \
|
||||
template void verticalExtent(const std::vector<int>&, \
|
||||
const std::vector<std::pair<T,T>>&, \
|
||||
const Parallel::Communication&, \
|
||||
std::array<T,2>&); \
|
||||
template class PhaseSaturations<MatLaw<T>,BlackOilFluidSystem<T>, \
|
||||
template class PhaseSaturations<MatLaw1<T>,BlackOilFluidSystem<T>, \
|
||||
EquilReg<T>,std::size_t>; \
|
||||
template class PhaseSaturations<MatLaw2<T>,BlackOilFluidSystem<T>, \
|
||||
EquilReg<T>,std::size_t>; \
|
||||
template std::pair<T,T> cellZMinMax<T>(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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user