boost::optional<IdfObject> ForwardTranslator::translateCoilHeatingDXVariableSpeedWithoutUnitary( CoilHeatingDXVariableSpeed & modelObject )
{
  boost::optional<std::string> s;
  boost::optional<double> value;

  // Name
  IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::Coil_Heating_DX_VariableSpeed, modelObject);

  // IndoorAirInletNodeName
  if( auto node = modelObject.inletModelObject() ) {
    idfObject.setString(Coil_Heating_DX_VariableSpeedFields::IndoorAirInletNodeName,node->name().get());
  }  

  // IndoorAirOutletNodeName
  if( auto node = modelObject.outletModelObject() ) {
    idfObject.setString(Coil_Heating_DX_VariableSpeedFields::IndoorAirOutletNodeName,node->name().get());
  }

  // NominalSpeedLevel
  if( auto speedLevel = modelObject.nominalSpeedLevel() ) {
    idfObject.setInt(Coil_Heating_DX_VariableSpeedFields::NominalSpeedLevel,speedLevel);
  }

  // RatedHeatingCapacityAtSelectedNominalSpeedLevel
  if( modelObject.isRatedHeatingCapacityAtSelectedNominalSpeedLevelAutosized() ) {
    idfObject.setString(Coil_Heating_DX_VariableSpeedFields::RatedHeatingCapacityAtSelectedNominalSpeedLevel,"AutoSize");
  } else if( (value = modelObject.ratedHeatingCapacityAtSelectedNominalSpeedLevel()) ) {
    idfObject.setDouble(Coil_Heating_DX_VariableSpeedFields::RatedHeatingCapacityAtSelectedNominalSpeedLevel,value.get());
  }

  // RatedAirFlowRateAtSelectedNominalSpeedLevel
  if( modelObject.isRatedAirFlowRateAtSelectedNominalSpeedLevelAutosized() ) {
    idfObject.setString(Coil_Heating_DX_VariableSpeedFields::RatedAirFlowRateAtSelectedNominalSpeedLevel,"AutoSize");
  } else if( (value = modelObject.ratedAirFlowRateAtSelectedNominalSpeedLevel()) ) {
    idfObject.setDouble(Coil_Heating_DX_VariableSpeedFields::RatedAirFlowRateAtSelectedNominalSpeedLevel,value.get());
  }

  // EnergyPartLoadFractionCurveName
  { 
    auto curve = modelObject.energyPartLoadFractionCurve();
    if( auto _curve = translateAndMapModelObject(curve) ) {
      idfObject.setString(Coil_Heating_DX_VariableSpeedFields::EnergyPartLoadFractionCurveName,_curve->name().get());
    }
  }

  // DefrostEnergyInputRatioFunctionofTemperatureCurveName
  if( auto curve = modelObject.defrostEnergyInputRatioFunctionofTemperatureCurve() ) {
    if( auto _curve = translateAndMapModelObject(curve.get()) ) {
      idfObject.setString(Coil_Heating_DX_VariableSpeedFields::DefrostEnergyInputRatioFunctionofTemperatureCurveName,_curve->name().get());
    }
  }

  // MinimumOutdoorDryBulbTemperatureforCompressorOperation
  if( (value = modelObject.minimumOutdoorDryBulbTemperatureforCompressorOperation()) ) {
    idfObject.setDouble(Coil_Heating_DX_VariableSpeedFields::MinimumOutdoorDryBulbTemperatureforCompressorOperation,value.get());
  }

  // OutdoorDryBulbTemperaturetoTurnOnCompressor
  if( (value = modelObject.outdoorDryBulbTemperaturetoTurnOnCompressor()) ) {
    idfObject.setDouble(Coil_Heating_DX_VariableSpeedFields::OutdoorDryBulbTemperaturetoTurnOnCompressor,value.get());
  }

  // MaximumOutdoorDryBulbTemperatureforDefrostOperation
  if( (value = modelObject.maximumOutdoorDryBulbTemperatureforDefrostOperation()) ) {
    idfObject.setDouble(Coil_Heating_DX_VariableSpeedFields::MaximumOutdoorDryBulbTemperatureforDefrostOperation,value.get());
  }

  // CrankcaseHeaterCapacity
  if( (value = modelObject.crankcaseHeaterCapacity()) ) {
    idfObject.setDouble(Coil_Heating_DX_VariableSpeedFields::CrankcaseHeaterCapacity,value.get());
  }

  // MaximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation
  if( (value = modelObject.maximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation()) ) {
    idfObject.setDouble(Coil_Heating_DX_VariableSpeedFields::MaximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation,value.get());
  }

  // DefrostStrategy
  if( (s = modelObject.defrostStrategy()) ) {
    idfObject.setString(Coil_Heating_DX_VariableSpeedFields::DefrostStrategy,s.get());
  }

  // DefrostControl
  if( (s = modelObject.defrostControl()) ) {
    idfObject.setString(Coil_Heating_DX_VariableSpeedFields::DefrostControl,s.get());
  }

  // DefrostTimePeriodFraction
  if( (value = modelObject.defrostTimePeriodFraction()) ) {
    idfObject.setDouble(Coil_Heating_DX_VariableSpeedFields::DefrostTimePeriodFraction,value.get());
  }

  // ResistiveDefrostHeaterCapacity
  if( modelObject.isResistiveDefrostHeaterCapacityAutosized() ) {
    idfObject.setString(Coil_Heating_DX_VariableSpeedFields::ResistiveDefrostHeaterCapacity,"AutoSize");
  } else if( (value = modelObject.resistiveDefrostHeaterCapacity()) ) {
    idfObject.setDouble(Coil_Heating_DX_VariableSpeedFields::ResistiveDefrostHeaterCapacity,value.get());
  }
  
  auto const speeds = modelObject.speeds();
  
  // NumberofSpeeds
  if( auto num = speeds.size() ) {
    idfObject.setInt(Coil_Heating_DX_VariableSpeedFields::NumberofSpeeds,num);
  }

  for( auto const & speed : speeds ) {
    auto eg = idfObject.pushExtensibleGroup();

    // SpeedReferenceUnitGrossRatedHeatingCapacity
    if( (value = speed.referenceUnitGrossRatedHeatingCapacity()) ) {
      eg.setDouble(Coil_Heating_DX_VariableSpeedExtensibleFields::SpeedReferenceUnitGrossRatedHeatingCapacity,value.get());
    }

    // SpeedReferenceUnitGrossRatedHeatingCOP
    if( (value = speed.referenceUnitGrossRatedHeatingCOP()) ) {
      eg.setDouble(Coil_Heating_DX_VariableSpeedExtensibleFields::SpeedReferenceUnitGrossRatedHeatingCOP,value.get());
    }

    // SpeedReferenceUnitRatedAirFlowRate
    if( (value = speed.referenceUnitRatedAirFlowRate()) ) {
      eg.setDouble(Coil_Heating_DX_VariableSpeedExtensibleFields::SpeedReferenceUnitRatedAirFlowRate,value.get());
    }

    // SpeedHeatingCapacityFunctionofTemperatureCurveName
    { 
      auto curve = speed.heatingCapacityFunctionofTemperatureCurve();
      if( auto _curve = translateAndMapModelObject(curve) ) {
        eg.setString(Coil_Heating_DX_VariableSpeedExtensibleFields::SpeedHeatingCapacityFunctionofTemperatureCurveName,_curve->name().get());
      }
    }

    // SpeedTotalHeatingCapacityFunctionofAirFlowFractionCurveName
    { 
      auto curve = speed.totalHeatingCapacityFunctionofAirFlowFractionCurve();
      if( auto _curve = translateAndMapModelObject(curve) ) {
        eg.setString(Coil_Heating_DX_VariableSpeedExtensibleFields::SpeedTotalHeatingCapacityFunctionofAirFlowFractionCurveName,_curve->name().get());
      }
    }

    // SpeedEnergyInputRatioFunctionofTemperatureCurveName
    { 
      auto curve = speed.energyInputRatioFunctionofTemperatureCurve();
      if( auto _curve = translateAndMapModelObject(curve) ) {
        eg.setString(Coil_Heating_DX_VariableSpeedExtensibleFields::SpeedEnergyInputRatioFunctionofTemperatureCurveName,_curve->name().get());
      }
    }

    // SpeedEnergyInputRatioFunctionofAirFlowFractionCurveName
    { 
      auto curve = speed.energyInputRatioFunctionofAirFlowFractionCurve();
      if( auto _curve = translateAndMapModelObject(curve) ) {
        eg.setString(Coil_Heating_DX_VariableSpeedExtensibleFields::SpeedEnergyInputRatioFunctionofAirFlowFractionCurveName,_curve->name().get());
      }
    }
  
  }

  return idfObject;
}
Пример #2
0
 RunPeriod_Impl::RunPeriod_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
   : ParentObject_Impl(idfObject, model, keepHandle)
 {
   OS_ASSERT(idfObject.iddObject().type() == RunPeriod::iddObjectType());
 }
