ZoneHVACEquipmentList::ZoneHVACEquipmentList(const ThermalZone & thermalZone)
  : ModelObject(ZoneHVACEquipmentList::iddObjectType(),thermalZone.model())
{
  OS_ASSERT(getImpl<detail::ZoneHVACEquipmentList_Impl>());

  setPointer(OS_ZoneHVAC_EquipmentListFields::ThermalZone,thermalZone.handle());
}
Esempio n. 2
0
 bool ZoneMixing_Impl::setSourceZone(const ThermalZone& zone) {
   bool result(false);
   
   // source zone cannot be the same as this zone
   if (zone.handle() != this->zone().handle()){
     result = setPointer(OS_ZoneMixingFields::SourceZoneName, zone.handle());
   }
   return result;
 }
TEST_F(ModelFixture, AirflowNetwork_Zone_Basic)
{
  Model model;
  ThermalZone thermalZone(model);
  Space space1(model);
  Space space2(model);

  EXPECT_FALSE(thermalZone.airflowNetworkZone());
  EXPECT_FALSE(space1.thermalZone());
  EXPECT_FALSE(space2.thermalZone());
  EXPECT_EQ(0u, thermalZone.spaces().size());

  EXPECT_TRUE(space1.setThermalZone(thermalZone));
  ASSERT_TRUE(space1.thermalZone());
  EXPECT_EQ(thermalZone.handle(), space1.thermalZone()->handle());
  EXPECT_FALSE(space2.thermalZone());
  EXPECT_EQ(1u, thermalZone.spaces().size());

  ASSERT_TRUE(space1.thermalZone());
  EXPECT_EQ(thermalZone.handle(), space1.thermalZone()->handle());
  EXPECT_TRUE(space2.setThermalZone(thermalZone));
  ASSERT_TRUE(space2.thermalZone());
  EXPECT_EQ(thermalZone.handle(), space2.thermalZone()->handle());
  EXPECT_EQ(2u, thermalZone.spaces().size());

  auto zone = thermalZone.getAirflowNetworkZone();
  auto optzone = thermalZone.airflowNetworkZone();
  ASSERT_TRUE(optzone);
  EXPECT_EQ(zone, optzone.get());

  zone.setFacadeWidth(50.0);
  CurveLinear curve(model);
  curve.setCoefficient1Constant(55.0);
  curve.setCoefficient2x(0.0);

  AirflowNetworkOccupantVentilationControl ovc(model, curve);
  EXPECT_FALSE(zone.occupantVentilationControl());
  EXPECT_TRUE(zone.setOccupantVentilationControl(ovc));
  ASSERT_TRUE(zone.occupantVentilationControl());
  EXPECT_EQ(ovc, zone.occupantVentilationControl().get());

  ThermalZone thermalZoneClone = thermalZone.clone(model).cast<ThermalZone>();
  optzone = thermalZoneClone.airflowNetworkZone();
  ASSERT_TRUE(optzone);
  EXPECT_NE(zone, optzone.get());
  EXPECT_EQ(50.0, optzone.get().facadeWidth());
  ASSERT_TRUE(optzone.get().occupantVentilationControl());
  EXPECT_EQ(ovc, optzone.get().occupantVentilationControl().get());

}
Esempio n. 4
0
ZoneMixing::ZoneMixing(const ThermalZone& zone)
  : ModelObject(ZoneMixing::iddObjectType(), zone.model())
{
  OS_ASSERT(getImpl<detail::ZoneMixing_Impl>());

  bool ok = setPointer(OS_ZoneMixingFields::ZoneName, zone.handle());
  OS_ASSERT(ok);

  ok = setPointer(OS_ZoneMixingFields::ScheduleName, zone.model().alwaysOnContinuousSchedule().handle());
  OS_ASSERT(ok);

  ok = setDesignFlowRate(0.0);
  OS_ASSERT(ok);
}
  bool RefrigerationAirChiller_Impl::addToThermalZone(ThermalZone & thermalZone)
  {
    Model m = this->model();

    if( thermalZone.model() != m )
    {
      return false;
    }

    removeFromThermalZone();
    thermalZone.setUseIdealAirLoads(false);
    thermalZone.addEquipment(this->getObject<ZoneHVACComponent>());

    return true;
  }
  bool ZoneHVACBaseboardConvectiveElectric_Impl::addToThermalZone(ThermalZone & thermalZone)
  {
    Model m = this->model();

    if( thermalZone.model() != m )
    {
      return false;
    }

    if( thermalZone.isPlenum() )
    {
      return false;
    }

    removeFromThermalZone();

    thermalZone.setUseIdealAirLoads(false);

    thermalZone.addEquipment(this->getObject<ZoneHVACComponent>());

    return true;
  }
  //reimplemented to override the base-class method in ZoneHVACComponent
  //because this component doesn't get attached to the zone inlet and zone outlet nodes
  bool ZoneHVACLowTempRadiantVarFlow_Impl::addToThermalZone(ThermalZone & thermalZone)
  {
    Model m = this->model();

    if( thermalZone.model() != m )
    {
      return false;
    }

    if( thermalZone.isPlenum() )
    {
      return false;
    }

    removeFromThermalZone();

    thermalZone.setUseIdealAirLoads(false);

    thermalZone.addEquipment(this->getObject<ZoneHVACComponent>());

    return true;
  }
