Skip to content

Commit f048db7

Browse files
authored
add temperature dependent volume correction for gas (#1036)
* add temperature dependent volume correction for gas * Update Density.java * Update Density.java
1 parent 94579af commit f048db7

File tree

1 file changed

+6
-5
lines changed
  • src/main/java/neqsim/physicalProperties/physicalPropertyMethods/gasPhysicalProperties/density

1 file changed

+6
-5
lines changed

src/main/java/neqsim/physicalProperties/physicalPropertyMethods/gasPhysicalProperties/density/Density.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,21 @@ public Density clone() {
6161
/**
6262
* {@inheritDoc}
6363
*
64-
* <p>
6564
* Returns the density of the phase. Unit: kg/m^3
66-
* </p>
6765
*/
6866
@Override
6967
public double calcDensity() {
70-
double tempVar = 0;
68+
double tempVar = 0.0;
7169
if (gasPhase.getPhase().useVolumeCorrection()) {
7270
for (int i = 0; i < gasPhase.getPhase().getNumberOfComponents(); i++) {
7371
tempVar += gasPhase.getPhase().getComponents()[i].getx()
74-
* gasPhase.getPhase().getComponents()[i].getVolumeCorrection();
72+
* (gasPhase.getPhase().getComponents()[i].getVolumeCorrection()
73+
+ gasPhase.getPhase().getComponents()[i].getVolumeCorrectionT()
74+
* (gasPhase.getPhase().getTemperature() - 288.15));
7575
}
7676
}
77+
// System.out.println("density correction tempvar " + tempVar);
7778
return 1.0 / (gasPhase.getPhase().getMolarVolume() - tempVar)
78-
* gasPhase.getPhase().getMolarMass() * 1e5;
79+
* gasPhase.getPhase().getMolarMass() * 1.0e5;
7980
}
8081
}

0 commit comments

Comments
 (0)