Skip to content

Commit

Permalink
fix: pipe beggs and brills y factor (#898)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sviatose authored Jan 8, 2024
1 parent d414887 commit 72f24b1
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
public class PipeBeggsAndBrills extends Pipeline {
private static final long serialVersionUID = 1001;

int iteration;

// Inlet pressure of the pipeline (initialization)
private double inletPressure = 0;

Expand Down Expand Up @@ -581,8 +583,13 @@ public double calcFrictionPressureLoss() {

if (system.getNumberOfPhases() != 1) {
if (regime != "Single Phase") {
double y = Math.log(inputVolumeFractionLiquid / (Math.pow(El, 2)));
S = y / (-0.0523 + 3.18 * y - 0.872 * Math.pow(y, 2.0) + 0.01853 * Math.pow(y, 4));
double y = inputVolumeFractionLiquid / (Math.pow(El, 2));
if(1 < y && y < 1.2){
S = Math.log(2.2*y - 1.2);
}
else {
S = Math.log(y) / (-0.0523 + 3.18 * Math.log(y) - 0.872 * Math.pow(Math.log(y), 2.0) + 0.01853 * Math.pow(Math.log(y), 4));
}
if (system.getNumberOfPhases() == 3) {
rhoNoSlip = mixtureLiquidDensity * inputVolumeFractionLiquid
+ (system.getPhase(0).getDensity("lb/ft3")) * (1 - inputVolumeFractionLiquid);
Expand Down Expand Up @@ -642,12 +649,17 @@ public double calcPressureDrop() {
frictionPressureLoss = calcFrictionPressureLoss();
pressureDrop = (hydrostaticPressureDrop + frictionPressureLoss);
convertSystemUnitToMetric();
iteration = iteration + 1;

return pressureDrop;
}

/** {@inheritDoc} */
@Override
public void run(UUID id) {

iteration = 0;

pressureProfile = new ArrayList<>();
temperatureProfile = new ArrayList<>();

Expand Down

0 comments on commit 72f24b1

Please sign in to comment.