Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
asmfstatoil committed Oct 27, 2024
1 parent 52218a3 commit fc06a09
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

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

/**
* <p>
Expand All @@ -26,12 +25,8 @@ public abstract class PhysicalPropertyMethod implements PhysicalPropertyMethodIn
* <p>
* Constructor for PhysicalPropertyMethod.
* </p>
*
* @param phase a {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties} object
*/
public PhysicalPropertyMethod(PhysicalProperties phase) {
setPhase(phase);
}
public PhysicalPropertyMethod() {}

/** {@inheritDoc} */
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,19 @@
public abstract class CommonPhysicalPropertyMethod extends PhysicalPropertyMethod {
private static final long serialVersionUID = 1000;

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

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

/** {@inheritDoc} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,19 @@
public abstract class LiquidPhysicalPropertyMethod extends PhysicalPropertyMethod {
private static final long serialVersionUID = 1000;

protected PhysicalProperties liquidPhase;
protected neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties liquidPhase;

/**
* <p>
* Constructor for LiquidPhysicalPropertyMethod.
* </p>
*
* @param liquidPhase a
* {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties} object
* {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface}
* object
*/
public LiquidPhysicalPropertyMethod(PhysicalProperties liquidPhase) {
super(liquidPhase);
setPhase(liquidPhase);
}

/** {@inheritDoc} */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package neqsim.physicalproperties.physicalpropertymethods.solidphysicalproperties;

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

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

protected PhysicalProperties solidPhase;
protected neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties solidPhase;

/**
* <p>
* Constructor for SolidPhysicalPropertyMethod.
* </p>
*
* @param solidPhase a {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties}
* @param solidPhase a
* {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalPropertiesInterface}
* object
*/
public SolidPhysicalPropertyMethod(PhysicalProperties solidPhase) {
super(solidPhase);
public SolidPhysicalPropertyMethod(
neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties solidPhase) {
setPhase(solidPhase);
}

/** {@inheritDoc} */
@Override
public void setPhase(PhysicalProperties solidPhase) {
this.solidPhase = solidPhase;
public void setPhase(neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties phase) {
this.solidPhase = phase;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ public void calcDesign() {
// double moduleWidth = 0.0, moduleHeight = 0.0, moduleLength = 0.0;
double materialsCost = 0.0;
double gasDensity = ((SeparatorInterface) getProcessEquipment()).getThermoSystem().getPhase(0)
.getDensity("kg/m3");
.getPhysicalProperties().getDensity();

double liqDensity = ((SeparatorInterface) getProcessEquipment()).getThermoSystem().getPhase(1)
.getDensity("kg/m3");
.getPhysicalProperties().getDensity();
double liqViscosity = ((SeparatorInterface) getProcessEquipment()).getThermoSystem().getPhase(1)
.getPhysicalProperties().getViscosity();
if (((SeparatorInterface) getProcessEquipment()).getThermoSystem().getNumberOfPhases() == 1) {
Expand Down
21 changes: 2 additions & 19 deletions src/main/java/neqsim/thermo/phase/Phase.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import org.apache.logging.log4j.Logger;
import neqsim.physicalproperties.PhysicalPropertyHandler;
import neqsim.physicalproperties.PhysicalPropertyType;
import neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties;
import neqsim.thermo.ThermodynamicConstantsInterface;
import neqsim.thermo.ThermodynamicModelSettings;
import neqsim.thermo.component.ComponentInterface;
Expand Down Expand Up @@ -426,7 +425,7 @@ public void setTemperature(double temp) {

/** {@inheritDoc} */
@Override
public PhysicalProperties getPhysicalProperties() {
public neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties getPhysicalProperties() {
if (physicalPropertyHandler == null) {
initPhysicalProperties();
return physicalPropertyHandler.getPhysicalProperty(this);
Expand Down Expand Up @@ -1212,9 +1211,6 @@ public double getEntropydT() {
/** {@inheritDoc} */
@Override
public double getViscosity() {
if (getPhysicalProperties() == null) {
initPhysicalProperties(PhysicalPropertyType.DYNAMIC_VISCOSITY);
}
return getPhysicalProperties().getViscosity();
}

Expand All @@ -1240,9 +1236,6 @@ public double getViscosity(String unit) {
/** {@inheritDoc} */
@Override
public double getThermalConductivity() {
if (getPhysicalProperties() == null) {
initPhysicalProperties(PhysicalPropertyType.THERMAL_CONDUCTIVITY);
}
return getPhysicalProperties().getConductivity();
}

Expand Down Expand Up @@ -1649,23 +1642,13 @@ public double getJouleThomsonCoefficient() {
/** {@inheritDoc} */
@Override
public double getDensity() {
/*
* if (getPhysicalProperties() == null) {
* initPhysicalProperties(PhysicalPropertyType.MASS_DENSITY); }
*
* return getPhysicalProperties().getDensity();
*/
return 1.0 / getMolarVolume() * getMolarMass() * 1.0e5;
}

/** {@inheritDoc} */
@Override
public double getDensity(String unit) {
// double refDensity = getDensity(); // density in kg/m3
if (getPhysicalProperties() == null) {
initPhysicalProperties(PhysicalPropertyType.MASS_DENSITY);
}
double refDensity = getPhysicalProperties().getDensity();
double refDensity = getPhysicalProperties().getDensity(); // density in kg/m3
double conversionFactor = 1.0;
switch (unit) {
case "kg/m3":
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/neqsim/thermo/phase/PhaseGEWilson.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ public void addComponent(String name, double moles, double molesInPhase, int com
componentArray[compNumber] = new ComponentGEWilson(name, moles, molesInPhase, compNumber);
}

/** {@inheritDoc} */
@Override
public void setMixingRule(int type) {
super.setMixingRule(type);
}

/** {@inheritDoc} */
@Override
public double getGibbsEnergy() {
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/neqsim/thermo/system/SystemThermo.java
Original file line number Diff line number Diff line change
Expand Up @@ -1883,9 +1883,6 @@ public double getDensity() {
public double getDensity(String unit) {
double density = 0;
for (int i = 0; i < getNumberOfPhases(); i++) {
if (getPhase(i).getPhysicalProperties() == null) {
getPhase(i).initPhysicalProperties(PhysicalPropertyType.MASS_DENSITY);
}
density +=
getPhase(i).getVolume() / getVolume() * getPhase(i).getPhysicalProperties().getDensity();
}
Expand Down

0 comments on commit fc06a09

Please sign in to comment.