Пример #3
0
 WeatherFile_Impl::WeatherFile_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
   : ModelObject_Impl(idfObject,model,keepHandle)
 {
   OS_ASSERT(idfObject.iddObject().type() == WeatherFile::iddObjectType());
 }
boost::optional<IdfObject> ForwardTranslator::translateFanOnOff( FanOnOff & modelObject )
{
  //setup boost optionals to use to store get method returns
  boost::optional<std::string> s;
  boost::optional<double> value;
  boost::optional<Node> node;
  OptionalModelObject mo;
  
  // Make sure the modelObject gets ut into the map, and the new idfObject gets put into the final file.
  // Also sets the idfObjects name

  IdfObject idfObject = createRegisterAndNameIdfObject(IddObjectType::Fan_OnOff,modelObject);
  
  // Model Name
  //std::string baseName = modelObject.name().get();

  //  A3 ,Field Availability Schedule Name
  boost::optional<Schedule> availabilitySchedule = modelObject.availabilitySchedule();

  if( availabilitySchedule )
  {
    boost::optional<IdfObject> _availabilitySchedule = translateAndMapModelObject(availabilitySchedule.get());

    if( _availabilitySchedule && _availabilitySchedule->name() )
    {
      idfObject.setString(Fan_OnOffFields::AvailabilityScheduleName, _availabilitySchedule->name().get());
    }
  }
  
  //  N1 ,Field Fan Efficiency
  
  value = modelObject.fanEfficiency();
  
  if( value )
  {
    idfObject.setDouble(Fan_OnOffFields::FanTotalEfficiency, *value);
  }
  
  //  N2 Pressure Rise
  
  value = modelObject.pressureRise();
  
  if( value )
  {
    idfObject.setDouble(Fan_OnOffFields::PressureRise, *value);
  }
  
  // N3,  Field Maximum Flow Rate

  value = modelObject.maximumFlowRate();
  if( value )
  {
    idfObject.setDouble(Fan_OnOffFields::MaximumFlowRate, value.get());
  }
  else
  {
    idfObject.setString(Fan_OnOffFields::MaximumFlowRate,"Autosize");
  }
  
  // N4,  Field Motor Efficiency
  
  value = modelObject.motorEfficiency();
  
  if( value )
  {
    idfObject.setDouble(Fan_OnOffFields::MotorEfficiency,*value);
  }
  
  //   N5, Field Motor In Airstream Fraction

  value = modelObject.motorInAirstreamFraction();
  
  if( value )
  {
    idfObject.setDouble(Fan_OnOffFields::MotorInAirstreamFraction, *value);
  }
  
  // A4 Air Inlet Node Name

  if( boost::optional<ModelObject> inletModelObject = modelObject.inletModelObject() )
  {
    if( boost::optional<Node> inletNode = inletModelObject->optionalCast<Node>() )
    {
      idfObject.setString(Fan_OnOffFields::AirInletNodeName, inletNode->name().get());
    }
  }

  // A5 , Field Air Outlet Node Name
  
  if( boost::optional<ModelObject> ouletModelObject = modelObject.inletModelObject() )
  {
    if( boost::optional<Node> ouletNode = ouletModelObject->optionalCast<Node>() )
    {
      idfObject.setString(Fan_OnOffFields::AirOutletNodeName, ouletNode->name().get());
    }
  }

  // A6 , Field Fan Power Ratio Function of Speed Ratio Curve Name

  boost::optional<Curve> fanPowerRatioFunctionofSpeedRatioCurve = modelObject.fanPowerRatioFunctionofSpeedRatioCurve();

  if( fanPowerRatioFunctionofSpeedRatioCurve )
  {
    boost::optional<IdfObject> _fanPowerRatioFunctionofSpeedRatioCurve = translateAndMapModelObject(fanPowerRatioFunctionofSpeedRatioCurve.get());

    if( _fanPowerRatioFunctionofSpeedRatioCurve && _fanPowerRatioFunctionofSpeedRatioCurve->name() )
    {
      idfObject.setString(Fan_OnOffFields::FanPowerRatioFunctionofSpeedRatioCurveName, _fanPowerRatioFunctionofSpeedRatioCurve->name().get());
    }
  }
  
  // A7 , Field Fan Efficiency Ratio Function of Speed Ratio Curve Name

  boost::optional<Curve> fanEfficiencyRatioFunctionofSpeedRatioCurve = modelObject.fanEfficiencyRatioFunctionofSpeedRatioCurve();

  if( fanEfficiencyRatioFunctionofSpeedRatioCurve )
  {
    boost::optional<IdfObject> _fanEfficiencyRatioFunctionofSpeedRatioCurve = translateAndMapModelObject(fanEfficiencyRatioFunctionofSpeedRatioCurve.get());

    if( _fanEfficiencyRatioFunctionofSpeedRatioCurve && _fanEfficiencyRatioFunctionofSpeedRatioCurve->name() )
    {
      idfObject.setString(Fan_OnOffFields::FanEfficiencyRatioFunctionofSpeedRatioCurveName, _fanEfficiencyRatioFunctionofSpeedRatioCurve->name().get());
    }
  }
  
  // A8 , Field End-Use Subcategory

   idfObject.setString(Fan_OnOffFields::EndUseSubcategory, modelObject.endUseSubcategory());

  return idfObject;
}
ComponentCostAdjustments_Impl::ComponentCostAdjustments_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
    : ParentObject_Impl(idfObject, model, keepHandle)
{
    OS_ASSERT(idfObject.iddObject().type() == ComponentCostAdjustments::iddObjectType());
}
Пример #6
0
 BoilerHotWater_Impl::BoilerHotWater_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
   : StraightComponent_Impl(idfObject, model, keepHandle)
 {
   OS_ASSERT(idfObject.iddObject().type() == BoilerHotWater::iddObjectType());
 }
Пример #7
0
 IlluminanceMap_Impl::IlluminanceMap_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
   : SpaceItem_Impl(idfObject,model,keepHandle)
 {
   OS_ASSERT(idfObject.iddObject().type() == IlluminanceMap::iddObjectType());
 }
boost::optional<IdfObject> ForwardTranslator::translateCentralHeatPumpSystem( CentralHeatPumpSystem& modelObject )
{
  OptionalString s;
  OptionalDouble d;
  OptionalModelObject temp;

  auto const& modules = modelObject.getImpl<model::detail::CentralHeatPumpSystem_Impl>()->modules();

  // If the CentralHeatPumpSystem doesn't have at least one CentralHeatPumpSystemModule, then it shouldn't be translated
  if (modules.empty()) {
    LOG(Warn, "CentralHeatPumpSystem " << modelObject.name().get() << " has no CentralHeatPumpSystemModules, it will not be translated");
    return boost::none;
  }

  // Name
  IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::CentralHeatPumpSystem, modelObject);

  // ControlMethod
  if( (s = modelObject.controlMethod()) ) {
    idfObject.setString(CentralHeatPumpSystemFields::ControlMethod,s.get());
  }

  // AncillaryPower
  if( (d = modelObject.ancillaryPower()) ) {
    idfObject.setDouble(CentralHeatPumpSystemFields::AncillaryPower,d.get());
  }

  // AncillaryOperationScheduleName
  {
   if( auto schedule = modelObject.ancillaryOperationSchedule() ) {
     if( auto _schedule = translateAndMapModelObject(schedule.get()) ) {
       idfObject.setString(CentralHeatPumpSystemFields::AncillaryOperationScheduleName,_schedule->name().get());
     }
   }
  }

  // supply = Cooling Loop, demand=Source Loop, tertiary = Heating Loop

  // CoolingLoopInletNodeName
  if( auto mo = modelObject.supplyInletModelObject() ) {
    if( auto node = mo->optionalCast<Node>() ) {
      idfObject.setString(CentralHeatPumpSystemFields::CoolingLoopInletNodeName,node->name().get());
    }
  }

  // CoolingLoopOutletNodeName
  if( auto mo = modelObject.supplyOutletModelObject() ) {
    if( auto node = mo->optionalCast<Node>() ) {
      idfObject.setString(CentralHeatPumpSystemFields::CoolingLoopOutletNodeName,node->name().get());
    }
  }

  // SourceLoopInletNodeName
  if( auto mo = modelObject.demandInletModelObject() ) {
    if( auto node = mo->optionalCast<Node>() ) {
      idfObject.setString(CentralHeatPumpSystemFields::SourceLoopInletNodeName,node->name().get());
    }
  }

  // SourceLoopOutletNodeName
  if( auto mo = modelObject.demandOutletModelObject() ) {
    if( auto node = mo->optionalCast<Node>() ) {
      idfObject.setString(CentralHeatPumpSystemFields::SourceLoopOutletNodeName,node->name().get());
    }
  }


  // HeatingLoopInletNodeName
  if ( auto mo = modelObject.tertiaryInletModelObject() ) {
    if ( auto node = mo->optionalCast<Node>() ) {
      idfObject.setString(CentralHeatPumpSystemFields::HeatingLoopInletNodeName, node->name().get());
    }
  }
  // HeatingLoopOutletNodeName
  if ( auto mo = modelObject.tertiaryOutletModelObject() ) {
    if ( auto node = mo->optionalCast<Node>() ) {
      idfObject.setString(CentralHeatPumpSystemFields::HeatingLoopOutletNodeName, node->name().get());
    }
  }

  // ChillerHeaterModulesPerformanceComponentObjectType1
  // ChillerHeaterModulesPerformanceComponentName1
  // ChillerHeaterModulesControlScheduleName1
  // NumberofChillerHeaterModules1

  for ( auto const& module : modules ) {
    IdfExtensibleGroup group = idfObject.pushExtensibleGroup();

    auto performanceComponent = module.chillerHeaterModulesPerformanceComponent();
    if( auto _performanceComponent = translateAndMapModelObject(performanceComponent) ) {
      group.setString(CentralHeatPumpSystemExtensibleFields::ChillerHeaterModulesPerformanceComponentObjectType, _performanceComponent->iddObject().name());
      group.setString(CentralHeatPumpSystemExtensibleFields::ChillerHeaterModulesPerformanceComponentName, _performanceComponent->name().get());
    }
    {
      auto schedule = module.chillerHeaterModulesControlSchedule();
      if( auto _schedule = translateAndMapModelObject(schedule) ) {
        group.setString(CentralHeatPumpSystemExtensibleFields::ChillerHeaterModulesControlScheduleName,_schedule->name().get());
     }
    }
    group.setInt(CentralHeatPumpSystemExtensibleFields::NumberofChillerHeaterModules, module.numberofChillerHeaterModules() );
  }

  return idfObject;
}
Пример #9
0
 ConvergenceLimits_Impl::ConvergenceLimits_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
   : ModelObject_Impl(idfObject,model,keepHandle)
 {
   OS_ASSERT(idfObject.iddObject().type() == ConvergenceLimits::iddObjectType());
 }
