コード例 #1
0
 Curve CoilCoolingDXVariableRefrigerantFlow_Impl::coolingCapacityModifierCurveFunctionofFlowFraction() const {
   boost::optional<Curve> value = optionalCoolingCapacityModifierCurveFunctionofFlowFraction();
   if (!value) {
     LOG_AND_THROW(briefDescription() << " does not have an Cooling Capacity Modifier Curve Functionof Flow Fraction attached.");
   }
   return value.get();
 }
コード例 #2
0
 double RefractionExtinctionGlazing_Impl::thermalTransmittance() const {
   OptionalDouble od = getDouble(OS_WindowMaterial_Glazing_RefractionExtinctionMethodFields::InfraredTransmittanceatNormalIncidence,true);
   if (!od) {
     LOG_AND_THROW("Thermal transmittance not yet defined for " << briefDescription() << ".");
   }
   return *od;
 }
コード例 #3
0
 Schedule RefrigerationAirChiller_Impl::defrostSchedule() const {
   boost::optional<Schedule> value = optionalDefrostSchedule();
   if (!value) {
     LOG_AND_THROW(briefDescription() << " does not have an Defrost Schedule attached.");
   }
   return value.get();
 }
コード例 #4
0
 AirToAirComponent CoilSystemCoolingWaterHeatExchangerAssisted_Impl::heatExchanger() const {
   boost::optional<AirToAirComponent> value = optionalHeatExchanger();
   if (!value) {
     LOG_AND_THROW(briefDescription() << " does not have an Heat Exchanger attached.");
   }
   return value.get();
 }
コード例 #5
0
 Schedule AvailabilityManagerNightVentilation_Impl::applicabilitySchedule() const {
   boost::optional<Schedule> value = optionalApplicabilitySchedule();
   if (!value) {
     LOG_AND_THROW(briefDescription() << " does not have an Applicability Schedule attached.");
   }
   return value.get();
 }
コード例 #6
0
ファイル: Quantity.cpp プロジェクト: airguider/OpenStudio
Quantity& Quantity::operator+=(const Quantity& rQuantity) {

  if (this == &rQuantity) {
    m_value *= 2.0;
    return *this;
  }

  if (m_units != rQuantity.m_units) {
    LOG_AND_THROW("Cannot add quantities with different units.");
  }

  if (scale() != rQuantity.scale()) {
    Quantity wRQuantity(rQuantity);
    wRQuantity.setScale(scale().exponent);
    m_value += wRQuantity.value();
  }
  else {
    m_value += rQuantity.value();
  }

  if (isTemperature() && rQuantity.isTemperature()) {
    if (!isAbsolute() && rQuantity.isAbsolute()) {
      setAsAbsolute();
    }
  }

  return *this;
}
コード例 #7
0
ファイル: OSDoubleEdit.cpp プロジェクト: airguider/OpenStudio
void OSDoubleEdit2::completeBind() {

  // only let one of autosize/autocalculate
  if ((m_isAutosized && m_isAutocalculated) || 
      (m_isAutosized && m_autocalculate) || 
      (m_isAutocalculated && m_autosize)) 
  {
    LOG_AND_THROW("A field can only be autosized or autocalculated, it cannot be both.");
  }

  setEnabled(true);

  bool isConnected = false;
  isConnected = connect( this, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()) );
  OS_ASSERT(isConnected);

  isConnected = connect( m_modelObject->getImpl<openstudio::model::detail::ModelObject_Impl>().get(),SIGNAL(onChange()),
                         this,SLOT(onModelObjectChange()) );
  OS_ASSERT(isConnected);

  isConnected = connect( m_modelObject->getImpl<openstudio::model::detail::ModelObject_Impl>().get(),SIGNAL(onRemoveFromWorkspace(Handle)),
                         this,SLOT(onModelObjectRemove(Handle)) );
  OS_ASSERT(isConnected);

  refreshTextAndLabel();
}
コード例 #8
0
AirTerminalSingleDuctParallelPIUReheat::AirTerminalSingleDuctParallelPIUReheat( const Model& model,
                                                                                Schedule & schedule,
                                                                                HVACComponent & fan,
                                                                                HVACComponent & reheatCoil )
  : StraightComponent(AirTerminalSingleDuctParallelPIUReheat::iddObjectType(),model)
{
  OS_ASSERT(getImpl<detail::AirTerminalSingleDuctParallelPIUReheat_Impl>());

  bool test = setAvailabilitySchedule(schedule);
  if (!test) {
    remove();
    LOG_AND_THROW("Could not construct " << briefDescription() << ", because could not set its "
        << "availability schedule to " << schedule.briefDescription() << ".");
  }

  setFan(fan);

  setReheatCoil(reheatCoil);

  autosizeMaximumHotWaterorSteamFlowRate();

  setMinimumHotWaterorSteamFlowRate(0.0);

  setConvergenceTolerance(0.001);

  autosizeMaximumPrimaryAirFlowRate();

  autosizeMaximumSecondaryAirFlowRate();

  autosizeMinimumPrimaryAirFlowFraction();

  autosizeFanOnFlowFraction();
}
コード例 #9
0
ファイル: OSArgument.cpp プロジェクト: Rahjou/OpenStudio
std::string OSArgument::valueAsString() const
{
  if (!hasValue()) {
    LOG_AND_THROW("Argument " << name() << " has no value.");
  }
  return printQVariant(m_value);
}
コード例 #10
0
 Schedule CentralHeatPumpSystemModule_Impl::chillerHeaterModulesControlSchedule() const {
   boost::optional<Schedule> value = optionalChillerHeaterModulesControlSchedule();
   if (!value) {
     LOG_AND_THROW(briefDescription() << " does not have an Chiller Heater Modules Control Schedule attached.");
   }
   return value.get();
 }
