removing the unit conversion factors in frictional formular.

since we are using the SI unit internally, they should not be needed.
This commit is contained in:
Kai Bao 2017-09-28 11:00:10 +02:00
parent 7ae5bd5187
commit aa8ffe9386
2 changed files with 11 additions and 20 deletions

View File

@ -79,13 +79,13 @@ namespace mswellhelpers
static double calculateFrictionFactor(const double cr, const double area, const double diameter,
static double calculateFrictionFactor(const double area, const double diameter,
const double w, const double roughness, const double mu)
{
double f = 0.;
// Reynolds number
const double re = cr * diameter * w / (area * mu);
const double re = diameter * w / (area * mu);
assert(re > 0.0);
@ -111,20 +111,19 @@ namespace mswellhelpers
// TODO: not sure whether mu, density and mass flow rate should be Evaluation
// only use its value first
// cr and cf are unit conversion factors
// only use its value for now.
// l is the segment length
// area is the segment cross area
// diameter is the segment inner diameter
// w is mass flow rate through the segment
// density is density
// roughness is the absolute roughness
// mu is the average phase viscosity
double frictionPressureLoss(const double cf, const double cr, const double l,
const double diameter, const double area, const double density,
double frictionPressureLoss(const double l, const double diameter, const double area, const double density,
const double w, const double roughness, const double mu)
{
const double f = calculateFrictionFactor(cr, area, diameter, w, roughness, mu);
return cf * f * l * w * w / (area * area * diameter * density);
const double f = calculateFrictionFactor(area, diameter, w, roughness, mu);
return f * l * w * w / (area * area * diameter * density);
}

View File

@ -259,7 +259,7 @@ namespace Opm
// we should not have this member variable
std::vector<EvalWell> segment_densities_;
// the viscosity of the segment
// the viscosity of the segments
std::vector<EvalWell> segment_viscosities_;
std::vector<double> segment_depth_diffs_;
@ -329,23 +329,15 @@ namespace Opm
// hytrostatic pressure loss
EvalWell getHydroPressureLoss(const int seg) const;
// frictinal pressure loss
EvalWell getFrictionPressureLoss(const int seg) const;
// handling the overshooting and undershooting of the fractions
void processFractions(const int seg) const;
void updateWellStateFromPrimaryVariables(WellState& well_state) const;
double scalingFactor(const int comp_idx) const;
// TODO: the value should not be hard-coded, while has not found a correct way to handle it
double cf() const
{
return 2.679e-15;
}
double cr() const
{
return 0.01158;
}
};
}