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(); }
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; }
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(); }
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(); }
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(); }
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; }
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(); }
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(); }
std::string OSArgument::valueAsString() const { if (!hasValue()) { LOG_AND_THROW("Argument " << name() << " has no value."); } return printQVariant(m_value); }
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(); }
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,""); }
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(); }
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; }
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(); }
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(); }
std::string OSArgument::defaultValueAsString() const { if (!hasDefaultValue()) { LOG_AND_THROW("Argument " << name() << " does not have a default value."); } return printQVariant(m_defaultValue); }
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(); }
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(); }
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; }
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(); }
Curve ThermalStorageIceDetailed_Impl::chargingCurve() const { auto value = optionalChargingCurve(); if (!value) { LOG_AND_THROW(briefDescription() << " does not have an Charging Curve attached."); } return value.get(); }
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(); }
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(); }
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; }
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(); }
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(); }
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(); }
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(); }
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(); }