diff --git a/src/main/java/neqsim/thermo/component/ComponentGeDuanSun.java b/src/main/java/neqsim/thermo/component/ComponentGeDuanSun.java index d2dfb40cd9..eff4dd2b7b 100644 --- a/src/main/java/neqsim/thermo/component/ComponentGeDuanSun.java +++ b/src/main/java/neqsim/thermo/component/ComponentGeDuanSun.java @@ -33,6 +33,32 @@ public ComponentGeDuanSun(String name, double moles, double molesInPhase, int co super(name, moles, molesInPhase, compIndex); } + /** + *

+ * getGamma. + *

+ * + * @param phase a {@link neqsim.thermo.phase.PhaseInterface} object + * @param numberOfComponents a int + * @param temperature a double + * @param pressure a double + * @param pt the PhaseType of the phase. + * @param HValpha an array of {@link double} objects + * @param HVgij an array of {@link double} objects + * @return a double + */ + public double getGamma(PhaseInterface phase, int numberOfComponents, double temperature, + double pressure, PhaseType pt, double[][] HValpha, double[][] HVgij) { + if (componentName.equals("CO2")) { + return 0.9; + } else if (componentName.equals("water")) { + return 1.0; + } else { + return 1.0; + } + } + + /** {@inheritDoc} */ @Override public double getGamma(PhaseInterface phase, int numberOfComponents, double temperature, @@ -262,31 +288,6 @@ public double getGammaNRTL(PhaseInterface phase, int numberOfComponents, double return gamma; } - /** - *

- * getGamma. - *

- * - * @param phase a {@link neqsim.thermo.phase.PhaseInterface} object - * @param numberOfComponents a int - * @param temperature a double - * @param pressure a double - * @param pt the PhaseType of the phase. - * @param HValpha an array of {@link double} objects - * @param HVgij an array of {@link double} objects - * @return a double - */ - public double getGamma(PhaseInterface phase, int numberOfComponents, double temperature, - double pressure, PhaseType pt, double[][] HValpha, double[][] HVgij) { - if (componentName.equals("CO2")) { - return 0.9; - } else if (componentName.equals("water")) { - return 1.0; - } else { - return 1.0; - } - } - /* * public double getHenryCoef(double temperature) { // System.out.println("henry " + // * Math.exp(henryCoefParameter[0]+henryCoefParameter[1]/temperature+ diff --git a/src/main/java/neqsim/thermo/component/ComponentHydrate.java b/src/main/java/neqsim/thermo/component/ComponentHydrate.java index 10da952f7d..f95b061fb2 100644 --- a/src/main/java/neqsim/thermo/component/ComponentHydrate.java +++ b/src/main/java/neqsim/thermo/component/ComponentHydrate.java @@ -507,25 +507,25 @@ public void setDGfHydrate(double dGfHydrate, int i) { /** *

- * Setter for the field dHfHydrate. + * Getter for the field dHfHydrate. *

* - * @param dHfHydrate a double - * @param i a int + * @return an array of {@link double} objects */ - public void setDHfHydrate(double dHfHydrate, int i) { - this.dHfHydrate[i] = dHfHydrate; + public double[] getDHfHydrate() { + return dHfHydrate; } /** *

- * Getter for the field dHfHydrate. + * Setter for the field dHfHydrate. *

* - * @return an array of {@link double} objects + * @param dHfHydrate a double + * @param i a int */ - public double[] getDHfHydrate() { - return dHfHydrate; + public void setDHfHydrate(double dHfHydrate, int i) { + this.dHfHydrate[i] = dHfHydrate; } /** diff --git a/src/main/java/neqsim/thermo/phase/Phase.java b/src/main/java/neqsim/thermo/phase/Phase.java index 72ec94d81f..0e1ff98418 100644 --- a/src/main/java/neqsim/thermo/phase/Phase.java +++ b/src/main/java/neqsim/thermo/phase/Phase.java @@ -130,7 +130,7 @@ public void addComponent(String name, double moles) { /** {@inheritDoc} */ @Override - public void removeComponent(String name, double moles, double molesInPhase, int compNumber) { + public void removeComponent(String name, double moles, double molesInPhase) { name = ComponentInterface.getComponentNameFromAlias(name); ArrayList temp = new ArrayList(); diff --git a/src/main/java/neqsim/thermo/phase/PhaseInterface.java b/src/main/java/neqsim/thermo/phase/PhaseInterface.java index 42e1505986..3e40766c0b 100644 --- a/src/main/java/neqsim/thermo/phase/PhaseInterface.java +++ b/src/main/java/neqsim/thermo/phase/PhaseInterface.java @@ -418,15 +418,14 @@ public void init(double totalNumberOfMoles, int numberOfComponents, int initType /** *

- * removeComponent. + * Remove component from Phase. *

* * @param name Name of component. * @param moles Total number of moles of component. * @param molesInPhase Number of moles in phase. - * @param compNumber Index number of component in phase object component array. */ - public void removeComponent(String name, double moles, double molesInPhase, int compNumber); + public void removeComponent(String name, double moles, double molesInPhase); /** *

diff --git a/src/main/java/neqsim/thermo/system/SystemThermo.java b/src/main/java/neqsim/thermo/system/SystemThermo.java index bfb549636c..1bd0a3fa2f 100644 --- a/src/main/java/neqsim/thermo/system/SystemThermo.java +++ b/src/main/java/neqsim/thermo/system/SystemThermo.java @@ -1360,12 +1360,10 @@ public void removeComponent(String name) { getTotalNumberOfMoles() - phaseArray[0].getComponent(name).getNumberOfmoles()); for (int i = 0; i < getMaxNumberOfPhases(); i++) { getPhase(i).removeComponent(name, getTotalNumberOfMoles(), - phaseArray[phaseIndex[i]].getComponent(name).getNumberOfMolesInPhase(), - phaseArray[phaseIndex[i]].getComponent(name).getComponentNumber()); + getPhase(i).getComponent(name).getNumberOfMolesInPhase()); } componentNames.remove(name); - // System.out.println("removing " + componentNames.toString()); numberOfComponents--; }