boost::optional<IdfObject> ForwardTranslator::translateEvaporativeFluidCoolerTwoSpeed( EvaporativeFluidCoolerTwoSpeed & modelObject )
{
  OptionalString s;
  OptionalDouble d;
  OptionalModelObject temp;
 
  //Name
  IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::EvaporativeFluidCooler_TwoSpeed, modelObject);

  // WaterInletNodeName
  temp = modelObject.inletModelObject();
  if(temp) {
    idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::WaterInletNodeName,temp->name().get());
  }

  // WaterOutletNodeName
  temp = modelObject.outletModelObject();
  if(temp) {
    idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::WaterOutletNodeName,temp->name().get());
  }

  // HighFanSpeedAirFlowRate
  if( modelObject.isHighFanSpeedAirFlowRateAutosized() )
  {
    idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::HighFanSpeedAirFlowRate,"Autosize");
  } 
  else if( (d = modelObject.highFanSpeedAirFlowRate()) )
  {
    idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::HighFanSpeedAirFlowRate,d.get());
  }

  // HighFanSpeedFanPower
  if( modelObject.isHighFanSpeedFanPowerAutosized() )
  {
    idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::HighFanSpeedFanPower,"Autosize");
  } 
  else if( (d = modelObject.highFanSpeedFanPower()) )
  {
    idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::HighFanSpeedFanPower,d.get());
  }

  // LowFanSpeedAirFlowRate
  if( modelObject.isLowFanSpeedAirFlowRateAutosized() )
  {
    idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowFanSpeedAirFlowRate,"Autocalculate");
  } 
  else if( (d = modelObject.lowFanSpeedAirFlowRate()) )
  {
    idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowFanSpeedAirFlowRate,d.get());
  }

  // LowFanSpeedAirFlowRateSizingFactor
  if( (d = modelObject.lowFanSpeedAirFlowRateSizingFactor()) )
  {
    idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowFanSpeedAirFlowRateSizingFactor,d.get());
  }

  // LowFanSpeedFanPower
  if( modelObject.isLowFanSpeedFanPowerAutosized() )
  {
    idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowFanSpeedFanPower,"Autocalculate");
  } 
  else if( (d = modelObject.lowFanSpeedFanPower()) )
  {
    idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowFanSpeedFanPower,d.get());
  }

  // LowFanSpeedFanPowerSizingFactor
  if( (d = modelObject.lowFanSpeedFanPowerSizingFactor()) )
  {
    idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowFanSpeedFanPowerSizingFactor,d.get());
  }

  // DesignSprayWaterFlowRate
  if( (d = modelObject.designSprayWaterFlowRate()) )
  {
    idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::DesignSprayWaterFlowRate,d.get());
  }

  // PerformanceInputMethod
  if( (s = modelObject.performanceInputMethod()) )
  {
    idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::PerformanceInputMethod,s.get());
  }

  // OutdoorAirInletNodeName
  idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::OutdoorAirInletNodeName,"");

  // HeatRejectionCapacityandNominalCapacitySizingRatio
  if( (d = modelObject.heatRejectionCapacityandNominalCapacitySizingRatio()) )
  {
    idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::HeatRejectionCapacityandNominalCapacitySizingRatio,d.get());
  }

  // HighSpeedStandardDesignCapacity
  if( (d = modelObject.highSpeedStandardDesignCapacity()) )
  {
    idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::HighSpeedStandardDesignCapacity,d.get());
  }

  // LowSpeedStandardDesignCapacity
  if( modelObject.isLowSpeedStandardDesignCapacityAutosized() )
  {
    idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowSpeedStandardDesignCapacity,"Autosize");
  } 
  else if( (d = modelObject.lowSpeedStandardDesignCapacity()) )
  {
    idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowSpeedStandardDesignCapacity,d.get());
  }

  // LowSpeedStandardCapacitySizingFactor
  if( (d = modelObject.lowSpeedStandardCapacitySizingFactor()) )
  {
    idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowSpeedStandardCapacitySizingFactor,d.get());
  }

  // HighFanSpeedUfactorTimesAreaValue
  if( modelObject.isHighFanSpeedUfactorTimesAreaValueAutosized() )
  {
    idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::HighFanSpeedUfactorTimesAreaValue,"Autosize");
  } 
  else if( (d = modelObject.highFanSpeedUfactorTimesAreaValue()) )
  {
    idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::HighFanSpeedUfactorTimesAreaValue,d.get());
  }

  // LowFanSpeedUfactorTimesAreaValue
  if( modelObject.isLowFanSpeedUfactorTimesAreaValueAutosized() )
  {
    idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowFanSpeedUfactorTimesAreaValue,"Autocalculate");
  } 
  else if( (d = modelObject.lowFanSpeedUfactorTimesAreaValue()) )
  {
    idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowFanSpeedUfactorTimesAreaValue,d.get());
  }

  // LowFanSpeedUFactorTimesAreaSizingFactor
  if( (d = modelObject.lowFanSpeedUFactorTimesAreaSizingFactor()) )
  {
    idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowFanSpeedUFactorTimesAreaSizingFactor,d.get());
  }

  // DesignWaterFlowRate
  if( modelObject.isDesignWaterFlowRateAutosized() )
  {
    idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::DesignWaterFlowRate,"Autosize");
  } 
  else if( (d = modelObject.designWaterFlowRate()) )
  {
    idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::DesignWaterFlowRate,d.get());
  }

  // HighSpeedUserSpecifiedDesignCapacity
  if( (d = modelObject.highSpeedUserSpecifiedDesignCapacity()) )
  {
    idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::HighSpeedUserSpecifiedDesignCapacity,d.get());
  }

  // LowSpeedUserSpecifiedDesignCapacity
  if( modelObject.isLowSpeedUserSpecifiedDesignCapacityAutosized() )
  {
    idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowSpeedUserSpecifiedDesignCapacity,"Autocalculate");
  } 
  else if( (d = modelObject.lowSpeedUserSpecifiedDesignCapacity()) )
  {
    idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowSpeedUserSpecifiedDesignCapacity,d.get());
  }

  // LowSpeedUserSpecifiedDesignCapacitySizingFactor
  if( (d = modelObject.lowSpeedUserSpecifiedDesignCapacitySizingFactor()) )
  {
    idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowSpeedUserSpecifiedDesignCapacitySizingFactor,d.get());
  }

  // DesignEnteringWaterTemperature
  if( (d = modelObject.designEnteringWaterTemperature()) )
  {
    idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::DesignEnteringWaterTemperature,d.get());
  }

  // DesignEnteringAirTemperature
  if( (d = modelObject.designEnteringAirTemperature()) )
  {
    idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::DesignEnteringAirTemperature,d.get());
  }

  // DesignEnteringAirWetbulbTemperature
  if( (d = modelObject.designEnteringAirWetbulbTemperature()) )
  {
    idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::DesignEnteringAirWetbulbTemperature,d.get());
  }

  // HighSpeedSizingFactor
  if( (d = modelObject.highSpeedSizingFactor()) )
  {
    idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::HighSpeedSizingFactor,d.get());
  }

  // EvaporationLossMode
  if( (s = modelObject.evaporationLossMode()) )
  {
    idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::EvaporationLossMode,s.get());
  }

  // EvaporationLossFactor
  if( (d = modelObject.evaporationLossFactor()) )
  {
    idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::EvaporationLossFactor,d.get());
  }

  // DriftLossPercent
  if( (d = modelObject.driftLossPercent()) )
  {
    idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::DriftLossPercent,d.get());
  }

  // BlowdownCalculationMode
  if( (s = modelObject.blowdownCalculationMode()) )
  {
    idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::BlowdownCalculationMode,s.get());
  }

  // BlowdownConcentrationRatio
  if( (d = modelObject.blowdownConcentrationRatio()) )
  {
    idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::BlowdownConcentrationRatio,d.get());
  }

  // BlowdownMakeupWaterUsageScheduleName
  if( (temp = modelObject.blowdownMakeupWaterUsageSchedule()) )
  {
    if( boost::optional<IdfObject> _schedule = translateAndMapModelObject(temp.get()) )
    {
      idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::BlowdownMakeupWaterUsageScheduleName,_schedule->name().get());
    }
  }

  // SupplyWaterStorageTankName

  return idfObject;
}
Пример #11
0
 ScheduleRule_Impl::ScheduleRule_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
   : ParentObject_Impl(idfObject,model,keepHandle)
 {
   OS_ASSERT(idfObject.iddObject().type() == ScheduleRule::iddObjectType());
 }
 CurveRectangularHyperbola2_Impl::CurveRectangularHyperbola2_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
   : Curve_Impl(idfObject,model,keepHandle)
 {
   OS_ASSERT(idfObject.iddObject().type() == CurveRectangularHyperbola2::iddObjectType());
 }
