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

added unit for temperature #1017

Merged
merged 1 commit into from
May 22, 2024
Merged
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 @@ -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