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: bug with str units #1028

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
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 @@ -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