Still working on adsorption computations.

This commit is contained in:
Atgeirr Flø Rasmussen 2012-03-14 16:13:59 +01:00
parent b227b7e954
commit 1554bfff11
3 changed files with 4 additions and 14 deletions

View File

@ -696,7 +696,7 @@ main(int argc, char** argv)
// Report volume balances.
Opm::computeSaturatedVol(porevol, state.saturation(), satvol);
polymass = Opm::computePolymerMass(porevol, state.saturation(), state.concentration(), polydata.deadPoreVol());
polymass_adsorbed = Opm::computePolymerAdsorbed(polydata, porevol, state.saturation(), state.cmax());
polymass_adsorbed = Opm::computePolymerAdsorbed(polydata, porevol, state.cmax());
Opm::computeInjectedProduced(*props, polydata, state.saturation(), state.concentration(),
src, simtimer.currentStepLength(), inflow_c,
injected, produced, polyinj, polyprod);

View File

@ -191,25 +191,17 @@ namespace Opm
/// @brief Computes total absorbed polymer mass over all grid cells.
/// @param[in] polyprops polymer properties
/// @param[in] pv the pore volume by cell.
/// @param[in] s saturation values (for all P phases)
/// @param[in] cmax max polymer concentration for cell
/// @param[in] dps dead pore space
/// @return total absorbed polymer mass.
double computePolymerAdsorbed(const Opm::PolymerProperties& polyprops,
const std::vector<double>& pv,
const std::vector<double>& s,
const std::vector<double>& cmax)
{
const int num_cells = pv.size();
const int np = s.size()/pv.size();
if (int(s.size()) != num_cells*np) {
THROW("Sizes of s and pv vectors do not match.");
}
const double dps = polyprops.deadPoreVol();
const double rhor = polyprops.rockDensity();
double abs_mass = 0.0;
for (int cell = 0; cell < num_cells; ++cell) {
const double max_polymass = cmax[cell]*pv[cell]*s[np*cell + 0]*(1.0 - dps);
abs_mass += polyprops.adsorbtion(cmax[cell])*max_polymass;
abs_mass += polyprops.adsorbtion(cmax[cell])*pv[cell]*rhor;
}
return abs_mass;
}

View File

@ -105,15 +105,13 @@ namespace Opm
/// @brief Computes total absorbed polymer mass over all grid cells.
/// @param[in] polyprops polymer properties
/// @param[in] pv the pore volume by cell.
/// @param[in] s saturation values (for all P phases)
/// @param[in] cmax max polymer concentration for cell
/// @param[in] dps dead pore space
/// @return total absorbed polymer mass.
double computePolymerAdsorbed(const Opm::PolymerProperties& polyprops,
const std::vector<double>& pv,
const std::vector<double>& s,
const std::vector<double>& cmax);
} // namespace Opm