1 #ifndef AMO_TOOLS_SUITE_HEATEXCHANGER_H 2 #define AMO_TOOLS_SUITE_HEATEXCHANGER_H 5 #include "SteamProperties.h" 12 : hotOutlet(hotOutlet), coldOutlet(coldOutlet)
18 stream <<
"HeatExchanger::Output[" 19 <<
"hotOutlet=" << output.hotOutlet
20 <<
", coldOutlet=" << output.coldOutlet
25 friend std::ostream &operator<<(std::ostream &stream, const std::shared_ptr<HeatExchanger::Output> &turbine) {
26 if (turbine ==
nullptr) {
27 stream <<
"HeatExchanger::Output[nullptr]";
42 const double approachTemp = 20
44 : hotInlet(hotInlet), coldInlet(coldInlet), approachTemp(approachTemp)
49 hotInlet.pressure, SteamProperties::ThermodynamicQuantity::TEMPERATURE,
50 coldInlet.temperature + approachTemp
54 hotInlet.massFlow, hotInlet.massFlow * sp.specificEnthalpy, sp
57 double heatExchanged = hotInlet.energyFlow - hotOutletTest.energyFlow;
60 coldInlet.pressure, SteamProperties::ThermodynamicQuantity::ENTHALPY,
61 (coldInlet.energyFlow + heatExchanged) / coldInlet.massFlow
65 coldInlet.massFlow, coldInlet.massFlow * sp.specificEnthalpy, sp
68 if (fabs((hotOutletTest.temperature - coldInlet.temperature) - approachTemp) > .0001) {
70 coldInlet.pressure, SteamProperties::ThermodynamicQuantity::TEMPERATURE,
71 hotInlet.temperature - approachTemp
75 coldInlet.massFlow, coldInlet.massFlow * sp.specificEnthalpy, sp
78 heatExchanged = coldOutletTest.energyFlow - coldInlet.energyFlow;
80 hotInlet.pressure, SteamProperties::ThermodynamicQuantity::ENTHALPY,
81 (hotInlet.energyFlow - heatExchanged) / hotInlet.massFlow
85 hotInlet.massFlow, hotInlet.massFlow * sp.specificEnthalpy, sp
88 return {hotOutletTest, coldOutletTest};
92 const double approachTemp;
95 #endif //AMO_TOOLS_SUITE_HEATEXCHANGER_H
HeatExchanger(const SteamSystemModelerTool::FluidProperties hotInlet, const SteamSystemModelerTool::FluidProperties coldInlet, const double approachTemp=20)
SteamSystemModelerTool::SteamPropertiesOutput calculate()