Skip to content

Commit

Permalink
refact: replace numeric mixingrule with enum type (#1248)
Browse files Browse the repository at this point in the history
* feat: introduce MixingRulesInterface* refact: get eosmixingruletype
* refact: use eosmixingruletype

* fix: add CLASSIC_HV

* doc: remove wrong doc

* doc: fix variable name

, getName()
  • Loading branch information
asmfstatoil authored Jan 9, 2025
1 parent b89ffb9 commit 58c04dd
Show file tree
Hide file tree
Showing 33 changed files with 364 additions and 195 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ public default double getFlowRate(String unit) {
*/
public double getRVP(double referenceTemperature, String unit, String returnUnit);


/**
* Calculates the Reid Vapor Pressure (RVP) of the stream.
*
Expand Down Expand Up @@ -321,7 +320,6 @@ public double getRVP(double referenceTemperature, String unit, String returnUnit
@Override
public int hashCode();


/**
* Calculates the hydrocarbon dew point of the stream.
*
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/neqsim/thermo/characterization/LumpingModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,41 +50,49 @@ public class StandardLumpingModel

public StandardLumpingModel() {}

/** {@inheritDoc} */
@Override
public void setNumberOfLumpedComponents(int lumpedNumb) {
numberOfLumpedComponents = lumpedNumb;
}

/** {@inheritDoc} */
@Override
public int getNumberOfLumpedComponents() {
return numberOfLumpedComponents;
}

/** {@inheritDoc} */
@Override
public void setNumberOfPseudoComponents(int lumpedNumb) {
numberOfPseudocomponents = lumpedNumb;
}

/** {@inheritDoc} */
@Override
public int getNumberOfPseudoComponents() {
return numberOfPseudocomponents;
}

/** {@inheritDoc} */
@Override
public String getName() {
return name;
}

/** {@inheritDoc} */
@Override
public String getLumpedComponentName(int i) {
return lumpedComponentNames[i];
}

/** {@inheritDoc} */
@Override
public String[] getLumpedComponentNames() {
return lumpedComponentNames;
}

/** {@inheritDoc} */
@Override
public void generateLumpedComposition(Characterise charac) {
numberOfLumpedComponents = numberOfPseudocomponents;
Expand Down Expand Up @@ -196,6 +204,7 @@ public void generateLumpedComposition(Characterise charac) {
}
}

/** {@inheritDoc} */
@Override
public double getFractionOfHeavyEnd(int i) {
if (fractionOfHeavyEnd == null) {
Expand All @@ -220,6 +229,7 @@ public class PVTLumpingModel extends StandardLumpingModel {

public PVTLumpingModel() {}

/** {@inheritDoc} */
@Override
public void generateLumpedComposition(Characterise charac) {
double weightFrac = 0.0;
Expand Down Expand Up @@ -311,6 +321,7 @@ public void generateLumpedComposition(Characterise charac) {
system.init(0);
}

/** {@inheritDoc} */
@Override
public double getFractionOfHeavyEnd(int i) {
if (fractionOfHeavyEnd == null) {
Expand All @@ -334,6 +345,7 @@ public class NoLumpingModel extends StandardLumpingModel {

public NoLumpingModel() {}

/** {@inheritDoc} */
@Override
public void generateLumpedComposition(Characterise charac) {
numberOfPseudocomponents = charac.getPlusFractionModel().getLastPlusFractionNumber();
Expand Down Expand Up @@ -414,6 +426,7 @@ public void generateLumpedComposition(Characterise charac) {
system.init(0);
}

/** {@inheritDoc} */
@Override
public double getFractionOfHeavyEnd(int i) {
if (fractionOfHeavyEnd == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,13 @@ public String getName() {
return name;
}

/** {@inheritDoc} */
@Override
public double getMPlus() {
return MPlus;
}

/** {@inheritDoc} */
@Override
public double getZPlus() {
return zPlus;
Expand All @@ -119,36 +121,43 @@ public double getMaxPlusMolarMass() {
return maxPlusMolarMass;
}

/** {@inheritDoc} */
@Override
public double getNumberOfPlusPseudocomponents() {
return numberOfPlusPseudocomponents;
}

/** {@inheritDoc} */
@Override
public double[] getZ() {
return z;
}

/** {@inheritDoc} */
@Override
public double[] getM() {
return M;
}

/** {@inheritDoc} */
@Override
public double[] getDens() {
return dens;
}

/** {@inheritDoc} */
@Override
public double getDensPlus() {
return densPlus;
}

/** {@inheritDoc} */
@Override
public int getFirstPlusFractionNumber() {
return firstPlusFractionNumber;
}

/** {@inheritDoc} */
@Override
public int getFirstTBPFractionNumber() {
int firstTBPNumber = 0;
Expand All @@ -174,16 +183,19 @@ public int getFirstTBPFractionNumber() {
return firstTBPNumber;
}

/** {@inheritDoc} */
@Override
public int getPlusComponentNumber() {
return plusComponentNumber;
}

/** {@inheritDoc} */
@Override
public int getLastPlusFractionNumber() {
return lastPlusFractionNumber;
}

/** {@inheritDoc} */
@Override
public boolean hasPlusFraction() {
for (int i = 0; i < system.getPhase(0).getNumberOfComponents(); i++) {
Expand All @@ -198,6 +210,7 @@ public boolean hasPlusFraction() {
return false;
}

/** {@inheritDoc} */
@Override
public boolean characterizePlusFraction(TBPModelInterface TBPModel) {
system.init(0);
Expand Down Expand Up @@ -242,11 +255,13 @@ public boolean characterizePlusFraction(TBPModelInterface TBPModel) {
return true;
}

/** {@inheritDoc} */
@Override
public double[] getCoefs() {
return this.coefs;
}

/** {@inheritDoc} */
@Override
public double getCoef(int i) {
return this.coefs[i];
Expand Down Expand Up @@ -298,6 +313,7 @@ public void setCoefs(double coef, int i) {
this.coefs[i] = coef;
}

/** {@inheritDoc} */
@Override
public void setLastPlusFractionNumber(int fract) {
lastPlusFractionNumber = fract + 1;
Expand Down Expand Up @@ -392,6 +408,7 @@ public void densityUOP() {
}
}

/** {@inheritDoc} */
@Override
public boolean characterizePlusFraction(TBPModelInterface TBPModel) {
system.init(0);
Expand Down Expand Up @@ -451,11 +468,13 @@ public double[] getGammaParameters() {
return new double[] {this.alfa, this.eta};
}

/** {@inheritDoc} */
@Override
public double[] getCoefs() {
return new double[] {alfa, eta};
}

/** {@inheritDoc} */
@Override
public double getCoef(int i) {
if (i == 0)
Expand All @@ -465,16 +484,19 @@ public double getCoef(int i) {
return 0;
}

/** {@inheritDoc} */
@Override
public double[] getZ() {
return zValues;
}

/** {@inheritDoc} */
@Override
public double[] getM() {
return molarMasses;
}

/** {@inheritDoc} */
@Override
public double[] getDens() {
return densities;
Expand Down
Loading

0 comments on commit 58c04dd

Please sign in to comment.