src/energyplus/ForwardTranslator/ForwardTranslateCoilHeatingDXVariableRefrigerantFlow.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*********************************************************************************************************************** | ||
| 2 | * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC. | ||
| 3 | * See also https://openstudio.net/license | ||
| 4 | ***********************************************************************************************************************/ | ||
| 5 | |||
| 6 | #include "../ForwardTranslator.hpp" | ||
| 7 | #include "../../model/Model.hpp" | ||
| 8 | #include "../../model/Schedule.hpp" | ||
| 9 | #include "../../model/Schedule_Impl.hpp" | ||
| 10 | #include "../../model/Node.hpp" | ||
| 11 | #include "../../model/Node_Impl.hpp" | ||
| 12 | #include "../../model/ThermalZone.hpp" | ||
| 13 | #include "../../model/ThermalZone_Impl.hpp" | ||
| 14 | #include "../../model/CoilHeatingDXVariableRefrigerantFlow.hpp" | ||
| 15 | #include "../../model/CoilHeatingDXVariableRefrigerantFlow_Impl.hpp" | ||
| 16 | #include "../../model/Curve.hpp" | ||
| 17 | #include "../../model/Curve_Impl.hpp" | ||
| 18 | #include "../../model/CurveBiquadratic.hpp" | ||
| 19 | #include "../../model/CurveBiquadratic_Impl.hpp" | ||
| 20 | #include "../../model/CurveCubic.hpp" | ||
| 21 | #include "../../model/CurveCubic_Impl.hpp" | ||
| 22 | #include "../../utilities/core/Logger.hpp" | ||
| 23 | #include "../../utilities/core/Assert.hpp" | ||
| 24 | #include <utilities/idd/Coil_Heating_DX_VariableRefrigerantFlow_FieldEnums.hxx> | ||
| 25 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 26 | #include <utilities/idd/IddEnums.hxx> | ||
| 27 | |||
| 28 | using namespace openstudio::model; | ||
| 29 | |||
| 30 | using namespace std; | ||
| 31 | |||
| 32 | namespace openstudio { | ||
| 33 | |||
| 34 | namespace energyplus { | ||
| 35 | |||
| 36 | 24 | boost::optional<IdfObject> ForwardTranslator::translateCoilHeatingDXVariableRefrigerantFlow(CoilHeatingDXVariableRefrigerantFlow& modelObject) { | |
| 37 | 24 | boost::optional<std::string> s; | |
| 38 | 24 | boost::optional<double> value; | |
| 39 | |||
| 40 |
2/2✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
|
24 | IdfObject idfObject(IddObjectType::Coil_Heating_DX_VariableRefrigerantFlow); |
| 41 | |||
| 42 |
1/1✓ Branch 1 taken 24 times.
|
24 | m_idfObjects.push_back(idfObject); |
| 43 | |||
| 44 | // Name | ||
| 45 | |||
| 46 |
1/1✓ Branch 1 taken 24 times.
|
24 | s = modelObject.name(); |
| 47 |
1/2✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
|
24 | if (s) { |
| 48 |
2/2✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
|
24 | idfObject.setName(*s); |
| 49 | } | ||
| 50 | |||
| 51 | // AvailabilitySchedule | ||
| 52 | |||
| 53 |
3/4✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 8 taken 24 times.
✗ Branch 9 not taken.
|
48 | if (boost::optional<model::Schedule> schedule = modelObject.availabilitySchedule()) { |
| 54 |
3/4✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 6 taken 24 times.
✗ Branch 7 not taken.
|
48 | if (boost::optional<IdfObject> _schedule = translateAndMapModelObject(schedule.get())) { |
| 55 |
4/4✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 7 taken 24 times.
✓ Branch 10 taken 24 times.
|
24 | idfObject.setString(Coil_Heating_DX_VariableRefrigerantFlowFields::AvailabilitySchedule, _schedule->name().get()); |
| 56 | 24 | } | |
| 57 | 24 | } | |
| 58 | |||
| 59 | // RatedTotalHeatingCapacity | ||
| 60 | |||
| 61 |
2/3✓ Branch 1 taken 24 times.
✓ Branch 3 taken 24 times.
✗ Branch 4 not taken.
|
24 | if (modelObject.isRatedTotalHeatingCapacityAutosized()) { |
| 62 |
2/2✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
|
48 | idfObject.setString(Coil_Heating_DX_VariableRefrigerantFlowFields::GrossRatedHeatingCapacity, "Autosize"); |
| 63 | ✗ | } else if ((value = modelObject.ratedTotalHeatingCapacity())) { | |
| 64 | ✗ | idfObject.setDouble(Coil_Heating_DX_VariableRefrigerantFlowFields::GrossRatedHeatingCapacity, value.get()); | |
| 65 | } | ||
| 66 | |||
| 67 | // RatedAirFlowRate | ||
| 68 | |||
| 69 |
2/3✓ Branch 1 taken 24 times.
✓ Branch 3 taken 24 times.
✗ Branch 4 not taken.
|
24 | if (modelObject.isRatedAirFlowRateAutosized()) { |
| 70 |
2/2✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
|
48 | idfObject.setString(Coil_Heating_DX_VariableRefrigerantFlowFields::RatedAirFlowRate, "Autosize"); |
| 71 | ✗ | } else if ((value = modelObject.ratedAirFlowRate())) { | |
| 72 | ✗ | idfObject.setDouble(Coil_Heating_DX_VariableRefrigerantFlowFields::RatedAirFlowRate, value.get()); | |
| 73 | } | ||
| 74 | |||
| 75 | // HeatingCapacityRatioModifierFunctionofTemperatureCurveName | ||
| 76 | |||
| 77 |
3/4✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 8 taken 24 times.
✗ Branch 9 not taken.
|
48 | if (boost::optional<model::Curve> curve = modelObject.heatingCapacityRatioModifierFunctionofTemperatureCurve()) { |
| 78 |
3/4✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 6 taken 24 times.
✗ Branch 7 not taken.
|
48 | if (boost::optional<IdfObject> _curve = translateAndMapModelObject(curve.get())) { |
| 79 | 24 | idfObject.setString(Coil_Heating_DX_VariableRefrigerantFlowFields::HeatingCapacityRatioModifierFunctionofTemperatureCurveName, | |
| 80 |
4/4✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 7 taken 24 times.
✓ Branch 10 taken 24 times.
|
24 | _curve->name().get()); |
| 81 | 24 | } | |
| 82 | 24 | } | |
| 83 | |||
| 84 | // HeatingCapacityModifierFunctionofFlowFractionCurveName | ||
| 85 | |||
| 86 |
3/4✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 8 taken 24 times.
✗ Branch 9 not taken.
|
48 | if (boost::optional<model::Curve> curve = modelObject.heatingCapacityModifierFunctionofFlowFractionCurve()) { |
| 87 |
3/4✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 6 taken 24 times.
✗ Branch 7 not taken.
|
48 | if (boost::optional<IdfObject> _curve = translateAndMapModelObject(curve.get())) { |
| 88 | 24 | idfObject.setString(Coil_Heating_DX_VariableRefrigerantFlowFields::HeatingCapacityModifierFunctionofFlowFractionCurveName, | |
| 89 |
4/4✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 7 taken 24 times.
✓ Branch 10 taken 24 times.
|
24 | _curve->name().get()); |
| 90 | 24 | } | |
| 91 | 24 | } | |
| 92 | |||
| 93 | // TODO CoilAirInletNode | ||
| 94 | // TODO CoilAirOutletNode | ||
| 95 | |||
| 96 |
1/1✓ Branch 1 taken 24 times.
|
48 | return idfObject; |
| 97 | 24 | } | |
| 98 | |||
| 99 | } // namespace energyplus | ||
| 100 | |||
| 101 | } // namespace openstudio | ||
| 102 |