@@ -39,7 +39,8 @@ public class Stream extends ProcessEquipmentBaseClass implements StreamInterface
39
39
40
40
protected SystemInterface thermoSystem ;
41
41
42
- // todo: is streamNumber ever anything besides 0 and 1? consider removing along with
42
+ // todo: is streamNumber ever anything besides 0 and 1? consider removing along
43
+ // with
43
44
// numberOfStreams?
44
45
protected int streamNumber = 0 ;
45
46
/** Constant <code>numberOfStreams=0</code>. */
@@ -68,12 +69,13 @@ public Stream(String name) {
68
69
* </p>
69
70
*
70
71
* <p>
71
- * NB! This construct uses the input stream object internally, i.e., it is not cloned. Use
72
+ * NB! This construct uses the input stream object internally, i.e., it is not
73
+ * cloned. Use
72
74
* <code>streamObject.clone(newName)</code> rather than
73
75
* <code>new Stream(newName,streamObject)</code>
74
76
* </p>
75
77
*
76
- * @param name name of stream
78
+ * @param name name of stream
77
79
* @param stream Stream to use as internal Stream.
78
80
*/
79
81
public Stream (String name , StreamInterface stream ) {
@@ -89,10 +91,11 @@ public Stream(String name, StreamInterface stream) {
89
91
* </p>
90
92
*
91
93
* <p>
92
- * NB! This construct uses the input thermoSystem object internally, i.e., it is not cloned.
94
+ * NB! This construct uses the input thermoSystem object internally, i.e., it is
95
+ * not cloned.
93
96
* </p>
94
97
*
95
- * @param name name of stream
98
+ * @param name name of stream
96
99
* @param thermoSystem System to use as internal System.
97
100
*/
98
101
public Stream (String name , SystemInterface thermoSystem ) {
@@ -179,7 +182,8 @@ public Stream clone() {
179
182
try {
180
183
clonedSystem = (Stream ) super .clone ();
181
184
} catch (Exception ex ) {
182
- logger .error (ex .getMessage ());;
185
+ logger .error (ex .getMessage ());
186
+ ;
183
187
}
184
188
if (stream != null ) {
185
189
clonedSystem .setStream (stream .clone ());
@@ -251,8 +255,7 @@ public void setThermoSystemFromPhase(SystemInterface thermoSystem, String phaseT
251
255
} else if (thermoSystem .hasPhaseType ("oil" )) {
252
256
this .thermoSystem = thermoSystem .phaseToSystem (thermoSystem .getPhaseNumberOfPhase ("oil" ));
253
257
} else if (thermoSystem .hasPhaseType ("aqueous" )) {
254
- this .thermoSystem =
255
- thermoSystem .phaseToSystem (thermoSystem .getPhaseNumberOfPhase ("aqueous" ));
258
+ this .thermoSystem = thermoSystem .phaseToSystem (thermoSystem .getPhaseNumberOfPhase ("aqueous" ));
256
259
} else {
257
260
logger .warn ("no phase of type " + phaseTypeName );
258
261
logger .warn ("...returning empty system " );
@@ -368,8 +371,7 @@ && getSpecification().equals("TP")) {
368
371
double gasEnthalpy = thermoSystem .getPhase (0 ).getEnthalpy ();
369
372
double liquidEnthalpy = thermoSystem .getPhase (1 ).getEnthalpy ();
370
373
371
- double enthalpySpec =
372
- getGasQuality () * gasEnthalpy + (1.0 - getGasQuality ()) * liquidEnthalpy ;
374
+ double enthalpySpec = getGasQuality () * gasEnthalpy + (1.0 - getGasQuality ()) * liquidEnthalpy ;
373
375
thermoOps .PHflash (enthalpySpec );
374
376
} catch (Exception ex ) {
375
377
logger .error (ex .getMessage (), ex );
@@ -472,7 +474,7 @@ public void phaseEnvelope() {
472
474
SystemInterface localSyst = getFluid ().clone ();
473
475
ThermodynamicOperations ops = new ThermodynamicOperations (localSyst );
474
476
ops .setRunAsThread (true );
475
- ops .calcPTphaseEnvelope ( true );
477
+ ops .calcPTphaseEnvelope2 ( );
476
478
ops .waitAndCheckForFinishedCalculation (10000 );
477
479
ops .displayResult ();
478
480
// ops.getJfreeChart();
@@ -484,7 +486,7 @@ public double CCB(String unit) {
484
486
SystemInterface localSyst = getFluid ().clone ();
485
487
ThermodynamicOperations ops = new ThermodynamicOperations (localSyst );
486
488
ops .setRunAsThread (true );
487
- ops .calcPTphaseEnvelope ( true );
489
+ ops .calcPTphaseEnvelope2 ( );
488
490
ops .waitAndCheckForFinishedCalculation (10000 );
489
491
if (unit .equals ("bara" ) || unit .equals ("bar" )) {
490
492
return ops .get ("cricondenbar" )[1 ];
@@ -505,7 +507,7 @@ public double CCT(String unit) {
505
507
SystemInterface localSyst = getFluid ().clone ();
506
508
ThermodynamicOperations ops = new ThermodynamicOperations (localSyst );
507
509
ops .setRunAsThread (true );
508
- ops .calcPTphaseEnvelope ( true );
510
+ ops .calcPTphaseEnvelope2 ( );
509
511
ops .waitAndCheckForFinishedCalculation (10000 );
510
512
if (unit .equals ("bara" ) || unit .equals ("bar" )) {
511
513
return ops .get ("cricondentherm" )[1 ];
@@ -582,9 +584,9 @@ public String[][] reportResults() {
582
584
* </p>
583
585
*
584
586
* @param propertyName a {@link java.lang.String} object
585
- * @param unit a {@link java.lang.String} object
586
- * @param phase a {@link java.lang.String} object
587
- * @param component a {@link java.lang.String} object
587
+ * @param unit a {@link java.lang.String} object
588
+ * @param phase a {@link java.lang.String} object
589
+ * @param component a {@link java.lang.String} object
588
590
* @return a {@link java.lang.Object} object
589
591
*/
590
592
public Object getProperty (String propertyName , String unit , String phase , String component ) {
@@ -611,17 +613,15 @@ public double GCV() {
611
613
@ Override
612
614
public double getHydrocarbonDewPoint (String temperatureUnit , double refpressure ,
613
615
String refPressureUnit ) {
614
- HydrocarbonDewPointAnalyser dewPointAnalyser =
615
- new HydrocarbonDewPointAnalyser ("dew point analyser" , this );
616
+ HydrocarbonDewPointAnalyser dewPointAnalyser = new HydrocarbonDewPointAnalyser ("dew point analyser" , this );
616
617
dewPointAnalyser .setReferencePressure (refpressure );
617
618
return dewPointAnalyser .getMeasuredValue (temperatureUnit );
618
619
}
619
620
620
621
/** {@inheritDoc} */
621
622
@ Override
622
623
public double getGCV (String unit , double refTVolume , double refTCombustion ) {
623
- Standard_ISO6976 standard =
624
- new Standard_ISO6976 (getFluid ().clone (), refTVolume , refTCombustion , unit );
624
+ Standard_ISO6976 standard = new Standard_ISO6976 (getFluid ().clone (), refTVolume , refTCombustion , unit );
625
625
standard .setReferenceState ("real" );
626
626
standard .calculate ();
627
627
return standard .getValue ("SuperiorCalorificValue" ) * 1.0e3 ;
@@ -630,8 +630,7 @@ public double getGCV(String unit, double refTVolume, double refTCombustion) {
630
630
/** {@inheritDoc} */
631
631
@ Override
632
632
public double getWI (String unit , double refTVolume , double refTCombustion ) {
633
- Standard_ISO6976 standard =
634
- new Standard_ISO6976 (getFluid ().clone (), refTVolume , refTCombustion , unit );
633
+ Standard_ISO6976 standard = new Standard_ISO6976 (getFluid ().clone (), refTVolume , refTCombustion , unit );
635
634
standard .setReferenceState ("real" );
636
635
standard .calculate ();
637
636
return standard .getValue ("SuperiorWobbeIndex" ) * 1.0e3 ;
@@ -640,8 +639,7 @@ public double getWI(String unit, double refTVolume, double refTCombustion) {
640
639
/** {@inheritDoc} */
641
640
@ Override
642
641
public Standard_ISO6976 getISO6976 (String unit , double refTVolume , double refTCombustion ) {
643
- Standard_ISO6976 standard =
644
- new Standard_ISO6976 (getFluid ().clone (), refTVolume , refTCombustion , unit );
642
+ Standard_ISO6976 standard = new Standard_ISO6976 (getFluid ().clone (), refTVolume , refTCombustion , unit );
645
643
standard .setReferenceState ("real" );
646
644
return standard ;
647
645
}
@@ -660,7 +658,8 @@ public double LCV() {
660
658
* Setter for the field <code>stream</code>.
661
659
* </p>
662
660
*
663
- * @param stream a {@link neqsim.process.equipment.stream.StreamInterface} object
661
+ * @param stream a {@link neqsim.process.equipment.stream.StreamInterface}
662
+ * object
664
663
*/
665
664
public void setStream (StreamInterface stream ) {
666
665
this .stream = stream ;
@@ -702,21 +701,21 @@ public ArrayList<String[]> getReport() {
702
701
703
702
ArrayList <String []> report = new ArrayList <String []>();
704
703
report .add (phases .toArray (new String [0 ]));
705
- report .add (new String [] {"temperature" ,
704
+ report .add (new String [] { "temperature" ,
706
705
Double .toString (getTemperature (neqsim .util .unit .Units .getSymbol ("temperature" ))),
707
- neqsim .util .unit .Units .getSymbol ("temperature" )});
708
- report .add (new String [] {"pressure" ,
706
+ neqsim .util .unit .Units .getSymbol ("temperature" ) });
707
+ report .add (new String [] { "pressure" ,
709
708
Double .toString (getPressure (neqsim .util .unit .Units .getSymbol ("pressure" ))),
710
- neqsim .util .unit .Units .getSymbol ("pressure" )});
711
- report .add (new String [] {"mass flow" ,
709
+ neqsim .util .unit .Units .getSymbol ("pressure" ) });
710
+ report .add (new String [] { "mass flow" ,
712
711
Double .toString (getFlowRate (neqsim .util .unit .Units .getSymbol ("mass flow" ))),
713
- neqsim .util .unit .Units .getSymbol ("mass flow" )});
714
- report .add (new String [] {"molar flow" ,
712
+ neqsim .util .unit .Units .getSymbol ("mass flow" ) });
713
+ report .add (new String [] { "molar flow" ,
715
714
Double .toString (getFlowRate (neqsim .util .unit .Units .getSymbol ("molar flow" ))),
716
- neqsim .util .unit .Units .getSymbol ("molar flow" )});
717
- report .add (new String [] {"volume flow" ,
715
+ neqsim .util .unit .Units .getSymbol ("molar flow" ) });
716
+ report .add (new String [] { "volume flow" ,
718
717
Double .toString (getFlowRate (neqsim .util .unit .Units .getSymbol ("volume flow" ))),
719
- neqsim .util .unit .Units .getSymbol ("volume flow" )});
718
+ neqsim .util .unit .Units .getSymbol ("volume flow" ) });
720
719
return report ;
721
720
}
722
721
0 commit comments