コード例 #11
0
ZoneHVACLowTemperatureRadiantElectric::ZoneHVACLowTemperatureRadiantElectric(const Model& model, Schedule & availabilitySchedule, Schedule & heatingTemperatureSchedule)
  : ZoneHVACComponent(ZoneHVACLowTemperatureRadiantElectric::iddObjectType(),model)
{
  OS_ASSERT(getImpl<detail::ZoneHVACLowTemperatureRadiantElectric_Impl>());


  bool ok = setAvailabilitySchedule(availabilitySchedule);
     
  if (!ok) 
  {
    //remove();
    LOG_AND_THROW("Unable to set " << briefDescription() << "'s availability schedule to "
                << availabilitySchedule.briefDescription() << ".");
  }
  
  ok = setHeatingSetpointTemperatureSchedule(heatingTemperatureSchedule);
     
  if (!ok) 
  {
    //remove();
    //LOG_AND_THROW("Unable to set " << briefDescription() << "'s heating temperature schedule to "
    //            << schedule.briefDescription() << ".");
  }
  
  resetRadiantSurfaceType();
  autosizeMaximumElectricalPowertoPanel();
  setTemperatureControlType("MeanAirTemperature");
  setHeatingThrottlingRange(2.0);
  //setString(OS_ZoneHVAC_LowTemperatureRadiant_ElectricFields::HeatingSetpointTemperatureScheduleName,"");
  
}
コード例 #12
0
 ChillerHeaterPerformanceElectricEIR CentralHeatPumpSystemModule_Impl::chillerHeaterModulesPerformanceComponent() const {
   boost::optional<ChillerHeaterPerformanceElectricEIR> value = optionalChillerHeaterModulesPerformanceComponent();
   if (!value) {
     LOG_AND_THROW(briefDescription() << " does not have an Chiller Heater Modules Performance Component attached.");
   }
   return value.get();
 }
