Loading...
Searching...
No Matches
ReservoirPropertyCapillary.hpp
//===========================================================================
//
// File: ReservoirPropertyCapillary.hpp
//
// Created: Fri Jul 3 12:28:48 2009
//
// Author(s): Atgeirr F Rasmussen <atgeirr@sintef.no>
// Bård Skaflestad <bard.skaflestad@sintef.no>
//
// $Date$
//
// $Revision$
//
//===========================================================================
/*
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
Copyright 2009, 2010 Statoil ASA.
This file is part of The Open Reservoir Simulator Project (OpenRS).
OpenRS 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.
OpenRS 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPENRS_RESERVOIRPROPERTYCAPILLARY_HEADER
#define OPENRS_RESERVOIRPROPERTYCAPILLARY_HEADER
#include <opm/porsol/common/RockJfunc.hpp>
#include <opm/porsol/common/ReservoirPropertyCommon.hpp>
#include <array>
namespace Opm
{
struct ScalarMobility
{
double mob;
void setToAverage(const ScalarMobility& m1, const ScalarMobility& m2)
{
mob = 0.5*(m1.mob + m2.mob);
}
void setToSum(const ScalarMobility& m1, const ScalarMobility& m2)
{
mob = m1.mob + m2.mob;
}
void setToInverse(const ScalarMobility& m)
{
mob = 1.0/m.mob;
}
template <class Vec>
Vec multiply(const Vec& v)
{
Vec ret(v);
ret *= mob;
return ret;
}
ScalarMobility& operator *=(const ScalarMobility& other)
{
mob *= other.mob;
return *this;
}
};
template <int dim>
class ReservoirPropertyCapillary : public ReservoirPropertyCommon<dim, ReservoirPropertyCapillary<dim>, RockJfunc>
{
public:
typedef ScalarMobility Mobility;
double mobilityFirstPhase(int cell_index, double saturation) const;
double mobilitySecondPhase(int cell_index, double saturation) const;
void phaseMobility(int phase_index, int cell_index, double saturation, double& phase_mob) const;
double totalMobility(int cell_index, double saturation) const;
double fractionalFlow(int cell_index, double saturation) const;
template<class Vector>
void phaseMobilities(int cell_index, double saturation, Vector& mobility) const;
template<class Vector>
void phaseMobilitiesDeriv(int c, double s, Vector& dmob) const;
void computeCflFactors();
private:
typedef ReservoirPropertyCommon<dim, ReservoirPropertyCapillary<dim>, RockJfunc> Super;
// Methods
double relPermFirstPhase(int cell_index, double saturation) const;
double relPermSecondPhase(int cell_index, double saturation) const;
double relPermFirstPhaseDeriv(int cell_index, double saturation) const;
double relPermSecondPhaseDeriv(int cell_index, double saturation) const;
void cflFracFlows(int rock, double s, double& ff_first, double& ff_gravity) const;
std::array<double, 3> computeSingleRockCflFactors(int rock, double min_perm, double max_poro) const;
};
} // namespace Opm
#include "ReservoirPropertyCapillary_impl.hpp"
#endif // OPENRS_RESERVOIRPROPERTYCAPILLARY_HEADER
Opm::ReservoirPropertyCapillary
A property class for incompressible two-phase flow.
Definition ReservoirPropertyCapillary.hpp:80
Opm::ReservoirPropertyCapillary::computeCflFactors
void computeCflFactors()
Computes cfl factors. Called from ReservoirPropertyCommon::init().
Definition ReservoirPropertyCapillary_impl.hpp:254
Opm::ReservoirPropertyCapillary::phaseMobilities
void phaseMobilities(int cell_index, double saturation, Vector &mobility) const
Mobilities for both phases.
Definition ReservoirPropertyCapillary_impl.hpp:93
Opm::ReservoirPropertyCapillary::mobilitySecondPhase
double mobilitySecondPhase(int cell_index, double saturation) const
Mobility of second (oil) phase.
Definition ReservoirPropertyCapillary_impl.hpp:52
Opm::ReservoirPropertyCapillary::phaseMobility
void phaseMobility(int phase_index, int cell_index, double saturation, double &phase_mob) const
Phase mobility.
Definition ReservoirPropertyCapillary_impl.hpp:59
Opm::ReservoirPropertyCapillary::Mobility
ScalarMobility Mobility
The (scalar) mobility type.
Definition ReservoirPropertyCapillary.hpp:83
Opm::ReservoirPropertyCapillary::mobilityFirstPhase
double mobilityFirstPhase(int cell_index, double saturation) const
Mobility of first (water) phase.
Definition ReservoirPropertyCapillary_impl.hpp:45
Opm::ReservoirPropertyCapillary::totalMobility
double totalMobility(int cell_index, double saturation) const
Total mobility.
Definition ReservoirPropertyCapillary_impl.hpp:74
Opm::ReservoirPropertyCapillary::fractionalFlow
double fractionalFlow(int cell_index, double saturation) const
Fractional flow (of the first phase).
Definition ReservoirPropertyCapillary_impl.hpp:83
Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim >, RockJfunc >::ReservoirPropertyCommon
ReservoirPropertyCommon()
Opm::RockJfunc
Definition RockJfunc.hpp:53
Opm
Inverting small matrices.
Definition ImplicitAssembly.hpp:43
Opm::ScalarMobility
A wrapper for a scalar.
Definition ReservoirPropertyCapillary.hpp:48