mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Change setThresholdPressures() interface.
Now it takes a std::vector instead of an Eigen::Array, more importantly it expects one element per face, not interior face. The mapping now takes place in setThresholdPressures().
This commit is contained in:
parent
dc9ce967a2
commit
4af03dcdb8
@ -80,9 +80,9 @@ namespace Opm {
|
|||||||
/// difference is greater, the threshold value is subtracted
|
/// difference is greater, the threshold value is subtracted
|
||||||
/// before calculating flow. This is treated symmetrically, so
|
/// before calculating flow. This is treated symmetrically, so
|
||||||
/// flow is prevented or reduced in both directions equally.
|
/// flow is prevented or reduced in both directions equally.
|
||||||
/// \param[in] threshold_pressures array of size equal to the number of interior faces
|
/// \param[in] threshold_pressures_by_face array of size equal to the number of faces
|
||||||
/// of the grid passed in the constructor.
|
/// of the grid passed in the constructor.
|
||||||
void setThresholdPressures(const Eigen::Array<double, Eigen::Dynamic, 1>& threshold_pressures);
|
void setThresholdPressures(const std::vector<double>& threshold_pressures_by_face);
|
||||||
|
|
||||||
/// Take a single forward step, modifiying
|
/// Take a single forward step, modifiying
|
||||||
/// state.pressure()
|
/// state.pressure()
|
||||||
|
@ -218,14 +218,18 @@ namespace {
|
|||||||
template<class T>
|
template<class T>
|
||||||
void
|
void
|
||||||
FullyImplicitBlackoilSolver<T>::
|
FullyImplicitBlackoilSolver<T>::
|
||||||
setThresholdPressures(const Eigen::Array<double, Eigen::Dynamic, 1>& threshold_pressures)
|
setThresholdPressures(const std::vector<double>& threshold_pressures_by_face)
|
||||||
{
|
{
|
||||||
const int ifacesize = ops_.internal_faces.size();
|
const int num_faces = AutoDiffGrid::numFaces(grid_);
|
||||||
if (threshold_pressures.size() != ifacesize) {
|
if (int(threshold_pressures_by_face.size()) != num_faces) {
|
||||||
OPM_THROW(std::runtime_error, "Illegal size of threshold_pressures input, must be equal to number of interior faces.");
|
OPM_THROW(std::runtime_error, "Illegal size of threshold_pressures_by_face input, must be equal to number of faces.");
|
||||||
}
|
}
|
||||||
use_threshold_pressure_ = true;
|
use_threshold_pressure_ = true;
|
||||||
threshold_pressures_by_interior_face_ = threshold_pressures;
|
// Map to interior faces.
|
||||||
|
const int num_ifaces = ops_.internal_faces.size();
|
||||||
|
for (int ii = 0; ii < num_ifaces; ++ii) {
|
||||||
|
threshold_pressures_by_interior_face_[ii] = threshold_pressures_by_face[ops_.internal_faces[ii]];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user