Skip to content

Commit

Permalink
fix: eclipse (read stuck at kij and aqueous phase) (#1084)
Browse files Browse the repository at this point in the history
* fix: eclipse read stuck at kij

* fix: bug with Aqueous phase

* fixed: remove unnecessary tests
  • Loading branch information
Sviatose authored Sep 24, 2024
1 parent 66f9f2b commit 278ac96
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/main/java/neqsim/thermo/phase/PhaseEos.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public void init(double totalNumberOfMoles, int numberOfComponents, int initType
Z = pressure * getMolarVolume() / (R * temperature);
for (int i = 0; i < numberOfComponents; i++) {
componentArray[i].Finit(this, temperature, pressure, totalNumberOfMoles, beta,
numberOfComponents, initType);
numberOfComponents, initType);
}

f_loc = calcf();
Expand All @@ -135,8 +135,10 @@ public void init(double totalNumberOfMoles, int numberOfComponents, int initType
double sumHydrocarbons = 0.0;
double sumAqueous = 0.0;
for (int i = 0; i < numberOfComponents; i++) {
if (getComponent(i).isHydrocarbon() || getComponent(i).isInert()
|| getComponent(i).isIsTBPfraction()) {
if ((getComponent(i).isHydrocarbon() || getComponent(i).isInert()
|| getComponent(i).isIsTBPfraction())
&& !getComponent(i).getName().equals("water")
&& !getComponent(i).getName().equals("water_PC")) {
sumHydrocarbons += getComponent(i).getx();
} else {
sumAqueous += getComponent(i).getx();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public static SystemInterface read(String inputFile) {
kij = new double[names.size()][names.size()];
int lengthLastLine = 0;
List<String> list = new ArrayList<String>();
while ((st = br.readLine().replace("/", "")) != null) {
while ((st = br.readLine().replace("/", "")) != null && addedComps < names.size() - 1) {
if (st.startsWith("--") || st.isEmpty()) {
break;
}
Expand Down

0 comments on commit 278ac96

Please sign in to comment.