Esempio n. 8
0
  bool FanZoneExhaust_Impl::addToThermalZone(ThermalZone & thermalZone)
  {
    Model m = this->model();

    if( thermalZone.model() != m )
    {
      return false;
    }

    removeFromThermalZone();

    thermalZone.setUseIdealAirLoads(false);

    // Zone Exhaust Node (Exhaust Fan Inlet node)

    Node exhaustNode(m);

    PortList exhaustPortList = thermalZone.exhaustPortList();

    unsigned nextPort = exhaustPortList.nextPort();

    m.connect(exhaustPortList,nextPort,exhaustNode,exhaustNode.inletPort());

    ModelObject mo = this->getObject<ModelObject>();

    m.connect(exhaustNode,exhaustNode.outletPort(),mo,this->inletPort());

    // Node (Exhaust Fan Outlet Node) 

    Node exhaustFanOutletNode(m);

    m.connect(mo,this->outletPort(),exhaustFanOutletNode,exhaustFanOutletNode.inletPort());

    thermalZone.addEquipment(this->getObject<ZoneHVACComponent>());

    return true;
  }
  bool AirTerminalSingleDuctParallelPIUReheat_Impl::setInducedAirPlenumZone(ThermalZone & plenumZone)
  {
    bool result = true;

    if( ! plenumZone.isPlenum() )
    {
      result = false;
    }

    boost::optional<Node> t_secondaryAirInletNode;
    if( result )
    {
      t_secondaryAirInletNode = secondaryAirInletNode();
      if( ! t_secondaryAirInletNode )
      {
        result = false;
      }
    }

    boost::optional<AirLoopHVACReturnPlenum> plenum;
    if( result )
    {
      plenum = plenumZone.getImpl<detail::ThermalZone_Impl>()->airLoopHVACReturnPlenum();
      if( ! plenum )
      {
        result = false;
      }
    }

    if( result )
    {
      Model t_model = model();
      PortList pl = plenum->getImpl<detail::AirLoopHVACReturnPlenum_Impl>()->inducedAirOutletPortList();
      t_model.connect(pl,pl.nextPort(),t_secondaryAirInletNode.get(),t_secondaryAirInletNode->inletPort());
    }

    return result;
  }
Esempio n. 10
0
  bool ZoneHVACComponent_Impl::addToThermalZone(ThermalZone & thermalZone)
  {
    Model m = this->model();

    if( thermalZone.model() != m ) {
      return false;
    }

    if( thermalZone.isPlenum() ) {
      return false;
    }

    removeFromThermalZone();

    thermalZone.setUseIdealAirLoads(false);

    // Connect nodes if this is an air based zone hvac component
    if( inletPort() != 0u && outletPort() != 0u ) {
      // Exhaust Node
      Node exhaustNode(m);
      PortList exhaustPortList = thermalZone.exhaustPortList();
      unsigned nextPort = exhaustPortList.nextPort();
      m.connect(exhaustPortList,nextPort,exhaustNode,exhaustNode.inletPort());
      ModelObject mo = this->getObject<ModelObject>();
      m.connect(exhaustNode,exhaustNode.outletPort(),mo,this->inletPort());

      // Air Inlet Node
      Node airInletNode(m);
      PortList inletPortList = thermalZone.inletPortList();
      unsigned nextInletPort = inletPortList.nextPort();
      m.connect(airInletNode,airInletNode.outletPort(),inletPortList,nextInletPort);
      m.connect(mo,this->outletPort(),airInletNode,airInletNode.inletPort());
    }

    thermalZone.addEquipment(this->getObject<ZoneHVACComponent>());

    return true;
  }
 bool ZoneControlContaminantController_Impl::setControlledZone(ThermalZone& zone) {
   return setPointer(OS_ZoneControl_ContaminantControllerFields::ControlledZoneName,zone.handle());
 }
  void SetpointManagerSingleZoneReheat_Impl::setControlZone(ThermalZone & thermalZone)
  {
    SetpointManagerSingleZoneReheat thisModelObject = this->getObject<SetpointManagerSingleZoneReheat>();

    thisModelObject.setPointer(OS_SetpointManager_SingleZone_ReheatFields::ControlZoneName,thermalZone.handle());
  }
