From fac350b657f23a2aab9869b34905bc01d4651414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Tue, 7 Dec 2010 11:37:07 +0100 Subject: [PATCH] Volume disrcrepancy is now computed with other fluid data. --- dune/porsol/blackoil/BlackoilFluid.hpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/dune/porsol/blackoil/BlackoilFluid.hpp b/dune/porsol/blackoil/BlackoilFluid.hpp index e001c231..13ec3055 100644 --- a/dune/porsol/blackoil/BlackoilFluid.hpp +++ b/dune/porsol/blackoil/BlackoilFluid.hpp @@ -76,6 +76,8 @@ namespace Opm // Per-cell data. std::vector totcompr; // Total compressibility. std::vector totphasevol; // Total volume filled by fluid phases. + std::vector voldiscr; // Volume discrepancy = (totphasevol - porevol)/dt + std::vector relvoldiscr; // Relative volume discrepancy = (totphasevol - porevol)/porevol std::vector cellA; // A = RB^{-1}. Fortran ordering, flat storage. std::vector saturation; // Saturation. std::vector frac_flow; // Fractional flow. @@ -88,13 +90,15 @@ namespace Opm std::vector phasemobc; // Just a helper. Mobilities per cell. public: - template + template void compute(const Grid& grid, + const Rock& rock, const BlackoilFluid& fluid, const std::vector& cell_pressure, const std::vector& face_pressure, const std::vector& cell_z, - const CompVec& bdy_z) + const CompVec& bdy_z, + const double dt) { int num_cells = cell_z.size(); ASSERT(num_cells == grid.numCells()); @@ -105,6 +109,8 @@ namespace Opm BOOST_STATIC_ASSERT(np == nc); totcompr.resize(num_cells); totphasevol.resize(num_cells); + voldiscr.resize(num_cells); + relvoldiscr.resize(num_cells); saturation.resize(num_cells); frac_flow.resize(num_cells); rel_perm.resize(num_cells); @@ -118,6 +124,9 @@ namespace Opm FluidStateBlackoil state = fluid.computeState(cell_pressure[cell], cell_z[cell]); totcompr[cell] = state.total_compressibility_; totphasevol[cell] = state.total_phase_volume_; + double pv = rock.porosity(cell)*grid.cellVolume(cell); + voldiscr[cell] = (totphasevol[cell] - pv)/dt; + relvoldiscr[cell] = (totphasevol[cell] - pv)/pv; saturation[cell] = state.saturation_; rel_perm[cell] = state.relperm_; viscosity[cell] = state.viscosity_;