5
5
import static org .junit .jupiter .api .Assertions .assertTrue ;
6
6
import org .junit .jupiter .api .BeforeEach ;
7
7
import org .junit .jupiter .api .Test ;
8
+ import neqsim .thermo .mixingrule .EosMixingRuleType ;
8
9
import neqsim .thermodynamicoperations .ThermodynamicOperations ;
9
10
10
11
public class PTPhaseEnvelopeTest {
@@ -25,22 +26,23 @@ void testDewP() {
25
26
testSystem .addComponent ("nitrogen" , 0.01 );
26
27
testSystem .addComponent ("CO2" , 0.01 );
27
28
testSystem .addComponent ("methane" , 0.98 );
28
- testSystem .setMixingRule ("classic" );
29
+ testSystem .setMixingRule (EosMixingRuleType . byName ( "classic" ) );
29
30
30
31
testOps = new ThermodynamicOperations (testSystem );
31
32
testOps .TPflash ();
32
33
testSystem .initProperties ();
33
34
testOps .calcPTphaseEnvelope ();
34
35
double [] dewPointPressures = testOps .get ("dewP" );
35
- double [] expectedDewPointPressures = new double [] { 1.1051709180756477 , 1.2214027581601699 , 1.3498588075760032 ,
36
- 1.4918246976412703 , 1.6652911949458864 , 1.8794891289619104 , 2.1418131227502055 ,
37
- 2.4690864123141987 , 2.881197018974799 , 3.404779997613969 , 4.075230307874481 ,
38
- 4.938583914869986 , 6.051801019586486 , 7.477304695462727 , 9.260793952051571 ,
39
- 11.364101185282063 , 13.480106047577934 , 14.53423776629387 , 13.607498029406681 ,
40
- 11.181207439509638 , 9.189487040488075 , 9.612827246459474 , 10.706126846063928 ,
41
- 12.501491987760147 , 15.075672692089958 , 18.51283799420178 , 23.330378296334104 ,
42
- 29.71319711031059 , 37.25532259549197 , 43.660805656603934 , 45.75836660678656 ,
43
- 46.42490219574348 , 46.83203503669948 , 46.869568345957006 , 46.903557772489435 };
36
+ double [] expectedDewPointPressures =
37
+ new double [] {1.1051709180756477 , 1.2214027581601699 , 1.3498588075760032 ,
38
+ 1.4918246976412703 , 1.6652911949458864 , 1.8794891289619104 , 2.1418131227502055 ,
39
+ 2.4690864123141987 , 2.881197018974799 , 3.404779997613969 , 4.075230307874481 ,
40
+ 4.938583914869986 , 6.051801019586486 , 7.477304695462727 , 9.260793952051571 ,
41
+ 11.364101185282063 , 13.480106047577934 , 14.53423776629387 , 13.607498029406681 ,
42
+ 11.181207439509638 , 9.189487040488075 , 9.612827246459474 , 10.706126846063928 ,
43
+ 12.501491987760147 , 15.075672692089958 , 18.51283799420178 , 23.330378296334104 ,
44
+ 29.71319711031059 , 37.25532259549197 , 43.660805656603934 , 45.75836660678656 ,
45
+ 46.42490219574348 , 46.83203503669948 , 46.869568345957006 , 46.903557772489435 };
44
46
// System.out.println(Arrays.toString(dewPointPressures));
45
47
assertArrayEquals (expectedDewPointPressures , dewPointPressures , 10E-10 );
46
48
}
@@ -58,7 +60,8 @@ void testFailingCaseWithWater() {
58
60
testOps .TPflash ();
59
61
testSystem .initProperties ();
60
62
61
- Exception exception = assertThrows (ArrayIndexOutOfBoundsException .class , () -> testOps .calcPTphaseEnvelope ());
63
+ Exception exception =
64
+ assertThrows (ArrayIndexOutOfBoundsException .class , () -> testOps .calcPTphaseEnvelope ());
62
65
}
63
66
64
67
@ Test
@@ -132,7 +135,8 @@ void testFailingCase1() {
132
135
void testFailingCase2 () {
133
136
// testSystem.setTemperature(40, "C");
134
137
// testSystem.setPressure(50, "bara");
135
- neqsim .thermo .system .SystemInterface fluid0_HC = new neqsim .thermo .system .SystemUMRPRUMCEos (298.0 , 50.0 );
138
+ neqsim .thermo .system .SystemInterface fluid0_HC =
139
+ new neqsim .thermo .system .SystemUMRPRUMCEos (298.0 , 50.0 );
136
140
fluid0_HC .addComponent ("nitrogen" , 2.5 );
137
141
fluid0_HC .addComponent ("CO2" , 4.5 );
138
142
fluid0_HC .addComponent ("methane" , 79.45 );
0 commit comments