mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-18 21:12:57 -06:00
Add utility for calculating all phase mobilities.
This commit is contained in:
parent
5caa3eb3e8
commit
2ac5157148
@ -141,6 +141,30 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void computePhaseMobilities(const Opm::IncompPropertiesInterface& props,
|
||||||
|
const std::vector<int>& cells,
|
||||||
|
const std::vector<double>& s ,
|
||||||
|
std::vector<double>& pmobc)
|
||||||
|
{
|
||||||
|
const std::vector<int>::size_type nc = cells.size();
|
||||||
|
const std::size_t np = props.numPhases();
|
||||||
|
|
||||||
|
ASSERT (s.size() == nc * np);
|
||||||
|
|
||||||
|
std::vector<double>(nc * np, 0.0).swap(pmobc );
|
||||||
|
double* dpmobc = 0;
|
||||||
|
props.relperm(static_cast<const int>(nc), &s[0], &cells[0],
|
||||||
|
&pmobc[0], dpmobc);
|
||||||
|
|
||||||
|
const double* mu = props.viscosity();
|
||||||
|
std::vector<double>::iterator lam = pmobc.begin();
|
||||||
|
for (std::vector<int>::size_type c = 0; c < nc; ++c) {
|
||||||
|
for (std::size_t p = 0; p < np; ++p, ++lam) {
|
||||||
|
*lam /= mu[ p ];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// @brief Estimates a scalar cell velocity from face fluxes.
|
/// @brief Estimates a scalar cell velocity from face fluxes.
|
||||||
/// @param[in] grid a grid
|
/// @param[in] grid a grid
|
||||||
/// @param[in] face_flux signed per-face fluxes
|
/// @param[in] face_flux signed per-face fluxes
|
||||||
|
@ -73,6 +73,11 @@ namespace Opm
|
|||||||
std::vector<double>& totmob,
|
std::vector<double>& totmob,
|
||||||
std::vector<double>& omega);
|
std::vector<double>& omega);
|
||||||
|
|
||||||
|
void computePhaseMobilities(const Opm::IncompPropertiesInterface& props,
|
||||||
|
const std::vector<int>& cells,
|
||||||
|
const std::vector<double>& s ,
|
||||||
|
std::vector<double>& pmobc);
|
||||||
|
|
||||||
/// @brief Estimates a scalar cell velocity from face fluxes.
|
/// @brief Estimates a scalar cell velocity from face fluxes.
|
||||||
/// @param[in] grid a grid
|
/// @param[in] grid a grid
|
||||||
/// @param[in] face_flux signed per-face fluxes
|
/// @param[in] face_flux signed per-face fluxes
|
||||||
|
Loading…
Reference in New Issue
Block a user