boost::optional<IdfObject> ForwardTranslator::translateZoneMixing( ZoneMixing & modelObject )
{
  // Makes sure the modelObject gets put in the map, and that the new idfObject gets put in 
  // the final file. Also set's the idfObject's name.
  IdfObject idfObject = createRegisterAndNameIdfObject(IddObjectType::ZoneMixing, modelObject);

  boost::optional<double> value;

  // ZoneName 
  ThermalZone zone = modelObject.zone();
  translateAndMapModelObject(zone);
  idfObject.setString(ZoneMixingFields::ZoneName, zone.name().get());

  // ScheduleName 
  Schedule schedule = modelObject.schedule();
  translateAndMapModelObject(schedule);
  idfObject.setString(ZoneMixingFields::ScheduleName, schedule.name().get());

  // DesignFlowRateCalculationMethod
  idfObject.setString(ZoneMixingFields::DesignFlowRateCalculationMethod, modelObject.designFlowRateCalculationMethod());

  // DesignFlowRate
  value = modelObject.designFlowRate();
  if (value){
    idfObject.setDouble(ZoneMixingFields::DesignFlowRate, *value);
  }

  // FlowRateperZoneFloorArea
  value = modelObject.flowRateperZoneFloorArea();
  if (value){
    idfObject.setDouble(ZoneMixingFields::FlowRateperZoneFloorArea, *value);
  }

  // FlowRateperPerson
  value = modelObject.flowRateperPerson();
  if (value){
    idfObject.setDouble(ZoneMixingFields::FlowRateperPerson, *value);
  }

  // AirChangesperHour
  value = modelObject.airChangesperHour();
  if (value){
    idfObject.setDouble(ZoneMixingFields::AirChangesperHour, *value);
  }

  // SourceZone
  boost::optional<ThermalZone> sourceZone = modelObject.sourceZone();
  if (sourceZone){
    // DLM: do not translate source zone now, it will be translated at the right time
    idfObject.setString(ZoneMixingFields::SourceZoneName, sourceZone->name().get());
  }

  // DeltaTemperature
  value = modelObject.deltaTemperature();
  if (value){
    idfObject.setDouble(ZoneMixingFields::DeltaTemperature, *value);
  }

  // DeltaTemperatureScheduleName
  boost::optional<Schedule> optSchedule = modelObject.deltaTemperatureSchedule();
  if (optSchedule){
    translateAndMapModelObject(*optSchedule);
    idfObject.setString(ZoneMixingFields::DeltaTemperatureScheduleName, optSchedule->name().get());
  }
  
  // MinimumZoneTemperatureScheduleName
  optSchedule = modelObject.minimumZoneTemperatureSchedule();
  if (optSchedule){
    translateAndMapModelObject(*optSchedule);
    idfObject.setString(ZoneMixingFields::MinimumZoneTemperatureScheduleName, optSchedule->name().get());
  }

  // MaximumZoneTemperatureScheduleName
  optSchedule = modelObject.maximumZoneTemperatureSchedule();
  if (optSchedule){
    translateAndMapModelObject(*optSchedule);
    idfObject.setString(ZoneMixingFields::MaximumZoneTemperatureScheduleName, optSchedule->name().get());
  }

  // MinimumSourceZoneTemperatureScheduleName
  optSchedule = modelObject.minimumSourceZoneTemperatureSchedule();
  if (optSchedule){
    translateAndMapModelObject(*optSchedule);
    idfObject.setString(ZoneMixingFields::MinimumSourceZoneTemperatureScheduleName, optSchedule->name().get());
  }

  // MaximumSourceZoneTemperatureScheduleName
  optSchedule = modelObject.maximumSourceZoneTemperatureSchedule();
  if (optSchedule){
    translateAndMapModelObject(*optSchedule);
    idfObject.setString(ZoneMixingFields::MaximumSourceZoneTemperatureScheduleName, optSchedule->name().get());
  }

  // MinimumOutdoorTemperatureScheduleName
  optSchedule = modelObject.minimumOutdoorTemperatureSchedule();
  if (optSchedule){
    translateAndMapModelObject(*optSchedule);
    idfObject.setString(ZoneMixingFields::MinimumOutdoorTemperatureScheduleName, optSchedule->name().get());
  }

  // MaximumOutdoorTemperatureScheduleName
  optSchedule = modelObject.maximumOutdoorTemperatureSchedule();
  if (optSchedule){
    translateAndMapModelObject(*optSchedule);
    idfObject.setString(ZoneMixingFields::MaximumOutdoorTemperatureScheduleName, optSchedule->name().get());
  }

  return idfObject;
}
 bool ElectricLoadCenterInverterSimple_Impl::setThermalZone(const ThermalZone& thermalZone) {
   return setPointer(OS_ElectricLoadCenter_Inverter_SimpleFields::ZoneName, thermalZone.handle());
 }
 bool SetpointManagerSingleZoneHumidityMaximum_Impl::setControlZone(const ThermalZone& thermalZone) {
   bool result = setPointer(OS_SetpointManager_SingleZone_Humidity_MaximumFields::ControlZoneName, thermalZone.handle());
   return result;
 }
 bool RefrigerationWalkInZoneBoundary_Impl::setThermalZone(const ThermalZone& thermalZone) {
   bool result = setPointer(OS_Refrigeration_WalkIn_ZoneBoundaryFields::ZoneName, thermalZone.handle());
   return result;
 }