Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
asmfstatoil committed Feb 22, 2024
1 parent 767c583 commit 081201f
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,7 @@ public double step() {
double[] n_omega = new double[NSPEC];
double[] chem_pot_omega = new double[NSPEC];
double[] chem_pot = new double[NSPEC];
double G_1;

double G_0;
check = 0;
step = 1;

Expand All @@ -262,8 +260,8 @@ public double step() {
}
}

G_1 = 0;

double G_0;
double G_1 = 0;
for (i = 0; i < NSPEC; i++) {
G_1 += chem_pot_omega[i] * d_n[i];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public Viscosity clone() {
public double calcViscosity() {
double tempVar = 0;
double tempVar2 = 0;
double viscosity = 0;
this.calcPureComponentViscosity();

// method og Grunberg and Nissan [87]
Expand All @@ -85,7 +84,7 @@ public double calcViscosity() {
// liquidPhase.getPhase().getComponents()[i].getx()*liquidPhase.getPhase().getComponents()[j].getx()*liquidPhase.getMixingRule().getViscosityGij(i,j);
}
}
viscosity = Math.exp(tempVar + tempVar2) / 1.0e3; // N-sek/m2
double viscosity = Math.exp(tempVar + tempVar2) / 1.0e3; // N-sek/m2
return viscosity;
}

Expand Down
12 changes: 5 additions & 7 deletions src/main/java/neqsim/standards/Standard.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,20 +111,18 @@ public void setStandardDescription(String standardDescription) {
/** {@inheritDoc} */
@Override
public String[][] createTable(String name) {
if (thermoSystem == null) {
String[][] table = new String[0][6];
return table;
}
thermoSystem.setNumberOfPhases(1);
thermoSystem.createTable(name);

DecimalFormat nf = new DecimalFormat();
nf.setMaximumFractionDigits(5);
nf.applyPattern("#.#####E0");

int rows = 0;
if (thermoSystem == null) {
String[][] table = new String[0][6];
return table;
}

rows = thermoSystem.getPhases()[0].getNumberOfComponents() + 30;
int rows = thermoSystem.getPhases()[0].getNumberOfComponents() + 30;
String[][] table = new String[rows][6];
// String[] names = {"", "Phase 1", "Phase 2", "Phase 3", "Unit"};
table[0][0] = ""; // getPhases()[0].getType(); //"";
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/neqsim/thermo/system/SystemThermo.java
Original file line number Diff line number Diff line change
Expand Up @@ -3622,6 +3622,9 @@ public String[][] createTable(String name) {
/** {@inheritDoc} */
@Override
public void display(String name) {
if (this.getNumberOfComponents() == 0) {
return;
}
javax.swing.JFrame dialog = new javax.swing.JFrame("System-Report");
java.awt.Dimension screenDimension = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
java.awt.Container dialogContentPane = dialog.getContentPane();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,7 @@ void testCalculate2() {

@Test
void testDisplay() {
Standard_ISO6976 s = new Standard_ISO6976(null);
s.display("test");

s = new Standard_ISO6976(testSystem);
Standard_ISO6976 s = new Standard_ISO6976(testSystem);
s.display("test");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,7 @@ void testCalculate2() {

@Test
void testDisplay() {
Standard_ISO6976_2016 s = new Standard_ISO6976_2016(null);
s.display("test");

s = new Standard_ISO6976_2016(testSystem);
Standard_ISO6976_2016 s = new Standard_ISO6976_2016(testSystem);
s.display("test");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,5 @@ void testDisplay() {

BaseContract bc = new BaseContract();
bc.display();

bc = new BaseContract(null);
bc.display();
}
}

0 comments on commit 081201f

Please sign in to comment.