Skip to content

Commit

Permalink
refact: clean up setBeta/getBeta functions and docfix (#671)
Browse files Browse the repository at this point in the history
* refact: cleanup various setBeta stuff
  • Loading branch information
asmfstatoil authored and EvenSol committed May 22, 2023
1 parent db50378 commit d638646
Show file tree
Hide file tree
Showing 14 changed files with 151 additions and 171 deletions.
7 changes: 3 additions & 4 deletions src/main/java/neqsim/dataPresentation/SampleXYDataSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@

/**
* A dummy data source for an XY plot.
* <P>
*
* <p>
* Note that the aim of this class is to create a self-contained data source for demo purposes - it
* is NOT intended to show how you should go about writing your own data sources.
*
* @author asmund
* @version $Id: $Id
* </p>
*/
public class SampleXYDataSource {
double[][] points;
Expand Down
26 changes: 0 additions & 26 deletions src/main/java/neqsim/dataPresentation/userInterface.java

This file was deleted.

8 changes: 4 additions & 4 deletions src/main/java/neqsim/thermo/component/Component.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ abstract class Component implements ComponentInterface {
private double triplePointTemperature = 1000.0;
double meltingPointTemperature = 110.0;
private double idealGasEnthalpyOfFormation = 0.0;
double idealGasGibsEnergyOfFormation = 0.0;
double idealGasGibbsEnergyOfFormation = 0.0;

double idealGasAbsoluteEntropy = 0.0;

Expand Down Expand Up @@ -363,7 +363,7 @@ public void createComponent(String component_name, double moles, double molesInP

setIdealGasEnthalpyOfFormation(
Double.parseDouble(dataSet.getString("EnthalpyOfFormation")));
idealGasGibsEnergyOfFormation = gibbsEnergyOfFormation;
idealGasGibbsEnergyOfFormation = gibbsEnergyOfFormation;
idealGasAbsoluteEntropy = Double.parseDouble(dataSet.getString("AbsoluteEntropy"));

for (int i = 0; i < 5; i++) {
Expand Down Expand Up @@ -656,8 +656,8 @@ public final double getIdealGasEnthalpyOfFormation() {

/** {@inheritDoc} */
@Override
public final double getIdealGasGibsEnergyOfFormation() {
return idealGasGibsEnergyOfFormation;
public final double getIdealGasGibbsEnergyOfFormation() {
return idealGasGibbsEnergyOfFormation;
}

/** {@inheritDoc} */
Expand Down
15 changes: 14 additions & 1 deletion src/main/java/neqsim/thermo/component/ComponentInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -685,8 +685,21 @@ public default double getTripplePointDensity() {
* </p>
*
* @return a double
* @deprecated Replaced by {@link getIdealGasGibbsEnergyOfFormation}
*/
public double getIdealGasGibsEnergyOfFormation();
@Deprecated
public default double getIdealGasGibsEnergyOfFormation() {
return getIdealGasGibbsEnergyOfFormation();
}

/**
* <p>
* getIdealGasGibsEnergyOfFormation.
* </p>
*
* @return a double
*/
public double getIdealGasGibbsEnergyOfFormation();

/**
* <p>
Expand Down
22 changes: 14 additions & 8 deletions src/main/java/neqsim/thermo/phase/Phase.java
Original file line number Diff line number Diff line change
Expand Up @@ -1612,12 +1612,6 @@ public final double getPhaseFraction() {
return getBeta();
}

/** {@inheritDoc} */
@Override
public final double getBeta() {
return this.beta;
}

/** {@inheritDoc} */
@Override
public double getdPdrho() {
Expand Down Expand Up @@ -1922,8 +1916,20 @@ public double[] groupTBPfractions() {

/** {@inheritDoc} */
@Override
public final void setBeta(double beta) {
this.beta = beta;
public final double getBeta() {
return this.beta;
}

/** {@inheritDoc} */
@Override
public final void setBeta(double b) {
if (b < 0) {
b = neqsim.thermo.ThermodynamicModelSettings.phaseFractionMinimumLimit;
}
if (b > 1) {
b = 1.0 - neqsim.thermo.ThermodynamicModelSettings.phaseFractionMinimumLimit;
}
this.beta = b;
}

/** {@inheritDoc} */
Expand Down
25 changes: 13 additions & 12 deletions src/main/java/neqsim/thermo/phase/PhaseInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -590,16 +590,6 @@ public default double getExessGibbsEnergySymetric() {
*/
public double getSresTP();

/**
* <p>
* Setter for property <code>beta</code>. Beta is the mole fraction of a phase of all the moles of
* a system.
* </p>
*
* @param b Beta value to set.
*/
public void setBeta(double b);

/**
* <p>
* setProperties. Transfer properties from another phase object.
Expand Down Expand Up @@ -629,13 +619,24 @@ public default double getExessGibbsEnergySymetric() {

/**
* <p>
* getBeta.
* Getter for property <code>beta</code>. Beta is the mole fraction of a phase of all the moles of
* a system.
* </p>
*
* @return a double
* @return Beta value
*/
public double getBeta();

/**
* <p>
* Setter for property <code>beta</code>. Beta is the mole fraction of a phase of all the moles of
* a system.
* </p>
*
* @param b Beta value to set.
*/
public void setBeta(double b);

/**
* <p>
* getWtFrac.
Expand Down
Loading

0 comments on commit d638646

Please sign in to comment.