Skip to content

Commit

Permalink
added unit for temperature
Browse files Browse the repository at this point in the history
  • Loading branch information
EvenSol committed May 22, 2024
1 parent 8b23ec9 commit a09c88c
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void runCalc() {
liquidRelativeVolume = new double[pressures.length];
cummulativeMolePercDepleted = new double[pressures.length];
double totalNumberOfMoles = getThermoSystem().getTotalNumberOfMoles();
getThermoSystem().setTemperature(temperature);
getThermoSystem().setTemperature(temperature, temperatureUnit);

for (int i = 0; i < pressures.length; i++) {
getThermoSystem().setPressure(pressures[i]);
Expand All @@ -121,7 +121,7 @@ public void runCalc() {
}
// getThermoSystem().display();
totalVolume[i] = getThermoSystem().getVolume();
System.out.println("volume " + totalVolume[i]);
// System.out.println("volume " + totalVolume[i]);
cummulativeMolePercDepleted[i] =
100.0 - getThermoSystem().getTotalNumberOfMoles() / totalNumberOfMoles * 100;
if (getThermoSystem().getNumberOfPhases() > 1) {
Expand Down Expand Up @@ -167,6 +167,11 @@ public void runCalc() {
relativeVolume[i] = totalVolume[i] / saturationVolume;
// System.out.println("rel volume " + relativeVolume[i]);
}
try {
thermoOps.TPflash();
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
}
// System.out.println("test finished");
}

Expand All @@ -188,7 +193,7 @@ public void runTuning() {

SystemInterface tempSystem = getThermoSystem(); // getThermoSystem().clone();

tempSystem.setTemperature(temperature);
tempSystem.setTemperature(temperature, temperatureUnit);
tempSystem.setPressure(pressures[i]);
// thermoOps.TPflash();
// tempSystem.display();
Expand Down Expand Up @@ -275,7 +280,7 @@ public static void main(String[] args) {
tempSystem.init(1);

ConstantVolumeDepletion CVDsim = new ConstantVolumeDepletion(tempSystem);
CVDsim.setTemperature(315.0);
CVDsim.setTemperature(315.0, "K");
CVDsim.setPressures(new double[] {400, 300.0, 200.0, 150.0, 100.0, 50.0});
CVDsim.runCalc();
CVDsim.setTemperaturesAndPressures(new double[] {313, 313, 313, 313},
Expand Down

0 comments on commit a09c88c

Please sign in to comment.