Fix PR comments

1) swatinit() is changed to setSwatInitScaling() to make it obvious that
we are modifying the props.
2) the descriptions of saturation and pc now makes more sense
3) the method is removed from the sibling class and the interface and
the type of new_props is changed from BlackoilPropsAdInterface to
BlackoilPropsAdFromDeck
5) The same modification is added to sim_fibo_ad_cp
This commit is contained in:
Tor Harald Sandve
2015-02-19 08:17:41 +01:00
parent 013d1d3499
commit 44e9d2a34e
7 changed files with 22 additions and 33 deletions

View File

@@ -95,7 +95,7 @@ try
}
std::shared_ptr<GridManager> grid;
std::shared_ptr<BlackoilPropertiesInterface> props;
std::shared_ptr<BlackoilPropsAdInterface> new_props;
std::shared_ptr<BlackoilPropsAdFromDeck> new_props;
std::shared_ptr<RockCompressibility> rock_comp;
BlackoilState state;
// bool check_well_controls = false;
@@ -177,7 +177,7 @@ try
for (int c = 0; c < nc; ++c) { cells[c] = c; }
std::vector<double> pc = state.saturation();
props->capPress(nc, state.saturation().data(), cells.data(), pc.data(),NULL);
new_props->swatinit(state.saturation(),pc);
new_props->setSwatInitScaling(state.saturation(),pc);
}
bool use_gravity = (gravity[0] != 0.0 || gravity[1] != 0.0 || gravity[2] != 0.0);

View File

@@ -207,6 +207,17 @@ try
*props, deck, gravity[2], state);
}
// The capillary pressure is scaled in new_props to match the scaled capillary pressure in props.
if (deck->hasKeyword("SWATINIT")) {
const int nc = grid->numCells();
std::vector<int> cells(nc);
for (int c = 0; c < nc; ++c) { cells[c] = c; }
std::vector<double> pc = state.saturation();
props->capPress(nc, state.saturation().data(), cells.data(), pc.data(),NULL);
new_props->setSwatInitScaling(state.saturation(),pc);
}
BlackoilState distributed_state;
std::shared_ptr<Opm::BlackoilPropsAdFromDeck> distributed_props = new_props;
Dune::CpGrid distributed_grid = *grid;

View File

@@ -936,14 +936,5 @@ namespace Opm
OPM_THROW(std::logic_error, "BlackoilPropsAd class does not support this functionality.");
}
/// Update capillary pressure scaling according to pressure diff. and initial water saturation.
/// \param[in] saturation Array of n*numPhases cell indices to be associated with the saturation values.
/// \param[in] pc Array of n*numPhases cell indices to be associated with the capillary pressure values.
void BlackoilPropsAd::swatinit(const std::vector<double>& /*saturation*/,
const std::vector<double>& /*pc*/)
{
OPM_THROW(std::logic_error, "BlackoilPropsAd class does not support this functionality.");
}
} // namespace Opm

View File

@@ -387,12 +387,6 @@ namespace Opm
/// Update for max oil saturation.
void updateSatOilMax(const std::vector<double>& saturation);
/// Update capillary pressure scaling according to pressure diff. and initial water saturation.
/// \param[in] saturation Array of n*numPhases cell indices to be associated with the saturation values.
/// \param[in] pc Array of n*numPhases cell indices to be associated with the capillary pressure values.
void swatinit(const std::vector<double>& saturation,
const std::vector<double>& pc);
private:
const BlackoilPropertiesInterface& props_;
PhaseUsage pu_;

View File

@@ -1167,10 +1167,10 @@ BlackoilPropsAdFromDeck::BlackoilPropsAdFromDeck(const BlackoilPropsAdFromDeck&
}
}
/// Update capillary pressure scaling according to pressure diff. and initial water saturation.
/// \param[in] saturation Array of n*numPhases cell indices to be associated with the saturation values.
/// \param[in] pc Array of n*numPhases cell indices to be associated with the capillary pressure values.
void BlackoilPropsAdFromDeck::swatinit(const std::vector<double>& saturation,
/// Set capillary pressure scaling according to pressure diff. and initial water saturation.
/// \param[in] saturation Array of n*numPhases saturation values.
/// \param[in] pc Array of n*numPhases capillary pressure values.
void BlackoilPropsAdFromDeck::setSwatInitScaling(const std::vector<double>& saturation,
const std::vector<double>& pc)
{
const int nc = rock_.numCells();
@@ -1178,7 +1178,7 @@ BlackoilPropsAdFromDeck::BlackoilPropsAdFromDeck(const BlackoilPropsAdFromDeck&
for (int i = 0; i < nc; ++i) {
double pcow = pc[numActivePhases*i + phase_usage_.phase_pos[Water]];
double swat = saturation[numActivePhases*i + phase_usage_.phase_pos[Water]];
satprops_->swatInitScaling(i,pcow,swat);
satprops_->swatInitScaling(i, pcow, swat);
}
}

View File

@@ -425,10 +425,10 @@ namespace Opm
/// Update for max oil saturation.
void updateSatOilMax(const std::vector<double>& saturation);
/// Update capillary pressure scaling according to pressure diff. and initial water saturation.
/// \param[in] saturation Array of n*numPhases cell indices to be associated with the saturation values.
/// \param[in] pc Array of n*numPhases cell indices to be associated with the capillary pressure values.
void swatinit(const std::vector<double>& saturation,
/// Set capillary pressure scaling according to pressure diff. and initial water saturation.
/// \param[in] saturation Array of n*numPhases saturation values.
/// \param[in] pc Array of n*numPhases capillary pressure values.
void setSwatInitScaling(const std::vector<double>& saturation,
const std::vector<double>& pc);

View File

@@ -400,13 +400,6 @@ namespace Opm
/// Update for max oil saturation.
virtual
void updateSatOilMax(const std::vector<double>& saturation) = 0;
/// Update capillary pressure scaling according to pressure diff. and initial water saturation.
/// \param[in] saturation Array of n*numPhases cell indices to be associated with the saturation values.
/// \param[in] pc Array of n*numPhases cell indices to be associated with the capillary pressure values.
virtual
void swatinit(const std::vector<double>& saturation,
const std::vector<double>& pc ) = 0;
};
} // namespace Opm