Ejemplo n.º 1
0
 bool GeneratorPVWatts_Impl::setSurface(const PlanarSurface& surface) {
   bool result = true;
   result = result && setString(OS_Generator_PVWattsFields::TiltAngle, "");
   result = result && setString(OS_Generator_PVWattsFields::AzimuthAngle, "");
   if (surface.optionalCast<Surface>()){
     result = result && setPointer(OS_Generator_PVWattsFields::SurfaceName, surface.handle());
   }
   else if (surface.optionalCast<ShadingSurface>()){
     result = result && setPointer(OS_Generator_PVWattsFields::SurfaceName, surface.handle());
   }
   return result;
 }
  bool SolarCollectorIntegralCollectorStorage_Impl::setSurface(const PlanarSurface& surface) {
    bool result(false);

    if (surface.isAirWall()){
      return false;
    }

    // DLM: check for existing solar collectors or photovoltaic generators?

    if (surface.optionalCast<Surface>()){
      Surface s = surface.cast<Surface>();
      if (istringEqual("SunExposed", s.sunExposure())){
        result = setPointer(OS_SolarCollector_IntegralCollectorStorageFields::SurfaceName, surface.handle());
      }
    } else if (surface.optionalCast<ShadingSurface>()){
      result = setPointer(OS_SolarCollector_IntegralCollectorStorageFields::SurfaceName, surface.handle());
    }

    return result;
  }
