move updateWellStateFromPrimaryVariablesPolyMW to StandardWellPrimaryVariables

This commit is contained in:
Arne Morten Kvarving 2022-11-08 07:09:51 +01:00
parent f964169914
commit 412e561cd8
5 changed files with 22 additions and 20 deletions

View File

@ -557,23 +557,6 @@ updateWellStateFromPrimaryVariables(WellState& well_state,
well_state, deferred_logger);
}
template<class FluidSystem, class Indices, class Scalar>
void
StandardWellEval<FluidSystem,Indices,Scalar>::
updateWellStateFromPrimaryVariablesPolyMW(WellState& well_state) const
{
if (baseif_.isInjector()) {
auto& ws = well_state.well(baseif_.indexOfWell());
auto& perf_data = ws.perf_data;
auto& perf_water_velocity = perf_data.water_velocity;
auto& perf_skin_pressure = perf_data.skin_pressure;
for (int perf = 0; perf < baseif_.numPerfs(); ++perf) {
perf_water_velocity[perf] = primary_variables_.value_[Bhp + 1 + perf];
perf_skin_pressure[perf] = primary_variables_.value_[Bhp + 1 + baseif_.numPerfs() + perf];
}
}
}
template<class FluidSystem, class Indices, class Scalar>
void
StandardWellEval<FluidSystem,Indices,Scalar>::

View File

@ -134,8 +134,6 @@ protected:
const double dFLimit,
const double dBHPLimit) const;
void updateWellStateFromPrimaryVariablesPolyMW(WellState& well_state) const;
mutable PrimaryVariables primary_variables_; //!< Primary variables for well
// the saturations in the well bore under surface conditions at the beginning of the time step

View File

@ -33,6 +33,7 @@
#include <opm/models/blackoil/blackoiltwophaseindices.hh>
#include <opm/simulators/wells/WellInterfaceIndices.hpp>
#include <opm/simulators/wells/WellState.hpp>
namespace Opm {
@ -78,6 +79,22 @@ updatePolyMW(const BVectorWell& dwells)
}
}
template<class FluidSystem, class Indices, class Scalar>
void StandardWellPrimaryVariables<FluidSystem,Indices,Scalar>::
copyToWellStatePolyMW(WellState& well_state) const
{
if (well_.isInjector()) {
auto& ws = well_state.well(well_.indexOfWell());
auto& perf_data = ws.perf_data;
auto& perf_water_velocity = perf_data.water_velocity;
auto& perf_skin_pressure = perf_data.skin_pressure;
for (int perf = 0; perf < well_.numPerfs(); ++perf) {
perf_water_velocity[perf] = value_[Bhp + 1 + perf];
perf_skin_pressure[perf] = value_[Bhp + 1 + well_.numPerfs() + perf];
}
}
}
#define INSTANCE(...) \
template class StandardWellPrimaryVariables<BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>,__VA_ARGS__,double>;

View File

@ -33,6 +33,7 @@ namespace Opm
{
template<class FluidSystem, class Indices, class Scalar> class WellInterfaceIndices;
class WellState;
//! \brief Class holding primary variables for StandardWell.
template<class FluidSystem, class Indices, class Scalar>
@ -109,6 +110,9 @@ public:
//! \brief Update polymer molecular weight values from solution vector.
void updatePolyMW(const BVectorWell& dwells);
//! \brief Copy values to well state.
void copyToWellStatePolyMW(WellState& well_state) const;
private:
const WellInterfaceIndices<FluidSystem,Indices,Scalar>& well_; //!< Reference to well interface

View File

@ -995,7 +995,7 @@ namespace Opm
// other primary variables related to polymer injectivity study
if constexpr (Base::has_polymermw) {
this->updateWellStateFromPrimaryVariablesPolyMW(well_state);
this->primary_variables_.copyToWellStatePolyMW(well_state);
}
}