Skip to content

Commit

Permalink
feat: 101325.0 -> atm
Browse files Browse the repository at this point in the history
  • Loading branch information
asmfstatoil committed Nov 13, 2023
1 parent c5467fa commit a42070d
Show file tree
Hide file tree
Showing 19 changed files with 332 additions and 424 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@ public double getRefComponentViscosity(double temp, double pres) {
4.2903609488e-2, 1.4529023444e2, 6.1276818706e3};
// double viscRefK[] = {-9.74602, 18.0834, -4126.66, 44.6055, 0.9676544, 81.8134, 15649.9};

double molDens =
101325.0 / ThermodynamicConstantsInterface.R / phase.getPhase().getTemperature() / 1.0e3;
double molDens = ThermodynamicConstantsInterface.atm / ThermodynamicConstantsInterface.R
/ phase.getPhase().getTemperature() / 1.0e3;
double critMolDens = 10.15;
double redMolDens = (molDens - critMolDens) / critMolDens;
double viscRefO = GVcoef[0] * Math.pow(temp, -1.0) + GVcoef[1] * Math.pow(temp, -2.0 / 3.0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package neqsim.processSimulation.measurementDevice;

import neqsim.processSimulation.processEquipment.stream.StreamInterface;
import neqsim.thermo.ThermodynamicConstantsInterface;

/**
* <p>
Expand Down Expand Up @@ -58,13 +59,13 @@ public double getMeasuredValue(String unit) {
} else if (unit.equals("Nm^3/day")) {
return stream.getThermoSystem().getPhase(measuredPhaseNumber).getNumberOfMolesInPhase()
* neqsim.thermo.ThermodynamicConstantsInterface.R
* neqsim.thermo.ThermodynamicConstantsInterface.normalStateTemperature / 101325.0 * 3600.0
* 24;
* neqsim.thermo.ThermodynamicConstantsInterface.normalStateTemperature
/ ThermodynamicConstantsInterface.atm * 3600.0 * 24;
} else if (unit.equals("Sm^3/day")) {
return stream.getThermoSystem().getPhase(measuredPhaseNumber).getNumberOfMolesInPhase()
* neqsim.thermo.ThermodynamicConstantsInterface.R
* neqsim.thermo.ThermodynamicConstantsInterface.standardStateTemperature / 101325.0
* 3600.0 * 24;
* neqsim.thermo.ThermodynamicConstantsInterface.standardStateTemperature
/ ThermodynamicConstantsInterface.atm * 3600.0 * 24;
} else {
return stream.getThermoSystem().getPhase(measuredPhaseNumber).getNumberOfMolesInPhase()
* stream.getThermoSystem().getPhase(measuredPhaseNumber).getMolarMass() / stream
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,9 @@ public static void main(String[] args) {
* getPhase(0).getPhysicalProperties().getDensity() * 3600.0 + " m^3/hr");
* System.out.println("Export gas flow " +
* separationModule.getOutputStream("gas exit stream").getThermoSystem().
* getTotalNumberOfMoles() * ThermodynamicConstantsInterface.R * (273.15 + 15.0) / 101325.0 *
* 3600.0 * 24 / 1.0e6 + " MSm^3/day"); System.out.println("oil/water heater duty " + ((Heater)
* getTotalNumberOfMoles() * ThermodynamicConstantsInterface.R * (273.15 + 15.0)
* /ThermodynamicConstantsInterface.atm * 3600.0 * 24 / 1.0e6 + " MSm^3/day");
* System.out.println("oil/water heater duty " + ((Heater)
* separationModule.getOperations().getUnit("oil/water heater")).getEnergyInput( ) + " W");
* System.out.println("Export oil cooler duty " + ((Cooler)
* separationModule.getOperations().getUnit("export oil cooler")).getEnergyInput () + " W");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,9 @@ public static void main(String[] args) {
* getPhase(0).getPhysicalProperties().getDensity() * 3600.0 + " m^3/hr");
* System.out.println("Export gas flow " +
* separationModule.getOutputStream("gas exit stream").getThermoSystem().
* getTotalNumberOfMoles() * ThermodynamicConstantsInterface.R * (273.15 + 15.0) / 101325.0 *
* 3600.0 * 24 / 1.0e6 + " MSm^3/day"); System.out.println("oil/water heater duty " + ((Heater)
* getTotalNumberOfMoles() * ThermodynamicConstantsInterface.R * (273.15 + 15.0)
* /ThermodynamicConstantsInterface.atm * 3600.0 * 24 / 1.0e6 + " MSm^3/day");
* System.out.println("oil/water heater duty " + ((Heater)
* separationModule.getOperations().getUnit("oil/water heater")).getEnergyInput( ) + " W");
* System.out.println("Export oil cooler duty " + ((Cooler)
* separationModule.getOperations().getUnit("export oil cooler")).getEnergyInput () + " W");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ public void calcdPdt() {
dNdt[i] = dPdt[i] * 1.0 / dPdn[i];
err += Math.abs((dNdtOld[i] - dNdt[i]));
// System.out.println("dndt: " + dNdt[i]);
dnVdt[i] = dNdt[i] * ThermodynamicConstantsInterface.R * 298.15 / 101325.0 * 1000 * 60;
dnVdt[i] = dNdt[i] * ThermodynamicConstantsInterface.R * 298.15
/ ThermodynamicConstantsInterface.atm * 1000 * 60;
System.out.println("dVdt: " + dnVdt[i]);
}
System.out.println("err: " + err);
Expand Down
12 changes: 8 additions & 4 deletions src/main/java/neqsim/thermo/phase/Phase.java
Original file line number Diff line number Diff line change
Expand Up @@ -2159,16 +2159,20 @@ public double getFlowRate(String flowunit) {
return numberOfMolesInPhase * 3600.0;
} else if (flowunit.equals("Sm3/sec")) {
return numberOfMolesInPhase * ThermodynamicConstantsInterface.R
* ThermodynamicConstantsInterface.standardStateTemperature / 101325.0;
* ThermodynamicConstantsInterface.standardStateTemperature
/ ThermodynamicConstantsInterface.atm;
} else if (flowunit.equals("Sm3/hr")) {
return numberOfMolesInPhase * 3600.0 * ThermodynamicConstantsInterface.R
* ThermodynamicConstantsInterface.standardStateTemperature / 101325.0;
* ThermodynamicConstantsInterface.standardStateTemperature
/ ThermodynamicConstantsInterface.atm;
} else if (flowunit.equals("Sm3/day")) {
return numberOfMolesInPhase * 3600.0 * 24.0 * ThermodynamicConstantsInterface.R
* ThermodynamicConstantsInterface.standardStateTemperature / 101325.0;
* ThermodynamicConstantsInterface.standardStateTemperature
/ ThermodynamicConstantsInterface.atm;
} else if (flowunit.equals("MSm3/day")) {
return numberOfMolesInPhase * 3600.0 * 24.0 * ThermodynamicConstantsInterface.R
* ThermodynamicConstantsInterface.standardStateTemperature / 101325.0 / 1.0e6;
* ThermodynamicConstantsInterface.standardStateTemperature
/ ThermodynamicConstantsInterface.atm / 1.0e6;
} else {
throw new RuntimeException("failed.. unit: " + flowunit + " not supported");
}
Expand Down
Loading

0 comments on commit a42070d

Please sign in to comment.