From c1ee941195a19c4dafe185fdc9e5795348b82cf1 Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Mon, 31 Jul 2017 17:11:44 +0200 Subject: [PATCH] adding shear calculation to the polymer simulation. --- opm/autodiff/StandardWell.hpp | 5 +++++ opm/autodiff/StandardWell_impl.hpp | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/opm/autodiff/StandardWell.hpp b/opm/autodiff/StandardWell.hpp index ca7868ea0..591837138 100644 --- a/opm/autodiff/StandardWell.hpp +++ b/opm/autodiff/StandardWell.hpp @@ -57,6 +57,7 @@ namespace Opm SFrac = 3 }; + using typename WellInterface::Scalar; using typename WellInterface::VectorBlockType; using typename WellInterface::MatrixBlockType; using typename WellInterface::Mat; @@ -196,6 +197,10 @@ namespace Opm using WellInterface::perf_depth_; using WellInterface::allow_cf_; + using WellInterface::perf_rep_radius_; + using WellInterface::perf_length_; + using WellInterface::bore_diameters_; + // densities of the fluid in each perforation std::vector perf_densities_; // pressure drop between different perforations diff --git a/opm/autodiff/StandardWell_impl.hpp b/opm/autodiff/StandardWell_impl.hpp index 88b816601..341705713 100644 --- a/opm/autodiff/StandardWell_impl.hpp +++ b/opm/autodiff/StandardWell_impl.hpp @@ -808,14 +808,15 @@ namespace Opm mob[ Water ] /= (extendEval(intQuants.waterViscosityCorrection()) * viscosityMultiplier.eval(polymerConcentration, /*extrapolate=*/true) ); } - /* if (PolymerModule::hasPlyshlog()) { + if (PolymerModule::hasPlyshlog()) { // compute the well water velocity with out shear effects. const int numComp = numComponents(); const bool allow_cf = crossFlowAllowed(ebosSimulator); const EvalWell& bhp = getBhp(); std::vector cq_s(numComp,0.0); computePerfRate(intQuants, mob, wellIndex()[perf], bhp, perfPressureDiffs()[perf], allow_cf, cq_s); - double area = 2 * M_PI * wells_rep_radius_[perf] * wells_perf_length_[perf]; + // TODO: make area a member + double area = 2 * M_PI * perf_rep_radius_[perf] * perf_length_[perf]; const auto& materialLawManager = ebosSimulator.problem().materialLawManager(); const auto& scaledDrainageInfo = materialLawManager->oilWaterScaledEpsInfoDrainage(cell_idx); @@ -830,7 +831,7 @@ namespace Opm // TODO Use the same conversion as for the reservoar equations. // Need the "permeability" of the well? // For now use the same formula as in legacy. - waterVelocity *= PolymerModule::shrate( intQuants.pvtRegionIndex() ) / wells_bore_diameter_[perf]; + waterVelocity *= PolymerModule::shrate( intQuants.pvtRegionIndex() ) / bore_diameters_[perf]; } EvalWell polymerConcentration = extendEval(intQuants.polymerConcentration()); EvalWell shearFactor = PolymerModule::computeShearFactor(polymerConcentration, @@ -839,7 +840,7 @@ namespace Opm // modify the mobility with the shear factor and recompute the well fluxes. mob[ Water ] /= shearFactor; - } */ + } } }