Skip to content

Commit

Permalink
added improved TEG in gas calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
EvenSol committed Apr 13, 2022
1 parent ddfaa0d commit 3acd77f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,33 @@ public double calcY0() {
.getFugacityCoefficient());
return y0;
}

/**
* <p>
* calcY0TEG.
* </p>
*
* @return a double
*/
public double calcY0TEG() {
// double fugacityWaterLiquid =
// mixedStream.getThermoSystem().getPhase(1).getFugacity("water");
// double xrel =
// mixedStream.getFluid().getPhase(0).getComponent("water").getx()/solventInStream.getFluid().getPhase(0).getComponent("water").getx();
// double y0 =
// xrel*fugacityWaterLiquid/(mixedStream.getFluid().getPhase(0).getComponent("water").getFugacityCoefficient()*mixedStream.getFluid().getPressure());
//double oldTemp = mixedStream.getTemperature();
//mixedStream.setTemperature(solventInStream.getTemperature(),"K");
//mixedStream.getFluid().init(1);
double fugCoefRef = mixedStream.getThermoSystem().getPhase(1).getComponent("TEG")
.getFugacityCoefficient();
double y0TEG = solventInStream.getFluid().getPhase(0).getComponent("TEG").getx() * fugCoefRef
/ (mixedStream.getThermoSystem().getPhase(0).getComponent("TEG")
.getFugacityCoefficient());
//mixedStream.setTemperature(oldTemp, "K");
//mixedStream.getFluid().init(2);
return y0TEG;
}

/**
* <p>
Expand Down Expand Up @@ -325,7 +352,7 @@ public double calcNTU(double y0, double y1, double yb, double ymix) {
@Override
public void run() {
try {
double y0 = 0.0, y1 = 0.0;
double y0 = 0.0, y1 = 0.0, y0TEG=0.0;
// double yN = gasInStream.getThermoSystem().getPhase(0).getComponent("water").getx();
double absorptionEffiency = 0.0;
mixedStream.setThermoSystem((streams.get(0).getThermoSystem().clone()));
Expand All @@ -352,13 +379,18 @@ public void run() {
absorptionEffiency = calcEa();

y0 = calcY0();
y0TEG = calcY0TEG();
y1 = gasInStream.getThermoSystem().getPhase(0).getComponent("water").getx()
- absorptionEffiency * (gasInStream.getThermoSystem().getPhase(0)
.getComponent("water").getx() - y0);

double yMean = mixedStream.getThermoSystem().getPhase(0).getComponent("water").getx();
double molesWaterToMove = (yMean - y1)
* mixedStream.getThermoSystem().getPhase(0).getNumberOfMolesInPhase();
double yMeanTEG = mixedStream.getThermoSystem().getPhase(0).getComponent("TEG").getx();
double molesTEGToMove = (y0TEG-yMeanTEG)
* mixedStream.getThermoSystem().getPhase(0).getNumberOfMolesInPhase();

// System.out.println("Lean TEG to absorber "
// +solventInStream.getFlowRate("kg/hr"));

Expand All @@ -371,6 +403,8 @@ public void run() {
stream.setName("test");
stream.getThermoSystem().addComponent("water", -molesWaterToMove, 0);
stream.getThermoSystem().addComponent("water", molesWaterToMove, 1);
stream.getThermoSystem().addComponent("TEG", molesTEGToMove, 0);
stream.getThermoSystem().addComponent("TEG", -molesTEGToMove, 1);
stream.getThermoSystem().initBeta();
stream.getThermoSystem().init_x_y();
stream.getThermoSystem().init(2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,8 @@ public void runTEGProcessTest() {
operations.add(makeupTEG);
operations.add(makeupMixer);
operations.add(resycleLeanTEG);
//operations.run();
operations.run();
dehydratedGas.getFluid().display();
dehydratedGas.getFluid().display();
}
}

0 comments on commit 3acd77f

Please sign in to comment.