Skip to content

Commit

Permalink
refact: remove physicalpropertiesinterface
Browse files Browse the repository at this point in the history
  • Loading branch information
asmfstatoil committed Oct 27, 2024
1 parent 8d1929d commit 14ce5ec
Show file tree
Hide file tree
Showing 40 changed files with 375 additions and 558 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface;
import neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties;
import neqsim.physicalproperties.physicalpropertysystem.commonphasephysicalproperties.DefaultPhysicalProperties;
import neqsim.physicalproperties.physicalpropertysystem.gasphysicalproperties.GasPhysicalProperties;
import neqsim.physicalproperties.physicalpropertysystem.liquidphysicalproperties.AminePhysicalProperties;
Expand All @@ -25,10 +25,10 @@ public class PhysicalPropertyHandler implements Cloneable, java.io.Serializable
private static final long serialVersionUID = 1000;
static Logger logger = LogManager.getLogger(PhysicalPropertyHandler.class);

private PhysicalPropertiesInterface gasPhysicalProperties = null;
private PhysicalPropertiesInterface oilPhysicalProperties = null;
private PhysicalPropertiesInterface aqueousPhysicalProperties = null;
private PhysicalPropertiesInterface solidPhysicalProperties = null;
private PhysicalProperties gasPhysicalProperties = null;
private PhysicalProperties oilPhysicalProperties = null;
private PhysicalProperties aqueousPhysicalProperties = null;
private PhysicalProperties solidPhysicalProperties = null;
private neqsim.physicalproperties.mixingrule.PhysicalPropertyMixingRule mixingRule = null;

