Skip to content

Commit

Permalink
fix-2
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanluo113 committed Feb 15, 2020
1 parent 190f559 commit 3496ad1
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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}


Expand Down
4 changes: 2 additions & 2 deletions idd/Energy+.idd.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 22 additions & 6 deletions src/EnergyPlus/WeatherManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -3500,19 +3500,19 @@ 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;
}

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 {
Expand Down Expand Up @@ -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;
}
}
}

Expand Down
8 changes: 5 additions & 3 deletions src/EnergyPlus/WeatherManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
{
}
};
Expand Down Expand Up @@ -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)
{
}
};
Expand Down

7 comments on commit 3496ad1

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sky-emissivity (xuanluo113) - x86_64-MacOS-10.13-clang: OK (2637 of 2637 tests passed, 675 test warnings)

Messages:\n

  • 675 tests had: EIO diffs.
  • 1 test had: ESO small diffs.

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sky-emissivity (xuanluo113) - x86_64-Linux-Ubuntu-18.04-gcc-7.4: OK (2677 of 2677 tests passed, 679 test warnings)

Messages:\n

  • 679 tests had: EIO diffs.
  • 1 test had: ESO small diffs.

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sky-emissivity (xuanluo113) - x86_64-Linux-Ubuntu-18.04-cppcheck: OK (0 of 0 tests passed, 0 test warnings)

Build Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sky-emissivity (xuanluo113) - x86_64-Linux-Ubuntu-18.04-custom_check: OK (11 of 11 tests passed, 0 test warnings)

Build Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sky-emissivity (xuanluo113) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-UnitTestsCoverage-Debug: OK (1285 of 1285 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sky-emissivity (xuanluo113) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-IntegrationCoverage-Debug: OK (680 of 680 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sky-emissivity (xuanluo113) - Win64-Windows-10-VisualStudio-16: OK (2637 of 2637 tests passed, 675 test warnings)

Messages:\n

  • 675 tests had: EIO diffs.
  • 1 test had: ESO small diffs.

Build Badge Test Badge

Please sign in to comment.