add a private member cmax_ to store the max concentration for per cell.

This commit is contained in:
Liu Ming
2014-01-10 17:53:54 +08:00
parent 97f5c5ace5
commit 65764ce6f2
5 changed files with 20 additions and 24 deletions

Binary file not shown.

View File

@@ -175,6 +175,7 @@ namespace {
, ops_ (grid)
, wops_ (wells)
, grav_ (gravityOperator(grid_, ops_, geo_))
, cmax_(V::Zero(grid.number_of_cells))
, rq_ (fluid.numPhases() + 1)
, residual_ ( { std::vector<ADB>(fluid.numPhases() + 1, ADB::null()),
ADB::null(),
@@ -454,18 +455,16 @@ namespace {
V
ADB
FullyImplicitCompressiblePolymerSolver::
computeCmax(const PolymerBlackoilState& x) const
computeCmax(const ADB& c)
{
const int nc = c.value().size();
const V cmax = Eigen::Map<const V>(& x.maxconcentration()[0], nc);
const V c = Eigen::Map<const V>(& x.concentration()[0], nc);
const int nc = grid_.number_of_cells;
for (int i = 0; i < nc; ++i) {
cmax(i) = std::max(cmax(i), c(i));
cmax_(i) = std::max(cmax_(i), c.value()(i));
}
return cmax;
return ADB::constant(cmax_, c.blockPattern());
}
void
@@ -493,8 +492,7 @@ namespace {
const V trans = subset(geo_.transmissibility(), ops_.internal_faces);
const std::vector<ADB> kr = computeRelPerm(state);
const double dead_pore_vol = polymer_props_ad_.deadPoreVol();
const V cmax_v = computeCmax(x);
const ADB cmax = ADB::constant(cmax_v, state.concentration.blockPattern());
const ADB cmax = computeCmax(state.concentration);
const ADB ads = polymer_props_ad_.adsorption(state.concentration, cmax);
const ADB krw_eff = polymer_props_ad_.effectiveRelPerm(state.concentration, cmax, kr[0], state.saturation[0]);
const ADB mc = computeMc(state);

View File

@@ -130,7 +130,7 @@ namespace Opm {
HelperOps ops_;
const WellOps wops_;
const M grav_;
V cmax_;
std::vector<ReservoirResidualQuant> rq_;
// The mass_balance vector has one element for each active phase,
@@ -191,8 +191,8 @@ namespace Opm {
computeFracFlow(const ADB& kro,
const ADB& krw_eff,
const ADB& c) const;
V
computeCmax(const PolymerBlackoilState& x) const;
ADB
computeCmax(const ADB& c);
ADB
computeMc(const SolutionState& state) const;
ADB

View File

@@ -104,6 +104,7 @@ namespace {
, ops_(grid)
, wops_(wells)
, mob_(std::vector<ADB>(fluid.numPhases() + 1, ADB::null()))
, cmax_(V::Zero(grid.number_of_cells))
, residual_( { std::vector<ADB>(fluid.numPhases() + 1, ADB::null()), ADB::null(), ADB::null()})
{
}
@@ -343,18 +344,16 @@ namespace {
}
V
ADB
FullyImplicitTwophasePolymerSolver::
computeCmax(const PolymerState& x) const
computeCmax(const ADB& c)
{
const int nc = c.value().size();
const V cmax = Eigen::Map<const V>(& x.maxconcentration()[0], nc);
const V c = Eigen::Map<const V>(& x.concentration()[0], nc);
const int nc = grid_.number_of_cells;
for (int i = 0; i < nc; ++i) {
cmax(i) = std::max(cmax(i), c(i));
cmax_(i) = std::max(cmax_(i), c.value()(i));
}
return cmax;
return ADB::constant(cmax_, c.blockPattern());
}
@@ -374,8 +373,7 @@ namespace {
const V trans = subset(transmissibility(), ops_.internal_faces);
const std::vector<ADB> kr = computeRelPerm(state);
const V cmax_v = computeCmax(x);
const ADB cmax = ADB::constant(cmax, state.concentration.blockPattern());
const ADB cmax = computeCmax(state.concentration);
const ADB ads = polymer_props_ad_.adsorption(state.concentration, cmax);
const ADB krw_eff = polymer_props_ad_.effectiveRelPerm(state.concentration, cmax, kr[0], state.saturation[0]);
const ADB mc = computeMc(state);

View File

@@ -61,7 +61,7 @@ namespace Opm {
HelperOps ops_;
const WellOps wops_;
std::vector<ADB> mob_;
V cmax_;
struct {
std::vector<ADB> mass_balance;
ADB well_eq;
@@ -114,8 +114,8 @@ namespace Opm {
const std::vector<double>& polymer_inflow_c,
const SolutionState& state) const;
V
computeCmax(const PolymerState& x) const;
ADB
computeCmax(const ADB& c);
ADB
computeMc(const SolutionState& state) const;
ADB