mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
changed: put calculation of foam connection rate in separate method
This commit is contained in:
parent
c239cbd14f
commit
4041644171
@ -443,6 +443,10 @@ namespace Opm
|
|||||||
const std::vector<EvalWell>& cq_s,
|
const std::vector<EvalWell>& cq_s,
|
||||||
const IntensiveQuantities& intQuants) const;
|
const IntensiveQuantities& intQuants) const;
|
||||||
|
|
||||||
|
Eval connectionRateFoam(const std::vector<EvalWell>& cq_s,
|
||||||
|
const IntensiveQuantities& intQuants,
|
||||||
|
DeferredLogger& deferred_logger) const;
|
||||||
|
|
||||||
std::tuple<Eval,Eval,Eval>
|
std::tuple<Eval,Eval,Eval>
|
||||||
connectionRatesMICP(const std::vector<EvalWell>& cq_s,
|
connectionRatesMICP(const std::vector<EvalWell>& cq_s,
|
||||||
const IntensiveQuantities& intQuants) const;
|
const IntensiveQuantities& intQuants) const;
|
||||||
|
@ -715,33 +715,8 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
|
|
||||||
if constexpr (has_foam) {
|
if constexpr (has_foam) {
|
||||||
// TODO: the application of well efficiency factor has not been tested with an example yet
|
connectionRates[perf][Indices::contiFoamEqIdx] =
|
||||||
auto getFoamTransportIdx = [&deferred_logger] {
|
connectionRateFoam(cq_s, intQuants, deferred_logger);
|
||||||
switch (FoamModule::transportPhase()) {
|
|
||||||
case Phase::WATER: {
|
|
||||||
return Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx);
|
|
||||||
}
|
|
||||||
case Phase::GAS: {
|
|
||||||
return Indices::canonicalToActiveComponentIndex(FluidSystem::gasCompIdx);
|
|
||||||
}
|
|
||||||
case Phase::SOLVENT: {
|
|
||||||
if constexpr (has_solvent)
|
|
||||||
return (unsigned)Indices::contiSolventEqIdx;
|
|
||||||
else
|
|
||||||
OPM_DEFLOG_THROW(std::runtime_error, "Foam transport phase is SOLVENT but SOLVENT is not activated.", deferred_logger);
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
OPM_DEFLOG_THROW(std::runtime_error, "Foam transport phase must be GAS/WATER/SOLVENT.", deferred_logger);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
EvalWell cq_s_foam = cq_s[getFoamTransportIdx()] * this->well_efficiency_factor_;
|
|
||||||
if (this->isInjector()) {
|
|
||||||
cq_s_foam *= this->wfoam();
|
|
||||||
} else {
|
|
||||||
cq_s_foam *= this->extendEval(intQuants.foamConcentration());
|
|
||||||
}
|
|
||||||
connectionRates[perf][Indices::contiFoamEqIdx] = Base::restrictEval(cq_s_foam);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if constexpr (has_zFraction) {
|
if constexpr (has_zFraction) {
|
||||||
@ -2365,6 +2340,43 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template <typename TypeTag>
|
||||||
|
typename StandardWell<TypeTag>::Eval
|
||||||
|
StandardWell<TypeTag>::
|
||||||
|
connectionRateFoam(const std::vector<EvalWell>& cq_s,
|
||||||
|
const IntensiveQuantities& intQuants,
|
||||||
|
DeferredLogger& deferred_logger) const
|
||||||
|
{
|
||||||
|
// TODO: the application of well efficiency factor has not been tested with an example yet
|
||||||
|
auto getFoamTransportIdx = [&deferred_logger] {
|
||||||
|
switch (FoamModule::transportPhase()) {
|
||||||
|
case Phase::WATER: {
|
||||||
|
return Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx);
|
||||||
|
}
|
||||||
|
case Phase::GAS: {
|
||||||
|
return Indices::canonicalToActiveComponentIndex(FluidSystem::gasCompIdx);
|
||||||
|
}
|
||||||
|
case Phase::SOLVENT: {
|
||||||
|
if constexpr (has_solvent)
|
||||||
|
return static_cast<unsigned>(Indices::contiSolventEqIdx);
|
||||||
|
else
|
||||||
|
OPM_DEFLOG_THROW(std::runtime_error, "Foam transport phase is SOLVENT but SOLVENT is not activated.", deferred_logger);
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
OPM_DEFLOG_THROW(std::runtime_error, "Foam transport phase must be GAS/WATER/SOLVENT.", deferred_logger);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
EvalWell cq_s_foam = cq_s[getFoamTransportIdx()] * this->well_efficiency_factor_;
|
||||||
|
if (this->isInjector()) {
|
||||||
|
cq_s_foam *= this->wfoam();
|
||||||
|
} else {
|
||||||
|
cq_s_foam *= this->extendEval(intQuants.foamConcentration());
|
||||||
|
}
|
||||||
|
return Base::restrictEval(cq_s_foam);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template <typename TypeTag>
|
template <typename TypeTag>
|
||||||
std::tuple<typename StandardWell<TypeTag>::Eval,
|
std::tuple<typename StandardWell<TypeTag>::Eval,
|
||||||
typename StandardWell<TypeTag>::Eval,
|
typename StandardWell<TypeTag>::Eval,
|
||||||
|
Loading…
Reference in New Issue
Block a user