mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
adding function processFractions() to MultisegmentWell
to handle the undershooting and overshooting of the fractions during updateWellState.
This commit is contained in:
parent
0e7b77fac2
commit
1adc081430
@ -326,6 +326,9 @@ namespace Opm
|
|||||||
|
|
||||||
// hytrostatic pressure loss
|
// hytrostatic pressure loss
|
||||||
EvalWell getHydorPressureLoss(const int seg) const;
|
EvalWell getHydorPressureLoss(const int seg) const;
|
||||||
|
|
||||||
|
// handling the overshooting and undershooting of the fractions
|
||||||
|
void processFractions(const int seg, std::vector<double>& fractions) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1367,4 +1367,64 @@ namespace Opm
|
|||||||
{
|
{
|
||||||
return segment_densities_[seg] * gravity_ * segment_depth_diffs_;
|
return segment_densities_[seg] * gravity_ * segment_depth_diffs_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
template<typename TypeTag>
|
||||||
|
void
|
||||||
|
MultisegmentWell<TypeTag>::
|
||||||
|
processFractions(const int seg,
|
||||||
|
std::vector<double>& fractions) const
|
||||||
|
{
|
||||||
|
assert( active()[Oil] );
|
||||||
|
fractions[Oil] = 1.0;
|
||||||
|
|
||||||
|
if ( active()[Water] ) {
|
||||||
|
fractions[Water] = primary_variables_[seg][WFrac];
|
||||||
|
fractions[Oil] -= fractions[Water];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( active()[Gas] ) {
|
||||||
|
fractions[Gas] = primary_variables_[seg][GFrac];
|
||||||
|
fractions[Oil] -= fractions[Gas];
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: not handling solvent related
|
||||||
|
|
||||||
|
if (fractions[Water] < 0.0) {
|
||||||
|
if ( active()[Gas] ) {
|
||||||
|
fractions[Gas] /= (1.0 - fractions[Water]);
|
||||||
|
}
|
||||||
|
fractions[Oil] /= (1.0 - fractions[Water]);
|
||||||
|
fractions[Water] = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fractions[Gas] < 0.0) {
|
||||||
|
if ( active()[Water] ) {
|
||||||
|
fractions[Water] /= (1.0 - fractions[Gas]);
|
||||||
|
}
|
||||||
|
fractions[Oil] /= (1.0 - fractions[Gas]);
|
||||||
|
fractions[Gas] = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fractions[Oil] < 0.0) {
|
||||||
|
if ( active()[Water] ) {
|
||||||
|
fractions[Water] /= (1.0 - fractions[Oil]);
|
||||||
|
}
|
||||||
|
if ( active()[Gas] ) {
|
||||||
|
fractions[Gas] /= (1.0 - fractions[Oil]);
|
||||||
|
}
|
||||||
|
fractions[Oil] = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( active()[Water] ) {
|
||||||
|
primary_variables_[seg][WFrac] = fractions[Water];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( active()[Gas] ) {
|
||||||
|
primary_variables_[seg][GFrac] = fractions[Gas];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user