better test

This commit is contained in:
hnil 2022-06-08 22:39:20 +02:00 committed by Atgeirr Flø Rasmussen
parent 18b03f3546
commit ad66808158
2 changed files with 34 additions and 22 deletions

View File

@ -169,7 +169,10 @@ public:
* \param phaseIdx The index of the fluid phase * \param phaseIdx The index of the fluid phase
*/ */
const Evaluation& volumeFlux(unsigned phaseIdx) const const Evaluation& volumeFlux(unsigned phaseIdx) const
{ return volumeFlux_[phaseIdx]; } {
throw std::invalid_argument("Should not acces volume flux for eclmoduletpfa");
return volumeFlux_[phaseIdx];
}
protected: protected:
/*! /*!
@ -181,6 +184,7 @@ protected:
*/ */
unsigned upstreamIndex_(unsigned phaseIdx) const unsigned upstreamIndex_(unsigned phaseIdx) const
{ {
throw std::invalid_argument("No upstreamIndex");
assert(phaseIdx < numPhases); assert(phaseIdx < numPhases);
return upIdx_[phaseIdx]; return upIdx_[phaseIdx];
@ -195,6 +199,7 @@ protected:
*/ */
unsigned downstreamIndex_(unsigned phaseIdx) const unsigned downstreamIndex_(unsigned phaseIdx) const
{ {
throw std::invalid_argument("No downstream index");
assert(phaseIdx < numPhases); assert(phaseIdx < numPhases);
return dnIdx_[phaseIdx]; return dnIdx_[phaseIdx];
@ -207,24 +212,24 @@ protected:
{ asImp_().updateShearMultipliers(elemCtx, scvfIdx, timeIdx); } { asImp_().updateShearMultipliers(elemCtx, scvfIdx, timeIdx); }
public:
template<class EvalType> template<class EvalType>
void calculatePhasePressureDiff_(short& upIdx, static void calculatePhasePressureDiff_(short& upIdx,
short& dnIdx, short& dnIdx,
EvalType& pressureDifference, EvalType& pressureDifference,
const IntensiveQuantities& intQuantsIn, const IntensiveQuantities& intQuantsIn,
const IntensiveQuantities& intQuantsEx, const IntensiveQuantities& intQuantsEx,
const unsigned scvfIdx, const unsigned scvfIdx,
const unsigned timeIdx, const unsigned timeIdx,
const unsigned phaseIdx, const unsigned phaseIdx,
const unsigned interiorDofIdx, const unsigned interiorDofIdx,
const unsigned exteriorDofIdx, const unsigned exteriorDofIdx,
const Scalar& Vin, const Scalar& Vin,
const Scalar& Vex, const Scalar& Vex,
const unsigned& globalIndexIn, const unsigned& globalIndexIn,
const unsigned& globalIndexEx, const unsigned& globalIndexEx,
const Scalar& distZg, const Scalar& distZg,
const Scalar& thpres const Scalar& thpres
) )
{ {
@ -260,11 +265,11 @@ protected:
// degree of freedom which is regarded upstream if both pressures are equal // degree of freedom which is regarded upstream if both pressures are equal
// is always the same: if the pressure is equal, the DOF with the lower // is always the same: if the pressure is equal, the DOF with the lower
// global index is regarded to be the upstream one. // global index is regarded to be the upstream one.
if (pressureDifference_[phaseIdx] > 0.0) { if (pressureDifference > 0.0) {
upIdx = exteriorDofIdx; upIdx = exteriorDofIdx;
dnIdx = interiorDofIdx; dnIdx = interiorDofIdx;
} }
else if (pressureDifference_[phaseIdx] < 0.0) { else if (pressureDifference < 0.0) {
upIdx = interiorDofIdx; upIdx = interiorDofIdx;
dnIdx = exteriorDofIdx; dnIdx = exteriorDofIdx;
} }
@ -310,12 +315,14 @@ protected:
} }
} }
protected:
/*! /*!
* \brief Update the required gradients for interior faces * \brief Update the required gradients for interior faces
*/ */
void calculateGradients_(const ElementContext& elemCtx, unsigned scvfIdx, unsigned timeIdx) void calculateGradients_(const ElementContext& elemCtx, unsigned scvfIdx, unsigned timeIdx)
{ {
throw std::invalid_argument("No calculateGradients_");
Valgrind::SetUndefined(*this); Valgrind::SetUndefined(*this);
const auto& problem = elemCtx.problem(); const auto& problem = elemCtx.problem();
@ -414,6 +421,7 @@ protected:
unsigned timeIdx, unsigned timeIdx,
const FluidState& exFluidState) const FluidState& exFluidState)
{ {
throw std::invalid_argument("No calculateGradients for boundary");
const auto& problem = elemCtx.problem(); const auto& problem = elemCtx.problem();
bool enableBoundaryMassFlux = problem.nonTrivialBoundaryConditions(); bool enableBoundaryMassFlux = problem.nonTrivialBoundaryConditions();

View File

@ -20,6 +20,8 @@
#include <opm/simulators/flow/Main.hpp> #include <opm/simulators/flow/Main.hpp>
// modifications from standard // modifications from standard
#include <opm/models/blackoil/blackoillocalresidualtpfa.hh> #include <opm/models/blackoil/blackoillocalresidualtpfa.hh>
#include <opm/models/discretization/common/fvbaselocalresidualtpfa.hh>
#include <opm/models/discretization/common/fvbaseadlocallinearizertpfa.hh>
#include <ebos/eclfluxmoduletpfa.hh> #include <ebos/eclfluxmoduletpfa.hh>
namespace Opm { namespace Opm {
namespace Properties { namespace Properties {
@ -36,7 +38,7 @@ namespace Opm {
namespace Properties { namespace Properties {
template<class TypeTag> template<class TypeTag>
struct LocalLinearizerSplice<TypeTag, TTag::EclFlowProblemTPFA> { struct LocalLinearizerSplice<TypeTag, TTag::EclFlowProblemTPFA> {
using type = TTag::AutoDiffLocalLinearizer; using type = TTag::AutoDiffLocalLinearizerTPFA;
}; };
} }
} }
@ -44,6 +46,8 @@ namespace Opm {
namespace Properties { namespace Properties {
template<class TypeTag> template<class TypeTag>
struct LocalResidual<TypeTag, TTag::EclFlowProblemTPFA> { using type = BlackOilLocalResidualTPFA<TypeTag>; }; struct LocalResidual<TypeTag, TTag::EclFlowProblemTPFA> { using type = BlackOilLocalResidualTPFA<TypeTag>; };
template<class TypeTag>
struct DiscLocalResidual<TypeTag, TTag::EclFlowProblemTPFA> { using type = FvBaseLocalResidualTPFA<TypeTag>; };
} }
} }
namespace Opm{ namespace Opm{