From 3496ad1a8282a7c251cf96c3463fbf8c56af7f97 Mon Sep 17 00:00:00 2001 From: xuanluolbl Date: Fri, 14 Feb 2020 16:49:05 -0800 Subject: [PATCH] fix-2 --- .../climate-calculations.tex | 4 ++- ...p-location-climate-weather-file-access.tex | 12 ++++++-- idd/Energy+.idd.in | 4 +-- src/EnergyPlus/WeatherManager.cc | 28 +++++++++++++++---- src/EnergyPlus/WeatherManager.hh | 8 ++++-- 5 files changed, 42 insertions(+), 14 deletions(-) diff --git a/doc/engineering-reference/src/climate-sky-and-solar-shading-calculations/climate-calculations.tex b/doc/engineering-reference/src/climate-sky-and-solar-shading-calculations/climate-calculations.tex index f3d16f68afe..b2d40c68e54 100644 --- a/doc/engineering-reference/src/climate-sky-and-solar-shading-calculations/climate-calculations.tex +++ b/doc/engineering-reference/src/climate-sky-and-solar-shading-calculations/climate-calculations.tex @@ -105,7 +105,9 @@ \subsection{Sky Radiation Modeling}\label{sky-radiation-modeling} Horizontal\_IR = 0.815*5.6697e-8*(293**4) = 340.6 W/m\(^{2}\) -References for these calculations are contained in the references subsection at the end of this section and include Walton (1983), Clark and Allen (1978), and Li et al (2017). +If specified in \textbf{WeatherProperty:SkyTemperature} object, Horizontal Infrared Radiation Intensity from the weather files can also be ignored and the values can be calculated directly from the specified sky emissivity model. + +References for these calculations are contained in the references subsection at the end of this section and include Walton (1983), Clark and Allen (1978), and Li et al (2017). \subsection{EnergyPlus Sky Temperature Calculation}\label{energyplus-sky-temperature-calculation} diff --git a/doc/input-output-reference/src/overview/group-location-climate-weather-file-access.tex b/doc/input-output-reference/src/overview/group-location-climate-weather-file-access.tex index 09542aad8a7..3c5d3a33f8e 100644 --- a/doc/input-output-reference/src/overview/group-location-climate-weather-file-access.tex +++ b/doc/input-output-reference/src/overview/group-location-climate-weather-file-access.tex @@ -839,7 +839,9 @@ \subsubsection{Inputs}\label{inputs-7-013} \subsection{WeatherProperty:SkyTemperature}\label{weatherpropertyskytemperature} -Sky Temperature, or radiative sky temperature, is internally calculated by EnergyPlus with an empirical model using sky cloudiness factors and current clear sky emissivity. In Weather File Run Periods, the sky temperature is derived by the horizontal infrared radiation if presented in the weather file input. For flexibility, the following object can be entered to override the entire internal sky temperature calculation from schedule import. +Sky Temperature, or radiative sky temperature, is internally calculated by EnergyPlus with an empirical model using sky cloudiness factors and current clear sky emissivity. For flexibility, the following object can be entered to override the entire internal sky temperature calculation from schedule import. + +In particular, during Weather File Run Periods, the sky temperature is derived by the horizontal infrared radiation if presented in the weather file input by default. For flexibility, the field \textbf{Use Weather File Horizontal IR} can be set to "No" to ignore horizontal IR values from the weather file and always use the specified sky model for horizontal infrared radiation and sky temperature calculations. By default, EnergyPlus calculates clear sky emissivity using Clark-Allen model. The following object can also be entered to adopt alternative sky emissivity calculation methods. Alternative methods of sky emissivity calculation include the calibrated forms of Berdahl \& Martin, Brunt, and Idso model. Their algorithms are all described in the Engineering Reference document. Much of the literature describes the sky temperature as relative to water vapor pressure, drybulb or dewpoint temperature. @@ -873,6 +875,10 @@ \subsubsection{Inputs}\label{inputs-8-011} This field specifies a schedule name to accomplish the sky temperature calculation from the previous field. A Schedule:Day:* (i.e., \hyperref[scheduledayhourly]{Schedule:Day:Hourly}, \hyperref[scheduledayinterval]{Schedule:Day:Interval}, \hyperref[scheduledaylist]{Schedule:Day:List}) should be specified if the name in the name field matches a \hyperref[sizingperioddesignday]{SizingPeriod:DesignDay} object. If the name is one of the weather file period specifications (i.e. matches a \hyperref[sizingperiodweatherfiledays]{SizingPeriod:WeatherFileDays}, \hyperref[sizingperiodweatherfileconditiontype]{SizingPeriod:WeatherFileConditionType} or \hyperref[runperiod]{RunPeriod}), then the schedule name must match a full year schedule (i.e. \hyperref[scheduleyear]{Schedule:Year}, \hyperref[schedulecompact]{Schedule:Compact}, \hyperref[schedulefile]{Schedule:File}, or \hyperref[scheduleconstant]{Schedule:Constant}). +\paragraph{Field: Use Weather File Horizontal IR}\label{field-use-weather-file-hori-ir} + +This field specifies whether or not to use the horizontal infrared radiation values from weather files if presented. The field is default to be true. If yes or blank, and the values are presented in weather file, EnergyPlus uses the values from weather file for weather calculations, otherwise it uses the specified sky model to calculate the values. If no, it always uses the specified sky model and ignores the horizontal IR values from the weather file. For \textbf{Calculation Type} = \textbf{ScheduleValue}, \textbf{ScheduleValue} or \textbf{DifferenceScheduleDewPointValue,} this field is ignored and the scheduled values are used. If this field is set to \textbf{No} but no specific sky model is declared in the field \textbf{Calculation Type}, the default sky model \textbf{ClarkAllen} is used. + An example of IDF usage (with DesignDay): \begin{lstlisting} @@ -914,7 +920,9 @@ \subsubsection{Inputs}\label{inputs-8-011} \begin{lstlisting} WeatherProperty:SkyTemperature, , - UseBerdahlMartinModel; !- Calculation Type + UseBerdahlMartinModel, !- Calculation Type + , + No; !- Use Weather File Horizontal IR \end{lstlisting} diff --git a/idd/Energy+.idd.in b/idd/Energy+.idd.in index 5beec9be06f..27b690d57cc 100644 --- a/idd/Energy+.idd.in +++ b/idd/Energy+.idd.in @@ -1477,8 +1477,8 @@ WeatherProperty:SkyTemperature, \object-list ScheduleNames A4; \field Use Weather File Horizontal IR \note If yes or blank, use Horizontal IR values from weather file when present, otherwise use the specified sky model. - \note If no, always use the specified sky model and ignore horizontal IR value from the weather file. - \note For Calculation Type = ScheduleValue or DifferenceScheduleDryBulbValue, this field is ignored and the scheduled values are used. + \note If no, always use the specified sky model and ignore the horizontal IR values from the weather file. + \note For Calculation Type = ScheduleValue, DifferenceScheduleDryBulbValue or DifferenceScheduleDewPointValue, this field is ignored and the scheduled values are used. \type choice \default Yes \key Yes diff --git a/src/EnergyPlus/WeatherManager.cc b/src/EnergyPlus/WeatherManager.cc index 96bc642f1a5..c507425c9b6 100644 --- a/src/EnergyPlus/WeatherManager.cc +++ b/src/EnergyPlus/WeatherManager.cc @@ -2616,7 +2616,7 @@ namespace WeatherManager { SPSiteBeamSolarScheduleValue(envrnDayNum) = DDBeamSolarValues(TimeStep, HourOfDay, envrnDayNum); SPSiteDiffuseSolarScheduleValue(envrnDayNum) = DDDiffuseSolarValues(TimeStep, HourOfDay, envrnDayNum); } - if (Environment(Envrn).SkyTempModel > 3 || Environment(Envrn).SkyTempModel == 0) { + if (Environment(Envrn).SkyTempModel <= 3 || Environment(Envrn).SkyTempModel >= 1) { SPSiteSkyTemperatureScheduleValue(envrnDayNum) = DDSkyTempScheduleValues(TimeStep, HourOfDay, envrnDayNum); } } else if (TotDesDays > 0) { @@ -3500,7 +3500,7 @@ namespace WeatherManager { TomorrowLiquidPrecip(CurTimeStep, Hour) = LiquidPrecip; ESky = CalcSkyEmissivity(Environment(Envrn).SkyTempModel, OpaqueSkyCover, DryBulb, DewPoint, RelHum); - if (IRHoriz >= 9999.0) { + if (!Environment(Envrn).UseWeatherFileHorizontalIR || IRHoriz >= 9999.0) { TomorrowHorizIRSky(CurTimeStep, Hour) = ESky * Sigma * pow_4(DryBulb + TKelvin); } else { TomorrowHorizIRSky(CurTimeStep, Hour) = IRHoriz; @@ -3508,11 +3508,11 @@ namespace WeatherManager { if (Environment(Envrn).SkyTempModel > 3 || Environment(Envrn).SkyTempModel == 0) { // Calculate sky temperature, use IRHoriz if not missing - if (IRHoriz >= 9999.0) { - // Missing, using sky cover and clear sky emissivity + if (!Environment(Envrn).UseWeatherFileHorizontalIR || IRHoriz >= 9999.0) { + // Missing or user defined to not use IRHoriz from weather, using sky cover and clear sky emissivity SkyTemp = (DryBulb + TKelvin) * root_4(ESky) - TKelvin; } else { - // Valid IR from Sky + // Valid IR from weather files SkyTemp = root_4(IRHoriz / Sigma) - TKelvin; } } else { @@ -8041,10 +8041,26 @@ namespace WeatherManager { } } } + + if (!WPSkyTemperature(Item).IsSchedule && !lAlphaFieldBlanks(4)) { + if (UtilityRoutines::SameString(cAlphaArgs(4), "Yes")) { + WPSkyTemperature(Item).UseWeatherFileHorizontalIR = true; + } else if (UtilityRoutines::SameString(cAlphaArgs(4), "No")) { + WPSkyTemperature(Item).UseWeatherFileHorizontalIR = false; + } else { + ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid " + cAlphaFieldNames(4) + '.'); + ShowContinueError("...entered value=\"" + cAlphaArgs(4) + "\", should be Yes or No."); + ErrorsFound = true; + } + } else { + WPSkyTemperature(Item).UseWeatherFileHorizontalIR = true; + } } for (int envrn = 1; envrn <= NumOfEnvrn; ++envrn) { - if (Environment(envrn).WP_Type1 != 0 && NumWPSkyTemperatures >= Environment(envrn).WP_Type1) + if (Environment(envrn).WP_Type1 != 0 && NumWPSkyTemperatures >= Environment(envrn).WP_Type1){ Environment(envrn).SkyTempModel = WPSkyTemperature(Environment(envrn).WP_Type1).CalculationType; + Environment(envrn).UseWeatherFileHorizontalIR = WPSkyTemperature(Environment(envrn).WP_Type1).UseWeatherFileHorizontalIR; + } } } diff --git a/src/EnergyPlus/WeatherManager.hh b/src/EnergyPlus/WeatherManager.hh index 9b15455ca5c..40733756649 100644 --- a/src/EnergyPlus/WeatherManager.hh +++ b/src/EnergyPlus/WeatherManager.hh @@ -318,6 +318,7 @@ namespace WeatherManager { int CurrentCycle; // Current cycle through weather file in NumSimYears repeats int WP_Type1; // WeatherProperties SkyTemperature Pointer int SkyTempModel; // WeatherProperties SkyTemperature CalculationType + bool UseWeatherFileHorizontalIR; // If false, horizontal IR and sky temperature are calculated with WP models int CurrentYear; // Current year bool IsLeapYear; // True if current year is leap year. bool RollDayTypeOnRepeat; // If repeating run period, increment day type on repeat. @@ -331,8 +332,8 @@ namespace WeatherManager { : KindOfEnvrn(0), DesignDayNum(0), RunPeriodDesignNum(0), SeedEnvrnNum(0), HVACSizingIterationNum(0), TotalDays(0), StartJDay(0), StartMonth(0), StartDay(0), StartYear(0), StartDate(0), EndMonth(0), EndDay(0), EndJDay(0), EndYear(0), EndDate(0), DayOfWeek(0), UseDST(false), UseHolidays(false), ApplyWeekendRule(false), UseRain(true), UseSnow(true), MonWeekDay(12, 0), SetWeekDays(false), - NumSimYears(1), CurrentCycle(0), WP_Type1(0), SkyTempModel(0), CurrentYear(0), IsLeapYear(false), RollDayTypeOnRepeat(true), - TreatYearsAsConsecutive(true), MatchYear(false), ActualWeather(false), RawSimDays(0) + NumSimYears(1), CurrentCycle(0), WP_Type1(0), SkyTempModel(0), UseWeatherFileHorizontalIR(true), CurrentYear(0), IsLeapYear(false), + RollDayTypeOnRepeat(true), TreatYearsAsConsecutive(true), MatchYear(false), ActualWeather(false), RawSimDays(0) { } }; @@ -629,9 +630,10 @@ namespace WeatherManager { int CalculationType; int SchedulePtr; // pointer to schedule when used bool UsedForEnvrn; + bool UseWeatherFileHorizontalIR; // If false, horizontal IR and sky temperature are calculated with WP models // Default Constructor - WeatherProperties() : IsSchedule(true), CalculationType(0), SchedulePtr(0), UsedForEnvrn(false) + WeatherProperties() : IsSchedule(true), CalculationType(0), SchedulePtr(0), UsedForEnvrn(false), UseWeatherFileHorizontalIR(true) { } };