Skip to content

Commit

Permalink
fix: but with str units (#1028)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sviatose authored Jun 21, 2024
1 parent 44c805c commit 984f484
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ public double getMeasuredValue(String unit) {
double externalDiamater = (pipe.getDiameter() + 2 * pipe.getThickness()) * 1000;// mm
double alpha = 0.0;
double betta = 0.0;
if (supportArrangement == "Stiff") {
if (supportArrangement.equals("Stiff")) {
alpha = 446187 + 646 * externalDiamater
+ 9.17E-4 * externalDiamater * externalDiamater * externalDiamater;
betta = 0.1 * Math.log(externalDiamater) - 1.3739;
} else if (supportArrangement == "Medium stiff") {
} else if (supportArrangement.equals("Medium stiff")) {
alpha = 283921 + 370 * externalDiamater;
betta = 0.1106 * Math.log(externalDiamater) - 1.501;
} else if (supportArrangement == "Medium") {
} else if (supportArrangement.equals("Medium")) {
alpha = 150412 + 209 * externalDiamater;
betta = 0.0815 * Math.log(externalDiamater) - 1.3269;
} else {
Expand All @@ -105,7 +105,7 @@ public double getMeasuredValue(String unit) {
double Fv = alpha * Math.pow(diameterOverThickness, betta);
double LOF = mixDensity * mixVelocity * mixVelocity * FVF / Fv;
return LOF;
} else if (method == "FRMS") {
} else if (method.equals("FRMS")) {
if (GVF < 0.8) {
return GVF;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ public void setAngle(double angle) {
* @return a double
*/
public double getAngle(String unit) {
if (unit == "Degree") {
if (unit.equals("Degree")) {
return this.angle;
} else if (unit == "Radian") {
} else if (unit.equals("Radian")) {
return this.angle * pi / 180;
}
return this.angle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void run(UUID id) {
waterStream.setTemperature(temperature, "C");
waterStream.setPressure(pressure, "bara");

if (unit == "Sm3/hr") {
if (unit.equals("Sm3/hr")) {
gasStream.setFlowRate(desiredGasFlow, unit);
oilStream.setFlowRate(desiredOilFlow * oilDensity, "kg/hr");
waterStream.setFlowRate(desiredWaterFlow * waterDensity, "kg/hr");
Expand Down

0 comments on commit 984f484

Please sign in to comment.