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 read #1005

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 @@ -155,8 +155,9 @@ public static SystemInterface read(String inputFile) {
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 );
if (st.trim().equals("EOS")) {
EOS = br.readLine().replace("/", "");
Expand Down Expand Up @@ -233,7 +234,8 @@ public static SystemInterface read(String inputFile) {
VCRIT.add(Double.parseDouble(st));
}
}
if (st.equals("SSHIFT")) {
if (st.equals("SSHIFT") && !shiftisset) {
shiftisset = true;
while ((st = br.readLine().replace("/", "")) != null) {
if (st.startsWith("--") || st.isEmpty()) {
break;
Expand Down Expand Up @@ -318,11 +320,13 @@ public static SystemInterface read(String inputFile) {
fluid.addComponent(name, ZI.get(counter));
} else if (TC.get(counter) >= 00.0) {
name = names.get(counter);
fluid.addTBPfraction(name, ZI.get(counter), MW.get(counter) / 1000.0, 0.9);
double stddensity = 0.5046 * MW.get(counter) / 1000.0 + 0.668468;
fluid.addTBPfraction(name, ZI.get(counter), MW.get(counter) / 1000.0, stddensity);
name = name + "_PC";
} else {
name = names.get(counter);
fluid.addTBPfraction(name, ZI.get(counter), MW.get(counter) / 1000.0, 0.9);
double stddensity = 0.5046 * MW.get(counter) / 1000.0 + 0.668468;
fluid.addTBPfraction(name, ZI.get(counter), MW.get(counter) / 1000.0, stddensity);
name = name + "_PC";
// fluid.changeComponentName(name+"_PC", names.get(counter));
}
Expand All @@ -336,6 +340,7 @@ public static SystemInterface read(String inputFile) {
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));
fluid.getPhase(i).getComponent(name).setRacketZ(0.29056 - 0.08775 * ACF.get(counter));
}
if (fluid.getPhase(0).getComponent(name).isIsTBPfraction()) {
fluid.changeComponentName(name, names.get(counter).replaceAll("_PC", "") + pseudoName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class EclipseFluidReadWriteTest extends neqsim.NeqSimTest {
static neqsim.thermo.system.SystemInterface testSystem = null;

File file = new File("src/test/java/neqsim/thermo/util/readwrite");
String fileFluid1 = file.getAbsolutePath() + "/fluid1.e300";
String fileA1 = file.getAbsolutePath() + "/A-1.E300";
String fileA13 = file.getAbsolutePath() + "/A-13.E300";
String fileA17 = file.getAbsolutePath() + "/A-17.E300";
Expand Down Expand Up @@ -85,4 +86,22 @@ void testSetComposition() throws IOException {
ThermodynamicOperations testOps = new ThermodynamicOperations(testSystem);
testOps.TPflash();
}

@Test
void testReadFluid1() throws IOException {
testSystem = EclipseFluidReadWrite.read(fileFluid1);
ThermodynamicOperations testOps = new ThermodynamicOperations(testSystem);
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()));

// for (int i = 0; i < testSystem.getNumberOfComponents(); i++) {
// System.out.println(testSystem.getComponent(i).getName() + " TC "
// + (testSystem.getComponent(i).getVolumeCorrectionConst()));
// }
}
}
Loading