Skip to content

Commit

Permalink
ref: rename classes
Browse files Browse the repository at this point in the history
  • Loading branch information
asmfstatoil committed Jan 9, 2025
1 parent d38fe96 commit 7b0706a
Show file tree
Hide file tree
Showing 12 changed files with 77 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@

/**
* <p>
* CPAMixing class.
* CPAMixingRules class.
* </p>
*
* @author Even Solbraa
* @version $Id: $Id
*/
public class CPAMixing implements Cloneable, ThermodynamicConstantsInterface {
public class CPAMixingRules implements Cloneable, ThermodynamicConstantsInterface {
/** Serialization version UID. */
private static final long serialVersionUID = 1000;
/** Logger object for class. */
static Logger logger = LogManager.getLogger(CPAMixing.class);
static Logger logger = LogManager.getLogger(CPAMixingRules.class);

int[][] assosSchemeType = null; // 0- ER - 1 - CR1
double[][] cpaBetaCross = null;
Expand All @@ -39,25 +39,25 @@ public class CPAMixing implements Cloneable, ThermodynamicConstantsInterface {

/**
* <p>
* Constructor for CPAMixing.
* Constructor for CPAMixingRules.
* </p>
*/
public CPAMixing() {}
public CPAMixingRules() {}

/** {@inheritDoc} */
@Override
public CPAMixing clone() {
CPAMixing clonedSystem = null;
public CPAMixingRules clone() {
CPAMixingRules clonedSystem = null;
try {
clonedSystem = (CPAMixing) super.clone();
clonedSystem = (CPAMixingRules) super.clone();
} catch (Exception ex) {
logger.error("Cloning failed.", ex);
}

return clonedSystem;
}

public class CPA_Radoch_base implements CPAMixingInterface {
public abstract class CPA_Radoch_base implements CPAMixingRulesInterface {
/** Serialization version UID. */
private static final long serialVersionUID = 1000;

Expand Down Expand Up @@ -586,9 +586,9 @@ public double calcDelta(int siteNumber1, int siteNumber2, int compnumb1, int com
* </p>
*
* @param i a int
* @return a {@link neqsim.thermo.mixingrule.CPAMixingInterface} object
* @return a {@link neqsim.thermo.mixingrule.CPAMixingRulesInterface} object
*/
public CPAMixingInterface getMixingRule(int i) {
public CPAMixingRulesInterface getMixingRule(int i) {
if (i == 1) {
return new CPA_Radoch();
} else if (i == 2) {
Expand All @@ -607,9 +607,9 @@ public CPAMixingInterface getMixingRule(int i) {
*
* @param i a int
* @param phase a {@link neqsim.thermo.phase.PhaseInterface} object
* @return a {@link neqsim.thermo.mixingrule.CPAMixingInterface} object
* @return a {@link neqsim.thermo.mixingrule.CPAMixingRulesInterface} object
*/
public CPAMixingInterface getMixingRule(int i, PhaseInterface phase) {
public CPAMixingRulesInterface getMixingRule(int i, PhaseInterface phase) {
assosSchemeType = new int[phase.getNumberOfComponents()][phase.getNumberOfComponents()];
cpaBetaCross = new double[phase.getNumberOfComponents()][phase.getNumberOfComponents()];
cpaEpsCross = new double[phase.getNumberOfComponents()][phase.getNumberOfComponents()];
Expand Down Expand Up @@ -674,9 +674,9 @@ public CPAMixingInterface getMixingRule(int i, PhaseInterface phase) {
*
* @param i a int
* @param phase a {@link neqsim.thermo.phase.PhaseInterface} object
* @return a {@link neqsim.thermo.mixingrule.CPAMixingInterface} object
* @return a {@link neqsim.thermo.mixingrule.CPAMixingRulesInterface} object
*/
public CPAMixingInterface resetMixingRule(int i, PhaseInterface phase) {
public CPAMixingRulesInterface resetMixingRule(int i, PhaseInterface phase) {
if (i == 1) {
return new CPA_Radoch();
} else if (i == 2) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* CPAMixingInterface.java
* CPAMixingRulesInterface.java
*
* Created on 26. februar 2001, 19:38
*/
Expand All @@ -10,13 +10,13 @@

/**
* <p>
* CPAMixingInterface interface.
* CPAMixingRulesInterface interface.
* </p>
*
* @author Even Solbraa
* @version $Id: $Id
*/
public interface CPAMixingInterface extends java.io.Serializable {
public interface CPAMixingRulesInterface extends java.io.Serializable {
// public double calcXi(int siteNumber, int compnumb, PhaseInterface phase,
// double temperature, double pressure, int numbcomp);

Expand Down
9 changes: 4 additions & 5 deletions src/main/java/neqsim/thermo/mixingrule/EosMixingRules.java
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ public ClassicSRKT clone() {
}
}

public class SRKHuronVidal extends ClassicSRK implements HVmixingRuleInterface {
public class SRKHuronVidal extends ClassicSRK implements HVMixingRulesInterface {
/** Serialization version UID. */
private static final long serialVersionUID = 1000;

Expand Down Expand Up @@ -1182,7 +1182,7 @@ public double calcAij(int compNumb, int compNumbj, PhaseInterface phase, double
}
}

public class SRKHuronVidal2 extends ClassicSRK implements HVmixingRuleInterface {
public class SRKHuronVidal2 extends ClassicSRK implements HVMixingRulesInterface {
/** Serialization version UID. */
private static final long serialVersionUID = 1000;

Expand Down Expand Up @@ -2707,9 +2707,6 @@ public java.lang.String[][] getClassicOrWS() {
*/
@ExcludeFromJacocoGeneratedReport
public void displayInteractionCoefficients(String intType, PhaseInterface phase) {
String[][] interactTable =
new String[phase.getNumberOfComponents() + 1][phase.getNumberOfComponents() + 1];

java.text.DecimalFormat nf = new java.text.DecimalFormat();

java.text.DecimalFormatSymbols symbols = new java.text.DecimalFormatSymbols();
Expand All @@ -2721,6 +2718,8 @@ public void displayInteractionCoefficients(String intType, PhaseInterface phase)

// String[][] table = new String[getPhases()[0].getNumberOfComponents() +
// 30][7];
String[][] interactTable =
new String[phase.getNumberOfComponents() + 1][phase.getNumberOfComponents() + 1];
String[] names = new String[phase.getNumberOfComponents() + 1];
names[0] = "";
for (int i = 0; i < phase.getNumberOfComponents(); i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @author Even Solbraa
* @version $Id: $Id
*/
public interface HVmixingRuleInterface extends EosMixingRulesInterface {
public interface HVMixingRulesInterface extends EosMixingRulesInterface {
/**
* <p>
* setHVDijParameter.
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/neqsim/thermo/phase/PhaseCPAInterface.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package neqsim.thermo.phase;

import neqsim.thermo.mixingrule.CPAMixingInterface;
import neqsim.thermo.mixingrule.CPAMixingRulesInterface;

/**
* <p>
Expand Down Expand Up @@ -74,7 +74,7 @@ public interface PhaseCPAInterface extends PhaseEosInterface {
* getCpamix.
* </p>
*
* @return a {@link neqsim.thermo.mixingrule.CPAMixingInterface} object
* @return a {@link neqsim.thermo.mixingrule.CPAMixingRulesInterface} object
*/
public CPAMixingInterface getCpamix();
public CPAMixingRulesInterface getCpamix();
}
10 changes: 5 additions & 5 deletions src/main/java/neqsim/thermo/phase/PhaseElectrolyteCPA.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import org.ejml.simple.SimpleMatrix;
import neqsim.thermo.component.ComponentCPAInterface;
import neqsim.thermo.component.ComponentElectrolyteCPA;
import neqsim.thermo.mixingrule.CPAMixing;
import neqsim.thermo.mixingrule.CPAMixingInterface;
import neqsim.thermo.mixingrule.CPAMixingRules;
import neqsim.thermo.mixingrule.CPAMixingRulesInterface;

/**
* <p>
Expand All @@ -26,8 +26,8 @@ public class PhaseElectrolyteCPA extends PhaseModifiedFurstElectrolyteEos
/** Logger object for class. */
static Logger logger = LogManager.getLogger(PhaseElectrolyteCPA.class);

public CPAMixing cpaSelect = new CPAMixing();
public CPAMixingInterface cpamix;
public CPAMixingRules cpaSelect = new CPAMixingRules();
public CPAMixingRulesInterface cpamix;
double gcpavv = 0.0;
double gcpavvv = 0.0;
double gcpa = 0.0;
Expand Down Expand Up @@ -1322,7 +1322,7 @@ public void setGcpav(double gcpav) {

/** {@inheritDoc} */
@Override
public CPAMixingInterface getCpamix() {
public CPAMixingRulesInterface getCpamix() {
return cpamix;
}

Expand Down
10 changes: 5 additions & 5 deletions src/main/java/neqsim/thermo/phase/PhaseElectrolyteCPAOld.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import neqsim.thermo.component.ComponentCPAInterface;
import neqsim.thermo.component.ComponentElectrolyteCPA;
import neqsim.thermo.component.ComponentEosInterface;
import neqsim.thermo.mixingrule.CPAMixing;
import neqsim.thermo.mixingrule.CPAMixingInterface;
import neqsim.thermo.mixingrule.CPAMixingRules;
import neqsim.thermo.mixingrule.CPAMixingRulesInterface;

/**
* <p>
Expand All @@ -23,10 +23,10 @@ public class PhaseElectrolyteCPAOld extends PhaseModifiedFurstElectrolyteEos
/** Logger object for class. */
static Logger logger = LogManager.getLogger(PhaseElectrolyteCPAOld.class);

public CPAMixing cpaSelect = new CPAMixing();
public CPAMixingRules cpaSelect = new CPAMixingRules();

int totalNumberOfAccociationSites = 0;
public CPAMixingInterface cpamix;
public CPAMixingRulesInterface cpamix;
double hcpatot = 1.0;
double hcpatotdT = 0.0;
double hcpatotdTdT = 0.0;
Expand Down Expand Up @@ -802,7 +802,7 @@ public void setGcpav(double gcpav) {

/** {@inheritDoc} */
@Override
public CPAMixingInterface getCpamix() {
public CPAMixingRulesInterface getCpamix() {
return cpamix;
}

Expand Down
10 changes: 5 additions & 5 deletions src/main/java/neqsim/thermo/phase/PhasePCSAFTa.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import org.apache.logging.log4j.Logger;
import neqsim.thermo.component.ComponentCPAInterface;
import neqsim.thermo.component.ComponentPCSAFTa;
import neqsim.thermo.mixingrule.CPAMixing;
import neqsim.thermo.mixingrule.CPAMixingInterface;
import neqsim.thermo.mixingrule.CPAMixingRules;
import neqsim.thermo.mixingrule.CPAMixingRulesInterface;

/**
* <p>
Expand All @@ -21,8 +21,8 @@ public class PhasePCSAFTa extends PhasePCSAFT implements PhaseCPAInterface {
/** Logger object for class. */
static Logger logger = LogManager.getLogger(PhasePCSAFTa.class);

public CPAMixing cpaSelect = new CPAMixing();
public CPAMixingInterface cpamix;
public CPAMixingRules cpaSelect = new CPAMixingRules();
public CPAMixingRulesInterface cpamix;
double hcpatot = 1.0;
double hcpatotdT = 0.0;
double hcpatotdTdT = 0.0;
Expand Down Expand Up @@ -475,7 +475,7 @@ public double getGcpav() {

/** {@inheritDoc} */
@Override
public CPAMixingInterface getCpamix() {
public CPAMixingRulesInterface getCpamix() {
return cpamix;
}

Expand Down
10 changes: 5 additions & 5 deletions src/main/java/neqsim/thermo/phase/PhasePrCPA.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import neqsim.thermo.component.ComponentCPAInterface;
import neqsim.thermo.component.ComponentSrkCPA;
import neqsim.thermo.mixingrule.CPAMixing;
import neqsim.thermo.mixingrule.CPAMixingInterface;
import neqsim.thermo.mixingrule.CPAMixingRules;
import neqsim.thermo.mixingrule.CPAMixingRulesInterface;

/**
* <p>
Expand All @@ -18,8 +18,8 @@ public class PhasePrCPA extends PhasePrEos implements PhaseCPAInterface {
private static final long serialVersionUID = 1000;

int totalNumberOfAccociationSites = 0;
public CPAMixing cpaSelect = new CPAMixing();
public CPAMixingInterface cpamix;
public CPAMixingRules cpaSelect = new CPAMixingRules();
public CPAMixingRulesInterface cpamix;
double hcpatot = 1.0;
double hcpatotdT = 0.0;
double hcpatotdTdT = 0.0;
Expand Down Expand Up @@ -456,7 +456,7 @@ public double getGcpav() {

/** {@inheritDoc} */
@Override
public CPAMixingInterface getCpamix() {
public CPAMixingRulesInterface getCpamix() {
return cpamix;
}

Expand Down
16 changes: 8 additions & 8 deletions src/main/java/neqsim/thermo/phase/PhaseSrkCPA.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import org.ejml.simple.SimpleMatrix;
import neqsim.thermo.component.ComponentCPAInterface;
import neqsim.thermo.component.ComponentSrkCPA;
import neqsim.thermo.mixingrule.CPAMixing;
import neqsim.thermo.mixingrule.CPAMixingInterface;
import neqsim.thermo.mixingrule.CPAMixingRules;
import neqsim.thermo.mixingrule.CPAMixingRulesInterface;

/**
* <p>
Expand All @@ -25,8 +25,8 @@ public class PhaseSrkCPA extends PhaseSrkEos implements PhaseCPAInterface {
/** Logger object for class. */
static Logger logger = LogManager.getLogger(PhaseSrkCPA.class);

public CPAMixing cpaSelect = new CPAMixing();
public CPAMixingInterface cpamix;
public CPAMixingRules cpaSelect = new CPAMixingRules();
public CPAMixingRulesInterface cpamix;
double gcpavv = 0.0;
double gcpavvv = 0.0;
double gcpa = 0.0;
Expand Down Expand Up @@ -667,11 +667,11 @@ public double dFCPAdTdV() {
}

/**
* calcdFdNtemp.
* Calculate and return dFdNtemp. NB! Does not set field <code>dFdNtemp</code>.
*
* @return double[]
*/
double[] calcdFdNtemp() {
private double[] calcdFdNtemp() {
double tot1 = 0.0;
double tot2 = 0.0;
double tot3 = 0.0;
Expand Down Expand Up @@ -960,7 +960,7 @@ public boolean solveX2(int maxIter) {

/**
* <p>
* Getter for the field <code>dFdNtemp</code>.
* Getter for the field <code>dFdNtemp</code>. Set value by calling function molarVolume.
* </p>
*
* @return the dFdNtemp
Expand Down Expand Up @@ -1419,7 +1419,7 @@ public void setGcpav(double gcpav) {

/** {@inheritDoc} */
@Override
public CPAMixingInterface getCpamix() {
public CPAMixingRulesInterface getCpamix() {
return cpamix;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import org.ejml.dense.row.NormOps_DDRM;
import neqsim.thermo.component.ComponentCPAInterface;
import neqsim.thermo.component.ComponentSrkCPA;
import neqsim.thermo.mixingrule.CPAMixing;
import neqsim.thermo.mixingrule.CPAMixingInterface;
import neqsim.thermo.mixingrule.CPAMixingRules;
import neqsim.thermo.mixingrule.CPAMixingRulesInterface;

/**
* <p>
Expand All @@ -24,8 +24,8 @@ public class PhaseSrkCPA_proceduralMatrices extends PhaseSrkEos implements Phase
/** Logger object for class. */
static Logger logger = LogManager.getLogger(PhaseSrkCPA_proceduralMatrices.class);

public CPAMixing cpaSelect = new CPAMixing();
public CPAMixingInterface cpamix;
public CPAMixingRules cpaSelect = new CPAMixingRules();
public CPAMixingRulesInterface cpamix;
double gcpavv = 0.0;
double gcpavvv = 0.0;
double gcpa = 0.0;
Expand Down Expand Up @@ -1404,7 +1404,7 @@ public void setGcpav(double gcpav) {

/** {@inheritDoc} */
@Override
public CPAMixingInterface getCpamix() {
public CPAMixingRulesInterface getCpamix() {
return cpamix;
}

Expand Down
Loading

0 comments on commit 7b0706a

Please sign in to comment.