-
Notifications
You must be signed in to change notification settings - Fork 30
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
refact: getPhases()[k] -> getPhase(k) #1190
base: master
Are you sure you want to change the base?
Conversation
dd8797c
to
2a66106
Compare
2a66106
to
ec36cf4
Compare
} | ||
system.init(1); | ||
// logger.info("solid phase will form..." + system.getNumberOfPhases()); | ||
// logger.info("freezing component " + solid); | ||
system.setBeta(system.getNumberOfPhases() - 1, frac); | ||
system.initBeta(); | ||
system.setBeta(system.getNumberOfPhases() - 1, | ||
system.getPhases()[3].getComponent(solid).getNumberOfmoles() | ||
/ system.getNumberOfMoles()); | ||
system.getPhase(3).getComponent(solid).getNumberOfmoles() / system.getNumberOfMoles()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case I beleive we have to used system.getPhases()[3] - as the solid phase is always number three (and getPhase(3) can point to a different phase.
@@ -397,36 +397,35 @@ public void solidPhaseFlash() { | |||
tempVar[k] = system.getPhase(0).getComponent(k).getz(); | |||
for (int i = 0; i < system.getNumberOfPhases() - 1; i++) { | |||
tempVar[k] -= | |||
system.getBeta(i) * system.getPhases()[3].getComponent(k).getFugacityCoefficient() | |||
system.getBeta(i) * system.getPhase(3).getComponent(k).getFugacityCoefficient() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case I beleive we have to used system.getPhases()[3] - as the solid phase is always number three (and getPhase(3) can point to a different phase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thin every time we need to use solid phases like solid, hdyrate etc., we need to use the phase array.
/ system.getPhase(i).getComponent(k).getFugacityCoefficient(); | ||
} | ||
|
||
if (tempVar[k] > 0.0 && tempVar[k] > frac) { | ||
solidPhase = true; | ||
solid = k; | ||
frac = tempVar[k]; | ||
for (int p = 0; p < system.getPhases()[0].getNumberOfComponents(); p++) { | ||
system.getPhases()[3].getComponent(p).setx(1.0e-20); | ||
for (int p = 0; p < system.getPhase(0).getNumberOfComponents(); p++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case I beleive we have to used system.getPhases()[3] - as the solid phase is always number three (and getPhase(3) can point to a different phase.
@@ -68,7 +68,7 @@ public void run() { | |||
* double solidEnthalpy = 0.0; | |||
* | |||
* if (system.doSolidPhaseCheck()) { system.init(3, 3); solidEnthalpy = | |||
* system.getPhases()[3].getEnthalpy() / system.getPhases()[3].getNumberOfMolesInPhase() | |||
* system.getPhase(3).getEnthalpy() / system.getPhase(3).getNumberOfMolesInPhase() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case I beleive we have to used system.getPhases()[3] - as the solid phase is always number three (and getPhase(3) can point to a different phase.
@@ -137,7 +137,7 @@ public void calcE() { | |||
// system.getBeta(system.getNumberOfPhases()-1) / | |||
// system.getPhase(3).getComponent(solidComponent).getFugacityCoefficient(); | |||
E[solidComponent] = system.getPhase(0).getComponent(solidComponent).getz() | |||
/ system.getPhases()[3].getComponents()[solidComponent].getFugacityCoefficient(); | |||
/ system.getPhase(3).getComponents()[solidComponent].getFugacityCoefficient(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case I beleive we have to used system.getPhases()[3] - as the solid phase is always number three (and getPhase(3) can point to a different phase.
1.0 - system.getPhases()[3].getComponents()[solidComponent].getFugacityCoefficient() | ||
/ system.getPhase(k).getComponent(solidComponent).getFugacityCoefficient(); | ||
for (int i = 0; i < system.getPhases()[0].getNumberOfComponents(); i++) { | ||
dQdbeta[k] = 1.0 - system.getPhase(3).getComponents()[solidComponent].getFugacityCoefficient() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case I beleive we have to used system.getPhases()[3] - as the solid phase is always number three (and getPhase(3) can point to a different phase.
if (i != solidIndex) { | ||
system.getPhase(k).getComponent(i).setx(system.getPhase(0).getComponent(i).getz() / E[i] | ||
/ system.getPhase(k).getComponent(i).getFugacityCoefficient()); | ||
} else { | ||
system.getPhase(k).getComponent(i) | ||
.setx(system.getPhases()[3].getComponent(i).getFugacityCoefficient() | ||
.setx(system.getPhase(3).getComponent(i).getFugacityCoefficient() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case I beleive we have to used system.getPhases()[3] - as the solid phase is always number three (and getPhase(3) can point to a different phase.
|
||
for (int k = 0; k < system.getPhase(0).getNumberOfComponents(); k++) { | ||
if (system.getTemperature() > system.getPhase(0).getComponent(k) | ||
.getTriplePointTemperature()) { | ||
solidCandidate[k] = -10; | ||
} else { | ||
solidCandidate[k] = system.getPhase(0).getComponent(k).getz(); | ||
system.getPhases()[3].getComponent(k).setx(1.0); | ||
system.getPhase(3).getComponent(k).setx(1.0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case I beleive we have to used system.getPhases()[3] - as the solid phase is always number three (and getPhase(3) can point to a different phase.
|
||
for (int i = 0; i < system.getNumberOfPhases(); i++) { | ||
solidCandidate[k] -= system.getPhases()[3].getComponent(k).fugcoef(system.getPhases()[3]) | ||
solidCandidate[k] -= system.getPhase(3).getComponent(k).fugcoef(system.getPhase(3)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case I beleive we have to used system.getPhases()[3] - as the solid phase is always number three (and getPhase(3) can point to a different phase.
/ system.getPhase(i).getComponent(k).getFugacityCoefficient(); | ||
} | ||
} | ||
} | ||
|
||
for (int i = 0; i < solidCandidate.length; i++) { | ||
if (solidCandidate[i] > 0.0) { | ||
system.getPhases()[3].getComponent(i).setx(1.0); | ||
system.getPhase(3).getComponent(i).setx(1.0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case I beleive we have to used system.getPhases()[3] - as the solid phase is always number three (and getPhase(3) can point to a different phase.
solidIndex = i; | ||
solidsNumber++; | ||
} else { | ||
system.getPhases()[3].getComponent(i).setx(0.0); | ||
system.getPhase(3).getComponent(i).setx(0.0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case I beleive we have to used system.getPhases()[3] - as the solid phase is always number three (and getPhase(3) can point to a different phase.
solidCandidate -= | ||
system.getPhases()[3].getComponent(solidIndex).fugcoef(system.getPhases()[3]) | ||
/ system.getPhase(i).getComponent(solidIndex).getFugacityCoefficient(); | ||
solidCandidate -= system.getPhase(3).getComponent(solidIndex).fugcoef(system.getPhase(3)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case I beleive we have to used system.getPhases()[3] - as the solid phase is always number three (and getPhase(3) can point to a different phase.
@@ -1184,7 +1184,7 @@ public void hydrateFormationTemperature(int structure) throws IsNaNException { | |||
} | |||
|
|||
for (int i = 0; i < system.getPhase(4).getNumberOfComponents(); i++) { | |||
((ComponentHydrate) system.getPhases()[4].getComponent(i)).setHydrateStructure(structure - 1); | |||
((ComponentHydrate) system.getPhase(4).getComponent(i)).setHydrateStructure(structure - 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case I beleive we have to used system.getPhases()[4] - as the hydrate phase is always number four (and getPhase(4) can point to a different phase.
} | ||
system.getPhases()[3].getComponents()[solid].setx(1.0); | ||
system.getPhase(3).getComponents()[solid].setx(1.0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case I beleive we have to used system.getPhases()[3] - as the solid phase is always number three (and getPhase(3) can point to a different phase.
No description provided.