Skip to content

Commit

Permalink
refact: mark classes abstract and simplify imports
Browse files Browse the repository at this point in the history
  • Loading branch information
asmfstatoil committed Oct 27, 2024
1 parent 793eea2 commit 79b869b
Show file tree
Hide file tree
Showing 34 changed files with 138 additions and 157 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package neqsim.physicalproperties.physicalpropertymethods.commonphasephysicalproperties;

import neqsim.physicalproperties.physicalpropertymethods.PhysicalPropertyMethod;
import neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface;

/**
* <p>
* CommonPhysicalPropertyMethod class.
Expand All @@ -8,8 +11,7 @@
* @author Even Solbraa
* @version $Id: $Id
*/
public class CommonPhysicalPropertyMethod
extends neqsim.physicalproperties.physicalpropertymethods.PhysicalPropertyMethod {
public abstract class CommonPhysicalPropertyMethod extends PhysicalPropertyMethod {
private static final long serialVersionUID = 1000;

protected neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface phase;
Expand All @@ -23,15 +25,13 @@ public class CommonPhysicalPropertyMethod
* {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface}
* object
*/
public CommonPhysicalPropertyMethod(
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface phase) {
public CommonPhysicalPropertyMethod(PhysicalPropertiesInterface phase) {
this.phase = phase;
}

/** {@inheritDoc} */
@Override
public void setPhase(
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface phase) {
public void setPhase(PhysicalPropertiesInterface phase) {
this.phase = phase;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import neqsim.physicalproperties.physicalpropertymethods.commonphasephysicalproperties.CommonPhysicalPropertyMethod;
import neqsim.physicalproperties.physicalpropertymethods.methodinterface.ConductivityInterface;

/**
* Class for physical property Conductivity.
* Abstract class for Conductivity.
*
* @author Even Solbraa
*/
abstract class Conductivity extends
neqsim.physicalproperties.physicalpropertymethods.commonphasephysicalproperties.CommonPhysicalPropertyMethod
implements
neqsim.physicalproperties.physicalpropertymethods.methodinterface.ConductivityInterface {
public abstract class Conductivity extends CommonPhysicalPropertyMethod
implements ConductivityInterface {
private static final long serialVersionUID = 1000;
static Logger logger = LogManager.getLogger(Conductivity.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

/**
* <p>
* PFCTConductivityMethodMod86 class.
* PFCTConductivityMethodMod86 class extending conductivity for commonphase.
* </p>
*
* @author esol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import neqsim.physicalproperties.physicalpropertymethods.commonphasephysicalproperties.CommonPhysicalPropertyMethod;
import neqsim.physicalproperties.physicalpropertymethods.methodinterface.DiffusivityInterface;

/**
* <p>
Expand All @@ -12,8 +13,7 @@
* @author Even Solbraa
* @version $Id: $Id
*/
public class Diffusivity extends CommonPhysicalPropertyMethod implements
neqsim.physicalproperties.physicalpropertymethods.methodinterface.DiffusivityInterface {
public class Diffusivity extends CommonPhysicalPropertyMethod implements DiffusivityInterface {
private static final long serialVersionUID = 1000;
static Logger logger = LogManager.getLogger(Diffusivity.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import neqsim.physicalproperties.physicalpropertymethods.commonphasephysicalproperties.CommonPhysicalPropertyMethod;
import neqsim.physicalproperties.physicalpropertymethods.methodinterface.ViscosityInterface;

/**
* Abstract class for Viscosity property.
*
* @author Even Solbraa
*/
abstract class Viscosity extends
neqsim.physicalproperties.physicalpropertymethods.commonphasephysicalproperties.CommonPhysicalPropertyMethod
implements
neqsim.physicalproperties.physicalpropertymethods.methodinterface.ViscosityInterface {
public abstract class Viscosity extends CommonPhysicalPropertyMethod implements ViscosityInterface {
private static final long serialVersionUID = 1000;
static Logger logger = LogManager.getLogger(Viscosity.class);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package neqsim.physicalproperties.physicalpropertymethods.gasphysicalproperties;

import neqsim.physicalproperties.physicalpropertymethods.PhysicalPropertyMethod;
import neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface;

/**
* <p>
* GasPhysicalPropertyMethod class.
Expand All @@ -8,23 +11,14 @@
* @author Even Solbraa
* @version $Id: $Id
*/
public class GasPhysicalPropertyMethod
extends neqsim.physicalproperties.physicalpropertymethods.PhysicalPropertyMethod {
public abstract class GasPhysicalPropertyMethod extends PhysicalPropertyMethod {
private static final long serialVersionUID = 1000;

protected neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface gasPhase;
public double[][] binaryMolecularDiameter;
public double[][] binaryEnergyParameter;
public double[][] binaryMolecularMass;

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

/**
* <p>
* Constructor for GasPhysicalPropertyMethod.
Expand All @@ -34,8 +28,7 @@ public GasPhysicalPropertyMethod() {
* {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface}
* object
*/
public GasPhysicalPropertyMethod(
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface gasPhase) {
public GasPhysicalPropertyMethod(PhysicalPropertiesInterface gasPhase) {
this.gasPhase = gasPhase;
binaryMolecularDiameter = new double[gasPhase.getPhase().getNumberOfComponents()][gasPhase
.getPhase().getNumberOfComponents()];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
* <p>
* ChungConductivityMethod class.
* ChungConductivityMethod class extending conductivity for gases.
* </p>
*
* @author Even Solbraa
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import neqsim.physicalproperties.physicalpropertymethods.gasphysicalproperties.GasPhysicalPropertyMethod;
import neqsim.physicalproperties.physicalpropertymethods.methodinterface.ConductivityInterface;

/**
* Abstract class Conductivity.
* Abstract class Conductivity for gases.
*
* @author Even Solbraa
*/
abstract class Conductivity extends
neqsim.physicalproperties.physicalpropertymethods.gasphysicalproperties.GasPhysicalPropertyMethod
implements
neqsim.physicalproperties.physicalpropertymethods.methodinterface.ConductivityInterface {
public abstract class Conductivity extends GasPhysicalPropertyMethod
implements ConductivityInterface {
private static final long serialVersionUID = 1000;
static Logger logger = LogManager.getLogger(Conductivity.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import neqsim.physicalproperties.physicalpropertymethods.gasphysicalproperties.GasPhysicalPropertyMethod;
import neqsim.physicalproperties.physicalpropertymethods.methodinterface.DensityInterface;

/**
* <p>
* Density class.
* Density class for gases.
* </p>
*
* @author Even Solbraa
* @version $Id: $Id
*/
public class Density extends GasPhysicalPropertyMethod
implements neqsim.physicalproperties.physicalpropertymethods.methodinterface.DensityInterface {
public class Density extends GasPhysicalPropertyMethod implements DensityInterface {
private static final long serialVersionUID = 1000;
static Logger logger = LogManager.getLogger(Density.class);

Expand All @@ -28,13 +28,13 @@ public class Density extends GasPhysicalPropertyMethod
* Constructor for Density.
* </p>
*
* @param gasPhase a
* @param phase a
* {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface}
* object
*/
public Density(
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface gasPhase) {
this.gasPhase = gasPhase;
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface phase) {
super(phase);
}

/** {@inheritDoc} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import neqsim.physicalproperties.physicalpropertymethods.gasphysicalproperties.GasPhysicalPropertyMethod;
import neqsim.physicalproperties.physicalpropertymethods.methodinterface.DiffusivityInterface;

/**
* <p>
Expand All @@ -11,10 +13,7 @@
* @author Even Solbraa
* @version $Id: $Id
*/
public class Diffusivity extends
neqsim.physicalproperties.physicalpropertymethods.gasphysicalproperties.GasPhysicalPropertyMethod
implements
neqsim.physicalproperties.physicalpropertymethods.methodinterface.DiffusivityInterface {
public class Diffusivity extends GasPhysicalPropertyMethod implements DiffusivityInterface {
private static final long serialVersionUID = 1000;
static Logger logger = LogManager.getLogger(Diffusivity.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
public class WilkeLeeDiffusivity extends Diffusivity {
private static final long serialVersionUID = 1000;

double[][] binaryDiffusionCoefficients, binaryLennardJonesOmega;
double[][] binaryDiffusionCoefficients;

double[][] binaryLennardJonesOmega;

/**
* <p>
Expand All @@ -38,8 +40,14 @@ public double calcBinaryDiffusionCoefficient(int i, int j, int method) {
// if(method==? then)
// remember this is the Fick's diffusion coefficients
// to get the Maxwell-Stefan coefficient - multiply by gamma
double A2 = 1.06036, B2 = 0.15610, C2 = 0.19300, D2 = 0.47635, E2 = 1.03587, F2 = 1.52996,
G2 = 1.76474, H2 = 3.89411;
double A2 = 1.06036;
double B2 = 0.15610;
double C2 = 0.19300;
double D2 = 0.47635;
double E2 = 1.03587;
double F2 = 1.52996;
double G2 = 1.76474;
double H2 = 3.89411;
double tempVar2 = gasPhase.getPhase().getTemperature() / binaryEnergyParameter[i][j];
binaryLennardJonesOmega[i][j] = A2 / Math.pow(tempVar2, B2) + C2 / Math.exp(D2 * tempVar2)
+ E2 / Math.exp(F2 * tempVar2) + G2 / Math.exp(H2 * tempVar2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import neqsim.physicalproperties.physicalpropertymethods.gasphysicalproperties.GasPhysicalPropertyMethod;
import neqsim.physicalproperties.physicalpropertymethods.methodinterface.ViscosityInterface;

/**
* * Abstract class for Viscosity property.
* Abstract class for Viscosity property.
*
* @author Even Solbraa
*/
abstract class Viscosity extends
neqsim.physicalproperties.physicalpropertymethods.gasphysicalproperties.GasPhysicalPropertyMethod
implements
neqsim.physicalproperties.physicalpropertymethods.methodinterface.ViscosityInterface {
public abstract class Viscosity extends GasPhysicalPropertyMethod implements ViscosityInterface {
private static final long serialVersionUID = 1000;
static Logger logger = LogManager.getLogger(Viscosity.class);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package neqsim.physicalproperties.physicalpropertymethods.liquidphysicalproperties;

import neqsim.physicalproperties.physicalpropertymethods.PhysicalPropertyMethod;
import neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface;

/**
* <p>
* LiquidPhysicalPropertyMethod class.
Expand All @@ -8,20 +11,11 @@
* @author Even Solbraa
* @version $Id: $Id
*/
public class LiquidPhysicalPropertyMethod
extends neqsim.physicalproperties.physicalpropertymethods.PhysicalPropertyMethod {
public abstract class LiquidPhysicalPropertyMethod extends PhysicalPropertyMethod {
private static final long serialVersionUID = 1000;

protected neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface liquidPhase;

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

/**
* <p>
* Constructor for LiquidPhysicalPropertyMethod.
Expand All @@ -31,15 +25,13 @@ public LiquidPhysicalPropertyMethod() {
* {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface}
* object
*/
public LiquidPhysicalPropertyMethod(
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface liquidPhase) {
this.liquidPhase = liquidPhase;
public LiquidPhysicalPropertyMethod(PhysicalPropertiesInterface liquidPhase) {
setPhase(liquidPhase);
}

/** {@inheritDoc} */
@Override
public void setPhase(
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface phase) {
public void setPhase(PhysicalPropertiesInterface phase) {
this.liquidPhase = phase;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,18 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import neqsim.physicalproperties.physicalpropertymethods.liquidphysicalproperties.LiquidPhysicalPropertyMethod;
import neqsim.physicalproperties.physicalpropertymethods.methodinterface.ConductivityInterface;

/**
* <p>
* Conductivity class.
* Conductivity class for liquids.
* </p>
*
* @author Even Solbraa
* @version $Id: $Id
*/
public class Conductivity extends
neqsim.physicalproperties.physicalpropertymethods.liquidphysicalproperties.LiquidPhysicalPropertyMethod
implements
neqsim.physicalproperties.physicalpropertymethods.methodinterface.ConductivityInterface {
public class Conductivity extends LiquidPhysicalPropertyMethod implements ConductivityInterface {
private static final long serialVersionUID = 1000;
static Logger logger = LogManager.getLogger(Conductivity.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import neqsim.physicalproperties.physicalpropertymethods.liquidphysicalproperties.LiquidPhysicalPropertyMethod;
import neqsim.physicalproperties.physicalpropertymethods.methodinterface.DensityInterface;

/**
* <p>
* Costald Density Calculation class.
* Costald Density Calculation class for liquids.
* </p>
*
* @author Even Solbraa
* @version $Id: $Id
*/
public class Costald extends
neqsim.physicalproperties.physicalpropertymethods.liquidphysicalproperties.LiquidPhysicalPropertyMethod
implements neqsim.physicalproperties.physicalpropertymethods.methodinterface.DensityInterface {
public class Costald extends LiquidPhysicalPropertyMethod implements DensityInterface {
private static final long serialVersionUID = 1000;
static Logger logger = LogManager.getLogger(Density.class);

Expand All @@ -34,7 +34,7 @@ public class Costald extends
*/
public Costald(
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface liquidPhase) {
this.liquidPhase = liquidPhase;
super(liquidPhase);
}

/** {@inheritDoc} */
Expand Down
Loading

0 comments on commit 79b869b

Please sign in to comment.