12 : hotOutlet(hotOutlet), coldOutlet(coldOutlet) {}
17 stream <<
"HeatExchanger::Output[" <<
"hotOutlet=" << output.hotOutlet <<
", coldOutlet=" << output.coldOutlet
22 friend std::ostream& operator<<(std::ostream& stream,
const std::shared_ptr<HeatExchanger::Output>& turbine) {
23 if (turbine ==
nullptr) {
24 stream <<
"HeatExchanger::Output[nullptr]";
40 : hotInlet(hotInlet), coldInlet(coldInlet), approachTemp(approachTemp) {}
43 auto sp =
SteamProperties(hotInlet.pressure, SteamProperties::ThermodynamicQuantity::TEMPERATURE,
44 coldInlet.temperature + approachTemp)
50 double heatExchanged = hotInlet.energyFlow - hotOutletTest.energyFlow;
52 sp =
SteamProperties(coldInlet.pressure, SteamProperties::ThermodynamicQuantity::ENTHALPY,
53 (coldInlet.energyFlow + heatExchanged) / coldInlet.massFlow)
59 if (fabs((hotOutletTest.temperature - coldInlet.temperature) - approachTemp) > .0001) {
60 sp =
SteamProperties(coldInlet.pressure, SteamProperties::ThermodynamicQuantity::TEMPERATURE,
61 hotInlet.temperature - approachTemp)
65 coldInlet.massFlow * sp.specificEnthalpy, sp);
67 heatExchanged = coldOutletTest.energyFlow - coldInlet.energyFlow;
68 sp =
SteamProperties(hotInlet.pressure, SteamProperties::ThermodynamicQuantity::ENTHALPY,
69 (hotInlet.energyFlow - heatExchanged) / hotInlet.massFlow)
75 return {hotOutletTest, coldOutletTest};
80 const double approachTemp;