adding thresholdPressure() interface to FlowProblemComp

although we do not support it yet.
This commit is contained in:
Kai Bao 2024-10-21 17:57:22 +02:00
parent 3635132d95
commit e4d1311589
5 changed files with 29 additions and 8 deletions

View File

@ -488,7 +488,7 @@ public:
this->actionState(),
this->udqState(),
this->summaryState(),
{}, // this->simulator_.problem().thresholdPressure().getRestartVector(),
this->simulator_.problem().thresholdPressure().getRestartVector(),
curTime, nextStepSize,
Parameters::Get<Parameters::EclOutputDoublePrecision>(),
isFlowsn, std::move(flowsn),

View File

@ -32,6 +32,7 @@
#include <opm/simulators/flow/FlowProblem.hpp>
#include <opm/simulators/flow/FlowThresholdPressure.hpp>
#include <opm/simulators/flow/OutputCompositionalModule.hpp>
#include <opm/material/fluidstates/CompositionalFluidState.hpp>
@ -109,6 +110,7 @@ public:
*/
explicit FlowProblemComp(Simulator& simulator)
: FlowProblemType(simulator)
, thresholdPressures_(simulator)
{
eclWriter_ = std::make_unique<EclWriterType>(simulator);
enableEclOutput_ = Parameters::Get<Parameters::EnableEclOutput>();
@ -408,11 +410,19 @@ public:
const std::vector<InitialFluidState>& initialFluidStates() const
{ return initialFluidStates_; }
const FlowThresholdPressure<TypeTag>& thresholdPressure() const
{
assert( !thresholdPressures_.enableThresholdPressure() &&
" Threshold Pressures are not supported by compostional simulation ");
return thresholdPressures_;
}
// TODO: do we need this one?
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(static_cast<FlowProblemType&>(*this));
serializer(*eclWriter_);
}
protected:
@ -586,6 +596,8 @@ private:
throw std::logic_error("polymer is disabled for compositional modeling and you're trying to add polymer to BC");
}
FlowThresholdPressure<TypeTag> thresholdPressures_;
std::vector<InitialFluidState> initialFluidStates_;
bool enableEclOutput_;

View File

@ -1816,13 +1816,11 @@ INSTANTIATE_TYPE(float)
template<class T> using FS##NUM = GenericOilGasFluidSystem<T, NUM>; \
template class GenericOutputBlackoilModule<FS##NUM<double>>;
//INSTANTIATE_COMP(2)
INSTANTIATE_COMP(2)
INSTANTIATE_COMP(3)
//INSTANTIATE_COMP(4)
//INSTANTIATE_COMP(5)
//INSTANTIATE_COMP(6)
//INSTANTIATE_COMP(7)
// template class GenericOutputBlackoilModule<GenericOilGasFluidSystem<double, 3>>;
INSTANTIATE_COMP(4)
INSTANTIATE_COMP(5)
INSTANTIATE_COMP(6)
INSTANTIATE_COMP(7)
} // namespace Opm

View File

@ -81,6 +81,8 @@ public:
//! \details Returns the union of explicitly configured entries and defaulted values.
std::vector<Scalar> getRestartVector() const;
bool enableThresholdPressure() const;
protected:
/*!
* \brief Actually compute the threshold pressures over a face as a pre-compute step.

View File

@ -246,6 +246,15 @@ getRestartVector() const
return result;
}
template<class Grid, class GridView, class ElementMapper, class Scalar>
bool
GenericThresholdPressure<Grid,GridView,ElementMapper,Scalar>::
enableThresholdPressure() const
{
return this->enableThresholdPressure_;
}
template<class Grid, class GridView, class ElementMapper, class Scalar>
void
GenericThresholdPressure<Grid,GridView,ElementMapper,Scalar>::