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

chore: commented out dead code #291

Merged
merged 2 commits into from
Jan 17, 2022
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 @@ -128,20 +128,16 @@ public double solveQ() {
minTemperature = system.getTemperature();
}

if (false && error * erorOld < 0) {
system.setTemperature(
(Math.abs(erorOld) * 1.0 / oldTemp + Math.abs(error) * 1.0 / nyTemp)
/ (Math.abs(erorOld) + Math.abs(error)));
tpFlash.run();
system.init(2);
erorOld = error;
error = calcdQdT();
System.out.println("reset temperature -- new temp " + system.getTemperature()
+ " error " + error + " iter " + iterations);
}
// error = Math.abs((1.0 / nyTemp - 1.0 / oldTemp) / (1.0 / oldTemp));
// System.out.println("temp " + system.getTemperature() + " iter "+ iterations +
// " error "+ error + " correction " + newCorr + " factor "+ factor);
/*
* if (false && error * erorOld < 0) { system.setTemperature( (Math.abs(erorOld) * 1.0 /
* oldTemp + Math.abs(error) * 1.0 / nyTemp) / (Math.abs(erorOld) + Math.abs(error)));
* tpFlash.run(); system.init(2); erorOld = error; error = calcdQdT();
* System.out.println("reset temperature -- new temp " + system.getTemperature() +
* " error " + error + " iter " + iterations); } error = Math.abs((1.0 / nyTemp - 1.0 /
* oldTemp) / (1.0 / oldTemp)); System.out.println("temp " + system.getTemperature() +
* " iter "+ iterations + " error "+ error + " correction " + newCorr + " factor "+
* factor);
*/
} while (((Math.abs(error) + Math.abs(erorOld)) > 1e-8 || iterations < 3)
&& iterations < 200);
// System.out.println("temp " + system.getTemperature() + " iter " + iterations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class PHflashGERG2008 extends Flash {
Flash tpFlash;
double enthalpy_GERG2008 = 0.0;
double cP_GERG2008 = 0.0;

/**
* <p>
* Constructor for PHflashGERG2008.
Expand Down Expand Up @@ -64,7 +65,7 @@ public double calcdQdTT() {
* @return a double
*/
public double calcdQdT() {
double dQ = (enthalpy_GERG2008 - Hspec) / Math.abs(Hspec);
double dQ = (enthalpy_GERG2008 - Hspec) / Math.abs(Hspec);
return dQ;
}

