correcting the size of seg_comp_initial_ based on num_comp

for standards wells, all the three equations are mass balance
equatiions, it is safe to use numWellEq.

for MS wells, there is one extra pressure equation, it should be the
number of mass balance equations. If we do not put the polymer equation
inside the well equations, we will face dilemma soon.
This commit is contained in:
Kai Bao 2017-09-26 09:36:30 +02:00
parent 282d678622
commit dd9ad42a28
2 changed files with 8 additions and 4 deletions

View File

@ -33,7 +33,7 @@ namespace Opm
, segment_inlets_(numberOfSegments())
, perforation_cell_pressure_diffs_(number_of_perforations_, 0.0)
, segment_perforation_depth_diffs_(number_of_perforations_)
, segment_comp_initial_(numberOfSegments(), std::vector<double>(numWellEq, 0.0))
, segment_comp_initial_(numberOfSegments(), std::vector<double>(numComponents(), 0.0))
, segment_densities_(numberOfSegments(), 0.0)
, segment_depth_diffs_(numberOfSegments(), 0.0)
{
@ -762,8 +762,10 @@ namespace Opm
computeInitialComposition()
{
for (int seg = 0; seg < numberOfSegments(); ++seg) {
for (int eq_idx = 0; eq_idx < numWellEq; ++eq_idx) {
segment_comp_initial_[seg][eq_idx] = surfaceVolumeFraction(seg, eq_idx).value();
// TODO: probably it should be numWellEq -1 more accurately,
// while by meaning it should be num_comp
for (int comp_idx = 0; comp_idx < numComponents(); ++comp_idx) {
segment_comp_initial_[seg][comp_idx] = surfaceVolumeFraction(seg, comp_idx).value();
}
}
}

View File

@ -316,7 +316,7 @@ namespace Opm
StandardWell<TypeTag>::
wellVolumeFraction(const int compIdx) const
{
const auto pu = phaseUsage();
const auto& pu = phaseUsage();
if (active()[Water] && compIdx == pu.phase_pos[Water]) {
return primary_variables_evaluation_[WFrac];
}
@ -1525,6 +1525,8 @@ namespace Opm
StandardWell<TypeTag>::
computeAccumWell()
{
// TODO: it should be num_comp, while it also bring problem for
// the polymer case.
for (int eq_idx = 0; eq_idx < numWellEq; ++eq_idx) {
F0_[eq_idx] = wellSurfaceVolumeFraction(eq_idx).value();
}