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

fixed bug and added test #821

Merged
merged 1 commit into from
Sep 22, 2023
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 @@ -129,7 +129,7 @@ public HashMap<String, double[]> calculate() {
Z[i] = fluid.getZ();
viscosity[i] = fluid.getViscosity("cP");
enthalpy[i] = fluid.getEnthalpy("J/mol");
entropy[i] = fluid.getEnthalpy("J/molK");
entropy[i] = fluid.getEntropy("J/molK");
Cp[i] = fluid.getCp("kJ/kgK");
Cv[i] = fluid.getCp("kJ/kgK");
density[i] = fluid.getDensity("kg/m3");
Expand Down
36 changes: 36 additions & 0 deletions src/test/java/neqsim/util/generator/PropertyGeneratorTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package neqsim.util.generator;

import org.junit.jupiter.api.Test;
import neqsim.thermo.system.SystemInterface;
import neqsim.thermo.system.SystemSrkEos;

public class PropertyGeneratorTest {
@Test
void testCalculate() {

SystemInterface fluid = new SystemSrkEos(273.15 + 45.0, 22.0);
fluid.addComponent("water", 0.1);
fluid.addComponent("nitrogen", 0.02);
fluid.addComponent("CO2", 0.03);
fluid.addComponent("H2S", 0.01);
fluid.addComponent("methane", 0.80);
fluid.addComponent("ethane", 0.04);
fluid.addComponent("propane", 0.03);
fluid.addComponent("i-butane", 0.02);
fluid.addComponent("n-butane", 0.01);
fluid.addComponent("i-pentane", 0.01);
fluid.addComponent("n-pentane", 0.01);
fluid.addComponent("n-hexane", 0.01);
fluid.addComponent("nC10", 0.1);
fluid.setMixingRule(2);
fluid.useVolumeCorrection(true);
fluid.setMultiPhaseCheck(true);

double[] temps = new double[] {280.0, 290.0};
double[] pres = new double[] {10.0, 20.0};
PropertyGenerator generator = new PropertyGenerator(fluid, temps, pres);
generator.calculate();


}
}
Loading