From 3e1b26a3548d71acb4973a412804bb2ef5a04db3 Mon Sep 17 00:00:00 2001 From: Even Solbraa <41290109+EvenSol@users.noreply.github.com> Date: Sun, 12 May 2024 23:33:09 +0200 Subject: [PATCH] added Cp, Cv, enthalpy, entropy (#1013) --- .../util/monitor/StreamResponse.java | 49 ++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/src/main/java/neqsim/processSimulation/util/monitor/StreamResponse.java b/src/main/java/neqsim/processSimulation/util/monitor/StreamResponse.java index ae58f95c82..2194c177ee 100644 --- a/src/main/java/neqsim/processSimulation/util/monitor/StreamResponse.java +++ b/src/main/java/neqsim/processSimulation/util/monitor/StreamResponse.java @@ -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(); @@ -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", @@ -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); }