mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Remove more unused code.
This commit is contained in:
parent
aea69d328b
commit
a301477655
@ -100,158 +100,6 @@ namespace {
|
||||
|
||||
namespace Opm {
|
||||
|
||||
#if 0
|
||||
template <typename Scalar, class BOFluid>
|
||||
class PressureDependentFluidData {
|
||||
public:
|
||||
typedef AutoDiff::ForwardBlock<Scalar> ADB;
|
||||
typedef typename AutoDiff::ForwardBlock<Scalar>::V V;
|
||||
typedef typename AutoDiff::ForwardBlock<Scalar>::M M;
|
||||
|
||||
PressureDependentFluidData(const int nc,
|
||||
const BOFluid& fluid)
|
||||
: nc_ (nc)
|
||||
, np_ (fluid.numPhases())
|
||||
, cells_(buildAllCells(nc))
|
||||
, fluid_(fluid)
|
||||
, A_ (nc_, np_ * np_)
|
||||
, dA_ (nc_, np_ * np_)
|
||||
, mu_ (nc_, np_ )
|
||||
, dmu_ (nc_, np_ )
|
||||
, kr_ (nc_, np_ )
|
||||
, zero_ (ADB::V::Zero(nc, 1))
|
||||
, one_ (ADB::V::Ones(nc, 1))
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
computeSatQuant(const BlackoilState& state)
|
||||
{
|
||||
const std::vector<double>& s = state.saturation();
|
||||
|
||||
assert (s.size() == std::vector<double>::size_type(nc_ * np_));
|
||||
|
||||
double* dkrds = 0; // Ignore rel-perm derivatives
|
||||
fluid_.relperm(nc_, & s[0], & cells_[0],
|
||||
kr_.data(), dkrds);
|
||||
}
|
||||
|
||||
void
|
||||
computePressQuant(const BlackoilState& state)
|
||||
{
|
||||
const std::vector<double>& p = state.pressure();
|
||||
const std::vector<double>& z = state.surfacevol();
|
||||
|
||||
assert (p.size() == std::vector<double>::size_type(nc_ * 1 ));
|
||||
assert (z.size() == std::vector<double>::size_type(nc_ * np_));
|
||||
|
||||
fluid_.matrix (nc_, & p[0], & z[0], & cells_[0],
|
||||
A_ .data(), dA_ .data());
|
||||
|
||||
fluid_.viscosity(nc_, & p[0], & z[0], & cells_[0],
|
||||
mu_.data(), /*dmu_.data()*/ 0);
|
||||
dmu_.fill(0.0);
|
||||
}
|
||||
|
||||
ADB
|
||||
fvf(const int phase, const ADB& p) const
|
||||
{
|
||||
assert (0 <= phase);
|
||||
assert (phase < np_ );
|
||||
|
||||
typedef typename ADB::V V;
|
||||
|
||||
const V A = A_ .block(0, phase * (np_ + 1), nc_, 1);
|
||||
const V dA = dA_.block(0, phase * (np_ + 1), nc_, 1);
|
||||
|
||||
std::vector<typename ADB::M> jac(p.numBlocks());
|
||||
assert(p.numBlocks() == 2);
|
||||
jac[0] = spdiag(dA);
|
||||
assert(jac[0].cols() == p.blockPattern()[0]);
|
||||
jac[1] = M(A.rows(), p.blockPattern()[1]);
|
||||
return one_ / ADB::function(A, jac);
|
||||
}
|
||||
|
||||
typename ADB::V
|
||||
phaseRelPerm(const int phase) const
|
||||
{
|
||||
const typename ADB::V kr = kr_.block(0, phase, nc_, 1);
|
||||
|
||||
return kr;
|
||||
}
|
||||
|
||||
ADB
|
||||
phaseViscosity(const int phase, const ADB& p) const
|
||||
{
|
||||
assert (0 <= phase);
|
||||
assert (phase < np_ );
|
||||
|
||||
typedef typename ADB::V V;
|
||||
|
||||
const V mu = mu_ .block(0, phase, nc_, 1);
|
||||
const V dmu = dmu_.block(0, phase, nc_, 1);
|
||||
|
||||
std::vector<typename ADB::M> jac(p.numBlocks());
|
||||
assert(p.numBlocks() == 2);
|
||||
jac[0] = spdiag(dmu);
|
||||
assert(jac[0].cols() == p.blockPattern()[0]);
|
||||
jac[1] = M(mu.rows(), p.blockPattern()[1]);
|
||||
|
||||
return ADB::function(mu, jac);
|
||||
}
|
||||
|
||||
ADB
|
||||
phaseDensity(const int phase, const ADB& p) const
|
||||
{
|
||||
typedef typename ADB::V V;
|
||||
|
||||
const double* rho0 = fluid_.surfaceDensity();
|
||||
|
||||
V rho = V::Zero(nc_, 1);
|
||||
V drho = V::Zero(nc_, 1);
|
||||
for (int i = 0; i < np_; ++i) {
|
||||
rho += rho0[i] * A_ .block(0, phase*np_ + i, nc_, 1);
|
||||
drho += rho0[i] * dA_.block(0, phase*np_ + i, nc_, 1);
|
||||
}
|
||||
|
||||
assert (p.numBlocks() == 2);
|
||||
std::vector<typename ADB::M> jac(p.numBlocks());
|
||||
jac[0] = spdiag(drho);
|
||||
jac[1] = M(rho.rows(), p.blockPattern()[1]);
|
||||
|
||||
assert (jac[0].cols() == p.blockPattern()[0]);
|
||||
|
||||
return ADB::function(rho, jac);
|
||||
}
|
||||
|
||||
private:
|
||||
const int nc_;
|
||||
const int np_;
|
||||
|
||||
const std::vector<int> cells_;
|
||||
const BOFluid& fluid_;
|
||||
|
||||
typedef Eigen::Array<Scalar,
|
||||
Eigen::Dynamic,
|
||||
Eigen::Dynamic,
|
||||
Eigen::RowMajor> DerivedQuant;
|
||||
|
||||
// Pressure dependent quantities (essentially B and \mu)
|
||||
DerivedQuant A_ ;
|
||||
DerivedQuant dA_ ;
|
||||
DerivedQuant mu_ ;
|
||||
DerivedQuant dmu_;
|
||||
|
||||
// Saturation dependent quantities (rel-perm only)
|
||||
DerivedQuant kr_;
|
||||
|
||||
const typename ADB::V zero_;
|
||||
const typename ADB::V one_ ;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
template <class BOFluid, class GeoProps>
|
||||
class ImpesTPFAAD {
|
||||
@ -279,7 +127,6 @@ namespace Opm {
|
||||
BlackoilState& state,
|
||||
WellState& well_state)
|
||||
{
|
||||
// pdepfdata_.computeSatQuant(state);
|
||||
const int nc = grid_.number_of_cells;
|
||||
const int np = state.numPhases();
|
||||
DataBlock s = Eigen::Map<const DataBlock>(state.saturation().data(), nc, np);
|
||||
|
Loading…
Reference in New Issue
Block a user