boost::optional<IdfObject> ForwardTranslator::translateLifeCycleCostParameters( model::LifeCycleCostParameters & modelObject )
{
  // create, register, and name object
  IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::LifeCycleCost_Parameters,
                                                       modelObject);

  idfObject.setString(LifeCycleCost_ParametersFields::DiscountingConvention, modelObject.discountingConvention());
  
  idfObject.setString(LifeCycleCost_ParametersFields::InflationApproach, modelObject.inflationApproach());

  boost::optional<double> d = modelObject.realDiscountRate();
  if (d){
    idfObject.setDouble(LifeCycleCost_ParametersFields::RealDiscountRate, *d);
  }

  d = modelObject.nominalDiscountRate();
  if (d){
    idfObject.setDouble(LifeCycleCost_ParametersFields::NominalDiscountRate, *d);
  }

  d = modelObject.inflation();
  if (d){
    idfObject.setDouble(LifeCycleCost_ParametersFields::Inflation, *d);
  }

  if (!modelObject.isBaseDateMonthDefaulted()){
    idfObject.setString(LifeCycleCost_ParametersFields::BaseDateMonth, modelObject.baseDateMonth().valueDescription());
  }

  idfObject.setInt(LifeCycleCost_ParametersFields::BaseDateYear, modelObject.baseDateYear());

  if (!modelObject.isServiceDateMonthDefaulted()){
    idfObject.setString(LifeCycleCost_ParametersFields::ServiceDateMonth, modelObject.serviceDateMonth().valueDescription());
  }

  idfObject.setInt(LifeCycleCost_ParametersFields::ServiceDateYear, modelObject.serviceDateYear());

  idfObject.setInt(LifeCycleCost_ParametersFields::LengthofStudyPeriodinYears, modelObject.lengthOfStudyPeriodInYears());

  d = modelObject.taxRate();
  if (d){
    idfObject.setDouble(LifeCycleCost_ParametersFields::Taxrate, *d);
  }

  if (modelObject.isDepreciationMethodDefaulted()){
    idfObject.setString(LifeCycleCost_ParametersFields::DepreciationMethod, "None");
  }else{
    idfObject.setString(LifeCycleCost_ParametersFields::DepreciationMethod, modelObject.depreciationMethod());
  }
  
  // if useNISTFuelEscalationRates then load idf obbjects from file in resources
  if (modelObject.useNISTFuelEscalationRates()){

    boost::optional<std::string> region = modelObject.nistRegion();
    if (!region){
      region = "U.S. Avg";
    }
    boost::optional<std::string> sector = modelObject.nistSector();
    if (!sector){
      sector = "Commercial";
    }

    static boost::optional<IdfFile> usePriceEscalationFile;
    if (!usePriceEscalationFile){
     usePriceEscalationFile = findIdfFile(":/Resources/LCCusePriceEscalationDataSet2011.idf");
    }
    OS_ASSERT(usePriceEscalationFile);

    for (IdfObject object : usePriceEscalationFile->objects()){
      std::string name = object.name().get();
      if ((name.find(*region) == 0) &&
          (name.find(*sector) != string::npos)){
        m_idfObjects.push_back(object);
      }
    }
  }else{

    std::string baseDateMonth;
    if (!modelObject.isBaseDateMonthDefaulted()){
      baseDateMonth = modelObject.baseDateMonth().valueDescription();
    }
    int baseDateYear = modelObject.baseDateYear();
    int lengthOfStudyPeriodInYears = modelObject.lengthOfStudyPeriodInYears();

    // make a use price escalation for each fuel type we have inflation for
    makeUsePriceEscalation(modelObject.electricityInflation(), "Electricity", baseDateMonth, baseDateYear, lengthOfStudyPeriodInYears, m_idfObjects);
    makeUsePriceEscalation(modelObject.naturalGasInflation(),  "NaturalGas", baseDateMonth, baseDateYear, lengthOfStudyPeriodInYears, m_idfObjects);
    makeUsePriceEscalation(modelObject.steamInflation(),       "Steam", baseDateMonth, baseDateYear, lengthOfStudyPeriodInYears, m_idfObjects);
    makeUsePriceEscalation(modelObject.gasolineInflation(),    "Gasoline", baseDateMonth, baseDateYear, lengthOfStudyPeriodInYears, m_idfObjects);
    makeUsePriceEscalation(modelObject.dieselInflation(),      "Diesel", baseDateMonth, baseDateYear, lengthOfStudyPeriodInYears, m_idfObjects);
    makeUsePriceEscalation(modelObject.coalInflation(),        "Coal", baseDateMonth, baseDateYear, lengthOfStudyPeriodInYears, m_idfObjects);
    makeUsePriceEscalation(modelObject.fuelOil1Inflation(),    "FuelOil#1", baseDateMonth, baseDateYear, lengthOfStudyPeriodInYears, m_idfObjects);
    makeUsePriceEscalation(modelObject.fuelOil2Inflation(),    "FuelOil#2", baseDateMonth, baseDateYear, lengthOfStudyPeriodInYears, m_idfObjects);
    makeUsePriceEscalation(modelObject.propaneInflation(),     "Propane", baseDateMonth, baseDateYear, lengthOfStudyPeriodInYears, m_idfObjects);
    makeUsePriceEscalation(modelObject.waterInflation(),       "Water", baseDateMonth, baseDateYear, lengthOfStudyPeriodInYears, m_idfObjects);
  }

  return idfObject;
}
boost::optional<IdfObject> ForwardTranslator::translateAirLoopHVACUnitaryHeatCoolVAVChangeoverBypass( AirLoopHVACUnitaryHeatCoolVAVChangeoverBypass & modelObject )
{
  boost::optional<std::string> s;
  boost::optional<double> d;

  // Name
  IdfObject unitarySystem = createRegisterAndNameIdfObject(openstudio::IddObjectType::AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypass, modelObject);

  // Availability Schedule Name
  if( boost::optional<Schedule> availabilitySchedule = modelObject.availabilitySchedule() )
  {
    boost::optional<IdfObject> _availabilitySchedule = translateAndMapModelObject(availabilitySchedule.get());

    if( _availabilitySchedule && _availabilitySchedule->name() )
    {
      unitarySystem.setString(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::AvailabilityScheduleName,_availabilitySchedule->name().get());
    }
  }

  //  SystemAirFlowRateDuringCoolingOperation
  if( modelObject.isSystemAirFlowRateDuringCoolingOperationAutosized() ) {
    unitarySystem.setString(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::CoolingSupplyAirFlowRate,"AutoSize");
  } else if( (d = modelObject.systemAirFlowRateDuringCoolingOperation()) ) {
    unitarySystem.setDouble(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::CoolingSupplyAirFlowRate,d.get());
  }

  //  SystemAirFlowRateDuringHeatingOperation
  if( modelObject.isSystemAirFlowRateDuringHeatingOperationAutosized() ) {
    unitarySystem.setString(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::HeatingSupplyAirFlowRate,"AutoSize");
  } else if( (d = modelObject.systemAirFlowRateDuringHeatingOperation()) ) {
    unitarySystem.setDouble(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::HeatingSupplyAirFlowRate,d.get());
  }
  
  //  SystemAirFlowRateWhenNoCoolingorHeatingisNeeded
  if( modelObject.isSystemAirFlowRateWhenNoCoolingorHeatingisNeededAutosized() ) {
    unitarySystem.setString(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::NoLoadSupplyAirFlowRate,"AutoSize");
  } else if( (d = modelObject.systemAirFlowRateWhenNoCoolingorHeatingisNeeded()) ) {
    unitarySystem.setDouble(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::NoLoadSupplyAirFlowRate,d.get());
  } 
  
  //  OutdoorAirFlowRateDuringCoolingOperation
  if( modelObject.isOutdoorAirFlowRateDuringCoolingOperationAutosized() ) {
    unitarySystem.setString(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::CoolingOutdoorAirFlowRate,"AutoSize");
  } else if( (d = modelObject.outdoorAirFlowRateDuringCoolingOperation()) ) {
    unitarySystem.setDouble(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::CoolingOutdoorAirFlowRate,d.get());
  }
  
  //  OutdoorAirFlowRateDuringHeatingOperation
  if( modelObject.isOutdoorAirFlowRateDuringHeatingOperationAutosized() ) {
    unitarySystem.setString(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::HeatingOutdoorAirFlowRate,"AutoSize");
  } else if( (d = modelObject.outdoorAirFlowRateDuringHeatingOperation()) ) {
    unitarySystem.setDouble(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::HeatingOutdoorAirFlowRate,d.get());
  }
  
  //  OutdoorAirFlowRateWhenNoCoolingorHeatingisNeeded
  if( modelObject.isOutdoorAirFlowRateWhenNoCoolingorHeatingisNeededAutosized() ) {
    unitarySystem.setString(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::NoLoadOutdoorAirFlowRate,"AutoSize");
  } else if( (d = modelObject.outdoorAirFlowRateWhenNoCoolingorHeatingisNeeded()) ) {
    unitarySystem.setDouble(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::NoLoadOutdoorAirFlowRate,d.get());
  } 

  //  OutdoorAirFlowRateMultiplierScheduleName
  if( boost::optional<Schedule> schedule = modelObject.outdoorAirFlowRateMultiplierSchedule() ) {
    if( boost::optional<IdfObject> _schedule = translateAndMapModelObject(schedule.get()) ) {
      unitarySystem.setString(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::OutdoorAirFlowRateMultiplierScheduleName,_schedule->name().get());
    }
  }

  boost::optional<std::string> airInletNodeName;
  boost::optional<std::string> airOutletNodeName;

  // Air Inlet Node Name
  if( boost::optional<ModelObject> mo = modelObject.inletModelObject() )
  {
    if( boost::optional<Node> node = mo->optionalCast<Node>() )
    {
      airInletNodeName = node->name().get();
      unitarySystem.setString(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::AirInletNodeName,node->name().get());
    }
  }

  // Air Outlet Node Name
  if( boost::optional<ModelObject> mo = modelObject.outletModelObject() )
  {
    if( boost::optional<Node> node = mo->optionalCast<Node>() )
    {
      airOutletNodeName = node->name().get();
      unitarySystem.setString(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::AirOutletNodeName,node->name().get());
    }
  }

  std::string baseName = modelObject.name().get();

  //  BypassDuctMixerNodeName
  std::string bypassDuctMixerNodeName = baseName + " Bypass Duct Mixer Node";
  unitarySystem.setString(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::BypassDuctMixerNodeName,bypassDuctMixerNodeName);
  
  //  BypassDuctSplitterNodeName
  std::string bypassDuctSplitterNodeName = baseName + " Bypass Duct Splitter Node";
  unitarySystem.setString(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::BypassDuctSplitterNodeName,bypassDuctSplitterNodeName);
  
  //  OutdoorAirMixerObjectType
  unitarySystem.setString(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::OutdoorAirMixerObjectType,"OutdoorAir:Mixer");
  
  //  OutdoorAirMixerName
  std::string outdoorAirMixerName = baseName + " Outdoor Air Mixer";
  unitarySystem.setString(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::OutdoorAirMixerName,outdoorAirMixerName);

  //  SupplyAirFanName
  boost::optional<IdfObject> _fan;
  if( boost::optional<HVACComponent> fan = modelObject.supplyAirFan() ) {
    if( (_fan = translateAndMapModelObject(fan.get())) ) {
      unitarySystem.setString(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::SupplyAirFanObjectType,_fan->iddObject().name());
      unitarySystem.setString(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::SupplyAirFanName,_fan->name().get());
    }
  }
  
  bool blowThroughFan = false;
  //  SupplyAirFanPlacement
  if( (s = modelObject.supplyAirFanPlacement()) ) {
    unitarySystem.setString(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::SupplyAirFanPlacement,s.get());
    if( istringEqual(s.get(),"BlowThrough") ) {
      blowThroughFan = true;
    }
  }
  
  //  SupplyAirFanOperatingModeScheduleName
  if( boost::optional<Schedule> schedule = modelObject.supplyAirFanOperatingModeSchedule() ) {
    if( boost::optional<IdfObject> _schedule = translateAndMapModelObject(schedule.get()) ) {
      unitarySystem.setString(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::SupplyAirFanOperatingModeScheduleName,_schedule->name().get()); 
    }
  }

  // Heating Coil Object Type
  // Heating Coil Name
  boost::optional<IdfObject> _heatingCoil;
  if( boost::optional<HVACComponent> heatingCoil = modelObject.heatingCoil() )
  {
    _heatingCoil = translateAndMapModelObject(heatingCoil.get());

    if( _heatingCoil && _heatingCoil->name() )
    {
      unitarySystem.setString(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::HeatingCoilObjectType,_heatingCoil->iddObject().name());
      unitarySystem.setString(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::HeatingCoilName,_heatingCoil->name().get());
    }
  }

  // Cooling Coil Object Type
  // Cooling Coil Name
  boost::optional<IdfObject> _coolingCoil;
  if( boost::optional<HVACComponent> coolingCoil = modelObject.coolingCoil() )
  {
    if( boost::optional<CoilCoolingDXSingleSpeed> dxCoil = coolingCoil->optionalCast<CoilCoolingDXSingleSpeed>() ) {
      _coolingCoil = translateCoilCoolingDXSingleSpeedWithoutUnitary(dxCoil.get());
      m_map.insert(std::make_pair(coolingCoil->handle(),_coolingCoil.get()));
    } else {
      _coolingCoil = translateAndMapModelObject(coolingCoil.get());
    }

    if( _coolingCoil && _coolingCoil->name() )
    {
      unitarySystem.setString(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::CoolingCoilObjectType,_coolingCoil->iddObject().name());
      unitarySystem.setString(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::CoolingCoilName,_coolingCoil->name().get());
    }
  }

  //  PriorityControlMode
  if( (s = modelObject.priorityControlMode()) ) {
    unitarySystem.setString(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::PriorityControlMode,s.get());
  }
  
  //  MinimumOutletAirTemperatureDuringCoolingOperation
  if( (d = modelObject.minimumOutletAirTemperatureDuringCoolingOperation()) ) {
    unitarySystem.setDouble(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::MinimumOutletAirTemperatureDuringCoolingOperation,d.get());
  }
  
  //  MaximumOutletAirTemperatureDuringHeatingOperation)(Maximum Outlet Air Temperature During Heating Operation))
  if( (d = modelObject.maximumOutletAirTemperatureDuringHeatingOperation()) ) {
    unitarySystem.setDouble(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::MaximumOutletAirTemperatureDuringHeatingOperation,d.get());
  } 
  
  // DehumidificationControlType
  if( (s = modelObject.dehumidificationControlType()) ) {
    unitarySystem.setString(AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypassFields::DehumidificationControlType,s.get());
  }

  if( _fan && _coolingCoil && _heatingCoil )
  {
    std::string fanOutletNodeName;
    std::string fanInletNodeName;
    std::string heatOutletNodeName;
    std::string heatInletNodeName;
    std::string coolOutletNodeName;
    std::string coolInletNodeName;
    std::string mixedAirNodeName;

    if( blowThroughFan ) {
      mixedAirNodeName = baseName + " Mixed Air Node";
      fanInletNodeName = mixedAirNodeName;
      fanOutletNodeName = baseName + " Fan Outlet Node";
      coolInletNodeName = fanOutletNodeName;
      coolOutletNodeName = baseName + " Cooling Coil Outlet Node";
      heatInletNodeName = coolOutletNodeName;
      heatOutletNodeName = bypassDuctSplitterNodeName;
    } else {
      mixedAirNodeName = baseName + " Mixed Air Node";
      coolInletNodeName = mixedAirNodeName;
      coolOutletNodeName = baseName + " Cooling Coil Outlet Node";
      heatInletNodeName = coolOutletNodeName;
      heatOutletNodeName = baseName + " Heating Coil Outlet Node";
      fanInletNodeName = heatOutletNodeName;
      fanOutletNodeName = bypassDuctSplitterNodeName;
    }

    if( _fan->iddObject().type() == IddObjectType::Fan_ConstantVolume )
    {
      _fan->setString(Fan_ConstantVolumeFields::AirInletNodeName,fanInletNodeName);
      _fan->setString(Fan_ConstantVolumeFields::AirOutletNodeName,fanOutletNodeName);
    }
    else if( _fan->iddObject().type() == IddObjectType::Fan_VariableVolume )
    {
      _fan->setString(Fan_VariableVolumeFields::AirInletNodeName,fanInletNodeName);
      _fan->setString(Fan_VariableVolumeFields::AirOutletNodeName,fanOutletNodeName);
    }
    else if( _fan->iddObject().type() == IddObjectType::Fan_OnOff )
    {
      _fan->setString(Fan_OnOffFields::AirInletNodeName,fanInletNodeName);
      _fan->setString(Fan_OnOffFields::AirOutletNodeName,fanOutletNodeName);
    }

    fixSPMsForUnitarySystem(modelObject,fanInletNodeName,fanOutletNodeName);

    if( _coolingCoil->iddObject().type() == IddObjectType::Coil_Cooling_DX_SingleSpeed )
    {
      _coolingCoil->setString(Coil_Cooling_DX_SingleSpeedFields::AirInletNodeName,coolInletNodeName);
      _coolingCoil->setString(Coil_Cooling_DX_SingleSpeedFields::AirOutletNodeName,coolOutletNodeName);
    }
    else if( _coolingCoil->iddObject().type() == IddObjectType::Coil_Cooling_DX_TwoSpeed )
    {
      _coolingCoil->setString(Coil_Cooling_DX_TwoSpeedFields::AirInletNodeName,coolInletNodeName);
      _coolingCoil->setString(Coil_Cooling_DX_TwoSpeedFields::AirOutletNodeName,coolOutletNodeName);
    }
    else if( _coolingCoil->iddObject().type() == IddObjectType::Coil_Cooling_Water )
    {
      _coolingCoil->setString(Coil_Cooling_WaterFields::AirInletNodeName,coolInletNodeName);
      _coolingCoil->setString(Coil_Cooling_WaterFields::AirOutletNodeName,coolOutletNodeName);
    }
    else if( _coolingCoil->iddObject().type() == IddObjectType::Coil_Cooling_WaterToAirHeatPump_EquationFit )
    {
      _coolingCoil->setString(Coil_Cooling_WaterToAirHeatPump_EquationFitFields::AirInletNodeName,coolInletNodeName);
      _coolingCoil->setString(Coil_Cooling_WaterToAirHeatPump_EquationFitFields::AirOutletNodeName,coolOutletNodeName);
    }

    if( _heatingCoil->iddObject().type() == IddObjectType::Coil_Heating_DX_SingleSpeed )
    {
      _heatingCoil->setString(Coil_Heating_DX_SingleSpeedFields::AirInletNodeName,heatInletNodeName);
      _heatingCoil->setString(Coil_Heating_DX_SingleSpeedFields::AirOutletNodeName,heatOutletNodeName);
    }
    else if( _heatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Electric )
    {
      _heatingCoil->setString(Coil_Heating_ElectricFields::AirInletNodeName,heatInletNodeName);
      _heatingCoil->setString(Coil_Heating_ElectricFields::AirOutletNodeName,heatOutletNodeName);
    }
    else if( _heatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Gas )
    {
      _heatingCoil->setString(Coil_Heating_GasFields::AirInletNodeName,heatInletNodeName);
      _heatingCoil->setString(Coil_Heating_GasFields::AirOutletNodeName,heatOutletNodeName);
    }
    else if( _heatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Water )
    {
      _heatingCoil->setString(Coil_Heating_WaterFields::AirInletNodeName,heatInletNodeName);
      _heatingCoil->setString(Coil_Heating_WaterFields::AirOutletNodeName,heatOutletNodeName);
    }
    else if( _heatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Desuperheater )
    {
      _heatingCoil->setString(Coil_Heating_DesuperheaterFields::AirInletNodeName,heatInletNodeName);
      _heatingCoil->setString(Coil_Heating_DesuperheaterFields::AirOutletNodeName,heatOutletNodeName);
    }
    else if( _heatingCoil->iddObject().type() == IddObjectType::Coil_Heating_WaterToAirHeatPump_EquationFit )
    {
      _heatingCoil->setString(Coil_Heating_WaterToAirHeatPump_EquationFitFields::AirInletNodeName,heatInletNodeName);
      _heatingCoil->setString(Coil_Heating_WaterToAirHeatPump_EquationFitFields::AirOutletNodeName,heatOutletNodeName);
    }

    IdfObject _outdoorAirMixer(IddObjectType::OutdoorAir_Mixer);
    _outdoorAirMixer.setName(outdoorAirMixerName);
    m_idfObjects.push_back(_outdoorAirMixer);

    std::string oaNodeName = baseName + " OA Node";
    _outdoorAirMixer.setString(OutdoorAir_MixerFields::MixedAirNodeName,mixedAirNodeName);
    _outdoorAirMixer.setString(OutdoorAir_MixerFields::OutdoorAirStreamNodeName,oaNodeName);

    IdfObject _oaNodeList(openstudio::IddObjectType::OutdoorAir_NodeList);
    _oaNodeList.setString(0,oaNodeName);
    m_idfObjects.push_back(_oaNodeList);
    _outdoorAirMixer.setString(OutdoorAir_MixerFields::ReliefAirStreamNodeName,baseName + " Relief Air Node");
    _outdoorAirMixer.setString(OutdoorAir_MixerFields::ReturnAirStreamNodeName,bypassDuctMixerNodeName);
  }

  return unitarySystem;
}
Пример #15
0
 ConnectorMixer_Impl::ConnectorMixer_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
   : Mixer_Impl(idfObject, model, keepHandle)
 {
   OS_ASSERT(idfObject.iddObject().type() == ConnectorMixer::iddObjectType());
 }