コード例 #13
0
ファイル: GasMixture.cpp プロジェクト: ORNL-BTRIC/OpenStudio
 double GasMixture_Impl::getThermalConductivity(double temperature) const {
   double molecularWeight(0.0); // cumulative sum of fraction * molecular weight
   double result(0.0); // cumulative sum of conductivity * fraction * molecular weight
   for (unsigned i = 0, n = numGases(); i < n; ++i) {
     std::string type = getGasType(i);
     double fraction = getGasFraction(i);
     double weight(0.0);
     std::vector<double> coeffs;
     if (openstudio::istringEqual(type,"Air")) {
       weight = FenestrationMaterial::airMolecularWeight();
       coeffs = FenestrationMaterial::airThermalConductivityCoefficients();
     }
     else if (openstudio::istringEqual(type,"Argon")) {
       weight = FenestrationMaterial::argonMolecularWeight();
       coeffs = FenestrationMaterial::argonThermalConductivityCoefficients();
     }
     else if (openstudio::istringEqual(type,"Krypton")) {
       weight = FenestrationMaterial::kryptonMolecularWeight();
       coeffs = FenestrationMaterial::kryptonThermalConductivityCoefficients();
     }
     else if (openstudio::istringEqual(type,"Xenon")) {
       weight = FenestrationMaterial::xenonMolecularWeight();
       coeffs = FenestrationMaterial::xenonThermalConductivityCoefficients();
     }
     else {
       LOG_AND_THROW("Unknown gasType listed in " << briefDescription() << ".");
     }
     molecularWeight += weight*fraction;
     result += (coeffs[0] + (coeffs[1] * temperature) + (coeffs[2] * ::pow(temperature,2.0))) * fraction * weight;
   }
   result /= molecularWeight;
   return result;
 }
コード例 #14
0
 Schedule CoilCoolingDXVariableRefrigerantFlow_Impl::availabilitySchedule() const {
   boost::optional<Schedule> value = optionalAvailabilitySchedule();
   if (!value) {
     LOG_AND_THROW(briefDescription() << " does not have an Availability Schedule attached.");
   }
   return value.get();
 }
コード例 #15
0
 Schedule ZoneMixing_Impl::schedule() const {
   boost::optional<Schedule> value = getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_ZoneMixingFields::ScheduleName);
   if (!value) {
     LOG_AND_THROW(briefDescription() << " does not have an Schedule attached.");
   }
   return value.get();
 }
コード例 #16
0
ファイル: OSArgument.cpp プロジェクト: Rahjou/OpenStudio
std::string OSArgument::defaultValueAsString() const
{
  if (!hasDefaultValue()) {
    LOG_AND_THROW("Argument " << name() << " does not have a default value.");
  }
  return printQVariant(m_defaultValue);
}
コード例 #17
0
 Schedule ControllerMechanicalVentilation_Impl::availabilitySchedule() const {
   boost::optional<Schedule> value = optionalAvailabilitySchedule();
   if (!value) {
     LOG_AND_THROW(briefDescription() << " does not have an Availability Schedule attached.");
   }
   return value.get();
 }
コード例 #18
0
 Schedule LoadProfilePlant_Impl::flowRateFractionSchedule() const {
   boost::optional<Schedule> value = optionalFlowRateFractionSchedule();
   if (!value) {
     LOG_AND_THROW(briefDescription() << " does not have an Flow Rate Fraction Schedule attached.");
   }
   return value.get();
 }
コード例 #19
0
ファイル: ComponentData.cpp プロジェクト: NREL/OpenStudio
 ModelObject ComponentData_Impl::primaryComponentObject() const {
   OptionalModelObject omo = getComponentObject(0);
   if (!omo) {
     LOG_AND_THROW("ComponentData objects must always be able to return the primary object in the component.");
   }
   return *omo;
 }
