Skip to content

Commit 155e8ea

Browse files
authored
fix minor bug (#1274)
1 parent a47c6ba commit 155e8ea

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/main/java/neqsim/thermo/util/readwrite/EclipseFluidReadWrite.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -659,13 +659,15 @@ public static SystemInterface read(String inputFile, String[] fluidNames) {
659659

660660
// Then, to replicate the original kij,
661661
// we just pick the old kij[baseIndexI][baseIndexJ].
662+
// System.out.println("i: " + i + " j: " + j);
663+
// System.out.println("baseIndexI: " + baseIndexI + " baseIndexJ: " + baseIndexJ);
662664
double kijVal = kij[baseIndexI][baseIndexJ];
663665

664666
// Finally set it in the fluid
665667

666668
for (int phaseNum = 0; phaseNum < fluid.getMaxNumberOfPhases(); phaseNum++) {
667669
((PhaseEosInterface) fluid.getPhase(phaseNum)).getEosMixingRule()
668-
.setBinaryInteractionParameter(i, j, kij[i][j].doubleValue());
670+
.setBinaryInteractionParameter(i, j, kijVal);
669671
((PhaseEosInterface) fluid.getPhase(phaseNum)).getEosMixingRule()
670672
.setBinaryInteractionParameter(j, i, kijVal);
671673
}

src/test/java/neqsim/thermo/util/Leachman/LeachmanTest.java src/test/java/neqsim/thermo/util/leachman/LeachmanTest.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package neqsim.thermo.util.Leachman;
1+
package neqsim.thermo.util.leachman;
22

33
import static org.junit.jupiter.api.Assertions.assertEquals;
44
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -7,7 +7,6 @@
77
import org.netlib.util.StringW;
88
import org.netlib.util.doubleW;
99
import org.netlib.util.intW;
10-
import neqsim.thermo.util.leachman.Leachman;
1110

1211
public class LeachmanTest {
1312
private Leachman Leachman;

src/test/java/neqsim/thermo/util/readwrite/EclipseFluidReadWriteTest.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,12 @@ void testSetAllocationComposition() throws IOException {
118118

119119
double x_methane_A19 = testSystem.getPhase(1).getComponent("methane_A19").getx();
120120
assertEquals(0.0, x_methane_A13, 1e-9);
121-
assertEquals(0.004620472627047, x_methane_A19, 1e-9);
121+
assertEquals(0.0046202437, x_methane_A19, 1e-9);
122+
123+
// double[][] interactionParams =
124+
// ((PhaseEos) testSystem.getPhase(0)).getMixingRule().getBinaryInteractionParameters();
125+
126+
// System.out.println(Arrays.deepToString(interactionParams));
122127

123128
}
124129

0 commit comments

Comments
 (0)