3
3
import static org .junit .jupiter .api .Assertions .assertEquals ;
4
4
import java .io .File ;
5
5
import java .io .IOException ;
6
+ import org .junit .jupiter .api .Assertions ;
6
7
import org .junit .jupiter .api .Test ;
7
8
import neqsim .thermo .phase .PhaseEos ;
8
9
import neqsim .thermodynamicoperations .ThermodynamicOperations ;
@@ -20,6 +21,7 @@ class EclipseFluidReadWriteTest extends neqsim.NeqSimTest {
20
21
String fileA17 = file .getAbsolutePath () + "/A-17.E300" ;
21
22
String fileA19 = file .getAbsolutePath () + "/A-19.E300" ;
22
23
String filer = file .getAbsolutePath () + "/fluid-r.E300" ;
24
+ String fluid_water = file .getAbsolutePath () + "/fluid_water.E300" ;
23
25
24
26
/**
25
27
* Test method for
@@ -161,4 +163,33 @@ void testReadFluidR() throws IOException {
161
163
// testSystem.prettyPrint();
162
164
// Assertions.assertEquals(0.9270363530, testSystem.getBeta(0), 1e-6);
163
165
}
166
+
167
+ @ Test
168
+ void testFluidWater () throws IOException {
169
+ testSystem = EclipseFluidReadWrite .read (fluid_water );
170
+ testSystem .setMultiPhaseCheck (true );
171
+ ThermodynamicOperations testOps = new ThermodynamicOperations (testSystem );
172
+ testSystem .setPressure (60.0 , "bara" );
173
+ testSystem .setTemperature (65.0 , "C" );
174
+ testOps .TPflash ();
175
+
176
+ // testSystem.prettyPrint();
177
+
178
+ neqsim .thermo .util .readwrite .TablePrinter .printTable (
179
+ (((PhaseEos ) testSystem .getPhase (0 )).getMixingRule ().getBinaryInteractionParameters ()));
180
+ double [][] paramsPhase0 =
181
+ ((PhaseEos ) testSystem .getPhase (0 )).getMixingRule ().getBinaryInteractionParameters ();
182
+ double [][] paramsPhase1 =
183
+ ((PhaseEos ) testSystem .getPhase (2 )).getMixingRule ().getBinaryInteractionParameters ();
184
+
185
+ // Check that both 2D arrays have the same dimensions first.
186
+ Assertions .assertEquals (paramsPhase0 .length , paramsPhase1 .length );
187
+
188
+ // CHeck that kij are equal of phase gas and water
189
+ for (int i = 0 ; i < paramsPhase0 .length ; i ++) {
190
+ for (int j = 0 ; j < paramsPhase0 .length ; j ++) {
191
+ Assertions .assertEquals (paramsPhase0 [i ][j ], paramsPhase1 [i ][j ]);
192
+ }
193
+ }
194
+ }
164
195
}
0 commit comments