Skip to content

Commit

Permalink
update eclipse reader (#1006)
Browse files Browse the repository at this point in the history
  • Loading branch information
EvenSol authored May 9, 2024
1 parent 9b0d753 commit 811b5a0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ public static SystemInterface read(String inputFile) {
ArrayList<Double> ACF = new ArrayList<Double>();
ArrayList<Double> MW = new ArrayList<Double>();
ArrayList<Double> SSHIFT = new ArrayList<Double>();
ArrayList<Double> SSHIFTS = new ArrayList<Double>();
ArrayList<Double> TBOIL = new ArrayList<Double>();
ArrayList<Double> VCRIT = new ArrayList<Double>();
ArrayList<Double> PARACHOR = new ArrayList<Double>();
ArrayList<Double> ZI = new ArrayList<Double>();
ArrayList<Double> BIC = new ArrayList<Double>();
String EOS;
boolean shiftisset = false;
while ((st = br.readLine()) != null) {

// System.out.println("EOS " +EOS );
Expand Down Expand Up @@ -234,8 +234,7 @@ public static SystemInterface read(String inputFile) {
VCRIT.add(Double.parseDouble(st));
}
}
if (st.equals("SSHIFT") && !shiftisset) {
shiftisset = true;
if (st.equals("SSHIFT")) {
while ((st = br.readLine().replace("/", "")) != null) {
if (st.startsWith("--") || st.isEmpty()) {
break;
Expand Down Expand Up @@ -285,6 +284,20 @@ public static SystemInterface read(String inputFile) {
list.clear();
}
}
if (st.equals("SSHIFTS")) {
String line;
while ((line = br.readLine()) != null) {
st = line.replace("/", "");
if (st.startsWith("--") || st.isEmpty()) {
break;
}
try {
SSHIFTS.add(Double.parseDouble(st));
} catch (NumberFormatException e) {
System.out.println("Error parsing double value: " + e.getMessage());
}
}
}
}
for (int counter = 0; counter < names.size(); counter++) {
String name = names.get(counter);
Expand Down Expand Up @@ -339,7 +352,11 @@ public static SystemInterface read(String inputFile) {
fluid.getPhase(i).getComponent(name).setNormalBoilingPoint(TBOIL.get(counter));
fluid.getPhase(i).getComponent(name).setCriticalVolume(VCRIT.get(counter));
fluid.getPhase(i).getComponent(name).setParachorParameter(PARACHOR.get(counter));
fluid.getPhase(i).getComponent(name).setVolumeCorrectionConst(SSHIFT.get(counter));
if (SSHIFTS.size() > 0) {
fluid.getPhase(i).getComponent(name).setVolumeCorrectionConst(SSHIFTS.get(counter));
} else {
fluid.getPhase(i).getComponent(name).setVolumeCorrectionConst(SSHIFT.get(counter));
}
fluid.getPhase(i).getComponent(name).setRacketZ(0.29056 - 0.08775 * ACF.get(counter));
}
if (fluid.getPhase(0).getComponent(name).isIsTBPfraction()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ void testReadFluid1() throws IOException {
testSystem.setPressure(50.0, "bara");
testSystem.setTemperature(50.0, "C");
testOps.TPflash();
// testSystem.prettyPrint();

// neqsim.thermo.util.readwrite.TablePrinter.printTable(
// (((PhaseEos) testSystem.getPhase(0)).getMixingRule().getBinaryInteractionParameters()));
Expand Down

0 comments on commit 811b5a0

Please sign in to comment.