Skip to content

Commit

Permalink
convert SteamCoil
Browse files Browse the repository at this point in the history
  • Loading branch information
brianlball committed Oct 16, 2020
1 parent 6c1e5e5 commit 828c430
Show file tree
Hide file tree
Showing 16 changed files with 511 additions and 635 deletions.
1 change: 1 addition & 0 deletions src/EnergyPlus/Data/CommonIncludes.hh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
#include <EnergyPlus/Fans.hh>
#include <EnergyPlus/Pipes.hh>
#include <EnergyPlus/PlantChillers.hh>
#include <EnergyPlus/SteamCoils.hh>
#include <EnergyPlus/SurfaceGroundHeatExchanger.hh>
#include <EnergyPlus/SwimmingPool.hh>
#include <EnergyPlus/SystemAvailabilityManager.hh>
Expand Down
2 changes: 2 additions & 0 deletions src/EnergyPlus/Data/EnergyPlusData.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ namespace EnergyPlus {
this->dataGlobal = std::unique_ptr<DataGlobal>(new DataGlobal);
this->dataPipes = std::unique_ptr<PipesData>(new PipesData);
this->dataPlantChillers = std::unique_ptr<PlantChillersData>(new PlantChillersData);
this->dataSteamCoils = std::unique_ptr<SteamCoilsData>(new SteamCoilsData);
this->dataSurfaceGroundHeatExchangers = std::unique_ptr<SurfaceGroundHeatExchangersData>(new SurfaceGroundHeatExchangersData);
this->dataSwimmingPools = std::unique_ptr<SwimmingPoolsData>(new SwimmingPoolsData);
this->dataSystemAvailabilityManager = std::unique_ptr<SystemAvailabilityManagerData>(new SystemAvailabilityManagerData);
Expand Down Expand Up @@ -146,6 +147,7 @@ namespace EnergyPlus {
this->dataGlobal->clear_state();
this->dataPipes->clear_state();
this->dataPlantChillers->clear_state();
this->dataSteamCoils->clear_state();
this->dataSurfaceGroundHeatExchangers->clear_state();
this->dataSwimmingPools->clear_state();
this->dataSystemAvailabilityManager->clear_state();
Expand Down
2 changes: 2 additions & 0 deletions src/EnergyPlus/Data/EnergyPlusData.hh
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ struct ExteriorEnergyUseData;
struct FansData;
struct PipesData;
struct PlantChillersData;
struct SteamCoilsData;
struct SurfaceGroundHeatExchangersData;
struct SwimmingPoolsData;
struct SystemAvailabilityManagerData;
Expand Down Expand Up @@ -158,6 +159,7 @@ struct EnergyPlusData : BaseGlobalStruct {
std::unique_ptr<FansData> dataFans;
std::unique_ptr<PipesData> dataPipes;
std::unique_ptr<PlantChillersData> dataPlantChillers;
std::unique_ptr<SteamCoilsData> dataSteamCoils;
std::unique_ptr<SurfaceGroundHeatExchangersData> dataSurfaceGroundHeatExchangers;
std::unique_ptr<SwimmingPoolsData> dataSwimmingPools;
std::unique_ptr<SystemAvailabilityManagerData> dataSystemAvailabilityManager;
Expand Down
12 changes: 6 additions & 6 deletions src/EnergyPlus/FaultsManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -883,28 +883,28 @@ namespace FaultsManager {
} else if (UtilityRoutines::SameString(SELECT_CASE_VAR, "Coil:Heating:Steam")) {

// Read in coil input if not done yet
if (SteamCoils::GetSteamCoilsInputFlag) {
if (state.dataSteamCoils->GetSteamCoilsInputFlag) {
SteamCoils::GetSteamCoilInput(state);
SteamCoils::GetSteamCoilsInputFlag = false;
state.dataSteamCoils->GetSteamCoilsInputFlag = false;
}
// Check the coil name and coil type
int CoilNum = UtilityRoutines::FindItemInList(FaultsCoilSATSensor(jFault_CoilSAT).CoilName, SteamCoils::SteamCoil);
int CoilNum = UtilityRoutines::FindItemInList(FaultsCoilSATSensor(jFault_CoilSAT).CoilName, state.dataSteamCoils->SteamCoil);
if (CoilNum <= 0) {
ShowSevereError(cFaultCurrentObject + " = \"" + cAlphaArgs(1) + "\" invalid " + cAlphaFieldNames(5) + " = \"" +
cAlphaArgs(5) + "\" not found.");
ErrorsFound = true;
} else {

if (SteamCoils::SteamCoil(CoilNum).TypeOfCoil != SteamCoils::TemperatureSetPointControl) {
if (state.dataSteamCoils->SteamCoil(CoilNum).TypeOfCoil != state.dataSteamCoils->TemperatureSetPointControl) {
// The fault model is only applicable to the coils controlled on leaving air temperature
ShowWarningError(cFaultCurrentObject + " = \"" + cAlphaArgs(1) + "\" invalid " + cAlphaFieldNames(5) + " = \"" +
cAlphaArgs(5) +
"\". The specified coil is not controlled on leaving air temperature. The coil SAT sensor fault model "
"will not be applied.");
} else {
// Link the fault model with the coil that is controlled on leaving air temperature
SteamCoils::SteamCoil(CoilNum).FaultyCoilSATFlag = true;
SteamCoils::SteamCoil(CoilNum).FaultyCoilSATIndex = jFault_CoilSAT;
state.dataSteamCoils->SteamCoil(CoilNum).FaultyCoilSATFlag = true;
state.dataSteamCoils->SteamCoil(CoilNum).FaultyCoilSATIndex = jFault_CoilSAT;
}
}

Expand Down
8 changes: 5 additions & 3 deletions src/EnergyPlus/OutputReportTabular.cc
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ namespace OutputReportTabular {
} // namespace

// Functions
void clear_state()
void clear_state(EnergyPlusData &state)
{
GatherMonthlyResultsForTimestepRunOnce = true;
UpdateTabularReportsGetInput = true;
Expand Down Expand Up @@ -723,7 +723,7 @@ namespace OutputReportTabular {
TOCEntries.deallocate();
UnitConv.deallocate();

OutputReportTabular::ResetTabularReports();
OutputReportTabular::ResetTabularReports(state);

numPeopleAdaptive = 0;
}
Expand Down Expand Up @@ -15327,7 +15327,7 @@ namespace OutputReportTabular {
//======================================================================================================================
//======================================================================================================================

void ResetTabularReports()
void ResetTabularReports(EnergyPlusData &state)
{
// Jason Glazer - October 2015
// Reset all gathering arrays to zero for multi-year simulations
Expand All @@ -15343,6 +15343,8 @@ namespace OutputReportTabular {
ResetPeakDemandGathering();
ResetHeatGainGathering();
ResetRemainingPredefinedEntries();
ThermalComfort::ResetThermalComfortSimpleASH55(state);
ThermalComfort::ResetSetPointMet(state);
ResetAdaptiveComfort();
isFinalYear = true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/EnergyPlus/OutputReportTabular.hh
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ namespace OutputReportTabular {
extern Array1D<UnitConvType> UnitConv;

// Functions
void clear_state();
void clear_state(EnergyPlusData &state);

std::ofstream & open_tbl_stream(int const iStyle, std::string const & filename, bool output_to_file = true);

Expand Down Expand Up @@ -961,7 +961,7 @@ namespace OutputReportTabular {
//======================================================================================================================
//======================================================================================================================

void ResetTabularReports();
void ResetTabularReports(EnergyPlusData &state);

void ResetMonthlyGathering();

Expand Down
3 changes: 1 addition & 2 deletions src/EnergyPlus/PackagedTerminalHeatPump.cc
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,6 @@ namespace PackagedTerminalHeatPump {
using SteamCoils::GetSteamCoilIndex;
auto &GetCoilMaxSteamFlowRate(SteamCoils::GetCoilMaxSteamFlowRate);
using SteamCoils::GetTypeOfCoil;
using SteamCoils::ZoneLoadControl;
using WaterCoils::GetCoilMaxWaterFlowRate;
using WaterCoils::GetCoilWaterInletNode;
auto &GetWaterCoilInletNode(WaterCoils::GetCoilInletNode);
Expand Down Expand Up @@ -1848,7 +1847,7 @@ namespace PackagedTerminalHeatPump {
ShowContinueError("...occurs in " + PTUnit(PTUnitNum).UnitType + " \"" + PTUnit(PTUnitNum).Name + "\"");
ErrorsFound = true;
}
if (GetTypeOfCoil(state, PTUnit(PTUnitNum).ACHeatCoilIndex, ACHeatCoilName, errFlag) != ZoneLoadControl) {
if (GetTypeOfCoil(state, PTUnit(PTUnitNum).ACHeatCoilIndex, ACHeatCoilName, errFlag) != state.dataSteamCoils->ZoneLoadControl) {
if (errFlag) {
ShowContinueError("...occurs in " + PTUnit(PTUnitNum).UnitType + " \"" + PTUnit(PTUnitNum).Name + "\"");
ErrorsFound = true;
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/SimulationManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ namespace SimulationManager {
// for simulations that last longer than a week, identify when the last year of the simulation is started
if ((DayOfSim > 365) && ((NumOfDayInEnvrn - DayOfSim) == 364) && !WarmupFlag) {
DisplayString("Starting last year of environment at: " + state.dataGlobal->DayOfSimChr);
ResetTabularReports();
ResetTabularReports(state);
}

for (HourOfDay = 1; HourOfDay <= 24; ++HourOfDay) { // Begin hour loop ...
Expand Down
4 changes: 1 addition & 3 deletions src/EnergyPlus/StateManagement.cc
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@
#include <EnergyPlus/SolarCollectors.hh>
#include <EnergyPlus/SolarShading.hh>
#include <EnergyPlus/SplitterComponent.hh>
#include <EnergyPlus/SteamCoils.hh>
#include <EnergyPlus/SurfaceGeometry.hh>

void EnergyPlus::clearAllStates(EnergyPlusData &state)
Expand Down Expand Up @@ -333,7 +332,7 @@ void EnergyPlus::clearAllStates(EnergyPlusData &state)
OutdoorAirUnit::clear_state();
OutputProcessor::clear_state();
OutputReportPredefined::clear_state();
OutputReportTabular::clear_state();
OutputReportTabular::clear_state(state);
OutputReportTabularAnnual::clear_state();
OutsideEnergySources::clear_state();
PackagedTerminalHeatPump::clear_state();
Expand Down Expand Up @@ -378,7 +377,6 @@ void EnergyPlus::clearAllStates(EnergyPlusData &state)
SolarCollectors::clear_state();
SolarShading::clear_state();
SplitterComponent::clear_state();
SteamCoils::clear_state();
SurfaceGeometry::clear_state();
UtilityRoutines::clear_state();
EIRPlantLoopHeatPumps::EIRPlantLoopHeatPump::clear_state();
Expand Down
Loading

1 comment on commit 828c430

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

global_SteamCoils (brianlball) - x86_64-MacOS-10.15-clang-11.0.0: OK (2984 of 2984 tests passed, 0 test warnings)

Build Badge Test Badge

Please sign in to comment.