| 8750 | } |
| 8751 | |
| 8752 | boost::optional<pugi::xml_node> ForwardTranslator::translateFanConstantVolume(const openstudio::model::FanConstantVolume& fan, |
| 8753 | pugi::xml_node& airSegElement) { |
| 8754 | auto result = airSegElement.append_child("Fan"); |
| 8755 | m_translatedObjects[fan.handle()] = result; |
| 8756 | |
| 8757 | // CtrlMthd |
| 8758 | auto ctrlMthdElement = result.append_child("CtrlMthdSim"); |
| 8759 | ctrlMthdElement.text() = "ConstantVolume"; |
| 8760 | |
| 8761 | // Class - Centrifugal | Axial |
| 8762 | // TODO Define a way to deterimine or specify |
| 8763 | auto classElement = result.append_child("Class"); |
| 8764 | classElement.text() = "Axial"; |
| 8765 | |
| 8766 | // ModelingMthd |
| 8767 | auto modelingMthdElement = result.append_child("ModelingMthd"); |
| 8768 | modelingMthdElement.text() = "StaticPressure"; |
| 8769 | |
| 8770 | // FlowCap |
| 8771 | if (fan.isMaximumFlowRateAutosized()) { |
| 8772 | m_autoHardSize = true; |
| 8773 | } else if (auto value = fan.maximumFlowRate()) { |
| 8774 | auto flowCapElement = result.append_child("FlowCap"); |
| 8775 | // Note JM 2019-01-16: I use string_conversions::number here to mimic QString::number's number of decimals |
| 8776 | flowCapElement.text() = openstudio::string_conversions::number(convert(value.get(), "m^3/s", "cfm").get()).c_str(); |
| 8777 | } |
| 8778 | |
| 8779 | // FlowEff |
| 8780 | auto flowEffElement = result.append_child("FlowEff"); |
| 8781 | flowEffElement.text() = openstudio::string_conversions::number(fan.fanEfficiency()).c_str(); |
| 8782 | |
| 8783 | // TotStaticPress |
| 8784 | auto totStaticPressElement = result.append_child("TotStaticPress"); |
| 8785 | // Convert in PA to WC |
| 8786 | totStaticPressElement.text() = openstudio::string_conversions::number(fan.pressureRise() / 249.0889).c_str(); |
| 8787 | |
| 8788 | // MtrEff |
| 8789 | auto mtrEffElement = result.append_child("MtrEff"); |
| 8790 | mtrEffElement.text() = openstudio::string_conversions::number(fan.motorEfficiency()).c_str(); |
| 8791 | |
| 8792 | // MtrPos |
| 8793 | auto mtrPosElement = result.append_child("MtrfPos"); |
| 8794 | if (fan.motorInAirstreamFraction() >= 0.5) { |
| 8795 | mtrPosElement.text() = "InAirStream"; |
| 8796 | } else { |
| 8797 | mtrPosElement.text() = "NotInAirStream"; |
| 8798 | } |
| 8799 | |
| 8800 | return result; |
| 8801 | } |
| 8802 | |
| 8803 | } // namespace sdd |
| 8804 | } // namespace openstudio |
nothing calls this directly
no test coverage detected