Skip to content

Commit

Permalink
added more units for reading flow rate of phase
Browse files Browse the repository at this point in the history
  • Loading branch information
EvenSol committed Jul 15, 2023
1 parent 537ad12 commit a0383a9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/java/neqsim/thermo/phase/Phase.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import neqsim.physicalProperties.PhysicalPropertyHandler;
import neqsim.thermo.ThermodynamicConstantsInterface;
import neqsim.thermo.component.ComponentInterface;
import neqsim.thermo.system.SystemInterface;
import neqsim.util.exception.InvalidInputException;
Expand Down Expand Up @@ -2137,6 +2138,18 @@ public double getFlowRate(String flowunit) {
return numberOfMolesInPhase * 60.0;
} else if (flowunit.equals("mole/hr")) {
return numberOfMolesInPhase * 3600.0;
} else if (flowunit.equals("Sm3/sec")) {
return numberOfMolesInPhase * ThermodynamicConstantsInterface.R
* ThermodynamicConstantsInterface.standardStateTemperature / 101325.0;
} else if (flowunit.equals("Sm3/hr")) {
return numberOfMolesInPhase * 3600.0 * ThermodynamicConstantsInterface.R
* ThermodynamicConstantsInterface.standardStateTemperature / 101325.0;
} else if (flowunit.equals("Sm3/day")) {
return numberOfMolesInPhase * 3600.0 * 24.0 * ThermodynamicConstantsInterface.R
* ThermodynamicConstantsInterface.standardStateTemperature / 101325.0;
} else if (flowunit.equals("MSm3/day")) {
return numberOfMolesInPhase * 3600.0 * 24.0 * ThermodynamicConstantsInterface.R
* ThermodynamicConstantsInterface.standardStateTemperature / 101325.0 / 1.0e6;
} else {
throw new RuntimeException("failed.. unit: " + flowunit + " not supported");
}
Expand Down

0 comments on commit a0383a9

Please sign in to comment.