コード例 #20
0
 Curve CoilWaterHeatingAirToWaterHeatPumpWrapped_Impl::heatingCOPFunctionofAirFlowFractionCurve() const {
   boost::optional<Curve> value = optionalHeatingCOPFunctionofAirFlowFractionCurve();
   if (!value) {
     LOG_AND_THROW(briefDescription() << " does not have an Heating COPFunctionof Air Flow Fraction Curve attached.");
   }
   return value.get();
 }
コード例 #21
0
 Curve ThermalStorageIceDetailed_Impl::chargingCurve() const {
   auto value = optionalChargingCurve();
   if (!value) {
     LOG_AND_THROW(briefDescription() << " does not have an Charging Curve attached.");
   }
   return value.get();
 }
コード例 #22
0
 Curve CoilWaterHeatingAirToWaterHeatPumpWrapped_Impl::partLoadFractionCorrelationCurve() const {
   boost::optional<Curve> value = optionalPartLoadFractionCorrelationCurve();
   if (!value) {
     LOG_AND_THROW(briefDescription() << " does not have an Part Load Fraction Correlation Curve attached.");
   }
   return value.get();
 }
コード例 #23
0
 WaterToAirComponent CoilSystemCoolingWaterHeatExchangerAssisted_Impl::coolingCoil() const {
   auto value = optionalCoolingCoil();
   if (!value) {
     LOG_AND_THROW(briefDescription() << " does not have an Cooling Coil attached.");
   }
   return value.get();
 }
 Curve CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::energyPartLoadFractionCurve() const {
   boost::optional<Curve> value = optionalEnergyPartLoadFractionCurve();
   if (!value) {
     LOG_AND_THROW(briefDescription() << " does not have an Energy Part Load Fraction Curve attached.");
   }
   return value.get();
 }
コード例 #25
0
 double RefractionExtinctionGlazing_Impl::thermalConductivity() const {
   OptionalDouble od = getDouble(OS_WindowMaterial_Glazing_RefractionExtinctionMethodFields::Conductivity,true);
   if (!od) {
     LOG_AND_THROW("Thermal conductivity not yet defined for " << briefDescription() << ".");
   }
   return *od;
 }
コード例 #26
0
ファイル: SizingPlant.cpp プロジェクト: pepsi7959/OpenStudio
 PlantLoop SizingPlant_Impl::plantLoop() const {
   boost::optional<PlantLoop> value = optionalPlantLoop();
   if (!value) {
     LOG_AND_THROW(briefDescription() << " does not have a Plant Loop attached.");
   }
   return value.get();
 }
コード例 #27
0
 Schedule AvailabilityManagerScheduled_Impl::schedule() const {
   boost::optional<Schedule> value = optionalSchedule();
   if (!value) {
     LOG_AND_THROW(briefDescription() << " does not have an Schedule attached.");
   }
   return value.get();
 }
コード例 #28
0
 ThermalZone ZoneMixing_Impl::zone() const {
   boost::optional<ThermalZone> value = getObject<ModelObject>().getModelObjectTarget<ThermalZone>(OS_ZoneMixingFields::ZoneName);
   if (!value) {
     LOG_AND_THROW(briefDescription() << " does not have a receiving ThermalZone.");
   }
   return value.get();
 }
コード例 #29
0
 Schedule ZoneHVACBaseboardConvectiveElectric_Impl::availabilitySchedule() const {
   boost::optional<Schedule> value = optionalAvailabilitySchedule();
   if (!value) {
     LOG_AND_THROW(briefDescription() << " does not have an Availability Schedule attached.");
   }
   return value.get();
 }
コード例 #30
0
 Curve ChillerAbsorptionIndirect_Impl::generatorHeatInputCorrectionFunctionofChilledWaterTemperatureCurve() const {
   boost::optional<Curve> value = optionalGeneratorHeatInputCorrectionFunctionofChilledWaterTemperatureCurve();
   if (!value) {
     LOG_AND_THROW(briefDescription() << " does not have an Generator Heat Input Correction Functionof Chilled Water Temperature Curve attached.");
   }
   return value.get();
 }