13 : hotOutlet(hotOutlet), coldOutlet(coldOutlet) {}
18 stream <<
"HeatExchanger::Output[" <<
"hotOutlet=" << output.hotOutlet <<
", coldOutlet=" << output.coldOutlet
23 friend std::ostream& operator<<(std::ostream& stream,
const std::shared_ptr<HeatExchanger::Output>& turbine) {
24 if (turbine ==
nullptr) {
25 stream <<
"HeatExchanger::Output[nullptr]";
41 : hotInlet(hotInlet), coldInlet(coldInlet), approachTemp(approachTemp) {}
44 auto sp =
SteamProperties(hotInlet.pressure, SteamProperties::ThermodynamicQuantity::TEMPERATURE,
45 coldInlet.temperature + approachTemp)
51 double heatExchanged = hotInlet.energyFlow - hotOutletTest.energyFlow;
53 sp =
SteamProperties(coldInlet.pressure, SteamProperties::ThermodynamicQuantity::ENTHALPY,
54 (coldInlet.energyFlow + heatExchanged) / coldInlet.massFlow)
60 if (fabs((hotOutletTest.temperature - coldInlet.temperature) - approachTemp) > .0001) {
61 sp =
SteamProperties(coldInlet.pressure, SteamProperties::ThermodynamicQuantity::TEMPERATURE,
62 hotInlet.temperature - approachTemp)
66 coldInlet.massFlow * sp.specificEnthalpy, sp);
68 heatExchanged = coldOutletTest.energyFlow - coldInlet.energyFlow;
69 sp =
SteamProperties(hotInlet.pressure, SteamProperties::ThermodynamicQuantity::ENTHALPY,
70 (hotInlet.energyFlow - heatExchanged) / hotInlet.massFlow)
76 return {hotOutletTest, coldOutletTest};
81 const double approachTemp;