boost::optional<IdfObject> ForwardTranslator::translateCoilHeatingDesuperheater(CoilHeatingDesuperheater & modelObject)
{
  OptionalModelObject omo;
  OptionalString optS;
  boost::optional<std::string> s;
  boost::optional<double> d;

// Name
  IdfObject object = createRegisterAndNameIdfObject(openstudio::IddObjectType::Coil_Heating_Desuperheater, modelObject);

// Availability Schedule Name
  boost::optional<Schedule> availabilitySchedule = modelObject.availabilitySchedule();

  if( availabilitySchedule )
  {
    boost::optional<IdfObject> _availabilitySchedule = translateAndMapModelObject(availabilitySchedule.get());

    if( _availabilitySchedule && _availabilitySchedule->name() )
    {
      object.setString(Coil_Heating_DesuperheaterFields::AvailabilityScheduleName,_availabilitySchedule->name().get());
    }
  }

// Heat Recovery Efficiency
  d = modelObject.heatReclaimRecoveryEfficiency();
  if (d) {
      object.setDouble(Coil_Heating_DesuperheaterFields::HeatReclaimRecoveryEfficiency,d.get());
  }

// Air Inlet Node Name
  if( boost::optional<ModelObject> mo = modelObject.inletModelObject() )
  {
    if( boost::optional<Node> node = mo->optionalCast<Node>() )
    {
      object.setString(Coil_Heating_DesuperheaterFields::AirInletNodeName,node->name().get());
    }
  }

// Air Outlet Node Name
  if( boost::optional<ModelObject> mo = modelObject.outletModelObject() )
  {
    if( boost::optional<Node> node = mo->optionalCast<Node>() )
    {
      object.setString(Coil_Heating_DesuperheaterFields::AirOutletNodeName,node->name().get());
      object.setString(Coil_Heating_DesuperheaterFields::TemperatureSetpointNodeName,node->name().get());
    }
  }

// HeatingSourceObjectType
// Heating Source Name
  boost::optional<ModelObject> heatingSource = modelObject.heatingSource();

  if ( heatingSource ) {
      boost::optional<IdfObject> _heatingSource = translateAndMapModelObject(heatingSource.get());

      if ( _heatingSource && _heatingSource->name() )
      {
        object.setString(Coil_Heating_DesuperheaterFields::HeatingSourceObjectType,_heatingSource->iddObject().name());
        object.setString(Coil_Heating_DesuperheaterFields::HeatingSourceName,_heatingSource->name().get());
      }
  }

// Temperature Setpoint Node Name
  // if( boost::optional<Node> node = modelObject.temperatureSetpointNode() )
  // {
  //   object.setString(Coil_Heating_DesuperheaterFields::TemperatureSetpointNodeName,node->name().get());
  // }
  // object.setString(Coil_Heating_DesuperheaterFields::TemperatureSetpointNodeName,"");

// Parasitic Electric Load
  d = modelObject.parasiticElectricLoad();
  if (d) {
      object.setDouble(Coil_Heating_DesuperheaterFields::ParasiticElectricLoad,d.get());
  }

  return object;

}
boost::optional<IdfObject> ForwardTranslator::translateElectricLoadCenterInverterLookUpTable(model::ElectricLoadCenterInverterLookUpTable & modelObject)
{
  IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::ElectricLoadCenter_Inverter_LookUpTable, modelObject);

  if (modelObject.name()) {
    idfObject.setString(ElectricLoadCenter_Inverter_LookUpTableFields::Name, modelObject.name().get());
  }

  if (modelObject.availabilitySchedule() && modelObject.availabilitySchedule().get().name()) {
    idfObject.setString(ElectricLoadCenter_Inverter_LookUpTableFields::AvailabilityScheduleName, modelObject.availabilitySchedule().get().name().get());
  }

  if (modelObject.thermalZone() && modelObject.thermalZone().get().name()) {
    idfObject.setString(ElectricLoadCenter_Inverter_LookUpTableFields::ZoneName, modelObject.thermalZone().get().name().get());
  }

  if (modelObject.radiativeFraction()) {
    idfObject.setDouble(ElectricLoadCenter_Inverter_LookUpTableFields::RadiativeFraction, modelObject.radiativeFraction().get());
  }

  if (modelObject.ratedMaximumContinuousOutputPower()) {
    idfObject.setDouble(ElectricLoadCenter_Inverter_LookUpTableFields::RatedMaximumContinuousOutputPower, modelObject.ratedMaximumContinuousOutputPower().get());
  }

  if (modelObject.nightTareLossPower()) {
    idfObject.setDouble(ElectricLoadCenter_Inverter_LookUpTableFields::NightTareLossPower, modelObject.nightTareLossPower().get());
  }

  if (modelObject.nominalVoltageInput()) {
    idfObject.setDouble(ElectricLoadCenter_Inverter_LookUpTableFields::NominalVoltageInput, modelObject.nominalVoltageInput().get());
  }

  if (modelObject.efficiencyAt10PowerAndNominalVoltage()) {
    idfObject.setDouble(ElectricLoadCenter_Inverter_LookUpTableFields::Efficiencyat10_PowerandNominalVoltage, modelObject.efficiencyAt10PowerAndNominalVoltage().get());
  }

  if (modelObject.efficiencyAt20PowerAndNominalVoltage()) {
    idfObject.setDouble(ElectricLoadCenter_Inverter_LookUpTableFields::Efficiencyat20_PowerandNominalVoltage, modelObject.efficiencyAt20PowerAndNominalVoltage().get());
  }

  if (modelObject.efficiencyAt30PowerAndNominalVoltage()) {
    idfObject.setDouble(ElectricLoadCenter_Inverter_LookUpTableFields::Efficiencyat30_PowerandNominalVoltage, modelObject.efficiencyAt30PowerAndNominalVoltage().get());
  }

  if (modelObject.efficiencyAt50PowerAndNominalVoltage()) {
    idfObject.setDouble(ElectricLoadCenter_Inverter_LookUpTableFields::Efficiencyat50_PowerandNominalVoltage, modelObject.efficiencyAt50PowerAndNominalVoltage().get());
  }

  if (modelObject.efficiencyAt75PowerAndNominalVoltage()) {
    idfObject.setDouble(ElectricLoadCenter_Inverter_LookUpTableFields::Efficiencyat75_PowerandNominalVoltage, modelObject.efficiencyAt75PowerAndNominalVoltage().get());
  }

  if (modelObject.efficiencyAt100PowerAndNominalVoltage()) {
    idfObject.setDouble(ElectricLoadCenter_Inverter_LookUpTableFields::Efficiencyat100_PowerandNominalVoltage, modelObject.efficiencyAt100PowerAndNominalVoltage().get());
  }

  return idfObject;
}
boost::optional<IdfObject> ForwardTranslator::translateRefrigerationCondenserAirCooled( RefrigerationCondenserAirCooled & modelObject )
{
  OptionalModelObject temp;
  OptionalString optS;
  boost::optional<std::string> s;
  boost::optional<double> d;

// Name
  IdfObject object = createRegisterAndNameIdfObject(openstudio::IddObjectType::Refrigeration_Condenser_AirCooled, modelObject);

//Rated Effective Total Heat Rejection Rate Curve Name
  boost::optional<CurveLinear> heatRejectCurve = modelObject.ratedEffectiveTotalHeatRejectionRateCurve();

  if( heatRejectCurve )
  {
    boost::optional<IdfObject> _heatRejectCurve = translateAndMapModelObject(heatRejectCurve.get());

    if( _heatRejectCurve && _heatRejectCurve->name() )
    {
      object.setString(Refrigeration_Condenser_AirCooledFields::RatedEffectiveTotalHeatRejectionRateCurveName,_heatRejectCurve->name().get());
    }
  }

//Rated Subcooling Temperature Difference
  d = modelObject.ratedSubcoolingTemperatureDifference();
  if (d) {
    object.setDouble(Refrigeration_Condenser_AirCooledFields::RatedSubcoolingTemperatureDifference,d.get());
  }

//Condenser Fan Speed Control Type
  s = modelObject.condenserFanSpeedControlType();
  if (s) {
    object.setString(Refrigeration_Condenser_AirCooledFields::CondenserFanSpeedControlType,s.get());
  }

//Rated Fan Power
  d = modelObject.ratedFanPower();
  if (d) {
    object.setDouble(Refrigeration_Condenser_AirCooledFields::RatedFanPower,d.get());
  }

//Air Inlet Node Name or Zone Name
  boost::optional<ThermalZone> airInletZone = modelObject.airInletZone();

  if( airInletZone )
  {
    boost::optional<IdfObject> _airInletZone = translateAndMapModelObject(airInletZone.get());

    if( _airInletZone && _airInletZone->name() )
    {
      object.setString(Refrigeration_Condenser_AirCooledFields::AirInletNodeNameorZoneName,_airInletZone->name().get());
    }
  }

//End-Use Subcategory
  s = modelObject.endUseSubcategory();
  if (s) {
    object.setString(Refrigeration_Condenser_AirCooledFields::EndUseSubcategory,s.get());
  }

//Condenser Refrigerant Operating Charge Inventory
  d = modelObject.condenserRefrigerantOperatingChargeInventory();
  if (d) {
    object.setDouble(Refrigeration_Condenser_AirCooledFields::CondenserRefrigerantOperatingChargeInventory,d.get());
  }

//Condensate Receiver Refrigerant Inventory
  d = modelObject.condensateReceiverRefrigerantInventory();
  if (d) {
    object.setDouble(Refrigeration_Condenser_AirCooledFields::CondensateReceiverRefrigerantInventory,d.get());
  }

//Condensate Piping Refrigerant Inventory
  d = modelObject.condensatePipingRefrigerantInventory();
  if (d) {
    object.setDouble(Refrigeration_Condenser_AirCooledFields::CondensatePipingRefrigerantInventory,d.get());
  }

  return object;

}
Пример #19
0
 Lights_Impl::Lights_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
   : SpaceLoadInstance_Impl(idfObject,model,keepHandle)
 {
   OS_ASSERT(idfObject.iddObject().type() == Lights::iddObjectType());
 }
