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 faec1d1
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 51 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
@@ -1,6 +1,7 @@
package neqsim.physicalproperties.physicalpropertymethods.gasphysicalproperties;

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

/**
* <p>
Expand All @@ -18,13 +19,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 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 @@ -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 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 @@ -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 @@ -34,7 +34,7 @@ public class Density extends LiquidPhysicalPropertyMethod implements DensityInte
*/
public Density(
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 @@ -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 @@ -26,13 +26,13 @@ public class SolidPhysicalPropertyMethod extends PhysicalPropertyMethod {
*/
public SolidPhysicalPropertyMethod(
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface solidPhase) {
this.solidPhase = solidPhase;
setPhase(solidPhase);
}

/** {@inheritDoc} */
@Override
public void setPhase(
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface solidPhase) {
this.solidPhase = solidPhase;
neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface phase) {
this.solidPhase = phase;
}
}
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 @@ -162,7 +162,7 @@ public void setFRMSConstant(double frms) {

/**
* <p>
* Setter for the support arrangement <code>supportArrangement</code>.
* Setter for the <code>supportArrangement</code>.
* </p>
*
* @param arrangement a {@link java.lang.String} object
Expand All @@ -173,7 +173,7 @@ public void setSupportArrangement(String arrangement) {

/**
* <p>
* Setter for the support distance <code></code>.
* Setter for the <code>supportDistance</code>.
* </p>
*
* @param distance a {@link java.lang.Double} object
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 faec1d1

Please sign in to comment.