Skip to content

Commit

Permalink
Merge branch 'develop' into var_speed_cond_ctrl
Browse files Browse the repository at this point in the history
  • Loading branch information
lymereJ committed Jul 3, 2024
2 parents 8d461f9 + 8d4db0f commit 2d30aa9
Show file tree
Hide file tree
Showing 11 changed files with 3,768 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ \section{Group -- Location -- Climate -- Weather File Access}\label{group-locati

\subsection{Site:Location}\label{sitelocation}

The location class describes the parameters for the building's location. Only one location is allowed. Weather data file location, if it exists, will override any location data in the IDF. Thus, for an annual simulation, a Location does not need to be entered.
The location class describes the parameters for the building's location. Only one location is allowed in an IDF. The Site:Location information input fields are described below. This object is not required for an annual simulation since by default it will read this information from the weather file specified for the run. See the Keep Site Location Information field below for more information.

\subsubsection{Inputs}\label{inputs-201709281625}

Expand All @@ -28,20 +28,29 @@ \subsubsection{Inputs}\label{inputs-201709281625}

This field represents the elevation of the facility in meters (relative to sea level).

Units with their abbreviations are shown in Appendix A. And, as shown in an IDF:
\paragraph{Field: Keep Site Location Information}\label{keep-site-location-information}

This field controls whether or not the above inforation is kept or overwritten when an annual run is performed using an attached, existing weather file. There are two choices for this optional field: Yes or No. When set to Yes, the site information in the above fields is kept and the values obtained from the weather file are ignored. This option can be useful when the nearest weather station might have a significant difference in one of the parameters such as being at a much higher altitude or being across a time zone boundary. The default value for this parameter is No which means that the values for latitude, longitude, time zone, and elevation will be overwritten by what is contained in the weather file.

\begin{callout}
Note that throughout this document units are provided for various input fields. Units with their abbreviations are shown in Appendix A.
\end{callout}

An example of what this object would look like in an IDF is:

\begin{lstlisting}
Site:Location, DENVER COLORADO, ! Name
39.75000, ! Latitude {N+ S-}
-104.8700, ! Longitude {W- E+}
-7.000000, ! TimeZoneNumber {GMT+/-}
1610.26; ! Elevation {m}
1610.26, ! Elevation {m}
No; ! Keep Site Location Information
\end{lstlisting}

Most examples in this document include the comment lines that illustrate each data field's value. However, this is not necessary (though it makes the IDF more readable). The previous example could also be:
Most examples in this document include the comment lines that illustrate each data field's value. However, this is not necessary (though it makes the IDF more readable). The previous example could also be written in an IDF as:

\begin{lstlisting}
Site:Location, DENVER COLORADO,39.75,-104.87,-7,1610.26;
Site:Location, DENVER COLORADO,39.75,-104.87,-7,1610.26,No;
\end{lstlisting}


Expand Down
7 changes: 6 additions & 1 deletion idd/Energy+.idd.in
Original file line number Diff line number Diff line change
Expand Up @@ -1022,12 +1022,17 @@ Site:Location,
\default 0.0
\note Time relative to GMT. Decimal hours.
\type real
N4 ; \field Elevation
N4 , \field Elevation
\units m
\minimum -300.0
\maximum< 8900.0
\default 0.0
\type real
A2 ; \field Keep Site Location Information
\type choice
\key Yes
\key No
\default No

Site:VariableLocation,
\memo Captures the scheduling of a moving/reorienting building, or more likely a vessel
Expand Down
10 changes: 5 additions & 5 deletions src/EnergyPlus/Construction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ void ConstructionProps::calculateTransferFunction(EnergyPlusData &state, bool &E

// As with the 1-D solution, we are accounting for the thermal mass
// of the half-node at the surface by adding it to the first row
// of interior nodes at both sides of the this-> This is not
// of interior nodes at both sides of the construction. This is not
// exact, but it does take all of the thermal mass into account.
amatx = rk(1) / (1.5 * rho(1) * cp(1) * dx(1) * dx(1));
amaty = rk(1) / (1.5 * rho(1) * cp(1) * dyn * dyn);
Expand Down Expand Up @@ -821,7 +821,7 @@ void ConstructionProps::calculateTransferFunction(EnergyPlusData &state, bool &E

// As with the 1-D solution, we are accounting for the thermal mass
// of the half-node at the surface by adding it to the first row
// of interior nodes at both sides of the this-> This is not
// of interior nodes at both sides of the construction. This is not
// exact, but it does take all of the thermal mass into account.
amatx /= 1.5;
amaty /= 1.5;
Expand Down Expand Up @@ -943,9 +943,9 @@ void ConstructionProps::calculateTransferFunction(EnergyPlusData &state, bool &E
ShowContinueError(state, "listed in the severe error above. The CTF calculate routine is unable to come up");
ShowContinueError(state, "with a series of CTF terms that have a reasonable time step and this indicates an");
ShowContinueError(state, "error. Check the definition of this construction and the materials that make up");
ShowContinueError(state, "the this-> Very thin, highly conductive materials may cause problems.");
ShowContinueError(state, "the construction. Very thin, highly conductive materials may cause problems.");
ShowContinueError(state, "This may be avoided by ignoring the presence of those materials since they probably");
ShowContinueError(state, "do not effect the heat transfer characteristics of the this-> Highly");
ShowContinueError(state, "do not effect the heat transfer characteristics of the construction. Highly");
ShowContinueError(state, "conductive or highly resistive layers that are alternated with high mass layers");
ShowContinueError(state, "may also result in problems. After confirming that the input is correct and");
ShowContinueError(state, "realistic, the user should contact the EnergyPlus support team.");
Expand All @@ -972,7 +972,7 @@ void ConstructionProps::calculateTransferFunction(EnergyPlusData &state, bool &E
this->s0(1, 1) = cnd; // CTFs for current time
this->s0(2, 1) = -cnd; // step are set to the
this->s0(1, 2) = cnd; // overall conductance
this->s0(2, 2) = -cnd; // of the this->
this->s0(2, 2) = -cnd; // of the construction.

this->e.allocate(1);
this->e = 0.0;
Expand Down
16 changes: 9 additions & 7 deletions src/EnergyPlus/VariableSpeedCoils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1033,13 +1033,15 @@ namespace VariableSpeedCoils {

state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondPumpElecNomPower = NumArray(10);

if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondPumpElecNomPower < 0.0) {
ShowSevereError(
state,
format("{}{}=\"{}\", invalid", RoutineName, CurrentModuleObject, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name));
ShowContinueError(state, format("...{} cannot be < 0.0.", cNumericFields(10)));
ShowContinueError(state, format("...entered value=[{:.2T}].", NumArray(10)));
ErrorsFound = true;
if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondPumpElecNomPower != DataSizing::AutoSize) {
if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).EvapCondPumpElecNomPower < 0.0) {
ShowSevereError(
state,
format("{}{}=\"{}\", invalid", RoutineName, CurrentModuleObject, state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).Name));
ShowContinueError(state, format("...{} cannot be < 0.0.", cNumericFields(10)));
ShowContinueError(state, format("...entered value=[{:.2T}].", NumArray(10)));
ErrorsFound = true;
}
}

// Set crankcase heater capacity
Expand Down
4 changes: 2 additions & 2 deletions src/EnergyPlus/WaterThermalTanks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ namespace EnergyPlus::WaterThermalTanks {
// WaterHeater:Mixed simulates a well-mixed, single-node tank for hot water applications. Source (e.g. heat recovery) and
// use plant connections are allowed. A scheduled domestic hot water demand can also be specified
// to directly utilize the hot water without use side connections.
// WaterHeater:Stratified simulates a stratified, multi-node tank for hot water applicatons.
// WaterHeater:Stratified simulates a stratified, multi-node tank for hot water applications.
// The model shares most of the same capabilities as WaterHeater:Mixed
// but also has up to two heating elements which can be operated in
// a master-slave mode or simultaneous mode.
Expand Down Expand Up @@ -425,7 +425,7 @@ void HeatPumpWaterHeaterData::simulate(
state.dataIntegratedHP->IntegratedHeatPumps(this->DXCoilNum).DWHCoilName,
bDWHCoilReading);
this->DXCoilAirInletNode = this->HeatPumpAirInletNode;
} else // default is to input outdoor fan to the the this
} else // default is to input outdoor fan to the HPWH
{
this->FanNum = state.dataIntegratedHP->IntegratedHeatPumps(this->DXCoilNum).IDFanID;
this->FanName = state.dataIntegratedHP->IntegratedHeatPumps(this->DXCoilNum).IDFanName;
Expand Down
61 changes: 33 additions & 28 deletions src/EnergyPlus/WeatherManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4232,32 +4232,36 @@ namespace Weather {
state.dataWeather->WeatherFileExists) {
if (state.dataWeather->LocationGathered) {
// See if "matching" location
if (std::abs(state.dataEnvrn->Latitude - state.dataWeather->WeatherFileLatitude) > 1.0 ||
std::abs(state.dataEnvrn->Longitude - state.dataWeather->WeatherFileLongitude) > 1.0 ||
std::abs(state.dataEnvrn->TimeZoneNumber - state.dataWeather->WeatherFileTimeZone) > 0.0 ||
std::abs(state.dataEnvrn->Elevation - state.dataWeather->WeatherFileElevation) / max(state.dataEnvrn->Elevation, 1.0) > 0.10) {
ShowWarningError(state, "Weather file location will be used rather than entered (IDF) Location object.");
ShowContinueError(state, format("..Location object={}", state.dataWeather->LocationTitle));
ShowContinueError(state, format("..Weather File Location={}", state.dataEnvrn->WeatherFileLocationTitle));
ShowContinueError(
state,
format("..due to location differences, Latitude difference=[{:.2R}] degrees, Longitude difference=[{:.2R}] degrees.",
std::abs(state.dataEnvrn->Latitude - state.dataWeather->WeatherFileLatitude),
std::abs(state.dataEnvrn->Longitude - state.dataWeather->WeatherFileLongitude)));
ShowContinueError(state,
format("..Time Zone difference=[{:.1R}] hour(s), Elevation difference=[{:.2R}] percent, [{:.2R}] meters.",
std::abs(state.dataEnvrn->TimeZoneNumber - state.dataWeather->WeatherFileTimeZone),
std::abs((state.dataEnvrn->Elevation - state.dataWeather->WeatherFileElevation) /
max(state.dataEnvrn->Elevation, 1.0) * 100.0),
std::abs(state.dataEnvrn->Elevation - state.dataWeather->WeatherFileElevation)));
if (!state.dataWeather->keepUserSiteLocationDefinition) {
if (std::abs(state.dataEnvrn->Latitude - state.dataWeather->WeatherFileLatitude) > 1.0 ||
std::abs(state.dataEnvrn->Longitude - state.dataWeather->WeatherFileLongitude) > 1.0 ||
std::abs(state.dataEnvrn->TimeZoneNumber - state.dataWeather->WeatherFileTimeZone) > 0.0 ||
std::abs(state.dataEnvrn->Elevation - state.dataWeather->WeatherFileElevation) / max(state.dataEnvrn->Elevation, 1.0) >
0.10) {
ShowWarningError(state, "Weather file location will be used rather than entered (IDF) Location object.");
ShowContinueError(state, format("..Location object={}", state.dataWeather->LocationTitle));
ShowContinueError(state, format("..Weather File Location={}", state.dataEnvrn->WeatherFileLocationTitle));
ShowContinueError(
state,
format("..due to location differences, Latitude difference=[{:.2R}] degrees, Longitude difference=[{:.2R}] degrees.",
std::abs(state.dataEnvrn->Latitude - state.dataWeather->WeatherFileLatitude),
std::abs(state.dataEnvrn->Longitude - state.dataWeather->WeatherFileLongitude)));
ShowContinueError(state,
format("..Time Zone difference=[{:.1R}] hour(s), Elevation difference=[{:.2R}] percent, [{:.2R}] meters.",
std::abs(state.dataEnvrn->TimeZoneNumber - state.dataWeather->WeatherFileTimeZone),
std::abs((state.dataEnvrn->Elevation - state.dataWeather->WeatherFileElevation) /
max(state.dataEnvrn->Elevation, 1.0) * 100.0),
std::abs(state.dataEnvrn->Elevation - state.dataWeather->WeatherFileElevation)));
}
}
}

state.dataWeather->LocationTitle = state.dataEnvrn->WeatherFileLocationTitle;
state.dataEnvrn->Latitude = state.dataWeather->WeatherFileLatitude;
state.dataEnvrn->Longitude = state.dataWeather->WeatherFileLongitude;
state.dataEnvrn->TimeZoneNumber = state.dataWeather->WeatherFileTimeZone;
state.dataEnvrn->Elevation = state.dataWeather->WeatherFileElevation;
if (!state.dataWeather->keepUserSiteLocationDefinition) {
state.dataWeather->LocationTitle = state.dataEnvrn->WeatherFileLocationTitle;
state.dataEnvrn->Latitude = state.dataWeather->WeatherFileLatitude;
state.dataEnvrn->Longitude = state.dataWeather->WeatherFileLongitude;
state.dataEnvrn->TimeZoneNumber = state.dataWeather->WeatherFileTimeZone;
state.dataEnvrn->Elevation = state.dataWeather->WeatherFileElevation;
}
} else if (!state.dataWeather->LocationGathered) {
state.dataWeather->LocationTitle = "Not Entered";
ShowSevereError(state, "No Location given. Must have location information for simulation.");
Expand Down Expand Up @@ -6462,18 +6466,19 @@ namespace Weather {
int LocNumAlpha; // Number of alpha names being passed
int LocNumProp; // Number of properties being passed
int IOStat; // IO Status when calling get input subroutine
Array1D_string LocNames(1); // Temp Array to transfer location info
Array1D<Real64> LocProps(4); // Temporary array to transfer location info
Array1D_string LocAlphas(2); // Temporary array to transfer location info (non-numerics)
Array1D<Real64> LocProps(4); // Temporary array to transfer location info (numerics)
// Call Input Get routine to retrieve Location information
state.dataInputProcessing->inputProcessor->getObjectItem(
state, ipsc->cCurrentModuleObject, 1, LocNames, LocNumAlpha, LocProps, LocNumProp, IOStat);
state, ipsc->cCurrentModuleObject, 1, LocAlphas, LocNumAlpha, LocProps, LocNumProp, IOStat);

// set latitude, longitude, and time zone number variables
state.dataWeather->LocationTitle = LocNames(1);
state.dataWeather->LocationTitle = LocAlphas(1);
state.dataEnvrn->Latitude = LocProps(1);
state.dataEnvrn->Longitude = LocProps(2);
state.dataEnvrn->TimeZoneNumber = LocProps(3);
state.dataEnvrn->Elevation = LocProps(4);
if (Util::SameString(LocAlphas(2), "Yes")) state.dataWeather->keepUserSiteLocationDefinition = true;
state.dataWeather->LocationGathered = true;
}
}
Expand Down
16 changes: 9 additions & 7 deletions src/EnergyPlus/WeatherManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -782,13 +782,15 @@ struct WeatherManagerData : BaseGlobalStruct
bool PrintEnvrnStamp = false; // Set to true when the environment header should be printed
bool PrintDDHeader = true;

int YearOfSim = 1; // The Present year of Simulation.
int NumDaysInYear = 365; // TODO: removed const from this until leap year behavior is reviewed
int EnvironmentReportNbr = 0; // Report number for the environment stamp
std::string EnvironmentReportChr = ""; // Report number for the environment stamp (character -- for printing)
bool WeatherFileExists = false; // Set to true if a weather file exists
std::string LocationTitle = ""; // Location Title from input File
bool LocationGathered = false; // flag to show if Location exists on Input File (we assume one is there and correct on weather file)
int YearOfSim = 1; // The Present year of Simulation.
int NumDaysInYear = 365; // TODO: removed const from this until leap year behavior is reviewed
int EnvironmentReportNbr = 0; // Report number for the environment stamp
std::string EnvironmentReportChr = ""; // Report number for the environment stamp (character -- for printing)
bool WeatherFileExists = false; // Set to true if a weather file exists
std::string LocationTitle = ""; // Location Title from input File
bool LocationGathered = false; // flag to show if Location exists on Input File (we assume one is there and correct on weather file)
bool keepUserSiteLocationDefinition = false; // flag based on user input to set whether to keep the user site location definition (true)
// or override with the site information given on weather file (false/default)

Real64 WeatherFileLatitude = 0.0;
Real64 WeatherFileLongitude = 0.0;
Expand Down
Loading

5 comments on commit 2d30aa9

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

var_speed_cond_ctrl (lymereJ) - Win64-Windows-10-VisualStudio-16: OK (2844 of 2844 tests passed, 0 test warnings)

Build Badge Test Badge

@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.

var_speed_cond_ctrl (lymereJ) - x86_64-MacOS-10.18-clang-15.0.0: OK (3613 of 3636 tests passed, 294 test warnings)

Messages:\n

  • 306 tests had: AUD diffs.
  • 311 tests had: EIO diffs.
  • 45 tests had: ESO small diffs.
  • 36 tests had: MTR small diffs.
  • 21 tests had: Table big diffs.
  • 6 tests had: Table string diffs.
  • 11 tests had: ERR diffs.
  • 44 tests had: Table small diffs.
  • 3 tests had: ESO big diffs.
  • 1 test had: MTR big diffs.

Failures:\n

regression Test Summary

  • Passed: 768
  • Failed: 23

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

var_speed_cond_ctrl (lymereJ) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (3653 of 3677 tests passed, 294 test warnings)

Messages:\n

  • 307 tests had: AUD diffs.
  • 312 tests had: EIO diffs.
  • 45 tests had: ESO small diffs.
  • 36 tests had: MTR small diffs.
  • 20 tests had: Table big diffs.
  • 11 tests had: ERR diffs.
  • 45 tests had: Table small diffs.
  • 6 tests had: Table string diffs.
  • 3 tests had: ESO big diffs.
  • 1 test had: MTR big diffs.

Failures:\n

regression Test Summary

  • Passed: 787
  • Failed: 24

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

var_speed_cond_ctrl (lymereJ) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-Debug: OK (2052 of 2052 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.

var_speed_cond_ctrl (lymereJ) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-Debug: OK (795 of 795 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.