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

added composition init #761

Merged
merged 1 commit into from
Jul 7, 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
6 changes: 5 additions & 1 deletion src/main/java/neqsim/thermo/system/SystemThermo.java
Original file line number Diff line number Diff line change
Expand Up @@ -1788,6 +1788,9 @@ public void reset() {
/** {@inheritDoc} */
@Override
public void init(int type) {
if (!isInitialized) {
calc_x_y();
}
if (this.numericDerivatives) {
initNumeric(type);
} else {
Expand All @@ -1814,6 +1817,7 @@ public void init(int type, int phase) {
* calculate all derivatives and 4 to calculate all derivatives numerically
*/
public void initAnalytic(int type) {

if (type == 0) {
reInitPhaseInformation();

Expand Down Expand Up @@ -3387,7 +3391,7 @@ public void normalizeBeta() {
/** {@inheritDoc} */
@Override
public String[][] createTable(String name) {

if (!isInitialized) {
init_x_y();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ void testUpdate() {
SystemInterface testSystem = new SystemSrkEos(313.3, 10.01325);
ThermodynamicOperations testOps = new ThermodynamicOperations(testSystem);
StirredCell pipe1 = new StirredCell(2.0, 0.05);
//testSystem.addComponent("CO2", 1, "kg/hr", 0);
// testSystem.addComponent("CO2", 1, "kg/hr", 0);
testSystem.addComponent("methane", 10, "kg/hr", 0);
//testSystem.addComponent("ethane", 1, "kg/hr", 0);
//testSystem.addComponent("n-hexane", 1.206862204876, "kg/min", 0);
// testSystem.addComponent("ethane", 1, "kg/hr", 0);
// testSystem.addComponent("n-hexane", 1.206862204876, "kg/min", 0);
testSystem.addComponent("nC10", 3, "kg/hr", 1);
testSystem.setMixingRule(2);

//testSystem.prettyPrint();
testSystem.initProperties();

StirredCellNode test = new StirredCellNode(testSystem, pipe1);
test.setInterphaseModelType(1);
test.getFluidBoundary().useFiniteFluxCorrection(true);
Expand All @@ -35,6 +35,6 @@ void testUpdate() {
test.update();
// test.getBulkSystem().prettyPrint();
}
//test.getBulkSystem().prettyPrint();
// test.getBulkSystem().prettyPrint();
}
}