Skip to content

Commit

Permalink
fix: sometimes physical properties is not initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
asmfstatoil committed Oct 27, 2024
1 parent 5b1103a commit 844658c
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 17 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,7 +14,7 @@
public abstract class CommonPhysicalPropertyMethod extends PhysicalPropertyMethod {
private static final long serialVersionUID = 1000;

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

/**
* <p>
Expand All @@ -25,7 +25,7 @@ public abstract class CommonPhysicalPropertyMethod extends PhysicalPropertyMetho
* 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 @@ -28,7 +28,7 @@ public abstract class GasPhysicalPropertyMethod extends PhysicalPropertyMethod {
* object
*/
public GasPhysicalPropertyMethod(PhysicalProperties gasPhase) {
super(gasPhase);
setPhase(gasPhase);
binaryMolecularDiameter = new double[gasPhase.getPhase().getNumberOfComponents()][gasPhase
.getPhase().getNumberOfComponents()];
binaryMolecularMass = new double[gasPhase.getPhase().getNumberOfComponents()][gasPhase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
public abstract class LiquidPhysicalPropertyMethod extends PhysicalPropertyMethod {
private static final long serialVersionUID = 1000;

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

/**
* <p>
Expand All @@ -25,7 +25,7 @@ public abstract class LiquidPhysicalPropertyMethod extends PhysicalPropertyMetho
* {@link neqsim.physicalproperties.physicalpropertysystem.PhysicalProperties} object
*/
public LiquidPhysicalPropertyMethod(PhysicalProperties liquidPhase) {
super(liquidPhase);
setPhase(liquidPhase);
}

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

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

/**
* <p>
Expand All @@ -25,12 +25,12 @@ public abstract class SolidPhysicalPropertyMethod extends PhysicalPropertyMethod
* object
*/
public SolidPhysicalPropertyMethod(PhysicalProperties solidPhase) {
super(solidPhase);
setPhase(solidPhase);
}

/** {@inheritDoc} */
@Override
public void setPhase(PhysicalProperties solidPhase) {
this.solidPhase = solidPhase;
public void setPhase(PhysicalProperties phase) {
this.solidPhase = phase;
}
}
3 changes: 1 addition & 2 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

0 comments on commit 844658c

Please sign in to comment.