Some more cleanup adressing PR comments.

This commit is contained in:
Tor Harald Sandve
2016-02-12 11:02:03 +01:00
parent dee96db6b2
commit 0a30d912e8
4 changed files with 45 additions and 37 deletions

View File

@@ -232,10 +232,10 @@ namespace Opm {
phaseCondition() const {return this->phaseCondition_;}
// compute effective viscosities (mu_eff_) and effective b factors (b_eff_) using the ToddLongstaff model
void calculateEffectiveProperties(const SolutionState& state);
void computeEffectiveProperties(const SolutionState& state);
// compute density and viscosity using the ToddLongstaff mixing model
void ToddLongstaffModel(std::vector<ADB>& viscosity, std::vector<ADB>& density, const std::vector<ADB>& saturations, const Opm::PhaseUsage pu);
void computeToddLongstaffMixing(std::vector<ADB>& viscosity, std::vector<ADB>& density, const std::vector<ADB>& saturations, const Opm::PhaseUsage pu);
};

View File

@@ -712,7 +712,7 @@ namespace Opm {
template <class Grid>
void
BlackoilSolventModel<Grid>::calculateEffectiveProperties(const SolutionState& state)
BlackoilSolventModel<Grid>::computeEffectiveProperties(const SolutionState& state)
{
// Viscosity
const Opm::PhaseUsage& pu = fluid_.phaseUsage();
@@ -767,7 +767,7 @@ namespace Opm {
effective_saturations[solvent_pos_] = ss - sgcwmis;
// Compute effective viscosities and densities
ToddLongstaffModel(viscosity, density, effective_saturations, pu);
computeToddLongstaffMixing(viscosity, density, effective_saturations, pu);
// Store the computed volume factors and viscosities
b_eff_[pu.phase_pos[ Water ]] = bw;
@@ -783,7 +783,7 @@ namespace Opm {
template <class Grid>
void
BlackoilSolventModel<Grid>::ToddLongstaffModel(std::vector<ADB>& viscosity, std::vector<ADB>& density, const std::vector<ADB>& saturations, const Opm::PhaseUsage pu)
BlackoilSolventModel<Grid>::computeToddLongstaffMixing(std::vector<ADB>& viscosity, std::vector<ADB>& density, const std::vector<ADB>& saturations, const Opm::PhaseUsage pu)
{
const int nc = cells_.size();
const V ones = V::Constant(nc, 1.0);
@@ -904,14 +904,14 @@ namespace Opm {
// Compute initial accumulation contributions
// and well connection pressures.
if (is_miscible_) {
calculateEffectiveProperties(state0);
computeEffectiveProperties(state0);
}
computeAccum(state0, 0);
computeWellConnectionPressures(state0, well_state);
}
if (is_miscible_) {
calculateEffectiveProperties(state);
computeEffectiveProperties(state);
}
// -------- Mass balance equations --------

View File

@@ -373,7 +373,9 @@ ADB SolventPropsAdFromDeck::miscibleResidualOilSaturationFunction (const ADB& Sw
return ADB::constant(V::Zero(Sw.size()));
}
ADB SolventPropsAdFromDeck::makeADBfromTables(const ADB& X_AD, const Cells& cells, std::vector<NonuniformTableLinear<double>> table) const {
ADB SolventPropsAdFromDeck::makeADBfromTables(const ADB& X_AD,
const Cells& cells,
const std::vector<NonuniformTableLinear<double>>& tables) const {
const int n = cells.size();
assert(X_AD.value().size() == n);
V x(n);
@@ -381,8 +383,8 @@ ADB SolventPropsAdFromDeck::makeADBfromTables(const ADB& X_AD, const Cells& cell
for (int i = 0; i < n; ++i) {
const double& X_i = X_AD.value()[i];
int regionIdx = 0; // TODO add mapping from cells to sat function table
x[i] = table[regionIdx](X_i);
dx[i] = table[regionIdx].derivative(X_i);
x[i] = tables[regionIdx](X_i);
dx[i] = tables[regionIdx].derivative(X_i);
}
ADB::M dx_diag(dx.matrix().asDiagonal());

View File

@@ -86,7 +86,7 @@ public:
ADB misicibleHydrocarbonWaterRelPerm(const ADB& Sn,
const Cells& cells) const;
/// Miscible Solvent + Gas relPerm multipleier
/// Miscible Solvent + Gas relPerm multiplier
/// \param[in] Ssg Array of n total gas fraction (Sgas + Ssolvent) / Sn values, where
/// Sn = Sgas + Ssolvent + Soil.
/// \param[in] cells Array of n cell indices to be associated with the fraction values.
@@ -94,7 +94,7 @@ public:
ADB miscibleSolventGasRelPermMultiplier(const ADB& Ssg,
const Cells& cells) const;
/// Miscible Oil relPerm multipleier
/// Miscible Oil relPerm multiplier
/// \param[in] So Array of n oil fraction values. Soil / Sn values, where Sn = Sgas + Ssolvent + Soil.
/// \param[in] cells Array of n cell indices to be associated with the fraction values.
/// \return Array of n oil relperm multiplier.
@@ -137,7 +137,13 @@ public:
private:
/// Makes ADB from table values
ADB makeADBfromTables(const ADB& X, const Cells& cells, std::vector<NonuniformTableLinear<double> > table) const;
/// \param[in] X Array of n table lookup values.
/// \param[in] cells Array of n cell indices to be associated with the fraction values.
/// \param[in] tables Vector of tables, one for each PVT region.
/// \return Array of n solvent density values.
ADB makeADBfromTables(const ADB& X,
const Cells& cells,
const std::vector<NonuniformTableLinear<double>>& tables) const;
// The PVT region which is to be used for each cell
std::vector<int> cellPvtRegionIdx_;