Skip to content

Commit

Permalink
refact: replace byValue with enums
Browse files Browse the repository at this point in the history
  • Loading branch information
asmfstatoil committed Jan 11, 2025
1 parent 0fe37d1 commit 49a79da
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/main/java/neqsim/thermo/phase/PhaseEos.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void init(double totalNumberOfMoles, int numberOfComponents, int initType
pt = PhaseType.LIQUID;
}
if (!isMixingRuleDefined()) {
setMixingRule(EosMixingRuleType.byValue(1));
setMixingRule(EosMixingRuleType.NO);
}

super.init(totalNumberOfMoles, numberOfComponents, initType, pt, beta);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/neqsim/thermo/phase/PhaseGE.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public void setMixingRule(MixingRuleTypeInterface mr) {
throw new RuntimeException(
new neqsim.util.exception.InvalidInputException(this, "setMixingRule", "mr"));
}
mixingRuleType = EosMixingRuleType.byValue(2);
mixingRuleType = EosMixingRuleType.CLASSIC);
mixRule = mixSelect.getMixingRule(mixingRuleType.getValue(), this);
}

Expand All @@ -155,7 +155,7 @@ public void resetMixingRule(MixingRuleTypeInterface mr) {
new neqsim.util.exception.InvalidInputException(this, "resetMixingRule", "mr"));
}
// NB! Ignores input mr
mixingRuleType = EosMixingRuleType.byValue(2);
mixingRuleType = EosMixingRuleType.CLASSIC;
mixRule = mixSelect.resetMixingRule(mixingRuleType.getValue(), this);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/neqsim/thermo/phase/PhaseGENRTL.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public PhaseGENRTL(PhaseInterface phase, double[][] alpha, double[][] Dij, Strin
phase.getComponent(i).getNumberOfmoles(), phase.getComponent(i).getNumberOfMolesInPhase(),
phase.getComponent(i).getComponentNumber());
}
setMixingRule(EosMixingRuleType.byValue(2));
setMixingRule(EosMixingRuleType.CLASSIC);
}

/** {@inheritDoc} */
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/neqsim/thermo/phase/PhaseGEUnifacPSRK.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public PhaseGEUnifacPSRK(PhaseInterface phase, double[][] alpha, double[][] Dij,
phase.getComponent(i).getNumberOfmoles(), phase.getComponent(i).getNumberOfMolesInPhase(),
phase.getComponent(i).getComponentNumber());
}
this.setMixingRule(EosMixingRuleType.byValue(2));
this.setMixingRule(EosMixingRuleType.CLASSIC);
}

/** {@inheritDoc} */
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/neqsim/thermo/phase/PhaseGEUnifacUMRPRU.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public PhaseGEUnifacUMRPRU(PhaseInterface phase, double[][] alpha, double[][] Di
phase.getComponent(i).getComponentNumber());
componentArray[i].setAttractiveTerm(phase.getComponent(i).getAttractiveTermNumber());
}
this.setMixingRule(EosMixingRuleType.byValue(2));
this.setMixingRule(EosMixingRuleType.CLASSIC);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void testRun() {
testSystem.addComponent("MEG", 0.000001);
testSystem.addComponent("water", 0.0010);
testSystem.createDatabase(true);
testSystem.setMixingRule(EosMixingRuleType.byValue(10));
testSystem.setMixingRule(EosMixingRuleType.CLASSIC_TX_CPA);

testSystem.init(0);
testSystem.setMultiPhaseCheck(true);
Expand Down

0 comments on commit 49a79da

Please sign in to comment.