bool SolarCollectorIntegralCollectorStorage_Impl::setSurface(const PlanarSurface& surface) {
    bool result(false);

    // DLM: check for existing solar collectors or photovoltaic generators?

    if (surface.optionalCast<Surface>()) {
        result = setPointer(OS_SolarCollector_IntegralCollectorStorageFields::SurfaceName, surface.handle());
    } else if (surface.optionalCast<ShadingSurface>()) {
        result = setPointer(OS_SolarCollector_IntegralCollectorStorageFields::SurfaceName, surface.handle());
    }

    return result;
}
Ejemplo n.º 4
0
  boost::optional<ConstructionBase> DefaultConstructionSet_Impl::getDefaultConstruction(const PlanarSurface& planarSurface) const
  {
    boost::optional<ConstructionBase> result;
    if (planarSurface.optionalCast<Surface>()){

      boost::optional<DefaultSurfaceConstructions> defaultSurfaceConstructions;
      std::string outsideBoundaryCondition = planarSurface.cast<Surface>().outsideBoundaryCondition();
      if (istringEqual("Outdoors", outsideBoundaryCondition)){
        defaultSurfaceConstructions = this->defaultExteriorSurfaceConstructions();
      }else if (istringEqual("Ground", outsideBoundaryCondition) || 
                istringEqual("GroundSlabPreprocessorAverage", outsideBoundaryCondition) ||
                istringEqual("GroundSlabPreprocessorCore", outsideBoundaryCondition) ||
                istringEqual("GroundSlabPreprocessorPerimeter", outsideBoundaryCondition) ||
                istringEqual("GroundBasementPreprocessorAverageWall", outsideBoundaryCondition) ||
                istringEqual("GroundBasementPreprocessorAverageFloor", outsideBoundaryCondition) ||
                istringEqual("GroundBasementPreprocessorUpperWall", outsideBoundaryCondition) ||
                istringEqual("GroundBasementPreprocessorLowerWall", outsideBoundaryCondition)){
        defaultSurfaceConstructions = this->defaultGroundContactSurfaceConstructions();
      }else if (istringEqual("Surface", outsideBoundaryCondition)){
        defaultSurfaceConstructions = this->defaultInteriorSurfaceConstructions();
      }else{
       //Adiabatic
       //GroundFCfactorMethod
       //OtherSideCoefficients
       //OtherSideConditionsModel
      }
      
      if (defaultSurfaceConstructions){
        std::string surfaceType = planarSurface.cast<Surface>().surfaceType();
        if (istringEqual("Floor", surfaceType)){
          result = defaultSurfaceConstructions->floorConstruction();
        }else if (istringEqual("Wall", surfaceType)){
          result = defaultSurfaceConstructions->wallConstruction();
        }else if (istringEqual("RoofCeiling", surfaceType)){
          result = defaultSurfaceConstructions->roofCeilingConstruction();
        }
      }
      
    }else if (planarSurface.optionalCast<SubSurface>()){

      boost::optional<DefaultSubSurfaceConstructions> defaultSubSurfaceConstructions;
      boost::optional<Surface> surface = planarSurface.cast<SubSurface>().surface();
      if (surface){
        std::string outsideBoundaryCondition = surface->outsideBoundaryCondition();
        if (istringEqual("Outdoors", outsideBoundaryCondition)){
          defaultSubSurfaceConstructions = this->defaultExteriorSubSurfaceConstructions();
        }else if (istringEqual("Surface", outsideBoundaryCondition)){
          defaultSubSurfaceConstructions = this->defaultInteriorSubSurfaceConstructions();
        }else{
          //Adiabatic
          //Ground
          //GroundFCfactorMethod
          //OtherSideCoefficients
          //OtherSideConditionsModel
          //GroundSlabPreprocessorAverage
          //GroundSlabPreprocessorCore
          //GroundSlabPreprocessorPerimeter
          //GroundBasementPreprocessorAverageWall
          //GroundBasementPreprocessorAverageFloor
          //GroundBasementPreprocessorUpperWall
          //GroundBasementPreprocessorLowerWall
        }
      }

      if (defaultSubSurfaceConstructions){

        std::string subSurfaceType = planarSurface.cast<SubSurface>().subSurfaceType();
        if (istringEqual("FixedWindow", subSurfaceType)){
          result = defaultSubSurfaceConstructions->fixedWindowConstruction();
        }else if (istringEqual("OperableWindow", subSurfaceType)){
          result = defaultSubSurfaceConstructions->operableWindowConstruction();
        }else if (istringEqual("Door", subSurfaceType)){
          result = defaultSubSurfaceConstructions->doorConstruction();
        }else if (istringEqual("GlassDoor", subSurfaceType)){
          result = defaultSubSurfaceConstructions->glassDoorConstruction();
        }else if (istringEqual("OverheadDoor", subSurfaceType)){
          result = defaultSubSurfaceConstructions->overheadDoorConstruction();
        }else if (istringEqual("Skylight", subSurfaceType)){
          result = defaultSubSurfaceConstructions->skylightConstruction();
        }else if (istringEqual("TubularDaylightDome", subSurfaceType)){
          result = defaultSubSurfaceConstructions->tubularDaylightDomeConstruction();
        }else if (istringEqual("TubularDaylightDiffuser", subSurfaceType)){
          result = defaultSubSurfaceConstructions->tubularDaylightDiffuserConstruction();
        }
      }

    }else if (planarSurface.optionalCast<InteriorPartitionSurface>()){

      result = this->interiorPartitionConstruction();

    }else if (planarSurface.optionalCast<ShadingSurface>()){
      
      boost::optional<ShadingSurfaceGroup> shadingSurfaceGroup = planarSurface.cast<ShadingSurface>().shadingSurfaceGroup();
      if (shadingSurfaceGroup){
        std::string shadingSurfaceType = shadingSurfaceGroup->shadingSurfaceType();
        if (istringEqual("Space", shadingSurfaceType)){
          result = this->spaceShadingConstruction();
        }else if (istringEqual("Building", shadingSurfaceType)){
          result = this->buildingShadingConstruction();
        }else if (istringEqual("Site", shadingSurfaceType)){
          result = this->siteShadingConstruction();
        }
      }

    }else{
      LOG_AND_THROW("Unknown planar surface: " << planarSurface.briefDescription());
    }

    return result;
  }