mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Some more cleanup adressing PR comments.
This commit is contained in:
@@ -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);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -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 --------
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -86,40 +86,40 @@ 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.
|
||||
/// \return Array of n solvent gas relperm multiplier.
|
||||
ADB miscibleSolventGasRelPermMultiplier (const ADB& Ssg,
|
||||
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.
|
||||
ADB miscibleOilRelPermMultiplier (const ADB& So,
|
||||
ADB miscibleOilRelPermMultiplier(const ADB& So,
|
||||
const Cells& cells) const;
|
||||
|
||||
/// Miscible function
|
||||
/// \param[in] solventFraction Array of n solvent fraction Ss / (Sg + Ss) values.
|
||||
/// \param[in] cells Array of n cell indices to be associated with the fraction values.
|
||||
/// \return Array of n miscibility values
|
||||
ADB miscibilityFunction (const ADB& solventFraction,
|
||||
ADB miscibilityFunction(const ADB& solventFraction,
|
||||
const Cells& cells) const;
|
||||
|
||||
/// Miscible critical gas saturation function
|
||||
/// \param[in] Sw Array of n water saturation values.
|
||||
/// \param[in] cells Array of n cell indices to be associated with the saturation values.
|
||||
/// \return Array of n miscible critical gas saturation values
|
||||
ADB miscibleCriticalGasSaturationFunction (const ADB& Sw,
|
||||
ADB miscibleCriticalGasSaturationFunction(const ADB& Sw,
|
||||
const Cells& cells) const;
|
||||
|
||||
/// Miscible residual oil saturation function
|
||||
/// \param[in] Sw Array of n water saturation values.
|
||||
/// \param[in] cells Array of n cell indices to be associated with the saturation values.
|
||||
/// \return Array of n miscible residual oil saturation values
|
||||
ADB miscibleResidualOilSaturationFunction (const ADB& Sw,
|
||||
ADB miscibleResidualOilSaturationFunction(const ADB& Sw,
|
||||
const Cells& cells) const;
|
||||
|
||||
/// Solvent surface density
|
||||
@@ -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_;
|
||||
|
||||
Reference in New Issue
Block a user