src/energyplus/ForwardTranslator/ForwardTranslateElectricLoadCenterStorageSimple.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 | |||
| 8 | #include "../../model/Model.hpp" | ||
| 9 | #include "../../model/ElectricLoadCenterStorageSimple.hpp" | ||
| 10 | #include "../../model/ElectricLoadCenterStorageSimple_Impl.hpp" | ||
| 11 | |||
| 12 | #include "../../model/Schedule.hpp" | ||
| 13 | #include "../../model/Schedule_Impl.hpp" | ||
| 14 | #include "../../model/ThermalZone.hpp" | ||
| 15 | #include "../../model/ThermalZone_Impl.hpp" | ||
| 16 | |||
| 17 | #include <utilities/idd/ElectricLoadCenter_Storage_Simple_FieldEnums.hxx> | ||
| 18 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 19 | #include <utilities/idd/IddEnums.hxx> | ||
| 20 | |||
| 21 | using namespace openstudio::model; | ||
| 22 | |||
| 23 | using namespace std; | ||
| 24 | |||
| 25 | namespace openstudio { | ||
| 26 | |||
| 27 | namespace energyplus { | ||
| 28 | |||
| 29 | ✗ | boost::optional<IdfObject> ForwardTranslator::translateElectricLoadCenterStorageSimple(model::ElectricLoadCenterStorageSimple& modelObject) { | |
| 30 | ✗ | IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::ElectricLoadCenter_Storage_Simple, modelObject); | |
| 31 | |||
| 32 | ✗ | if (modelObject.name()) { | |
| 33 | ✗ | idfObject.setString(ElectricLoadCenter_Storage_SimpleFields::Name, modelObject.name().get()); | |
| 34 | } | ||
| 35 | |||
| 36 | // Availability Schedule, defaults to model.alwaysOnDiscrete | ||
| 37 | ✗ | Schedule sched = modelObject.availabilitySchedule(); | |
| 38 | ✗ | boost::optional<IdfObject> _sched = translateAndMapModelObject(sched); | |
| 39 | ✗ | if (_sched) { | |
| 40 | ✗ | idfObject.setString(ElectricLoadCenter_Storage_SimpleFields::AvailabilityScheduleName, _sched->name().get()); | |
| 41 | } | ||
| 42 | |||
| 43 | // ZoneName | ||
| 44 | ✗ | if (modelObject.thermalZone() && modelObject.thermalZone().get().name()) { | |
| 45 | ✗ | idfObject.setString(ElectricLoadCenter_Storage_SimpleFields::ZoneName, modelObject.thermalZone().get().name().get()); | |
| 46 | } | ||
| 47 | |||
| 48 | // Radiative Fraction, defaults (double) | ||
| 49 | { | ||
| 50 | ✗ | double value = modelObject.radiativeFractionforZoneHeatGains(); | |
| 51 | ✗ | idfObject.setDouble(ElectricLoadCenter_Storage_SimpleFields::RadiativeFractionforZoneHeatGains, value); | |
| 52 | } | ||
| 53 | |||
| 54 | // nominalEnergeticEfficiencyforCharging, defaults | ||
| 55 | { | ||
| 56 | ✗ | double value = modelObject.nominalEnergeticEfficiencyforCharging(); | |
| 57 | ✗ | idfObject.setDouble(ElectricLoadCenter_Storage_SimpleFields::NominalEnergeticEfficiencyforCharging, value); | |
| 58 | } | ||
| 59 | |||
| 60 | // nominalEnergeticEfficiencyforDischarging, defaults | ||
| 61 | { | ||
| 62 | ✗ | double value = modelObject.nominalDischargingEnergeticEfficiency(); | |
| 63 | ✗ | idfObject.setDouble(ElectricLoadCenter_Storage_SimpleFields::NominalDischargingEnergeticEfficiency, value); | |
| 64 | } | ||
| 65 | |||
| 66 | // maximumStorageCapacity, required, assigned in ctor | ||
| 67 | { | ||
| 68 | ✗ | double value = modelObject.maximumStorageCapacity(); | |
| 69 | ✗ | idfObject.setDouble(ElectricLoadCenter_Storage_SimpleFields::MaximumStorageCapacity, value); | |
| 70 | } | ||
| 71 | |||
| 72 | // maximumPowerforDischarging, required, assigned in ctor | ||
| 73 | { | ||
| 74 | ✗ | double value = modelObject.maximumPowerforDischarging(); | |
| 75 | ✗ | idfObject.setDouble(ElectricLoadCenter_Storage_SimpleFields::MaximumPowerforDischarging, value); | |
| 76 | } | ||
| 77 | |||
| 78 | // maximumPowerforCharging, required, assigned in ctor | ||
| 79 | { | ||
| 80 | ✗ | double value = modelObject.maximumPowerforCharging(); | |
| 81 | ✗ | idfObject.setDouble(ElectricLoadCenter_Storage_SimpleFields::MaximumPowerforCharging, value); | |
| 82 | } | ||
| 83 | |||
| 84 | // initialStateofCharge | ||
| 85 | { | ||
| 86 | ✗ | double value = modelObject.initialStateofCharge(); | |
| 87 | ✗ | idfObject.setDouble(ElectricLoadCenter_Storage_SimpleFields::InitialStateofCharge, value); | |
| 88 | } | ||
| 89 | |||
| 90 | ✗ | return idfObject; | |
| 91 | ✗ | } | |
| 92 | |||
| 93 | } // namespace energyplus | ||
| 94 | |||
| 95 | } // namespace openstudio | ||
| 96 |