Пример #20
0
 WindowDataFile_Impl::WindowDataFile_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
   : ConstructionBase_Impl(idfObject, model, keepHandle)
 {
   OS_ASSERT(idfObject.iddObject().type() == WindowDataFile::iddObjectType());
 }
TEST_F(ModelFixture, LifeCycleCost_BadNames)
{
  Model model1;
  Model model2;

  Building building = model1.getUniqueModelObject<Building>();

  {
    boost::optional<LifeCycleCost> cost = LifeCycleCost::createLifeCycleCost("Good Name", building, 1000.0, "CostPerEach", "Construction");
    ASSERT_TRUE(cost);
    EXPECT_EQ("Good Name", cost->nameString());
    ASSERT_TRUE(cost->getString(OS_LifeCycleCostFields::Name));
    EXPECT_EQ("Good Name", cost->getString(OS_LifeCycleCostFields::Name).get());
    IdfObject idfObject = cost->idfObject();
    ASSERT_TRUE(idfObject.getString(OS_LifeCycleCostFields::Name));
    EXPECT_EQ("Good Name", idfObject.getString(OS_LifeCycleCostFields::Name).get());

    std::stringstream ss;
    ss << *cost;
    boost::optional<IdfObject> idf2 = IdfObject::load(ss.str());
    ASSERT_TRUE(idf2);
    ASSERT_TRUE(idf2->getString(OS_LifeCycleCostFields::Name));
    EXPECT_EQ("Good Name", idf2->getString(OS_LifeCycleCostFields::Name).get());

    boost::optional<WorkspaceObject> modelObject = model2.addObject(*idf2);
    ASSERT_TRUE(modelObject);
    EXPECT_EQ("Good Name", modelObject->nameString());
  }

  {
    // &#44;
    boost::optional<LifeCycleCost> cost = LifeCycleCost::createLifeCycleCost("Comma, In, Name", building, 1000.0, "CostPerEach", "Construction");
    ASSERT_TRUE(cost);
    EXPECT_EQ("Comma, In, Name", cost->nameString());
    ASSERT_TRUE(cost->getString(OS_LifeCycleCostFields::Name));
    EXPECT_EQ("Comma, In, Name", cost->getString(OS_LifeCycleCostFields::Name).get());
    IdfObject idfObject = cost->idfObject();
    ASSERT_TRUE(idfObject.getString(OS_LifeCycleCostFields::Name));
    EXPECT_EQ("Comma, In, Name", idfObject.getString(OS_LifeCycleCostFields::Name).get());

    std::stringstream ss;
    ss << *cost;
    boost::optional<IdfObject> idf2 = IdfObject::load(ss.str());
    ASSERT_TRUE(idf2);
    ASSERT_TRUE(idf2->getString(OS_LifeCycleCostFields::Name));
    EXPECT_EQ("Comma, In, Name", idf2->getString(OS_LifeCycleCostFields::Name).get());

    boost::optional<WorkspaceObject> modelObject = model2.addObject(*idf2);
    ASSERT_TRUE(modelObject);
    EXPECT_EQ("Comma, In, Name", modelObject->nameString());
  }

  {
    // &#59;
    boost::optional<LifeCycleCost> cost = LifeCycleCost::createLifeCycleCost("Semicolon; In; Name", building, 1000.0, "CostPerEach", "Construction");
    ASSERT_TRUE(cost);
    EXPECT_EQ("Semicolon; In; Name", cost->nameString());
    ASSERT_TRUE(cost->getString(OS_LifeCycleCostFields::Name));
    EXPECT_EQ("Semicolon; In; Name", cost->getString(OS_LifeCycleCostFields::Name).get());
    IdfObject idfObject = cost->idfObject();
    ASSERT_TRUE(idfObject.getString(OS_LifeCycleCostFields::Name));
    EXPECT_EQ("Semicolon; In; Name", idfObject.getString(OS_LifeCycleCostFields::Name).get());

    std::stringstream ss;
    ss << *cost;
    boost::optional<IdfObject> idf2 = IdfObject::load(ss.str());
    ASSERT_TRUE(idf2);
    ASSERT_TRUE(idf2->getString(OS_LifeCycleCostFields::Name));
    EXPECT_EQ("Semicolon; In; Name", idf2->getString(OS_LifeCycleCostFields::Name).get());

    boost::optional<WorkspaceObject> modelObject = model2.addObject(*idf2);
    ASSERT_TRUE(modelObject);
    EXPECT_EQ("Semicolon; In; Name", modelObject->nameString());
  }

  {
    // &#33;
    boost::optional<LifeCycleCost> cost = LifeCycleCost::createLifeCycleCost("Exclamation! In! Name", building, 1000.0, "CostPerEach", "Construction");
    ASSERT_TRUE(cost);
    EXPECT_EQ("Exclamation! In! Name", cost->nameString());
    ASSERT_TRUE(cost->getString(OS_LifeCycleCostFields::Name));
    EXPECT_EQ("Exclamation! In! Name", cost->getString(OS_LifeCycleCostFields::Name).get());
    IdfObject idfObject = cost->idfObject();
    ASSERT_TRUE(idfObject.getString(OS_LifeCycleCostFields::Name));
    EXPECT_EQ("Exclamation! In! Name", idfObject.getString(OS_LifeCycleCostFields::Name).get());

    std::stringstream ss;
    ss << *cost;
    boost::optional<IdfObject> idf2 = IdfObject::load(ss.str());
    ASSERT_TRUE(idf2);
    ASSERT_TRUE(idf2->getString(OS_LifeCycleCostFields::Name));
    EXPECT_EQ("Exclamation! In! Name", idf2->getString(OS_LifeCycleCostFields::Name).get());

    boost::optional<WorkspaceObject> modelObject = model2.addObject(*idf2);
    ASSERT_TRUE(modelObject);
    EXPECT_EQ("Exclamation! In! Name", modelObject->nameString());
  }

  {
    boost::optional<LifeCycleCost> cost = LifeCycleCost::createLifeCycleCost("Crazy Name [email protected]#$%^&*(),.?;'{}|-_+=<>:\"[]~`", building, 1000.0, "CostPerEach", "Construction");
    ASSERT_TRUE(cost);
    EXPECT_EQ("Crazy Name [email protected]#$%^&*(),.?;'{}|-_+=<>:\"[]~`", cost->nameString());
    ASSERT_TRUE(cost->getString(OS_LifeCycleCostFields::Name));
    EXPECT_EQ("Crazy Name [email protected]#$%^&*(),.?;'{}|-_+=<>:\"[]~`", cost->getString(OS_LifeCycleCostFields::Name).get());
    IdfObject idfObject = cost->idfObject();
    ASSERT_TRUE(idfObject.getString(OS_LifeCycleCostFields::Name));
    EXPECT_EQ("Crazy Name [email protected]#$%^&*(),.?;'{}|-_+=<>:\"[]~`", idfObject.getString(OS_LifeCycleCostFields::Name).get());

    std::stringstream ss;
    ss << *cost;
    boost::optional<IdfObject> idf2 = IdfObject::load(ss.str());
    ASSERT_TRUE(idf2);
    ASSERT_TRUE(idf2->getString(OS_LifeCycleCostFields::Name));
    EXPECT_EQ("Crazy Name [email protected]#$%^&*(),.?;'{}|-_+=<>:\"[]~`", idf2->getString(OS_LifeCycleCostFields::Name).get());

    boost::optional<WorkspaceObject> modelObject = model2.addObject(*idf2);
    ASSERT_TRUE(modelObject);
    EXPECT_EQ("Crazy Name [email protected]#$%^&*(),.?;'{}|-_+=<>:\"[]~`", modelObject->nameString());
  }
}
Пример #22
0
 WaterUseEquipment_Impl::WaterUseEquipment_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
   : SpaceLoadInstance_Impl(idfObject,model,keepHandle)
 {
   OS_ASSERT(idfObject.iddObject().type() == WaterUseEquipment::iddObjectType());
 }
 CurveExponentialDecay_Impl::CurveExponentialDecay_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
   : Curve_Impl(idfObject,model,keepHandle)
 {
   OS_ASSERT(idfObject.iddObject().type() == CurveExponentialDecay::iddObjectType());
 }