/**
Expand Down Expand Up @@ -98,10 +98,9 @@ public void setPhysicalProperties(PhaseInterface phase, int type) {
* </p>
*
* @param phase a {@link neqsim.thermo.phase.PhaseInterface} object
* @return a {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface}
* object
* @return a {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties} object
*/
public PhysicalPropertiesInterface getPhysicalProperty(PhaseInterface phase) {
public PhysicalProperties getPhysicalProperty(PhaseInterface phase) {
switch (phase.getType()) {
case GAS:
return gasPhysicalProperties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

package neqsim.physicalproperties.physicalpropertymethods;

import neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties;

/**
* <p>
* PhysicalPropertyMethodInterface interface.
Expand All @@ -31,12 +33,9 @@ public interface PhysicalPropertyMethodInterface extends Cloneable, java.io.Seri
* setPhase.
* </p>
*
* @param phase a
* {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface}
* object
* @param phase a {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties} object
*/
public void setPhase(
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface phase);
public void setPhase(PhysicalProperties phase);

/**
* <p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package neqsim.physicalproperties.physicalpropertymethods.commonphasephysicalproperties;

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

/**
* <p>
Expand All @@ -14,24 +14,23 @@
public abstract class CommonPhysicalPropertyMethod extends PhysicalPropertyMethod {
private static final long serialVersionUID = 1000;

protected neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface phase;
protected PhysicalProperties phase;

/**
* <p>
* Constructor for CommonPhysicalPropertyMethod.
* </p>
*
* @param phase a
* {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface}
* @param phase a {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties}
* object
*/
public CommonPhysicalPropertyMethod(PhysicalPropertiesInterface phase) {
public CommonPhysicalPropertyMethod(PhysicalProperties phase) {
this.phase = phase;
}

/** {@inheritDoc} */
@Override
public void setPhase(PhysicalPropertiesInterface phase) {
public void setPhase(PhysicalProperties phase) {
this.phase = phase;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.apache.logging.log4j.Logger;
import neqsim.physicalproperties.physicalpropertymethods.commonphasephysicalproperties.CommonPhysicalPropertyMethod;
import neqsim.physicalproperties.physicalpropertymethods.methodinterface.ConductivityInterface;
import neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties;

/**
* Abstract class for Conductivity.
Expand All @@ -22,12 +23,10 @@ public abstract class Conductivity extends CommonPhysicalPropertyMethod
* Constructor for Conductivity.
* </p>
*
* @param phase a
* {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface}
* @param phase a {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties}
* object
*/
public Conductivity(
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface phase) {
public Conductivity(PhysicalProperties phase) {
super(phase);
}

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

import neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties;
import neqsim.thermo.ThermodynamicConstantsInterface;
import neqsim.thermo.system.SystemInterface;
import neqsim.thermo.system.SystemSrkEos;
Expand Down Expand Up @@ -39,12 +40,9 @@ public class PFCTConductivityMethodMod86 extends Conductivity {
* Constructor for PFCTConductivityMethodMod86.
* </p>
*
* @param phase a
* {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface}
* object
* @param phase a {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties} object
*/
public PFCTConductivityMethodMod86(
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface phase) {
public PFCTConductivityMethodMod86(PhysicalProperties phase) {
super(phase);
if (referenceSystem.getNumberOfMoles() < 1e-10) {
referenceSystem.addComponent("methane", 10.0);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package neqsim.physicalproperties.physicalpropertymethods.commonphasephysicalproperties.diffusivity;

import neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties;
import neqsim.thermo.phase.PhaseType;

/**
Expand All @@ -21,12 +22,9 @@ public class CorrespondingStatesDiffusivity extends Diffusivity {
* Constructor for CorrespondingStatesDiffusivity.
* </p>
*
* @param phase a
* {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface}
* object
* @param phase a {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties} object
*/
public CorrespondingStatesDiffusivity(
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface phase) {
public CorrespondingStatesDiffusivity(PhysicalProperties phase) {
super(phase);
binaryDiffusionCoefficients = new double[phase.getPhase().getNumberOfComponents()][phase
.getPhase().getNumberOfComponents()];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.apache.logging.log4j.Logger;
import neqsim.physicalproperties.physicalpropertymethods.commonphasephysicalproperties.CommonPhysicalPropertyMethod;
import neqsim.physicalproperties.physicalpropertymethods.methodinterface.DiffusivityInterface;
import neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties;

/**
* <p>
Expand All @@ -26,12 +27,10 @@ public class Diffusivity extends CommonPhysicalPropertyMethod implements Diffusi
* Constructor for Diffusivity.
* </p>
*
* @param phase a
* {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface}
* @param phase a {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties}
* object
*/
public Diffusivity(
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface phase) {
public Diffusivity(PhysicalProperties phase) {
super(phase);
binaryDiffusionCoefficients = new double[phase.getPhase().getNumberOfComponents()][phase
.getPhase().getNumberOfComponents()];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties;

/**
* <p>
Expand Down Expand Up @@ -54,12 +55,9 @@ public class FrictionTheoryViscosityMethod extends Viscosity
* Constructor for FrictionTheoryViscosityMethod.
* </p>
*
* @param phase a
* {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface}
* object
* @param phase a {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties} object
*/
public FrictionTheoryViscosityMethod(
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface phase) {
public FrictionTheoryViscosityMethod(PhysicalProperties phase) {
super(phase);
pureComponentViscosity = new double[phase.getPhase().getNumberOfComponents()];
Fc = new double[phase.getPhase().getNumberOfComponents()];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties;

/**
* <p>
Expand All @@ -22,12 +23,9 @@ public class LBCViscosityMethod extends Viscosity {
* Constructor for LBCViscosityMethod.
* </p>
*
* @param phase a
* {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface}
* object
* @param phase a {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties} object
*/
public LBCViscosityMethod(
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface phase) {
public LBCViscosityMethod(PhysicalProperties phase) {
super(phase);
}

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

package neqsim.physicalproperties.physicalpropertymethods.commonphasephysicalproperties.viscosity;

import neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties;
import neqsim.thermo.ThermodynamicConstantsInterface;
import neqsim.thermo.system.SystemInterface;
import neqsim.thermo.system.SystemSrkEos;
Expand Down Expand Up @@ -45,12 +46,9 @@ public class PFCTViscosityMethod extends Viscosity {
* Constructor for PFCTViscosityMethod.
* </p>
*
* @param phase a
* {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface}
* object
* @param phase a {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties} object
*/
public PFCTViscosityMethod(
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface phase) {
public PFCTViscosityMethod(PhysicalProperties phase) {
super(phase);
referenceSystem.addComponent("methane", 10.0);
referenceSystem.init(0);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package neqsim.physicalproperties.physicalpropertymethods.commonphasephysicalproperties.viscosity;

import neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties;
import neqsim.thermo.ThermodynamicConstantsInterface;
import neqsim.thermo.system.SystemInterface;
import neqsim.thermo.system.SystemSrkEos;
Expand Down Expand Up @@ -45,12 +46,9 @@ public class PFCTViscosityMethodHeavyOil extends Viscosity {
* Constructor for PFCTViscosityMethodHeavyOil.
* </p>
*
* @param phase a
* {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface}
* object
* @param phase a {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties} object
*/
public PFCTViscosityMethodHeavyOil(
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface phase) {
public PFCTViscosityMethodHeavyOil(PhysicalProperties phase) {
super(phase);
if (referenceSystem.getNumberOfMoles() < 1e-10) {
referenceSystem.addComponent("methane", 10.0);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package neqsim.physicalproperties.physicalpropertymethods.commonphasephysicalproperties.viscosity;

import neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties;
import neqsim.thermo.ThermodynamicConstantsInterface;
import neqsim.thermo.system.SystemInterface;
import neqsim.thermo.system.SystemSrkEos;
Expand Down Expand Up @@ -40,12 +41,9 @@ public class PFCTViscosityMethodMod86 extends Viscosity {
* Constructor for PFCTViscosityMethodMod86.
* </p>
*
* @param phase a
* {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface}
* object
* @param phase a {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties} object
*/
public PFCTViscosityMethodMod86(
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface phase) {
public PFCTViscosityMethodMod86(PhysicalProperties phase) {
super(phase);
if (referenceSystem.getNumberOfMoles() < 1e-10) {
referenceSystem.addComponent("methane", 10.0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.apache.logging.log4j.Logger;
import neqsim.physicalproperties.physicalpropertymethods.commonphasephysicalproperties.CommonPhysicalPropertyMethod;
import neqsim.physicalproperties.physicalpropertymethods.methodinterface.ViscosityInterface;
import neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties;

/**
* Abstract class for Viscosity property.
Expand All @@ -21,12 +22,10 @@ public abstract class Viscosity extends CommonPhysicalPropertyMethod implements
* Constructor for Viscosity.
* </p>
*
* @param phase a
* {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface}
* @param phase a {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties}
* object
*/
public Viscosity(
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface phase) {
public Viscosity(PhysicalProperties phase) {
super(phase);
pureComponentViscosity = new double[phase.getPhase().getNumberOfComponents()];
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package neqsim.physicalproperties.physicalpropertymethods.gasphysicalproperties;

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

/**
* <p>
Expand All @@ -14,7 +14,7 @@
public abstract class GasPhysicalPropertyMethod extends PhysicalPropertyMethod {
private static final long serialVersionUID = 1000;

protected neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface gasPhase;
protected PhysicalProperties gasPhase;
public double[][] binaryMolecularDiameter;
public double[][] binaryEnergyParameter;
public double[][] binaryMolecularMass;
Expand All @@ -24,11 +24,10 @@ public abstract class GasPhysicalPropertyMethod extends PhysicalPropertyMethod {
* Constructor for GasPhysicalPropertyMethod.
* </p>
*
* @param gasPhase a
* {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface}
* @param gasPhase a {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties}
* object
*/
public GasPhysicalPropertyMethod(PhysicalPropertiesInterface gasPhase) {
public GasPhysicalPropertyMethod(PhysicalProperties gasPhase) {
this.gasPhase = gasPhase;
binaryMolecularDiameter = new double[gasPhase.getPhase().getNumberOfComponents()][gasPhase
.getPhase().getNumberOfComponents()];
Expand Down Expand Up @@ -57,8 +56,7 @@ public GasPhysicalPropertyMethod(PhysicalPropertiesInterface gasPhase) {

/** {@inheritDoc} */
@Override
public void setPhase(
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface phase) {
public void setPhase(PhysicalProperties phase) {
this.gasPhase = phase;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package neqsim.physicalproperties.physicalpropertymethods.gasphysicalproperties.conductivity;

import neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties;

/**
* <p>
* ChungConductivityMethod class extending conductivity for gases.
Expand All @@ -18,12 +20,9 @@ public class ChungConductivityMethod extends Conductivity {
* Constructor for ChungConductivityMethod.
* </p>
*
* @param gasPhase a
* {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface}
* object
* @param gasPhase a {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties} object
*/
public ChungConductivityMethod(
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface gasPhase) {
public ChungConductivityMethod(PhysicalProperties gasPhase) {
super(gasPhase);
pureComponentConductivity = new double[gasPhase.getPhase().getNumberOfComponents()];
}
Expand Down
Loading

0 comments on commit 14ce5ec

Please sign in to comment.