/*
Copyright 2014 SINTEF ICT, Applied Mathematics.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see .
*/
#ifndef OPM_WELLDENSITYSEGMENTED_HEADER_INCLUDED
#define OPM_WELLDENSITYSEGMENTED_HEADER_INCLUDED
#include
struct Wells;
namespace Opm
{
class WellStateFullyImplicitBlackoil;
class WellStateFullyImplicitBlackoilSolvent;
struct PhaseUsage;
/// A class giving a well model, by which we mean a way to compute
/// the pressure deltas of each perforation and the bottom-hole
/// pressure. This class contains an explicit model, that uses a
/// different density for each well segment, that is between each
/// pair of perforations.
class WellDensitySegmented
{
public:
/// Compute well segment densities
/// Notation: N = number of perforations, C = number of components.
/// \param[in] wells struct with static well info
/// \param[in] well_rates well rates for actiev components, size NC, P values per perforation
/// \param[in] phase_usage specifies which phases are active and not
/// \param[in] b_perf inverse ('little b') formation volume factor, size NC, P values per perforation
/// \param[in] rsmax_perf saturation point for rs (gas in oil) at each perforation, size N
/// \param[in] rvmax_perf saturation point for rv (oil in gas) at each perforation, size N
/// \param[in] surf_dens surface densities for active components, size NC, C values per perforation
static std::vector computeConnectionDensities(const Wells& wells,
const PhaseUsage& phase_usage,
const std::vector& perfComponentRates,
const std::vector& b_perf,
const std::vector& rsmax_perf,
const std::vector& rvmax_perf,
const std::vector& surf_dens_perf);
/// Compute pressure deltas.
/// Notation: N = number of perforations
/// \param[in] wells struct with static well info
/// \param[in] z_perf depth values for each perforation, size N
/// \param[in] dens_perf densities for each perforation, size N (typically computed using computeConnectionDensities)
/// \param[in] gravity gravity acceleration constant
static std::vector computeConnectionPressureDelta(const Wells& wells,
const std::vector& z_perf,
const std::vector& dens_perf,
const double gravity);
};
} // namespace Opm
#endif // OPM_WELLDENSITYSEGMENTED_HEADER_INCLUDED