src/energyplus/ForwardTranslator/ForwardTranslateRefrigerationCompressor.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/RefrigerationCompressor.hpp" | ||
| 9 | #include "../../model/CurveBicubic.hpp" | ||
| 10 | |||
| 11 | #include <utilities/idd/Refrigeration_Compressor_FieldEnums.hxx> | ||
| 12 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 13 | #include <utilities/idd/IddEnums.hxx> | ||
| 14 | #include <utilities/idd/IddFactory.hxx> | ||
| 15 | |||
| 16 | using namespace openstudio::model; | ||
| 17 | |||
| 18 | namespace openstudio { | ||
| 19 | |||
| 20 | namespace energyplus { | ||
| 21 | |||
| 22 | ✗ | boost::optional<IdfObject> ForwardTranslator::translateRefrigerationCompressor(RefrigerationCompressor& modelObject) { | |
| 23 | ✗ | OptionalModelObject temp; | |
| 24 | ✗ | OptionalString optS; | |
| 25 | ✗ | boost::optional<std::string> s; | |
| 26 | ✗ | boost::optional<double> d; | |
| 27 | |||
| 28 | // Name | ||
| 29 | ✗ | IdfObject object = createRegisterAndNameIdfObject(openstudio::IddObjectType::Refrigeration_Compressor, modelObject); | |
| 30 | |||
| 31 | //Refrigeration Compressor Power Curve Name | ||
| 32 | ✗ | boost::optional<CurveBicubic> powerCurve = modelObject.refrigerationCompressorPowerCurve(); | |
| 33 | |||
| 34 | ✗ | if (powerCurve) { | |
| 35 | ✗ | boost::optional<IdfObject> _powerCurve = translateAndMapModelObject(powerCurve.get()); | |
| 36 | |||
| 37 | ✗ | if (_powerCurve && _powerCurve->name()) { | |
| 38 | ✗ | object.setString(Refrigeration_CompressorFields::RefrigerationCompressorPowerCurveName, _powerCurve->name().get()); | |
| 39 | } | ||
| 40 | ✗ | } | |
| 41 | |||
| 42 | //Refrigeration Compressor Capacity Curve name | ||
| 43 | ✗ | boost::optional<CurveBicubic> capacityCurve = modelObject.refrigerationCompressorCapacityCurve(); | |
| 44 | |||
| 45 | ✗ | if (capacityCurve) { | |
| 46 | ✗ | boost::optional<IdfObject> _capacityCurve = translateAndMapModelObject(capacityCurve.get()); | |
| 47 | |||
| 48 | ✗ | if (_capacityCurve && _capacityCurve->name()) { | |
| 49 | ✗ | object.setString(Refrigeration_CompressorFields::RefrigerationCompressorCapacityCurveName, _capacityCurve->name().get()); | |
| 50 | } | ||
| 51 | ✗ | } | |
| 52 | |||
| 53 | //Rated Superheat | ||
| 54 | ✗ | d = modelObject.ratedSuperheat(); | |
| 55 | ✗ | if (d) { | |
| 56 | ✗ | object.setDouble(Refrigeration_CompressorFields::RatedSuperheat, d.get()); | |
| 57 | } | ||
| 58 | |||
| 59 | //Rated Return Gas Temperature | ||
| 60 | ✗ | d = modelObject.ratedReturnGasTemperature(); | |
| 61 | ✗ | if (d) { | |
| 62 | ✗ | object.setDouble(Refrigeration_CompressorFields::RatedReturnGasTemperature, d.get()); | |
| 63 | } | ||
| 64 | |||
| 65 | //Rated Liquid Temperature | ||
| 66 | ✗ | d = modelObject.ratedLiquidTemperature(); | |
| 67 | ✗ | if (d) { | |
| 68 | ✗ | object.setDouble(Refrigeration_CompressorFields::RatedLiquidTemperature, d.get()); | |
| 69 | } | ||
| 70 | |||
| 71 | //Rated Subcooling | ||
| 72 | ✗ | d = modelObject.ratedSubcooling(); | |
| 73 | ✗ | if (d) { | |
| 74 | ✗ | object.setDouble(Refrigeration_CompressorFields::RatedSubcooling, d.get()); | |
| 75 | } | ||
| 76 | |||
| 77 | //End-Use Subcategory | ||
| 78 | ✗ | s = modelObject.endUseSubcategory(); | |
| 79 | ✗ | if (s) { | |
| 80 | ✗ | object.setString(Refrigeration_CompressorFields::EndUseSubcategory, s.get()); | |
| 81 | } | ||
| 82 | |||
| 83 | //Mode of Operation | ||
| 84 | ✗ | s = modelObject.modeofOperation(); | |
| 85 | ✗ | if (s) { | |
| 86 | ✗ | object.setString(Refrigeration_CompressorFields::ModeofOperation, s.get()); | |
| 87 | } | ||
| 88 | |||
| 89 | //Transcritical Compressor Power Curve Name | ||
| 90 | ✗ | boost::optional<CurveBicubic> transcriticalPowerCurve = modelObject.transcriticalCompressorPowerCurve(); | |
| 91 | |||
| 92 | ✗ | if (transcriticalPowerCurve) { | |
| 93 | ✗ | boost::optional<IdfObject> _transcriticalPowerCurve = translateAndMapModelObject(transcriticalPowerCurve.get()); | |
| 94 | |||
| 95 | ✗ | if (_transcriticalPowerCurve && _transcriticalPowerCurve->name()) { | |
| 96 | ✗ | object.setString(Refrigeration_CompressorFields::TranscriticalCompressorPowerCurveName, _transcriticalPowerCurve->name().get()); | |
| 97 | } | ||
| 98 | ✗ | } | |
| 99 | |||
| 100 | //Transcritical Compressor Capacity Curve Name | ||
| 101 | ✗ | boost::optional<CurveBicubic> transcriticalCapacityCurve = modelObject.transcriticalCompressorCapacityCurve(); | |
| 102 | |||
| 103 | ✗ | if (transcriticalCapacityCurve) { | |
| 104 | ✗ | boost::optional<IdfObject> _transcriticalCapacityCurve = translateAndMapModelObject(transcriticalCapacityCurve.get()); | |
| 105 | |||
| 106 | ✗ | if (_transcriticalCapacityCurve && _transcriticalCapacityCurve->name()) { | |
| 107 | ✗ | object.setString(Refrigeration_CompressorFields::TranscriticalCompressorCapacityCurveName, _transcriticalCapacityCurve->name().get()); | |
| 108 | } | ||
| 109 | ✗ | } | |
| 110 | |||
| 111 | ✗ | return object; | |
| 112 | ✗ | } | |
| 113 | } // namespace energyplus | ||
| 114 | } // namespace openstudio | ||
| 115 |