Skip to content

Commit

Permalink
updated test and fixed error
Browse files Browse the repository at this point in the history
  • Loading branch information
EvenSol committed Aug 2, 2023
1 parent ccbc064 commit a160866
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public StreamInterface getGasOutStream() {
* @return a {@link neqsim.processSimulation.processEquipment.stream.Stream} object
*/
public StreamInterface getProductOutStream() {
return super.getGasOutStream();
return getGasOutStream();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ public void init() {
}
setDoInitializion(false);
((Runnable) trays.get(feedTrayNumber)).run();
getTray(feedTrayNumber).getFluid().prettyPrint();
if (getTray(feedTrayNumber).getFluid().getNumberOfPhases() == 1) {
for (int i = 0; i < numberOfTrays; i++) {
if (getTray(i).getNumberOfInputStreams() > 0 && i != feedTrayNumber) {
Expand Down Expand Up @@ -331,7 +330,6 @@ public void run(UUID id) {
this.init();
}
err = 1.0e10;
double errOld;
int iter = 0;
double[] oldtemps = new double[numberOfTrays];
((SimpleTray) trays.get(feedTrayNumber)).run(id);
Expand Down Expand Up @@ -387,7 +385,8 @@ public void run(UUID id) {
// System.out.println("error iter " + err + " iteration " + iter);
// massBalanceCheck();
} while (err > 1e-4 && iter < maxNumberOfIterations); // &&
// !massBalanceCheck());

// !massBalanceCheck());
// massBalanceCheck();
// componentMassBalanceCheck("water");
gasOutStream.setThermoSystem(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ public void deethanizerTest() throws Exception {
/ gasToDeethanizerStream.getFlowRate("kg/hr") * 100;

assertEquals(0.0, massbalance, 0.2);
column.getGasOutStream().getFluid().prettyPrint();
column.getLiquidOutStream().getFluid().prettyPrint();
//column.getGasOutStream().getFluid().prettyPrint();
//column.getLiquidOutStream().getFluid().prettyPrint();
}

/**
Expand All @@ -179,7 +179,7 @@ public void debutanizerTest() throws Exception {
new neqsim.thermo.system.SystemSrkEos(289.0, 11.00);
gasToDbutanizer.addComponent("nitrogen", 3.09189E-7);
gasToDbutanizer.addComponent("CO2", 2.20812E-4);
gasToDbutanizer.addComponent("methane", 0.7192E-1);
gasToDbutanizer.addComponent("methane", 0.097192E-1);
gasToDbutanizer.addComponent("ethane", 0.15433E-1);
gasToDbutanizer.addComponent("propane", 2.01019E-1);
gasToDbutanizer.addComponent("i-butane", 2.953E-2);
Expand All @@ -191,9 +191,10 @@ public void debutanizerTest() throws Exception {
gasToDbutanizer.setMixingRule("classic");

StreamInterface gasToDebutanizerStream = new Stream("gasToDbutanizer", gasToDbutanizer);
gasToDebutanizerStream.setFlowRate(100.0, "kg/hr");
gasToDebutanizerStream.run();

gasToDebutanizerStream.getFluid().prettyPrint();
// gasToDebutanizerStream.getFluid().prettyPrint();

DistillationColumn column = new DistillationColumn(1, true, true);
column.setName("Deethanizer");
Expand All @@ -205,7 +206,6 @@ public void debutanizerTest() throws Exception {
column.setTopPressure(9.0);
column.setBottomPressure(13.0);
column.run();

// ((Condenser) column.getCondenser()).getProductOutStream().getFluid().prettyPrint();

// column.getReboiler().getLiquidOutStream().getFluid().prettyPrint();
Expand All @@ -215,6 +215,6 @@ public void debutanizerTest() throws Exception {
- ((Condenser) column.getCondenser()).getProductOutStream().getFlowRate("kg/hr"))
/ gasToDebutanizerStream.getFlowRate("kg/hr") * 100;

// assertEquals(0.0, massbalance, 0.2);
assertEquals(0.0, massbalance, 0.2);
}
}

0 comments on commit a160866

Please sign in to comment.