Skip to content

Commit

Permalink
refact: make PhysicalPropertyMethod abstract and rewrite with import
Browse files Browse the repository at this point in the history
  • Loading branch information
asmfstatoil committed Oct 27, 2024
1 parent e8e19d8 commit 8eff55e
Show file tree
Hide file tree
Showing 29 changed files with 95 additions and 106 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

/**
* <p>
* PhysicalPropertyMethod class.
* Abstract PhysicalPropertyMethod class.
* </p>
*
* @author esol
* @version $Id: $Id
*/
public class PhysicalPropertyMethod implements PhysicalPropertyMethodInterface {
public abstract class PhysicalPropertyMethod implements PhysicalPropertyMethodInterface {
private static final long serialVersionUID = 1000;
static Logger logger = LogManager.getLogger(PhysicalPropertyMethod.class);

Expand All @@ -42,15 +42,9 @@ public PhysicalPropertyMethod clone() {
return properties;
}

/** {@inheritDoc} */
@Override
public void setPhase(
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface phase) {}

/** {@inheritDoc} */
@Override
public void tuneModel(double val, double temperature, double pressure) {
throw new UnsupportedOperationException("Unimplemented method 'tuneModel'");
}
// should contain phase objects ++ get diffusivity methods .. more ?
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package neqsim.physicalproperties.physicalpropertymethods.commonphasephysicalproperties;

import neqsim.physicalproperties.physicalpropertymethods.PhysicalPropertyMethod;

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

protected neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface phase;
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.ConductivityInterface;

/**
* Class for physical property Conductivity.
*
* @author Even Solbraa
*/
abstract class Conductivity extends
neqsim.physicalproperties.physicalpropertymethods.commonphasephysicalproperties.CommonPhysicalPropertyMethod
implements
neqsim.physicalproperties.physicalpropertymethods.methodinterface.ConductivityInterface {
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 @@ -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 {
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,7 @@
package neqsim.physicalproperties.physicalpropertymethods.gasphysicalproperties;

import neqsim.physicalproperties.physicalpropertymethods.PhysicalPropertyMethod;

/**
* <p>
* GasPhysicalPropertyMethod class.
Expand All @@ -8,8 +10,7 @@
* @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;
Expand All @@ -22,8 +23,7 @@ public class GasPhysicalPropertyMethod
* Constructor for GasPhysicalPropertyMethod.
* </p>
*/
public GasPhysicalPropertyMethod() {
}
public GasPhysicalPropertyMethod() {}

/**
* <p>
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.
*
* @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,6 +9,7 @@
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>
Expand All @@ -18,8 +19,7 @@
* @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 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.
*
* @author Even Solbraa
*/
abstract class Viscosity extends
neqsim.physicalproperties.physicalpropertymethods.gasphysicalproperties.GasPhysicalPropertyMethod
implements
neqsim.physicalproperties.physicalpropertymethods.methodinterface.ViscosityInterface {
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,7 @@
package neqsim.physicalproperties.physicalpropertymethods.liquidphysicalproperties;

import neqsim.physicalproperties.physicalpropertymethods.PhysicalPropertyMethod;

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

protected neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface liquidPhase;
Expand All @@ -19,8 +20,7 @@ public class LiquidPhysicalPropertyMethod
* Constructor for LiquidPhysicalPropertyMethod.
* </p>
*/
public LiquidPhysicalPropertyMethod() {
}
public LiquidPhysicalPropertyMethod() {}

/**
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

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>
Expand All @@ -17,10 +19,7 @@
* @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,6 +8,8 @@

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>
Expand All @@ -17,9 +19,7 @@
* @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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

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>
Expand All @@ -17,9 +19,7 @@
* @author Even Solbraa
* @version $Id: $Id
*/
public class Density extends
neqsim.physicalproperties.physicalpropertymethods.liquidphysicalproperties.LiquidPhysicalPropertyMethod
implements neqsim.physicalproperties.physicalpropertymethods.methodinterface.DensityInterface {
public class Density extends LiquidPhysicalPropertyMethod implements DensityInterface {
private static final long serialVersionUID = 1000;
static Logger logger = LogManager.getLogger(Density.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.liquidphysicalproperties.LiquidPhysicalPropertyMethod;
import neqsim.physicalproperties.physicalpropertymethods.methodinterface.DiffusivityInterface;

/**
* Diffusivity class.
*
* @author Even Solbraa
*/
abstract class Diffusivity extends
neqsim.physicalproperties.physicalpropertymethods.liquidphysicalproperties.LiquidPhysicalPropertyMethod
implements
neqsim.physicalproperties.physicalpropertymethods.methodinterface.DiffusivityInterface {
abstract class Diffusivity extends LiquidPhysicalPropertyMethod 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,6 +2,8 @@

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

/**
* <p>
Expand All @@ -11,10 +13,7 @@
* @author Even Solbraa
* @version Method was checked on 2.8.2001 - seems to be correct - Even Solbraa
*/
public class Viscosity extends
neqsim.physicalproperties.physicalpropertymethods.liquidphysicalproperties.LiquidPhysicalPropertyMethod
implements
neqsim.physicalproperties.physicalpropertymethods.methodinterface.ViscosityInterface {
public class Viscosity extends LiquidPhysicalPropertyMethod 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,6 @@
package neqsim.physicalproperties.physicalpropertymethods.methodinterface;

import neqsim.physicalproperties.physicalpropertymethods.PhysicalPropertyMethodInterface;
import neqsim.thermo.ThermodynamicConstantsInterface;

/**
Expand All @@ -10,8 +11,8 @@
* @author Even Solbraa
* @version $Id: $Id
*/
public interface ConductivityInterface extends ThermodynamicConstantsInterface,
neqsim.physicalproperties.physicalpropertymethods.PhysicalPropertyMethodInterface {
public interface ConductivityInterface
extends ThermodynamicConstantsInterface, PhysicalPropertyMethodInterface {
/**
* <p>
* calcConductivity.
Expand Down
Loading

0 comments on commit 8eff55e

Please sign in to comment.