Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pipe beggs and brills y factor #898

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading