Add setThresholdPressures() method.

This commit is contained in:
Atgeirr Flø Rasmussen 2014-08-27 11:30:42 +02:00
parent f7fa3488cb
commit c5de6635c5
2 changed files with 27 additions and 0 deletions

View File

@ -74,6 +74,16 @@ namespace Opm {
const bool has_disgas,
const bool has_vapoil );
/// \brief Set threshold pressures that prevent or reduce flow.
/// This prevents flow across faces if the potential
/// difference is less than the threshold. If the potential
/// difference is greater, the threshold value is subtracted
/// before calculating flow. This is treated symmetrically, so
/// flow is prevented or reduced in both directions equally.
/// \param[in] threshold_pressures array of size equal to the number of interior faces
/// of the grid passed in the constructor.
void setThresholdPressures(const Eigen::Array<double, Eigen::Dynamic, 1>& threshold_pressures);
/// Take a single forward step, modifiying
/// state.pressure()
/// state.faceflux()

View File

@ -214,6 +214,23 @@ namespace {
}
template<class T>
void
FullyImplicitBlackoilSolver<T>::
setThresholdPressures(const Eigen::Array<double, Eigen::Dynamic, 1>& threshold_pressures)
{
const int ifacesize = ops_.internal_faces.size();
if (threshold_pressures.size() != ifacesize) {
OPM_THROW(std::runtime_error, "Illegal size of threshold_pressures input, must be equal to number of interior faces.");
}
use_threshold_pressure_ = true;
threshold_pressures_by_face_ = threshold_pressures;
}
template<class T>
void
FullyImplicitBlackoilSolver<T>::