Skip to content

Commit

Permalink
refact: simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
asmfstatoil committed Oct 27, 2024
1 parent 08af3f6 commit 4b44ebd
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @author Even Solbraa
*/
abstract class Viscosity extends CommonPhysicalPropertyMethod implements 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
Expand Up @@ -18,13 +18,6 @@ public abstract class GasPhysicalPropertyMethod extends PhysicalPropertyMethod {
public double[][] binaryEnergyParameter;
public double[][] binaryMolecularMass;

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

/**
* <p>
* Constructor for GasPhysicalPropertyMethod.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ public class Density extends GasPhysicalPropertyMethod implements DensityInterfa
* 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 @@ -6,11 +6,11 @@
import neqsim.physicalproperties.physicalpropertymethods.methodinterface.ViscosityInterface;

/**
* * Abstract class for Viscosity property.
* Abstract class for Viscosity property.
*
* @author Even Solbraa
*/
abstract class Viscosity extends GasPhysicalPropertyMethod implements 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,6 +1,7 @@
package neqsim.physicalproperties.physicalpropertymethods.liquidphysicalproperties;

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

/**
* <p>
Expand All @@ -10,18 +11,11 @@
* @author Even Solbraa
* @version $Id: $Id
*/
public class LiquidPhysicalPropertyMethod extends 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 phase) {
setPhase(phase);
}

/** {@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 @@ -34,7 +34,7 @@ public class Costald extends LiquidPhysicalPropertyMethod implements DensityInte
*/
public Costald(
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface liquidPhase) {
this.liquidPhase = liquidPhase;
super(liquidPhase);
}

/** {@inheritDoc} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public class Density extends LiquidPhysicalPropertyMethod implements DensityInte
* object
*/
public Density(
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface liquidPhase) {
this.liquidPhase = liquidPhase;
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface phase) {
super(phase);
}

/** {@inheritDoc} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @author Even Solbraa
* @version $Id: $Id
*/
public class SolidPhysicalPropertyMethod extends PhysicalPropertyMethod {
public abstract class SolidPhysicalPropertyMethod extends PhysicalPropertyMethod {
private static final long serialVersionUID = 1000;

protected neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface solidPhase;
Expand All @@ -25,8 +25,8 @@ public class SolidPhysicalPropertyMethod extends PhysicalPropertyMethod {
* object
*/
public SolidPhysicalPropertyMethod(
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface solidPhase) {
this.solidPhase = solidPhase;
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface phase) {
setPhase(phase);
}

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

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import neqsim.physicalproperties.mixingrule.PhysicalPropertyMixingRuleInterface;
import neqsim.physicalproperties.physicalpropertymethods.commonphasephysicalproperties.conductivity.PFCTConductivityMethodMod86;
import neqsim.physicalproperties.physicalpropertymethods.commonphasephysicalproperties.diffusivity.CorrespondingStatesDiffusivity;
import neqsim.physicalproperties.physicalpropertymethods.commonphasephysicalproperties.viscosity.FrictionTheoryViscosityMethod;
Expand All @@ -16,9 +17,13 @@
import neqsim.physicalproperties.physicalpropertymethods.commonphasephysicalproperties.viscosity.PFCTViscosityMethodMod86;
import neqsim.physicalproperties.physicalpropertymethods.gasphysicalproperties.conductivity.ChungConductivityMethod;
import neqsim.physicalproperties.physicalpropertymethods.gasphysicalproperties.diffusivity.WilkeLeeDiffusivity;
import neqsim.physicalproperties.physicalpropertymethods.liquidphysicalproperties.density.Costald;
import neqsim.physicalproperties.physicalpropertymethods.liquidphysicalproperties.diffusivity.AmineDiffusivity;
import neqsim.physicalproperties.physicalpropertymethods.liquidphysicalproperties.diffusivity.SiddiqiLucasMethod;
import neqsim.physicalproperties.physicalpropertymethods.methodinterface.ConductivityInterface;
import neqsim.physicalproperties.physicalpropertymethods.methodinterface.DensityInterface;
import neqsim.physicalproperties.physicalpropertymethods.methodinterface.DiffusivityInterface;
import neqsim.physicalproperties.physicalpropertymethods.methodinterface.ViscosityInterface;
import neqsim.thermo.ThermodynamicConstantsInterface;
import neqsim.thermo.phase.PhaseInterface;

Expand All @@ -38,12 +43,11 @@ public abstract class PhysicalProperties
public PhaseInterface phase;
protected int binaryDiffusionCoefficientMethod;
protected int multicomponentDiffusionMethod;
private neqsim.physicalproperties.mixingrule.PhysicalPropertyMixingRuleInterface mixingRule =
null;
public neqsim.physicalproperties.physicalpropertymethods.methodinterface.ConductivityInterface conductivityCalc;
public neqsim.physicalproperties.physicalpropertymethods.methodinterface.ViscosityInterface viscosityCalc;
public neqsim.physicalproperties.physicalpropertymethods.methodinterface.DiffusivityInterface diffusivityCalc;
public neqsim.physicalproperties.physicalpropertymethods.methodinterface.DensityInterface densityCalc;
private PhysicalPropertyMixingRuleInterface mixingRule = null;
public ConductivityInterface conductivityCalc;
public ViscosityInterface viscosityCalc;
public DiffusivityInterface diffusivityCalc;
public DensityInterface densityCalc;
public double kinematicViscosity = 0;
public double density = 0;
public double viscosity = 0;
Expand Down Expand Up @@ -105,14 +109,13 @@ public PhaseInterface getPhase() {

/** {@inheritDoc} */
@Override
public neqsim.physicalproperties.mixingrule.PhysicalPropertyMixingRuleInterface getMixingRule() {
public PhysicalPropertyMixingRuleInterface getMixingRule() {
return mixingRule;
}

/** {@inheritDoc} */
@Override
public void setMixingRule(
neqsim.physicalproperties.mixingrule.PhysicalPropertyMixingRuleInterface mixingRule) {
public void setMixingRule(PhysicalPropertyMixingRuleInterface mixingRule) {
this.mixingRule = mixingRule;
}

Expand All @@ -124,7 +127,7 @@ public void setMixingRuleNull() {

/** {@inheritDoc} */
@Override
public neqsim.physicalproperties.physicalpropertymethods.methodinterface.ViscosityInterface getViscosityModel() {
public ViscosityInterface getViscosityModel() {
return viscosityCalc;
}

Expand All @@ -136,9 +139,7 @@ public void setDensityModel(String model) {
new neqsim.physicalproperties.physicalpropertymethods.liquidphysicalproperties.density.Density(
this);
} else if ("Costald".equals(model)) {
densityCalc =
new neqsim.physicalproperties.physicalpropertymethods.liquidphysicalproperties.density.Costald(
this);
densityCalc = new Costald(this);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @author Even Solbraa
*/
abstract class ComponentGEUniquacmodifiedHV extends ComponentGEUniquac {
public abstract class ComponentGEUniquacmodifiedHV extends ComponentGEUniquac {
private static final long serialVersionUID = 1000;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/neqsim/thermo/component/ComponentPrCPA.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @author Even Solbraa
*/
abstract class ComponentPrCPA extends ComponentPR implements ComponentCPAInterface {
public abstract class ComponentPrCPA extends ComponentPR implements ComponentCPAInterface {
private static final long serialVersionUID = 1000;

int cpaon = 1;
Expand Down

0 comments on commit 4b44ebd

Please sign in to comment.