Expand Down Expand Up @@ -95,8 +96,9 @@ public double solveQ() {
iterations++;
oldTemp = nyTemp;
double[] gergProps = system.getPhase(0).getProperties_GERG2008();
cP_GERG2008 = gergProps[10]*system.getPhase(0).getNumberOfMolesInPhase(); // J/mol K
enthalpy_GERG2008 = gergProps[7]*system.getPhase(0).getNumberOfMolesInPhase(); // J/mol K
cP_GERG2008 = gergProps[10] * system.getPhase(0).getNumberOfMolesInPhase(); // J/mol K
enthalpy_GERG2008 = gergProps[7] * system.getPhase(0).getNumberOfMolesInPhase(); // J/mol
// K
newCorr = factor * calcdQdT() / calcdQdTT();
nyTemp = oldTemp - newCorr;
if (Math.abs(system.getTemperature() - 1.0 / nyTemp) > 10.0) {
Expand Down Expand Up @@ -127,18 +129,16 @@ public double solveQ() {
minTemperature = system.getTemperature();
}

if (false && error * erorOld < 0) {
system.setTemperature(
(Math.abs(erorOld) * 1.0 / oldTemp + Math.abs(error) * 1.0 / nyTemp)
/ (Math.abs(erorOld) + Math.abs(error)));
erorOld = error;
error = calcdQdT();
System.out.println("reset temperature -- new temp " + system.getTemperature()
+ " error " + error + " iter " + iterations);
}
// error = Math.abs((1.0 / nyTemp - 1.0 / oldTemp) / (1.0 / oldTemp));
// System.out.println("temp " + system.getTemperature() + " iter "+ iterations +
// " error "+ error + " correction " + newCorr + " factor "+ factor);
/*
* if (false && error * erorOld < 0) { system.setTemperature( (Math.abs(erorOld) * 1.0 /
* oldTemp + Math.abs(error) * 1.0 / nyTemp) / (Math.abs(erorOld) + Math.abs(error)));
* erorOld = error; error = calcdQdT();
* System.out.println("reset temperature -- new temp " + system.getTemperature() +
* " error " + error + " iter " + iterations); } // error = Math.abs((1.0 / nyTemp - 1.0
* / oldTemp) / (1.0 / oldTemp)); // System.out.println("temp " +
* system.getTemperature() + " iter "+ iterations + // " error "+ error + " correction "
* + newCorr + " factor "+ factor);
*/
} while (((Math.abs(error) + Math.abs(erorOld)) > 1e-8 || iterations < 3)
&& iterations < 200);
// System.out.println("temp " + system.getTemperature() + " iter " + iterations
Expand Down Expand Up @@ -171,9 +171,10 @@ public double solveQ2() {
iterations++;
oldTemp = nyTemp;
double[] gergProps = system.getPhase(0).getProperties_GERG2008();
cP_GERG2008 = gergProps[10]*system.getPhase(0).getNumberOfMolesInPhase(); // J/mol K
enthalpy_GERG2008 = gergProps[7]*system.getPhase(0).getNumberOfMolesInPhase(); // J/mol K

cP_GERG2008 = gergProps[10] * system.getPhase(0).getNumberOfMolesInPhase(); // J/mol K
enthalpy_GERG2008 = gergProps[7] * system.getPhase(0).getNumberOfMolesInPhase(); // J/mol
// K

newCorr = factor * calcdQdT() / calcdQdTT();
nyTemp = oldTemp - newCorr;
if (Math.abs(system.getTemperature() - 1.0 / nyTemp) > 10.0) {
Expand Down Expand Up @@ -206,12 +207,12 @@ public double solveQ2() {
@Override
public void run() {
tpFlash.run();
if(system.getNumberOfPhases()>1) {
logger.error("PSFlashGERG2008 only supprt single phase gas calculations");
return;
if (system.getNumberOfPhases() > 1) {
logger.error("PSFlashGERG2008 only support single phase gas calculations");
return;
}
solveQ();
system.init(3);
solveQ();
system.init(3);
}

/** {@inheritDoc} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,10 @@ public void initCalc() {

thermoOps.TPflash();

// GOR = thermoSystem.getPhase(0).getTotalVolume() / thermoSystem.getPhase(1).getTotalVolume();
// GLR = thermoSystem.getPhase(0).getTotalVolume() / thermoSystem.getPhase(1).getTotalVolume();
// GOR = thermoSystem.getPhase(0).getTotalVolume() /
// thermoSystem.getPhase(1).getTotalVolume();
// GLR = thermoSystem.getPhase(0).getTotalVolume() /
// thermoSystem.getPhase(1).getTotalVolume();
}

/**
Expand Down Expand Up @@ -427,8 +429,9 @@ public void run() {
k++;
} while (k < 9);// names[k] = "GAS DENSITY";
// units[k] = "KG/M3";
} else if (false && !hasGasValues) {
// startGasTemperatures = j;
/*
* } else if (false && !hasGasValues) { startGasTemperatures = j;
*/
} else {
gasSystem.setTemperature(temperatures[j]);
gasSystem.setPressure(pressures[i]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,10 @@ public void initCalc() {

thermoOps.TPflash();

// GOR = thermoSystem.getPhase(0).getTotalVolume() / thermoSystem.getPhase(1).getTotalVolume();
// GLR = thermoSystem.getPhase(0).getTotalVolume() / thermoSystem.getPhase(1).getTotalVolume();
// GOR = thermoSystem.getPhase(0).getTotalVolume() /
// thermoSystem.getPhase(1).getTotalVolume();
// GLR = thermoSystem.getPhase(0).getTotalVolume() /
// thermoSystem.getPhase(1).getTotalVolume();
}

/**
Expand Down Expand Up @@ -250,7 +252,7 @@ public void run() {
units = new String[nProps];
names = new String[nProps];

int startGasTemperatures = 0;
// int startGasTemperatures = 0;
boolean acceptedFlash = true;
for (int j = 0; j < temperatures.length; j++) {
thermoSystem.setTemperature(temperatures[j]);
Expand Down Expand Up @@ -395,9 +397,10 @@ public void run() {
k++;
} while (k < 9);// names[k] = "GAS DENSITY";
// units[k] = "KG/M3";
} else if (false && !hasGasValues) {
startGasTemperatures = j;
}
/*
* else if (false && !hasGasValues) { startGasTemperatures = j; }
*/
}
/*
* double[] gasVals = new double[9]; for (int kk = 0; kk < 9; kk++) { gasVals[kk] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,9 @@ public void run() {
k++;
} while (k < 9);// names[k] = "GAS DENSITY";
// units[k] = "KG/M3";
} else if (false && !hasGasValues) {
// startGasTemperatures = j;
/*
* } else if (false && !hasGasValues) { startGasTemperatures = j;
*/
} else {
gasSystem.setTemperature(temperatures[j]);
gasSystem.setPressure(pressures[i]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,9 @@ public void run() {
k++;
} while (k < 9);// names[k] = "GAS DENSITY";
// units[k] = "KG/M3";
} else if (false && !hasGasValues) {
// startGasTemperatures = j;
/*
* } else if (false && !hasGasValues) { startGasTemperatures = j;
*/
} else {
gasSystem.setTemperature(enthalpies[j]);
gasSystem.setPressure(pressures[i]);
Expand Down