@@ -207,7 +207,7 @@ public void run(UUID id) {
207
207
mixedStream .setThermoSystem (thermoSystem2 );
208
208
// thermoSystem2.display();
209
209
ThermodynamicOperations testOps = new ThermodynamicOperations (thermoSystem2 );
210
- if (streams .size () > 0 ) {
210
+ if (streams .size () >= 2 ) {
211
211
mixedStream .getThermoSystem ().setNumberOfPhases (2 );
212
212
mixedStream .getThermoSystem ().init (0 );
213
213
@@ -221,33 +221,37 @@ public void run(UUID id) {
221
221
mixedStream .getThermoSystem ().setTemperature (guessTemperature ());
222
222
}
223
223
// System.out.println("filan temp " + mixedStream.getTemperature());
224
- }
225
- if (isSetOutTemperature ) {
226
- if (!Double .isNaN (getOutTemperature ())) {
227
- mixedStream .getThermoSystem ().setTemperature (getOutTemperature ());
228
- }
229
- testOps .TPflash ();
230
- mixedStream .getThermoSystem ().init (2 );
231
- } else {
232
- try {
233
- testOps .PHflash (enthalpy , 0 );
234
- } catch (Exception ex ) {
235
- logger .error (ex .getMessage (), ex );
224
+
225
+ if (isSetOutTemperature ) {
236
226
if (!Double .isNaN (getOutTemperature ())) {
237
227
mixedStream .getThermoSystem ().setTemperature (getOutTemperature ());
238
228
}
239
229
testOps .TPflash ();
230
+ mixedStream .getThermoSystem ().init (2 );
231
+ } else {
232
+ try {
233
+ testOps .PHflash (enthalpy , 0 );
234
+ } catch (Exception ex ) {
235
+ logger .error (ex .getMessage (), ex );
236
+ if (!Double .isNaN (getOutTemperature ())) {
237
+ mixedStream .getThermoSystem ().setTemperature (getOutTemperature ());
238
+ }
239
+ testOps .TPflash ();
240
+ }
240
241
}
242
+ } else {
243
+ testOps .TPflash ();
244
+ mixedStream .getThermoSystem ().init (2 );
241
245
}
242
- mixedStream . setCalculationIdentifier ( id );
246
+
243
247
244
248
// System.out.println("enthalpy: " +
245
- // mixedStream.getThermoSystem().getEnthalpy());
246
- // System.out.println("enthalpy: " + enthalpy);
249
+ // mixedStream.getThermoSystem().getEnthalpy())
250
+ // System.out.println("enthalpy: " + en
247
251
// System.out.println("temperature: " +
248
- // mixedStream.getThermoSystem().getTemperature());
249
252
250
- // System.out.println("beta " + mixedStream.getThermoSystem().getBeta());
253
+
254
+ // System.out.println("beta " + mixedStream.getThermoSystem(
251
255
// outStream.setThermoSystem(mixedStream.getThermoSystem());
252
256
setCalculationIdentifier (id );
253
257
}
0 commit comments