Skip to content

Commit

Permalink
added Cp, Cv, enthalpy, entropy (#1013)
Browse files Browse the repository at this point in the history
  • Loading branch information
EvenSol authored May 12, 2024
1 parent c56695f commit 3e1b26a
Showing 1 changed file with 48 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,29 @@ public StreamResponse(StreamInterface inputStream) {
Double.toString(
inputStream.getFluid().getFlowRate(neqsim.util.unit.Units.getSymbol("volume flow"))),
neqsim.util.unit.Units.getSymbol("volume flow")));

newdata.put("heat capacity (Cp)", new Value(
Double.toString(
inputStream.getFluid().getCp(neqsim.util.unit.Units.getSymbol("Heat Capacity (Cp)"))),
neqsim.util.unit.Units.getSymbol("Heat Capacity (Cp)")));

newdata.put("heat capacity (Cv)", new Value(
Double.toString(
inputStream.getFluid().getCv(neqsim.util.unit.Units.getSymbol("Heat Capacity (Cv)"))),
neqsim.util.unit.Units.getSymbol("Heat Capacity (Cv)")));

newdata.put("enthalpy",
new Value(
Double.toString(
inputStream.getFluid().getEnthalpy(neqsim.util.unit.Units.getSymbol("enthalpy"))),
neqsim.util.unit.Units.getSymbol("enthalpy")));

newdata.put("entropy",
new Value(
Double.toString(
inputStream.getFluid().getEntropy(neqsim.util.unit.Units.getSymbol("entropy"))),
neqsim.util.unit.Units.getSymbol("entropy")));

properties.put(inputStream.getName(), newdata);
for (int i = 0; i < inputStream.getFluid().getNumberOfPhases(); i++) {
newdata = new HashMap<String, Value>();
Expand All @@ -155,6 +178,30 @@ public StreamResponse(StreamInterface inputStream) {
.getFlowRate(neqsim.util.unit.Units.getSymbol("volume flow"))),
neqsim.util.unit.Units.getSymbol("volume flow")));

newdata.put("heat capacity (Cp)",
new Value(
Double.toString(inputStream.getFluid().getPhase(name)
.getCp(neqsim.util.unit.Units.getSymbol("Heat Capacity (Cp)"))),
neqsim.util.unit.Units.getSymbol("Heat Capacity (Cp)")));

newdata.put("heat capacity (Cv)",
new Value(
Double.toString(inputStream.getFluid().getPhase(name)
.getCv(neqsim.util.unit.Units.getSymbol("Heat Capacity (Cv)"))),
neqsim.util.unit.Units.getSymbol("Heat Capacity (Cv)")));

newdata.put("enthalpy",
new Value(
Double.toString(inputStream.getFluid().getPhase(name)
.getEnthalpy(neqsim.util.unit.Units.getSymbol("enthalpy"))),
neqsim.util.unit.Units.getSymbol("enthalpy")));

newdata.put("entropy",
new Value(
Double.toString(inputStream.getFluid().getPhase(name)
.getEntropy(neqsim.util.unit.Units.getSymbol("entropy"))),
neqsim.util.unit.Units.getSymbol("entropy")));

if (name.equals("oil")) {
try {
newdata.put("TVP",
Expand Down Expand Up @@ -190,7 +237,7 @@ public StreamResponse(StreamInterface inputStream) {
.getFlowRate(neqsim.util.unit.Units.getSymbol("standard volume flow"))),
neqsim.util.unit.Units.getSymbol("standard volume flow")));
newdata.put("relative density",
new Value(Double.toString(standard.getValue("RelativeDensity") / 1e3), "[-]"));
new Value(Double.toString(standard.getValue("RelativeDensity")), "[-]"));
}
properties.put(name, newdata);
}
Expand Down

0 comments on commit 3e1b26a

Please sign in to comment.