Skip to content

Commit

Permalink
remove seldom used libraries from fatjar (#294)
Browse files Browse the repository at this point in the history
* Update pom.xml

* updates to energy calc of stream
  • Loading branch information
EvenSol authored Jan 20, 2022
1 parent dcae636 commit 5a6cbd4
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 4 deletions.
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<groupId>colt</groupId>
<artifactId>colt</artifactId>
<version>1.2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
Expand All @@ -73,6 +74,7 @@
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
<version>1.4.8</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>gov.nist.math</groupId>
Expand All @@ -88,6 +90,7 @@
<groupId>org.jfree</groupId>
<artifactId>jfreechart</artifactId>
<version>1.5.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.googlecode.matrix-toolkits-java</groupId>
Expand All @@ -99,16 +102,19 @@
<groupId>edu.ucar</groupId>
<artifactId>netcdf4</artifactId>
<version>4.6.16.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.ojalgo</groupId>
<artifactId>ojalgo</artifactId>
<version>48.4.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>edu.wisc.ssec</groupId>
<artifactId>visad</artifactId>
<version>2.0-20130124</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import neqsim.processSimulation.processEquipment.ProcessEquipmentBaseClass;
import neqsim.standards.gasQuality.Standard_ISO6976;
import neqsim.standards.gasQuality.Standard_ISO6976_2016;
import neqsim.thermo.system.SystemInterface;
import neqsim.thermodynamicOperations.ThermodynamicOperations;

Expand Down Expand Up @@ -489,19 +490,17 @@ public Object getProperty(String propertyName, String unit, String phase, String
public double GCV() {
Standard_ISO6976 standard = new Standard_ISO6976(thermoSystem.clone(), 0, 15.55, "volume");
standard.setReferenceState("real");
standard.setReferenceType("molar");
standard.calculate();
return standard.getValue("GCV") * 1.0e3 / 42.2949;
return standard.getValue("GCV") * 1.0e3;
}

/** {@inheritDoc} */
@Override
public double LCV() {
Standard_ISO6976 standard = new Standard_ISO6976(thermoSystem.clone(), 0, 15.55, "volume");
standard.setReferenceState("real");
standard.setReferenceType("molar");
standard.calculate();
return standard.getValue("LCV") * 1.0e3 / 42.2949;
return standard.getValue("InferiorCalorificValue") * 1.0e3;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ public double getValue(String returnParameter, java.lang.String returnUnit) {
if (returnParameter.equals("GCV")) {
returnParameter = "SuperiorCalorificValue";
}
if (returnParameter.equals("LCV")) {
returnParameter = "InferiorCalorificValue";
}

double returnValue = 0.0;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/**
*
*/
package neqsim.processSimulation.processEquipment.stream;

import static org.junit.jupiter.api.Assertions.*;

import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import neqsim.processSimulation.processSystem.ProcessSystem;
import neqsim.standards.gasQuality.Standard_ISO6976;
import neqsim.thermo.system.SystemSrkEos;
import neqsim.thermo.system.SystemSrkEos;
import neqsim.processSimulation.processEquipment.stream.Stream;
import neqsim.processSimulation.processSystem.ProcessSystem;
/**
* @author ESOL
*
*/
class StreamTest {
static neqsim.thermo.system.SystemInterface testSystem = null;
double pressure_inlet = 85.0;
double temperature_inlet = 35.0;
double gasFlowRate = 5.0;
ProcessSystem processOps = null;
/**
* @throws java.lang.Exception
*/
@BeforeEach
public void setUpBeforeClass() throws Exception {
testSystem = new SystemSrkEos(298.0, 10.0);
testSystem.addComponent("methane", 100.0);
processOps = new ProcessSystem();
Stream inletStream = new Stream(testSystem);
inletStream.setName("inlet stream");
inletStream.setPressure(pressure_inlet, "bara");
inletStream.setTemperature(temperature_inlet, "C");
inletStream.setFlowRate(gasFlowRate, "MSm3/day");

processOps.add(inletStream);
processOps.run();
}

@Test
public void testLCV() {
processOps.run();
((Stream)processOps.getUnit("inlet stream")).LCV();
assertEquals(3.58980282482032E7, ((Stream)processOps.getUnit("inlet stream")).LCV(), 1.0);
// 18978 J/Sm3
}

}

0 comments on commit 5a6cbd4

Please sign in to comment.