Skip to content

Commit

Permalink
fix for Java 8
Browse files Browse the repository at this point in the history
  • Loading branch information
EvenSol committed Nov 16, 2024
1 parent 7626625 commit 1721a2f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package neqsim.thermodynamicoperations.flashops;

import Jama.Matrix;
import neqsim.thermo.component.ComponentInterface;
import neqsim.thermo.system.SystemInterface;

/**
Expand Down Expand Up @@ -56,7 +57,7 @@ public void setfvec() {
double gasConstant = neqsim.thermo.ThermodynamicConstantsInterface.R;

for (int i = 0; i < numComponents; i++) {
var component = localSystem.getPhases()[0].getComponents()[i];
ComponentInterface component = (ComponentInterface) localSystem.getPhase(0).getComponent(i);
double fugacityCoeff = component.getFugacityCoefficient();
double componentX = component.getx();
double pressure = localSystem.getPressure();
Expand Down Expand Up @@ -127,7 +128,7 @@ public void setNewX() {
double relaxationFactor = 0.8; // Relaxation factor for numerical stability

for (int i = 0; i < numComponents; i++) {
var component = localSystem.getPhase(0).getComponent(i);
ComponentInterface component = (ComponentInterface) localSystem.getPhase(0).getComponent(i);
double newX = component.getx() - relaxationFactor * dx.get(i, 0);
component.setx(newX);
}
Expand Down

0 comments on commit 1721a2f

Please sign in to comment.