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

Fix bug teg mla #858

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,6 @@ public void stabilityAnalysis3() {
if (iter <= maxsucssubiter || !system.isImplementedCompositionDeriativesofFugacity()) {
if (iter % 7 == 0 && useaccsubst) {
double vec1 = 0.0;

double vec2 = 0.0;
double prod1 = 0.0;
double prod2 = 0.0;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
package neqsim.processSimulation.processSystem;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.security.AnyTypePermission;
import neqsim.processSimulation.measurementDevice.WaterDewPointAnalyser;
import neqsim.processSimulation.processEquipment.absorber.SimpleTEGAbsorber;
import neqsim.processSimulation.processEquipment.absorber.WaterStripperColumn;
Expand Down Expand Up @@ -349,5 +356,35 @@ public void runProcessTEG() throws InterruptedException {
} catch (Exception ex) {
logger.error("Something failed");
}

Assertions.assertEquals(makeupTEG.getFlowRate("kg/hr"), 0.37380397787296316);
}

@Test
void testRunNEQSIMAPI() {
XStream xstream = new XStream();
xstream.addPermission(AnyTypePermission.ANY);
// Specify the file path to read

Path filePath = Paths.get(
"/workspaces/neqsim/src/test/java/neqsim/processSimulation/processSystem/my_process_TEG.xml");
String xmlContents = "";
try {
xmlContents = new String(Files.readAllBytes(filePath));
} catch (IOException e) {
e.printStackTrace();
}

// Deserialize from xml
neqsim.processSimulation.processSystem.ProcessSystem operationsCopy =
(neqsim.processSimulation.processSystem.ProcessSystem) xstream.fromXML(xmlContents);
operationsCopy.run();
neqsim.processSimulation.processEquipment.stream.Stream makeUpTEG =
(neqsim.processSimulation.processEquipment.stream.Stream) operationsCopy
.getUnit("makeup TEG");
Assertions.assertEquals(makeUpTEG.getFlowRate("kg/hr"), 0.22761215378293284);

}


}
Loading
Loading