Пример #24
0
 CurveLinear_Impl::CurveLinear_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
   : Curve_Impl(idfObject,model,keepHandle)
 {
   OS_ASSERT(idfObject.iddObject().type() == CurveLinear::iddObjectType());
 }
Пример #25
0
UtilityCost_Tariff_Impl::UtilityCost_Tariff_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
  : ParentObject_Impl(idfObject, model, keepHandle)
{
  OS_ASSERT(idfObject.iddObject().type() == UtilityCost_Tariff::iddObjectType());
}
Пример #26
0
 FanConstantVolume_Impl::FanConstantVolume_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
   : StraightComponent_Impl(idfObject, model, keepHandle)
 {
   OS_ASSERT(idfObject.iddObject().type() == FanConstantVolume::iddObjectType());
 }
 SetpointManagerSingleZoneReheat_Impl::SetpointManagerSingleZoneReheat_Impl(
     const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
   : SetpointManager_Impl(idfObject, model, keepHandle)
 {
   OS_ASSERT(idfObject.iddObject().type() == SetpointManagerSingleZoneReheat::iddObjectType());
 }
Пример #28
0
 ShadingSurfaceGroup_Impl::ShadingSurfaceGroup_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
   : PlanarSurfaceGroup_Impl(idfObject,model,keepHandle)
 {
   OS_ASSERT(idfObject.iddObject().type() == ShadingSurfaceGroup::iddObjectType());
 }
Пример #29
0
 SimulationControl_Impl::SimulationControl_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
   : ParentObject_Impl(idfObject, model, keepHandle)
 {
   OS_ASSERT(idfObject.iddObject().type() == SimulationControl::iddObjectType());
 }
Пример #30
0
 CurveQuartic_Impl::CurveQuartic_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
   : Curve_Impl(idfObject,model,keepHandle)
 {
   BOOST_ASSERT(idfObject.iddObject().type() == CurveQuartic::iddObjectType());
 }