mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-09-05 04:40:19 -05:00
new eclproblemtpfa
This commit is contained in:
committed by
Atgeirr Flø Rasmussen
parent
8f5e0940fe
commit
409f60642e
+99
-1
@@ -1429,6 +1429,11 @@ public:
|
|||||||
/*!
|
/*!
|
||||||
* \copydoc EclTransmissiblity::transmissibility
|
* \copydoc EclTransmissiblity::transmissibility
|
||||||
*/
|
*/
|
||||||
|
Scalar transmissibility(unsigned globalCenterElemIdx,unsigned globalElemIdx) const
|
||||||
|
{
|
||||||
|
return transmissibilities_.transmissibility(globalCenterElemIdx, globalElemIdx);
|
||||||
|
}
|
||||||
|
|
||||||
template <class Context>
|
template <class Context>
|
||||||
Scalar transmissibility(const Context& context,
|
Scalar transmissibility(const Context& context,
|
||||||
[[maybe_unused]] unsigned fromDofLocalIdx,
|
[[maybe_unused]] unsigned fromDofLocalIdx,
|
||||||
@@ -1537,6 +1542,13 @@ public:
|
|||||||
return this->referencePorosity_[timeIdx][globalSpaceIdx];
|
return this->referencePorosity_[timeIdx][globalSpaceIdx];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Scalar porosity(unsigned globalSpaceIdx, unsigned timeIdx) const
|
||||||
|
{
|
||||||
|
//unsigned globalSpaceIdx = context.globalSpaceIndex(spaceIdx, timeIdx);
|
||||||
|
return this->referencePorosity_[timeIdx][globalSpaceIdx];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns the depth of an degree of freedom [m]
|
* \brief Returns the depth of an degree of freedom [m]
|
||||||
*
|
*
|
||||||
@@ -1561,6 +1573,11 @@ public:
|
|||||||
return this->simulator().vanguard().cellCenterDepth(globalSpaceIdx);
|
return this->simulator().vanguard().cellCenterDepth(globalSpaceIdx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Scalar dofCenterDepth(unsigned globalSpaceIdx, unsigned timeIdx) const
|
||||||
|
{
|
||||||
|
return this->simulator().vanguard().cellCenterDepth(globalSpaceIdx);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \copydoc BlackoilProblem::rockCompressibility
|
* \copydoc BlackoilProblem::rockCompressibility
|
||||||
@@ -1580,6 +1597,20 @@ public:
|
|||||||
return this->rockParams_[tableIdx].compressibility;
|
return this->rockParams_[tableIdx].compressibility;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Scalar rockCompressibility(unsigned globalSpaceIdx, unsigned timeIdx) const
|
||||||
|
{
|
||||||
|
// if (this->rockParams_.empty())
|
||||||
|
// return 0.0;
|
||||||
|
|
||||||
|
// unsigned tableIdx = 0;
|
||||||
|
// if (!this->rockTableIdx_.empty()) {
|
||||||
|
// tableIdx = this->rockTableIdx_[globalSpaceIdx];
|
||||||
|
// }
|
||||||
|
unsigned tableIdx = 0;
|
||||||
|
return this->rockParams_[tableIdx].compressibility;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \copydoc BlackoilProblem::rockReferencePressure
|
* \copydoc BlackoilProblem::rockReferencePressure
|
||||||
*/
|
*/
|
||||||
@@ -1594,10 +1625,21 @@ public:
|
|||||||
unsigned globalSpaceIdx = context.globalSpaceIndex(spaceIdx, timeIdx);
|
unsigned globalSpaceIdx = context.globalSpaceIndex(spaceIdx, timeIdx);
|
||||||
tableIdx = this->rockTableIdx_[globalSpaceIdx];
|
tableIdx = this->rockTableIdx_[globalSpaceIdx];
|
||||||
}
|
}
|
||||||
|
|
||||||
return this->rockParams_[tableIdx].referencePressure;
|
return this->rockParams_[tableIdx].referencePressure;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Scalar rockReferencePressure(unsigned globalSpaceIdx, unsigned timeIdx) const
|
||||||
|
{
|
||||||
|
// if (this->rockParams_.empty())
|
||||||
|
// return 1e5;
|
||||||
|
|
||||||
|
// unsigned tableIdx = 0;
|
||||||
|
// if (!this->rockTableIdx_.empty()) {
|
||||||
|
// tableIdx = this->rockTableIdx_[globalSpaceIdx];
|
||||||
|
// }
|
||||||
|
unsigned tableIdx = 0;//this->rockTableIdx_[globalSpaceIdx];
|
||||||
|
return this->rockParams_[tableIdx].referencePressure;
|
||||||
|
}
|
||||||
/*!
|
/*!
|
||||||
* \copydoc FvBaseMultiPhaseProblem::materialLawParams
|
* \copydoc FvBaseMultiPhaseProblem::materialLawParams
|
||||||
*/
|
*/
|
||||||
@@ -1825,6 +1867,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
Scalar maxGasDissolutionFactor(unsigned timeIdx, unsigned globalDofIdx) const
|
Scalar maxGasDissolutionFactor(unsigned timeIdx, unsigned globalDofIdx) const
|
||||||
{
|
{
|
||||||
|
|
||||||
int pvtRegionIdx = this->pvtRegionIndex(globalDofIdx);
|
int pvtRegionIdx = this->pvtRegionIndex(globalDofIdx);
|
||||||
int episodeIdx = this->episodeIndex();
|
int episodeIdx = this->episodeIndex();
|
||||||
if (!this->drsdtActive_(episodeIdx) || this->maxDRs_[pvtRegionIdx] < 0.0)
|
if (!this->drsdtActive_(episodeIdx) || this->maxDRs_[pvtRegionIdx] < 0.0)
|
||||||
@@ -1943,6 +1986,61 @@ public:
|
|||||||
aquiferModel_.initialSolutionApplied();
|
aquiferModel_.initialSolutionApplied();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class Context>
|
||||||
|
void source(RateVector& rate,
|
||||||
|
unsigned globalSpaceIdx,
|
||||||
|
unsigned timeIdx) const
|
||||||
|
{
|
||||||
|
rate = 0.0;
|
||||||
|
|
||||||
|
wellModel_.computeTotalRatesForDof(rate, globalSpaceIdx, timeIdx);
|
||||||
|
|
||||||
|
// convert the source term from the total mass rate of the
|
||||||
|
// cell to the one per unit of volume as used by the model.
|
||||||
|
|
||||||
|
for (unsigned eqIdx = 0; eqIdx < numEq; ++ eqIdx) {
|
||||||
|
rate[eqIdx] /= this->model().dofTotalVolume(globalSpaceIdx);
|
||||||
|
|
||||||
|
Valgrind::CheckDefined(rate[eqIdx]);
|
||||||
|
assert(isfinite(rate[eqIdx]));
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (enableAquifers_)
|
||||||
|
// aquiferModel_.addToSource(rate, context, spaceIdx, timeIdx);
|
||||||
|
|
||||||
|
// if requested, compensate systematic mass loss for cells which were "well
|
||||||
|
// behaved" in the last time step
|
||||||
|
// if (enableDriftCompensation_) {
|
||||||
|
// const auto& intQuants = context.intensiveQuantities(spaceIdx, timeIdx);
|
||||||
|
// const auto& simulator = this->simulator();
|
||||||
|
// const auto& model = this->model();
|
||||||
|
|
||||||
|
// // we need a higher maxCompensation than the Newton tolerance because the
|
||||||
|
// // current time step might be shorter than the last one
|
||||||
|
// Scalar maxCompensation = 10.0*model.newtonMethod().tolerance();
|
||||||
|
|
||||||
|
// Scalar poro = intQuants.referencePorosity();
|
||||||
|
// Scalar dt = simulator.timeStepSize();
|
||||||
|
|
||||||
|
// EqVector dofDriftRate = drift_[globalDofIdx];
|
||||||
|
// dofDriftRate /= dt*context.dofTotalVolume(spaceIdx, timeIdx);
|
||||||
|
|
||||||
|
// // compute the weighted total drift rate
|
||||||
|
// Scalar totalDriftRate = 0.0;
|
||||||
|
// for (unsigned eqIdx = 0; eqIdx < numEq; ++ eqIdx)
|
||||||
|
// totalDriftRate +=
|
||||||
|
// std::abs(dofDriftRate[eqIdx])*dt*model.eqWeight(globalDofIdx, eqIdx)/poro;
|
||||||
|
|
||||||
|
// // make sure that we do not exceed the maximum rate of drift compensation
|
||||||
|
// if (totalDriftRate > maxCompensation)
|
||||||
|
// dofDriftRate *= maxCompensation/totalDriftRate;
|
||||||
|
|
||||||
|
// for (unsigned eqIdx = 0; eqIdx < numEq; ++ eqIdx)
|
||||||
|
// rate[eqIdx] -= dofDriftRate[eqIdx];
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \copydoc FvBaseProblem::source
|
* \copydoc FvBaseProblem::source
|
||||||
*
|
*
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -25,6 +25,7 @@
|
|||||||
#include <opm/models/discretization/common/fvbaseadlocallinearizertpfa.hh>
|
#include <opm/models/discretization/common/fvbaseadlocallinearizertpfa.hh>
|
||||||
#include <opm/models/discretization/common/smallelementcontext.hh>
|
#include <opm/models/discretization/common/smallelementcontext.hh>
|
||||||
#include <ebos/eclfluxmoduletpfa.hh>
|
#include <ebos/eclfluxmoduletpfa.hh>
|
||||||
|
#include <ebos/eclproblemtpfa.hh>
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
namespace Properties {
|
namespace Properties {
|
||||||
namespace TTag {
|
namespace TTag {
|
||||||
@@ -32,10 +33,19 @@ namespace Opm {
|
|||||||
using InheritsFrom = std::tuple<EclFlowProblem>;
|
using InheritsFrom = std::tuple<EclFlowProblem>;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace Opm {
|
||||||
|
namespace Properties {
|
||||||
|
template<class TypeTag>
|
||||||
|
struct Problem<TypeTag, TTag::EclFlowProblemTPFA> {
|
||||||
|
using type = EclProblemTPFA<TypeTag>;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
namespace Properties {
|
namespace Properties {
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
|
|||||||
Reference in New Issue
Block a user