Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update eclipse reader #1006

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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