From e57b5ac627c914c3dfe445b0aa86fcf5fb4dcfe3 Mon Sep 17 00:00:00 2001 From: Lerond Date: Tue, 8 Apr 2025 12:29:15 -0700 Subject: [PATCH 01/30] NFP. --- design/FY2025/parallel_piu_damper_leakage.md | 182 +++++++++++++++++++ idd/Energy+.idd.in | 8 +- src/EnergyPlus/DataHeatBalance.hh | 1 + src/EnergyPlus/DisplacementVentMgr.hh | 5 +- src/EnergyPlus/InternalHeatGains.cc | 33 ++-- src/EnergyPlus/PoweredInductionUnits.cc | 85 ++++++++- src/EnergyPlus/PoweredInductionUnits.hh | 9 +- 7 files changed, 302 insertions(+), 21 deletions(-) create mode 100644 design/FY2025/parallel_piu_damper_leakage.md diff --git a/design/FY2025/parallel_piu_damper_leakage.md b/design/FY2025/parallel_piu_damper_leakage.md new file mode 100644 index 00000000000..8d853e5098a --- /dev/null +++ b/design/FY2025/parallel_piu_damper_leakage.md @@ -0,0 +1,182 @@ +Air Leakage in Parallel Fan-Powered Terminal Units +================ + +**Jeremy Lerond, Pacific Northwest National Laboratory** + + - Original Date: 04/07/2025 + - Revision Date: 04/07/2025 + + +## Justification for New Feature ## + +- Parallel PIU can be perceived as more efficient than series PIU because they don't run as much +- Laboratory and in-situ study have shown that their performance can be impacted by backdraft damper air leakage +- EnergyPlus doesn’t have the capability to model parallel PIU damper leakage which could potentially provide misleading results when comparing designs with both types of air terminals + +## E-mail and Conference Call Conclusions ## + +N/A + +## Overview ## + +With a new input users will be able to simulate the impact of parallel PIU backdraft damper leakage. The simplified modeling approach will consider the two main impacts of air leakage through backdraft dampers: increase in primary air flow rate and sensible heat loss to the plenum. + +## Approach ## + +Assumptions: +- Leakage only occurs when the terminal fan is off +- The damper leakage fracation is expressed as follows: `f_leak = m_dot_leakage / m_dot_primary` +- To meet zone loads, leakage results in an increase in primary air flow rate +- Leakage induces a sensible heat loss of primary air to the plenum or secondary thermal zone from which air is drew from when the fan is running + +## Testing/Validation/Data Sources ## + +- Simulation using /sample files will be run and results will be compared against (Sardoueinasab et al., 2018) +- Unit tests will be added to verify that EnergyPlus takes leakage into account when requested by a user + +## Input Output Reference Documentation ## + +The following descriptions will be added to the Input Output Reference manual: + +```latex +\paragraph{Field: Backdraft Damper Leakage Curve Name}\label{field-backdraft_damper_leakage_fraction_curve_name} + +This field is used to indicate how the backdraft damper leakage fraction changes with different primary air flow fractions. The leakage fraction is defined as the ratio of leakage mass flow rate to primary air mass flow rate at a constant supply static pressure setpoint. This curve should describe the leakage fraction as a function of primary air flow fraction (ratio of primary flow fraction to maximum nominal primary air flow rate). For a static pressure setpoint of 62 Pa (0.25 in w.c) a resonable low leakage assumption could be around 3\%, a medium leakage value could be around 5\%, and relatively high leakage could be up to 12\%. +``` + +## Input Description ## + +The following inputs will be added at the end of `AirTerminal:SingleDuct:ParallelPIU:Reheat`: + +``` + A13; \field Backdraft Damper Leakage Fraction Curve Name + \type object-list + \object-list UnivariateFunctions + \note Backdraft damper leakage fraction is the ratio of mass leakage flow rate to primary air flow rate + \note at a constant static pressure setpoint. This curve should describe the ratio as a function primary + \note air flow fraction (ratio of primary flow fraction to maximum nominal primary air flow rate). +``` + +## Outputs Description ## + +Two new outputs will be added: +``` +Output:Variable,*,Zone Air Terminal Backdraft Damper Leakage Mass Flow Rate,hourly; !- HVAC Average [kg/s] +Output:Variable,*,Zone Air Terminal Backdraft Damper Heat Loss,hourly; !- HVAC Sum [J] +``` + +## Engineering Reference ## + +A new section will be added under the "Zone Equipment and Zone Forced Air Units" to document how leakage for parallel fan-powered terminal is simulated in EnergyPlus. + +```latex +\subsection{Air Leakage in Parallel Fan-Powered Terminal Units}\label{parallel_piu_leakage} +As described in (O'Neal et al., 2016) and (Sardoueinasab et al., 2018), backdraft damper leakage in parallel fan-powered terminal units can be characterized using a leakage fraction at a constant static pressure setpoint: + +\begin{equation} +{f_{leakage}} = {\dot m_{leakage}} - {\dot m_{primary}} +\end{equation} + +Leakage is only simulated when the terminal fan is off. The impact of the simulated leakage is twofold: +\begin{enumerate} + \item To make up for the leaked air, the primary air flow rate should be increased to meet the zone load + \item The leaked air impact is accounted for by adding a sensible load to the plenum or the secondary thermal zone from which the terminal draws air from when its fan is running +\end{enumerate} + +The new primary flow rate is calculated as follows: +\begin{equation} +{\dot m_{primary, new}} = (1 + {f_{leakage}}) \times {\dot m_{primary}} +\end{equation} + +The convective load is calculated as follows: +\begin{equation} +Q_{plenum} = {\dot m_{leakage}} \times C_p \times (T_{plenum} - T_{supply}) +\end{equation} + +\subsubsection{References}\label{references_parallel_piu_leakage} +D.L. O'Neal, J.L. Edmondson, Characterizing air leakage in parallel fan-powered terminal units, ASHRAE Trans., 122 (1) (2016), pp. 343-353 + +Zahra Sardoueinasab, Peng Yin, Dennis O'Neal, Energy modeling and analysis of inherent air leakage from parallel fan-powered terminal units using EMS in EnergyPlus, (2018), Energy and Buildings, https://doi.org/10.1016/j.enbuild.2018.07.019 +``` + +## Example File and Transition Changes ## + +- No transition rules are required +- A new example file will be added to showcase this new feature The new file will include example curves to model leakage based on data included in (O'neal et al., 2016): + +``` +Curve:Linear, + low_0p25_in_wc, !- Name + -.006083039, !- Coefficient1 Constant + 0.036612602, !- Coefficient2 x + 0.63, !- Minimum Value of x + 1, !- Maximum Value of x + , !- Minimum Curve Output + , !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + +Curve:Linear, + medium_0p25_in_wc, !- Name + 0.039928941, !- Coefficient1 Constant + 0.009555789, !- Coefficient2 x + 0.63, !- Minimum Value of x + 1, !- Maximum Value of x + , !- Minimum Curve Output + , !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + +Curve:Linear, + high_0p25_in_wc, !- Name + 0.117130811, !- Coefficient1 Constant + -.001792284, !- Coefficient2 x + 0.63, !- Minimum Value of x + 1, !- Maximum Value of x + , !- Minimum Curve Output + , !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + +Curve:Linear, + low_0p50_in_wc, !- Name + -.023960304, !- Coefficient1 Constant + 0.078345929, !- Coefficient2 x + 0.51, !- Minimum Value of x + 1, !- Maximum Value of x + , !- Minimum Curve Output + , !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + +Curve:Linear, + medium_0p50_in_wc, !- Name + 0.027345369, !- Coefficient1 Constant + 0.04614075, !- Coefficient2 x + 0.5, !- Minimum Value of x + 1, !- Maximum Value of x + , !- Minimum Curve Output + , !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + +Curve:Linear, + high_0p50_in_wc, !- Name + 0.094531603, !- Coefficient1 Constant + 0.07094517, !- Coefficient2 x + 0.5, !- Minimum Value of x + 1, !- Maximum Value of x + , !- Minimum Curve Output + , !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type +``` + +## References ## + +- Energy modeling and analysis of inherent air leakage from parallel fan-powered terminal units using EMS in EnergyPlus, Zahra Sardoueinasab, Peng Yin, Dennis O'Neal, (2018), Energy and Buildings, https://doi.org/10.1016/j.enbuild.2018.07.019 +- Characterizing air leakage in parallel fan-powered terminal units, D.L. O'Neal, J.L. Edmondson, ASHRAE Trans., 122 (1) (2016), pp. 343-353 + +## Implemention Notes ## + +The leakage flow rate and losses calculation will be performed in a new function named `CalcBackdraftDamperLeakage` which will be called by `CalcParallelPIU` when the terminal is active, but the fan is off. The losses will be integrated into the heat balance through `SetupZoneInternalGain`. \ No newline at end of file diff --git a/idd/Energy+.idd.in b/idd/Energy+.idd.in index 3c923bf076c..87a666e55fb 100644 --- a/idd/Energy+.idd.in +++ b/idd/Energy+.idd.in @@ -48820,12 +48820,18 @@ AirTerminal:SingleDuct:ParallelPIU:Reheat, \default 32.1 \note Only used if Heating Control Type is Modulated \note Used to control second stage heating, typically zone heat setpoint plus 20F - N10; \field High Limit Heating Discharge Air Temperature + N10, \field High Limit Heating Discharge Air Temperature \type real \units C \default 37.7 \note Only used if Heating Control Type is Modulated \note Used to determine end of third stage heating + A13; \field Backdraft Damper Leakage Fraction Curve Name + \type object-list + \object-list UnivariateFunctions + \note Backdraft damper leakage fraction is the ratio of mass leakage flow rate to primary air flow rate + \note at a constant static pressure setpoint. This curve should describe the ratio as a function primary + \note air flow fraction (ratio of primary flow fraction to maximum nominal primary air flow rate). AirTerminal:SingleDuct:ConstantVolume:FourPipeInduction, \memo Central air system terminal unit, single duct, variable volume, induction unit with diff --git a/src/EnergyPlus/DataHeatBalance.hh b/src/EnergyPlus/DataHeatBalance.hh index 76da1eec1a5..877ef189deb 100644 --- a/src/EnergyPlus/DataHeatBalance.hh +++ b/src/EnergyPlus/DataHeatBalance.hh @@ -283,6 +283,7 @@ namespace DataHeatBalance { ElectricLoadCenterConverter, FanSystemModel, IndoorGreen, + ParallelPIUDamperLeakage, Num }; diff --git a/src/EnergyPlus/DisplacementVentMgr.hh b/src/EnergyPlus/DisplacementVentMgr.hh index 1f46b8df6c2..276d026e6a7 100644 --- a/src/EnergyPlus/DisplacementVentMgr.hh +++ b/src/EnergyPlus/DisplacementVentMgr.hh @@ -78,7 +78,7 @@ namespace RoomAir { void CalcDispVent3Node(EnergyPlusData &state, int ZoneNum); // Which Zonenum - static constexpr std::array IntGainTypesOccupied = { + static constexpr std::array IntGainTypesOccupied = { DataHeatBalance::IntGainType::People, DataHeatBalance::IntGainType::WaterHeaterMixed, DataHeatBalance::IntGainType::WaterHeaterStratified, @@ -129,7 +129,8 @@ namespace RoomAir { DataHeatBalance::IntGainType::SecCoolingDXCoilMultiSpeed, DataHeatBalance::IntGainType::SecHeatingDXCoilMultiSpeed, DataHeatBalance::IntGainType::ElectricLoadCenterConverter, - DataHeatBalance::IntGainType::FanSystemModel}; + DataHeatBalance::IntGainType::FanSystemModel, + DataHeatBalance::IntGainType::ParallelPIUDamperLeakage}; static constexpr std::array IntGainTypesMixedSubzone = {DataHeatBalance::IntGainType::DaylightingDeviceTubular, DataHeatBalance::IntGainType::Lights}; diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index ccc90568497..5ace5e927b6 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -150,7 +150,7 @@ namespace InternalHeatGains { static constexpr std::array IntGainTypesWaterUse = {DataHeatBalance::IntGainType::WaterUseEquipment, DataHeatBalance::IntGainType::WaterHeaterMixed, DataHeatBalance::IntGainType::WaterHeaterStratified}; - static constexpr std::array IntGainTypesHvacLoss = { + static constexpr std::array IntGainTypesHvacLoss = { DataHeatBalance::IntGainType::ZoneBaseboardOutdoorTemperatureControlled, DataHeatBalance::IntGainType::ThermalStorageChilledWaterMixed, DataHeatBalance::IntGainType::ThermalStorageChilledWaterStratified, @@ -170,7 +170,8 @@ namespace InternalHeatGains { DataHeatBalance::IntGainType::SecHeatingDXCoilSingleSpeed, DataHeatBalance::IntGainType::SecCoolingDXCoilTwoSpeed, DataHeatBalance::IntGainType::SecCoolingDXCoilMultiSpeed, - DataHeatBalance::IntGainType::SecHeatingDXCoilMultiSpeed}; + DataHeatBalance::IntGainType::SecHeatingDXCoilMultiSpeed, + DataHeatBalance::IntGainType::ParallelPIUDamperLeakage}; static constexpr std::array IntGainTypesPowerGen = { DataHeatBalance::IntGainType::GeneratorFuelCell, DataHeatBalance::IntGainType::GeneratorMicroCHP, @@ -850,7 +851,7 @@ namespace InternalHeatGains { default: { } break; // nothing to do for the other cases - } // switch (thisPeople.clothingType) + } // switch (thisPeople.clothingType) } if (IHGAlphaFieldBlanks(13)) { @@ -1620,8 +1621,8 @@ namespace InternalHeatGains { &thisZoneElectric.LatGainRate); } } // for elecEqInputNum.NumOfSpaces - } // for elecEqInputNum - } // TotElecEquip > 0 + } // for elecEqInputNum + } // TotElecEquip > 0 // GasEquipment EPVector zoneGasObjects; @@ -1850,8 +1851,8 @@ namespace InternalHeatGains { &thisZoneGas.CO2GainRate); } // for gasEqInputNum.NumOfSpaces - } // for gasEqInputNum - } // TotGasEquip > 0 + } // for gasEqInputNum + } // TotGasEquip > 0 // HotWaterEquipment EPVector hotWaterEqObjects; @@ -2053,8 +2054,8 @@ namespace InternalHeatGains { &thisZoneHWEq.LatGainRate); } // for hwEqInputNum.NumOfSpaces - } // for hwEqInputNum - } // TotHWEquip > 0 + } // for hwEqInputNum + } // TotHWEquip > 0 // SteamEquipment EPVector steamEqObjects; @@ -2258,8 +2259,8 @@ namespace InternalHeatGains { &thisZoneStmEq.LatGainRate); } // for stmEqInputNum.NumOfSpaces - } // for stmEqInputNum - } // TotStmEquip > 0 + } // for stmEqInputNum + } // TotStmEquip > 0 // OtherEquipment EPVector otherEqObjects; @@ -2524,8 +2525,8 @@ namespace InternalHeatGains { &thisZoneOthEq.LatGainRate); } // for othEqInputNum.NumOfSpaces - } // for othEqInputNum - } // TotOtherEquip > 0 + } // for othEqInputNum + } // TotOtherEquip > 0 // ElectricEquipment:ITE:AirCooled EPVector iTEqObjects; @@ -2920,7 +2921,7 @@ namespace InternalHeatGains { &thisZoneITEq.PowerRpt[(int)PERptVars::ConGainToZone]); } } // for itEqInputNum.NumOfSpaces - } // for itEqInputNum + } // for itEqInputNum for (int Loop = 1; Loop <= state.dataHeatBal->TotITEquip; ++Loop) { if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).HasAdjustedReturnTempByITE && (!state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps)) { @@ -3047,8 +3048,8 @@ namespace InternalHeatGains { nullptr, &thisZoneBBHeat.RadGainRate); } // for bbHeatInputNum.NumOfSpaces - } // for bbHeatInputNum - } // TotBBHeat > 0 + } // for bbHeatInputNum + } // TotBBHeat > 0 state.dataHeatBal->TotCO2Gen = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, contamSSModuleObject); state.dataHeatBal->ZoneCO2Gen.allocate(state.dataHeatBal->TotCO2Gen); diff --git a/src/EnergyPlus/PoweredInductionUnits.cc b/src/EnergyPlus/PoweredInductionUnits.cc index 854628a6a62..df1383c5d5d 100644 --- a/src/EnergyPlus/PoweredInductionUnits.cc +++ b/src/EnergyPlus/PoweredInductionUnits.cc @@ -55,10 +55,12 @@ // EnergyPlus Headers #include #include +#include #include #include #include #include +#include #include #include #include @@ -70,6 +72,7 @@ #include #include #include +#include #include #include #include @@ -85,6 +88,7 @@ #include #include #include +#include namespace EnergyPlus::PoweredInductionUnits { @@ -261,7 +265,7 @@ void GetPIUs(EnergyPlusData &state) int PIUNum = 0; auto &ip = state.dataInputProcessing->inputProcessor; - // loop over Series PIUs; get and load the input data + // loop over Series and Parallel PIUs; get and load the input data for (const std::string cCurrentModuleObject : {"AirTerminal:SingleDuct:SeriesPIU:Reheat", "AirTerminal:SingleDuct:ParallelPIU:Reheat"}) { auto const &objectSchemaProps = ip->getObjectSchemaProps(state, cCurrentModuleObject); auto const &PIUsInstances = ip->epJSON.find(cCurrentModuleObject); @@ -542,6 +546,48 @@ void GetPIUs(EnergyPlusData &state) ErrorsFound = true; } } + + // Get damper leakage inputs + if (cCurrentModuleObject == "AirTerminal:SingleDuct:ParallelPIU:Reheat") { + thisPIU.leakFracCurve = Curve::GetCurveIndex( + state, ip->getAlphaFieldValue(fields, objectSchemaProps, "backdraft_damper_leakage_fraction_curve_name")); + + if (thisPIU.leakFracCurve > 0) { + // Find the secondary zone or plenum index + // The secondary air inlet node should either be a zone exhaust air node... + for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { + for (int exhaustNum = 1; exhaustNum <= state.dataZoneEquip->ZoneEquipConfig(zoneNum).NumExhaustNodes; ++exhaustNum) { + if (thisPIU.SecAirInNode == state.dataZoneEquip->ZoneEquipConfig(zoneNum).ExhaustNode(exhaustNum)) { + thisPIU.secZoneNum = zoneNum; + break; + } + } + } + // ... or an induced air node of a return plenum + for (int zoneNum = 1; zoneNum <= state.dataZonePlenum->NumZoneSupplyPlenums; ++zoneNum) { + for (int nodeNum = 1; nodeNum <= state.dataZonePlenum->ZoneRetPlenCond(zoneNum).NumInducedNodes; ++nodeNum) { + if (thisPIU.SecAirInNode == state.dataZonePlenum->ZoneRetPlenCond(zoneNum).InducedNode(nodeNum)) { + thisPIU.secZoneNum = zoneNum; + break; + } + } + } + if (thisPIU.secZoneNum == 0) { + ShowWarningError(state, + format("The zone corresponding to the secondary air inlet could not be found for {} Unit = {}, no " + "leakage will be simulated", + cCurrentModuleObject, + thisPIU.Name)); + thisPIU.leakFracCurve = 0; + } + + SetupZoneInternalGain(state, + thisPIU.CtrlZoneNum, // Need to use the secondary zone/plenum zone num + thisPIU.Name, + DataHeatBalance::IntGainType::ParallelPIUDamperLeakage, + &thisPIU.leakLoss); + } + } } } } @@ -631,6 +677,20 @@ void GetPIUs(EnergyPlusData &state) OutputProcessor::TimeStepType::System, OutputProcessor::StoreType::Average, state.dataPowerInductionUnits->PIU(PIURpt).Name); + SetupOutputVariable(state, + "Zone Air Terminal Backdraft Damper Leakage Mass Flow Rate", + Constant::Units::kg_s, + thisPIU.leakFlow, + OutputProcessor::TimeStepType::System, + OutputProcessor::StoreType::Average, + state.dataPowerInductionUnits->PIU(PIURpt).Name); + SetupOutputVariable(state, + "Zone Air Terminal Backdraft Damper Heat Loss", + Constant::Units::J, + thisPIU.leakLoss, + OutputProcessor::TimeStepType::System, + OutputProcessor::StoreType::Sum, + state.dataPowerInductionUnits->PIU(PIURpt).Name); } } @@ -1751,6 +1811,8 @@ void CalcParallelPIU(EnergyPlusData &state, // initialize local variables auto &thisPIU = state.dataPowerInductionUnits->PIU(PIUNum); + thisPIU.leakFlow = 0.0; + thisPIU.leakLoss = 0.0; Real64 const PriAirMassFlowMax = state.dataLoopNodes->Node(thisPIU.PriAirInNode).MassFlowRateMaxAvail; // max primary air mass flow rate [kg/s] Real64 const PriAirMassFlowMin = state.dataLoopNodes->Node(thisPIU.PriAirInNode).MassFlowRateMinAvail; // min primary air mass flow rate [kg/s] thisPIU.PriAirMassFlow = state.dataLoopNodes->Node(thisPIU.PriAirInNode).MassFlowRate; // primary air mass flow rate [kg/s] @@ -1832,6 +1894,7 @@ void CalcParallelPIU(EnergyPlusData &state, thisPIU.SecAirMassFlow = 0.0; state.dataHVACGlobal->TurnFansOn = false; thisPIU.heatingOperatingMode = HeatOpModeType::HeaterOff; + CalcBackdraftDamperLeakage(state, PIUNum); } } else if (QZnReq > SmallLoad) { // heating @@ -1869,6 +1932,7 @@ void CalcParallelPIU(EnergyPlusData &state, if ((thisPIU.PriAirMassFlow > thisPIU.FanOnAirMassFlow) && !ReheatRequired) { thisPIU.SecAirMassFlow = 0.0; // Fan is off unless reheat is required; no secondary air; also reset fan flag state.dataHVACGlobal->TurnFansOn = false; + CalcBackdraftDamperLeakage(state, PIUNum); } else { // fan is on; recalc primary air flow thisPIU.PriAirMassFlow = @@ -2456,6 +2520,25 @@ Real64 CalcVariableSpeedPIUCoolingResidual(EnergyPlusData &state, Real64 const c return Residuum; } +void CalcBackdraftDamperLeakage(EnergyPlusData &state, int piuNum) +{ + auto &thisPIU = state.dataPowerInductionUnits->PIU(piuNum); + Real64 const CpAirZn = PsyCpAirFnW(state.dataLoopNodes->Node(thisPIU.PriAirInNode).HumRat); + thisPIU.leakFrac = 0.0; + thisPIU.leakFlow = 0.0; + if (thisPIU.leakFracCurve > 0) { + Real64 airflowFrac = thisPIU.PriAirMassFlow / thisPIU.MaxPriAirMassFlow; + thisPIU.leakFrac = Curve::CurveValue(state, thisPIU.leakFracCurve, airflowFrac); + } + Real64 priAirEnthalpy = + Psychrometrics::PsyHFnTdbW(state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp, state.dataLoopNodes->Node(thisPIU.PriAirInNode).HumRat); + Real64 zoneEnthalpy = + Psychrometrics::PsyHFnTdbW(state.dataLoopNodes->Node(thisPIU.SecAirInNode).Temp, state.dataLoopNodes->Node(thisPIU.PriAirInNode).HumRat); + thisPIU.leakFlow = thisPIU.leakFrac * thisPIU.PriAirMassFlow; + thisPIU.leakLoss = thisPIU.leakFlow * (priAirEnthalpy - zoneEnthalpy); // sensible only + thisPIU.PriAirMassFlow *= (1 + thisPIU.leakFrac); +} + void ReportPIU(EnergyPlusData &state, int const PIUNum) // number of the current fan coil unit being simulated { diff --git a/src/EnergyPlus/PoweredInductionUnits.hh b/src/EnergyPlus/PoweredInductionUnits.hh index e55ca16e944..7e660e80502 100644 --- a/src/EnergyPlus/PoweredInductionUnits.hh +++ b/src/EnergyPlus/PoweredInductionUnits.hh @@ -202,6 +202,11 @@ namespace PoweredInductionUnits { Real64 DischargeAirTemp = 0.0; // current operating discharge air temperature at outlet, for reporting HeatOpModeType heatingOperatingMode = HeatOpModeType::HeaterOff; CoolOpModeType coolingOperatingMode = CoolOpModeType::CoolerOff; + Real64 leakFrac = 0.0; // parallel PIU backdraft damper leakage fraction + Real64 leakFlow = 0.0; // parallel PIU backdraft damper leakage mass flow rate + int leakFracCurve = 0.0; // parallel PIU backdraft damper leakage fraction curve + Real64 leakLoss = 0.0; // parallel PIU backdraft damper loss + int secZoneNum = 0; // index to secondary zone int CurOperationControlStage = -1; // integer reference for what stage of control the unit is in int plenumIndex = 0; @@ -215,7 +220,7 @@ namespace PoweredInductionUnits { MaxHotWaterFlow(0.0), MaxHotSteamFlow(0.0), MinVolHotWaterFlow(0.0), MinHotSteamFlow(0.0), MinVolHotSteamFlow(0.0), MinHotWaterFlow(0.0), HotControlNode(0), HotCoilOutNodeNum(0), HotControlOffset(0.0), HWplantLoc{}, ADUNum(0), InducesPlenumAir(false), HeatingRate(0.0), HeatingEnergy(0.0), SensCoolRate(0.0), SensCoolEnergy(0.0), CtrlZoneNum(0), ctrlZoneInNodeIndex(0), AirLoopNum(0), - OutdoorAirFlowRate(0.0) + OutdoorAirFlowRate(0.0), leakFrac(0.0), leakFlow(0.0), leakFracCurve(0), secZoneNum(0) { } @@ -292,6 +297,8 @@ namespace PoweredInductionUnits { Real64 CalcVariableSpeedPIUCoolingResidual( EnergyPlusData &state, Real64 const coolSignal, int const piuNum, Real64 const targetQznReq, int const zoneNodeNum); + void CalcBackdraftDamperLeakage(EnergyPlusData &state, int const piuNum); + void CalcVariableSpeedPIUCoolingBehavior(EnergyPlusData &state, int const PIUNum, int const zoneNode, From 94cab85cf1e4944299e345b4506c53a2179ac167 Mon Sep 17 00:00:00 2001 From: Lerond Date: Tue, 8 Apr 2025 14:17:08 -0700 Subject: [PATCH 02/30] Missing ref. --- src/EnergyPlus/UFADManager.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/UFADManager.cc b/src/EnergyPlus/UFADManager.cc index 5dd0deabd9e..f9fe9a1fcd9 100644 --- a/src/EnergyPlus/UFADManager.cc +++ b/src/EnergyPlus/UFADManager.cc @@ -673,7 +673,7 @@ namespace RoomAir { } // END FLOOR } - static constexpr std::array IntGainTypesOccupied = { + static constexpr std::array IntGainTypesOccupied = { DataHeatBalance::IntGainType::People, DataHeatBalance::IntGainType::WaterHeaterMixed, DataHeatBalance::IntGainType::WaterHeaterStratified, @@ -724,7 +724,8 @@ namespace RoomAir { DataHeatBalance::IntGainType::SecCoolingDXCoilMultiSpeed, DataHeatBalance::IntGainType::SecHeatingDXCoilMultiSpeed, DataHeatBalance::IntGainType::ElectricLoadCenterConverter, - DataHeatBalance::IntGainType::FanSystemModel}; + DataHeatBalance::IntGainType::FanSystemModel, + DataHeatBalance::IntGainType::ParallelPIUDamperLeakage}; static constexpr std::array IntGainTypesUpSubzone = {DataHeatBalance::IntGainType::DaylightingDeviceTubular, DataHeatBalance::IntGainType::Lights}; From 67c0a26c4af41588e3c1bea4eac097ff237f3335 Mon Sep 17 00:00:00 2001 From: Lerond Date: Wed, 16 Apr 2025 23:28:41 -0700 Subject: [PATCH 03/30] Remove unintended clang change. --- src/EnergyPlus/InternalHeatGains.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index 5ace5e927b6..f1780f876c1 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -851,7 +851,7 @@ namespace InternalHeatGains { default: { } break; // nothing to do for the other cases - } // switch (thisPeople.clothingType) + } // switch (thisPeople.clothingType) } if (IHGAlphaFieldBlanks(13)) { From cbe2e4ceff21595d73b510ac826f0fd678eb1307 Mon Sep 17 00:00:00 2001 From: Lerond Date: Thu, 17 Apr 2025 08:22:54 -0700 Subject: [PATCH 04/30] Remove unintended clang change. Again. --- src/EnergyPlus/InternalHeatGains.cc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index f1780f876c1..6e94e48c934 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -1621,8 +1621,8 @@ namespace InternalHeatGains { &thisZoneElectric.LatGainRate); } } // for elecEqInputNum.NumOfSpaces - } // for elecEqInputNum - } // TotElecEquip > 0 + } // for elecEqInputNum + } // TotElecEquip > 0 // GasEquipment EPVector zoneGasObjects; @@ -2054,8 +2054,8 @@ namespace InternalHeatGains { &thisZoneHWEq.LatGainRate); } // for hwEqInputNum.NumOfSpaces - } // for hwEqInputNum - } // TotHWEquip > 0 + } // for gasEqInputNum + } // TotGasEquip > 0 // SteamEquipment EPVector steamEqObjects; @@ -2259,8 +2259,8 @@ namespace InternalHeatGains { &thisZoneStmEq.LatGainRate); } // for stmEqInputNum.NumOfSpaces - } // for stmEqInputNum - } // TotStmEquip > 0 + } // for stmEqInputNum + } // TotStmEquip > 0 // OtherEquipment EPVector otherEqObjects; @@ -2525,8 +2525,8 @@ namespace InternalHeatGains { &thisZoneOthEq.LatGainRate); } // for othEqInputNum.NumOfSpaces - } // for othEqInputNum - } // TotOtherEquip > 0 + } // for othEqInputNum + } // TotOtherEquip > 0 // ElectricEquipment:ITE:AirCooled EPVector iTEqObjects; @@ -2921,7 +2921,7 @@ namespace InternalHeatGains { &thisZoneITEq.PowerRpt[(int)PERptVars::ConGainToZone]); } } // for itEqInputNum.NumOfSpaces - } // for itEqInputNum + } // for itEqInputNum for (int Loop = 1; Loop <= state.dataHeatBal->TotITEquip; ++Loop) { if (state.dataHeatBal->Zone(state.dataHeatBal->ZoneITEq(Loop).ZonePtr).HasAdjustedReturnTempByITE && (!state.dataHeatBal->ZoneITEq(Loop).FlowControlWithApproachTemps)) { @@ -3048,8 +3048,8 @@ namespace InternalHeatGains { nullptr, &thisZoneBBHeat.RadGainRate); } // for bbHeatInputNum.NumOfSpaces - } // for bbHeatInputNum - } // TotBBHeat > 0 + } // for bbHeatInputNum + } // TotBBHeat > 0 state.dataHeatBal->TotCO2Gen = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, contamSSModuleObject); state.dataHeatBal->ZoneCO2Gen.allocate(state.dataHeatBal->TotCO2Gen); From fac3b624b241174b0b32ad7a50783b14c4e8b8b1 Mon Sep 17 00:00:00 2001 From: Lerond Date: Thu, 17 Apr 2025 08:30:47 -0700 Subject: [PATCH 05/30] Switching to a separate install of Clang (10) instead of using VS's version. --- src/EnergyPlus/InternalHeatGains.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index 6e94e48c934..52d6f488f06 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -1851,8 +1851,8 @@ namespace InternalHeatGains { &thisZoneGas.CO2GainRate); } // for gasEqInputNum.NumOfSpaces - } // for gasEqInputNum - } // TotGasEquip > 0 + } // for gasEqInputNum + } // TotGasEquip > 0 // HotWaterEquipment EPVector hotWaterEqObjects; From 5b5a75db30a5dc4f60bd4cc704b294524bb438b8 Mon Sep 17 00:00:00 2001 From: Lerond Date: Fri, 25 Apr 2025 21:55:16 -0700 Subject: [PATCH 06/30] Revise thermal leakage approach. --- src/EnergyPlus/DataAirLoop.hh | 24 ++++----- src/EnergyPlus/DataDefineEquip.hh | 53 ++++++++++--------- src/EnergyPlus/PoweredInductionUnits.cc | 40 +++++++------- src/EnergyPlus/PoweredInductionUnits.hh | 12 ++--- src/EnergyPlus/ZoneAirLoopEquipmentManager.cc | 11 +++- src/EnergyPlus/ZoneEquipmentManager.cc | 6 +-- 6 files changed, 77 insertions(+), 69 deletions(-) diff --git a/src/EnergyPlus/DataAirLoop.hh b/src/EnergyPlus/DataAirLoop.hh index 67589467ce0..e578060f680 100644 --- a/src/EnergyPlus/DataAirLoop.hh +++ b/src/EnergyPlus/DataAirLoop.hh @@ -169,18 +169,18 @@ namespace DataAirLoop { Real64 MaxOutAir = 0.0; // current maximum available outside air mass flow rate [kg/s] Real64 OAMinFrac = 0.0; // minimum outside air flow fraction this time step Real64 Previous = 0.0; // Previous mass air flow rate for this loop [kg/s] - Real64 SupFlow = 0.0; // supply air flow rate (includes LeakFlow) [kg/s] - Real64 ZoneRetFlow = 0.0; // return air flow rate at all zone return air nodes (includes RecircFlow, excludes LeakFlow) [kg/s] - Real64 ZoneRetFlowRatio = 1.0; // ratio for adjusting zone return flows for excess zone exhaust - Real64 SysRetFlow = 0.0; // return air flow rate back to central return (excludes RecircFlow, includes LeakFlow) [kg/s] - Real64 RecircFlow = 0.0; // sum of zone plenum recirculated flows [kg/s] - Real64 LeakFlow = 0.0; // sum of air distribution leak flows to return plenum [kg/s] - Real64 ExcessZoneExhFlow = 0.0; // excess zone exhuast flows made up by reduced return flow in other zones on same airloop [kg/s] - Real64 FanPLR = 1.0; // Operating PLR of air loop fan - Real64 OAFrac = 0.0; // fraction of outside air to mixed air mass flow rate - Real64 OAFlow = 0.0; // oa flow rate this time step [kg/s] - bool FlowError = false; // error flag for flow error message - Real64 BypassMassFlow = 0.0; // air loop bypass mass flow NOT entering splitter but included in mixer or plenum + Real64 SupFlow = 0.0; // supply air flow rate (includes leakMassFlowRate) [kg/s] + Real64 ZoneRetFlow = 0.0; // return air flow rate at all zone return air nodes (includes RecircFlow, excludes leakMassFlowRate) [kg/s] + Real64 ZoneRetFlowRatio = 1.0; // ratio for adjusting zone return flows for excess zone exhaust + Real64 SysRetFlow = 0.0; // return air flow rate back to central return (excludes RecircFlow, includes leakMassFlowRate) [kg/s] + Real64 RecircFlow = 0.0; // sum of zone plenum recirculated flows [kg/s] + Real64 leakMassFlowRate = 0.0; // sum of air distribution leak flows to return plenum [kg/s] + Real64 ExcessZoneExhFlow = 0.0; // excess zone exhuast flows made up by reduced return flow in other zones on same airloop [kg/s] + Real64 FanPLR = 1.0; // Operating PLR of air loop fan + Real64 OAFrac = 0.0; // fraction of outside air to mixed air mass flow rate + Real64 OAFlow = 0.0; // oa flow rate this time step [kg/s] + bool FlowError = false; // error flag for flow error message + Real64 BypassMassFlow = 0.0; // air loop bypass mass flow NOT entering splitter but included in mixer or plenum }; enum class ControllerKind diff --git a/src/EnergyPlus/DataDefineEquip.hh b/src/EnergyPlus/DataDefineEquip.hh index 57bd26d5fa0..dc6fe17863c 100644 --- a/src/EnergyPlus/DataDefineEquip.hh +++ b/src/EnergyPlus/DataDefineEquip.hh @@ -102,32 +102,33 @@ namespace DataDefineEquip { std::shared_ptr airTerminalPtr = nullptr; Array1D_string EquipName; // name of subcomponent Array1D_int EquipIndex; - int AirTerminalSizingSpecIndex = 0; // index to DesignSpecification:AirTerminal:Sizing obect - int TermUnitSizingNum = 0; // index to TermUnitSizing and TermUnitFinalZoneSizing for this air distribution unit - Real64 UpStreamLeakFrac = 0.0; // upstream nominal leakage fraction - Real64 DownStreamLeakFrac = 0.0; // downstream constant leakage fraction - Real64 MassFlowRateUpStrLk = 0.0; // current air mass flow rate of the upstream leak [kg/s] - Real64 MassFlowRateDnStrLk = 0.0; // current air mass flow rate of the downstream leak [kg/s] - Real64 MassFlowRateTU = 0.0; // current air mass flow rate through the terminal unit [kg/s] - Real64 MassFlowRateZSup = 0.0; // current air mass flow rate of zone supply air [kg/s] - Real64 MassFlowRateSup = 0.0; // current air mass flow rate of supply air upstream of upstream leak [kg/s] - Real64 MassFlowRatePlenInd = 0.0; // current air mass flow rate of induced air from plenum [kg/s] - Real64 MaxAvailDelta = 0.0; // change in max avail mass low rate due to leaks [kg/s] - Real64 MinAvailDelta = 0.0; // change in min avail mass low rate due to leaks [kg/s] - int InletNodeNum = 0; // index of inlet node 1 - int InletNodeNum2 = 0; // index of inlet node 2 (used for dual duct airterminals) - int ZoneEqNum = 0; // index of zone equipment object for this terminal unit - int AirLoopNum = 0; // index to airloop that this terminal unit is connected to - Real64 LeakLoadMult = 0.0; // zome load multiplier to adjust for downstream leak - bool UpStreamLeak = false; // if true, there is an upstream leak - bool DownStreamLeak = false; // if true, there is an downstream leak - int RetPlenumNum = 0; // return plenum number that this ADU can leak to, zero if none - int ZoneNum = 0; // index of the zone object for this terminal unit - bool AccountForDOAS = false; // if true user has asked for DOAS - Real64 HeatRate = 0.0; // [W] - Real64 CoolRate = 0.0; // [W] - Real64 HeatGain = 0.0; // [J] - Real64 CoolGain = 0.0; // [J] + int AirTerminalSizingSpecIndex = 0; // index to DesignSpecification:AirTerminal:Sizing obect + int TermUnitSizingNum = 0; // index to TermUnitSizing and TermUnitFinalZoneSizing for this air distribution unit + Real64 UpStreamLeakFrac = 0.0; // upstream nominal leakage fraction + Real64 DownStreamLeakFrac = 0.0; // downstream constant leakage fraction + Real64 piuTerminalLeakMassFlowRate = 0.0; // PIU terminal leakage mass flow rate [kg/s] + Real64 MassFlowRateUpStrLk = 0.0; // current air mass flow rate of the upstream leak [kg/s] + Real64 MassFlowRateDnStrLk = 0.0; // current air mass flow rate of the downstream leak [kg/s] + Real64 MassFlowRateTU = 0.0; // current air mass flow rate through the terminal unit [kg/s] + Real64 MassFlowRateZSup = 0.0; // current air mass flow rate of zone supply air [kg/s] + Real64 MassFlowRateSup = 0.0; // current air mass flow rate of supply air upstream of upstream leak [kg/s] + Real64 MassFlowRatePlenInd = 0.0; // current air mass flow rate of induced air from plenum [kg/s] + Real64 MaxAvailDelta = 0.0; // change in max avail mass low rate due to leaks [kg/s] + Real64 MinAvailDelta = 0.0; // change in min avail mass low rate due to leaks [kg/s] + int InletNodeNum = 0; // index of inlet node 1 + int InletNodeNum2 = 0; // index of inlet node 2 (used for dual duct airterminals) + int ZoneEqNum = 0; // index of zone equipment object for this terminal unit + int AirLoopNum = 0; // index to airloop that this terminal unit is connected to + Real64 LeakLoadMult = 0.0; // zome load multiplier to adjust for downstream leak + bool UpStreamLeak = false; // if true, there is an upstream leak + bool DownStreamLeak = false; // if true, there is an downstream leak + int RetPlenumNum = 0; // return plenum number that this ADU can leak to, zero if none + int ZoneNum = 0; // index of the zone object for this terminal unit + bool AccountForDOAS = false; // if true user has asked for DOAS + Real64 HeatRate = 0.0; // [W] + Real64 CoolRate = 0.0; // [W] + Real64 HeatGain = 0.0; // [J] + Real64 CoolGain = 0.0; // [J] bool EachOnceFlag = true; bool IsConstLeakageRate = false; // if true, constant leakage rate, if false proportional leakage rate will be calculated diff --git a/src/EnergyPlus/PoweredInductionUnits.cc b/src/EnergyPlus/PoweredInductionUnits.cc index df1383c5d5d..3024bf2fa0a 100644 --- a/src/EnergyPlus/PoweredInductionUnits.cc +++ b/src/EnergyPlus/PoweredInductionUnits.cc @@ -581,11 +581,11 @@ void GetPIUs(EnergyPlusData &state) thisPIU.leakFracCurve = 0; } - SetupZoneInternalGain(state, - thisPIU.CtrlZoneNum, // Need to use the secondary zone/plenum zone num - thisPIU.Name, - DataHeatBalance::IntGainType::ParallelPIUDamperLeakage, - &thisPIU.leakLoss); + // SetupZoneInternalGain(state, + // thisPIU.CtrlZoneNum, // Need to use the secondary zone/plenum zone num + // thisPIU.Name, + // DataHeatBalance::IntGainType::ParallelPIUDamperLeakage, + // &thisPIU.leakLoss); } } } @@ -680,7 +680,7 @@ void GetPIUs(EnergyPlusData &state) SetupOutputVariable(state, "Zone Air Terminal Backdraft Damper Leakage Mass Flow Rate", Constant::Units::kg_s, - thisPIU.leakFlow, + thisPIU.leakMassFlowRate, OutputProcessor::TimeStepType::System, OutputProcessor::StoreType::Average, state.dataPowerInductionUnits->PIU(PIURpt).Name); @@ -1811,7 +1811,7 @@ void CalcParallelPIU(EnergyPlusData &state, // initialize local variables auto &thisPIU = state.dataPowerInductionUnits->PIU(PIUNum); - thisPIU.leakFlow = 0.0; + thisPIU.leakMassFlowRate = 0.0; thisPIU.leakLoss = 0.0; Real64 const PriAirMassFlowMax = state.dataLoopNodes->Node(thisPIU.PriAirInNode).MassFlowRateMaxAvail; // max primary air mass flow rate [kg/s] Real64 const PriAirMassFlowMin = state.dataLoopNodes->Node(thisPIU.PriAirInNode).MassFlowRateMinAvail; // min primary air mass flow rate [kg/s] @@ -1927,7 +1927,6 @@ void CalcParallelPIU(EnergyPlusData &state, thisPIU.PriAirMassFlow = QZnReq / (CpAirZn * min(-SmallTempDiff, (state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp - state.dataLoopNodes->Node(ZoneNode).Temp))); - thisPIU.PriAirMassFlow = min(max(thisPIU.PriAirMassFlow, PriAirMassFlowMin), PriAirMassFlowMax); // check for fan on or off if ((thisPIU.PriAirMassFlow > thisPIU.FanOnAirMassFlow) && !ReheatRequired) { thisPIU.SecAirMassFlow = 0.0; // Fan is off unless reheat is required; no secondary air; also reset fan flag @@ -1940,9 +1939,9 @@ void CalcParallelPIU(EnergyPlusData &state, (state.dataLoopNodes->Node(thisPIU.SecAirInNode).Temp + FanDeltaTemp - state.dataLoopNodes->Node(ZoneNode).Temp)) / (CpAirZn * min(-SmallTempDiff, (state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp - state.dataLoopNodes->Node(ZoneNode).Temp))); - thisPIU.PriAirMassFlow = min(max(thisPIU.PriAirMassFlow, PriAirMassFlowMin), PriAirMassFlowMax); thisPIU.SecAirMassFlow = thisPIU.MaxSecAirMassFlow; } + thisPIU.PriAirMassFlow = min(max(thisPIU.PriAirMassFlow, PriAirMassFlowMin), PriAirMassFlowMax); if (QZnReq < 0) { if (thisPIU.fanControlType == FanCntrlType::VariableSpeedFan) { if (thisPIU.PriAirMassFlow == PriAirMassFlowMax) { @@ -2525,18 +2524,19 @@ void CalcBackdraftDamperLeakage(EnergyPlusData &state, int piuNum) auto &thisPIU = state.dataPowerInductionUnits->PIU(piuNum); Real64 const CpAirZn = PsyCpAirFnW(state.dataLoopNodes->Node(thisPIU.PriAirInNode).HumRat); thisPIU.leakFrac = 0.0; - thisPIU.leakFlow = 0.0; + thisPIU.leakMassFlowRate = 0.0; if (thisPIU.leakFracCurve > 0) { - Real64 airflowFrac = thisPIU.PriAirMassFlow / thisPIU.MaxPriAirMassFlow; - thisPIU.leakFrac = Curve::CurveValue(state, thisPIU.leakFracCurve, airflowFrac); - } - Real64 priAirEnthalpy = - Psychrometrics::PsyHFnTdbW(state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp, state.dataLoopNodes->Node(thisPIU.PriAirInNode).HumRat); - Real64 zoneEnthalpy = - Psychrometrics::PsyHFnTdbW(state.dataLoopNodes->Node(thisPIU.SecAirInNode).Temp, state.dataLoopNodes->Node(thisPIU.PriAirInNode).HumRat); - thisPIU.leakFlow = thisPIU.leakFrac * thisPIU.PriAirMassFlow; - thisPIU.leakLoss = thisPIU.leakFlow * (priAirEnthalpy - zoneEnthalpy); // sensible only - thisPIU.PriAirMassFlow *= (1 + thisPIU.leakFrac); + if (thisPIU.MaxPriAirMassFlow > 0) { + Real64 airflowFrac = thisPIU.PriAirMassFlow / thisPIU.MaxPriAirMassFlow; + thisPIU.leakFrac = Curve::CurveValue(state, thisPIU.leakFracCurve, airflowFrac); + Real64 priAirEnthalpy = Psychrometrics::PsyHFnTdbW(state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp, + state.dataLoopNodes->Node(thisPIU.PriAirInNode).HumRat); + Real64 zoneEnthalpy = Psychrometrics::PsyHFnTdbW(state.dataLoopNodes->Node(thisPIU.SecAirInNode).Temp, + state.dataLoopNodes->Node(thisPIU.PriAirInNode).HumRat); + thisPIU.leakMassFlowRate = thisPIU.leakFrac * thisPIU.PriAirMassFlow; + thisPIU.PriAirMassFlow *= (1 + thisPIU.leakFrac); + } + } } void ReportPIU(EnergyPlusData &state, int const PIUNum) // number of the current fan coil unit being simulated diff --git a/src/EnergyPlus/PoweredInductionUnits.hh b/src/EnergyPlus/PoweredInductionUnits.hh index 7e660e80502..d41f20fad12 100644 --- a/src/EnergyPlus/PoweredInductionUnits.hh +++ b/src/EnergyPlus/PoweredInductionUnits.hh @@ -202,11 +202,11 @@ namespace PoweredInductionUnits { Real64 DischargeAirTemp = 0.0; // current operating discharge air temperature at outlet, for reporting HeatOpModeType heatingOperatingMode = HeatOpModeType::HeaterOff; CoolOpModeType coolingOperatingMode = CoolOpModeType::CoolerOff; - Real64 leakFrac = 0.0; // parallel PIU backdraft damper leakage fraction - Real64 leakFlow = 0.0; // parallel PIU backdraft damper leakage mass flow rate - int leakFracCurve = 0.0; // parallel PIU backdraft damper leakage fraction curve - Real64 leakLoss = 0.0; // parallel PIU backdraft damper loss - int secZoneNum = 0; // index to secondary zone + Real64 leakFrac = 0.0; // parallel PIU backdraft damper leakage fraction + Real64 leakMassFlowRate = 0.0; // parallel PIU backdraft damper leakage mass flow rate + int leakFracCurve = 0.0; // parallel PIU backdraft damper leakage fraction curve + Real64 leakLoss = 0.0; // parallel PIU backdraft damper loss + int secZoneNum = 0; // index to secondary zone int CurOperationControlStage = -1; // integer reference for what stage of control the unit is in int plenumIndex = 0; @@ -220,7 +220,7 @@ namespace PoweredInductionUnits { MaxHotWaterFlow(0.0), MaxHotSteamFlow(0.0), MinVolHotWaterFlow(0.0), MinHotSteamFlow(0.0), MinVolHotSteamFlow(0.0), MinHotWaterFlow(0.0), HotControlNode(0), HotCoilOutNodeNum(0), HotControlOffset(0.0), HWplantLoc{}, ADUNum(0), InducesPlenumAir(false), HeatingRate(0.0), HeatingEnergy(0.0), SensCoolRate(0.0), SensCoolEnergy(0.0), CtrlZoneNum(0), ctrlZoneInNodeIndex(0), AirLoopNum(0), - OutdoorAirFlowRate(0.0), leakFrac(0.0), leakFlow(0.0), leakFracCurve(0), secZoneNum(0) + OutdoorAirFlowRate(0.0), leakFrac(0.0), leakMassFlowRate(0.0), leakFracCurve(0), secZoneNum(0) { } diff --git a/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc b/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc index 42be43d8e4c..b3f5cd07393 100644 --- a/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc +++ b/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc @@ -684,12 +684,17 @@ namespace ZoneAirLoopEquipmentManager { airDistUnit.EquipIndex(AirDistCompNum)); } break; case DataDefineEquip::ZnAirLoopEquipType::SingleDuct_ParallelPIU_Reheat: { + airDistUnit.piuTerminalLeakMassFlowRate = 0.0; SimPIU(state, airDistUnit.EquipName(AirDistCompNum), FirstHVACIteration, ControlledZoneNum, controlledZoneAirNode, airDistUnit.EquipIndex(AirDistCompNum)); + int PIUNum = Util::FindItemInList(airDistUnit.EquipName(AirDistCompNum), state.dataPowerInductionUnits->PIU); + if (PIUNum > 0) { + airDistUnit.piuTerminalLeakMassFlowRate = state.dataPowerInductionUnits->PIU(PIUNum).leakMassFlowRate; + } } break; case DataDefineEquip::ZnAirLoopEquipType::SingleDuct_ConstVol_4PipeInduc: { SimIndUnit(state, @@ -747,8 +752,10 @@ namespace ZoneAirLoopEquipmentManager { } if ((airDistUnit.UpStreamLeak || airDistUnit.DownStreamLeak) && MassFlowRateMaxAvail > 0.0) { airDistUnit.MassFlowRateTU = state.dataLoopNodes->Node(InNodeNum).MassFlowRate; - airDistUnit.MassFlowRateZSup = airDistUnit.MassFlowRateTU * (1.0 - airDistUnit.DownStreamLeakFrac); - airDistUnit.MassFlowRateDnStrLk = airDistUnit.MassFlowRateTU * airDistUnit.DownStreamLeakFrac; + airDistUnit.MassFlowRateZSup = + airDistUnit.MassFlowRateTU * (1.0 - airDistUnit.DownStreamLeakFrac) - airDistUnit.piuTerminalLeakMassFlowRate; + airDistUnit.MassFlowRateDnStrLk = + airDistUnit.MassFlowRateTU * airDistUnit.DownStreamLeakFrac + airDistUnit.piuTerminalLeakMassFlowRate; airDistUnit.MassFlowRateSup = airDistUnit.MassFlowRateTU + airDistUnit.MassFlowRateUpStrLk; state.dataLoopNodes->Node(InNodeNum).MassFlowRate = airDistUnit.MassFlowRateSup; state.dataLoopNodes->Node(OutNodeNum).MassFlowRate = airDistUnit.MassFlowRateZSup; diff --git a/src/EnergyPlus/ZoneEquipmentManager.cc b/src/EnergyPlus/ZoneEquipmentManager.cc index bc985e0849e..0b4b77580b5 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -295,7 +295,7 @@ void InitZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration) // airLoopFlow.ZoneRetFlow = 0.0; airLoopFlow.SysRetFlow = 0.0; airLoopFlow.RecircFlow = 0.0; - airLoopFlow.LeakFlow = 0.0; + airLoopFlow.leakMassFlowRate = 0.0; airLoopFlow.ExcessZoneExhFlow = 0.0; } } @@ -4809,7 +4809,7 @@ void CalcZoneMassBalance(EnergyPlusData &state, bool const FirstHVACIteration) auto &airLoopFlow = state.dataAirLoop->AirLoopFlow(airDisUnit.AirLoopNum); airLoopFlow.SupFlow += airDisUnit.MassFlowRateSup; airLoopFlow.RecircFlow += airDisUnit.MassFlowRatePlenInd; - airLoopFlow.LeakFlow += airDisUnit.MassFlowRateDnStrLk + airDisUnit.MassFlowRateUpStrLk; + airLoopFlow.leakMassFlowRate += airDisUnit.MassFlowRateDnStrLk + airDisUnit.MassFlowRateUpStrLk; } } @@ -5112,7 +5112,7 @@ void CalcZoneMassBalance(EnergyPlusData &state, bool const FirstHVACIteration) // Set system return flows for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) { auto &thisAirLoopFlow(state.dataAirLoop->AirLoopFlow(AirLoopNum)); - thisAirLoopFlow.SysRetFlow = thisAirLoopFlow.ZoneRetFlow - thisAirLoopFlow.RecircFlow + thisAirLoopFlow.LeakFlow; + thisAirLoopFlow.SysRetFlow = thisAirLoopFlow.ZoneRetFlow - thisAirLoopFlow.RecircFlow + thisAirLoopFlow.leakMassFlowRate; } } From 1cef13f63f52ae6e670077e2d93e62b67ea2ef4e Mon Sep 17 00:00:00 2001 From: Lerond Date: Fri, 25 Apr 2025 22:01:39 -0700 Subject: [PATCH 07/30] Remove unecessary changes. --- src/EnergyPlus/DataHeatBalance.hh | 1 - src/EnergyPlus/DisplacementVentMgr.hh | 111 ++++++++++++------------ src/EnergyPlus/InternalHeatGains.cc | 68 +++++++-------- src/EnergyPlus/PoweredInductionUnits.cc | 14 --- src/EnergyPlus/PoweredInductionUnits.hh | 1 - src/EnergyPlus/UFADManager.cc | 111 ++++++++++++------------ 6 files changed, 143 insertions(+), 163 deletions(-) diff --git a/src/EnergyPlus/DataHeatBalance.hh b/src/EnergyPlus/DataHeatBalance.hh index 877ef189deb..76da1eec1a5 100644 --- a/src/EnergyPlus/DataHeatBalance.hh +++ b/src/EnergyPlus/DataHeatBalance.hh @@ -283,7 +283,6 @@ namespace DataHeatBalance { ElectricLoadCenterConverter, FanSystemModel, IndoorGreen, - ParallelPIUDamperLeakage, Num }; diff --git a/src/EnergyPlus/DisplacementVentMgr.hh b/src/EnergyPlus/DisplacementVentMgr.hh index 276d026e6a7..3125beafb52 100644 --- a/src/EnergyPlus/DisplacementVentMgr.hh +++ b/src/EnergyPlus/DisplacementVentMgr.hh @@ -78,62 +78,61 @@ namespace RoomAir { void CalcDispVent3Node(EnergyPlusData &state, int ZoneNum); // Which Zonenum - static constexpr std::array IntGainTypesOccupied = { - DataHeatBalance::IntGainType::People, - DataHeatBalance::IntGainType::WaterHeaterMixed, - DataHeatBalance::IntGainType::WaterHeaterStratified, - DataHeatBalance::IntGainType::ThermalStorageChilledWaterMixed, - DataHeatBalance::IntGainType::ThermalStorageChilledWaterStratified, - DataHeatBalance::IntGainType::ElectricEquipment, - DataHeatBalance::IntGainType::ElectricEquipmentITEAirCooled, - DataHeatBalance::IntGainType::GasEquipment, - DataHeatBalance::IntGainType::HotWaterEquipment, - DataHeatBalance::IntGainType::SteamEquipment, - DataHeatBalance::IntGainType::OtherEquipment, - DataHeatBalance::IntGainType::IndoorGreen, - DataHeatBalance::IntGainType::ZoneBaseboardOutdoorTemperatureControlled, - DataHeatBalance::IntGainType::GeneratorFuelCell, - DataHeatBalance::IntGainType::WaterUseEquipment, - DataHeatBalance::IntGainType::GeneratorMicroCHP, - DataHeatBalance::IntGainType::ElectricLoadCenterTransformer, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterSimple, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterFunctionOfPower, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterLookUpTable, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageLiIonNmcBattery, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageBattery, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageSimple, - DataHeatBalance::IntGainType::PipeIndoor, - DataHeatBalance::IntGainType::RefrigerationCase, - DataHeatBalance::IntGainType::RefrigerationCompressorRack, - DataHeatBalance::IntGainType::RefrigerationSystemAirCooledCondenser, - DataHeatBalance::IntGainType::RefrigerationSystemSuctionPipe, - DataHeatBalance::IntGainType::RefrigerationSecondaryReceiver, - DataHeatBalance::IntGainType::RefrigerationSecondaryPipe, - DataHeatBalance::IntGainType::RefrigerationWalkIn, - DataHeatBalance::IntGainType::RefrigerationTransSysAirCooledGasCooler, - DataHeatBalance::IntGainType::RefrigerationTransSysSuctionPipeMT, - DataHeatBalance::IntGainType::RefrigerationTransSysSuctionPipeLT, - DataHeatBalance::IntGainType::Pump_VarSpeed, - DataHeatBalance::IntGainType::Pump_ConSpeed, - DataHeatBalance::IntGainType::Pump_Cond, - DataHeatBalance::IntGainType::PumpBank_VarSpeed, - DataHeatBalance::IntGainType::PumpBank_ConSpeed, - DataHeatBalance::IntGainType::PlantComponentUserDefined, - DataHeatBalance::IntGainType::CoilUserDefined, - DataHeatBalance::IntGainType::ZoneHVACForcedAirUserDefined, - DataHeatBalance::IntGainType::AirTerminalUserDefined, - DataHeatBalance::IntGainType::PackagedTESCoilTank, - DataHeatBalance::IntGainType::SecCoolingDXCoilSingleSpeed, - DataHeatBalance::IntGainType::SecHeatingDXCoilSingleSpeed, - DataHeatBalance::IntGainType::SecCoolingDXCoilTwoSpeed, - DataHeatBalance::IntGainType::SecCoolingDXCoilMultiSpeed, - DataHeatBalance::IntGainType::SecHeatingDXCoilMultiSpeed, - DataHeatBalance::IntGainType::ElectricLoadCenterConverter, - DataHeatBalance::IntGainType::FanSystemModel, - DataHeatBalance::IntGainType::ParallelPIUDamperLeakage}; - - static constexpr std::array IntGainTypesMixedSubzone = {DataHeatBalance::IntGainType::DaylightingDeviceTubular, - DataHeatBalance::IntGainType::Lights}; + static constexpr std::array IntGainTypesOccupied = + {DataHeatBalance::IntGainType::People, + DataHeatBalance::IntGainType::WaterHeaterMixed, + DataHeatBalance::IntGainType::WaterHeaterStratified, + DataHeatBalance::IntGainType::ThermalStorageChilledWaterMixed, + DataHeatBalance::IntGainType::ThermalStorageChilledWaterStratified, + DataHeatBalance::IntGainType::ElectricEquipment, + DataHeatBalance::IntGainType::ElectricEquipmentITEAirCooled, + DataHeatBalance::IntGainType::GasEquipment, + DataHeatBalance::IntGainType::HotWaterEquipment, + DataHeatBalance::IntGainType::SteamEquipment, + DataHeatBalance::IntGainType::OtherEquipment, + DataHeatBalance::IntGainType::IndoorGreen, + DataHeatBalance::IntGainType::ZoneBaseboardOutdoorTemperatureControlled, + DataHeatBalance::IntGainType::GeneratorFuelCell, + DataHeatBalance::IntGainType::WaterUseEquipment, + DataHeatBalance::IntGainType::GeneratorMicroCHP, + DataHeatBalance::IntGainType::ElectricLoadCenterTransformer, + DataHeatBalance::IntGainType::ElectricLoadCenterInverterSimple, + DataHeatBalance::IntGainType::ElectricLoadCenterInverterFunctionOfPower, + DataHeatBalance::IntGainType::ElectricLoadCenterInverterLookUpTable, + DataHeatBalance::IntGainType::ElectricLoadCenterStorageLiIonNmcBattery, + DataHeatBalance::IntGainType::ElectricLoadCenterStorageBattery, + DataHeatBalance::IntGainType::ElectricLoadCenterStorageSimple, + DataHeatBalance::IntGainType::PipeIndoor, + DataHeatBalance::IntGainType::RefrigerationCase, + DataHeatBalance::IntGainType::RefrigerationCompressorRack, + DataHeatBalance::IntGainType::RefrigerationSystemAirCooledCondenser, + DataHeatBalance::IntGainType::RefrigerationSystemSuctionPipe, + DataHeatBalance::IntGainType::RefrigerationSecondaryReceiver, + DataHeatBalance::IntGainType::RefrigerationSecondaryPipe, + DataHeatBalance::IntGainType::RefrigerationWalkIn, + DataHeatBalance::IntGainType::RefrigerationTransSysAirCooledGasCooler, + DataHeatBalance::IntGainType::RefrigerationTransSysSuctionPipeMT, + DataHeatBalance::IntGainType::RefrigerationTransSysSuctionPipeLT, + DataHeatBalance::IntGainType::Pump_VarSpeed, + DataHeatBalance::IntGainType::Pump_ConSpeed, + DataHeatBalance::IntGainType::Pump_Cond, + DataHeatBalance::IntGainType::PumpBank_VarSpeed, + DataHeatBalance::IntGainType::PumpBank_ConSpeed, + DataHeatBalance::IntGainType::PlantComponentUserDefined, + DataHeatBalance::IntGainType::CoilUserDefined, + DataHeatBalance::IntGainType::ZoneHVACForcedAirUserDefined, + DataHeatBalance::IntGainType::AirTerminalUserDefined, + DataHeatBalance::IntGainType::PackagedTESCoilTank, + DataHeatBalance::IntGainType::SecCoolingDXCoilSingleSpeed, + DataHeatBalance::IntGainType::SecHeatingDXCoilSingleSpeed, + DataHeatBalance::IntGainType::SecCoolingDXCoilTwoSpeed, + DataHeatBalance::IntGainType::SecCoolingDXCoilMultiSpeed, + DataHeatBalance::IntGainType::SecHeatingDXCoilMultiSpeed, + DataHeatBalance::IntGainType::ElectricLoadCenterConverter, + DataHeatBalance::IntGainType::FanSystemModel} + + static constexpr std::array + IntGainTypesMixedSubzone = {DataHeatBalance::IntGainType::DaylightingDeviceTubular, DataHeatBalance::IntGainType::Lights}; // Explicitly list internal gains not applicable for Displacement Vent static constexpr std::array ExcludedIntGainTypes = { diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index 52d6f488f06..cd53f2db97e 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -150,39 +150,37 @@ namespace InternalHeatGains { static constexpr std::array IntGainTypesWaterUse = {DataHeatBalance::IntGainType::WaterUseEquipment, DataHeatBalance::IntGainType::WaterHeaterMixed, DataHeatBalance::IntGainType::WaterHeaterStratified}; - static constexpr std::array IntGainTypesHvacLoss = { - DataHeatBalance::IntGainType::ZoneBaseboardOutdoorTemperatureControlled, - DataHeatBalance::IntGainType::ThermalStorageChilledWaterMixed, - DataHeatBalance::IntGainType::ThermalStorageChilledWaterStratified, - DataHeatBalance::IntGainType::PipeIndoor, - DataHeatBalance::IntGainType::Pump_VarSpeed, - DataHeatBalance::IntGainType::Pump_ConSpeed, - DataHeatBalance::IntGainType::Pump_Cond, - DataHeatBalance::IntGainType::PumpBank_VarSpeed, - DataHeatBalance::IntGainType::PumpBank_ConSpeed, - DataHeatBalance::IntGainType::PlantComponentUserDefined, - DataHeatBalance::IntGainType::CoilUserDefined, - DataHeatBalance::IntGainType::ZoneHVACForcedAirUserDefined, - DataHeatBalance::IntGainType::AirTerminalUserDefined, - DataHeatBalance::IntGainType::PackagedTESCoilTank, - DataHeatBalance::IntGainType::FanSystemModel, - DataHeatBalance::IntGainType::SecCoolingDXCoilSingleSpeed, - DataHeatBalance::IntGainType::SecHeatingDXCoilSingleSpeed, - DataHeatBalance::IntGainType::SecCoolingDXCoilTwoSpeed, - DataHeatBalance::IntGainType::SecCoolingDXCoilMultiSpeed, - DataHeatBalance::IntGainType::SecHeatingDXCoilMultiSpeed, - DataHeatBalance::IntGainType::ParallelPIUDamperLeakage}; - static constexpr std::array IntGainTypesPowerGen = { - DataHeatBalance::IntGainType::GeneratorFuelCell, - DataHeatBalance::IntGainType::GeneratorMicroCHP, - DataHeatBalance::IntGainType::ElectricLoadCenterTransformer, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterSimple, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterFunctionOfPower, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterLookUpTable, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageLiIonNmcBattery, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageBattery, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageSimple, - DataHeatBalance::IntGainType::ElectricLoadCenterConverter}; + static constexpr std::array IntGainTypesHvacLoss = + {DataHeatBalance::IntGainType::ZoneBaseboardOutdoorTemperatureControlled, + DataHeatBalance::IntGainType::ThermalStorageChilledWaterMixed, + DataHeatBalance::IntGainType::ThermalStorageChilledWaterStratified, + DataHeatBalance::IntGainType::PipeIndoor, + DataHeatBalance::IntGainType::Pump_VarSpeed, + DataHeatBalance::IntGainType::Pump_ConSpeed, + DataHeatBalance::IntGainType::Pump_Cond, + DataHeatBalance::IntGainType::PumpBank_VarSpeed, + DataHeatBalance::IntGainType::PumpBank_ConSpeed, + DataHeatBalance::IntGainType::PlantComponentUserDefined, + DataHeatBalance::IntGainType::CoilUserDefined, + DataHeatBalance::IntGainType::ZoneHVACForcedAirUserDefined, + DataHeatBalance::IntGainType::AirTerminalUserDefined, + DataHeatBalance::IntGainType::PackagedTESCoilTank, + DataHeatBalance::IntGainType::FanSystemModel, + DataHeatBalance::IntGainType::SecCoolingDXCoilSingleSpeed, + DataHeatBalance::IntGainType::SecHeatingDXCoilSingleSpeed, + DataHeatBalance::IntGainType::SecCoolingDXCoilTwoSpeed, + DataHeatBalance::IntGainType::SecCoolingDXCoilMultiSpeed, + DataHeatBalance::IntGainType::SecHeatingDXCoilMultiSpeed} static constexpr std::array + IntGainTypesPowerGen = {DataHeatBalance::IntGainType::GeneratorFuelCell, + DataHeatBalance::IntGainType::GeneratorMicroCHP, + DataHeatBalance::IntGainType::ElectricLoadCenterTransformer, + DataHeatBalance::IntGainType::ElectricLoadCenterInverterSimple, + DataHeatBalance::IntGainType::ElectricLoadCenterInverterFunctionOfPower, + DataHeatBalance::IntGainType::ElectricLoadCenterInverterLookUpTable, + DataHeatBalance::IntGainType::ElectricLoadCenterStorageLiIonNmcBattery, + DataHeatBalance::IntGainType::ElectricLoadCenterStorageBattery, + DataHeatBalance::IntGainType::ElectricLoadCenterStorageSimple, + DataHeatBalance::IntGainType::ElectricLoadCenterConverter}; // Explicitly list internal gains not gathered here static constexpr std::array ExcludedIntGainTypes = { DataHeatBalance::IntGainType::ZoneContaminantSourceAndSinkCarbonDioxide, @@ -1850,8 +1848,8 @@ namespace InternalHeatGains { nullptr, &thisZoneGas.CO2GainRate); - } // for gasEqInputNum.NumOfSpaces - } // for gasEqInputNum + } // for hwEqInputNum + } // TotHWEquip > 0 } // TotGasEquip > 0 // HotWaterEquipment diff --git a/src/EnergyPlus/PoweredInductionUnits.cc b/src/EnergyPlus/PoweredInductionUnits.cc index 3024bf2fa0a..ff342aa6096 100644 --- a/src/EnergyPlus/PoweredInductionUnits.cc +++ b/src/EnergyPlus/PoweredInductionUnits.cc @@ -580,12 +580,6 @@ void GetPIUs(EnergyPlusData &state) thisPIU.Name)); thisPIU.leakFracCurve = 0; } - - // SetupZoneInternalGain(state, - // thisPIU.CtrlZoneNum, // Need to use the secondary zone/plenum zone num - // thisPIU.Name, - // DataHeatBalance::IntGainType::ParallelPIUDamperLeakage, - // &thisPIU.leakLoss); } } } @@ -684,13 +678,6 @@ void GetPIUs(EnergyPlusData &state) OutputProcessor::TimeStepType::System, OutputProcessor::StoreType::Average, state.dataPowerInductionUnits->PIU(PIURpt).Name); - SetupOutputVariable(state, - "Zone Air Terminal Backdraft Damper Heat Loss", - Constant::Units::J, - thisPIU.leakLoss, - OutputProcessor::TimeStepType::System, - OutputProcessor::StoreType::Sum, - state.dataPowerInductionUnits->PIU(PIURpt).Name); } } @@ -1812,7 +1799,6 @@ void CalcParallelPIU(EnergyPlusData &state, auto &thisPIU = state.dataPowerInductionUnits->PIU(PIUNum); thisPIU.leakMassFlowRate = 0.0; - thisPIU.leakLoss = 0.0; Real64 const PriAirMassFlowMax = state.dataLoopNodes->Node(thisPIU.PriAirInNode).MassFlowRateMaxAvail; // max primary air mass flow rate [kg/s] Real64 const PriAirMassFlowMin = state.dataLoopNodes->Node(thisPIU.PriAirInNode).MassFlowRateMinAvail; // min primary air mass flow rate [kg/s] thisPIU.PriAirMassFlow = state.dataLoopNodes->Node(thisPIU.PriAirInNode).MassFlowRate; // primary air mass flow rate [kg/s] diff --git a/src/EnergyPlus/PoweredInductionUnits.hh b/src/EnergyPlus/PoweredInductionUnits.hh index d41f20fad12..e8ae552c912 100644 --- a/src/EnergyPlus/PoweredInductionUnits.hh +++ b/src/EnergyPlus/PoweredInductionUnits.hh @@ -205,7 +205,6 @@ namespace PoweredInductionUnits { Real64 leakFrac = 0.0; // parallel PIU backdraft damper leakage fraction Real64 leakMassFlowRate = 0.0; // parallel PIU backdraft damper leakage mass flow rate int leakFracCurve = 0.0; // parallel PIU backdraft damper leakage fraction curve - Real64 leakLoss = 0.0; // parallel PIU backdraft damper loss int secZoneNum = 0; // index to secondary zone int CurOperationControlStage = -1; // integer reference for what stage of control the unit is in diff --git a/src/EnergyPlus/UFADManager.cc b/src/EnergyPlus/UFADManager.cc index f9fe9a1fcd9..9c9249de30a 100644 --- a/src/EnergyPlus/UFADManager.cc +++ b/src/EnergyPlus/UFADManager.cc @@ -673,62 +673,61 @@ namespace RoomAir { } // END FLOOR } - static constexpr std::array IntGainTypesOccupied = { - DataHeatBalance::IntGainType::People, - DataHeatBalance::IntGainType::WaterHeaterMixed, - DataHeatBalance::IntGainType::WaterHeaterStratified, - DataHeatBalance::IntGainType::ThermalStorageChilledWaterMixed, - DataHeatBalance::IntGainType::ThermalStorageChilledWaterStratified, - DataHeatBalance::IntGainType::ElectricEquipment, - DataHeatBalance::IntGainType::ElectricEquipmentITEAirCooled, - DataHeatBalance::IntGainType::GasEquipment, - DataHeatBalance::IntGainType::HotWaterEquipment, - DataHeatBalance::IntGainType::SteamEquipment, - DataHeatBalance::IntGainType::OtherEquipment, - DataHeatBalance::IntGainType::IndoorGreen, - DataHeatBalance::IntGainType::ZoneBaseboardOutdoorTemperatureControlled, - DataHeatBalance::IntGainType::GeneratorFuelCell, - DataHeatBalance::IntGainType::WaterUseEquipment, - DataHeatBalance::IntGainType::GeneratorMicroCHP, - DataHeatBalance::IntGainType::ElectricLoadCenterTransformer, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterSimple, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterFunctionOfPower, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterLookUpTable, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageBattery, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageLiIonNmcBattery, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageSimple, - DataHeatBalance::IntGainType::PipeIndoor, - DataHeatBalance::IntGainType::RefrigerationCase, - DataHeatBalance::IntGainType::RefrigerationCompressorRack, - DataHeatBalance::IntGainType::RefrigerationSystemAirCooledCondenser, - DataHeatBalance::IntGainType::RefrigerationSystemSuctionPipe, - DataHeatBalance::IntGainType::RefrigerationSecondaryReceiver, - DataHeatBalance::IntGainType::RefrigerationSecondaryPipe, - DataHeatBalance::IntGainType::RefrigerationWalkIn, - DataHeatBalance::IntGainType::RefrigerationTransSysAirCooledGasCooler, - DataHeatBalance::IntGainType::RefrigerationTransSysSuctionPipeMT, - DataHeatBalance::IntGainType::RefrigerationTransSysSuctionPipeLT, - DataHeatBalance::IntGainType::Pump_VarSpeed, - DataHeatBalance::IntGainType::Pump_ConSpeed, - DataHeatBalance::IntGainType::Pump_Cond, - DataHeatBalance::IntGainType::PumpBank_VarSpeed, - DataHeatBalance::IntGainType::PumpBank_ConSpeed, - DataHeatBalance::IntGainType::PlantComponentUserDefined, - DataHeatBalance::IntGainType::CoilUserDefined, - DataHeatBalance::IntGainType::ZoneHVACForcedAirUserDefined, - DataHeatBalance::IntGainType::AirTerminalUserDefined, - DataHeatBalance::IntGainType::PackagedTESCoilTank, - DataHeatBalance::IntGainType::SecCoolingDXCoilSingleSpeed, - DataHeatBalance::IntGainType::SecHeatingDXCoilSingleSpeed, - DataHeatBalance::IntGainType::SecCoolingDXCoilTwoSpeed, - DataHeatBalance::IntGainType::SecCoolingDXCoilMultiSpeed, - DataHeatBalance::IntGainType::SecHeatingDXCoilMultiSpeed, - DataHeatBalance::IntGainType::ElectricLoadCenterConverter, - DataHeatBalance::IntGainType::FanSystemModel, - DataHeatBalance::IntGainType::ParallelPIUDamperLeakage}; - - static constexpr std::array IntGainTypesUpSubzone = {DataHeatBalance::IntGainType::DaylightingDeviceTubular, - DataHeatBalance::IntGainType::Lights}; + static constexpr std::array IntGainTypesOccupied = + {DataHeatBalance::IntGainType::People, + DataHeatBalance::IntGainType::WaterHeaterMixed, + DataHeatBalance::IntGainType::WaterHeaterStratified, + DataHeatBalance::IntGainType::ThermalStorageChilledWaterMixed, + DataHeatBalance::IntGainType::ThermalStorageChilledWaterStratified, + DataHeatBalance::IntGainType::ElectricEquipment, + DataHeatBalance::IntGainType::ElectricEquipmentITEAirCooled, + DataHeatBalance::IntGainType::GasEquipment, + DataHeatBalance::IntGainType::HotWaterEquipment, + DataHeatBalance::IntGainType::SteamEquipment, + DataHeatBalance::IntGainType::OtherEquipment, + DataHeatBalance::IntGainType::IndoorGreen, + DataHeatBalance::IntGainType::ZoneBaseboardOutdoorTemperatureControlled, + DataHeatBalance::IntGainType::GeneratorFuelCell, + DataHeatBalance::IntGainType::WaterUseEquipment, + DataHeatBalance::IntGainType::GeneratorMicroCHP, + DataHeatBalance::IntGainType::ElectricLoadCenterTransformer, + DataHeatBalance::IntGainType::ElectricLoadCenterInverterSimple, + DataHeatBalance::IntGainType::ElectricLoadCenterInverterFunctionOfPower, + DataHeatBalance::IntGainType::ElectricLoadCenterInverterLookUpTable, + DataHeatBalance::IntGainType::ElectricLoadCenterStorageBattery, + DataHeatBalance::IntGainType::ElectricLoadCenterStorageLiIonNmcBattery, + DataHeatBalance::IntGainType::ElectricLoadCenterStorageSimple, + DataHeatBalance::IntGainType::PipeIndoor, + DataHeatBalance::IntGainType::RefrigerationCase, + DataHeatBalance::IntGainType::RefrigerationCompressorRack, + DataHeatBalance::IntGainType::RefrigerationSystemAirCooledCondenser, + DataHeatBalance::IntGainType::RefrigerationSystemSuctionPipe, + DataHeatBalance::IntGainType::RefrigerationSecondaryReceiver, + DataHeatBalance::IntGainType::RefrigerationSecondaryPipe, + DataHeatBalance::IntGainType::RefrigerationWalkIn, + DataHeatBalance::IntGainType::RefrigerationTransSysAirCooledGasCooler, + DataHeatBalance::IntGainType::RefrigerationTransSysSuctionPipeMT, + DataHeatBalance::IntGainType::RefrigerationTransSysSuctionPipeLT, + DataHeatBalance::IntGainType::Pump_VarSpeed, + DataHeatBalance::IntGainType::Pump_ConSpeed, + DataHeatBalance::IntGainType::Pump_Cond, + DataHeatBalance::IntGainType::PumpBank_VarSpeed, + DataHeatBalance::IntGainType::PumpBank_ConSpeed, + DataHeatBalance::IntGainType::PlantComponentUserDefined, + DataHeatBalance::IntGainType::CoilUserDefined, + DataHeatBalance::IntGainType::ZoneHVACForcedAirUserDefined, + DataHeatBalance::IntGainType::AirTerminalUserDefined, + DataHeatBalance::IntGainType::PackagedTESCoilTank, + DataHeatBalance::IntGainType::SecCoolingDXCoilSingleSpeed, + DataHeatBalance::IntGainType::SecHeatingDXCoilSingleSpeed, + DataHeatBalance::IntGainType::SecCoolingDXCoilTwoSpeed, + DataHeatBalance::IntGainType::SecCoolingDXCoilMultiSpeed, + DataHeatBalance::IntGainType::SecHeatingDXCoilMultiSpeed, + DataHeatBalance::IntGainType::ElectricLoadCenterConverter, + DataHeatBalance::IntGainType::FanSystemModel} + + static constexpr std::array + IntGainTypesUpSubzone = {DataHeatBalance::IntGainType::DaylightingDeviceTubular, DataHeatBalance::IntGainType::Lights}; // Explicitly list internal gains not applicable for UFAD // Explicitly list internal gains not applicable for Displacement Vent From 48ab75d51e17ea1d1ecba7b94893c586810ee34b Mon Sep 17 00:00:00 2001 From: Lerond Date: Fri, 25 Apr 2025 22:08:04 -0700 Subject: [PATCH 08/30] Missing semi-colons. --- src/EnergyPlus/InternalHeatGains.cc | 64 ++++++++-------- src/EnergyPlus/UFADManager.cc | 110 ++++++++++++++-------------- 2 files changed, 88 insertions(+), 86 deletions(-) diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index cd53f2db97e..fd68c69d306 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -150,37 +150,39 @@ namespace InternalHeatGains { static constexpr std::array IntGainTypesWaterUse = {DataHeatBalance::IntGainType::WaterUseEquipment, DataHeatBalance::IntGainType::WaterHeaterMixed, DataHeatBalance::IntGainType::WaterHeaterStratified}; - static constexpr std::array IntGainTypesHvacLoss = - {DataHeatBalance::IntGainType::ZoneBaseboardOutdoorTemperatureControlled, - DataHeatBalance::IntGainType::ThermalStorageChilledWaterMixed, - DataHeatBalance::IntGainType::ThermalStorageChilledWaterStratified, - DataHeatBalance::IntGainType::PipeIndoor, - DataHeatBalance::IntGainType::Pump_VarSpeed, - DataHeatBalance::IntGainType::Pump_ConSpeed, - DataHeatBalance::IntGainType::Pump_Cond, - DataHeatBalance::IntGainType::PumpBank_VarSpeed, - DataHeatBalance::IntGainType::PumpBank_ConSpeed, - DataHeatBalance::IntGainType::PlantComponentUserDefined, - DataHeatBalance::IntGainType::CoilUserDefined, - DataHeatBalance::IntGainType::ZoneHVACForcedAirUserDefined, - DataHeatBalance::IntGainType::AirTerminalUserDefined, - DataHeatBalance::IntGainType::PackagedTESCoilTank, - DataHeatBalance::IntGainType::FanSystemModel, - DataHeatBalance::IntGainType::SecCoolingDXCoilSingleSpeed, - DataHeatBalance::IntGainType::SecHeatingDXCoilSingleSpeed, - DataHeatBalance::IntGainType::SecCoolingDXCoilTwoSpeed, - DataHeatBalance::IntGainType::SecCoolingDXCoilMultiSpeed, - DataHeatBalance::IntGainType::SecHeatingDXCoilMultiSpeed} static constexpr std::array - IntGainTypesPowerGen = {DataHeatBalance::IntGainType::GeneratorFuelCell, - DataHeatBalance::IntGainType::GeneratorMicroCHP, - DataHeatBalance::IntGainType::ElectricLoadCenterTransformer, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterSimple, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterFunctionOfPower, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterLookUpTable, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageLiIonNmcBattery, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageBattery, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageSimple, - DataHeatBalance::IntGainType::ElectricLoadCenterConverter}; + static constexpr std::array IntGainTypesHvacLoss = { + DataHeatBalance::IntGainType::ZoneBaseboardOutdoorTemperatureControlled, + DataHeatBalance::IntGainType::ThermalStorageChilledWaterMixed, + DataHeatBalance::IntGainType::ThermalStorageChilledWaterStratified, + DataHeatBalance::IntGainType::PipeIndoor, + DataHeatBalance::IntGainType::Pump_VarSpeed, + DataHeatBalance::IntGainType::Pump_ConSpeed, + DataHeatBalance::IntGainType::Pump_Cond, + DataHeatBalance::IntGainType::PumpBank_VarSpeed, + DataHeatBalance::IntGainType::PumpBank_ConSpeed, + DataHeatBalance::IntGainType::PlantComponentUserDefined, + DataHeatBalance::IntGainType::CoilUserDefined, + DataHeatBalance::IntGainType::ZoneHVACForcedAirUserDefined, + DataHeatBalance::IntGainType::AirTerminalUserDefined, + DataHeatBalance::IntGainType::PackagedTESCoilTank, + DataHeatBalance::IntGainType::FanSystemModel, + DataHeatBalance::IntGainType::SecCoolingDXCoilSingleSpeed, + DataHeatBalance::IntGainType::SecHeatingDXCoilSingleSpeed, + DataHeatBalance::IntGainType::SecCoolingDXCoilTwoSpeed, + DataHeatBalance::IntGainType::SecCoolingDXCoilMultiSpeed, + DataHeatBalance::IntGainType::SecHeatingDXCoilMultiSpeed}; + + static constexpr std::array IntGainTypesPowerGen = { + DataHeatBalance::IntGainType::GeneratorFuelCell, + DataHeatBalance::IntGainType::GeneratorMicroCHP, + DataHeatBalance::IntGainType::ElectricLoadCenterTransformer, + DataHeatBalance::IntGainType::ElectricLoadCenterInverterSimple, + DataHeatBalance::IntGainType::ElectricLoadCenterInverterFunctionOfPower, + DataHeatBalance::IntGainType::ElectricLoadCenterInverterLookUpTable, + DataHeatBalance::IntGainType::ElectricLoadCenterStorageLiIonNmcBattery, + DataHeatBalance::IntGainType::ElectricLoadCenterStorageBattery, + DataHeatBalance::IntGainType::ElectricLoadCenterStorageSimple, + DataHeatBalance::IntGainType::ElectricLoadCenterConverter}; // Explicitly list internal gains not gathered here static constexpr std::array ExcludedIntGainTypes = { DataHeatBalance::IntGainType::ZoneContaminantSourceAndSinkCarbonDioxide, diff --git a/src/EnergyPlus/UFADManager.cc b/src/EnergyPlus/UFADManager.cc index 9c9249de30a..5dd0deabd9e 100644 --- a/src/EnergyPlus/UFADManager.cc +++ b/src/EnergyPlus/UFADManager.cc @@ -673,61 +673,61 @@ namespace RoomAir { } // END FLOOR } - static constexpr std::array IntGainTypesOccupied = - {DataHeatBalance::IntGainType::People, - DataHeatBalance::IntGainType::WaterHeaterMixed, - DataHeatBalance::IntGainType::WaterHeaterStratified, - DataHeatBalance::IntGainType::ThermalStorageChilledWaterMixed, - DataHeatBalance::IntGainType::ThermalStorageChilledWaterStratified, - DataHeatBalance::IntGainType::ElectricEquipment, - DataHeatBalance::IntGainType::ElectricEquipmentITEAirCooled, - DataHeatBalance::IntGainType::GasEquipment, - DataHeatBalance::IntGainType::HotWaterEquipment, - DataHeatBalance::IntGainType::SteamEquipment, - DataHeatBalance::IntGainType::OtherEquipment, - DataHeatBalance::IntGainType::IndoorGreen, - DataHeatBalance::IntGainType::ZoneBaseboardOutdoorTemperatureControlled, - DataHeatBalance::IntGainType::GeneratorFuelCell, - DataHeatBalance::IntGainType::WaterUseEquipment, - DataHeatBalance::IntGainType::GeneratorMicroCHP, - DataHeatBalance::IntGainType::ElectricLoadCenterTransformer, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterSimple, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterFunctionOfPower, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterLookUpTable, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageBattery, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageLiIonNmcBattery, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageSimple, - DataHeatBalance::IntGainType::PipeIndoor, - DataHeatBalance::IntGainType::RefrigerationCase, - DataHeatBalance::IntGainType::RefrigerationCompressorRack, - DataHeatBalance::IntGainType::RefrigerationSystemAirCooledCondenser, - DataHeatBalance::IntGainType::RefrigerationSystemSuctionPipe, - DataHeatBalance::IntGainType::RefrigerationSecondaryReceiver, - DataHeatBalance::IntGainType::RefrigerationSecondaryPipe, - DataHeatBalance::IntGainType::RefrigerationWalkIn, - DataHeatBalance::IntGainType::RefrigerationTransSysAirCooledGasCooler, - DataHeatBalance::IntGainType::RefrigerationTransSysSuctionPipeMT, - DataHeatBalance::IntGainType::RefrigerationTransSysSuctionPipeLT, - DataHeatBalance::IntGainType::Pump_VarSpeed, - DataHeatBalance::IntGainType::Pump_ConSpeed, - DataHeatBalance::IntGainType::Pump_Cond, - DataHeatBalance::IntGainType::PumpBank_VarSpeed, - DataHeatBalance::IntGainType::PumpBank_ConSpeed, - DataHeatBalance::IntGainType::PlantComponentUserDefined, - DataHeatBalance::IntGainType::CoilUserDefined, - DataHeatBalance::IntGainType::ZoneHVACForcedAirUserDefined, - DataHeatBalance::IntGainType::AirTerminalUserDefined, - DataHeatBalance::IntGainType::PackagedTESCoilTank, - DataHeatBalance::IntGainType::SecCoolingDXCoilSingleSpeed, - DataHeatBalance::IntGainType::SecHeatingDXCoilSingleSpeed, - DataHeatBalance::IntGainType::SecCoolingDXCoilTwoSpeed, - DataHeatBalance::IntGainType::SecCoolingDXCoilMultiSpeed, - DataHeatBalance::IntGainType::SecHeatingDXCoilMultiSpeed, - DataHeatBalance::IntGainType::ElectricLoadCenterConverter, - DataHeatBalance::IntGainType::FanSystemModel} - - static constexpr std::array - IntGainTypesUpSubzone = {DataHeatBalance::IntGainType::DaylightingDeviceTubular, DataHeatBalance::IntGainType::Lights}; + static constexpr std::array IntGainTypesOccupied = { + DataHeatBalance::IntGainType::People, + DataHeatBalance::IntGainType::WaterHeaterMixed, + DataHeatBalance::IntGainType::WaterHeaterStratified, + DataHeatBalance::IntGainType::ThermalStorageChilledWaterMixed, + DataHeatBalance::IntGainType::ThermalStorageChilledWaterStratified, + DataHeatBalance::IntGainType::ElectricEquipment, + DataHeatBalance::IntGainType::ElectricEquipmentITEAirCooled, + DataHeatBalance::IntGainType::GasEquipment, + DataHeatBalance::IntGainType::HotWaterEquipment, + DataHeatBalance::IntGainType::SteamEquipment, + DataHeatBalance::IntGainType::OtherEquipment, + DataHeatBalance::IntGainType::IndoorGreen, + DataHeatBalance::IntGainType::ZoneBaseboardOutdoorTemperatureControlled, + DataHeatBalance::IntGainType::GeneratorFuelCell, + DataHeatBalance::IntGainType::WaterUseEquipment, + DataHeatBalance::IntGainType::GeneratorMicroCHP, + DataHeatBalance::IntGainType::ElectricLoadCenterTransformer, + DataHeatBalance::IntGainType::ElectricLoadCenterInverterSimple, + DataHeatBalance::IntGainType::ElectricLoadCenterInverterFunctionOfPower, + DataHeatBalance::IntGainType::ElectricLoadCenterInverterLookUpTable, + DataHeatBalance::IntGainType::ElectricLoadCenterStorageBattery, + DataHeatBalance::IntGainType::ElectricLoadCenterStorageLiIonNmcBattery, + DataHeatBalance::IntGainType::ElectricLoadCenterStorageSimple, + DataHeatBalance::IntGainType::PipeIndoor, + DataHeatBalance::IntGainType::RefrigerationCase, + DataHeatBalance::IntGainType::RefrigerationCompressorRack, + DataHeatBalance::IntGainType::RefrigerationSystemAirCooledCondenser, + DataHeatBalance::IntGainType::RefrigerationSystemSuctionPipe, + DataHeatBalance::IntGainType::RefrigerationSecondaryReceiver, + DataHeatBalance::IntGainType::RefrigerationSecondaryPipe, + DataHeatBalance::IntGainType::RefrigerationWalkIn, + DataHeatBalance::IntGainType::RefrigerationTransSysAirCooledGasCooler, + DataHeatBalance::IntGainType::RefrigerationTransSysSuctionPipeMT, + DataHeatBalance::IntGainType::RefrigerationTransSysSuctionPipeLT, + DataHeatBalance::IntGainType::Pump_VarSpeed, + DataHeatBalance::IntGainType::Pump_ConSpeed, + DataHeatBalance::IntGainType::Pump_Cond, + DataHeatBalance::IntGainType::PumpBank_VarSpeed, + DataHeatBalance::IntGainType::PumpBank_ConSpeed, + DataHeatBalance::IntGainType::PlantComponentUserDefined, + DataHeatBalance::IntGainType::CoilUserDefined, + DataHeatBalance::IntGainType::ZoneHVACForcedAirUserDefined, + DataHeatBalance::IntGainType::AirTerminalUserDefined, + DataHeatBalance::IntGainType::PackagedTESCoilTank, + DataHeatBalance::IntGainType::SecCoolingDXCoilSingleSpeed, + DataHeatBalance::IntGainType::SecHeatingDXCoilSingleSpeed, + DataHeatBalance::IntGainType::SecCoolingDXCoilTwoSpeed, + DataHeatBalance::IntGainType::SecCoolingDXCoilMultiSpeed, + DataHeatBalance::IntGainType::SecHeatingDXCoilMultiSpeed, + DataHeatBalance::IntGainType::ElectricLoadCenterConverter, + DataHeatBalance::IntGainType::FanSystemModel}; + + static constexpr std::array IntGainTypesUpSubzone = {DataHeatBalance::IntGainType::DaylightingDeviceTubular, + DataHeatBalance::IntGainType::Lights}; // Explicitly list internal gains not applicable for UFAD // Explicitly list internal gains not applicable for Displacement Vent From 868c2f10c5f2cf1fb07a3de7e270011403d575ad Mon Sep 17 00:00:00 2001 From: Lerond Date: Mon, 28 Apr 2025 08:53:55 -0700 Subject: [PATCH 09/30] Ah, missed one. --- src/EnergyPlus/DisplacementVentMgr.hh | 110 +++++++++++++------------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/src/EnergyPlus/DisplacementVentMgr.hh b/src/EnergyPlus/DisplacementVentMgr.hh index 3125beafb52..1f46b8df6c2 100644 --- a/src/EnergyPlus/DisplacementVentMgr.hh +++ b/src/EnergyPlus/DisplacementVentMgr.hh @@ -78,61 +78,61 @@ namespace RoomAir { void CalcDispVent3Node(EnergyPlusData &state, int ZoneNum); // Which Zonenum - static constexpr std::array IntGainTypesOccupied = - {DataHeatBalance::IntGainType::People, - DataHeatBalance::IntGainType::WaterHeaterMixed, - DataHeatBalance::IntGainType::WaterHeaterStratified, - DataHeatBalance::IntGainType::ThermalStorageChilledWaterMixed, - DataHeatBalance::IntGainType::ThermalStorageChilledWaterStratified, - DataHeatBalance::IntGainType::ElectricEquipment, - DataHeatBalance::IntGainType::ElectricEquipmentITEAirCooled, - DataHeatBalance::IntGainType::GasEquipment, - DataHeatBalance::IntGainType::HotWaterEquipment, - DataHeatBalance::IntGainType::SteamEquipment, - DataHeatBalance::IntGainType::OtherEquipment, - DataHeatBalance::IntGainType::IndoorGreen, - DataHeatBalance::IntGainType::ZoneBaseboardOutdoorTemperatureControlled, - DataHeatBalance::IntGainType::GeneratorFuelCell, - DataHeatBalance::IntGainType::WaterUseEquipment, - DataHeatBalance::IntGainType::GeneratorMicroCHP, - DataHeatBalance::IntGainType::ElectricLoadCenterTransformer, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterSimple, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterFunctionOfPower, - DataHeatBalance::IntGainType::ElectricLoadCenterInverterLookUpTable, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageLiIonNmcBattery, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageBattery, - DataHeatBalance::IntGainType::ElectricLoadCenterStorageSimple, - DataHeatBalance::IntGainType::PipeIndoor, - DataHeatBalance::IntGainType::RefrigerationCase, - DataHeatBalance::IntGainType::RefrigerationCompressorRack, - DataHeatBalance::IntGainType::RefrigerationSystemAirCooledCondenser, - DataHeatBalance::IntGainType::RefrigerationSystemSuctionPipe, - DataHeatBalance::IntGainType::RefrigerationSecondaryReceiver, - DataHeatBalance::IntGainType::RefrigerationSecondaryPipe, - DataHeatBalance::IntGainType::RefrigerationWalkIn, - DataHeatBalance::IntGainType::RefrigerationTransSysAirCooledGasCooler, - DataHeatBalance::IntGainType::RefrigerationTransSysSuctionPipeMT, - DataHeatBalance::IntGainType::RefrigerationTransSysSuctionPipeLT, - DataHeatBalance::IntGainType::Pump_VarSpeed, - DataHeatBalance::IntGainType::Pump_ConSpeed, - DataHeatBalance::IntGainType::Pump_Cond, - DataHeatBalance::IntGainType::PumpBank_VarSpeed, - DataHeatBalance::IntGainType::PumpBank_ConSpeed, - DataHeatBalance::IntGainType::PlantComponentUserDefined, - DataHeatBalance::IntGainType::CoilUserDefined, - DataHeatBalance::IntGainType::ZoneHVACForcedAirUserDefined, - DataHeatBalance::IntGainType::AirTerminalUserDefined, - DataHeatBalance::IntGainType::PackagedTESCoilTank, - DataHeatBalance::IntGainType::SecCoolingDXCoilSingleSpeed, - DataHeatBalance::IntGainType::SecHeatingDXCoilSingleSpeed, - DataHeatBalance::IntGainType::SecCoolingDXCoilTwoSpeed, - DataHeatBalance::IntGainType::SecCoolingDXCoilMultiSpeed, - DataHeatBalance::IntGainType::SecHeatingDXCoilMultiSpeed, - DataHeatBalance::IntGainType::ElectricLoadCenterConverter, - DataHeatBalance::IntGainType::FanSystemModel} - - static constexpr std::array - IntGainTypesMixedSubzone = {DataHeatBalance::IntGainType::DaylightingDeviceTubular, DataHeatBalance::IntGainType::Lights}; + static constexpr std::array IntGainTypesOccupied = { + DataHeatBalance::IntGainType::People, + DataHeatBalance::IntGainType::WaterHeaterMixed, + DataHeatBalance::IntGainType::WaterHeaterStratified, + DataHeatBalance::IntGainType::ThermalStorageChilledWaterMixed, + DataHeatBalance::IntGainType::ThermalStorageChilledWaterStratified, + DataHeatBalance::IntGainType::ElectricEquipment, + DataHeatBalance::IntGainType::ElectricEquipmentITEAirCooled, + DataHeatBalance::IntGainType::GasEquipment, + DataHeatBalance::IntGainType::HotWaterEquipment, + DataHeatBalance::IntGainType::SteamEquipment, + DataHeatBalance::IntGainType::OtherEquipment, + DataHeatBalance::IntGainType::IndoorGreen, + DataHeatBalance::IntGainType::ZoneBaseboardOutdoorTemperatureControlled, + DataHeatBalance::IntGainType::GeneratorFuelCell, + DataHeatBalance::IntGainType::WaterUseEquipment, + DataHeatBalance::IntGainType::GeneratorMicroCHP, + DataHeatBalance::IntGainType::ElectricLoadCenterTransformer, + DataHeatBalance::IntGainType::ElectricLoadCenterInverterSimple, + DataHeatBalance::IntGainType::ElectricLoadCenterInverterFunctionOfPower, + DataHeatBalance::IntGainType::ElectricLoadCenterInverterLookUpTable, + DataHeatBalance::IntGainType::ElectricLoadCenterStorageLiIonNmcBattery, + DataHeatBalance::IntGainType::ElectricLoadCenterStorageBattery, + DataHeatBalance::IntGainType::ElectricLoadCenterStorageSimple, + DataHeatBalance::IntGainType::PipeIndoor, + DataHeatBalance::IntGainType::RefrigerationCase, + DataHeatBalance::IntGainType::RefrigerationCompressorRack, + DataHeatBalance::IntGainType::RefrigerationSystemAirCooledCondenser, + DataHeatBalance::IntGainType::RefrigerationSystemSuctionPipe, + DataHeatBalance::IntGainType::RefrigerationSecondaryReceiver, + DataHeatBalance::IntGainType::RefrigerationSecondaryPipe, + DataHeatBalance::IntGainType::RefrigerationWalkIn, + DataHeatBalance::IntGainType::RefrigerationTransSysAirCooledGasCooler, + DataHeatBalance::IntGainType::RefrigerationTransSysSuctionPipeMT, + DataHeatBalance::IntGainType::RefrigerationTransSysSuctionPipeLT, + DataHeatBalance::IntGainType::Pump_VarSpeed, + DataHeatBalance::IntGainType::Pump_ConSpeed, + DataHeatBalance::IntGainType::Pump_Cond, + DataHeatBalance::IntGainType::PumpBank_VarSpeed, + DataHeatBalance::IntGainType::PumpBank_ConSpeed, + DataHeatBalance::IntGainType::PlantComponentUserDefined, + DataHeatBalance::IntGainType::CoilUserDefined, + DataHeatBalance::IntGainType::ZoneHVACForcedAirUserDefined, + DataHeatBalance::IntGainType::AirTerminalUserDefined, + DataHeatBalance::IntGainType::PackagedTESCoilTank, + DataHeatBalance::IntGainType::SecCoolingDXCoilSingleSpeed, + DataHeatBalance::IntGainType::SecHeatingDXCoilSingleSpeed, + DataHeatBalance::IntGainType::SecCoolingDXCoilTwoSpeed, + DataHeatBalance::IntGainType::SecCoolingDXCoilMultiSpeed, + DataHeatBalance::IntGainType::SecHeatingDXCoilMultiSpeed, + DataHeatBalance::IntGainType::ElectricLoadCenterConverter, + DataHeatBalance::IntGainType::FanSystemModel}; + + static constexpr std::array IntGainTypesMixedSubzone = {DataHeatBalance::IntGainType::DaylightingDeviceTubular, + DataHeatBalance::IntGainType::Lights}; // Explicitly list internal gains not applicable for Displacement Vent static constexpr std::array ExcludedIntGainTypes = { From bb7d542224efba75a5a7c7b55da64c910ebacda4 Mon Sep 17 00:00:00 2001 From: Lerond Date: Mon, 28 Apr 2025 16:41:19 -0700 Subject: [PATCH 10/30] New approach for impact of leakage on zone load. --- src/EnergyPlus/DataDefineEquip.hh | 1 + src/EnergyPlus/DataHeatBalance.hh | 1 + src/EnergyPlus/InternalHeatGains.cc | 9 ++--- src/EnergyPlus/PoweredInductionUnits.cc | 27 ++++++++----- src/EnergyPlus/PoweredInductionUnits.hh | 5 ++- src/EnergyPlus/RoomAirModelAirflowNetwork.cc | 14 +++++++ src/EnergyPlus/ZoneAirLoopEquipmentManager.cc | 18 ++++++--- .../ZoneContaminantPredictorCorrector.cc | 18 +++++++++ src/EnergyPlus/ZoneEquipmentManager.cc | 2 +- src/EnergyPlus/ZonePlenum.cc | 3 +- src/EnergyPlus/ZoneTempPredictorCorrector.cc | 38 +++++++++++++++++++ 11 files changed, 111 insertions(+), 25 deletions(-) diff --git a/src/EnergyPlus/DataDefineEquip.hh b/src/EnergyPlus/DataDefineEquip.hh index dc6fe17863c..82b3391246f 100644 --- a/src/EnergyPlus/DataDefineEquip.hh +++ b/src/EnergyPlus/DataDefineEquip.hh @@ -111,6 +111,7 @@ namespace DataDefineEquip { Real64 MassFlowRateDnStrLk = 0.0; // current air mass flow rate of the downstream leak [kg/s] Real64 MassFlowRateTU = 0.0; // current air mass flow rate through the terminal unit [kg/s] Real64 MassFlowRateZSup = 0.0; // current air mass flow rate of zone supply air [kg/s] + Real64 massFlowRateParallelPIULk; // current air mass flow rate of parallel piu leak [kg/s] Real64 MassFlowRateSup = 0.0; // current air mass flow rate of supply air upstream of upstream leak [kg/s] Real64 MassFlowRatePlenInd = 0.0; // current air mass flow rate of induced air from plenum [kg/s] Real64 MaxAvailDelta = 0.0; // change in max avail mass low rate due to leaks [kg/s] diff --git a/src/EnergyPlus/DataHeatBalance.hh b/src/EnergyPlus/DataHeatBalance.hh index 76da1eec1a5..3be5dff6445 100644 --- a/src/EnergyPlus/DataHeatBalance.hh +++ b/src/EnergyPlus/DataHeatBalance.hh @@ -602,6 +602,7 @@ namespace DataHeatBalance { Real64 ExtGrossGroundWallArea_Multiplied = 0.0; // Ground contact Wall Area for Zone (Gross) with multipliers bool IsSupplyPlenum = false; // True when this zone is a supply plenum bool IsReturnPlenum = false; // True when this zone is a return plenum + bool isSourceForParallelPIU = false; // True when a parallel PIU draws air from this zone int PlenumCondNum = 0; // Supply or return plenum conditions number, 0 if this is not a plenum zone int TempControlledZoneIndex = 0; // this is the index number for TempControlledZone structure for lookup int humidityControlZoneIndex = 0; // this is the index number for HumidityControlZone structure for lookup diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index fd68c69d306..ccc90568497 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -171,7 +171,6 @@ namespace InternalHeatGains { DataHeatBalance::IntGainType::SecCoolingDXCoilTwoSpeed, DataHeatBalance::IntGainType::SecCoolingDXCoilMultiSpeed, DataHeatBalance::IntGainType::SecHeatingDXCoilMultiSpeed}; - static constexpr std::array IntGainTypesPowerGen = { DataHeatBalance::IntGainType::GeneratorFuelCell, DataHeatBalance::IntGainType::GeneratorMicroCHP, @@ -1850,8 +1849,8 @@ namespace InternalHeatGains { nullptr, &thisZoneGas.CO2GainRate); - } // for hwEqInputNum - } // TotHWEquip > 0 + } // for gasEqInputNum.NumOfSpaces + } // for gasEqInputNum } // TotGasEquip > 0 // HotWaterEquipment @@ -2054,8 +2053,8 @@ namespace InternalHeatGains { &thisZoneHWEq.LatGainRate); } // for hwEqInputNum.NumOfSpaces - } // for gasEqInputNum - } // TotGasEquip > 0 + } // for hwEqInputNum + } // TotHWEquip > 0 // SteamEquipment EPVector steamEqObjects; diff --git a/src/EnergyPlus/PoweredInductionUnits.cc b/src/EnergyPlus/PoweredInductionUnits.cc index ff342aa6096..8bddcae1fa5 100644 --- a/src/EnergyPlus/PoweredInductionUnits.cc +++ b/src/EnergyPlus/PoweredInductionUnits.cc @@ -558,7 +558,7 @@ void GetPIUs(EnergyPlusData &state) for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { for (int exhaustNum = 1; exhaustNum <= state.dataZoneEquip->ZoneEquipConfig(zoneNum).NumExhaustNodes; ++exhaustNum) { if (thisPIU.SecAirInNode == state.dataZoneEquip->ZoneEquipConfig(zoneNum).ExhaustNode(exhaustNum)) { - thisPIU.secZoneNum = zoneNum; + state.dataHeatBal->Zone(zoneNum).isSourceForParallelPIU = true; break; } } @@ -567,19 +567,11 @@ void GetPIUs(EnergyPlusData &state) for (int zoneNum = 1; zoneNum <= state.dataZonePlenum->NumZoneSupplyPlenums; ++zoneNum) { for (int nodeNum = 1; nodeNum <= state.dataZonePlenum->ZoneRetPlenCond(zoneNum).NumInducedNodes; ++nodeNum) { if (thisPIU.SecAirInNode == state.dataZonePlenum->ZoneRetPlenCond(zoneNum).InducedNode(nodeNum)) { - thisPIU.secZoneNum = zoneNum; + state.dataHeatBal->Zone(zoneNum).isSourceForParallelPIU = true; break; } } } - if (thisPIU.secZoneNum == 0) { - ShowWarningError(state, - format("The zone corresponding to the secondary air inlet could not be found for {} Unit = {}, no " - "leakage will be simulated", - cCurrentModuleObject, - thisPIU.Name)); - thisPIU.leakFracCurve = 0; - } } } } @@ -2608,6 +2600,21 @@ void PIUInducesPlenumAir(EnergyPlusData &state, int const NodeNum, int const ple } } +int getParallelPIUNumFromSecNodeNum(EnergyPlusData &state, int const zoneNum) +{ + if (state.dataPowerInductionUnits->GetPIUInputFlag) { + GetPIUs(state); + state.dataPowerInductionUnits->GetPIUInputFlag = false; + } + + for (int PIUIndex = 1; PIUIndex <= state.dataPowerInductionUnits->NumPIUs; ++PIUIndex) { + if (zoneNum == state.dataPowerInductionUnits->PIU(PIUIndex).SecAirInNode) { + return PIUIndex; + } + } + return 0; +} + void PowIndUnitData::CalcOutdoorAirVolumeFlowRate(EnergyPlusData &state) { // calculates zone outdoor air volume flow rate using the supply air flow rate and OA fraction diff --git a/src/EnergyPlus/PoweredInductionUnits.hh b/src/EnergyPlus/PoweredInductionUnits.hh index e8ae552c912..6d979e78892 100644 --- a/src/EnergyPlus/PoweredInductionUnits.hh +++ b/src/EnergyPlus/PoweredInductionUnits.hh @@ -205,7 +205,6 @@ namespace PoweredInductionUnits { Real64 leakFrac = 0.0; // parallel PIU backdraft damper leakage fraction Real64 leakMassFlowRate = 0.0; // parallel PIU backdraft damper leakage mass flow rate int leakFracCurve = 0.0; // parallel PIU backdraft damper leakage fraction curve - int secZoneNum = 0; // index to secondary zone int CurOperationControlStage = -1; // integer reference for what stage of control the unit is in int plenumIndex = 0; @@ -219,7 +218,7 @@ namespace PoweredInductionUnits { MaxHotWaterFlow(0.0), MaxHotSteamFlow(0.0), MinVolHotWaterFlow(0.0), MinHotSteamFlow(0.0), MinVolHotSteamFlow(0.0), MinHotWaterFlow(0.0), HotControlNode(0), HotCoilOutNodeNum(0), HotControlOffset(0.0), HWplantLoc{}, ADUNum(0), InducesPlenumAir(false), HeatingRate(0.0), HeatingEnergy(0.0), SensCoolRate(0.0), SensCoolEnergy(0.0), CtrlZoneNum(0), ctrlZoneInNodeIndex(0), AirLoopNum(0), - OutdoorAirFlowRate(0.0), leakFrac(0.0), leakMassFlowRate(0.0), leakFracCurve(0), secZoneNum(0) + OutdoorAirFlowRate(0.0), leakFrac(0.0), leakMassFlowRate(0.0), leakFracCurve(0) { } @@ -284,6 +283,8 @@ namespace PoweredInductionUnits { void PIUInducesPlenumAir(EnergyPlusData &state, int NodeNum, int const plenumNum); // induced air node number + int getParallelPIUNumFromSecNodeNum(EnergyPlusData &state, int const zoneNum); // get parallel PIU index + Real64 CalcVariableSpeedPIUHeatingResidual(EnergyPlusData &state, Real64 const fanSignal, int const piuNum, diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc index 8ce4745ec6e..213421134ef 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc @@ -79,6 +79,7 @@ #include #include #include +#include #include #include #include @@ -774,6 +775,19 @@ namespace RoomAir { SumSysMCpT += inletNode.MassFlowRate * CpAir * inletNode.Temp; } + if (zone.isSourceForParallelPIU) { + Real64 CpAir = PsyCpAirFnW(zoneHB.airHumRat); + for (int iExhNode = 1; iExhNode <= state.dataZoneEquip->ZoneEquipConfig(zoneNum).NumExhaustNodes; ++iExhNode) { + int piuNum = PoweredInductionUnits::getParallelPIUNumFromSecNodeNum( + state, state.dataZoneEquip->ZoneEquipConfig(zoneNum).ExhaustNode(iExhNode)); + if (piuNum > 0) { + auto &thisPIU = state.dataPowerInductionUnits->PIU(piuNum); + SumSysMCp += thisPIU.leakMassFlowRate * CpAir; + SumSysMCpT += thisPIU.leakMassFlowRate * CpAir * state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp; + } + } + } + int ZoneMult = zone.Multiplier * zone.ListMultiplier; SumSysMCp /= ZoneMult; diff --git a/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc b/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc index b3f5cd07393..6c208f48396 100644 --- a/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc +++ b/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc @@ -517,6 +517,7 @@ namespace ZoneAirLoopEquipmentManager { // every time step airDistUnit.MassFlowRateDnStrLk = 0.0; airDistUnit.MassFlowRateUpStrLk = 0.0; + airDistUnit.massFlowRateParallelPIULk = 0.0; airDistUnit.MassFlowRateTU = 0.0; airDistUnit.MassFlowRateZSup = 0.0; airDistUnit.MassFlowRateSup = 0.0; @@ -750,19 +751,24 @@ namespace ZoneAirLoopEquipmentManager { state.dataLoopNodes->Node(InNodeNum).MassFlowRateMaxAvail = MassFlowRateMaxAvail; state.dataLoopNodes->Node(InNodeNum).MassFlowRateMinAvail = MassFlowRateMinAvail; } - if ((airDistUnit.UpStreamLeak || airDistUnit.DownStreamLeak) && MassFlowRateMaxAvail > 0.0) { + if ((airDistUnit.UpStreamLeak || airDistUnit.DownStreamLeak || airDistUnit.piuTerminalLeakMassFlowRate) && + MassFlowRateMaxAvail > 0.0) { airDistUnit.MassFlowRateTU = state.dataLoopNodes->Node(InNodeNum).MassFlowRate; airDistUnit.MassFlowRateZSup = - airDistUnit.MassFlowRateTU * (1.0 - airDistUnit.DownStreamLeakFrac) - airDistUnit.piuTerminalLeakMassFlowRate; - airDistUnit.MassFlowRateDnStrLk = - airDistUnit.MassFlowRateTU * airDistUnit.DownStreamLeakFrac + airDistUnit.piuTerminalLeakMassFlowRate; + max(airDistUnit.MassFlowRateTU * (1.0 - airDistUnit.DownStreamLeakFrac) - airDistUnit.piuTerminalLeakMassFlowRate, 0.0); + airDistUnit.MassFlowRateDnStrLk = airDistUnit.MassFlowRateTU * airDistUnit.DownStreamLeakFrac; + airDistUnit.massFlowRateParallelPIULk = airDistUnit.piuTerminalLeakMassFlowRate; airDistUnit.MassFlowRateSup = airDistUnit.MassFlowRateTU + airDistUnit.MassFlowRateUpStrLk; state.dataLoopNodes->Node(InNodeNum).MassFlowRate = airDistUnit.MassFlowRateSup; state.dataLoopNodes->Node(OutNodeNum).MassFlowRate = airDistUnit.MassFlowRateZSup; state.dataLoopNodes->Node(OutNodeNum).MassFlowRateMaxAvail = - max(0.0, MassFlowRateMaxAvail - airDistUnit.MassFlowRateDnStrLk - airDistUnit.MassFlowRateUpStrLk); + max(0.0, + MassFlowRateMaxAvail - airDistUnit.MassFlowRateDnStrLk - airDistUnit.MassFlowRateUpStrLk - + airDistUnit.massFlowRateParallelPIULk); state.dataLoopNodes->Node(OutNodeNum).MassFlowRateMinAvail = - max(0.0, MassFlowRateMinAvail - airDistUnit.MassFlowRateDnStrLk - airDistUnit.MassFlowRateUpStrLk); + max(0.0, + MassFlowRateMinAvail - airDistUnit.MassFlowRateDnStrLk - airDistUnit.MassFlowRateUpStrLk - + airDistUnit.massFlowRateParallelPIULk); airDistUnit.MaxAvailDelta = MassFlowRateMaxAvail - state.dataLoopNodes->Node(OutNodeNum).MassFlowRateMaxAvail; airDistUnit.MinAvailDelta = MassFlowRateMinAvail - state.dataLoopNodes->Node(OutNodeNum).MassFlowRateMinAvail; } else { diff --git a/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc b/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc index a69a91faaf8..6e0f573d73e 100644 --- a/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc @@ -71,6 +71,7 @@ #include #include #include +#include #include #include #include @@ -2293,6 +2294,23 @@ void CorrectZoneContaminants(EnergyPlusData &state, ZoneMassFlowRate += node.MassFlowRate / ZoneMult; } + if (state.dataHeatBal->Zone(ZoneNum).isSourceForParallelPIU) { + for (int iExhNode = 1; iExhNode <= state.dataZoneEquip->ZoneEquipConfig(ZoneNum).NumExhaustNodes; ++iExhNode) { + int piuNum = PoweredInductionUnits::getParallelPIUNumFromSecNodeNum( + state, state.dataZoneEquip->ZoneEquipConfig(ZoneNum).ExhaustNode(iExhNode)); + if (piuNum > 0) { + auto &thisPIU = state.dataPowerInductionUnits->PIU(piuNum); + if (state.dataContaminantBalance->Contaminant.CO2Simulation) { + CO2MassFlowRate += (thisPIU.leakMassFlowRate * state.dataLoopNodes->Node(thisPIU.PriAirInNode).CO2) / ZoneMult; + } + if (state.dataContaminantBalance->Contaminant.GenericContamSimulation) { + GCMassFlowRate += (thisPIU.leakMassFlowRate * state.dataLoopNodes->Node(thisPIU.PriAirInNode).GenContam) / ZoneMult; + } + ZoneMassFlowRate += thisPIU.leakMassFlowRate / ZoneMult; + } + } + } + Real64 timeStepSysSec = state.dataHVACGlobal->TimeStepSysSec; auto &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum); diff --git a/src/EnergyPlus/ZoneEquipmentManager.cc b/src/EnergyPlus/ZoneEquipmentManager.cc index 0b4b77580b5..d0581aa1bb4 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -4809,7 +4809,7 @@ void CalcZoneMassBalance(EnergyPlusData &state, bool const FirstHVACIteration) auto &airLoopFlow = state.dataAirLoop->AirLoopFlow(airDisUnit.AirLoopNum); airLoopFlow.SupFlow += airDisUnit.MassFlowRateSup; airLoopFlow.RecircFlow += airDisUnit.MassFlowRatePlenInd; - airLoopFlow.leakMassFlowRate += airDisUnit.MassFlowRateDnStrLk + airDisUnit.MassFlowRateUpStrLk; + airLoopFlow.leakMassFlowRate += airDisUnit.MassFlowRateDnStrLk + airDisUnit.MassFlowRateUpStrLk + airDisUnit.massFlowRateParallelPIULk; } } diff --git a/src/EnergyPlus/ZonePlenum.cc b/src/EnergyPlus/ZonePlenum.cc index 4debbeee80b..43349f95429 100644 --- a/src/EnergyPlus/ZonePlenum.cc +++ b/src/EnergyPlus/ZonePlenum.cc @@ -991,7 +991,8 @@ void CalcAirZoneReturnPlenum(EnergyPlusData &state, int const ZonePlenumNum) if (state.dataDefineEquipment->AirDistUnit(ADUNum).UpStreamLeak || state.dataDefineEquipment->AirDistUnit(ADUNum).DownStreamLeak) { state.dataZonePlenum->ZoneRetPlenCond(ZonePlenumNum).OutletMassFlowRate += state.dataDefineEquipment->AirDistUnit(ADUNum).MassFlowRateUpStrLk + - state.dataDefineEquipment->AirDistUnit(ADUNum).MassFlowRateDnStrLk; + state.dataDefineEquipment->AirDistUnit(ADUNum).MassFlowRateDnStrLk + + state.dataDefineEquipment->AirDistUnit(ADUNum).massFlowRateParallelPIULk; state.dataZonePlenum->ZoneRetPlenCond(ZonePlenumNum).OutletMassFlowRateMaxAvail += state.dataDefineEquipment->AirDistUnit(ADUNum).MaxAvailDelta; state.dataZonePlenum->ZoneRetPlenCond(ZonePlenumNum).OutletMassFlowRateMinAvail += diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index ad20f8b4766..33e23324270 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -87,6 +87,7 @@ #include #include #include +#include #include #include #include @@ -4376,6 +4377,18 @@ void ZoneSpaceHeatBalanceData::correctHumRat(EnergyPlusData &state, int const zo ZoneMassFlowRate += inletNode.MassFlowRate / ZoneMult; } + if (state.dataHeatBal->Zone(zoneNum).isSourceForParallelPIU) { + for (int iExhNode = 1; iExhNode <= state.dataZoneEquip->ZoneEquipConfig(zoneNum).NumExhaustNodes; ++iExhNode) { + int piuNum = + PoweredInductionUnits::getParallelPIUNumFromSecNodeNum(state, state.dataZoneEquip->ZoneEquipConfig(zoneNum).ExhaustNode(iExhNode)); + if (piuNum > 0) { + auto &thisPIU = state.dataPowerInductionUnits->PIU(piuNum); + MoistureMassFlowRate += (thisPIU.leakMassFlowRate * state.dataLoopNodes->Node(thisPIU.PriAirInNode).HumRat) / ZoneMult; + ZoneMassFlowRate += thisPIU.leakMassFlowRate / ZoneMult; + } + } + } + // Calculate hourly humidity ratio from infiltration + humidity added from latent load + system added moisture Real64 LatentGain = this->latentGain + state.dataHeatBalFanSys->SumLatentHTRadSys(zoneNum) + state.dataHeatBalFanSys->SumLatentPool(zoneNum); @@ -5104,6 +5117,18 @@ void ZoneSpaceHeatBalanceData::calcZoneOrSpaceSums(EnergyPlusData &state, MassFlowRate * CpAir * state.dataLoopNodes->Node(state.dataZonePlenum->ZoneSupPlenCond(thisZone.PlenumCondNum).InletNode).Temp; } + if (state.dataHeatBal->Zone(zoneNum).isSourceForParallelPIU) { + for (int iExhNode = 1; iExhNode <= state.dataZoneEquip->ZoneEquipConfig(zoneNum).NumExhaustNodes; ++iExhNode) { + int piuNum = PoweredInductionUnits::getParallelPIUNumFromSecNodeNum( + state, state.dataZoneEquip->ZoneEquipConfig(zoneNum).ExhaustNode(iExhNode)); + if (piuNum > 0) { + auto &thisPIU = state.dataPowerInductionUnits->PIU(piuNum); + this->SumSysMCp += thisPIU.leakMassFlowRate; + this->SumSysMCpT += thisPIU.leakMassFlowRate * state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp; + } + } + } + int ZoneMult = thisZone.Multiplier * thisZone.ListMultiplier; this->SumSysMCp /= ZoneMult; @@ -5381,6 +5406,19 @@ void CalcZoneComponentLoadSums(EnergyPlusData &state, thisAirRpt.SumMCpDTsystem += QSensRate; } + if (state.dataHeatBal->Zone(ZoneNum).isSourceForParallelPIU) { + for (int iExhNode = 1; iExhNode <= state.dataZoneEquip->ZoneEquipConfig(ZoneNum).NumExhaustNodes; ++iExhNode) { + int piuNum = + PoweredInductionUnits::getParallelPIUNumFromSecNodeNum(state, state.dataZoneEquip->ZoneEquipConfig(ZoneNum).ExhaustNode(iExhNode)); + if (piuNum > 0) { + auto &thisPIU = state.dataPowerInductionUnits->PIU(piuNum); + QSensRate = calcZoneSensibleOutput( + thisPIU.leakMassFlowRate, state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp, thisHB->MAT, thisHB->airHumRat); + thisAirRpt.SumMCpDTsystem += QSensRate; + } + } + } + // non air system response. thisAirRpt.SumNonAirSystem = thisHB->NonAirSystemResponse + state.dataHeatBalFanSys->SumConvHTRadSys(ZoneNum) + state.dataHeatBalFanSys->SumConvPool(ZoneNum); From 8645552ecadec3eedb5062f6c62b4adcccdf8041 Mon Sep 17 00:00:00 2001 From: lymereJ Date: Thu, 9 Oct 2025 14:07:54 -0700 Subject: [PATCH 11/30] Fix issues; Needs clean-up. --- src/EnergyPlus/DataDefineEquip.hh | 4 ++-- src/EnergyPlus/PoweredInductionUnits.cc | 23 ++++++++++--------- src/EnergyPlus/ZoneAirLoopEquipmentManager.cc | 23 +++++++++++++------ src/EnergyPlus/ZonePlenum.cc | 7 ++++-- src/EnergyPlus/ZoneTempPredictorCorrector.cc | 5 ++-- 5 files changed, 38 insertions(+), 24 deletions(-) diff --git a/src/EnergyPlus/DataDefineEquip.hh b/src/EnergyPlus/DataDefineEquip.hh index 82b3391246f..cf2cea4a8b3 100644 --- a/src/EnergyPlus/DataDefineEquip.hh +++ b/src/EnergyPlus/DataDefineEquip.hh @@ -106,12 +106,12 @@ namespace DataDefineEquip { int TermUnitSizingNum = 0; // index to TermUnitSizing and TermUnitFinalZoneSizing for this air distribution unit Real64 UpStreamLeakFrac = 0.0; // upstream nominal leakage fraction Real64 DownStreamLeakFrac = 0.0; // downstream constant leakage fraction - Real64 piuTerminalLeakMassFlowRate = 0.0; // PIU terminal leakage mass flow rate [kg/s] + Real64 parallelPIUTerminalLeakFrac = 0.0; // PIU terminal leakage mass flow rate [kg/s] Real64 MassFlowRateUpStrLk = 0.0; // current air mass flow rate of the upstream leak [kg/s] Real64 MassFlowRateDnStrLk = 0.0; // current air mass flow rate of the downstream leak [kg/s] Real64 MassFlowRateTU = 0.0; // current air mass flow rate through the terminal unit [kg/s] Real64 MassFlowRateZSup = 0.0; // current air mass flow rate of zone supply air [kg/s] - Real64 massFlowRateParallelPIULk; // current air mass flow rate of parallel piu leak [kg/s] + Real64 massFlowRateParallelPIULk = 0.0; // current air mass flow rate of parallel piu leak [kg/s] Real64 MassFlowRateSup = 0.0; // current air mass flow rate of supply air upstream of upstream leak [kg/s] Real64 MassFlowRatePlenInd = 0.0; // current air mass flow rate of induced air from plenum [kg/s] Real64 MaxAvailDelta = 0.0; // change in max avail mass low rate due to leaks [kg/s] diff --git a/src/EnergyPlus/PoweredInductionUnits.cc b/src/EnergyPlus/PoweredInductionUnits.cc index 6c284fe12fd..dc6ca3a5fcd 100644 --- a/src/EnergyPlus/PoweredInductionUnits.cc +++ b/src/EnergyPlus/PoweredInductionUnits.cc @@ -1875,7 +1875,7 @@ void CalcParallelPIU(EnergyPlusData &state, thisPIU.SecAirMassFlow = 0.0; state.dataHVACGlobal->TurnFansOn = false; thisPIU.heatingOperatingMode = HeatOpModeType::HeaterOff; - CalcBackdraftDamperLeakage(state, PIUNum); + // CalcBackdraftDamperLeakage(state, PIUNum); } } else if (QZnReq > SmallLoad) { // heating @@ -1908,11 +1908,16 @@ void CalcParallelPIU(EnergyPlusData &state, thisPIU.PriAirMassFlow = QZnReq / (CpAirZn * min(-SmallTempDiff, (state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp - state.dataLoopNodes->Node(ZoneNode).Temp))); + if (thisPIU.leakFracCurve > 0) { // PIU leakage calculations + const Real64 airflowFrac = thisPIU.PriAirMassFlow / thisPIU.MaxPriAirMassFlow; + thisPIU.leakFrac = min(1.0, Curve::CurveValue(state, thisPIU.leakFracCurve, airflowFrac)); + thisPIU.leakMassFlowRate = thisPIU.leakFrac * thisPIU.PriAirMassFlow; + thisPIU.PriAirMassFlow *= (1 + thisPIU.leakFrac); + } // check for fan on or off if ((thisPIU.PriAirMassFlow > thisPIU.FanOnAirMassFlow) && !ReheatRequired) { thisPIU.SecAirMassFlow = 0.0; // Fan is off unless reheat is required; no secondary air; also reset fan flag state.dataHVACGlobal->TurnFansOn = false; - CalcBackdraftDamperLeakage(state, PIUNum); } else { // fan is on; recalc primary air flow thisPIU.PriAirMassFlow = @@ -1922,7 +1927,7 @@ void CalcParallelPIU(EnergyPlusData &state, min(-SmallTempDiff, (state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp - state.dataLoopNodes->Node(ZoneNode).Temp))); thisPIU.SecAirMassFlow = thisPIU.MaxSecAirMassFlow; } - thisPIU.PriAirMassFlow = min(max(thisPIU.PriAirMassFlow, PriAirMassFlowMin), PriAirMassFlowMax); + thisPIU.PriAirMassFlow = min(thisPIU.PriAirMassFlow, PriAirMassFlowMax); if (QZnReq < 0) { if (thisPIU.fanControlType == FanCntrlType::VariableSpeedFan) { if (thisPIU.PriAirMassFlow == PriAirMassFlowMax) { @@ -1941,7 +1946,8 @@ void CalcParallelPIU(EnergyPlusData &state, thisPIU.SecAirMassFlow = 0.0; } // set inlet node flowrates - state.dataLoopNodes->Node(thisPIU.PriAirInNode).MassFlowRate = thisPIU.PriAirMassFlow; + state.dataLoopNodes->Node(thisPIU.PriAirInNode).MassFlowRate = + thisPIU.PriAirMassFlow; // This node will is one of the input to the mixer; flow should be reduced by leakage state.dataLoopNodes->Node(thisPIU.SecAirInNode).MassFlowRate = thisPIU.SecAirMassFlow; state.dataLoopNodes->Node(thisPIU.SecAirInNode).MassFlowRateMaxAvail = thisPIU.SecAirMassFlow; if (PriAirMassFlowMax == 0) { @@ -2503,19 +2509,14 @@ Real64 CalcVariableSpeedPIUCoolingResidual(EnergyPlusData &state, Real64 const c void CalcBackdraftDamperLeakage(EnergyPlusData &state, int piuNum) { auto &thisPIU = state.dataPowerInductionUnits->PIU(piuNum); - Real64 const CpAirZn = PsyCpAirFnW(state.dataLoopNodes->Node(thisPIU.PriAirInNode).HumRat); thisPIU.leakFrac = 0.0; thisPIU.leakMassFlowRate = 0.0; if (thisPIU.leakFracCurve > 0) { if (thisPIU.MaxPriAirMassFlow > 0) { Real64 airflowFrac = thisPIU.PriAirMassFlow / thisPIU.MaxPriAirMassFlow; - thisPIU.leakFrac = Curve::CurveValue(state, thisPIU.leakFracCurve, airflowFrac); - Real64 priAirEnthalpy = Psychrometrics::PsyHFnTdbW(state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp, - state.dataLoopNodes->Node(thisPIU.PriAirInNode).HumRat); - Real64 zoneEnthalpy = Psychrometrics::PsyHFnTdbW(state.dataLoopNodes->Node(thisPIU.SecAirInNode).Temp, - state.dataLoopNodes->Node(thisPIU.PriAirInNode).HumRat); + thisPIU.leakFrac = min(1.0, Curve::CurveValue(state, thisPIU.leakFracCurve, airflowFrac)); thisPIU.leakMassFlowRate = thisPIU.leakFrac * thisPIU.PriAirMassFlow; - thisPIU.PriAirMassFlow *= (1 + thisPIU.leakFrac); + // thisPIU.PriAirMassFlow *= (1 + thisPIU.leakFrac); } } } diff --git a/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc b/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc index c36d9b10070..5b53831c159 100644 --- a/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc +++ b/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc @@ -51,6 +51,7 @@ // EnergyPlus Headers #include #include +#include #include #include #include @@ -518,6 +519,7 @@ namespace ZoneAirLoopEquipmentManager { // every time step airDistUnit.MassFlowRateDnStrLk = 0.0; airDistUnit.MassFlowRateUpStrLk = 0.0; + airDistUnit.parallelPIUTerminalLeakFrac = 0.0; airDistUnit.massFlowRateParallelPIULk = 0.0; airDistUnit.MassFlowRateTU = 0.0; airDistUnit.MassFlowRateZSup = 0.0; @@ -576,8 +578,9 @@ namespace ZoneAirLoopEquipmentManager { MassFlowRateMaxAvail = 0.0; MassFlowRateMinAvail = 0.0; // check for no plenum - // set the max and min avail flow rates taking into acount the upstream leak - if (airDistUnit.UpStreamLeak) { + // set the max and min avail flow rates taking into account the upstream leak + if (airDistUnit.UpStreamLeak || airDistUnit.DownStreamLeak || + airDistUnit.EquipTypeEnum(AirDistCompNum) == DataDefineEquip::ZnAirLoopEquipType::SingleDuct_ParallelPIU_Reheat) { if (InNodeNum > 0) { MassFlowRateMaxAvail = state.dataLoopNodes->Node(InNodeNum).MassFlowRateMaxAvail; MassFlowRateMinAvail = state.dataLoopNodes->Node(InNodeNum).MassFlowRateMinAvail; @@ -686,7 +689,7 @@ namespace ZoneAirLoopEquipmentManager { airDistUnit.EquipIndex(AirDistCompNum)); } break; case DataDefineEquip::ZnAirLoopEquipType::SingleDuct_ParallelPIU_Reheat: { - airDistUnit.piuTerminalLeakMassFlowRate = 0.0; + airDistUnit.parallelPIUTerminalLeakFrac = 0.0; SimPIU(state, airDistUnit.EquipName(AirDistCompNum), FirstHVACIteration, @@ -695,7 +698,13 @@ namespace ZoneAirLoopEquipmentManager { airDistUnit.EquipIndex(AirDistCompNum)); int PIUNum = Util::FindItemInList(airDistUnit.EquipName(AirDistCompNum), state.dataPowerInductionUnits->PIU); if (PIUNum > 0) { - airDistUnit.piuTerminalLeakMassFlowRate = state.dataPowerInductionUnits->PIU(PIUNum).leakMassFlowRate; + if (auto &thisPIU = state.dataPowerInductionUnits->PIU(PIUNum); thisPIU.leakFracCurve > 0 && thisPIU.MaxPriAirMassFlow > 0 && + state.dataPowerInductionUnits->PIU(PIUNum).SecMassFlowRate == 0) { + const Real64 airflowFrac = thisPIU.PriAirMassFlow / thisPIU.MaxPriAirMassFlow; + thisPIU.leakFrac = min(1.0, Curve::CurveValue(state, thisPIU.leakFracCurve, airflowFrac)); + thisPIU.leakMassFlowRate = thisPIU.leakFrac * state.dataLoopNodes->Node(InNodeNum).MassFlowRate; + airDistUnit.parallelPIUTerminalLeakFrac = thisPIU.leakFrac; + } } } break; case DataDefineEquip::ZnAirLoopEquipType::SingleDuct_ConstVol_4PipeInduc: { @@ -752,13 +761,13 @@ namespace ZoneAirLoopEquipmentManager { state.dataLoopNodes->Node(InNodeNum).MassFlowRateMaxAvail = MassFlowRateMaxAvail; state.dataLoopNodes->Node(InNodeNum).MassFlowRateMinAvail = MassFlowRateMinAvail; } - if ((airDistUnit.UpStreamLeak || airDistUnit.DownStreamLeak || airDistUnit.piuTerminalLeakMassFlowRate) && + if ((airDistUnit.UpStreamLeak || airDistUnit.DownStreamLeak || airDistUnit.parallelPIUTerminalLeakFrac > 0.0) && MassFlowRateMaxAvail > 0.0) { airDistUnit.MassFlowRateTU = state.dataLoopNodes->Node(InNodeNum).MassFlowRate; airDistUnit.MassFlowRateZSup = - max(airDistUnit.MassFlowRateTU * (1.0 - airDistUnit.DownStreamLeakFrac) - airDistUnit.piuTerminalLeakMassFlowRate, 0.0); + max(airDistUnit.MassFlowRateTU * (1.0 - airDistUnit.DownStreamLeakFrac - airDistUnit.parallelPIUTerminalLeakFrac), 0.0); airDistUnit.MassFlowRateDnStrLk = airDistUnit.MassFlowRateTU * airDistUnit.DownStreamLeakFrac; - airDistUnit.massFlowRateParallelPIULk = airDistUnit.piuTerminalLeakMassFlowRate; + airDistUnit.massFlowRateParallelPIULk = airDistUnit.MassFlowRateTU * airDistUnit.parallelPIUTerminalLeakFrac; airDistUnit.MassFlowRateSup = airDistUnit.MassFlowRateTU + airDistUnit.MassFlowRateUpStrLk; state.dataLoopNodes->Node(InNodeNum).MassFlowRate = airDistUnit.MassFlowRateSup; state.dataLoopNodes->Node(OutNodeNum).MassFlowRate = airDistUnit.MassFlowRateZSup; diff --git a/src/EnergyPlus/ZonePlenum.cc b/src/EnergyPlus/ZonePlenum.cc index 332e99ae22a..779ec7546ec 100644 --- a/src/EnergyPlus/ZonePlenum.cc +++ b/src/EnergyPlus/ZonePlenum.cc @@ -990,11 +990,14 @@ void CalcAirZoneReturnPlenum(EnergyPlusData &state, int const ZonePlenumNum) // add in the leak flow rate, if any. Don't alter the pressure calc (it is not used anyway) for (ADUListIndex = 1; ADUListIndex <= state.dataZonePlenum->ZoneRetPlenCond(ZonePlenumNum).NumADUs; ++ADUListIndex) { int ADUNum = state.dataZonePlenum->ZoneRetPlenCond(ZonePlenumNum).ADUIndex(ADUListIndex); - if (state.dataDefineEquipment->AirDistUnit(ADUNum).UpStreamLeak || state.dataDefineEquipment->AirDistUnit(ADUNum).DownStreamLeak) { + if (state.dataDefineEquipment->AirDistUnit(ADUNum).UpStreamLeak || state.dataDefineEquipment->AirDistUnit(ADUNum).DownStreamLeak || + state.dataDefineEquipment->AirDistUnit(ADUNum).massFlowRateParallelPIULk > 0) { state.dataZonePlenum->ZoneRetPlenCond(ZonePlenumNum).OutletMassFlowRate += state.dataDefineEquipment->AirDistUnit(ADUNum).MassFlowRateUpStrLk + state.dataDefineEquipment->AirDistUnit(ADUNum).MassFlowRateDnStrLk + - state.dataDefineEquipment->AirDistUnit(ADUNum).massFlowRateParallelPIULk; + state.dataDefineEquipment->AirDistUnit(ADUNum) + .massFlowRateParallelPIULk; // Even though the PIU leakage flow rate doesn't necessarily go through the plenum, the same amount + // ends-up being returned state.dataZonePlenum->ZoneRetPlenCond(ZonePlenumNum).OutletMassFlowRateMaxAvail += state.dataDefineEquipment->AirDistUnit(ADUNum).MaxAvailDelta; state.dataZonePlenum->ZoneRetPlenCond(ZonePlenumNum).OutletMassFlowRateMinAvail += diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index 3154a9fd8cd..7edc0413f0a 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -5242,8 +5242,9 @@ void ZoneSpaceHeatBalanceData::calcZoneOrSpaceSums(EnergyPlusData &state, state, state.dataZoneEquip->ZoneEquipConfig(zoneNum).ExhaustNode(iExhNode)); if (piuNum > 0) { auto &thisPIU = state.dataPowerInductionUnits->PIU(piuNum); - this->SumSysMCp += thisPIU.leakMassFlowRate; - this->SumSysMCpT += thisPIU.leakMassFlowRate * state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp; + Real64 CpAir = Psychrometrics::PsyCpAirFnW(this->airHumRat); + this->SumSysMCp += thisPIU.leakMassFlowRate * CpAir; + this->SumSysMCpT += thisPIU.leakMassFlowRate * CpAir * state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp; } } } From e24a25631b9c5158b569bd20f9dea97b62968168 Mon Sep 17 00:00:00 2001 From: lymereJ Date: Thu, 9 Oct 2025 23:01:40 -0700 Subject: [PATCH 12/30] Clean-up and address outstanding issues. --- src/EnergyPlus/DataAirLoop.hh | 24 +++--- src/EnergyPlus/DataDefineEquip.hh | 2 +- src/EnergyPlus/PoweredInductionUnits.cc | 81 ++++++++++--------- src/EnergyPlus/PoweredInductionUnits.hh | 10 +-- src/EnergyPlus/RoomAirModelAirflowNetwork.cc | 4 +- src/EnergyPlus/ZoneAirLoopEquipmentManager.cc | 14 +--- .../ZoneContaminantPredictorCorrector.cc | 6 +- src/EnergyPlus/ZoneEquipmentManager.cc | 6 +- src/EnergyPlus/ZoneTempPredictorCorrector.cc | 12 +-- 9 files changed, 79 insertions(+), 80 deletions(-) diff --git a/src/EnergyPlus/DataAirLoop.hh b/src/EnergyPlus/DataAirLoop.hh index e578060f680..67589467ce0 100644 --- a/src/EnergyPlus/DataAirLoop.hh +++ b/src/EnergyPlus/DataAirLoop.hh @@ -169,18 +169,18 @@ namespace DataAirLoop { Real64 MaxOutAir = 0.0; // current maximum available outside air mass flow rate [kg/s] Real64 OAMinFrac = 0.0; // minimum outside air flow fraction this time step Real64 Previous = 0.0; // Previous mass air flow rate for this loop [kg/s] - Real64 SupFlow = 0.0; // supply air flow rate (includes leakMassFlowRate) [kg/s] - Real64 ZoneRetFlow = 0.0; // return air flow rate at all zone return air nodes (includes RecircFlow, excludes leakMassFlowRate) [kg/s] - Real64 ZoneRetFlowRatio = 1.0; // ratio for adjusting zone return flows for excess zone exhaust - Real64 SysRetFlow = 0.0; // return air flow rate back to central return (excludes RecircFlow, includes leakMassFlowRate) [kg/s] - Real64 RecircFlow = 0.0; // sum of zone plenum recirculated flows [kg/s] - Real64 leakMassFlowRate = 0.0; // sum of air distribution leak flows to return plenum [kg/s] - Real64 ExcessZoneExhFlow = 0.0; // excess zone exhuast flows made up by reduced return flow in other zones on same airloop [kg/s] - Real64 FanPLR = 1.0; // Operating PLR of air loop fan - Real64 OAFrac = 0.0; // fraction of outside air to mixed air mass flow rate - Real64 OAFlow = 0.0; // oa flow rate this time step [kg/s] - bool FlowError = false; // error flag for flow error message - Real64 BypassMassFlow = 0.0; // air loop bypass mass flow NOT entering splitter but included in mixer or plenum + Real64 SupFlow = 0.0; // supply air flow rate (includes LeakFlow) [kg/s] + Real64 ZoneRetFlow = 0.0; // return air flow rate at all zone return air nodes (includes RecircFlow, excludes LeakFlow) [kg/s] + Real64 ZoneRetFlowRatio = 1.0; // ratio for adjusting zone return flows for excess zone exhaust + Real64 SysRetFlow = 0.0; // return air flow rate back to central return (excludes RecircFlow, includes LeakFlow) [kg/s] + Real64 RecircFlow = 0.0; // sum of zone plenum recirculated flows [kg/s] + Real64 LeakFlow = 0.0; // sum of air distribution leak flows to return plenum [kg/s] + Real64 ExcessZoneExhFlow = 0.0; // excess zone exhuast flows made up by reduced return flow in other zones on same airloop [kg/s] + Real64 FanPLR = 1.0; // Operating PLR of air loop fan + Real64 OAFrac = 0.0; // fraction of outside air to mixed air mass flow rate + Real64 OAFlow = 0.0; // oa flow rate this time step [kg/s] + bool FlowError = false; // error flag for flow error message + Real64 BypassMassFlow = 0.0; // air loop bypass mass flow NOT entering splitter but included in mixer or plenum }; enum class ControllerKind diff --git a/src/EnergyPlus/DataDefineEquip.hh b/src/EnergyPlus/DataDefineEquip.hh index cf2cea4a8b3..d7953deeaba 100644 --- a/src/EnergyPlus/DataDefineEquip.hh +++ b/src/EnergyPlus/DataDefineEquip.hh @@ -106,7 +106,7 @@ namespace DataDefineEquip { int TermUnitSizingNum = 0; // index to TermUnitSizing and TermUnitFinalZoneSizing for this air distribution unit Real64 UpStreamLeakFrac = 0.0; // upstream nominal leakage fraction Real64 DownStreamLeakFrac = 0.0; // downstream constant leakage fraction - Real64 parallelPIUTerminalLeakFrac = 0.0; // PIU terminal leakage mass flow rate [kg/s] + Real64 parallelPIUTerminalLeakFrac = 0.0; // PIU terminal leakage fraction Real64 MassFlowRateUpStrLk = 0.0; // current air mass flow rate of the upstream leak [kg/s] Real64 MassFlowRateDnStrLk = 0.0; // current air mass flow rate of the downstream leak [kg/s] Real64 MassFlowRateTU = 0.0; // current air mass flow rate through the terminal unit [kg/s] diff --git a/src/EnergyPlus/PoweredInductionUnits.cc b/src/EnergyPlus/PoweredInductionUnits.cc index dc6ca3a5fcd..b02423e311c 100644 --- a/src/EnergyPlus/PoweredInductionUnits.cc +++ b/src/EnergyPlus/PoweredInductionUnits.cc @@ -72,7 +72,6 @@ #include #include #include -#include #include #include #include @@ -550,10 +549,16 @@ void GetPIUs(EnergyPlusData &state) // Get damper leakage inputs if (cCurrentModuleObject == "AirTerminal:SingleDuct:ParallelPIU:Reheat") { - thisPIU.leakFracCurve = Curve::GetCurveIndex( - state, ip->getAlphaFieldValue(fields, objectSchemaProps, "backdraft_damper_leakage_fraction_curve_name")); - - if (thisPIU.leakFracCurve > 0) { + std::string damperLeakageFractionCurveName = + ip->getAlphaFieldValue(fields, objectSchemaProps, "backdraft_damper_leakage_fraction_curve_name"); + thisPIU.leakFracCurve = Curve::GetCurveIndex(state, damperLeakageFractionCurveName); + + if (!damperLeakageFractionCurveName.empty() && thisPIU.leakFracCurve == 0) { + ShowSevereError(state, + format("The air leakage fraction curve for the {} {} is missing. No air leakage will be modeled.", + cCurrentModuleObject, + thisPIU.Name)); + } else if (thisPIU.leakFracCurve > 0) { // Find the secondary zone or plenum index // The secondary air inlet node should either be a zone exhaust air node... for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { @@ -664,13 +669,15 @@ void GetPIUs(EnergyPlusData &state) OutputProcessor::TimeStepType::System, OutputProcessor::StoreType::Average, state.dataPowerInductionUnits->PIU(PIURpt).Name); - SetupOutputVariable(state, - "Zone Air Terminal Backdraft Damper Leakage Mass Flow Rate", - Constant::Units::kg_s, - thisPIU.leakMassFlowRate, - OutputProcessor::TimeStepType::System, - OutputProcessor::StoreType::Average, - state.dataPowerInductionUnits->PIU(PIURpt).Name); + if (thisPIU.UnitType == "AirTerminal:SingleDuct:ParallelPIU:Reheat") { + SetupOutputVariable(state, + "Zone Air Terminal Backdraft Damper Leakage Mass Flow Rate", + Constant::Units::kg_s, + thisPIU.leakFlow, + OutputProcessor::TimeStepType::System, + OutputProcessor::StoreType::Average, + state.dataPowerInductionUnits->PIU(PIURpt).Name); + } } } @@ -1793,7 +1800,8 @@ void CalcParallelPIU(EnergyPlusData &state, // initialize local variables auto &thisPIU = state.dataPowerInductionUnits->PIU(PIUNum); - thisPIU.leakMassFlowRate = 0.0; + thisPIU.leakFlow = 0.0; + thisPIU.leakFrac = 0.0; Real64 const PriAirMassFlowMax = state.dataLoopNodes->Node(thisPIU.PriAirInNode).MassFlowRateMaxAvail; // max primary air mass flow rate [kg/s] Real64 const PriAirMassFlowMin = state.dataLoopNodes->Node(thisPIU.PriAirInNode).MassFlowRateMinAvail; // min primary air mass flow rate [kg/s] thisPIU.PriAirMassFlow = state.dataLoopNodes->Node(thisPIU.PriAirInNode).MassFlowRate; // primary air mass flow rate [kg/s] @@ -1875,7 +1883,14 @@ void CalcParallelPIU(EnergyPlusData &state, thisPIU.SecAirMassFlow = 0.0; state.dataHVACGlobal->TurnFansOn = false; thisPIU.heatingOperatingMode = HeatOpModeType::HeaterOff; - // CalcBackdraftDamperLeakage(state, PIUNum); + } + // PIU leakage calculations + if (thisPIU.leakFracCurve > 0 && state.dataHVACGlobal->TurnFansOn == false) { + // Determine leakage fraction as a function of the primary airflow fraction + const Real64 airflowFrac = thisPIU.PriAirMassFlow / thisPIU.MaxPriAirMassFlow; + thisPIU.leakFrac = min(1.0, Curve::CurveValue(state, thisPIU.leakFracCurve, airflowFrac)); + // Determine leakage rate that won't make it to the zone served by the terminal + thisPIU.leakFlow = thisPIU.leakFrac * thisPIU.PriAirMassFlow; } } else if (QZnReq > SmallLoad) { // heating @@ -1908,12 +1923,6 @@ void CalcParallelPIU(EnergyPlusData &state, thisPIU.PriAirMassFlow = QZnReq / (CpAirZn * min(-SmallTempDiff, (state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp - state.dataLoopNodes->Node(ZoneNode).Temp))); - if (thisPIU.leakFracCurve > 0) { // PIU leakage calculations - const Real64 airflowFrac = thisPIU.PriAirMassFlow / thisPIU.MaxPriAirMassFlow; - thisPIU.leakFrac = min(1.0, Curve::CurveValue(state, thisPIU.leakFracCurve, airflowFrac)); - thisPIU.leakMassFlowRate = thisPIU.leakFrac * thisPIU.PriAirMassFlow; - thisPIU.PriAirMassFlow *= (1 + thisPIU.leakFrac); - } // check for fan on or off if ((thisPIU.PriAirMassFlow > thisPIU.FanOnAirMassFlow) && !ReheatRequired) { thisPIU.SecAirMassFlow = 0.0; // Fan is off unless reheat is required; no secondary air; also reset fan flag @@ -1927,6 +1936,20 @@ void CalcParallelPIU(EnergyPlusData &state, min(-SmallTempDiff, (state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp - state.dataLoopNodes->Node(ZoneNode).Temp))); thisPIU.SecAirMassFlow = thisPIU.MaxSecAirMassFlow; } + // Cap at maximum primary airflow rate + thisPIU.PriAirMassFlow = max(min(thisPIU.PriAirMassFlow, PriAirMassFlowMax), PriAirMassFlowMin); + // PIU leakage calculations + if (thisPIU.leakFracCurve > 0 && state.dataHVACGlobal->TurnFansOn == false) { + // Determine leakage fraction as a function of the primary airflow fraction + const Real64 airflowFrac = thisPIU.PriAirMassFlow / thisPIU.MaxPriAirMassFlow; + thisPIU.leakFrac = min(1.0, Curve::CurveValue(state, thisPIU.leakFracCurve, airflowFrac)); + // Determine leakage rate that won't make it to the zone served by the terminal + thisPIU.leakFlow = thisPIU.leakFrac * thisPIU.PriAirMassFlow; + // Increase the primary flow rate to meet the cooling load with leakage + thisPIU.PriAirMassFlow *= 1 / (1 - thisPIU.leakFrac); //(1 + thisPIU.leakFrac); + } + // Make sure that the primary airflow doesn't exceed the maximum when leakage is modeled + // When the primary airflow is limited to the maximum, the load won't likely be met thisPIU.PriAirMassFlow = min(thisPIU.PriAirMassFlow, PriAirMassFlowMax); if (QZnReq < 0) { if (thisPIU.fanControlType == FanCntrlType::VariableSpeedFan) { @@ -1946,8 +1969,7 @@ void CalcParallelPIU(EnergyPlusData &state, thisPIU.SecAirMassFlow = 0.0; } // set inlet node flowrates - state.dataLoopNodes->Node(thisPIU.PriAirInNode).MassFlowRate = - thisPIU.PriAirMassFlow; // This node will is one of the input to the mixer; flow should be reduced by leakage + state.dataLoopNodes->Node(thisPIU.PriAirInNode).MassFlowRate = thisPIU.PriAirMassFlow; state.dataLoopNodes->Node(thisPIU.SecAirInNode).MassFlowRate = thisPIU.SecAirMassFlow; state.dataLoopNodes->Node(thisPIU.SecAirInNode).MassFlowRateMaxAvail = thisPIU.SecAirMassFlow; if (PriAirMassFlowMax == 0) { @@ -2506,21 +2528,6 @@ Real64 CalcVariableSpeedPIUCoolingResidual(EnergyPlusData &state, Real64 const c return Residuum; } -void CalcBackdraftDamperLeakage(EnergyPlusData &state, int piuNum) -{ - auto &thisPIU = state.dataPowerInductionUnits->PIU(piuNum); - thisPIU.leakFrac = 0.0; - thisPIU.leakMassFlowRate = 0.0; - if (thisPIU.leakFracCurve > 0) { - if (thisPIU.MaxPriAirMassFlow > 0) { - Real64 airflowFrac = thisPIU.PriAirMassFlow / thisPIU.MaxPriAirMassFlow; - thisPIU.leakFrac = min(1.0, Curve::CurveValue(state, thisPIU.leakFracCurve, airflowFrac)); - thisPIU.leakMassFlowRate = thisPIU.leakFrac * thisPIU.PriAirMassFlow; - // thisPIU.PriAirMassFlow *= (1 + thisPIU.leakFrac); - } - } -} - void ReportPIU(EnergyPlusData &state, int const PIUNum) // number of the current fan coil unit being simulated { diff --git a/src/EnergyPlus/PoweredInductionUnits.hh b/src/EnergyPlus/PoweredInductionUnits.hh index 9a285181055..53ae19ca660 100644 --- a/src/EnergyPlus/PoweredInductionUnits.hh +++ b/src/EnergyPlus/PoweredInductionUnits.hh @@ -202,9 +202,9 @@ namespace PoweredInductionUnits { Real64 DischargeAirTemp = 0.0; // current operating discharge air temperature at outlet, for reporting HeatOpModeType heatingOperatingMode = HeatOpModeType::HeaterOff; CoolOpModeType coolingOperatingMode = CoolOpModeType::CoolerOff; - Real64 leakFrac = 0.0; // parallel PIU backdraft damper leakage fraction - Real64 leakMassFlowRate = 0.0; // parallel PIU backdraft damper leakage mass flow rate - int leakFracCurve = 0.0; // parallel PIU backdraft damper leakage fraction curve + Real64 leakFrac = 0.0; // parallel PIU backdraft damper leakage fraction + Real64 leakFlow = 0.0; // parallel PIU backdraft damper leakage mass flow rate + int leakFracCurve = 0.0; // parallel PIU backdraft damper leakage fraction curve int CurOperationControlStage = -1; // integer reference for what stage of control the unit is in int plenumIndex = 0; @@ -218,7 +218,7 @@ namespace PoweredInductionUnits { MaxHotWaterFlow(0.0), MaxHotSteamFlow(0.0), MinVolHotWaterFlow(0.0), MinHotSteamFlow(0.0), MinVolHotSteamFlow(0.0), MinHotWaterFlow(0.0), HotControlNode(0), HotCoilOutNodeNum(0), HotControlOffset(0.0), HWplantLoc{}, ADUNum(0), InducesPlenumAir(false), HeatingRate(0.0), HeatingEnergy(0.0), SensCoolRate(0.0), SensCoolEnergy(0.0), CtrlZoneNum(0), ctrlZoneInNodeIndex(0), AirLoopNum(0), - OutdoorAirFlowRate(0.0), leakFrac(0.0), leakMassFlowRate(0.0), leakFracCurve(0) + OutdoorAirFlowRate(0.0), leakFrac(0.0), leakFlow(0.0), leakFracCurve(0) { } @@ -297,8 +297,6 @@ namespace PoweredInductionUnits { Real64 CalcVariableSpeedPIUCoolingResidual( EnergyPlusData &state, Real64 const coolSignal, int const piuNum, Real64 const targetQznReq, int const zoneNodeNum); - void CalcBackdraftDamperLeakage(EnergyPlusData &state, int const piuNum); - void CalcVariableSpeedPIUCoolingBehavior(EnergyPlusData &state, int const PIUNum, int const zoneNode, diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc index 2c3435cb335..f35c7b1e329 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc @@ -805,8 +805,8 @@ namespace RoomAir { state, state.dataZoneEquip->ZoneEquipConfig(zoneNum).ExhaustNode(iExhNode)); if (piuNum > 0) { auto &thisPIU = state.dataPowerInductionUnits->PIU(piuNum); - SumSysMCp += thisPIU.leakMassFlowRate * CpAir; - SumSysMCpT += thisPIU.leakMassFlowRate * CpAir * state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp; + SumSysMCp += thisPIU.leakFlow * CpAir; + SumSysMCpT += thisPIU.leakFlow * CpAir * state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp; } } } diff --git a/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc b/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc index 5b53831c159..8d2cb287554 100644 --- a/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc +++ b/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc @@ -577,6 +577,7 @@ namespace ZoneAirLoopEquipmentManager { int OutNodeNum = airDistUnit.OutletNodeNum; MassFlowRateMaxAvail = 0.0; MassFlowRateMinAvail = 0.0; + airDistUnit.parallelPIUTerminalLeakFrac = 0.0; // check for no plenum // set the max and min avail flow rates taking into account the upstream leak if (airDistUnit.UpStreamLeak || airDistUnit.DownStreamLeak || @@ -689,22 +690,15 @@ namespace ZoneAirLoopEquipmentManager { airDistUnit.EquipIndex(AirDistCompNum)); } break; case DataDefineEquip::ZnAirLoopEquipType::SingleDuct_ParallelPIU_Reheat: { - airDistUnit.parallelPIUTerminalLeakFrac = 0.0; SimPIU(state, airDistUnit.EquipName(AirDistCompNum), FirstHVACIteration, ControlledZoneNum, controlledZoneAirNode, airDistUnit.EquipIndex(AirDistCompNum)); - int PIUNum = Util::FindItemInList(airDistUnit.EquipName(AirDistCompNum), state.dataPowerInductionUnits->PIU); - if (PIUNum > 0) { - if (auto &thisPIU = state.dataPowerInductionUnits->PIU(PIUNum); thisPIU.leakFracCurve > 0 && thisPIU.MaxPriAirMassFlow > 0 && - state.dataPowerInductionUnits->PIU(PIUNum).SecMassFlowRate == 0) { - const Real64 airflowFrac = thisPIU.PriAirMassFlow / thisPIU.MaxPriAirMassFlow; - thisPIU.leakFrac = min(1.0, Curve::CurveValue(state, thisPIU.leakFracCurve, airflowFrac)); - thisPIU.leakMassFlowRate = thisPIU.leakFrac * state.dataLoopNodes->Node(InNodeNum).MassFlowRate; - airDistUnit.parallelPIUTerminalLeakFrac = thisPIU.leakFrac; - } + // Retrieve previously calculated PIU terminal leakage through backdraft damper + if (const int PIUNum = Util::FindItemInList(airDistUnit.EquipName(AirDistCompNum), state.dataPowerInductionUnits->PIU); PIUNum > 0) { + airDistUnit.parallelPIUTerminalLeakFrac = state.dataPowerInductionUnits->PIU(PIUNum).leakFrac; } } break; case DataDefineEquip::ZnAirLoopEquipType::SingleDuct_ConstVol_4PipeInduc: { diff --git a/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc b/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc index 0c6ae014bd9..b740b908571 100644 --- a/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc @@ -2327,12 +2327,12 @@ void CorrectZoneContaminants(EnergyPlusData &state, if (piuNum > 0) { auto &thisPIU = state.dataPowerInductionUnits->PIU(piuNum); if (state.dataContaminantBalance->Contaminant.CO2Simulation) { - CO2MassFlowRate += (thisPIU.leakMassFlowRate * state.dataLoopNodes->Node(thisPIU.PriAirInNode).CO2) / ZoneMult; + CO2MassFlowRate += (thisPIU.leakFlow * state.dataLoopNodes->Node(thisPIU.PriAirInNode).CO2) / ZoneMult; } if (state.dataContaminantBalance->Contaminant.GenericContamSimulation) { - GCMassFlowRate += (thisPIU.leakMassFlowRate * state.dataLoopNodes->Node(thisPIU.PriAirInNode).GenContam) / ZoneMult; + GCMassFlowRate += (thisPIU.leakFlow * state.dataLoopNodes->Node(thisPIU.PriAirInNode).GenContam) / ZoneMult; } - ZoneMassFlowRate += thisPIU.leakMassFlowRate / ZoneMult; + ZoneMassFlowRate += thisPIU.leakFlow / ZoneMult; } } } diff --git a/src/EnergyPlus/ZoneEquipmentManager.cc b/src/EnergyPlus/ZoneEquipmentManager.cc index 2d21c00f497..2928ab2b63c 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -310,7 +310,7 @@ void InitZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration) // airLoopFlow.ZoneRetFlow = 0.0; airLoopFlow.SysRetFlow = 0.0; airLoopFlow.RecircFlow = 0.0; - airLoopFlow.leakMassFlowRate = 0.0; + airLoopFlow.LeakFlow = 0.0; airLoopFlow.ExcessZoneExhFlow = 0.0; } } @@ -4952,7 +4952,7 @@ void CalcZoneMassBalance(EnergyPlusData &state, bool const FirstHVACIteration) auto &airLoopFlow = state.dataAirLoop->AirLoopFlow(airDisUnit.AirLoopNum); airLoopFlow.SupFlow += airDisUnit.MassFlowRateSup; airLoopFlow.RecircFlow += airDisUnit.MassFlowRatePlenInd; - airLoopFlow.leakMassFlowRate += airDisUnit.MassFlowRateDnStrLk + airDisUnit.MassFlowRateUpStrLk + airDisUnit.massFlowRateParallelPIULk; + airLoopFlow.LeakFlow += airDisUnit.MassFlowRateDnStrLk + airDisUnit.MassFlowRateUpStrLk + airDisUnit.massFlowRateParallelPIULk; } } @@ -5267,7 +5267,7 @@ void CalcZoneMassBalance(EnergyPlusData &state, bool const FirstHVACIteration) // Set system return flows for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) { auto &thisAirLoopFlow(state.dataAirLoop->AirLoopFlow(AirLoopNum)); - thisAirLoopFlow.SysRetFlow = thisAirLoopFlow.ZoneRetFlow - thisAirLoopFlow.RecircFlow + thisAirLoopFlow.leakMassFlowRate; + thisAirLoopFlow.SysRetFlow = thisAirLoopFlow.ZoneRetFlow - thisAirLoopFlow.RecircFlow + thisAirLoopFlow.LeakFlow; } } diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index 7edc0413f0a..1f288ff8522 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -4490,8 +4490,8 @@ void ZoneSpaceHeatBalanceData::correctHumRat(EnergyPlusData &state, int const zo PoweredInductionUnits::getParallelPIUNumFromSecNodeNum(state, state.dataZoneEquip->ZoneEquipConfig(zoneNum).ExhaustNode(iExhNode)); if (piuNum > 0) { auto &thisPIU = state.dataPowerInductionUnits->PIU(piuNum); - MoistureMassFlowRate += (thisPIU.leakMassFlowRate * state.dataLoopNodes->Node(thisPIU.PriAirInNode).HumRat) / ZoneMult; - ZoneMassFlowRate += thisPIU.leakMassFlowRate / ZoneMult; + MoistureMassFlowRate += (thisPIU.leakFlow * state.dataLoopNodes->Node(thisPIU.PriAirInNode).HumRat) / ZoneMult; + ZoneMassFlowRate += thisPIU.leakFlow / ZoneMult; } } } @@ -5243,8 +5243,8 @@ void ZoneSpaceHeatBalanceData::calcZoneOrSpaceSums(EnergyPlusData &state, if (piuNum > 0) { auto &thisPIU = state.dataPowerInductionUnits->PIU(piuNum); Real64 CpAir = Psychrometrics::PsyCpAirFnW(this->airHumRat); - this->SumSysMCp += thisPIU.leakMassFlowRate * CpAir; - this->SumSysMCpT += thisPIU.leakMassFlowRate * CpAir * state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp; + this->SumSysMCp += thisPIU.leakFlow * CpAir; + this->SumSysMCpT += thisPIU.leakFlow * CpAir * state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp; } } } @@ -5535,8 +5535,8 @@ void CalcZoneComponentLoadSums(EnergyPlusData &state, PoweredInductionUnits::getParallelPIUNumFromSecNodeNum(state, state.dataZoneEquip->ZoneEquipConfig(ZoneNum).ExhaustNode(iExhNode)); if (piuNum > 0) { auto &thisPIU = state.dataPowerInductionUnits->PIU(piuNum); - QSensRate = calcZoneSensibleOutput( - thisPIU.leakMassFlowRate, state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp, thisHB->MAT, thisHB->airHumRat); + QSensRate = + calcZoneSensibleOutput(thisPIU.leakFlow, state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp, thisHB->MAT, thisHB->airHumRat); thisAirRpt.SumMCpDTsystem += QSensRate; } } From 5e41a523b51620c5ba55cb2ee7b6a231844a2136 Mon Sep 17 00:00:00 2001 From: lymereJ Date: Fri, 10 Oct 2025 11:04:42 -0700 Subject: [PATCH 13/30] Add unit tests. --- .../unit/PoweredInductionUnits.unit.cc | 37 +++++++++++++++++-- .../unit/ZoneTempPredictorCorrector.unit.cc | 17 ++++++++- 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/tst/EnergyPlus/unit/PoweredInductionUnits.unit.cc b/tst/EnergyPlus/unit/PoweredInductionUnits.unit.cc index 9c83238ddba..3b47d7e3b13 100644 --- a/tst/EnergyPlus/unit/PoweredInductionUnits.unit.cc +++ b/tst/EnergyPlus/unit/PoweredInductionUnits.unit.cc @@ -55,12 +55,12 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" #include +#include #include #include #include #include #include -#include #include #include #include @@ -166,6 +166,13 @@ TEST_F(EnergyPlusFixture, ParallelPIUTest1) " , !- Schedule Type Limits Name", " 1; !- Hourly Value", + "Curve:Linear,", + " constant_leakage, !- Name", + " 0.1, !- Coefficient1 Constant", + " 0, !- Coefficient2 x", + " 0, !- Minimum Value of x", + " 1; !- Maximum Value of x", + }); ASSERT_TRUE(process_idf(idf_objects)); @@ -311,6 +318,31 @@ TEST_F(EnergyPlusFixture, ParallelPIUTest1) EXPECT_EQ(SecMaxMassFlow, state->dataLoopNodes->Node(SecNodeNum).MassFlowRate); EXPECT_EQ(1.0, state->dataPowerInductionUnits->PIU(SysNum).PriDamperPosition); + // Nineth test - Cooling load TurnFansOn is false, yes primary flow - expecting secondary flow, leakage + state->dataLoopNodes->Node(PriNodeNum).MassFlowRate = state->dataPowerInductionUnits->PIU(SysNum).MaxPriAirMassFlow; + state->dataLoopNodes->Node(PriNodeNum).MassFlowRateMaxAvail = state->dataPowerInductionUnits->PIU(SysNum).MaxPriAirMassFlow; + state->dataLoopNodes->Node(PriNodeNum).MassFlowRateMinAvail = state->dataPowerInductionUnits->PIU(SysNum).MinPriAirMassFlow; + state->dataZoneEnergyDemand->ZoneSysEnergyDemand(1).RemainingOutputRequired = -2000.0; // Cooling load + state->dataZoneEnergyDemand->ZoneSysEnergyDemand(1).RemainingOutputReqToHeatSP = -2000.0; + state->dataZoneEnergyDemand->CurDeadBandOrSetback(1) = false; + state->dataHVACGlobal->TurnFansOn = false; + state->dataPowerInductionUnits->PIU(SysNum).leakFracCurve = Curve::GetCurveIndex(*state, "CONSTANT_LEAKAGE"); + PoweredInductionUnits::CalcParallelPIU(*state, SysNum, ZoneNum, ZoneNodeNum, FirstHVACIteration); + + Real64 SysOutputProvided = 0.0; + Real64 NonAirSysOutput = 0.0; + Real64 LatOutputProvided = 0.0; + int AirDistUnitNum = 1; + state->dataPowerInductionUnits->GetPIUInputFlag = false; + ZoneAirLoopEquipmentManager::SimZoneAirLoopEquipment(*state, + AirDistUnitNum, + SysOutputProvided, + NonAirSysOutput, + LatOutputProvided, + FirstHVACIteration, + state->dataPowerInductionUnits->PIU(SysNum).CtrlZoneNum); + EXPECT_TRUE(state->dataDefineEquipment->AirDistUnit(1).MassFlowRateTU > state->dataDefineEquipment->AirDistUnit(1).MassFlowRateZSup); + // Cleanup state->dataHeatBalFanSys->TempControlType.deallocate(); state->dataZoneEnergyDemand->ZoneSysEnergyDemand.deallocate(); @@ -3016,7 +3048,6 @@ TEST_F(EnergyPlusFixture, VSSeriesPIUCool) int SysNum = 1; int ZoneNodeNum = 1; bool FirstHVACIteration = true; - // Real64 SecMaxMassFlow = 0.05 * state->dataEnvrn->StdRhoAir; state->dataGlobal->BeginEnvrnFlag = true; // Must be true for initial pass thru InitPIU for this terminal unit FirstHVACIteration = true; PoweredInductionUnits::InitPIU(*state, SysNum, FirstHVACIteration); // Run thru init once with FirstHVACIteration set to true @@ -3031,7 +3062,7 @@ TEST_F(EnergyPlusFixture, VSSeriesPIUCool) Real64 PriMinMassFlow = thisPIU.MinPriAirMassFlow; // first stage cooling, expects: - // - total flow rate: modulating between minimum and maxium value + // - total flow rate: modulating between minimum and maximum value state->dataLoopNodes->Node(PriNodeNum).MassFlowRate = PriMinMassFlow; state->dataZoneEnergyDemand->ZoneSysEnergyDemand(ZoneNodeNum).RemainingOutputRequired = -400.0; state->dataZoneEnergyDemand->ZoneSysEnergyDemand(ZoneNodeNum).RemainingOutputReqToCoolSP = -400.0; diff --git a/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc b/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc index 19cdb2b1b80..f12e95d9900 100644 --- a/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc +++ b/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc @@ -71,6 +71,7 @@ #include #include #include +#include #include #include #include @@ -980,7 +981,7 @@ TEST_F(EnergyPlusFixture, ZoneTempPredictorCorrector_calcZoneOrSpaceSums_SurfCon state->dataHeatBal->space(1).HTSurfaceLast = 3; state->dataSurface->Surface.allocate(3); state->dataHeatBalSurf->SurfHConvInt.allocate(3); - state->dataLoopNodes->Node.allocate(4); + state->dataLoopNodes->Node.allocate(5); state->dataHeatBal->SurfTempEffBulkAir.allocate(3); state->dataHeatBalSurf->SurfTempInTmp.allocate(3); @@ -1040,6 +1041,20 @@ TEST_F(EnergyPlusFixture, ZoneTempPredictorCorrector_calcZoneOrSpaceSums_SurfCon thisZoneHB.calcZoneOrSpaceSums(*state, false, ZoneNum); EXPECT_EQ(0.0, thisZoneHB.SumSysMCp); EXPECT_EQ(0.0, thisZoneHB.SumSysMCpT); + + // Check that parallel PIU leakage is accounted for + state->dataHeatBal->Zone(1).isSourceForParallelPIU = true; + state->dataPowerInductionUnits->GetPIUInputFlag = false; + state->dataPowerInductionUnits->NumPIUs = 1; + state->dataPowerInductionUnits->PIU.allocate(1); + state->dataPowerInductionUnits->PIU(1).SecAirInNode = 3; // exhaust node + state->dataPowerInductionUnits->PIU(1).PriAirInNode = 5; // primary air node + state->dataPowerInductionUnits->PIU(1).leakFlow = 0.1; + state->dataLoopNodes->Node(5).HumRat = 0.008; + state->dataLoopNodes->Node(5).Temp = 12.8; + thisZoneHB.calcZoneOrSpaceSums(*state, true, ZoneNum); + EXPECT_NEAR(402.67958, thisZoneHB.SumSysMCp, 0.0001); + EXPECT_NEAR(7328.768356, thisZoneHB.SumSysMCpT, 0.0001); } TEST_F(EnergyPlusFixture, ZoneTempPredictorCorrector_EMSOverrideSetpointTest) From 4254b29c856ee3ae18c18668f736b6bfb16cb235 Mon Sep 17 00:00:00 2001 From: lymereJ Date: Fri, 10 Oct 2025 11:06:15 -0700 Subject: [PATCH 14/30] Revert change fixed in another branch. --- src/EnergyPlus/ZoneAirLoopEquipmentManager.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc b/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc index 8d2cb287554..7abdbf6f6b0 100644 --- a/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc +++ b/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc @@ -579,8 +579,8 @@ namespace ZoneAirLoopEquipmentManager { MassFlowRateMinAvail = 0.0; airDistUnit.parallelPIUTerminalLeakFrac = 0.0; // check for no plenum - // set the max and min avail flow rates taking into account the upstream leak - if (airDistUnit.UpStreamLeak || airDistUnit.DownStreamLeak || + // set the max and min avail flow rates taking into acount the upstream leak + if (airDistUnit.UpStreamLeak || airDistUnit.EquipTypeEnum(AirDistCompNum) == DataDefineEquip::ZnAirLoopEquipType::SingleDuct_ParallelPIU_Reheat) { if (InNodeNum > 0) { MassFlowRateMaxAvail = state.dataLoopNodes->Node(InNodeNum).MassFlowRateMaxAvail; From e3d53279bcd99755c63e7f827b725b5f965ae2d8 Mon Sep 17 00:00:00 2001 From: lymereJ Date: Fri, 10 Oct 2025 11:22:15 -0700 Subject: [PATCH 15/30] Merge missed this file. --- src/Transition/CreateNewIDFUsingRulesv25_2_0.f90 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Transition/CreateNewIDFUsingRulesv25_2_0.f90 b/src/Transition/CreateNewIDFUsingRulesv25_2_0.f90 index 3e11c9df634..5f5d51b2d0e 100644 --- a/src/Transition/CreateNewIDFUsingRulesv25_2_0.f90 +++ b/src/Transition/CreateNewIDFUsingRulesv25_2_0.f90 @@ -423,7 +423,7 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile OutArgs(2) = '' ! new Availability Schedule Name field OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) CurArgs = CurArgs + 1 - + CASE('COIL:COOLING:WATERTOAIRHEATPUMP:EQUATIONFIT') CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) nodiff=.false. @@ -431,7 +431,7 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile OutArgs(2) = '' ! new Availability Schedule Name field OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) CurArgs = CurArgs + 1 - + CASE('COIL:HEATING:WATERTOAIRHEATPUMP:EQUATIONFIT') CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) nodiff=.false. @@ -439,7 +439,7 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile OutArgs(2) = '' ! new Availability Schedule Name field OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) CurArgs = CurArgs + 1 - + CASE('COIL:COOLING:WATERTOAIRHEATPUMP:PARAMETERESTIMATION') CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) nodiff=.false. @@ -447,7 +447,7 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile OutArgs(2) = '' ! new Availability Schedule Name field OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) CurArgs = CurArgs + 1 - + CASE('COIL:HEATING:WATERTOAIRHEATPUMP:PARAMETERESTIMATION') CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) nodiff=.false. @@ -463,7 +463,7 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile OutArgs(2) = '' ! new Availability Schedule Name field OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) CurArgs = CurArgs + 1 - + CASE('COIL:WATERHEATING:AIRTOWATERHEATPUMP:WRAPPED') CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) nodiff=.false. @@ -1138,4 +1138,4 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile RETURN -END SUBROUTINE CreateNewIDFUsingRules +END SUBROUTINE CreateNewIDFUsingRules \ No newline at end of file From 9a8445a607ad95dc392d43bac3974ef3493547ca Mon Sep 17 00:00:00 2001 From: lymereJ Date: Fri, 10 Oct 2025 12:10:43 -0700 Subject: [PATCH 16/30] Temporarily remove this file. --- .../CreateNewIDFUsingRulesV25_2_0.f90 | 1060 --------------- .../CreateNewIDFUsingRulesv25_2_0.f90 | 1141 ----------------- 2 files changed, 2201 deletions(-) delete mode 100644 src/Transition/CreateNewIDFUsingRulesV25_2_0.f90 delete mode 100644 src/Transition/CreateNewIDFUsingRulesv25_2_0.f90 diff --git a/src/Transition/CreateNewIDFUsingRulesV25_2_0.f90 b/src/Transition/CreateNewIDFUsingRulesV25_2_0.f90 deleted file mode 100644 index 82ab01201ad..00000000000 --- a/src/Transition/CreateNewIDFUsingRulesV25_2_0.f90 +++ /dev/null @@ -1,1060 +0,0 @@ -MODULE SetVersion - -USE DataStringGlobals -USE DataVCompareGlobals - -PUBLIC - -CONTAINS - -SUBROUTINE SetThisVersionVariables() - ! TODO: Update this section as appropriate - VerString='Conversion 25.1 => 25.2' - VersionNum=25.2 - ! Starting with version 22.1, the version string requires 4 characters - ! The original sVersionNum variable is a 3 character length string - ! If we just change that variable to be 4 characters, it could break everything before 22.1 - ! So instead, let's just move forward with a new 4 character string and use that in this file and the future - ! If we get to version 100.1 and we are still using this Fortran transition then well....we can deal with it then - sVersionNum = '***' - sVersionNumFourChars='25.2' - IDDFileNameWithPath=TRIM(ProgramPath)//'V25-1-0-Energy+.idd' - NewIDDFileNameWithPath=TRIM(ProgramPath)//'V25-2-0-Energy+.idd' - RepVarFileNameWithPath=TRIM(ProgramPath)//'Report Variables 25-1-0 to 25-2-0.csv' -END SUBROUTINE - -END MODULE - -SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFileName,ArgFile,ArgIDFExtension) - - ! SUBROUTINE INFORMATION: - ! AUTHOR Linda Lawrie - ! DATE WRITTEN July 2002 - ! MODIFIED For each release - ! RE-ENGINEERED na - - ! PURPOSE OF THIS SUBROUTINE: - ! This subroutine creates new IDFs based on the rules specified by - ! developers. This will result in a more complete transition but - ! takes more time to create. - - ! METHODOLOGY EMPLOYED: - ! na - - ! REFERENCES: - ! na - - ! USE STATEMENTS: - USE InputProcessor - USE DataVCompareGlobals - USE VCompareGlobalRoutines - USE DataStringGlobals, ONLY: ProgNameConversion - USE General - USE DataGlobals, ONLY: ShowMessage, ShowContinueError, ShowFatalError, ShowSevereError, ShowWarningError - - IMPLICIT NONE ! Enforce explicit typing of all variables in this routine - - ! SUBROUTINE ARGUMENT DEFINITIONS: - LOGICAL, INTENT(INOUT) :: EndOfFile - LOGICAL, INTENT(IN) :: DiffOnly - INTEGER, INTENT(IN) :: InLfn - LOGICAL, INTENT(IN) :: AskForInput - CHARACTER(len=*), INTENT(IN) :: InputFileName - LOGICAL, INTENT(IN) :: ArgFile - CHARACTER(len=*), INTENT(IN) :: ArgIDFExtension - - ! SUBROUTINE PARAMETER DEFINITIONS: - CHARACTER(len=*), PARAMETER :: fmta="(A)" - - ! INTERFACE BLOCK SPECIFICATIONS - ! na - - ! DERIVED TYPE DEFINITIONS - - ! SUBROUTINE LOCAL VARIABLE DECLARATIONS: - INTEGER IoS - INTEGER DotPos - INTEGER Status - INTEGER NA - INTEGER NN - INTEGER CurArgs - INTEGER DifLfn - INTEGER xCount - INTEGER Num - INTEGER, EXTERNAL :: GetNewUnitNumber - INTEGER Arg - LOGICAL, SAVE :: FirstTime=.true. - CHARACTER(len=30) UnitsArg - CHARACTER(len=MaxNameLength) :: ObjectName - CHARACTER(len=30), EXTERNAL :: TrimTrailZeros - CHARACTER(len=MaxNameLength) :: UCRepVarName=blank - CHARACTER(len=MaxNameLength) :: UCCompRepVarName=blank - LOGICAL DelThis - INTEGER pos - INTEGER pos2 - LOGICAL ExitBecauseBadFile - LOGICAL StillWorking - LOGICAL NoDiff - LOGICAL checkrvi - LOGICAL NoVersion - LOGICAL DiffMinFields ! Set to true when diff number of min-fields between the two objects - LOGICAL Written - INTEGER :: Var - INTEGER :: CurVar - LOGICAL ArgFileBeingDone - LOGICAL LatestVersion - CHARACTER(len=10) :: LocalFileExtension=' ' - LOGICAL :: WildMatch - - LOGICAL :: ConnComp - LOGICAL :: ConnCompCtrl - LOGICAL :: FileExist - CHARACTER(len=MaxNameLength) :: CreatedOutputName - LOGICAL, ALLOCATABLE, DIMENSION(:) :: DeleteThisRecord - INTEGER :: COutArgs - CHARACTER(len=16) :: UnitsField - - LOGICAL :: ErrFlag - - INTEGER :: I, CurField, NewField, KAindex=0, SearchNum - INTEGER :: AlphaNumI - REAL :: SaveNumber - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! I N S E R T L O C A L V A R I A B L E S H E R E ! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - - ! TODO: Move to V10_0_0.f90 when available - ! For Defaulting now-required RunPeriod Name - INTEGER :: TotRunPeriods = 0 - INTEGER :: runPeriodNum = 0 - INTEGER :: iterateRunPeriod = 0 - CHARACTER(len=MaxNameLength), ALLOCATABLE, DIMENSION(:) :: CurrentRunPeriodNames - CHARACTER(len=20) :: PotentialRunPeriodName - ! END OF TODO - - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! E N D O F I N S E R T L O C A L V A R I A B L E S H E R E ! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - - If (FirstTime) THEN ! do things that might be applicable only to this new version - FirstTime=.false. - EndIf - - StillWorking=.true. - ArgFileBeingDone=.false. - LatestVersion=.false. - NoVersion=.true. - LocalFileExtension=ArgIDFExtension - EndOfFile=.false. - IOS=0 - - DO WHILE (StillWorking) - - ExitBecauseBadFile=.false. - DO WHILE (.not. EndOfFile) - IF (AskForInput) THEN - WRITE(*,*) 'Enter input file name, with path' - write(*,fmta,advance='no') '-->' - READ(*,fmta) FullFileName - ELSE - IF (.not. ArgFile) THEN - READ(InLfn,*,IOSTAT=IoS) FullFileName - ELSEIF (.not. ArgFileBeingDone) THEN - FullFileName=InputFileName - IOS=0 - ArgFileBeingDone=.true. - ELSE - FullFileName=Blank - IOS=1 - ENDIF - IF (FullFileName(1:1) == '!') THEN - FullFileName=Blank - CYCLE - ENDIF - ENDIF - UnitsArg=Blank - IF (IoS /= 0) FullFileName=Blank - FullFileName=ADJUSTL(FullFileName) - IF (FullFileName /= Blank) THEN - CALL DisplayString('Processing IDF -- '//TRIM(FullFileName)) - WRITE(Auditf,fmta) ' Processing IDF -- '//TRIM(FullFileName) - DotPos=SCAN(FullFileName,'.',.true.) ! Scan backward looking for extension, - IF (DotPos /= 0) THEN - FileNamePath=FullFileName(1:DotPos-1) - LocalFileExtension=MakeLowerCase(FullFileName(DotPos+1:)) - ELSE - FileNamePath=FullFileName - WRITE(*,*) ' assuming file extension of .idf' - WRITE(Auditf,fmta) ' ..assuming file extension of .idf' - FullFileName=TRIM(FullFileName)//'.idf' - LocalFileExtension='idf' - ENDIF - ! Process the old input - DifLfn=GetNewUnitNumber() - INQUIRE(File=TRIM(FullFileName),EXIST=FileOK) - IF (.not. FileOK) THEN - WRITE(*,*) 'File not found='//TRIM(FullFileName) - WRITE(Auditf,*) 'File not found='//TRIM(FullFileName) - EndOfFile=.true. - ExitBecauseBadFile=.true. - EXIT - ENDIF - IF (LocalFileExtension == 'idf' .or. LocalFileExtension == 'imf') THEN - checkrvi=.false. - ConnComp=.false. - ConnCompCtrl=.false. - IF (DiffOnly) THEN - OPEN(DifLfn,FILE=TRIM(FileNamePath)//'.'//TRIM(LocalFileExtension)//'dif') - ELSE - OPEN(DifLfn,FILE=TRIM(FileNamePath)//'.'//TRIM(LocalFileExtension)//'new') - ENDIF - IF (LocalFileExtension == 'imf') THEN - CALL ShowWarningError('Note: IMF file being processed. No guarantee of perfection. Please check new file carefully.',Auditf) - ProcessingIMFFile=.true. - ELSE - ProcessingIMFFile=.false. - ENDIF - CALL ProcessInput(IDDFileNameWithPath,NewIDDFileNameWithPath,FullFileName) - IF (FatalError) THEN - ExitBecauseBadFile=.true. - EXIT - ENDIF - - ! Clean up from any previous passes, then re-allocate. These are for the 'standard' stuff, not your own - ! Do not add anything here! - IF(ALLOCATED(DeleteThisRecord)) DEALLOCATE(DeleteThisRecord) - IF(ALLOCATED(Alphas)) DEALLOCATE(Alphas) - IF(ALLOCATED(Numbers)) DEALLOCATE(Numbers) - IF(ALLOCATED(InArgs)) DEALLOCATE(InArgs) - IF(ALLOCATED(TempArgs)) DEALLOCATE(TempArgs) - IF(ALLOCATED(AorN)) DEALLOCATE(AorN) - IF(ALLOCATED(ReqFld)) DEALLOCATE(ReqFld) - IF(ALLOCATED(FldNames)) DEALLOCATE(FldNames) - IF(ALLOCATED(FldDefaults)) DEALLOCATE(FldDefaults) - IF(ALLOCATED(FldUnits)) DEALLOCATE(FldUnits) - IF(ALLOCATED(NwAorN)) DEALLOCATE(NwAorN) - IF(ALLOCATED(NwReqFld)) DEALLOCATE(NwReqFld) - IF(ALLOCATED(NwFldNames)) DEALLOCATE(NwFldNames) - IF(ALLOCATED(NwFldDefaults)) DEALLOCATE(NwFldDefaults) - IF(ALLOCATED(NwFldUnits)) DEALLOCATE(NwFldUnits) - IF(ALLOCATED(OutArgs)) DEALLOCATE(OutArgs) - ALLOCATE(Alphas(MaxAlphaArgsFound),Numbers(MaxNumericArgsFound)) - ALLOCATE(InArgs(MaxTotalArgs)) - ALLOCATE(TempArgs(MaxTotalArgs)) - ALLOCATE(AorN(MaxTotalArgs),ReqFld(MaxTotalArgs),FldNames(MaxTotalArgs),FldDefaults(MaxTotalArgs),FldUnits(MaxTotalArgs)) - ALLOCATE(NwAorN(MaxTotalArgs),NwReqFld(MaxTotalArgs),NwFldNames(MaxTotalArgs),NwFldDefaults(MaxTotalArgs),NwFldUnits(MaxTotalArgs)) - ALLOCATE(OutArgs(MaxTotalArgs)) - ALLOCATE(DeleteThisRecord(NumIDFRecords)) - DeleteThisRecord=.false. - - NoVersion=.true. - DO Num=1,NumIDFRecords - IF (MakeUPPERCase(IDFRecords(Num)%Name) /= 'VERSION') CYCLE - NoVersion=.false. - EXIT - ENDDO - - DO Num=1,NumIDFRecords - IF (DeleteThisRecord(Num)) THEN - Write(DifLfn,fmta) '! Deleting: '//TRIM(IDFRecords(Num)%Name)//'="'//TRIM(IDFRecords(Num)%Alphas(1))//'".' - ENDIF - ENDDO - - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! P R E P R O C E S S I N G ! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -! Do any kind of Preprocessing that is needed here (eg: a first pass on objects to store some attributes etc) - - - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! P R O C E S S I N G ! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - CALL DisplayString('Processing IDF -- Processing idf objects . . .') - DO Num=1,NumIDFRecords - - IF (DeleteThisRecord(Num)) CYCLE - DO xcount=IDFRecords(Num)%CommtS+1,IDFRecords(Num)%CommtE - WRITE(DifLfn,fmta) TRIM(Comments(xcount)) - if (xcount == IDFRecords(Num)%CommtE) WRITE(DifLfn,fmta) '' - ENDDO - IF (NoVersion .and. Num == 1) THEN - CALL GetNewObjectDefInIDD('VERSION',NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1) = sVersionNumFourChars - CurArgs=1 - CALL ShowWarningError('No version found in file, defaulting to '//sVersionNumFourChars,Auditf) - CALL WriteOutIDFLinesAsComments(DifLfn,'Version',CurArgs,OutArgs,NwFldNames,NwFldUnits) - ENDIF - - ! deleted objects. no transition. - ! eg: IF (MakeUPPERCase(TRIM(IDFRecords(Num)%Name)) == 'PROGRAMCONTROL') CYCLE - - ObjectName=IDFRecords(Num)%Name - IF (FindItemInList(ObjectName,ObjectDef%Name,NumObjectDefs) /= 0) THEN - CALL GetObjectDefInIDD(ObjectName,NumArgs,AorN,ReqFld,ObjMinFlds,FldNames,FldDefaults,FldUnits) - NumAlphas=IDFRecords(Num)%NumAlphas - NumNumbers=IDFRecords(Num)%NumNumbers - Alphas(1:NumAlphas)=IDFRecords(Num)%Alphas(1:NumAlphas) - Numbers(1:NumNumbers)=IDFRecords(Num)%Numbers(1:NumNumbers) - CurArgs=NumAlphas+NumNumbers - InArgs=Blank - OutArgs=Blank - TempArgs=Blank - NA=0 - NN=0 - DO Arg=1,CurArgs - IF (AorN(Arg)) THEN - NA=NA+1 - InArgs(Arg)=Alphas(NA) - ELSE - NN=NN+1 - InArgs(Arg)=Numbers(NN) - ENDIF - ENDDO - ELSE - WRITE(Auditf,fmta) 'Object="'//TRIM(ObjectName)//'" does not seem to be on the "old" IDD.' - WRITE(Auditf,fmta) '... will be listed as comments (no field names) on the new output file.' - WRITE(Auditf,fmta) '... Alpha fields will be listed first, then numerics.' - NumAlphas=IDFRecords(Num)%NumAlphas - NumNumbers=IDFRecords(Num)%NumNumbers - Alphas(1:NumAlphas)=IDFRecords(Num)%Alphas(1:NumAlphas) - Numbers(1:NumNumbers)=IDFRecords(Num)%Numbers(1:NumNumbers) - DO Arg=1,NumAlphas - OutArgs(Arg)=Alphas(Arg) - ENDDO - NN=NumAlphas+1 - DO Arg=1,NumNumbers - OutArgs(NN)=Numbers(Arg) - NN=NN+1 - ENDDO - CurArgs=NumAlphas+NumNumbers - NwFldNames=Blank - NwFldUnits=Blank - CALL WriteOutIDFLinesAsComments(DifLfn,ObjectName,CurArgs,OutArgs,NwFldNames,NwFldUnits) - CYCLE - ENDIF - - Nodiff=.true. ! Nodiff is true by default - DiffMinFields=.false. - Written=.false. - - IF (FindItemInList(MakeUPPERCase(ObjectName),NotInNew,SIZE(NotInNew)) == 0) THEN - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - ! Check minfields - IF (ObjMinFlds /= NwObjMinFlds) THEN - DiffMinFields=.true. - ELSE - DiffMinFields=.false. - ENDIF - ENDIF - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IF NOT ONLY MAKING PRETTY !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - IF (.not. MakingPretty) THEN - - SELECT CASE (MakeUPPERCase(TRIM(IDFRecords(Num)%Name))) - - CASE ('VERSION') - IF ((InArgs(1)(1:4)) == sVersionNumFourChars .and. ArgFile) THEN - CALL ShowWarningError('File is already at latest version. No new diff file made.',Auditf) - CLOSE(diflfn,STATUS='DELETE') - LatestVersion=.true. - EXIT - ENDIF - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1) = sVersionNumFourChars - NoDiff=.false. - - ! changes for this version, pick one of the spots to add rules, this will reduce the possibility of merge conflicts - -! CASE('OBJECTNAMEHERE') -! CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) -! nodiff=.false. -! OutArgs(1)=InArgs(1) -! OutArgs(2) = 'SequentialLoad' -! OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) -! CurArgs = CurArgs + 1 - - ! If your original object starts with A, insert the rules here - CASE('AIRLOOPHVAC:UNITARYHEATPUMP:AIRTOAIR:MULTISPEED') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:11)=InArgs(1:11) - OutArgs(12) = '' - OutArgs(13:CurArgs)=InArgs(13:CurArgs) - - ! If your original object starts with C, insert the rules here - - ! If your original object starts with D, insert the rules here - - ! If your original object starts with E, insert the rules here - - ! If your original object starts with F, insert the rules here - - ! If your original object starts with G, insert the rules here - - ! If your original object starts with H, insert the rules here - - ! If your original object starts with I, insert the rules here - - ! If your original object starts with L, insert the rules here - - ! If your original object starts with M, insert the rules here - - ! If your original object starts with N, insert the rules here - - ! If your original object starts with O, insert the rules here - - ! If your original object starts with P, insert the rules here - - ! If your original object starts with R, insert the rules here - - ! If your original object starts with S, insert the rules here - - ! If your original object starts with T, insert the rules here - - ! If your original object starts with U, insert the rules here - - ! If your original object starts with V, insert the rules here - - ! If your original object starts with W, insert the rules here - - ! If your original object starts with Z, insert the rules here - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! Changes for report variables, meters, tables -- update names ! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -! TODO: not sure if need to keep all of this... - - !!! Changes for report variables, meters, tables -- update names - CASE('OUTPUT:VARIABLE') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - IF (OutArgs(1) == Blank) THEN - OutArgs(1)='*' - nodiff=.false. - ENDIF - - CALL ScanOutputVariablesForReplacement( & - 2, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .true., & !OutVar - .false., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .false.) - IF (DelThis) CYCLE - - CASE ('OUTPUT:METER','OUTPUT:METER:METERFILEONLY','OUTPUT:METER:CUMULATIVE','OUTPUT:METER:CUMULATIVE:METERFILEONLY') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - CALL ScanOutputVariablesForReplacement( & - 1, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .true., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .false.) - IF (DelThis) CYCLE - - CASE('OUTPUT:TABLE:TIMEBINS') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - IF (OutArgs(1) == Blank) THEN - OutArgs(1)='*' - nodiff=.false. - ENDIF - CALL ScanOutputVariablesForReplacement( & - 2, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .false., & !MtrVar - .true., & !TimeBinVar - CurArgs, & - Written, & - .false.) - IF (DelThis) CYCLE - -!ExternalInterface:FunctionalMockupUnitImport:From:Variable, field 2 -!ExternalInterface:FunctionalMockupUnitExport:From:Variable, field 2 - CASE('EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT:FROM:VARIABLE', & - 'EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITEXPORT:FROM:VARIABLE') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - IF (OutArgs(1) == Blank) THEN - OutArgs(1)='*' - nodiff=.false. - ENDIF - CALL ScanOutputVariablesForReplacement( & - 2, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .false., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .false.) - IF (DelThis) CYCLE - -!EnergyManagementSystem:Sensor, field 3 - CASE('ENERGYMANAGEMENTSYSTEM:SENSOR') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - CALL ScanOutputVariablesForReplacement( & - 3, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .false., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .true.) - IF (DelThis) CYCLE - - CASE('OUTPUT:TABLE:MONTHLY') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.true. - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - CurVar=3 - DO Var=3,CurArgs,2 - UCRepVarName=MakeUPPERCase(InArgs(Var)) - OutArgs(CurVar)=InArgs(Var) - OutArgs(CurVar+1)=InArgs(Var+1) - pos=INDEX(UCRepVarName,'[') - IF (pos > 0) THEN - UCRepVarName=UCRepVarName(1:pos-1) - OutArgs(CurVar)=InArgs(Var)(1:pos-1) - OutArgs(CurVar+1)=InArgs(Var+1) - ENDIF - DelThis=.false. - DO Arg=1,NumRepVarNames - UCCompRepVarName=MakeUPPERCase(OldRepVarName(Arg)) - IF (UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName)) == '*') THEN - WildMatch=.true. - UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName))=' ' - pos=INDEX(TRIM(UCRepVarname),TRIM(UCCompRepVarName)) - ELSE - WildMatch=.false. - pos=0 - if (UCRepVarName == UCCompRepVarName) pos=1 - ENDIF - IF (pos > 0 .and. pos /= 1) CYCLE - IF (pos > 0) THEN - IF (NewRepVarName(Arg) /= '') THEN - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg) /= Blank .and. .not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq') ) THEN - IF (.not. OTMVarCaution(Arg)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Output Table Monthly (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Output Table Monthly (new)="'// & - trim(NewRepVarName(Arg))//'" has the following caution "'//trim(NewRepVarCaution(Arg))//'".') - write(diflfn,fmtA) ' ' - OTMVarCaution(Arg)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ELSE - DelThis=.true. - ENDIF - IF (OldRepVarName(Arg) == OldRepVarName(Arg+1)) THEN - IF (.not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq')) THEN - ! Adding a var field. - CurVar=CurVar+2 - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg+1) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg+1))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg+1) /= Blank) THEN - IF (.not. OTMVarCaution(Arg+1)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Output Table Monthly (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Output Table Monthly (new)="'// & - trim(NewRepVarName(Arg+1))//'" has the following caution "'//trim(NewRepVarCaution(Arg+1))//'".') - write(diflfn,fmtA) ' ' - OTMVarCaution(Arg+1)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ENDIF - ENDIF - IF (OldRepVarName(Arg) == OldRepVarName(Arg+2)) THEN ! only 1 more... for ForkEq - ! Adding a var field. - CurVar=CurVar+2 - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg+2) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg+2))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg+2) /= Blank) THEN - IF (.not. OTMVarCaution(Arg+2)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Output Table Monthly (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Output Table Monthly (new)="'// & - trim(NewRepVarName(Arg+2))//'" has the following caution "'//trim(NewRepVarCaution(Arg+2))//'".') - write(diflfn,fmtA) ' ' - OTMVarCaution(Arg+2)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ENDIF - EXIT - ENDIF - ENDDO - IF (.not. DelThis) CurVar=CurVar+2 - ENDDO - CurArgs=CurVar-1 - - CASE('METER:CUSTOM') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - CurVar=4 - DO Var=4,CurArgs,2 - UCRepVarName=MakeUPPERCase(InArgs(Var)) - OutArgs(CurVar)=InArgs(Var) - OutArgs(CurVar+1)=InArgs(Var+1) - pos=INDEX(UCRepVarName,'[') - IF (pos > 0) THEN - UCRepVarName=UCRepVarName(1:pos-1) - OutArgs(CurVar)=InArgs(Var)(1:pos-1) - OutArgs(CurVar+1)=InArgs(Var+1) - ENDIF - DelThis=.false. - DO Arg=1,NumRepVarNames - UCCompRepVarName=MakeUPPERCase(OldRepVarName(Arg)) - IF (UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName)) == '*') THEN - WildMatch=.true. - UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName))=' ' - pos=INDEX(TRIM(UCRepVarname),TRIM(UCCompRepVarName)) - ELSE - WildMatch=.false. - pos=0 - if (UCRepVarName == UCCompRepVarName) pos=1 - ENDIF - IF (pos > 0 .and. pos /= 1) CYCLE - IF (pos > 0) THEN - IF (NewRepVarName(Arg) /= '') THEN - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg) /= Blank .and. .not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq') ) THEN - IF (.not. CMtrVarCaution(Arg)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Custom Meter (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Custom Meter (new)="'// & - trim(NewRepVarName(Arg))//'" has the following caution "'//trim(NewRepVarCaution(Arg))//'".') - write(diflfn,fmtA) ' ' - CMtrVarCaution(Arg)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ELSE - DelThis=.true. - ENDIF - IF (OldRepVarName(Arg) == OldRepVarName(Arg+1)) THEN - IF (.not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq')) THEN - ! Adding a var field. - CurVar=CurVar+2 - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg+1) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg+1))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg+1) /= Blank .and. .not. SameString(NewRepVarCaution(Arg+1)(1:6),'Forkeq') ) THEN - IF (.not. CMtrVarCaution(Arg+1)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Custom Meter (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Custom Meter (new)="'// & - trim(NewRepVarName(Arg+1))//'" has the following caution "'//trim(NewRepVarCaution(Arg+1))//'".') - write(diflfn,fmtA) ' ' - CMtrVarCaution(Arg+1)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ENDIF - ENDIF - IF (OldRepVarName(Arg) == OldRepVarName(Arg+2)) THEN - ! Adding a var field. - CurVar=CurVar+2 - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg+2) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg+2))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg+2) /= Blank) THEN - IF (.not. CMtrVarCaution(Arg+2)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Custom Meter (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Custom Meter (new)="'// & - trim(NewRepVarName(Arg+2))//'" has the following caution "'//trim(NewRepVarCaution(Arg+2))//'".') - write(diflfn,fmtA) ' ' - CMtrVarCaution(Arg+2)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ENDIF - EXIT - ENDIF - ENDDO - IF (.not. DelThis) CurVar=CurVar+2 - ENDDO - CurArgs=CurVar - DO Arg=CurVar,1,-1 - IF (OutArgs(Arg) == Blank) THEN - CurArgs=CurArgs-1 - ELSE - EXIT - ENDIF - ENDDO - - CASE('METER:CUSTOMDECREMENT') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - CurVar=4 ! In case Source Meter would change - DO Var=4,CurArgs,2 - UCRepVarName=MakeUPPERCase(InArgs(Var)) - OutArgs(CurVar)=InArgs(Var) - OutArgs(CurVar+1)=InArgs(Var+1) - pos=INDEX(UCRepVarName,'[') - IF (pos > 0) THEN - UCRepVarName=UCRepVarName(1:pos-1) - OutArgs(CurVar)=InArgs(Var)(1:pos-1) - OutArgs(CurVar+1)=InArgs(Var+1) - ENDIF - DelThis=.false. - DO Arg=1,NumRepVarNames - UCCompRepVarName=MakeUPPERCase(OldRepVarName(Arg)) - IF (UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName)) == '*') THEN - WildMatch=.true. - UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName))=' ' - pos=INDEX(TRIM(UCRepVarname),TRIM(UCCompRepVarName)) - ELSE - WildMatch=.false. - pos=0 - if (UCRepVarName == UCCompRepVarName) pos=1 - ENDIF - IF (pos > 0 .and. pos /= 1) CYCLE - IF (pos > 0) THEN - IF (NewRepVarName(Arg) /= '') THEN - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg) /= Blank .and. .not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq') ) THEN - IF (.not. CMtrDVarCaution(Arg)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Custom Decrement Meter (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Custom Meter (new)="'// & - trim(NewRepVarName(Arg))//'" has the following caution "'//trim(NewRepVarCaution(Arg))//'".') - write(diflfn,fmtA) ' ' - CMtrDVarCaution(Arg)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ELSE - DelThis=.true. - ENDIF - IF (OldRepVarName(Arg) == OldRepVarName(Arg+1)) THEN - IF (.not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq')) THEN - ! Adding a var field. - CurVar=CurVar+2 - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg+1) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg+1))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg+1) /= Blank .and. .not. SameString(NewRepVarCaution(Arg+1)(1:6),'Forkeq') ) THEN - IF (.not. CMtrDVarCaution(Arg+1)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Custom Decrement Meter (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Custom Decrement Meter (new)="'// & - trim(NewRepVarName(Arg+1))//'" has the following caution "'//trim(NewRepVarCaution(Arg+1))//'".') - write(diflfn,fmtA) ' ' - CMtrDVarCaution(Arg+1)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ENDIF - ENDIF - IF (OldRepVarName(Arg) == OldRepVarName(Arg+2)) THEN - ! Adding a var field. - CurVar=CurVar+2 - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg+2) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg+2))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg+2) /= Blank) THEN - IF (.not. CMtrDVarCaution(Arg+2)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Custom Decrement Meter (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Custom Meter (new)="'// & - trim(NewRepVarName(Arg+2))//'" has the following caution "'//trim(NewRepVarCaution(Arg+2))//'".') - write(diflfn,fmtA) ' ' - CMtrDVarCaution(Arg+2)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ENDIF - EXIT - ENDIF - ENDDO - IF (.not. DelThis) CurVar=CurVar+2 - ENDDO - CurArgs=CurVar - DO Arg=CurVar,1,-1 - IF (OutArgs(Arg) == Blank) THEN - CurArgs=CurArgs-1 - ELSE - EXIT - ENDIF - ENDDO - - !!! Changes for other objects that reference meter names -- update names - CASE('DEMANDMANAGERASSIGNMENTLIST', & - 'UTILITYCOST:TARIFF') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - - CALL ScanOutputVariablesForReplacement( & - 2, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .true., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .false.) - - CASE('ELECTRICLOADCENTER:DISTRIBUTION') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - - ! Field 6 A5, \field Generator Track Meter Scheme Meter Name - CALL ScanOutputVariablesForReplacement( & - 6, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .true., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .false.) - - ! Field 12 A11, \field Storage Control Track Meter Name - CALL ScanOutputVariablesForReplacement( & - 12, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .true., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .false.) - - ! ANY OTHER OBJECT - CASE DEFAULT - IF (FindItemInList(ObjectName,NotInNew,SIZE(NotInNew)) /= 0) THEN - WRITE(Auditf,fmta) 'Object="'//TRIM(ObjectName)//'" is not in the "new" IDD.' - WRITE(Auditf,fmta) '... will be listed as comments on the new output file.' - CALL WriteOutIDFLinesAsComments(DifLfn,ObjectName,CurArgs,InArgs,FldNames,FldUnits) - Written=.true. - !CYCLE - ELSE - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - NoDiff=.true. - ENDIF - - END SELECT - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IF ONLY MAKING PRETTY !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ELSE !!! Making Pretty - - ! Just making pretty -- no changes as above. - CALL GetNewObjectDefInIDD(IDFRecords(Num)%Name,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - ENDIF - - IF (DiffMinFields .and. nodiff) THEN - ! Change in min-fields - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - NoDiff=.false. - DO Arg=CurArgs+1,NwObjMinFlds - OutArgs(Arg)=NwFldDefaults(Arg) - ENDDO - CurArgs=MAX(NwObjMinFlds,CurArgs) - ENDIF - - IF (NoDiff .and. DiffOnly) CYCLE - - !! reformat for better readability - !! BUILDING,SOLUTION ALGORITHM,OUTSIDE CONVECTION ALGORITHM,INSIDE CONVECTION ALGORITHM,REPORT VARIABLE, - !! SURFACE:HEATTRANSFER,SURFACE:HEATTRANSFER:SUBSURFACE:SHADING:DETACHED, - !! SURFACE:SHADING:DETACHED:FIXED,SURFACE:SHADING:DETACHED:BUILDING, - !! SURFACE:SHADING:ATTACHED, - !! WINDOWGLASSSPECTRALDATA, - !! FLUIDPROPERTYTEMPERATURES, - !! FLUIDPROPERTYSATURATED,FLUIDPROPERTYSUPERHEATED,FLUIDPROPERTYCONCENTRATION - IF (.not. Written) THEN - CALL CheckSpecialObjects(DifLfn,ObjectName,CurArgs,OutArgs,NwFldNames,NwFldUnits,Written) - ENDIF - - IF (.not. Written) THEN - CALL WriteOutIDFLines(DifLfn,ObjectName,CurArgs,OutArgs,NwFldNames,NwFldUnits) - ENDIF - - ENDDO ! IDFRecords - - CALL DisplayString('Processing IDF -- Processing idf objects complete.') - IF (IDFRecords(NumIDFRecords)%CommtE /= CurComment) THEN - DO xcount=IDFRecords(NumIDFRecords)%CommtE+1,CurComment - WRITE(DifLfn,fmta) TRIM(Comments(xcount)) - if (xcount == IDFRecords(Num)%CommtE) WRITE(DifLfn,fmta) '' - ENDDO - ENDIF - - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! E N D O F P R O C E S S I N G ! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - - IF (GetNumSectionsFound('Report Variable Dictionary') > 0) THEN - ObjectName='Output:VariableDictionary' - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1)='Regular' - CurArgs=1 - CALL WriteOutIDFLines(DifLfn,ObjectName,CurArgs,OutArgs,NwFldNames,NwFldUnits) - ENDIF - - INQUIRE(FILE=trim(FileNamePath)//'.rvi',EXIST=FileExist) -! IF (FileExist) THEN -! CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & -! 'rvi file associated with this input is being processed. Review for accuracy.') -! write(diflfn,fmtA) ' ' -! ENDIF - CLOSE(DifLfn) - CALL ProcessRviMviFiles(FileNamePath,'rvi') - CALL ProcessRviMviFiles(FileNamePath,'mvi') - CALL CloseOut - ELSE ! not a idf or imf - CALL ProcessRviMviFiles(FileNamePath,'rvi') - CALL ProcessRviMviFiles(FileNamePath,'mvi') - ENDIF - ELSE ! Full name == Blank - EndOfFile=.true. - ENDIF - - CALL CreateNewName('Reallocate',CreatedOutputName,' ') - - ENDDO - - IF (.not. ExitBecauseBadFile) THEN - StillWorking=.false. - EXIT - ELSE - IF (.not. ArgFileBeingDone) THEN - EndOfFile=.false. - ELSE - EndOfFile=.true. - StillWorking=.false. - ENDIF - ENDIF - ENDDO - - IF (ArgFileBeingDone .and. .not. LatestVersion .and. .not. ExitBecauseBadFile) THEN - ! If this is true, then there was a "arg IDF File" on the command line and some files need to be renamed - ErrFlag=.false. - CALL copyfile(TRIM(FileNamePath)//'.'//TRIM(ArgIDFExtension),TRIM(FileNamePath)//'.'//TRIM(ArgIDFExtension)//'old',ErrFlag) - CALL copyfile(TRIM(FileNamePath)//'.'//TRIM(ArgIDFExtension)//'new',TRIM(FileNamePath)//'.'//TRIM(ArgIDFExtension),ErrFlag) - INQUIRE(File=TRIM(FileNamePath)//'.rvi',EXIST=FileExist) - IF (FileExist) THEN - CALL copyfile(TRIM(FileNamePath)//'.rvi',TRIM(FileNamePath)//'.rviold',ErrFlag) - ENDIF - INQUIRE(File=TRIM(FileNamePath)//'.rvinew',EXIST=FileExist) - IF (FileExist) THEN - CALL copyfile(TRIM(FileNamePath)//'.rvinew',TRIM(FileNamePath)//'.rvi',ErrFlag) - ENDIF - INQUIRE(File=TRIM(FileNamePath)//'.mvi',EXIST=FileExist) - IF (FileExist) THEN - CALL copyfile(TRIM(FileNamePath)//'.mvi',TRIM(FileNamePath)//'.mviold',ErrFlag) - ENDIF - INQUIRE(File=TRIM(FileNamePath)//'.mvinew',EXIST=FileExist) - IF (FileExist) THEN - CALL copyfile(TRIM(FileNamePath)//'.mvinew',TRIM(FileNamePath)//'.mvi',ErrFlag) - ENDIF - ENDIF - - RETURN - -END SUBROUTINE CreateNewIDFUsingRules diff --git a/src/Transition/CreateNewIDFUsingRulesv25_2_0.f90 b/src/Transition/CreateNewIDFUsingRulesv25_2_0.f90 deleted file mode 100644 index 5f5d51b2d0e..00000000000 --- a/src/Transition/CreateNewIDFUsingRulesv25_2_0.f90 +++ /dev/null @@ -1,1141 +0,0 @@ -MODULE SetVersion - -USE DataStringGlobals -USE DataVCompareGlobals - -PUBLIC - -CONTAINS - -SUBROUTINE SetThisVersionVariables() - ! TODO: Update this section as appropriate - VerString='Conversion 25.1 => 25.2' - VersionNum=25.2 - ! Starting with version 22.1, the version string requires 4 characters - ! The original sVersionNum variable is a 3 character length string - ! If we just change that variable to be 4 characters, it could break everything before 22.1 - ! So instead, let's just move forward with a new 4 character string and use that in this file and the future - ! If we get to version 100.1 and we are still using this Fortran transition then well....we can deal with it then - sVersionNum = '***' - sVersionNumFourChars='25.2' - IDDFileNameWithPath=TRIM(ProgramPath)//'V25-1-0-Energy+.idd' - NewIDDFileNameWithPath=TRIM(ProgramPath)//'V25-2-0-Energy+.idd' - RepVarFileNameWithPath=TRIM(ProgramPath)//'Report Variables 25-1-0 to 25-2-0.csv' -END SUBROUTINE - -END MODULE - -SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFileName,ArgFile,ArgIDFExtension) - - ! SUBROUTINE INFORMATION: - ! AUTHOR Linda Lawrie - ! DATE WRITTEN July 2002 - ! MODIFIED For each release - ! RE-ENGINEERED na - - ! PURPOSE OF THIS SUBROUTINE: - ! This subroutine creates new IDFs based on the rules specified by - ! developers. This will result in a more complete transition but - ! takes more time to create. - - ! METHODOLOGY EMPLOYED: - ! na - - ! REFERENCES: - ! na - - ! USE STATEMENTS: - USE InputProcessor - USE DataVCompareGlobals - USE VCompareGlobalRoutines - USE DataStringGlobals, ONLY: ProgNameConversion - USE General - USE DataGlobals, ONLY: ShowMessage, ShowContinueError, ShowFatalError, ShowSevereError, ShowWarningError - - IMPLICIT NONE ! Enforce explicit typing of all variables in this routine - - ! SUBROUTINE ARGUMENT DEFINITIONS: - LOGICAL, INTENT(INOUT) :: EndOfFile - LOGICAL, INTENT(IN) :: DiffOnly - INTEGER, INTENT(IN) :: InLfn - LOGICAL, INTENT(IN) :: AskForInput - CHARACTER(len=*), INTENT(IN) :: InputFileName - LOGICAL, INTENT(IN) :: ArgFile - CHARACTER(len=*), INTENT(IN) :: ArgIDFExtension - - ! SUBROUTINE PARAMETER DEFINITIONS: - CHARACTER(len=*), PARAMETER :: fmta="(A)" - - ! INTERFACE BLOCK SPECIFICATIONS - ! na - - ! DERIVED TYPE DEFINITIONS - - ! SUBROUTINE LOCAL VARIABLE DECLARATIONS: - INTEGER IoS - INTEGER DotPos - INTEGER Status - INTEGER NA - INTEGER NN - INTEGER CurArgs - INTEGER DifLfn - INTEGER xCount - INTEGER Num - INTEGER, EXTERNAL :: GetNewUnitNumber - INTEGER Arg - LOGICAL, SAVE :: FirstTime=.true. - CHARACTER(len=30) UnitsArg - CHARACTER(len=MaxNameLength) :: ObjectName - CHARACTER(len=30), EXTERNAL :: TrimTrailZeros - CHARACTER(len=MaxNameLength) :: UCRepVarName=blank - CHARACTER(len=MaxNameLength) :: UCCompRepVarName=blank - LOGICAL DelThis - INTEGER pos - INTEGER pos2 - LOGICAL ExitBecauseBadFile - LOGICAL StillWorking - LOGICAL NoDiff - LOGICAL checkrvi - LOGICAL NoVersion - LOGICAL DiffMinFields ! Set to true when diff number of min-fields between the two objects - LOGICAL Written - INTEGER :: Var - INTEGER :: CurVar - LOGICAL ArgFileBeingDone - LOGICAL LatestVersion - CHARACTER(len=10) :: LocalFileExtension=' ' - LOGICAL :: WildMatch - - LOGICAL :: ConnComp - LOGICAL :: ConnCompCtrl - LOGICAL :: FileExist - CHARACTER(len=MaxNameLength) :: CreatedOutputName - LOGICAL, ALLOCATABLE, DIMENSION(:) :: DeleteThisRecord - INTEGER :: COutArgs - CHARACTER(len=16) :: UnitsField - - LOGICAL :: ErrFlag - - INTEGER :: I, CurField, NewField, KAindex=0, SearchNum - INTEGER :: AlphaNumI - REAL :: SaveNumber - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! I N S E R T L O C A L V A R I A B L E S H E R E ! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - - ! TODO: Move to V10_0_0.f90 when available - ! For Defaulting now-required RunPeriod Name - INTEGER :: TotRunPeriods = 0 - INTEGER :: runPeriodNum = 0 - INTEGER :: iterateRunPeriod = 0 - CHARACTER(len=MaxNameLength), ALLOCATABLE, DIMENSION(:) :: CurrentRunPeriodNames - CHARACTER(len=20) :: PotentialRunPeriodName - ! END OF TODO - - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! E N D O F I N S E R T L O C A L V A R I A B L E S H E R E ! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - - If (FirstTime) THEN ! do things that might be applicable only to this new version - FirstTime=.false. - EndIf - - StillWorking=.true. - ArgFileBeingDone=.false. - LatestVersion=.false. - NoVersion=.true. - LocalFileExtension=ArgIDFExtension - EndOfFile=.false. - IOS=0 - - DO WHILE (StillWorking) - - ExitBecauseBadFile=.false. - DO WHILE (.not. EndOfFile) - IF (AskForInput) THEN - WRITE(*,*) 'Enter input file name, with path' - write(*,fmta,advance='no') '-->' - READ(*,fmta) FullFileName - ELSE - IF (.not. ArgFile) THEN - READ(InLfn,*,IOSTAT=IoS) FullFileName - ELSEIF (.not. ArgFileBeingDone) THEN - FullFileName=InputFileName - IOS=0 - ArgFileBeingDone=.true. - ELSE - FullFileName=Blank - IOS=1 - ENDIF - IF (FullFileName(1:1) == '!') THEN - FullFileName=Blank - CYCLE - ENDIF - ENDIF - UnitsArg=Blank - IF (IoS /= 0) FullFileName=Blank - FullFileName=ADJUSTL(FullFileName) - IF (FullFileName /= Blank) THEN - CALL DisplayString('Processing IDF -- '//TRIM(FullFileName)) - WRITE(Auditf,fmta) ' Processing IDF -- '//TRIM(FullFileName) - DotPos=SCAN(FullFileName,'.',.true.) ! Scan backward looking for extension, - IF (DotPos /= 0) THEN - FileNamePath=FullFileName(1:DotPos-1) - LocalFileExtension=MakeLowerCase(FullFileName(DotPos+1:)) - ELSE - FileNamePath=FullFileName - WRITE(*,*) ' assuming file extension of .idf' - WRITE(Auditf,fmta) ' ..assuming file extension of .idf' - FullFileName=TRIM(FullFileName)//'.idf' - LocalFileExtension='idf' - ENDIF - ! Process the old input - DifLfn=GetNewUnitNumber() - INQUIRE(File=TRIM(FullFileName),EXIST=FileOK) - IF (.not. FileOK) THEN - WRITE(*,*) 'File not found='//TRIM(FullFileName) - WRITE(Auditf,*) 'File not found='//TRIM(FullFileName) - EndOfFile=.true. - ExitBecauseBadFile=.true. - EXIT - ENDIF - IF (LocalFileExtension == 'idf' .or. LocalFileExtension == 'imf') THEN - checkrvi=.false. - ConnComp=.false. - ConnCompCtrl=.false. - IF (DiffOnly) THEN - OPEN(DifLfn,FILE=TRIM(FileNamePath)//'.'//TRIM(LocalFileExtension)//'dif') - ELSE - OPEN(DifLfn,FILE=TRIM(FileNamePath)//'.'//TRIM(LocalFileExtension)//'new') - ENDIF - IF (LocalFileExtension == 'imf') THEN - CALL ShowWarningError('Note: IMF file being processed. No guarantee of perfection. Please check new file carefully.',Auditf) - ProcessingIMFFile=.true. - ELSE - ProcessingIMFFile=.false. - ENDIF - CALL ProcessInput(IDDFileNameWithPath,NewIDDFileNameWithPath,FullFileName) - IF (FatalError) THEN - ExitBecauseBadFile=.true. - EXIT - ENDIF - - ! Clean up from any previous passes, then re-allocate. These are for the 'standard' stuff, not your own - ! Do not add anything here! - IF(ALLOCATED(DeleteThisRecord)) DEALLOCATE(DeleteThisRecord) - IF(ALLOCATED(Alphas)) DEALLOCATE(Alphas) - IF(ALLOCATED(Numbers)) DEALLOCATE(Numbers) - IF(ALLOCATED(InArgs)) DEALLOCATE(InArgs) - IF(ALLOCATED(TempArgs)) DEALLOCATE(TempArgs) - IF(ALLOCATED(AorN)) DEALLOCATE(AorN) - IF(ALLOCATED(ReqFld)) DEALLOCATE(ReqFld) - IF(ALLOCATED(FldNames)) DEALLOCATE(FldNames) - IF(ALLOCATED(FldDefaults)) DEALLOCATE(FldDefaults) - IF(ALLOCATED(FldUnits)) DEALLOCATE(FldUnits) - IF(ALLOCATED(NwAorN)) DEALLOCATE(NwAorN) - IF(ALLOCATED(NwReqFld)) DEALLOCATE(NwReqFld) - IF(ALLOCATED(NwFldNames)) DEALLOCATE(NwFldNames) - IF(ALLOCATED(NwFldDefaults)) DEALLOCATE(NwFldDefaults) - IF(ALLOCATED(NwFldUnits)) DEALLOCATE(NwFldUnits) - IF(ALLOCATED(OutArgs)) DEALLOCATE(OutArgs) - ALLOCATE(Alphas(MaxAlphaArgsFound),Numbers(MaxNumericArgsFound)) - ALLOCATE(InArgs(MaxTotalArgs)) - ALLOCATE(TempArgs(MaxTotalArgs)) - ALLOCATE(AorN(MaxTotalArgs),ReqFld(MaxTotalArgs),FldNames(MaxTotalArgs),FldDefaults(MaxTotalArgs),FldUnits(MaxTotalArgs)) - ALLOCATE(NwAorN(MaxTotalArgs),NwReqFld(MaxTotalArgs),NwFldNames(MaxTotalArgs),NwFldDefaults(MaxTotalArgs),NwFldUnits(MaxTotalArgs)) - ALLOCATE(OutArgs(MaxTotalArgs)) - ALLOCATE(DeleteThisRecord(NumIDFRecords)) - DeleteThisRecord=.false. - - NoVersion=.true. - DO Num=1,NumIDFRecords - IF (MakeUPPERCase(IDFRecords(Num)%Name) /= 'VERSION') CYCLE - NoVersion=.false. - EXIT - ENDDO - - DO Num=1,NumIDFRecords - IF (DeleteThisRecord(Num)) THEN - Write(DifLfn,fmta) '! Deleting: '//TRIM(IDFRecords(Num)%Name)//'="'//TRIM(IDFRecords(Num)%Alphas(1))//'".' - ENDIF - ENDDO - - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! P R E P R O C E S S I N G ! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -! Do any kind of Preprocessing that is needed here (eg: a first pass on objects to store some attributes etc) - - - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! P R O C E S S I N G ! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - CALL DisplayString('Processing IDF -- Processing idf objects . . .') - DO Num=1,NumIDFRecords - - IF (DeleteThisRecord(Num)) CYCLE - DO xcount=IDFRecords(Num)%CommtS+1,IDFRecords(Num)%CommtE - WRITE(DifLfn,fmta) TRIM(Comments(xcount)) - if (xcount == IDFRecords(Num)%CommtE) WRITE(DifLfn,fmta) '' - ENDDO - IF (NoVersion .and. Num == 1) THEN - CALL GetNewObjectDefInIDD('VERSION',NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1) = sVersionNumFourChars - CurArgs=1 - CALL ShowWarningError('No version found in file, defaulting to '//sVersionNumFourChars,Auditf) - CALL WriteOutIDFLinesAsComments(DifLfn,'Version',CurArgs,OutArgs,NwFldNames,NwFldUnits) - ENDIF - - ! deleted objects. no transition. - ! eg: IF (MakeUPPERCase(TRIM(IDFRecords(Num)%Name)) == 'PROGRAMCONTROL') CYCLE - - ObjectName=IDFRecords(Num)%Name - IF (FindItemInList(ObjectName,ObjectDef%Name,NumObjectDefs) /= 0) THEN - CALL GetObjectDefInIDD(ObjectName,NumArgs,AorN,ReqFld,ObjMinFlds,FldNames,FldDefaults,FldUnits) - NumAlphas=IDFRecords(Num)%NumAlphas - NumNumbers=IDFRecords(Num)%NumNumbers - Alphas(1:NumAlphas)=IDFRecords(Num)%Alphas(1:NumAlphas) - Numbers(1:NumNumbers)=IDFRecords(Num)%Numbers(1:NumNumbers) - CurArgs=NumAlphas+NumNumbers - InArgs=Blank - OutArgs=Blank - TempArgs=Blank - NA=0 - NN=0 - DO Arg=1,CurArgs - IF (AorN(Arg)) THEN - NA=NA+1 - InArgs(Arg)=Alphas(NA) - ELSE - NN=NN+1 - InArgs(Arg)=Numbers(NN) - ENDIF - ENDDO - ELSE - WRITE(Auditf,fmta) 'Object="'//TRIM(ObjectName)//'" does not seem to be on the "old" IDD.' - WRITE(Auditf,fmta) '... will be listed as comments (no field names) on the new output file.' - WRITE(Auditf,fmta) '... Alpha fields will be listed first, then numerics.' - NumAlphas=IDFRecords(Num)%NumAlphas - NumNumbers=IDFRecords(Num)%NumNumbers - Alphas(1:NumAlphas)=IDFRecords(Num)%Alphas(1:NumAlphas) - Numbers(1:NumNumbers)=IDFRecords(Num)%Numbers(1:NumNumbers) - DO Arg=1,NumAlphas - OutArgs(Arg)=Alphas(Arg) - ENDDO - NN=NumAlphas+1 - DO Arg=1,NumNumbers - OutArgs(NN)=Numbers(Arg) - NN=NN+1 - ENDDO - CurArgs=NumAlphas+NumNumbers - NwFldNames=Blank - NwFldUnits=Blank - CALL WriteOutIDFLinesAsComments(DifLfn,ObjectName,CurArgs,OutArgs,NwFldNames,NwFldUnits) - CYCLE - ENDIF - - Nodiff=.true. ! Nodiff is true by default - DiffMinFields=.false. - Written=.false. - - IF (FindItemInList(MakeUPPERCase(ObjectName),NotInNew,SIZE(NotInNew)) == 0) THEN - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - ! Check minfields - IF (ObjMinFlds /= NwObjMinFlds) THEN - DiffMinFields=.true. - ELSE - DiffMinFields=.false. - ENDIF - ENDIF - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IF NOT ONLY MAKING PRETTY !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - IF (.not. MakingPretty) THEN - - SELECT CASE (MakeUPPERCase(TRIM(IDFRecords(Num)%Name))) - - CASE ('VERSION') - IF ((InArgs(1)(1:4)) == sVersionNumFourChars .and. ArgFile) THEN - CALL ShowWarningError('File is already at latest version. No new diff file made.',Auditf) - CLOSE(diflfn,STATUS='DELETE') - LatestVersion=.true. - EXIT - ENDIF - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1) = sVersionNumFourChars - NoDiff=.false. - - ! changes for this version, pick one of the spots to add rules, this will reduce the possibility of merge conflicts - -! CASE('OBJECTNAMEHERE') -! CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) -! nodiff=.false. -! OutArgs(1)=InArgs(1) -! OutArgs(2) = 'SequentialLoad' -! OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) -! CurArgs = CurArgs + 1 - - ! If your original object starts with A, insert the rules here - - ! If your original object starts with C, insert the rules here - CASE('COIL:COOLING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:HEATING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:COOLING:DX:VARIABLESPEED') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:HEATING:DX:VARIABLESPEED') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:WATERHEATING:AIRTOWATERHEATPUMP:VARIABLESPEED') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:COOLING:WATERTOAIRHEATPUMP:EQUATIONFIT') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:HEATING:WATERTOAIRHEATPUMP:EQUATIONFIT') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:COOLING:WATERTOAIRHEATPUMP:PARAMETERESTIMATION') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:HEATING:WATERTOAIRHEATPUMP:PARAMETERESTIMATION') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:WATERHEATING:AIRTOWATERHEATPUMP:PUMPED') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:WATERHEATING:AIRTOWATERHEATPUMP:WRAPPED') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - ! If your original object starts with D, insert the rules here - - ! If your original object starts with E, insert the rules here - - ! If your original object starts with F, insert the rules here - - ! If your original object starts with G, insert the rules here - - ! If your original object starts with H, insert the rules here - - ! If your original object starts with I, insert the rules here - - ! If your original object starts with L, insert the rules here - - ! If your original object starts with M, insert the rules here - - ! If your original object starts with N, insert the rules here - - ! If your original object starts with O, insert the rules here - - ! If your original object starts with P, insert the rules here - - ! If your original object starts with R, insert the rules here - - ! If your original object starts with S, insert the rules here - - ! If your original object starts with T, insert the rules here - - ! If your original object starts with U, insert the rules here - - ! If your original object starts with V, insert the rules here - - ! If your original object starts with W, insert the rules here - - ! If your original object starts with Z, insert the rules here - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! Changes for report variables, meters, tables -- update names ! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -! TODO: not sure if need to keep all of this... - - !!! Changes for report variables, meters, tables -- update names - CASE('OUTPUT:VARIABLE') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - IF (OutArgs(1) == Blank) THEN - OutArgs(1)='*' - nodiff=.false. - ENDIF - - CALL ScanOutputVariablesForReplacement( & - 2, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .true., & !OutVar - .false., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .false.) - IF (DelThis) CYCLE - - CASE ('OUTPUT:METER','OUTPUT:METER:METERFILEONLY','OUTPUT:METER:CUMULATIVE','OUTPUT:METER:CUMULATIVE:METERFILEONLY') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - CALL ScanOutputVariablesForReplacement( & - 1, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .true., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .false.) - IF (DelThis) CYCLE - - CASE('OUTPUT:TABLE:TIMEBINS') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - IF (OutArgs(1) == Blank) THEN - OutArgs(1)='*' - nodiff=.false. - ENDIF - CALL ScanOutputVariablesForReplacement( & - 2, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .false., & !MtrVar - .true., & !TimeBinVar - CurArgs, & - Written, & - .false.) - IF (DelThis) CYCLE - -!ExternalInterface:FunctionalMockupUnitImport:From:Variable, field 2 -!ExternalInterface:FunctionalMockupUnitExport:From:Variable, field 2 - CASE('EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT:FROM:VARIABLE', & - 'EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITEXPORT:FROM:VARIABLE') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - IF (OutArgs(1) == Blank) THEN - OutArgs(1)='*' - nodiff=.false. - ENDIF - CALL ScanOutputVariablesForReplacement( & - 2, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .false., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .false.) - IF (DelThis) CYCLE - -!EnergyManagementSystem:Sensor, field 3 - CASE('ENERGYMANAGEMENTSYSTEM:SENSOR') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - CALL ScanOutputVariablesForReplacement( & - 3, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .false., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .true.) - IF (DelThis) CYCLE - - CASE('OUTPUT:TABLE:MONTHLY') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.true. - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - CurVar=3 - DO Var=3,CurArgs,2 - UCRepVarName=MakeUPPERCase(InArgs(Var)) - OutArgs(CurVar)=InArgs(Var) - OutArgs(CurVar+1)=InArgs(Var+1) - pos=INDEX(UCRepVarName,'[') - IF (pos > 0) THEN - UCRepVarName=UCRepVarName(1:pos-1) - OutArgs(CurVar)=InArgs(Var)(1:pos-1) - OutArgs(CurVar+1)=InArgs(Var+1) - ENDIF - DelThis=.false. - DO Arg=1,NumRepVarNames - UCCompRepVarName=MakeUPPERCase(OldRepVarName(Arg)) - IF (UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName)) == '*') THEN - WildMatch=.true. - UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName))=' ' - pos=INDEX(TRIM(UCRepVarname),TRIM(UCCompRepVarName)) - ELSE - WildMatch=.false. - pos=0 - if (UCRepVarName == UCCompRepVarName) pos=1 - ENDIF - IF (pos > 0 .and. pos /= 1) CYCLE - IF (pos > 0) THEN - IF (NewRepVarName(Arg) /= '') THEN - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg) /= Blank .and. .not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq') ) THEN - IF (.not. OTMVarCaution(Arg)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Output Table Monthly (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Output Table Monthly (new)="'// & - trim(NewRepVarName(Arg))//'" has the following caution "'//trim(NewRepVarCaution(Arg))//'".') - write(diflfn,fmtA) ' ' - OTMVarCaution(Arg)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ELSE - DelThis=.true. - ENDIF - IF (OldRepVarName(Arg) == OldRepVarName(Arg+1)) THEN - IF (.not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq')) THEN - ! Adding a var field. - CurVar=CurVar+2 - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg+1) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg+1))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg+1) /= Blank) THEN - IF (.not. OTMVarCaution(Arg+1)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Output Table Monthly (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Output Table Monthly (new)="'// & - trim(NewRepVarName(Arg+1))//'" has the following caution "'//trim(NewRepVarCaution(Arg+1))//'".') - write(diflfn,fmtA) ' ' - OTMVarCaution(Arg+1)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ENDIF - ENDIF - IF (OldRepVarName(Arg) == OldRepVarName(Arg+2)) THEN ! only 1 more... for ForkEq - ! Adding a var field. - CurVar=CurVar+2 - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg+2) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg+2))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg+2) /= Blank) THEN - IF (.not. OTMVarCaution(Arg+2)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Output Table Monthly (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Output Table Monthly (new)="'// & - trim(NewRepVarName(Arg+2))//'" has the following caution "'//trim(NewRepVarCaution(Arg+2))//'".') - write(diflfn,fmtA) ' ' - OTMVarCaution(Arg+2)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ENDIF - EXIT - ENDIF - ENDDO - IF (.not. DelThis) CurVar=CurVar+2 - ENDDO - CurArgs=CurVar-1 - - CASE('METER:CUSTOM') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - CurVar=4 - DO Var=4,CurArgs,2 - UCRepVarName=MakeUPPERCase(InArgs(Var)) - OutArgs(CurVar)=InArgs(Var) - OutArgs(CurVar+1)=InArgs(Var+1) - pos=INDEX(UCRepVarName,'[') - IF (pos > 0) THEN - UCRepVarName=UCRepVarName(1:pos-1) - OutArgs(CurVar)=InArgs(Var)(1:pos-1) - OutArgs(CurVar+1)=InArgs(Var+1) - ENDIF - DelThis=.false. - DO Arg=1,NumRepVarNames - UCCompRepVarName=MakeUPPERCase(OldRepVarName(Arg)) - IF (UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName)) == '*') THEN - WildMatch=.true. - UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName))=' ' - pos=INDEX(TRIM(UCRepVarname),TRIM(UCCompRepVarName)) - ELSE - WildMatch=.false. - pos=0 - if (UCRepVarName == UCCompRepVarName) pos=1 - ENDIF - IF (pos > 0 .and. pos /= 1) CYCLE - IF (pos > 0) THEN - IF (NewRepVarName(Arg) /= '') THEN - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg) /= Blank .and. .not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq') ) THEN - IF (.not. CMtrVarCaution(Arg)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Custom Meter (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Custom Meter (new)="'// & - trim(NewRepVarName(Arg))//'" has the following caution "'//trim(NewRepVarCaution(Arg))//'".') - write(diflfn,fmtA) ' ' - CMtrVarCaution(Arg)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ELSE - DelThis=.true. - ENDIF - IF (OldRepVarName(Arg) == OldRepVarName(Arg+1)) THEN - IF (.not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq')) THEN - ! Adding a var field. - CurVar=CurVar+2 - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg+1) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg+1))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg+1) /= Blank .and. .not. SameString(NewRepVarCaution(Arg+1)(1:6),'Forkeq') ) THEN - IF (.not. CMtrVarCaution(Arg+1)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Custom Meter (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Custom Meter (new)="'// & - trim(NewRepVarName(Arg+1))//'" has the following caution "'//trim(NewRepVarCaution(Arg+1))//'".') - write(diflfn,fmtA) ' ' - CMtrVarCaution(Arg+1)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ENDIF - ENDIF - IF (OldRepVarName(Arg) == OldRepVarName(Arg+2)) THEN - ! Adding a var field. - CurVar=CurVar+2 - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg+2) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg+2))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg+2) /= Blank) THEN - IF (.not. CMtrVarCaution(Arg+2)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Custom Meter (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Custom Meter (new)="'// & - trim(NewRepVarName(Arg+2))//'" has the following caution "'//trim(NewRepVarCaution(Arg+2))//'".') - write(diflfn,fmtA) ' ' - CMtrVarCaution(Arg+2)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ENDIF - EXIT - ENDIF - ENDDO - IF (.not. DelThis) CurVar=CurVar+2 - ENDDO - CurArgs=CurVar - DO Arg=CurVar,1,-1 - IF (OutArgs(Arg) == Blank) THEN - CurArgs=CurArgs-1 - ELSE - EXIT - ENDIF - ENDDO - - CASE('METER:CUSTOMDECREMENT') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - CurVar=4 ! In case Source Meter would change - DO Var=4,CurArgs,2 - UCRepVarName=MakeUPPERCase(InArgs(Var)) - OutArgs(CurVar)=InArgs(Var) - OutArgs(CurVar+1)=InArgs(Var+1) - pos=INDEX(UCRepVarName,'[') - IF (pos > 0) THEN - UCRepVarName=UCRepVarName(1:pos-1) - OutArgs(CurVar)=InArgs(Var)(1:pos-1) - OutArgs(CurVar+1)=InArgs(Var+1) - ENDIF - DelThis=.false. - DO Arg=1,NumRepVarNames - UCCompRepVarName=MakeUPPERCase(OldRepVarName(Arg)) - IF (UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName)) == '*') THEN - WildMatch=.true. - UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName))=' ' - pos=INDEX(TRIM(UCRepVarname),TRIM(UCCompRepVarName)) - ELSE - WildMatch=.false. - pos=0 - if (UCRepVarName == UCCompRepVarName) pos=1 - ENDIF - IF (pos > 0 .and. pos /= 1) CYCLE - IF (pos > 0) THEN - IF (NewRepVarName(Arg) /= '') THEN - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg) /= Blank .and. .not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq') ) THEN - IF (.not. CMtrDVarCaution(Arg)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Custom Decrement Meter (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Custom Meter (new)="'// & - trim(NewRepVarName(Arg))//'" has the following caution "'//trim(NewRepVarCaution(Arg))//'".') - write(diflfn,fmtA) ' ' - CMtrDVarCaution(Arg)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ELSE - DelThis=.true. - ENDIF - IF (OldRepVarName(Arg) == OldRepVarName(Arg+1)) THEN - IF (.not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq')) THEN - ! Adding a var field. - CurVar=CurVar+2 - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg+1) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg+1))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg+1) /= Blank .and. .not. SameString(NewRepVarCaution(Arg+1)(1:6),'Forkeq') ) THEN - IF (.not. CMtrDVarCaution(Arg+1)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Custom Decrement Meter (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Custom Decrement Meter (new)="'// & - trim(NewRepVarName(Arg+1))//'" has the following caution "'//trim(NewRepVarCaution(Arg+1))//'".') - write(diflfn,fmtA) ' ' - CMtrDVarCaution(Arg+1)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ENDIF - ENDIF - IF (OldRepVarName(Arg) == OldRepVarName(Arg+2)) THEN - ! Adding a var field. - CurVar=CurVar+2 - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg+2) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg+2))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg+2) /= Blank) THEN - IF (.not. CMtrDVarCaution(Arg+2)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Custom Decrement Meter (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Custom Meter (new)="'// & - trim(NewRepVarName(Arg+2))//'" has the following caution "'//trim(NewRepVarCaution(Arg+2))//'".') - write(diflfn,fmtA) ' ' - CMtrDVarCaution(Arg+2)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ENDIF - EXIT - ENDIF - ENDDO - IF (.not. DelThis) CurVar=CurVar+2 - ENDDO - CurArgs=CurVar - DO Arg=CurVar,1,-1 - IF (OutArgs(Arg) == Blank) THEN - CurArgs=CurArgs-1 - ELSE - EXIT - ENDIF - ENDDO - - !!! Changes for other objects that reference meter names -- update names - CASE('DEMANDMANAGERASSIGNMENTLIST', & - 'UTILITYCOST:TARIFF') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - - CALL ScanOutputVariablesForReplacement( & - 2, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .true., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .false.) - - CASE('ELECTRICLOADCENTER:DISTRIBUTION') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - - ! Field 6 A5, \field Generator Track Meter Scheme Meter Name - CALL ScanOutputVariablesForReplacement( & - 6, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .true., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .false.) - - ! Field 12 A11, \field Storage Control Track Meter Name - CALL ScanOutputVariablesForReplacement( & - 12, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .true., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .false.) - - ! ANY OTHER OBJECT - CASE DEFAULT - IF (FindItemInList(ObjectName,NotInNew,SIZE(NotInNew)) /= 0) THEN - WRITE(Auditf,fmta) 'Object="'//TRIM(ObjectName)//'" is not in the "new" IDD.' - WRITE(Auditf,fmta) '... will be listed as comments on the new output file.' - CALL WriteOutIDFLinesAsComments(DifLfn,ObjectName,CurArgs,InArgs,FldNames,FldUnits) - Written=.true. - !CYCLE - ELSE - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - NoDiff=.true. - ENDIF - - END SELECT - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IF ONLY MAKING PRETTY !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ELSE !!! Making Pretty - - ! Just making pretty -- no changes as above. - CALL GetNewObjectDefInIDD(IDFRecords(Num)%Name,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - ENDIF - - IF (DiffMinFields .and. nodiff) THEN - ! Change in min-fields - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - NoDiff=.false. - DO Arg=CurArgs+1,NwObjMinFlds - OutArgs(Arg)=NwFldDefaults(Arg) - ENDDO - CurArgs=MAX(NwObjMinFlds,CurArgs) - ENDIF - - IF (NoDiff .and. DiffOnly) CYCLE - - !! reformat for better readability - !! BUILDING,SOLUTION ALGORITHM,OUTSIDE CONVECTION ALGORITHM,INSIDE CONVECTION ALGORITHM,REPORT VARIABLE, - !! SURFACE:HEATTRANSFER,SURFACE:HEATTRANSFER:SUBSURFACE:SHADING:DETACHED, - !! SURFACE:SHADING:DETACHED:FIXED,SURFACE:SHADING:DETACHED:BUILDING, - !! SURFACE:SHADING:ATTACHED, - !! WINDOWGLASSSPECTRALDATA, - !! FLUIDPROPERTYTEMPERATURES, - !! FLUIDPROPERTYSATURATED,FLUIDPROPERTYSUPERHEATED,FLUIDPROPERTYCONCENTRATION - IF (.not. Written) THEN - CALL CheckSpecialObjects(DifLfn,ObjectName,CurArgs,OutArgs,NwFldNames,NwFldUnits,Written) - ENDIF - - IF (.not. Written) THEN - CALL WriteOutIDFLines(DifLfn,ObjectName,CurArgs,OutArgs,NwFldNames,NwFldUnits) - ENDIF - - ENDDO ! IDFRecords - - CALL DisplayString('Processing IDF -- Processing idf objects complete.') - IF (IDFRecords(NumIDFRecords)%CommtE /= CurComment) THEN - DO xcount=IDFRecords(NumIDFRecords)%CommtE+1,CurComment - WRITE(DifLfn,fmta) TRIM(Comments(xcount)) - if (xcount == IDFRecords(Num)%CommtE) WRITE(DifLfn,fmta) '' - ENDDO - ENDIF - - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! E N D O F P R O C E S S I N G ! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - - IF (GetNumSectionsFound('Report Variable Dictionary') > 0) THEN - ObjectName='Output:VariableDictionary' - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1)='Regular' - CurArgs=1 - CALL WriteOutIDFLines(DifLfn,ObjectName,CurArgs,OutArgs,NwFldNames,NwFldUnits) - ENDIF - - INQUIRE(FILE=trim(FileNamePath)//'.rvi',EXIST=FileExist) -! IF (FileExist) THEN -! CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & -! 'rvi file associated with this input is being processed. Review for accuracy.') -! write(diflfn,fmtA) ' ' -! ENDIF - CLOSE(DifLfn) - CALL ProcessRviMviFiles(FileNamePath,'rvi') - CALL ProcessRviMviFiles(FileNamePath,'mvi') - CALL CloseOut - ELSE ! not a idf or imf - CALL ProcessRviMviFiles(FileNamePath,'rvi') - CALL ProcessRviMviFiles(FileNamePath,'mvi') - ENDIF - ELSE ! Full name == Blank - EndOfFile=.true. - ENDIF - - CALL CreateNewName('Reallocate',CreatedOutputName,' ') - - ENDDO - - IF (.not. ExitBecauseBadFile) THEN - StillWorking=.false. - EXIT - ELSE - IF (.not. ArgFileBeingDone) THEN - EndOfFile=.false. - ELSE - EndOfFile=.true. - StillWorking=.false. - ENDIF - ENDIF - ENDDO - - IF (ArgFileBeingDone .and. .not. LatestVersion .and. .not. ExitBecauseBadFile) THEN - ! If this is true, then there was a "arg IDF File" on the command line and some files need to be renamed - ErrFlag=.false. - CALL copyfile(TRIM(FileNamePath)//'.'//TRIM(ArgIDFExtension),TRIM(FileNamePath)//'.'//TRIM(ArgIDFExtension)//'old',ErrFlag) - CALL copyfile(TRIM(FileNamePath)//'.'//TRIM(ArgIDFExtension)//'new',TRIM(FileNamePath)//'.'//TRIM(ArgIDFExtension),ErrFlag) - INQUIRE(File=TRIM(FileNamePath)//'.rvi',EXIST=FileExist) - IF (FileExist) THEN - CALL copyfile(TRIM(FileNamePath)//'.rvi',TRIM(FileNamePath)//'.rviold',ErrFlag) - ENDIF - INQUIRE(File=TRIM(FileNamePath)//'.rvinew',EXIST=FileExist) - IF (FileExist) THEN - CALL copyfile(TRIM(FileNamePath)//'.rvinew',TRIM(FileNamePath)//'.rvi',ErrFlag) - ENDIF - INQUIRE(File=TRIM(FileNamePath)//'.mvi',EXIST=FileExist) - IF (FileExist) THEN - CALL copyfile(TRIM(FileNamePath)//'.mvi',TRIM(FileNamePath)//'.mviold',ErrFlag) - ENDIF - INQUIRE(File=TRIM(FileNamePath)//'.mvinew',EXIST=FileExist) - IF (FileExist) THEN - CALL copyfile(TRIM(FileNamePath)//'.mvinew',TRIM(FileNamePath)//'.mvi',ErrFlag) - ENDIF - ENDIF - - RETURN - -END SUBROUTINE CreateNewIDFUsingRules \ No newline at end of file From 788222629ac708b325fa66748309fc238c1ef915 Mon Sep 17 00:00:00 2001 From: lymereJ Date: Fri, 10 Oct 2025 12:11:53 -0700 Subject: [PATCH 17/30] Temporarily remove this file. --- .../CreateNewIDFUsingRulesV25_2_0.f90 | 1141 ----------------- .../CreateNewIDFUsingRulesv25_2_0.f90 | 1141 ----------------- 2 files changed, 2282 deletions(-) delete mode 100644 src/Transition/CreateNewIDFUsingRulesV25_2_0.f90 delete mode 100644 src/Transition/CreateNewIDFUsingRulesv25_2_0.f90 diff --git a/src/Transition/CreateNewIDFUsingRulesV25_2_0.f90 b/src/Transition/CreateNewIDFUsingRulesV25_2_0.f90 deleted file mode 100644 index 3e11c9df634..00000000000 --- a/src/Transition/CreateNewIDFUsingRulesV25_2_0.f90 +++ /dev/null @@ -1,1141 +0,0 @@ -MODULE SetVersion - -USE DataStringGlobals -USE DataVCompareGlobals - -PUBLIC - -CONTAINS - -SUBROUTINE SetThisVersionVariables() - ! TODO: Update this section as appropriate - VerString='Conversion 25.1 => 25.2' - VersionNum=25.2 - ! Starting with version 22.1, the version string requires 4 characters - ! The original sVersionNum variable is a 3 character length string - ! If we just change that variable to be 4 characters, it could break everything before 22.1 - ! So instead, let's just move forward with a new 4 character string and use that in this file and the future - ! If we get to version 100.1 and we are still using this Fortran transition then well....we can deal with it then - sVersionNum = '***' - sVersionNumFourChars='25.2' - IDDFileNameWithPath=TRIM(ProgramPath)//'V25-1-0-Energy+.idd' - NewIDDFileNameWithPath=TRIM(ProgramPath)//'V25-2-0-Energy+.idd' - RepVarFileNameWithPath=TRIM(ProgramPath)//'Report Variables 25-1-0 to 25-2-0.csv' -END SUBROUTINE - -END MODULE - -SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFileName,ArgFile,ArgIDFExtension) - - ! SUBROUTINE INFORMATION: - ! AUTHOR Linda Lawrie - ! DATE WRITTEN July 2002 - ! MODIFIED For each release - ! RE-ENGINEERED na - - ! PURPOSE OF THIS SUBROUTINE: - ! This subroutine creates new IDFs based on the rules specified by - ! developers. This will result in a more complete transition but - ! takes more time to create. - - ! METHODOLOGY EMPLOYED: - ! na - - ! REFERENCES: - ! na - - ! USE STATEMENTS: - USE InputProcessor - USE DataVCompareGlobals - USE VCompareGlobalRoutines - USE DataStringGlobals, ONLY: ProgNameConversion - USE General - USE DataGlobals, ONLY: ShowMessage, ShowContinueError, ShowFatalError, ShowSevereError, ShowWarningError - - IMPLICIT NONE ! Enforce explicit typing of all variables in this routine - - ! SUBROUTINE ARGUMENT DEFINITIONS: - LOGICAL, INTENT(INOUT) :: EndOfFile - LOGICAL, INTENT(IN) :: DiffOnly - INTEGER, INTENT(IN) :: InLfn - LOGICAL, INTENT(IN) :: AskForInput - CHARACTER(len=*), INTENT(IN) :: InputFileName - LOGICAL, INTENT(IN) :: ArgFile - CHARACTER(len=*), INTENT(IN) :: ArgIDFExtension - - ! SUBROUTINE PARAMETER DEFINITIONS: - CHARACTER(len=*), PARAMETER :: fmta="(A)" - - ! INTERFACE BLOCK SPECIFICATIONS - ! na - - ! DERIVED TYPE DEFINITIONS - - ! SUBROUTINE LOCAL VARIABLE DECLARATIONS: - INTEGER IoS - INTEGER DotPos - INTEGER Status - INTEGER NA - INTEGER NN - INTEGER CurArgs - INTEGER DifLfn - INTEGER xCount - INTEGER Num - INTEGER, EXTERNAL :: GetNewUnitNumber - INTEGER Arg - LOGICAL, SAVE :: FirstTime=.true. - CHARACTER(len=30) UnitsArg - CHARACTER(len=MaxNameLength) :: ObjectName - CHARACTER(len=30), EXTERNAL :: TrimTrailZeros - CHARACTER(len=MaxNameLength) :: UCRepVarName=blank - CHARACTER(len=MaxNameLength) :: UCCompRepVarName=blank - LOGICAL DelThis - INTEGER pos - INTEGER pos2 - LOGICAL ExitBecauseBadFile - LOGICAL StillWorking - LOGICAL NoDiff - LOGICAL checkrvi - LOGICAL NoVersion - LOGICAL DiffMinFields ! Set to true when diff number of min-fields between the two objects - LOGICAL Written - INTEGER :: Var - INTEGER :: CurVar - LOGICAL ArgFileBeingDone - LOGICAL LatestVersion - CHARACTER(len=10) :: LocalFileExtension=' ' - LOGICAL :: WildMatch - - LOGICAL :: ConnComp - LOGICAL :: ConnCompCtrl - LOGICAL :: FileExist - CHARACTER(len=MaxNameLength) :: CreatedOutputName - LOGICAL, ALLOCATABLE, DIMENSION(:) :: DeleteThisRecord - INTEGER :: COutArgs - CHARACTER(len=16) :: UnitsField - - LOGICAL :: ErrFlag - - INTEGER :: I, CurField, NewField, KAindex=0, SearchNum - INTEGER :: AlphaNumI - REAL :: SaveNumber - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! I N S E R T L O C A L V A R I A B L E S H E R E ! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - - ! TODO: Move to V10_0_0.f90 when available - ! For Defaulting now-required RunPeriod Name - INTEGER :: TotRunPeriods = 0 - INTEGER :: runPeriodNum = 0 - INTEGER :: iterateRunPeriod = 0 - CHARACTER(len=MaxNameLength), ALLOCATABLE, DIMENSION(:) :: CurrentRunPeriodNames - CHARACTER(len=20) :: PotentialRunPeriodName - ! END OF TODO - - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! E N D O F I N S E R T L O C A L V A R I A B L E S H E R E ! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - - If (FirstTime) THEN ! do things that might be applicable only to this new version - FirstTime=.false. - EndIf - - StillWorking=.true. - ArgFileBeingDone=.false. - LatestVersion=.false. - NoVersion=.true. - LocalFileExtension=ArgIDFExtension - EndOfFile=.false. - IOS=0 - - DO WHILE (StillWorking) - - ExitBecauseBadFile=.false. - DO WHILE (.not. EndOfFile) - IF (AskForInput) THEN - WRITE(*,*) 'Enter input file name, with path' - write(*,fmta,advance='no') '-->' - READ(*,fmta) FullFileName - ELSE - IF (.not. ArgFile) THEN - READ(InLfn,*,IOSTAT=IoS) FullFileName - ELSEIF (.not. ArgFileBeingDone) THEN - FullFileName=InputFileName - IOS=0 - ArgFileBeingDone=.true. - ELSE - FullFileName=Blank - IOS=1 - ENDIF - IF (FullFileName(1:1) == '!') THEN - FullFileName=Blank - CYCLE - ENDIF - ENDIF - UnitsArg=Blank - IF (IoS /= 0) FullFileName=Blank - FullFileName=ADJUSTL(FullFileName) - IF (FullFileName /= Blank) THEN - CALL DisplayString('Processing IDF -- '//TRIM(FullFileName)) - WRITE(Auditf,fmta) ' Processing IDF -- '//TRIM(FullFileName) - DotPos=SCAN(FullFileName,'.',.true.) ! Scan backward looking for extension, - IF (DotPos /= 0) THEN - FileNamePath=FullFileName(1:DotPos-1) - LocalFileExtension=MakeLowerCase(FullFileName(DotPos+1:)) - ELSE - FileNamePath=FullFileName - WRITE(*,*) ' assuming file extension of .idf' - WRITE(Auditf,fmta) ' ..assuming file extension of .idf' - FullFileName=TRIM(FullFileName)//'.idf' - LocalFileExtension='idf' - ENDIF - ! Process the old input - DifLfn=GetNewUnitNumber() - INQUIRE(File=TRIM(FullFileName),EXIST=FileOK) - IF (.not. FileOK) THEN - WRITE(*,*) 'File not found='//TRIM(FullFileName) - WRITE(Auditf,*) 'File not found='//TRIM(FullFileName) - EndOfFile=.true. - ExitBecauseBadFile=.true. - EXIT - ENDIF - IF (LocalFileExtension == 'idf' .or. LocalFileExtension == 'imf') THEN - checkrvi=.false. - ConnComp=.false. - ConnCompCtrl=.false. - IF (DiffOnly) THEN - OPEN(DifLfn,FILE=TRIM(FileNamePath)//'.'//TRIM(LocalFileExtension)//'dif') - ELSE - OPEN(DifLfn,FILE=TRIM(FileNamePath)//'.'//TRIM(LocalFileExtension)//'new') - ENDIF - IF (LocalFileExtension == 'imf') THEN - CALL ShowWarningError('Note: IMF file being processed. No guarantee of perfection. Please check new file carefully.',Auditf) - ProcessingIMFFile=.true. - ELSE - ProcessingIMFFile=.false. - ENDIF - CALL ProcessInput(IDDFileNameWithPath,NewIDDFileNameWithPath,FullFileName) - IF (FatalError) THEN - ExitBecauseBadFile=.true. - EXIT - ENDIF - - ! Clean up from any previous passes, then re-allocate. These are for the 'standard' stuff, not your own - ! Do not add anything here! - IF(ALLOCATED(DeleteThisRecord)) DEALLOCATE(DeleteThisRecord) - IF(ALLOCATED(Alphas)) DEALLOCATE(Alphas) - IF(ALLOCATED(Numbers)) DEALLOCATE(Numbers) - IF(ALLOCATED(InArgs)) DEALLOCATE(InArgs) - IF(ALLOCATED(TempArgs)) DEALLOCATE(TempArgs) - IF(ALLOCATED(AorN)) DEALLOCATE(AorN) - IF(ALLOCATED(ReqFld)) DEALLOCATE(ReqFld) - IF(ALLOCATED(FldNames)) DEALLOCATE(FldNames) - IF(ALLOCATED(FldDefaults)) DEALLOCATE(FldDefaults) - IF(ALLOCATED(FldUnits)) DEALLOCATE(FldUnits) - IF(ALLOCATED(NwAorN)) DEALLOCATE(NwAorN) - IF(ALLOCATED(NwReqFld)) DEALLOCATE(NwReqFld) - IF(ALLOCATED(NwFldNames)) DEALLOCATE(NwFldNames) - IF(ALLOCATED(NwFldDefaults)) DEALLOCATE(NwFldDefaults) - IF(ALLOCATED(NwFldUnits)) DEALLOCATE(NwFldUnits) - IF(ALLOCATED(OutArgs)) DEALLOCATE(OutArgs) - ALLOCATE(Alphas(MaxAlphaArgsFound),Numbers(MaxNumericArgsFound)) - ALLOCATE(InArgs(MaxTotalArgs)) - ALLOCATE(TempArgs(MaxTotalArgs)) - ALLOCATE(AorN(MaxTotalArgs),ReqFld(MaxTotalArgs),FldNames(MaxTotalArgs),FldDefaults(MaxTotalArgs),FldUnits(MaxTotalArgs)) - ALLOCATE(NwAorN(MaxTotalArgs),NwReqFld(MaxTotalArgs),NwFldNames(MaxTotalArgs),NwFldDefaults(MaxTotalArgs),NwFldUnits(MaxTotalArgs)) - ALLOCATE(OutArgs(MaxTotalArgs)) - ALLOCATE(DeleteThisRecord(NumIDFRecords)) - DeleteThisRecord=.false. - - NoVersion=.true. - DO Num=1,NumIDFRecords - IF (MakeUPPERCase(IDFRecords(Num)%Name) /= 'VERSION') CYCLE - NoVersion=.false. - EXIT - ENDDO - - DO Num=1,NumIDFRecords - IF (DeleteThisRecord(Num)) THEN - Write(DifLfn,fmta) '! Deleting: '//TRIM(IDFRecords(Num)%Name)//'="'//TRIM(IDFRecords(Num)%Alphas(1))//'".' - ENDIF - ENDDO - - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! P R E P R O C E S S I N G ! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -! Do any kind of Preprocessing that is needed here (eg: a first pass on objects to store some attributes etc) - - - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! P R O C E S S I N G ! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - CALL DisplayString('Processing IDF -- Processing idf objects . . .') - DO Num=1,NumIDFRecords - - IF (DeleteThisRecord(Num)) CYCLE - DO xcount=IDFRecords(Num)%CommtS+1,IDFRecords(Num)%CommtE - WRITE(DifLfn,fmta) TRIM(Comments(xcount)) - if (xcount == IDFRecords(Num)%CommtE) WRITE(DifLfn,fmta) '' - ENDDO - IF (NoVersion .and. Num == 1) THEN - CALL GetNewObjectDefInIDD('VERSION',NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1) = sVersionNumFourChars - CurArgs=1 - CALL ShowWarningError('No version found in file, defaulting to '//sVersionNumFourChars,Auditf) - CALL WriteOutIDFLinesAsComments(DifLfn,'Version',CurArgs,OutArgs,NwFldNames,NwFldUnits) - ENDIF - - ! deleted objects. no transition. - ! eg: IF (MakeUPPERCase(TRIM(IDFRecords(Num)%Name)) == 'PROGRAMCONTROL') CYCLE - - ObjectName=IDFRecords(Num)%Name - IF (FindItemInList(ObjectName,ObjectDef%Name,NumObjectDefs) /= 0) THEN - CALL GetObjectDefInIDD(ObjectName,NumArgs,AorN,ReqFld,ObjMinFlds,FldNames,FldDefaults,FldUnits) - NumAlphas=IDFRecords(Num)%NumAlphas - NumNumbers=IDFRecords(Num)%NumNumbers - Alphas(1:NumAlphas)=IDFRecords(Num)%Alphas(1:NumAlphas) - Numbers(1:NumNumbers)=IDFRecords(Num)%Numbers(1:NumNumbers) - CurArgs=NumAlphas+NumNumbers - InArgs=Blank - OutArgs=Blank - TempArgs=Blank - NA=0 - NN=0 - DO Arg=1,CurArgs - IF (AorN(Arg)) THEN - NA=NA+1 - InArgs(Arg)=Alphas(NA) - ELSE - NN=NN+1 - InArgs(Arg)=Numbers(NN) - ENDIF - ENDDO - ELSE - WRITE(Auditf,fmta) 'Object="'//TRIM(ObjectName)//'" does not seem to be on the "old" IDD.' - WRITE(Auditf,fmta) '... will be listed as comments (no field names) on the new output file.' - WRITE(Auditf,fmta) '... Alpha fields will be listed first, then numerics.' - NumAlphas=IDFRecords(Num)%NumAlphas - NumNumbers=IDFRecords(Num)%NumNumbers - Alphas(1:NumAlphas)=IDFRecords(Num)%Alphas(1:NumAlphas) - Numbers(1:NumNumbers)=IDFRecords(Num)%Numbers(1:NumNumbers) - DO Arg=1,NumAlphas - OutArgs(Arg)=Alphas(Arg) - ENDDO - NN=NumAlphas+1 - DO Arg=1,NumNumbers - OutArgs(NN)=Numbers(Arg) - NN=NN+1 - ENDDO - CurArgs=NumAlphas+NumNumbers - NwFldNames=Blank - NwFldUnits=Blank - CALL WriteOutIDFLinesAsComments(DifLfn,ObjectName,CurArgs,OutArgs,NwFldNames,NwFldUnits) - CYCLE - ENDIF - - Nodiff=.true. ! Nodiff is true by default - DiffMinFields=.false. - Written=.false. - - IF (FindItemInList(MakeUPPERCase(ObjectName),NotInNew,SIZE(NotInNew)) == 0) THEN - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - ! Check minfields - IF (ObjMinFlds /= NwObjMinFlds) THEN - DiffMinFields=.true. - ELSE - DiffMinFields=.false. - ENDIF - ENDIF - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IF NOT ONLY MAKING PRETTY !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - IF (.not. MakingPretty) THEN - - SELECT CASE (MakeUPPERCase(TRIM(IDFRecords(Num)%Name))) - - CASE ('VERSION') - IF ((InArgs(1)(1:4)) == sVersionNumFourChars .and. ArgFile) THEN - CALL ShowWarningError('File is already at latest version. No new diff file made.',Auditf) - CLOSE(diflfn,STATUS='DELETE') - LatestVersion=.true. - EXIT - ENDIF - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1) = sVersionNumFourChars - NoDiff=.false. - - ! changes for this version, pick one of the spots to add rules, this will reduce the possibility of merge conflicts - -! CASE('OBJECTNAMEHERE') -! CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) -! nodiff=.false. -! OutArgs(1)=InArgs(1) -! OutArgs(2) = 'SequentialLoad' -! OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) -! CurArgs = CurArgs + 1 - - ! If your original object starts with A, insert the rules here - - ! If your original object starts with C, insert the rules here - CASE('COIL:COOLING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:HEATING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:COOLING:DX:VARIABLESPEED') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:HEATING:DX:VARIABLESPEED') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:WATERHEATING:AIRTOWATERHEATPUMP:VARIABLESPEED') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:COOLING:WATERTOAIRHEATPUMP:EQUATIONFIT') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:HEATING:WATERTOAIRHEATPUMP:EQUATIONFIT') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:COOLING:WATERTOAIRHEATPUMP:PARAMETERESTIMATION') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:HEATING:WATERTOAIRHEATPUMP:PARAMETERESTIMATION') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:WATERHEATING:AIRTOWATERHEATPUMP:PUMPED') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:WATERHEATING:AIRTOWATERHEATPUMP:WRAPPED') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - ! If your original object starts with D, insert the rules here - - ! If your original object starts with E, insert the rules here - - ! If your original object starts with F, insert the rules here - - ! If your original object starts with G, insert the rules here - - ! If your original object starts with H, insert the rules here - - ! If your original object starts with I, insert the rules here - - ! If your original object starts with L, insert the rules here - - ! If your original object starts with M, insert the rules here - - ! If your original object starts with N, insert the rules here - - ! If your original object starts with O, insert the rules here - - ! If your original object starts with P, insert the rules here - - ! If your original object starts with R, insert the rules here - - ! If your original object starts with S, insert the rules here - - ! If your original object starts with T, insert the rules here - - ! If your original object starts with U, insert the rules here - - ! If your original object starts with V, insert the rules here - - ! If your original object starts with W, insert the rules here - - ! If your original object starts with Z, insert the rules here - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! Changes for report variables, meters, tables -- update names ! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -! TODO: not sure if need to keep all of this... - - !!! Changes for report variables, meters, tables -- update names - CASE('OUTPUT:VARIABLE') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - IF (OutArgs(1) == Blank) THEN - OutArgs(1)='*' - nodiff=.false. - ENDIF - - CALL ScanOutputVariablesForReplacement( & - 2, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .true., & !OutVar - .false., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .false.) - IF (DelThis) CYCLE - - CASE ('OUTPUT:METER','OUTPUT:METER:METERFILEONLY','OUTPUT:METER:CUMULATIVE','OUTPUT:METER:CUMULATIVE:METERFILEONLY') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - CALL ScanOutputVariablesForReplacement( & - 1, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .true., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .false.) - IF (DelThis) CYCLE - - CASE('OUTPUT:TABLE:TIMEBINS') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - IF (OutArgs(1) == Blank) THEN - OutArgs(1)='*' - nodiff=.false. - ENDIF - CALL ScanOutputVariablesForReplacement( & - 2, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .false., & !MtrVar - .true., & !TimeBinVar - CurArgs, & - Written, & - .false.) - IF (DelThis) CYCLE - -!ExternalInterface:FunctionalMockupUnitImport:From:Variable, field 2 -!ExternalInterface:FunctionalMockupUnitExport:From:Variable, field 2 - CASE('EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT:FROM:VARIABLE', & - 'EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITEXPORT:FROM:VARIABLE') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - IF (OutArgs(1) == Blank) THEN - OutArgs(1)='*' - nodiff=.false. - ENDIF - CALL ScanOutputVariablesForReplacement( & - 2, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .false., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .false.) - IF (DelThis) CYCLE - -!EnergyManagementSystem:Sensor, field 3 - CASE('ENERGYMANAGEMENTSYSTEM:SENSOR') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - CALL ScanOutputVariablesForReplacement( & - 3, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .false., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .true.) - IF (DelThis) CYCLE - - CASE('OUTPUT:TABLE:MONTHLY') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.true. - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - CurVar=3 - DO Var=3,CurArgs,2 - UCRepVarName=MakeUPPERCase(InArgs(Var)) - OutArgs(CurVar)=InArgs(Var) - OutArgs(CurVar+1)=InArgs(Var+1) - pos=INDEX(UCRepVarName,'[') - IF (pos > 0) THEN - UCRepVarName=UCRepVarName(1:pos-1) - OutArgs(CurVar)=InArgs(Var)(1:pos-1) - OutArgs(CurVar+1)=InArgs(Var+1) - ENDIF - DelThis=.false. - DO Arg=1,NumRepVarNames - UCCompRepVarName=MakeUPPERCase(OldRepVarName(Arg)) - IF (UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName)) == '*') THEN - WildMatch=.true. - UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName))=' ' - pos=INDEX(TRIM(UCRepVarname),TRIM(UCCompRepVarName)) - ELSE - WildMatch=.false. - pos=0 - if (UCRepVarName == UCCompRepVarName) pos=1 - ENDIF - IF (pos > 0 .and. pos /= 1) CYCLE - IF (pos > 0) THEN - IF (NewRepVarName(Arg) /= '') THEN - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg) /= Blank .and. .not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq') ) THEN - IF (.not. OTMVarCaution(Arg)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Output Table Monthly (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Output Table Monthly (new)="'// & - trim(NewRepVarName(Arg))//'" has the following caution "'//trim(NewRepVarCaution(Arg))//'".') - write(diflfn,fmtA) ' ' - OTMVarCaution(Arg)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ELSE - DelThis=.true. - ENDIF - IF (OldRepVarName(Arg) == OldRepVarName(Arg+1)) THEN - IF (.not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq')) THEN - ! Adding a var field. - CurVar=CurVar+2 - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg+1) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg+1))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg+1) /= Blank) THEN - IF (.not. OTMVarCaution(Arg+1)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Output Table Monthly (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Output Table Monthly (new)="'// & - trim(NewRepVarName(Arg+1))//'" has the following caution "'//trim(NewRepVarCaution(Arg+1))//'".') - write(diflfn,fmtA) ' ' - OTMVarCaution(Arg+1)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ENDIF - ENDIF - IF (OldRepVarName(Arg) == OldRepVarName(Arg+2)) THEN ! only 1 more... for ForkEq - ! Adding a var field. - CurVar=CurVar+2 - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg+2) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg+2))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg+2) /= Blank) THEN - IF (.not. OTMVarCaution(Arg+2)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Output Table Monthly (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Output Table Monthly (new)="'// & - trim(NewRepVarName(Arg+2))//'" has the following caution "'//trim(NewRepVarCaution(Arg+2))//'".') - write(diflfn,fmtA) ' ' - OTMVarCaution(Arg+2)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ENDIF - EXIT - ENDIF - ENDDO - IF (.not. DelThis) CurVar=CurVar+2 - ENDDO - CurArgs=CurVar-1 - - CASE('METER:CUSTOM') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - CurVar=4 - DO Var=4,CurArgs,2 - UCRepVarName=MakeUPPERCase(InArgs(Var)) - OutArgs(CurVar)=InArgs(Var) - OutArgs(CurVar+1)=InArgs(Var+1) - pos=INDEX(UCRepVarName,'[') - IF (pos > 0) THEN - UCRepVarName=UCRepVarName(1:pos-1) - OutArgs(CurVar)=InArgs(Var)(1:pos-1) - OutArgs(CurVar+1)=InArgs(Var+1) - ENDIF - DelThis=.false. - DO Arg=1,NumRepVarNames - UCCompRepVarName=MakeUPPERCase(OldRepVarName(Arg)) - IF (UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName)) == '*') THEN - WildMatch=.true. - UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName))=' ' - pos=INDEX(TRIM(UCRepVarname),TRIM(UCCompRepVarName)) - ELSE - WildMatch=.false. - pos=0 - if (UCRepVarName == UCCompRepVarName) pos=1 - ENDIF - IF (pos > 0 .and. pos /= 1) CYCLE - IF (pos > 0) THEN - IF (NewRepVarName(Arg) /= '') THEN - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg) /= Blank .and. .not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq') ) THEN - IF (.not. CMtrVarCaution(Arg)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Custom Meter (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Custom Meter (new)="'// & - trim(NewRepVarName(Arg))//'" has the following caution "'//trim(NewRepVarCaution(Arg))//'".') - write(diflfn,fmtA) ' ' - CMtrVarCaution(Arg)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ELSE - DelThis=.true. - ENDIF - IF (OldRepVarName(Arg) == OldRepVarName(Arg+1)) THEN - IF (.not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq')) THEN - ! Adding a var field. - CurVar=CurVar+2 - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg+1) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg+1))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg+1) /= Blank .and. .not. SameString(NewRepVarCaution(Arg+1)(1:6),'Forkeq') ) THEN - IF (.not. CMtrVarCaution(Arg+1)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Custom Meter (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Custom Meter (new)="'// & - trim(NewRepVarName(Arg+1))//'" has the following caution "'//trim(NewRepVarCaution(Arg+1))//'".') - write(diflfn,fmtA) ' ' - CMtrVarCaution(Arg+1)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ENDIF - ENDIF - IF (OldRepVarName(Arg) == OldRepVarName(Arg+2)) THEN - ! Adding a var field. - CurVar=CurVar+2 - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg+2) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg+2))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg+2) /= Blank) THEN - IF (.not. CMtrVarCaution(Arg+2)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Custom Meter (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Custom Meter (new)="'// & - trim(NewRepVarName(Arg+2))//'" has the following caution "'//trim(NewRepVarCaution(Arg+2))//'".') - write(diflfn,fmtA) ' ' - CMtrVarCaution(Arg+2)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ENDIF - EXIT - ENDIF - ENDDO - IF (.not. DelThis) CurVar=CurVar+2 - ENDDO - CurArgs=CurVar - DO Arg=CurVar,1,-1 - IF (OutArgs(Arg) == Blank) THEN - CurArgs=CurArgs-1 - ELSE - EXIT - ENDIF - ENDDO - - CASE('METER:CUSTOMDECREMENT') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - CurVar=4 ! In case Source Meter would change - DO Var=4,CurArgs,2 - UCRepVarName=MakeUPPERCase(InArgs(Var)) - OutArgs(CurVar)=InArgs(Var) - OutArgs(CurVar+1)=InArgs(Var+1) - pos=INDEX(UCRepVarName,'[') - IF (pos > 0) THEN - UCRepVarName=UCRepVarName(1:pos-1) - OutArgs(CurVar)=InArgs(Var)(1:pos-1) - OutArgs(CurVar+1)=InArgs(Var+1) - ENDIF - DelThis=.false. - DO Arg=1,NumRepVarNames - UCCompRepVarName=MakeUPPERCase(OldRepVarName(Arg)) - IF (UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName)) == '*') THEN - WildMatch=.true. - UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName))=' ' - pos=INDEX(TRIM(UCRepVarname),TRIM(UCCompRepVarName)) - ELSE - WildMatch=.false. - pos=0 - if (UCRepVarName == UCCompRepVarName) pos=1 - ENDIF - IF (pos > 0 .and. pos /= 1) CYCLE - IF (pos > 0) THEN - IF (NewRepVarName(Arg) /= '') THEN - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg) /= Blank .and. .not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq') ) THEN - IF (.not. CMtrDVarCaution(Arg)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Custom Decrement Meter (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Custom Meter (new)="'// & - trim(NewRepVarName(Arg))//'" has the following caution "'//trim(NewRepVarCaution(Arg))//'".') - write(diflfn,fmtA) ' ' - CMtrDVarCaution(Arg)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ELSE - DelThis=.true. - ENDIF - IF (OldRepVarName(Arg) == OldRepVarName(Arg+1)) THEN - IF (.not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq')) THEN - ! Adding a var field. - CurVar=CurVar+2 - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg+1) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg+1))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg+1) /= Blank .and. .not. SameString(NewRepVarCaution(Arg+1)(1:6),'Forkeq') ) THEN - IF (.not. CMtrDVarCaution(Arg+1)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Custom Decrement Meter (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Custom Decrement Meter (new)="'// & - trim(NewRepVarName(Arg+1))//'" has the following caution "'//trim(NewRepVarCaution(Arg+1))//'".') - write(diflfn,fmtA) ' ' - CMtrDVarCaution(Arg+1)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ENDIF - ENDIF - IF (OldRepVarName(Arg) == OldRepVarName(Arg+2)) THEN - ! Adding a var field. - CurVar=CurVar+2 - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg+2) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg+2))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg+2) /= Blank) THEN - IF (.not. CMtrDVarCaution(Arg+2)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Custom Decrement Meter (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Custom Meter (new)="'// & - trim(NewRepVarName(Arg+2))//'" has the following caution "'//trim(NewRepVarCaution(Arg+2))//'".') - write(diflfn,fmtA) ' ' - CMtrDVarCaution(Arg+2)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ENDIF - EXIT - ENDIF - ENDDO - IF (.not. DelThis) CurVar=CurVar+2 - ENDDO - CurArgs=CurVar - DO Arg=CurVar,1,-1 - IF (OutArgs(Arg) == Blank) THEN - CurArgs=CurArgs-1 - ELSE - EXIT - ENDIF - ENDDO - - !!! Changes for other objects that reference meter names -- update names - CASE('DEMANDMANAGERASSIGNMENTLIST', & - 'UTILITYCOST:TARIFF') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - - CALL ScanOutputVariablesForReplacement( & - 2, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .true., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .false.) - - CASE('ELECTRICLOADCENTER:DISTRIBUTION') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - - ! Field 6 A5, \field Generator Track Meter Scheme Meter Name - CALL ScanOutputVariablesForReplacement( & - 6, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .true., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .false.) - - ! Field 12 A11, \field Storage Control Track Meter Name - CALL ScanOutputVariablesForReplacement( & - 12, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .true., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .false.) - - ! ANY OTHER OBJECT - CASE DEFAULT - IF (FindItemInList(ObjectName,NotInNew,SIZE(NotInNew)) /= 0) THEN - WRITE(Auditf,fmta) 'Object="'//TRIM(ObjectName)//'" is not in the "new" IDD.' - WRITE(Auditf,fmta) '... will be listed as comments on the new output file.' - CALL WriteOutIDFLinesAsComments(DifLfn,ObjectName,CurArgs,InArgs,FldNames,FldUnits) - Written=.true. - !CYCLE - ELSE - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - NoDiff=.true. - ENDIF - - END SELECT - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IF ONLY MAKING PRETTY !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ELSE !!! Making Pretty - - ! Just making pretty -- no changes as above. - CALL GetNewObjectDefInIDD(IDFRecords(Num)%Name,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - ENDIF - - IF (DiffMinFields .and. nodiff) THEN - ! Change in min-fields - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - NoDiff=.false. - DO Arg=CurArgs+1,NwObjMinFlds - OutArgs(Arg)=NwFldDefaults(Arg) - ENDDO - CurArgs=MAX(NwObjMinFlds,CurArgs) - ENDIF - - IF (NoDiff .and. DiffOnly) CYCLE - - !! reformat for better readability - !! BUILDING,SOLUTION ALGORITHM,OUTSIDE CONVECTION ALGORITHM,INSIDE CONVECTION ALGORITHM,REPORT VARIABLE, - !! SURFACE:HEATTRANSFER,SURFACE:HEATTRANSFER:SUBSURFACE:SHADING:DETACHED, - !! SURFACE:SHADING:DETACHED:FIXED,SURFACE:SHADING:DETACHED:BUILDING, - !! SURFACE:SHADING:ATTACHED, - !! WINDOWGLASSSPECTRALDATA, - !! FLUIDPROPERTYTEMPERATURES, - !! FLUIDPROPERTYSATURATED,FLUIDPROPERTYSUPERHEATED,FLUIDPROPERTYCONCENTRATION - IF (.not. Written) THEN - CALL CheckSpecialObjects(DifLfn,ObjectName,CurArgs,OutArgs,NwFldNames,NwFldUnits,Written) - ENDIF - - IF (.not. Written) THEN - CALL WriteOutIDFLines(DifLfn,ObjectName,CurArgs,OutArgs,NwFldNames,NwFldUnits) - ENDIF - - ENDDO ! IDFRecords - - CALL DisplayString('Processing IDF -- Processing idf objects complete.') - IF (IDFRecords(NumIDFRecords)%CommtE /= CurComment) THEN - DO xcount=IDFRecords(NumIDFRecords)%CommtE+1,CurComment - WRITE(DifLfn,fmta) TRIM(Comments(xcount)) - if (xcount == IDFRecords(Num)%CommtE) WRITE(DifLfn,fmta) '' - ENDDO - ENDIF - - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! E N D O F P R O C E S S I N G ! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - - IF (GetNumSectionsFound('Report Variable Dictionary') > 0) THEN - ObjectName='Output:VariableDictionary' - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1)='Regular' - CurArgs=1 - CALL WriteOutIDFLines(DifLfn,ObjectName,CurArgs,OutArgs,NwFldNames,NwFldUnits) - ENDIF - - INQUIRE(FILE=trim(FileNamePath)//'.rvi',EXIST=FileExist) -! IF (FileExist) THEN -! CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & -! 'rvi file associated with this input is being processed. Review for accuracy.') -! write(diflfn,fmtA) ' ' -! ENDIF - CLOSE(DifLfn) - CALL ProcessRviMviFiles(FileNamePath,'rvi') - CALL ProcessRviMviFiles(FileNamePath,'mvi') - CALL CloseOut - ELSE ! not a idf or imf - CALL ProcessRviMviFiles(FileNamePath,'rvi') - CALL ProcessRviMviFiles(FileNamePath,'mvi') - ENDIF - ELSE ! Full name == Blank - EndOfFile=.true. - ENDIF - - CALL CreateNewName('Reallocate',CreatedOutputName,' ') - - ENDDO - - IF (.not. ExitBecauseBadFile) THEN - StillWorking=.false. - EXIT - ELSE - IF (.not. ArgFileBeingDone) THEN - EndOfFile=.false. - ELSE - EndOfFile=.true. - StillWorking=.false. - ENDIF - ENDIF - ENDDO - - IF (ArgFileBeingDone .and. .not. LatestVersion .and. .not. ExitBecauseBadFile) THEN - ! If this is true, then there was a "arg IDF File" on the command line and some files need to be renamed - ErrFlag=.false. - CALL copyfile(TRIM(FileNamePath)//'.'//TRIM(ArgIDFExtension),TRIM(FileNamePath)//'.'//TRIM(ArgIDFExtension)//'old',ErrFlag) - CALL copyfile(TRIM(FileNamePath)//'.'//TRIM(ArgIDFExtension)//'new',TRIM(FileNamePath)//'.'//TRIM(ArgIDFExtension),ErrFlag) - INQUIRE(File=TRIM(FileNamePath)//'.rvi',EXIST=FileExist) - IF (FileExist) THEN - CALL copyfile(TRIM(FileNamePath)//'.rvi',TRIM(FileNamePath)//'.rviold',ErrFlag) - ENDIF - INQUIRE(File=TRIM(FileNamePath)//'.rvinew',EXIST=FileExist) - IF (FileExist) THEN - CALL copyfile(TRIM(FileNamePath)//'.rvinew',TRIM(FileNamePath)//'.rvi',ErrFlag) - ENDIF - INQUIRE(File=TRIM(FileNamePath)//'.mvi',EXIST=FileExist) - IF (FileExist) THEN - CALL copyfile(TRIM(FileNamePath)//'.mvi',TRIM(FileNamePath)//'.mviold',ErrFlag) - ENDIF - INQUIRE(File=TRIM(FileNamePath)//'.mvinew',EXIST=FileExist) - IF (FileExist) THEN - CALL copyfile(TRIM(FileNamePath)//'.mvinew',TRIM(FileNamePath)//'.mvi',ErrFlag) - ENDIF - ENDIF - - RETURN - -END SUBROUTINE CreateNewIDFUsingRules diff --git a/src/Transition/CreateNewIDFUsingRulesv25_2_0.f90 b/src/Transition/CreateNewIDFUsingRulesv25_2_0.f90 deleted file mode 100644 index 3e11c9df634..00000000000 --- a/src/Transition/CreateNewIDFUsingRulesv25_2_0.f90 +++ /dev/null @@ -1,1141 +0,0 @@ -MODULE SetVersion - -USE DataStringGlobals -USE DataVCompareGlobals - -PUBLIC - -CONTAINS - -SUBROUTINE SetThisVersionVariables() - ! TODO: Update this section as appropriate - VerString='Conversion 25.1 => 25.2' - VersionNum=25.2 - ! Starting with version 22.1, the version string requires 4 characters - ! The original sVersionNum variable is a 3 character length string - ! If we just change that variable to be 4 characters, it could break everything before 22.1 - ! So instead, let's just move forward with a new 4 character string and use that in this file and the future - ! If we get to version 100.1 and we are still using this Fortran transition then well....we can deal with it then - sVersionNum = '***' - sVersionNumFourChars='25.2' - IDDFileNameWithPath=TRIM(ProgramPath)//'V25-1-0-Energy+.idd' - NewIDDFileNameWithPath=TRIM(ProgramPath)//'V25-2-0-Energy+.idd' - RepVarFileNameWithPath=TRIM(ProgramPath)//'Report Variables 25-1-0 to 25-2-0.csv' -END SUBROUTINE - -END MODULE - -SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFileName,ArgFile,ArgIDFExtension) - - ! SUBROUTINE INFORMATION: - ! AUTHOR Linda Lawrie - ! DATE WRITTEN July 2002 - ! MODIFIED For each release - ! RE-ENGINEERED na - - ! PURPOSE OF THIS SUBROUTINE: - ! This subroutine creates new IDFs based on the rules specified by - ! developers. This will result in a more complete transition but - ! takes more time to create. - - ! METHODOLOGY EMPLOYED: - ! na - - ! REFERENCES: - ! na - - ! USE STATEMENTS: - USE InputProcessor - USE DataVCompareGlobals - USE VCompareGlobalRoutines - USE DataStringGlobals, ONLY: ProgNameConversion - USE General - USE DataGlobals, ONLY: ShowMessage, ShowContinueError, ShowFatalError, ShowSevereError, ShowWarningError - - IMPLICIT NONE ! Enforce explicit typing of all variables in this routine - - ! SUBROUTINE ARGUMENT DEFINITIONS: - LOGICAL, INTENT(INOUT) :: EndOfFile - LOGICAL, INTENT(IN) :: DiffOnly - INTEGER, INTENT(IN) :: InLfn - LOGICAL, INTENT(IN) :: AskForInput - CHARACTER(len=*), INTENT(IN) :: InputFileName - LOGICAL, INTENT(IN) :: ArgFile - CHARACTER(len=*), INTENT(IN) :: ArgIDFExtension - - ! SUBROUTINE PARAMETER DEFINITIONS: - CHARACTER(len=*), PARAMETER :: fmta="(A)" - - ! INTERFACE BLOCK SPECIFICATIONS - ! na - - ! DERIVED TYPE DEFINITIONS - - ! SUBROUTINE LOCAL VARIABLE DECLARATIONS: - INTEGER IoS - INTEGER DotPos - INTEGER Status - INTEGER NA - INTEGER NN - INTEGER CurArgs - INTEGER DifLfn - INTEGER xCount - INTEGER Num - INTEGER, EXTERNAL :: GetNewUnitNumber - INTEGER Arg - LOGICAL, SAVE :: FirstTime=.true. - CHARACTER(len=30) UnitsArg - CHARACTER(len=MaxNameLength) :: ObjectName - CHARACTER(len=30), EXTERNAL :: TrimTrailZeros - CHARACTER(len=MaxNameLength) :: UCRepVarName=blank - CHARACTER(len=MaxNameLength) :: UCCompRepVarName=blank - LOGICAL DelThis - INTEGER pos - INTEGER pos2 - LOGICAL ExitBecauseBadFile - LOGICAL StillWorking - LOGICAL NoDiff - LOGICAL checkrvi - LOGICAL NoVersion - LOGICAL DiffMinFields ! Set to true when diff number of min-fields between the two objects - LOGICAL Written - INTEGER :: Var - INTEGER :: CurVar - LOGICAL ArgFileBeingDone - LOGICAL LatestVersion - CHARACTER(len=10) :: LocalFileExtension=' ' - LOGICAL :: WildMatch - - LOGICAL :: ConnComp - LOGICAL :: ConnCompCtrl - LOGICAL :: FileExist - CHARACTER(len=MaxNameLength) :: CreatedOutputName - LOGICAL, ALLOCATABLE, DIMENSION(:) :: DeleteThisRecord - INTEGER :: COutArgs - CHARACTER(len=16) :: UnitsField - - LOGICAL :: ErrFlag - - INTEGER :: I, CurField, NewField, KAindex=0, SearchNum - INTEGER :: AlphaNumI - REAL :: SaveNumber - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! I N S E R T L O C A L V A R I A B L E S H E R E ! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - - ! TODO: Move to V10_0_0.f90 when available - ! For Defaulting now-required RunPeriod Name - INTEGER :: TotRunPeriods = 0 - INTEGER :: runPeriodNum = 0 - INTEGER :: iterateRunPeriod = 0 - CHARACTER(len=MaxNameLength), ALLOCATABLE, DIMENSION(:) :: CurrentRunPeriodNames - CHARACTER(len=20) :: PotentialRunPeriodName - ! END OF TODO - - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! E N D O F I N S E R T L O C A L V A R I A B L E S H E R E ! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - - If (FirstTime) THEN ! do things that might be applicable only to this new version - FirstTime=.false. - EndIf - - StillWorking=.true. - ArgFileBeingDone=.false. - LatestVersion=.false. - NoVersion=.true. - LocalFileExtension=ArgIDFExtension - EndOfFile=.false. - IOS=0 - - DO WHILE (StillWorking) - - ExitBecauseBadFile=.false. - DO WHILE (.not. EndOfFile) - IF (AskForInput) THEN - WRITE(*,*) 'Enter input file name, with path' - write(*,fmta,advance='no') '-->' - READ(*,fmta) FullFileName - ELSE - IF (.not. ArgFile) THEN - READ(InLfn,*,IOSTAT=IoS) FullFileName - ELSEIF (.not. ArgFileBeingDone) THEN - FullFileName=InputFileName - IOS=0 - ArgFileBeingDone=.true. - ELSE - FullFileName=Blank - IOS=1 - ENDIF - IF (FullFileName(1:1) == '!') THEN - FullFileName=Blank - CYCLE - ENDIF - ENDIF - UnitsArg=Blank - IF (IoS /= 0) FullFileName=Blank - FullFileName=ADJUSTL(FullFileName) - IF (FullFileName /= Blank) THEN - CALL DisplayString('Processing IDF -- '//TRIM(FullFileName)) - WRITE(Auditf,fmta) ' Processing IDF -- '//TRIM(FullFileName) - DotPos=SCAN(FullFileName,'.',.true.) ! Scan backward looking for extension, - IF (DotPos /= 0) THEN - FileNamePath=FullFileName(1:DotPos-1) - LocalFileExtension=MakeLowerCase(FullFileName(DotPos+1:)) - ELSE - FileNamePath=FullFileName - WRITE(*,*) ' assuming file extension of .idf' - WRITE(Auditf,fmta) ' ..assuming file extension of .idf' - FullFileName=TRIM(FullFileName)//'.idf' - LocalFileExtension='idf' - ENDIF - ! Process the old input - DifLfn=GetNewUnitNumber() - INQUIRE(File=TRIM(FullFileName),EXIST=FileOK) - IF (.not. FileOK) THEN - WRITE(*,*) 'File not found='//TRIM(FullFileName) - WRITE(Auditf,*) 'File not found='//TRIM(FullFileName) - EndOfFile=.true. - ExitBecauseBadFile=.true. - EXIT - ENDIF - IF (LocalFileExtension == 'idf' .or. LocalFileExtension == 'imf') THEN - checkrvi=.false. - ConnComp=.false. - ConnCompCtrl=.false. - IF (DiffOnly) THEN - OPEN(DifLfn,FILE=TRIM(FileNamePath)//'.'//TRIM(LocalFileExtension)//'dif') - ELSE - OPEN(DifLfn,FILE=TRIM(FileNamePath)//'.'//TRIM(LocalFileExtension)//'new') - ENDIF - IF (LocalFileExtension == 'imf') THEN - CALL ShowWarningError('Note: IMF file being processed. No guarantee of perfection. Please check new file carefully.',Auditf) - ProcessingIMFFile=.true. - ELSE - ProcessingIMFFile=.false. - ENDIF - CALL ProcessInput(IDDFileNameWithPath,NewIDDFileNameWithPath,FullFileName) - IF (FatalError) THEN - ExitBecauseBadFile=.true. - EXIT - ENDIF - - ! Clean up from any previous passes, then re-allocate. These are for the 'standard' stuff, not your own - ! Do not add anything here! - IF(ALLOCATED(DeleteThisRecord)) DEALLOCATE(DeleteThisRecord) - IF(ALLOCATED(Alphas)) DEALLOCATE(Alphas) - IF(ALLOCATED(Numbers)) DEALLOCATE(Numbers) - IF(ALLOCATED(InArgs)) DEALLOCATE(InArgs) - IF(ALLOCATED(TempArgs)) DEALLOCATE(TempArgs) - IF(ALLOCATED(AorN)) DEALLOCATE(AorN) - IF(ALLOCATED(ReqFld)) DEALLOCATE(ReqFld) - IF(ALLOCATED(FldNames)) DEALLOCATE(FldNames) - IF(ALLOCATED(FldDefaults)) DEALLOCATE(FldDefaults) - IF(ALLOCATED(FldUnits)) DEALLOCATE(FldUnits) - IF(ALLOCATED(NwAorN)) DEALLOCATE(NwAorN) - IF(ALLOCATED(NwReqFld)) DEALLOCATE(NwReqFld) - IF(ALLOCATED(NwFldNames)) DEALLOCATE(NwFldNames) - IF(ALLOCATED(NwFldDefaults)) DEALLOCATE(NwFldDefaults) - IF(ALLOCATED(NwFldUnits)) DEALLOCATE(NwFldUnits) - IF(ALLOCATED(OutArgs)) DEALLOCATE(OutArgs) - ALLOCATE(Alphas(MaxAlphaArgsFound),Numbers(MaxNumericArgsFound)) - ALLOCATE(InArgs(MaxTotalArgs)) - ALLOCATE(TempArgs(MaxTotalArgs)) - ALLOCATE(AorN(MaxTotalArgs),ReqFld(MaxTotalArgs),FldNames(MaxTotalArgs),FldDefaults(MaxTotalArgs),FldUnits(MaxTotalArgs)) - ALLOCATE(NwAorN(MaxTotalArgs),NwReqFld(MaxTotalArgs),NwFldNames(MaxTotalArgs),NwFldDefaults(MaxTotalArgs),NwFldUnits(MaxTotalArgs)) - ALLOCATE(OutArgs(MaxTotalArgs)) - ALLOCATE(DeleteThisRecord(NumIDFRecords)) - DeleteThisRecord=.false. - - NoVersion=.true. - DO Num=1,NumIDFRecords - IF (MakeUPPERCase(IDFRecords(Num)%Name) /= 'VERSION') CYCLE - NoVersion=.false. - EXIT - ENDDO - - DO Num=1,NumIDFRecords - IF (DeleteThisRecord(Num)) THEN - Write(DifLfn,fmta) '! Deleting: '//TRIM(IDFRecords(Num)%Name)//'="'//TRIM(IDFRecords(Num)%Alphas(1))//'".' - ENDIF - ENDDO - - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! P R E P R O C E S S I N G ! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -! Do any kind of Preprocessing that is needed here (eg: a first pass on objects to store some attributes etc) - - - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! P R O C E S S I N G ! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - CALL DisplayString('Processing IDF -- Processing idf objects . . .') - DO Num=1,NumIDFRecords - - IF (DeleteThisRecord(Num)) CYCLE - DO xcount=IDFRecords(Num)%CommtS+1,IDFRecords(Num)%CommtE - WRITE(DifLfn,fmta) TRIM(Comments(xcount)) - if (xcount == IDFRecords(Num)%CommtE) WRITE(DifLfn,fmta) '' - ENDDO - IF (NoVersion .and. Num == 1) THEN - CALL GetNewObjectDefInIDD('VERSION',NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1) = sVersionNumFourChars - CurArgs=1 - CALL ShowWarningError('No version found in file, defaulting to '//sVersionNumFourChars,Auditf) - CALL WriteOutIDFLinesAsComments(DifLfn,'Version',CurArgs,OutArgs,NwFldNames,NwFldUnits) - ENDIF - - ! deleted objects. no transition. - ! eg: IF (MakeUPPERCase(TRIM(IDFRecords(Num)%Name)) == 'PROGRAMCONTROL') CYCLE - - ObjectName=IDFRecords(Num)%Name - IF (FindItemInList(ObjectName,ObjectDef%Name,NumObjectDefs) /= 0) THEN - CALL GetObjectDefInIDD(ObjectName,NumArgs,AorN,ReqFld,ObjMinFlds,FldNames,FldDefaults,FldUnits) - NumAlphas=IDFRecords(Num)%NumAlphas - NumNumbers=IDFRecords(Num)%NumNumbers - Alphas(1:NumAlphas)=IDFRecords(Num)%Alphas(1:NumAlphas) - Numbers(1:NumNumbers)=IDFRecords(Num)%Numbers(1:NumNumbers) - CurArgs=NumAlphas+NumNumbers - InArgs=Blank - OutArgs=Blank - TempArgs=Blank - NA=0 - NN=0 - DO Arg=1,CurArgs - IF (AorN(Arg)) THEN - NA=NA+1 - InArgs(Arg)=Alphas(NA) - ELSE - NN=NN+1 - InArgs(Arg)=Numbers(NN) - ENDIF - ENDDO - ELSE - WRITE(Auditf,fmta) 'Object="'//TRIM(ObjectName)//'" does not seem to be on the "old" IDD.' - WRITE(Auditf,fmta) '... will be listed as comments (no field names) on the new output file.' - WRITE(Auditf,fmta) '... Alpha fields will be listed first, then numerics.' - NumAlphas=IDFRecords(Num)%NumAlphas - NumNumbers=IDFRecords(Num)%NumNumbers - Alphas(1:NumAlphas)=IDFRecords(Num)%Alphas(1:NumAlphas) - Numbers(1:NumNumbers)=IDFRecords(Num)%Numbers(1:NumNumbers) - DO Arg=1,NumAlphas - OutArgs(Arg)=Alphas(Arg) - ENDDO - NN=NumAlphas+1 - DO Arg=1,NumNumbers - OutArgs(NN)=Numbers(Arg) - NN=NN+1 - ENDDO - CurArgs=NumAlphas+NumNumbers - NwFldNames=Blank - NwFldUnits=Blank - CALL WriteOutIDFLinesAsComments(DifLfn,ObjectName,CurArgs,OutArgs,NwFldNames,NwFldUnits) - CYCLE - ENDIF - - Nodiff=.true. ! Nodiff is true by default - DiffMinFields=.false. - Written=.false. - - IF (FindItemInList(MakeUPPERCase(ObjectName),NotInNew,SIZE(NotInNew)) == 0) THEN - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - ! Check minfields - IF (ObjMinFlds /= NwObjMinFlds) THEN - DiffMinFields=.true. - ELSE - DiffMinFields=.false. - ENDIF - ENDIF - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IF NOT ONLY MAKING PRETTY !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - IF (.not. MakingPretty) THEN - - SELECT CASE (MakeUPPERCase(TRIM(IDFRecords(Num)%Name))) - - CASE ('VERSION') - IF ((InArgs(1)(1:4)) == sVersionNumFourChars .and. ArgFile) THEN - CALL ShowWarningError('File is already at latest version. No new diff file made.',Auditf) - CLOSE(diflfn,STATUS='DELETE') - LatestVersion=.true. - EXIT - ENDIF - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1) = sVersionNumFourChars - NoDiff=.false. - - ! changes for this version, pick one of the spots to add rules, this will reduce the possibility of merge conflicts - -! CASE('OBJECTNAMEHERE') -! CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) -! nodiff=.false. -! OutArgs(1)=InArgs(1) -! OutArgs(2) = 'SequentialLoad' -! OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) -! CurArgs = CurArgs + 1 - - ! If your original object starts with A, insert the rules here - - ! If your original object starts with C, insert the rules here - CASE('COIL:COOLING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:HEATING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:COOLING:DX:VARIABLESPEED') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:HEATING:DX:VARIABLESPEED') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:WATERHEATING:AIRTOWATERHEATPUMP:VARIABLESPEED') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:COOLING:WATERTOAIRHEATPUMP:EQUATIONFIT') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:HEATING:WATERTOAIRHEATPUMP:EQUATIONFIT') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:COOLING:WATERTOAIRHEATPUMP:PARAMETERESTIMATION') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:HEATING:WATERTOAIRHEATPUMP:PARAMETERESTIMATION') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:WATERHEATING:AIRTOWATERHEATPUMP:PUMPED') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - CASE('COIL:WATERHEATING:AIRTOWATERHEATPUMP:WRAPPED') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1:1)=InArgs(1:1) - OutArgs(2) = '' ! new Availability Schedule Name field - OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) - CurArgs = CurArgs + 1 - - ! If your original object starts with D, insert the rules here - - ! If your original object starts with E, insert the rules here - - ! If your original object starts with F, insert the rules here - - ! If your original object starts with G, insert the rules here - - ! If your original object starts with H, insert the rules here - - ! If your original object starts with I, insert the rules here - - ! If your original object starts with L, insert the rules here - - ! If your original object starts with M, insert the rules here - - ! If your original object starts with N, insert the rules here - - ! If your original object starts with O, insert the rules here - - ! If your original object starts with P, insert the rules here - - ! If your original object starts with R, insert the rules here - - ! If your original object starts with S, insert the rules here - - ! If your original object starts with T, insert the rules here - - ! If your original object starts with U, insert the rules here - - ! If your original object starts with V, insert the rules here - - ! If your original object starts with W, insert the rules here - - ! If your original object starts with Z, insert the rules here - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! Changes for report variables, meters, tables -- update names ! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -! TODO: not sure if need to keep all of this... - - !!! Changes for report variables, meters, tables -- update names - CASE('OUTPUT:VARIABLE') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - IF (OutArgs(1) == Blank) THEN - OutArgs(1)='*' - nodiff=.false. - ENDIF - - CALL ScanOutputVariablesForReplacement( & - 2, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .true., & !OutVar - .false., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .false.) - IF (DelThis) CYCLE - - CASE ('OUTPUT:METER','OUTPUT:METER:METERFILEONLY','OUTPUT:METER:CUMULATIVE','OUTPUT:METER:CUMULATIVE:METERFILEONLY') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - CALL ScanOutputVariablesForReplacement( & - 1, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .true., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .false.) - IF (DelThis) CYCLE - - CASE('OUTPUT:TABLE:TIMEBINS') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - IF (OutArgs(1) == Blank) THEN - OutArgs(1)='*' - nodiff=.false. - ENDIF - CALL ScanOutputVariablesForReplacement( & - 2, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .false., & !MtrVar - .true., & !TimeBinVar - CurArgs, & - Written, & - .false.) - IF (DelThis) CYCLE - -!ExternalInterface:FunctionalMockupUnitImport:From:Variable, field 2 -!ExternalInterface:FunctionalMockupUnitExport:From:Variable, field 2 - CASE('EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT:FROM:VARIABLE', & - 'EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITEXPORT:FROM:VARIABLE') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - IF (OutArgs(1) == Blank) THEN - OutArgs(1)='*' - nodiff=.false. - ENDIF - CALL ScanOutputVariablesForReplacement( & - 2, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .false., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .false.) - IF (DelThis) CYCLE - -!EnergyManagementSystem:Sensor, field 3 - CASE('ENERGYMANAGEMENTSYSTEM:SENSOR') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - CALL ScanOutputVariablesForReplacement( & - 3, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .false., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .true.) - IF (DelThis) CYCLE - - CASE('OUTPUT:TABLE:MONTHLY') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.true. - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - CurVar=3 - DO Var=3,CurArgs,2 - UCRepVarName=MakeUPPERCase(InArgs(Var)) - OutArgs(CurVar)=InArgs(Var) - OutArgs(CurVar+1)=InArgs(Var+1) - pos=INDEX(UCRepVarName,'[') - IF (pos > 0) THEN - UCRepVarName=UCRepVarName(1:pos-1) - OutArgs(CurVar)=InArgs(Var)(1:pos-1) - OutArgs(CurVar+1)=InArgs(Var+1) - ENDIF - DelThis=.false. - DO Arg=1,NumRepVarNames - UCCompRepVarName=MakeUPPERCase(OldRepVarName(Arg)) - IF (UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName)) == '*') THEN - WildMatch=.true. - UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName))=' ' - pos=INDEX(TRIM(UCRepVarname),TRIM(UCCompRepVarName)) - ELSE - WildMatch=.false. - pos=0 - if (UCRepVarName == UCCompRepVarName) pos=1 - ENDIF - IF (pos > 0 .and. pos /= 1) CYCLE - IF (pos > 0) THEN - IF (NewRepVarName(Arg) /= '') THEN - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg) /= Blank .and. .not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq') ) THEN - IF (.not. OTMVarCaution(Arg)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Output Table Monthly (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Output Table Monthly (new)="'// & - trim(NewRepVarName(Arg))//'" has the following caution "'//trim(NewRepVarCaution(Arg))//'".') - write(diflfn,fmtA) ' ' - OTMVarCaution(Arg)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ELSE - DelThis=.true. - ENDIF - IF (OldRepVarName(Arg) == OldRepVarName(Arg+1)) THEN - IF (.not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq')) THEN - ! Adding a var field. - CurVar=CurVar+2 - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg+1) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg+1))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg+1) /= Blank) THEN - IF (.not. OTMVarCaution(Arg+1)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Output Table Monthly (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Output Table Monthly (new)="'// & - trim(NewRepVarName(Arg+1))//'" has the following caution "'//trim(NewRepVarCaution(Arg+1))//'".') - write(diflfn,fmtA) ' ' - OTMVarCaution(Arg+1)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ENDIF - ENDIF - IF (OldRepVarName(Arg) == OldRepVarName(Arg+2)) THEN ! only 1 more... for ForkEq - ! Adding a var field. - CurVar=CurVar+2 - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg+2) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg+2))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg+2) /= Blank) THEN - IF (.not. OTMVarCaution(Arg+2)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Output Table Monthly (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Output Table Monthly (new)="'// & - trim(NewRepVarName(Arg+2))//'" has the following caution "'//trim(NewRepVarCaution(Arg+2))//'".') - write(diflfn,fmtA) ' ' - OTMVarCaution(Arg+2)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ENDIF - EXIT - ENDIF - ENDDO - IF (.not. DelThis) CurVar=CurVar+2 - ENDDO - CurArgs=CurVar-1 - - CASE('METER:CUSTOM') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - CurVar=4 - DO Var=4,CurArgs,2 - UCRepVarName=MakeUPPERCase(InArgs(Var)) - OutArgs(CurVar)=InArgs(Var) - OutArgs(CurVar+1)=InArgs(Var+1) - pos=INDEX(UCRepVarName,'[') - IF (pos > 0) THEN - UCRepVarName=UCRepVarName(1:pos-1) - OutArgs(CurVar)=InArgs(Var)(1:pos-1) - OutArgs(CurVar+1)=InArgs(Var+1) - ENDIF - DelThis=.false. - DO Arg=1,NumRepVarNames - UCCompRepVarName=MakeUPPERCase(OldRepVarName(Arg)) - IF (UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName)) == '*') THEN - WildMatch=.true. - UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName))=' ' - pos=INDEX(TRIM(UCRepVarname),TRIM(UCCompRepVarName)) - ELSE - WildMatch=.false. - pos=0 - if (UCRepVarName == UCCompRepVarName) pos=1 - ENDIF - IF (pos > 0 .and. pos /= 1) CYCLE - IF (pos > 0) THEN - IF (NewRepVarName(Arg) /= '') THEN - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg) /= Blank .and. .not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq') ) THEN - IF (.not. CMtrVarCaution(Arg)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Custom Meter (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Custom Meter (new)="'// & - trim(NewRepVarName(Arg))//'" has the following caution "'//trim(NewRepVarCaution(Arg))//'".') - write(diflfn,fmtA) ' ' - CMtrVarCaution(Arg)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ELSE - DelThis=.true. - ENDIF - IF (OldRepVarName(Arg) == OldRepVarName(Arg+1)) THEN - IF (.not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq')) THEN - ! Adding a var field. - CurVar=CurVar+2 - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg+1) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg+1))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg+1) /= Blank .and. .not. SameString(NewRepVarCaution(Arg+1)(1:6),'Forkeq') ) THEN - IF (.not. CMtrVarCaution(Arg+1)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Custom Meter (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Custom Meter (new)="'// & - trim(NewRepVarName(Arg+1))//'" has the following caution "'//trim(NewRepVarCaution(Arg+1))//'".') - write(diflfn,fmtA) ' ' - CMtrVarCaution(Arg+1)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ENDIF - ENDIF - IF (OldRepVarName(Arg) == OldRepVarName(Arg+2)) THEN - ! Adding a var field. - CurVar=CurVar+2 - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg+2) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg+2))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg+2) /= Blank) THEN - IF (.not. CMtrVarCaution(Arg+2)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Custom Meter (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Custom Meter (new)="'// & - trim(NewRepVarName(Arg+2))//'" has the following caution "'//trim(NewRepVarCaution(Arg+2))//'".') - write(diflfn,fmtA) ' ' - CMtrVarCaution(Arg+2)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ENDIF - EXIT - ENDIF - ENDDO - IF (.not. DelThis) CurVar=CurVar+2 - ENDDO - CurArgs=CurVar - DO Arg=CurVar,1,-1 - IF (OutArgs(Arg) == Blank) THEN - CurArgs=CurArgs-1 - ELSE - EXIT - ENDIF - ENDDO - - CASE('METER:CUSTOMDECREMENT') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - CurVar=4 ! In case Source Meter would change - DO Var=4,CurArgs,2 - UCRepVarName=MakeUPPERCase(InArgs(Var)) - OutArgs(CurVar)=InArgs(Var) - OutArgs(CurVar+1)=InArgs(Var+1) - pos=INDEX(UCRepVarName,'[') - IF (pos > 0) THEN - UCRepVarName=UCRepVarName(1:pos-1) - OutArgs(CurVar)=InArgs(Var)(1:pos-1) - OutArgs(CurVar+1)=InArgs(Var+1) - ENDIF - DelThis=.false. - DO Arg=1,NumRepVarNames - UCCompRepVarName=MakeUPPERCase(OldRepVarName(Arg)) - IF (UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName)) == '*') THEN - WildMatch=.true. - UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName))=' ' - pos=INDEX(TRIM(UCRepVarname),TRIM(UCCompRepVarName)) - ELSE - WildMatch=.false. - pos=0 - if (UCRepVarName == UCCompRepVarName) pos=1 - ENDIF - IF (pos > 0 .and. pos /= 1) CYCLE - IF (pos > 0) THEN - IF (NewRepVarName(Arg) /= '') THEN - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg) /= Blank .and. .not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq') ) THEN - IF (.not. CMtrDVarCaution(Arg)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Custom Decrement Meter (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Custom Meter (new)="'// & - trim(NewRepVarName(Arg))//'" has the following caution "'//trim(NewRepVarCaution(Arg))//'".') - write(diflfn,fmtA) ' ' - CMtrDVarCaution(Arg)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ELSE - DelThis=.true. - ENDIF - IF (OldRepVarName(Arg) == OldRepVarName(Arg+1)) THEN - IF (.not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq')) THEN - ! Adding a var field. - CurVar=CurVar+2 - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg+1) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg+1))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg+1) /= Blank .and. .not. SameString(NewRepVarCaution(Arg+1)(1:6),'Forkeq') ) THEN - IF (.not. CMtrDVarCaution(Arg+1)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Custom Decrement Meter (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Custom Decrement Meter (new)="'// & - trim(NewRepVarName(Arg+1))//'" has the following caution "'//trim(NewRepVarCaution(Arg+1))//'".') - write(diflfn,fmtA) ' ' - CMtrDVarCaution(Arg+1)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ENDIF - ENDIF - IF (OldRepVarName(Arg) == OldRepVarName(Arg+2)) THEN - ! Adding a var field. - CurVar=CurVar+2 - IF (.not. WildMatch) THEN - OutArgs(CurVar)=NewRepVarName(Arg+2) - ELSE - OutArgs(CurVar)=TRIM(NewRepVarName(Arg+2))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) - ENDIF - IF (NewRepVarCaution(Arg+2) /= Blank) THEN - IF (.not. CMtrDVarCaution(Arg+2)) THEN ! caution message not written yet - CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & - 'Custom Decrement Meter (old)="'//trim(OldRepVarName(Arg))// & - '" conversion to Custom Meter (new)="'// & - trim(NewRepVarName(Arg+2))//'" has the following caution "'//trim(NewRepVarCaution(Arg+2))//'".') - write(diflfn,fmtA) ' ' - CMtrDVarCaution(Arg+2)=.true. - ENDIF - ENDIF - OutArgs(CurVar+1)=InArgs(Var+1) - nodiff=.false. - ENDIF - EXIT - ENDIF - ENDDO - IF (.not. DelThis) CurVar=CurVar+2 - ENDDO - CurArgs=CurVar - DO Arg=CurVar,1,-1 - IF (OutArgs(Arg) == Blank) THEN - CurArgs=CurArgs-1 - ELSE - EXIT - ENDIF - ENDDO - - !!! Changes for other objects that reference meter names -- update names - CASE('DEMANDMANAGERASSIGNMENTLIST', & - 'UTILITYCOST:TARIFF') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - - CALL ScanOutputVariablesForReplacement( & - 2, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .true., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .false.) - - CASE('ELECTRICLOADCENTER:DISTRIBUTION') - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - nodiff=.true. - - ! Field 6 A5, \field Generator Track Meter Scheme Meter Name - CALL ScanOutputVariablesForReplacement( & - 6, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .true., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .false.) - - ! Field 12 A11, \field Storage Control Track Meter Name - CALL ScanOutputVariablesForReplacement( & - 12, & - DelThis, & - checkrvi, & - nodiff, & - ObjectName, & - DifLfn, & - .false., & !OutVar - .true., & !MtrVar - .false., & !TimeBinVar - CurArgs, & - Written, & - .false.) - - ! ANY OTHER OBJECT - CASE DEFAULT - IF (FindItemInList(ObjectName,NotInNew,SIZE(NotInNew)) /= 0) THEN - WRITE(Auditf,fmta) 'Object="'//TRIM(ObjectName)//'" is not in the "new" IDD.' - WRITE(Auditf,fmta) '... will be listed as comments on the new output file.' - CALL WriteOutIDFLinesAsComments(DifLfn,ObjectName,CurArgs,InArgs,FldNames,FldUnits) - Written=.true. - !CYCLE - ELSE - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - NoDiff=.true. - ENDIF - - END SELECT - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IF ONLY MAKING PRETTY !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ELSE !!! Making Pretty - - ! Just making pretty -- no changes as above. - CALL GetNewObjectDefInIDD(IDFRecords(Num)%Name,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - ENDIF - - IF (DiffMinFields .and. nodiff) THEN - ! Change in min-fields - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - OutArgs(1:CurArgs)=InArgs(1:CurArgs) - NoDiff=.false. - DO Arg=CurArgs+1,NwObjMinFlds - OutArgs(Arg)=NwFldDefaults(Arg) - ENDDO - CurArgs=MAX(NwObjMinFlds,CurArgs) - ENDIF - - IF (NoDiff .and. DiffOnly) CYCLE - - !! reformat for better readability - !! BUILDING,SOLUTION ALGORITHM,OUTSIDE CONVECTION ALGORITHM,INSIDE CONVECTION ALGORITHM,REPORT VARIABLE, - !! SURFACE:HEATTRANSFER,SURFACE:HEATTRANSFER:SUBSURFACE:SHADING:DETACHED, - !! SURFACE:SHADING:DETACHED:FIXED,SURFACE:SHADING:DETACHED:BUILDING, - !! SURFACE:SHADING:ATTACHED, - !! WINDOWGLASSSPECTRALDATA, - !! FLUIDPROPERTYTEMPERATURES, - !! FLUIDPROPERTYSATURATED,FLUIDPROPERTYSUPERHEATED,FLUIDPROPERTYCONCENTRATION - IF (.not. Written) THEN - CALL CheckSpecialObjects(DifLfn,ObjectName,CurArgs,OutArgs,NwFldNames,NwFldUnits,Written) - ENDIF - - IF (.not. Written) THEN - CALL WriteOutIDFLines(DifLfn,ObjectName,CurArgs,OutArgs,NwFldNames,NwFldUnits) - ENDIF - - ENDDO ! IDFRecords - - CALL DisplayString('Processing IDF -- Processing idf objects complete.') - IF (IDFRecords(NumIDFRecords)%CommtE /= CurComment) THEN - DO xcount=IDFRecords(NumIDFRecords)%CommtE+1,CurComment - WRITE(DifLfn,fmta) TRIM(Comments(xcount)) - if (xcount == IDFRecords(Num)%CommtE) WRITE(DifLfn,fmta) '' - ENDDO - ENDIF - - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! E N D O F P R O C E S S I N G ! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - - IF (GetNumSectionsFound('Report Variable Dictionary') > 0) THEN - ObjectName='Output:VariableDictionary' - CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) - nodiff=.false. - OutArgs(1)='Regular' - CurArgs=1 - CALL WriteOutIDFLines(DifLfn,ObjectName,CurArgs,OutArgs,NwFldNames,NwFldUnits) - ENDIF - - INQUIRE(FILE=trim(FileNamePath)//'.rvi',EXIST=FileExist) -! IF (FileExist) THEN -! CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & -! 'rvi file associated with this input is being processed. Review for accuracy.') -! write(diflfn,fmtA) ' ' -! ENDIF - CLOSE(DifLfn) - CALL ProcessRviMviFiles(FileNamePath,'rvi') - CALL ProcessRviMviFiles(FileNamePath,'mvi') - CALL CloseOut - ELSE ! not a idf or imf - CALL ProcessRviMviFiles(FileNamePath,'rvi') - CALL ProcessRviMviFiles(FileNamePath,'mvi') - ENDIF - ELSE ! Full name == Blank - EndOfFile=.true. - ENDIF - - CALL CreateNewName('Reallocate',CreatedOutputName,' ') - - ENDDO - - IF (.not. ExitBecauseBadFile) THEN - StillWorking=.false. - EXIT - ELSE - IF (.not. ArgFileBeingDone) THEN - EndOfFile=.false. - ELSE - EndOfFile=.true. - StillWorking=.false. - ENDIF - ENDIF - ENDDO - - IF (ArgFileBeingDone .and. .not. LatestVersion .and. .not. ExitBecauseBadFile) THEN - ! If this is true, then there was a "arg IDF File" on the command line and some files need to be renamed - ErrFlag=.false. - CALL copyfile(TRIM(FileNamePath)//'.'//TRIM(ArgIDFExtension),TRIM(FileNamePath)//'.'//TRIM(ArgIDFExtension)//'old',ErrFlag) - CALL copyfile(TRIM(FileNamePath)//'.'//TRIM(ArgIDFExtension)//'new',TRIM(FileNamePath)//'.'//TRIM(ArgIDFExtension),ErrFlag) - INQUIRE(File=TRIM(FileNamePath)//'.rvi',EXIST=FileExist) - IF (FileExist) THEN - CALL copyfile(TRIM(FileNamePath)//'.rvi',TRIM(FileNamePath)//'.rviold',ErrFlag) - ENDIF - INQUIRE(File=TRIM(FileNamePath)//'.rvinew',EXIST=FileExist) - IF (FileExist) THEN - CALL copyfile(TRIM(FileNamePath)//'.rvinew',TRIM(FileNamePath)//'.rvi',ErrFlag) - ENDIF - INQUIRE(File=TRIM(FileNamePath)//'.mvi',EXIST=FileExist) - IF (FileExist) THEN - CALL copyfile(TRIM(FileNamePath)//'.mvi',TRIM(FileNamePath)//'.mviold',ErrFlag) - ENDIF - INQUIRE(File=TRIM(FileNamePath)//'.mvinew',EXIST=FileExist) - IF (FileExist) THEN - CALL copyfile(TRIM(FileNamePath)//'.mvinew',TRIM(FileNamePath)//'.mvi',ErrFlag) - ENDIF - ENDIF - - RETURN - -END SUBROUTINE CreateNewIDFUsingRules From d01512a2ebef3c0283843c672f2f3406cd146757 Mon Sep 17 00:00:00 2001 From: lymereJ Date: Fri, 10 Oct 2025 12:13:08 -0700 Subject: [PATCH 18/30] Git add latest file. --- .../CreateNewIDFUsingRulesV25_2_0.f90 | 1141 +++++++++++++++++ 1 file changed, 1141 insertions(+) create mode 100644 src/Transition/CreateNewIDFUsingRulesV25_2_0.f90 diff --git a/src/Transition/CreateNewIDFUsingRulesV25_2_0.f90 b/src/Transition/CreateNewIDFUsingRulesV25_2_0.f90 new file mode 100644 index 00000000000..3e11c9df634 --- /dev/null +++ b/src/Transition/CreateNewIDFUsingRulesV25_2_0.f90 @@ -0,0 +1,1141 @@ +MODULE SetVersion + +USE DataStringGlobals +USE DataVCompareGlobals + +PUBLIC + +CONTAINS + +SUBROUTINE SetThisVersionVariables() + ! TODO: Update this section as appropriate + VerString='Conversion 25.1 => 25.2' + VersionNum=25.2 + ! Starting with version 22.1, the version string requires 4 characters + ! The original sVersionNum variable is a 3 character length string + ! If we just change that variable to be 4 characters, it could break everything before 22.1 + ! So instead, let's just move forward with a new 4 character string and use that in this file and the future + ! If we get to version 100.1 and we are still using this Fortran transition then well....we can deal with it then + sVersionNum = '***' + sVersionNumFourChars='25.2' + IDDFileNameWithPath=TRIM(ProgramPath)//'V25-1-0-Energy+.idd' + NewIDDFileNameWithPath=TRIM(ProgramPath)//'V25-2-0-Energy+.idd' + RepVarFileNameWithPath=TRIM(ProgramPath)//'Report Variables 25-1-0 to 25-2-0.csv' +END SUBROUTINE + +END MODULE + +SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFileName,ArgFile,ArgIDFExtension) + + ! SUBROUTINE INFORMATION: + ! AUTHOR Linda Lawrie + ! DATE WRITTEN July 2002 + ! MODIFIED For each release + ! RE-ENGINEERED na + + ! PURPOSE OF THIS SUBROUTINE: + ! This subroutine creates new IDFs based on the rules specified by + ! developers. This will result in a more complete transition but + ! takes more time to create. + + ! METHODOLOGY EMPLOYED: + ! na + + ! REFERENCES: + ! na + + ! USE STATEMENTS: + USE InputProcessor + USE DataVCompareGlobals + USE VCompareGlobalRoutines + USE DataStringGlobals, ONLY: ProgNameConversion + USE General + USE DataGlobals, ONLY: ShowMessage, ShowContinueError, ShowFatalError, ShowSevereError, ShowWarningError + + IMPLICIT NONE ! Enforce explicit typing of all variables in this routine + + ! SUBROUTINE ARGUMENT DEFINITIONS: + LOGICAL, INTENT(INOUT) :: EndOfFile + LOGICAL, INTENT(IN) :: DiffOnly + INTEGER, INTENT(IN) :: InLfn + LOGICAL, INTENT(IN) :: AskForInput + CHARACTER(len=*), INTENT(IN) :: InputFileName + LOGICAL, INTENT(IN) :: ArgFile + CHARACTER(len=*), INTENT(IN) :: ArgIDFExtension + + ! SUBROUTINE PARAMETER DEFINITIONS: + CHARACTER(len=*), PARAMETER :: fmta="(A)" + + ! INTERFACE BLOCK SPECIFICATIONS + ! na + + ! DERIVED TYPE DEFINITIONS + + ! SUBROUTINE LOCAL VARIABLE DECLARATIONS: + INTEGER IoS + INTEGER DotPos + INTEGER Status + INTEGER NA + INTEGER NN + INTEGER CurArgs + INTEGER DifLfn + INTEGER xCount + INTEGER Num + INTEGER, EXTERNAL :: GetNewUnitNumber + INTEGER Arg + LOGICAL, SAVE :: FirstTime=.true. + CHARACTER(len=30) UnitsArg + CHARACTER(len=MaxNameLength) :: ObjectName + CHARACTER(len=30), EXTERNAL :: TrimTrailZeros + CHARACTER(len=MaxNameLength) :: UCRepVarName=blank + CHARACTER(len=MaxNameLength) :: UCCompRepVarName=blank + LOGICAL DelThis + INTEGER pos + INTEGER pos2 + LOGICAL ExitBecauseBadFile + LOGICAL StillWorking + LOGICAL NoDiff + LOGICAL checkrvi + LOGICAL NoVersion + LOGICAL DiffMinFields ! Set to true when diff number of min-fields between the two objects + LOGICAL Written + INTEGER :: Var + INTEGER :: CurVar + LOGICAL ArgFileBeingDone + LOGICAL LatestVersion + CHARACTER(len=10) :: LocalFileExtension=' ' + LOGICAL :: WildMatch + + LOGICAL :: ConnComp + LOGICAL :: ConnCompCtrl + LOGICAL :: FileExist + CHARACTER(len=MaxNameLength) :: CreatedOutputName + LOGICAL, ALLOCATABLE, DIMENSION(:) :: DeleteThisRecord + INTEGER :: COutArgs + CHARACTER(len=16) :: UnitsField + + LOGICAL :: ErrFlag + + INTEGER :: I, CurField, NewField, KAindex=0, SearchNum + INTEGER :: AlphaNumI + REAL :: SaveNumber + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! I N S E R T L O C A L V A R I A B L E S H E R E ! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + + ! TODO: Move to V10_0_0.f90 when available + ! For Defaulting now-required RunPeriod Name + INTEGER :: TotRunPeriods = 0 + INTEGER :: runPeriodNum = 0 + INTEGER :: iterateRunPeriod = 0 + CHARACTER(len=MaxNameLength), ALLOCATABLE, DIMENSION(:) :: CurrentRunPeriodNames + CHARACTER(len=20) :: PotentialRunPeriodName + ! END OF TODO + + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! E N D O F I N S E R T L O C A L V A R I A B L E S H E R E ! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + + If (FirstTime) THEN ! do things that might be applicable only to this new version + FirstTime=.false. + EndIf + + StillWorking=.true. + ArgFileBeingDone=.false. + LatestVersion=.false. + NoVersion=.true. + LocalFileExtension=ArgIDFExtension + EndOfFile=.false. + IOS=0 + + DO WHILE (StillWorking) + + ExitBecauseBadFile=.false. + DO WHILE (.not. EndOfFile) + IF (AskForInput) THEN + WRITE(*,*) 'Enter input file name, with path' + write(*,fmta,advance='no') '-->' + READ(*,fmta) FullFileName + ELSE + IF (.not. ArgFile) THEN + READ(InLfn,*,IOSTAT=IoS) FullFileName + ELSEIF (.not. ArgFileBeingDone) THEN + FullFileName=InputFileName + IOS=0 + ArgFileBeingDone=.true. + ELSE + FullFileName=Blank + IOS=1 + ENDIF + IF (FullFileName(1:1) == '!') THEN + FullFileName=Blank + CYCLE + ENDIF + ENDIF + UnitsArg=Blank + IF (IoS /= 0) FullFileName=Blank + FullFileName=ADJUSTL(FullFileName) + IF (FullFileName /= Blank) THEN + CALL DisplayString('Processing IDF -- '//TRIM(FullFileName)) + WRITE(Auditf,fmta) ' Processing IDF -- '//TRIM(FullFileName) + DotPos=SCAN(FullFileName,'.',.true.) ! Scan backward looking for extension, + IF (DotPos /= 0) THEN + FileNamePath=FullFileName(1:DotPos-1) + LocalFileExtension=MakeLowerCase(FullFileName(DotPos+1:)) + ELSE + FileNamePath=FullFileName + WRITE(*,*) ' assuming file extension of .idf' + WRITE(Auditf,fmta) ' ..assuming file extension of .idf' + FullFileName=TRIM(FullFileName)//'.idf' + LocalFileExtension='idf' + ENDIF + ! Process the old input + DifLfn=GetNewUnitNumber() + INQUIRE(File=TRIM(FullFileName),EXIST=FileOK) + IF (.not. FileOK) THEN + WRITE(*,*) 'File not found='//TRIM(FullFileName) + WRITE(Auditf,*) 'File not found='//TRIM(FullFileName) + EndOfFile=.true. + ExitBecauseBadFile=.true. + EXIT + ENDIF + IF (LocalFileExtension == 'idf' .or. LocalFileExtension == 'imf') THEN + checkrvi=.false. + ConnComp=.false. + ConnCompCtrl=.false. + IF (DiffOnly) THEN + OPEN(DifLfn,FILE=TRIM(FileNamePath)//'.'//TRIM(LocalFileExtension)//'dif') + ELSE + OPEN(DifLfn,FILE=TRIM(FileNamePath)//'.'//TRIM(LocalFileExtension)//'new') + ENDIF + IF (LocalFileExtension == 'imf') THEN + CALL ShowWarningError('Note: IMF file being processed. No guarantee of perfection. Please check new file carefully.',Auditf) + ProcessingIMFFile=.true. + ELSE + ProcessingIMFFile=.false. + ENDIF + CALL ProcessInput(IDDFileNameWithPath,NewIDDFileNameWithPath,FullFileName) + IF (FatalError) THEN + ExitBecauseBadFile=.true. + EXIT + ENDIF + + ! Clean up from any previous passes, then re-allocate. These are for the 'standard' stuff, not your own + ! Do not add anything here! + IF(ALLOCATED(DeleteThisRecord)) DEALLOCATE(DeleteThisRecord) + IF(ALLOCATED(Alphas)) DEALLOCATE(Alphas) + IF(ALLOCATED(Numbers)) DEALLOCATE(Numbers) + IF(ALLOCATED(InArgs)) DEALLOCATE(InArgs) + IF(ALLOCATED(TempArgs)) DEALLOCATE(TempArgs) + IF(ALLOCATED(AorN)) DEALLOCATE(AorN) + IF(ALLOCATED(ReqFld)) DEALLOCATE(ReqFld) + IF(ALLOCATED(FldNames)) DEALLOCATE(FldNames) + IF(ALLOCATED(FldDefaults)) DEALLOCATE(FldDefaults) + IF(ALLOCATED(FldUnits)) DEALLOCATE(FldUnits) + IF(ALLOCATED(NwAorN)) DEALLOCATE(NwAorN) + IF(ALLOCATED(NwReqFld)) DEALLOCATE(NwReqFld) + IF(ALLOCATED(NwFldNames)) DEALLOCATE(NwFldNames) + IF(ALLOCATED(NwFldDefaults)) DEALLOCATE(NwFldDefaults) + IF(ALLOCATED(NwFldUnits)) DEALLOCATE(NwFldUnits) + IF(ALLOCATED(OutArgs)) DEALLOCATE(OutArgs) + ALLOCATE(Alphas(MaxAlphaArgsFound),Numbers(MaxNumericArgsFound)) + ALLOCATE(InArgs(MaxTotalArgs)) + ALLOCATE(TempArgs(MaxTotalArgs)) + ALLOCATE(AorN(MaxTotalArgs),ReqFld(MaxTotalArgs),FldNames(MaxTotalArgs),FldDefaults(MaxTotalArgs),FldUnits(MaxTotalArgs)) + ALLOCATE(NwAorN(MaxTotalArgs),NwReqFld(MaxTotalArgs),NwFldNames(MaxTotalArgs),NwFldDefaults(MaxTotalArgs),NwFldUnits(MaxTotalArgs)) + ALLOCATE(OutArgs(MaxTotalArgs)) + ALLOCATE(DeleteThisRecord(NumIDFRecords)) + DeleteThisRecord=.false. + + NoVersion=.true. + DO Num=1,NumIDFRecords + IF (MakeUPPERCase(IDFRecords(Num)%Name) /= 'VERSION') CYCLE + NoVersion=.false. + EXIT + ENDDO + + DO Num=1,NumIDFRecords + IF (DeleteThisRecord(Num)) THEN + Write(DifLfn,fmta) '! Deleting: '//TRIM(IDFRecords(Num)%Name)//'="'//TRIM(IDFRecords(Num)%Alphas(1))//'".' + ENDIF + ENDDO + + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! P R E P R O C E S S I N G ! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +! Do any kind of Preprocessing that is needed here (eg: a first pass on objects to store some attributes etc) + + + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! P R O C E S S I N G ! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + CALL DisplayString('Processing IDF -- Processing idf objects . . .') + DO Num=1,NumIDFRecords + + IF (DeleteThisRecord(Num)) CYCLE + DO xcount=IDFRecords(Num)%CommtS+1,IDFRecords(Num)%CommtE + WRITE(DifLfn,fmta) TRIM(Comments(xcount)) + if (xcount == IDFRecords(Num)%CommtE) WRITE(DifLfn,fmta) '' + ENDDO + IF (NoVersion .and. Num == 1) THEN + CALL GetNewObjectDefInIDD('VERSION',NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1) = sVersionNumFourChars + CurArgs=1 + CALL ShowWarningError('No version found in file, defaulting to '//sVersionNumFourChars,Auditf) + CALL WriteOutIDFLinesAsComments(DifLfn,'Version',CurArgs,OutArgs,NwFldNames,NwFldUnits) + ENDIF + + ! deleted objects. no transition. + ! eg: IF (MakeUPPERCase(TRIM(IDFRecords(Num)%Name)) == 'PROGRAMCONTROL') CYCLE + + ObjectName=IDFRecords(Num)%Name + IF (FindItemInList(ObjectName,ObjectDef%Name,NumObjectDefs) /= 0) THEN + CALL GetObjectDefInIDD(ObjectName,NumArgs,AorN,ReqFld,ObjMinFlds,FldNames,FldDefaults,FldUnits) + NumAlphas=IDFRecords(Num)%NumAlphas + NumNumbers=IDFRecords(Num)%NumNumbers + Alphas(1:NumAlphas)=IDFRecords(Num)%Alphas(1:NumAlphas) + Numbers(1:NumNumbers)=IDFRecords(Num)%Numbers(1:NumNumbers) + CurArgs=NumAlphas+NumNumbers + InArgs=Blank + OutArgs=Blank + TempArgs=Blank + NA=0 + NN=0 + DO Arg=1,CurArgs + IF (AorN(Arg)) THEN + NA=NA+1 + InArgs(Arg)=Alphas(NA) + ELSE + NN=NN+1 + InArgs(Arg)=Numbers(NN) + ENDIF + ENDDO + ELSE + WRITE(Auditf,fmta) 'Object="'//TRIM(ObjectName)//'" does not seem to be on the "old" IDD.' + WRITE(Auditf,fmta) '... will be listed as comments (no field names) on the new output file.' + WRITE(Auditf,fmta) '... Alpha fields will be listed first, then numerics.' + NumAlphas=IDFRecords(Num)%NumAlphas + NumNumbers=IDFRecords(Num)%NumNumbers + Alphas(1:NumAlphas)=IDFRecords(Num)%Alphas(1:NumAlphas) + Numbers(1:NumNumbers)=IDFRecords(Num)%Numbers(1:NumNumbers) + DO Arg=1,NumAlphas + OutArgs(Arg)=Alphas(Arg) + ENDDO + NN=NumAlphas+1 + DO Arg=1,NumNumbers + OutArgs(NN)=Numbers(Arg) + NN=NN+1 + ENDDO + CurArgs=NumAlphas+NumNumbers + NwFldNames=Blank + NwFldUnits=Blank + CALL WriteOutIDFLinesAsComments(DifLfn,ObjectName,CurArgs,OutArgs,NwFldNames,NwFldUnits) + CYCLE + ENDIF + + Nodiff=.true. ! Nodiff is true by default + DiffMinFields=.false. + Written=.false. + + IF (FindItemInList(MakeUPPERCase(ObjectName),NotInNew,SIZE(NotInNew)) == 0) THEN + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + ! Check minfields + IF (ObjMinFlds /= NwObjMinFlds) THEN + DiffMinFields=.true. + ELSE + DiffMinFields=.false. + ENDIF + ENDIF + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IF NOT ONLY MAKING PRETTY !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + IF (.not. MakingPretty) THEN + + SELECT CASE (MakeUPPERCase(TRIM(IDFRecords(Num)%Name))) + + CASE ('VERSION') + IF ((InArgs(1)(1:4)) == sVersionNumFourChars .and. ArgFile) THEN + CALL ShowWarningError('File is already at latest version. No new diff file made.',Auditf) + CLOSE(diflfn,STATUS='DELETE') + LatestVersion=.true. + EXIT + ENDIF + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1) = sVersionNumFourChars + NoDiff=.false. + + ! changes for this version, pick one of the spots to add rules, this will reduce the possibility of merge conflicts + +! CASE('OBJECTNAMEHERE') +! CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) +! nodiff=.false. +! OutArgs(1)=InArgs(1) +! OutArgs(2) = 'SequentialLoad' +! OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) +! CurArgs = CurArgs + 1 + + ! If your original object starts with A, insert the rules here + + ! If your original object starts with C, insert the rules here + CASE('COIL:COOLING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.false. + OutArgs(1:1)=InArgs(1:1) + OutArgs(2) = '' ! new Availability Schedule Name field + OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) + CurArgs = CurArgs + 1 + + CASE('COIL:HEATING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.false. + OutArgs(1:1)=InArgs(1:1) + OutArgs(2) = '' ! new Availability Schedule Name field + OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) + CurArgs = CurArgs + 1 + + CASE('COIL:COOLING:DX:VARIABLESPEED') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.false. + OutArgs(1:1)=InArgs(1:1) + OutArgs(2) = '' ! new Availability Schedule Name field + OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) + CurArgs = CurArgs + 1 + + CASE('COIL:HEATING:DX:VARIABLESPEED') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.false. + OutArgs(1:1)=InArgs(1:1) + OutArgs(2) = '' ! new Availability Schedule Name field + OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) + CurArgs = CurArgs + 1 + + CASE('COIL:WATERHEATING:AIRTOWATERHEATPUMP:VARIABLESPEED') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.false. + OutArgs(1:1)=InArgs(1:1) + OutArgs(2) = '' ! new Availability Schedule Name field + OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) + CurArgs = CurArgs + 1 + + CASE('COIL:COOLING:WATERTOAIRHEATPUMP:EQUATIONFIT') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.false. + OutArgs(1:1)=InArgs(1:1) + OutArgs(2) = '' ! new Availability Schedule Name field + OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) + CurArgs = CurArgs + 1 + + CASE('COIL:HEATING:WATERTOAIRHEATPUMP:EQUATIONFIT') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.false. + OutArgs(1:1)=InArgs(1:1) + OutArgs(2) = '' ! new Availability Schedule Name field + OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) + CurArgs = CurArgs + 1 + + CASE('COIL:COOLING:WATERTOAIRHEATPUMP:PARAMETERESTIMATION') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.false. + OutArgs(1:1)=InArgs(1:1) + OutArgs(2) = '' ! new Availability Schedule Name field + OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) + CurArgs = CurArgs + 1 + + CASE('COIL:HEATING:WATERTOAIRHEATPUMP:PARAMETERESTIMATION') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.false. + OutArgs(1:1)=InArgs(1:1) + OutArgs(2) = '' ! new Availability Schedule Name field + OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) + CurArgs = CurArgs + 1 + + CASE('COIL:WATERHEATING:AIRTOWATERHEATPUMP:PUMPED') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.false. + OutArgs(1:1)=InArgs(1:1) + OutArgs(2) = '' ! new Availability Schedule Name field + OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) + CurArgs = CurArgs + 1 + + CASE('COIL:WATERHEATING:AIRTOWATERHEATPUMP:WRAPPED') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.false. + OutArgs(1:1)=InArgs(1:1) + OutArgs(2) = '' ! new Availability Schedule Name field + OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) + CurArgs = CurArgs + 1 + + ! If your original object starts with D, insert the rules here + + ! If your original object starts with E, insert the rules here + + ! If your original object starts with F, insert the rules here + + ! If your original object starts with G, insert the rules here + + ! If your original object starts with H, insert the rules here + + ! If your original object starts with I, insert the rules here + + ! If your original object starts with L, insert the rules here + + ! If your original object starts with M, insert the rules here + + ! If your original object starts with N, insert the rules here + + ! If your original object starts with O, insert the rules here + + ! If your original object starts with P, insert the rules here + + ! If your original object starts with R, insert the rules here + + ! If your original object starts with S, insert the rules here + + ! If your original object starts with T, insert the rules here + + ! If your original object starts with U, insert the rules here + + ! If your original object starts with V, insert the rules here + + ! If your original object starts with W, insert the rules here + + ! If your original object starts with Z, insert the rules here + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! Changes for report variables, meters, tables -- update names ! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +! TODO: not sure if need to keep all of this... + + !!! Changes for report variables, meters, tables -- update names + CASE('OUTPUT:VARIABLE') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1:CurArgs)=InArgs(1:CurArgs) + nodiff=.true. + IF (OutArgs(1) == Blank) THEN + OutArgs(1)='*' + nodiff=.false. + ENDIF + + CALL ScanOutputVariablesForReplacement( & + 2, & + DelThis, & + checkrvi, & + nodiff, & + ObjectName, & + DifLfn, & + .true., & !OutVar + .false., & !MtrVar + .false., & !TimeBinVar + CurArgs, & + Written, & + .false.) + IF (DelThis) CYCLE + + CASE ('OUTPUT:METER','OUTPUT:METER:METERFILEONLY','OUTPUT:METER:CUMULATIVE','OUTPUT:METER:CUMULATIVE:METERFILEONLY') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1:CurArgs)=InArgs(1:CurArgs) + nodiff=.true. + CALL ScanOutputVariablesForReplacement( & + 1, & + DelThis, & + checkrvi, & + nodiff, & + ObjectName, & + DifLfn, & + .false., & !OutVar + .true., & !MtrVar + .false., & !TimeBinVar + CurArgs, & + Written, & + .false.) + IF (DelThis) CYCLE + + CASE('OUTPUT:TABLE:TIMEBINS') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1:CurArgs)=InArgs(1:CurArgs) + nodiff=.true. + IF (OutArgs(1) == Blank) THEN + OutArgs(1)='*' + nodiff=.false. + ENDIF + CALL ScanOutputVariablesForReplacement( & + 2, & + DelThis, & + checkrvi, & + nodiff, & + ObjectName, & + DifLfn, & + .false., & !OutVar + .false., & !MtrVar + .true., & !TimeBinVar + CurArgs, & + Written, & + .false.) + IF (DelThis) CYCLE + +!ExternalInterface:FunctionalMockupUnitImport:From:Variable, field 2 +!ExternalInterface:FunctionalMockupUnitExport:From:Variable, field 2 + CASE('EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT:FROM:VARIABLE', & + 'EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITEXPORT:FROM:VARIABLE') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1:CurArgs)=InArgs(1:CurArgs) + nodiff=.true. + IF (OutArgs(1) == Blank) THEN + OutArgs(1)='*' + nodiff=.false. + ENDIF + CALL ScanOutputVariablesForReplacement( & + 2, & + DelThis, & + checkrvi, & + nodiff, & + ObjectName, & + DifLfn, & + .false., & !OutVar + .false., & !MtrVar + .false., & !TimeBinVar + CurArgs, & + Written, & + .false.) + IF (DelThis) CYCLE + +!EnergyManagementSystem:Sensor, field 3 + CASE('ENERGYMANAGEMENTSYSTEM:SENSOR') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1:CurArgs)=InArgs(1:CurArgs) + nodiff=.true. + CALL ScanOutputVariablesForReplacement( & + 3, & + DelThis, & + checkrvi, & + nodiff, & + ObjectName, & + DifLfn, & + .false., & !OutVar + .false., & !MtrVar + .false., & !TimeBinVar + CurArgs, & + Written, & + .true.) + IF (DelThis) CYCLE + + CASE('OUTPUT:TABLE:MONTHLY') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.true. + OutArgs(1:CurArgs)=InArgs(1:CurArgs) + CurVar=3 + DO Var=3,CurArgs,2 + UCRepVarName=MakeUPPERCase(InArgs(Var)) + OutArgs(CurVar)=InArgs(Var) + OutArgs(CurVar+1)=InArgs(Var+1) + pos=INDEX(UCRepVarName,'[') + IF (pos > 0) THEN + UCRepVarName=UCRepVarName(1:pos-1) + OutArgs(CurVar)=InArgs(Var)(1:pos-1) + OutArgs(CurVar+1)=InArgs(Var+1) + ENDIF + DelThis=.false. + DO Arg=1,NumRepVarNames + UCCompRepVarName=MakeUPPERCase(OldRepVarName(Arg)) + IF (UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName)) == '*') THEN + WildMatch=.true. + UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName))=' ' + pos=INDEX(TRIM(UCRepVarname),TRIM(UCCompRepVarName)) + ELSE + WildMatch=.false. + pos=0 + if (UCRepVarName == UCCompRepVarName) pos=1 + ENDIF + IF (pos > 0 .and. pos /= 1) CYCLE + IF (pos > 0) THEN + IF (NewRepVarName(Arg) /= '') THEN + IF (.not. WildMatch) THEN + OutArgs(CurVar)=NewRepVarName(Arg) + ELSE + OutArgs(CurVar)=TRIM(NewRepVarName(Arg))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) + ENDIF + IF (NewRepVarCaution(Arg) /= Blank .and. .not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq') ) THEN + IF (.not. OTMVarCaution(Arg)) THEN ! caution message not written yet + CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & + 'Output Table Monthly (old)="'//trim(OldRepVarName(Arg))// & + '" conversion to Output Table Monthly (new)="'// & + trim(NewRepVarName(Arg))//'" has the following caution "'//trim(NewRepVarCaution(Arg))//'".') + write(diflfn,fmtA) ' ' + OTMVarCaution(Arg)=.true. + ENDIF + ENDIF + OutArgs(CurVar+1)=InArgs(Var+1) + nodiff=.false. + ELSE + DelThis=.true. + ENDIF + IF (OldRepVarName(Arg) == OldRepVarName(Arg+1)) THEN + IF (.not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq')) THEN + ! Adding a var field. + CurVar=CurVar+2 + IF (.not. WildMatch) THEN + OutArgs(CurVar)=NewRepVarName(Arg+1) + ELSE + OutArgs(CurVar)=TRIM(NewRepVarName(Arg+1))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) + ENDIF + IF (NewRepVarCaution(Arg+1) /= Blank) THEN + IF (.not. OTMVarCaution(Arg+1)) THEN ! caution message not written yet + CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & + 'Output Table Monthly (old)="'//trim(OldRepVarName(Arg))// & + '" conversion to Output Table Monthly (new)="'// & + trim(NewRepVarName(Arg+1))//'" has the following caution "'//trim(NewRepVarCaution(Arg+1))//'".') + write(diflfn,fmtA) ' ' + OTMVarCaution(Arg+1)=.true. + ENDIF + ENDIF + OutArgs(CurVar+1)=InArgs(Var+1) + nodiff=.false. + ENDIF + ENDIF + IF (OldRepVarName(Arg) == OldRepVarName(Arg+2)) THEN ! only 1 more... for ForkEq + ! Adding a var field. + CurVar=CurVar+2 + IF (.not. WildMatch) THEN + OutArgs(CurVar)=NewRepVarName(Arg+2) + ELSE + OutArgs(CurVar)=TRIM(NewRepVarName(Arg+2))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) + ENDIF + IF (NewRepVarCaution(Arg+2) /= Blank) THEN + IF (.not. OTMVarCaution(Arg+2)) THEN ! caution message not written yet + CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & + 'Output Table Monthly (old)="'//trim(OldRepVarName(Arg))// & + '" conversion to Output Table Monthly (new)="'// & + trim(NewRepVarName(Arg+2))//'" has the following caution "'//trim(NewRepVarCaution(Arg+2))//'".') + write(diflfn,fmtA) ' ' + OTMVarCaution(Arg+2)=.true. + ENDIF + ENDIF + OutArgs(CurVar+1)=InArgs(Var+1) + nodiff=.false. + ENDIF + EXIT + ENDIF + ENDDO + IF (.not. DelThis) CurVar=CurVar+2 + ENDDO + CurArgs=CurVar-1 + + CASE('METER:CUSTOM') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1:CurArgs)=InArgs(1:CurArgs) + nodiff=.true. + CurVar=4 + DO Var=4,CurArgs,2 + UCRepVarName=MakeUPPERCase(InArgs(Var)) + OutArgs(CurVar)=InArgs(Var) + OutArgs(CurVar+1)=InArgs(Var+1) + pos=INDEX(UCRepVarName,'[') + IF (pos > 0) THEN + UCRepVarName=UCRepVarName(1:pos-1) + OutArgs(CurVar)=InArgs(Var)(1:pos-1) + OutArgs(CurVar+1)=InArgs(Var+1) + ENDIF + DelThis=.false. + DO Arg=1,NumRepVarNames + UCCompRepVarName=MakeUPPERCase(OldRepVarName(Arg)) + IF (UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName)) == '*') THEN + WildMatch=.true. + UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName))=' ' + pos=INDEX(TRIM(UCRepVarname),TRIM(UCCompRepVarName)) + ELSE + WildMatch=.false. + pos=0 + if (UCRepVarName == UCCompRepVarName) pos=1 + ENDIF + IF (pos > 0 .and. pos /= 1) CYCLE + IF (pos > 0) THEN + IF (NewRepVarName(Arg) /= '') THEN + IF (.not. WildMatch) THEN + OutArgs(CurVar)=NewRepVarName(Arg) + ELSE + OutArgs(CurVar)=TRIM(NewRepVarName(Arg))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) + ENDIF + IF (NewRepVarCaution(Arg) /= Blank .and. .not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq') ) THEN + IF (.not. CMtrVarCaution(Arg)) THEN ! caution message not written yet + CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & + 'Custom Meter (old)="'//trim(OldRepVarName(Arg))// & + '" conversion to Custom Meter (new)="'// & + trim(NewRepVarName(Arg))//'" has the following caution "'//trim(NewRepVarCaution(Arg))//'".') + write(diflfn,fmtA) ' ' + CMtrVarCaution(Arg)=.true. + ENDIF + ENDIF + OutArgs(CurVar+1)=InArgs(Var+1) + nodiff=.false. + ELSE + DelThis=.true. + ENDIF + IF (OldRepVarName(Arg) == OldRepVarName(Arg+1)) THEN + IF (.not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq')) THEN + ! Adding a var field. + CurVar=CurVar+2 + IF (.not. WildMatch) THEN + OutArgs(CurVar)=NewRepVarName(Arg+1) + ELSE + OutArgs(CurVar)=TRIM(NewRepVarName(Arg+1))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) + ENDIF + IF (NewRepVarCaution(Arg+1) /= Blank .and. .not. SameString(NewRepVarCaution(Arg+1)(1:6),'Forkeq') ) THEN + IF (.not. CMtrVarCaution(Arg+1)) THEN ! caution message not written yet + CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & + 'Custom Meter (old)="'//trim(OldRepVarName(Arg))// & + '" conversion to Custom Meter (new)="'// & + trim(NewRepVarName(Arg+1))//'" has the following caution "'//trim(NewRepVarCaution(Arg+1))//'".') + write(diflfn,fmtA) ' ' + CMtrVarCaution(Arg+1)=.true. + ENDIF + ENDIF + OutArgs(CurVar+1)=InArgs(Var+1) + nodiff=.false. + ENDIF + ENDIF + IF (OldRepVarName(Arg) == OldRepVarName(Arg+2)) THEN + ! Adding a var field. + CurVar=CurVar+2 + IF (.not. WildMatch) THEN + OutArgs(CurVar)=NewRepVarName(Arg+2) + ELSE + OutArgs(CurVar)=TRIM(NewRepVarName(Arg+2))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) + ENDIF + IF (NewRepVarCaution(Arg+2) /= Blank) THEN + IF (.not. CMtrVarCaution(Arg+2)) THEN ! caution message not written yet + CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & + 'Custom Meter (old)="'//trim(OldRepVarName(Arg))// & + '" conversion to Custom Meter (new)="'// & + trim(NewRepVarName(Arg+2))//'" has the following caution "'//trim(NewRepVarCaution(Arg+2))//'".') + write(diflfn,fmtA) ' ' + CMtrVarCaution(Arg+2)=.true. + ENDIF + ENDIF + OutArgs(CurVar+1)=InArgs(Var+1) + nodiff=.false. + ENDIF + EXIT + ENDIF + ENDDO + IF (.not. DelThis) CurVar=CurVar+2 + ENDDO + CurArgs=CurVar + DO Arg=CurVar,1,-1 + IF (OutArgs(Arg) == Blank) THEN + CurArgs=CurArgs-1 + ELSE + EXIT + ENDIF + ENDDO + + CASE('METER:CUSTOMDECREMENT') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1:CurArgs)=InArgs(1:CurArgs) + nodiff=.true. + CurVar=4 ! In case Source Meter would change + DO Var=4,CurArgs,2 + UCRepVarName=MakeUPPERCase(InArgs(Var)) + OutArgs(CurVar)=InArgs(Var) + OutArgs(CurVar+1)=InArgs(Var+1) + pos=INDEX(UCRepVarName,'[') + IF (pos > 0) THEN + UCRepVarName=UCRepVarName(1:pos-1) + OutArgs(CurVar)=InArgs(Var)(1:pos-1) + OutArgs(CurVar+1)=InArgs(Var+1) + ENDIF + DelThis=.false. + DO Arg=1,NumRepVarNames + UCCompRepVarName=MakeUPPERCase(OldRepVarName(Arg)) + IF (UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName)) == '*') THEN + WildMatch=.true. + UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName))=' ' + pos=INDEX(TRIM(UCRepVarname),TRIM(UCCompRepVarName)) + ELSE + WildMatch=.false. + pos=0 + if (UCRepVarName == UCCompRepVarName) pos=1 + ENDIF + IF (pos > 0 .and. pos /= 1) CYCLE + IF (pos > 0) THEN + IF (NewRepVarName(Arg) /= '') THEN + IF (.not. WildMatch) THEN + OutArgs(CurVar)=NewRepVarName(Arg) + ELSE + OutArgs(CurVar)=TRIM(NewRepVarName(Arg))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) + ENDIF + IF (NewRepVarCaution(Arg) /= Blank .and. .not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq') ) THEN + IF (.not. CMtrDVarCaution(Arg)) THEN ! caution message not written yet + CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & + 'Custom Decrement Meter (old)="'//trim(OldRepVarName(Arg))// & + '" conversion to Custom Meter (new)="'// & + trim(NewRepVarName(Arg))//'" has the following caution "'//trim(NewRepVarCaution(Arg))//'".') + write(diflfn,fmtA) ' ' + CMtrDVarCaution(Arg)=.true. + ENDIF + ENDIF + OutArgs(CurVar+1)=InArgs(Var+1) + nodiff=.false. + ELSE + DelThis=.true. + ENDIF + IF (OldRepVarName(Arg) == OldRepVarName(Arg+1)) THEN + IF (.not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq')) THEN + ! Adding a var field. + CurVar=CurVar+2 + IF (.not. WildMatch) THEN + OutArgs(CurVar)=NewRepVarName(Arg+1) + ELSE + OutArgs(CurVar)=TRIM(NewRepVarName(Arg+1))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) + ENDIF + IF (NewRepVarCaution(Arg+1) /= Blank .and. .not. SameString(NewRepVarCaution(Arg+1)(1:6),'Forkeq') ) THEN + IF (.not. CMtrDVarCaution(Arg+1)) THEN ! caution message not written yet + CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & + 'Custom Decrement Meter (old)="'//trim(OldRepVarName(Arg))// & + '" conversion to Custom Decrement Meter (new)="'// & + trim(NewRepVarName(Arg+1))//'" has the following caution "'//trim(NewRepVarCaution(Arg+1))//'".') + write(diflfn,fmtA) ' ' + CMtrDVarCaution(Arg+1)=.true. + ENDIF + ENDIF + OutArgs(CurVar+1)=InArgs(Var+1) + nodiff=.false. + ENDIF + ENDIF + IF (OldRepVarName(Arg) == OldRepVarName(Arg+2)) THEN + ! Adding a var field. + CurVar=CurVar+2 + IF (.not. WildMatch) THEN + OutArgs(CurVar)=NewRepVarName(Arg+2) + ELSE + OutArgs(CurVar)=TRIM(NewRepVarName(Arg+2))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) + ENDIF + IF (NewRepVarCaution(Arg+2) /= Blank) THEN + IF (.not. CMtrDVarCaution(Arg+2)) THEN ! caution message not written yet + CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & + 'Custom Decrement Meter (old)="'//trim(OldRepVarName(Arg))// & + '" conversion to Custom Meter (new)="'// & + trim(NewRepVarName(Arg+2))//'" has the following caution "'//trim(NewRepVarCaution(Arg+2))//'".') + write(diflfn,fmtA) ' ' + CMtrDVarCaution(Arg+2)=.true. + ENDIF + ENDIF + OutArgs(CurVar+1)=InArgs(Var+1) + nodiff=.false. + ENDIF + EXIT + ENDIF + ENDDO + IF (.not. DelThis) CurVar=CurVar+2 + ENDDO + CurArgs=CurVar + DO Arg=CurVar,1,-1 + IF (OutArgs(Arg) == Blank) THEN + CurArgs=CurArgs-1 + ELSE + EXIT + ENDIF + ENDDO + + !!! Changes for other objects that reference meter names -- update names + CASE('DEMANDMANAGERASSIGNMENTLIST', & + 'UTILITYCOST:TARIFF') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1:CurArgs)=InArgs(1:CurArgs) + nodiff=.true. + + CALL ScanOutputVariablesForReplacement( & + 2, & + DelThis, & + checkrvi, & + nodiff, & + ObjectName, & + DifLfn, & + .false., & !OutVar + .true., & !MtrVar + .false., & !TimeBinVar + CurArgs, & + Written, & + .false.) + + CASE('ELECTRICLOADCENTER:DISTRIBUTION') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1:CurArgs)=InArgs(1:CurArgs) + nodiff=.true. + + ! Field 6 A5, \field Generator Track Meter Scheme Meter Name + CALL ScanOutputVariablesForReplacement( & + 6, & + DelThis, & + checkrvi, & + nodiff, & + ObjectName, & + DifLfn, & + .false., & !OutVar + .true., & !MtrVar + .false., & !TimeBinVar + CurArgs, & + Written, & + .false.) + + ! Field 12 A11, \field Storage Control Track Meter Name + CALL ScanOutputVariablesForReplacement( & + 12, & + DelThis, & + checkrvi, & + nodiff, & + ObjectName, & + DifLfn, & + .false., & !OutVar + .true., & !MtrVar + .false., & !TimeBinVar + CurArgs, & + Written, & + .false.) + + ! ANY OTHER OBJECT + CASE DEFAULT + IF (FindItemInList(ObjectName,NotInNew,SIZE(NotInNew)) /= 0) THEN + WRITE(Auditf,fmta) 'Object="'//TRIM(ObjectName)//'" is not in the "new" IDD.' + WRITE(Auditf,fmta) '... will be listed as comments on the new output file.' + CALL WriteOutIDFLinesAsComments(DifLfn,ObjectName,CurArgs,InArgs,FldNames,FldUnits) + Written=.true. + !CYCLE + ELSE + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1:CurArgs)=InArgs(1:CurArgs) + NoDiff=.true. + ENDIF + + END SELECT + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IF ONLY MAKING PRETTY !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ELSE !!! Making Pretty + + ! Just making pretty -- no changes as above. + CALL GetNewObjectDefInIDD(IDFRecords(Num)%Name,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1:CurArgs)=InArgs(1:CurArgs) + ENDIF + + IF (DiffMinFields .and. nodiff) THEN + ! Change in min-fields + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1:CurArgs)=InArgs(1:CurArgs) + NoDiff=.false. + DO Arg=CurArgs+1,NwObjMinFlds + OutArgs(Arg)=NwFldDefaults(Arg) + ENDDO + CurArgs=MAX(NwObjMinFlds,CurArgs) + ENDIF + + IF (NoDiff .and. DiffOnly) CYCLE + + !! reformat for better readability + !! BUILDING,SOLUTION ALGORITHM,OUTSIDE CONVECTION ALGORITHM,INSIDE CONVECTION ALGORITHM,REPORT VARIABLE, + !! SURFACE:HEATTRANSFER,SURFACE:HEATTRANSFER:SUBSURFACE:SHADING:DETACHED, + !! SURFACE:SHADING:DETACHED:FIXED,SURFACE:SHADING:DETACHED:BUILDING, + !! SURFACE:SHADING:ATTACHED, + !! WINDOWGLASSSPECTRALDATA, + !! FLUIDPROPERTYTEMPERATURES, + !! FLUIDPROPERTYSATURATED,FLUIDPROPERTYSUPERHEATED,FLUIDPROPERTYCONCENTRATION + IF (.not. Written) THEN + CALL CheckSpecialObjects(DifLfn,ObjectName,CurArgs,OutArgs,NwFldNames,NwFldUnits,Written) + ENDIF + + IF (.not. Written) THEN + CALL WriteOutIDFLines(DifLfn,ObjectName,CurArgs,OutArgs,NwFldNames,NwFldUnits) + ENDIF + + ENDDO ! IDFRecords + + CALL DisplayString('Processing IDF -- Processing idf objects complete.') + IF (IDFRecords(NumIDFRecords)%CommtE /= CurComment) THEN + DO xcount=IDFRecords(NumIDFRecords)%CommtE+1,CurComment + WRITE(DifLfn,fmta) TRIM(Comments(xcount)) + if (xcount == IDFRecords(Num)%CommtE) WRITE(DifLfn,fmta) '' + ENDDO + ENDIF + + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! E N D O F P R O C E S S I N G ! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + + IF (GetNumSectionsFound('Report Variable Dictionary') > 0) THEN + ObjectName='Output:VariableDictionary' + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.false. + OutArgs(1)='Regular' + CurArgs=1 + CALL WriteOutIDFLines(DifLfn,ObjectName,CurArgs,OutArgs,NwFldNames,NwFldUnits) + ENDIF + + INQUIRE(FILE=trim(FileNamePath)//'.rvi',EXIST=FileExist) +! IF (FileExist) THEN +! CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & +! 'rvi file associated with this input is being processed. Review for accuracy.') +! write(diflfn,fmtA) ' ' +! ENDIF + CLOSE(DifLfn) + CALL ProcessRviMviFiles(FileNamePath,'rvi') + CALL ProcessRviMviFiles(FileNamePath,'mvi') + CALL CloseOut + ELSE ! not a idf or imf + CALL ProcessRviMviFiles(FileNamePath,'rvi') + CALL ProcessRviMviFiles(FileNamePath,'mvi') + ENDIF + ELSE ! Full name == Blank + EndOfFile=.true. + ENDIF + + CALL CreateNewName('Reallocate',CreatedOutputName,' ') + + ENDDO + + IF (.not. ExitBecauseBadFile) THEN + StillWorking=.false. + EXIT + ELSE + IF (.not. ArgFileBeingDone) THEN + EndOfFile=.false. + ELSE + EndOfFile=.true. + StillWorking=.false. + ENDIF + ENDIF + ENDDO + + IF (ArgFileBeingDone .and. .not. LatestVersion .and. .not. ExitBecauseBadFile) THEN + ! If this is true, then there was a "arg IDF File" on the command line and some files need to be renamed + ErrFlag=.false. + CALL copyfile(TRIM(FileNamePath)//'.'//TRIM(ArgIDFExtension),TRIM(FileNamePath)//'.'//TRIM(ArgIDFExtension)//'old',ErrFlag) + CALL copyfile(TRIM(FileNamePath)//'.'//TRIM(ArgIDFExtension)//'new',TRIM(FileNamePath)//'.'//TRIM(ArgIDFExtension),ErrFlag) + INQUIRE(File=TRIM(FileNamePath)//'.rvi',EXIST=FileExist) + IF (FileExist) THEN + CALL copyfile(TRIM(FileNamePath)//'.rvi',TRIM(FileNamePath)//'.rviold',ErrFlag) + ENDIF + INQUIRE(File=TRIM(FileNamePath)//'.rvinew',EXIST=FileExist) + IF (FileExist) THEN + CALL copyfile(TRIM(FileNamePath)//'.rvinew',TRIM(FileNamePath)//'.rvi',ErrFlag) + ENDIF + INQUIRE(File=TRIM(FileNamePath)//'.mvi',EXIST=FileExist) + IF (FileExist) THEN + CALL copyfile(TRIM(FileNamePath)//'.mvi',TRIM(FileNamePath)//'.mviold',ErrFlag) + ENDIF + INQUIRE(File=TRIM(FileNamePath)//'.mvinew',EXIST=FileExist) + IF (FileExist) THEN + CALL copyfile(TRIM(FileNamePath)//'.mvinew',TRIM(FileNamePath)//'.mvi',ErrFlag) + ENDIF + ENDIF + + RETURN + +END SUBROUTINE CreateNewIDFUsingRules From a67fef8866b67c423351400261e6899a10efcb29 Mon Sep 17 00:00:00 2001 From: lymereJ Date: Fri, 10 Oct 2025 12:17:54 -0700 Subject: [PATCH 19/30] Add correct transition file back in. --- .../CreateNewIDFUsingRulesV25_2_0.f90 | 1141 +++++++++++++++++ 1 file changed, 1141 insertions(+) create mode 100644 src/Transition/CreateNewIDFUsingRulesV25_2_0.f90 diff --git a/src/Transition/CreateNewIDFUsingRulesV25_2_0.f90 b/src/Transition/CreateNewIDFUsingRulesV25_2_0.f90 new file mode 100644 index 00000000000..3e11c9df634 --- /dev/null +++ b/src/Transition/CreateNewIDFUsingRulesV25_2_0.f90 @@ -0,0 +1,1141 @@ +MODULE SetVersion + +USE DataStringGlobals +USE DataVCompareGlobals + +PUBLIC + +CONTAINS + +SUBROUTINE SetThisVersionVariables() + ! TODO: Update this section as appropriate + VerString='Conversion 25.1 => 25.2' + VersionNum=25.2 + ! Starting with version 22.1, the version string requires 4 characters + ! The original sVersionNum variable is a 3 character length string + ! If we just change that variable to be 4 characters, it could break everything before 22.1 + ! So instead, let's just move forward with a new 4 character string and use that in this file and the future + ! If we get to version 100.1 and we are still using this Fortran transition then well....we can deal with it then + sVersionNum = '***' + sVersionNumFourChars='25.2' + IDDFileNameWithPath=TRIM(ProgramPath)//'V25-1-0-Energy+.idd' + NewIDDFileNameWithPath=TRIM(ProgramPath)//'V25-2-0-Energy+.idd' + RepVarFileNameWithPath=TRIM(ProgramPath)//'Report Variables 25-1-0 to 25-2-0.csv' +END SUBROUTINE + +END MODULE + +SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFileName,ArgFile,ArgIDFExtension) + + ! SUBROUTINE INFORMATION: + ! AUTHOR Linda Lawrie + ! DATE WRITTEN July 2002 + ! MODIFIED For each release + ! RE-ENGINEERED na + + ! PURPOSE OF THIS SUBROUTINE: + ! This subroutine creates new IDFs based on the rules specified by + ! developers. This will result in a more complete transition but + ! takes more time to create. + + ! METHODOLOGY EMPLOYED: + ! na + + ! REFERENCES: + ! na + + ! USE STATEMENTS: + USE InputProcessor + USE DataVCompareGlobals + USE VCompareGlobalRoutines + USE DataStringGlobals, ONLY: ProgNameConversion + USE General + USE DataGlobals, ONLY: ShowMessage, ShowContinueError, ShowFatalError, ShowSevereError, ShowWarningError + + IMPLICIT NONE ! Enforce explicit typing of all variables in this routine + + ! SUBROUTINE ARGUMENT DEFINITIONS: + LOGICAL, INTENT(INOUT) :: EndOfFile + LOGICAL, INTENT(IN) :: DiffOnly + INTEGER, INTENT(IN) :: InLfn + LOGICAL, INTENT(IN) :: AskForInput + CHARACTER(len=*), INTENT(IN) :: InputFileName + LOGICAL, INTENT(IN) :: ArgFile + CHARACTER(len=*), INTENT(IN) :: ArgIDFExtension + + ! SUBROUTINE PARAMETER DEFINITIONS: + CHARACTER(len=*), PARAMETER :: fmta="(A)" + + ! INTERFACE BLOCK SPECIFICATIONS + ! na + + ! DERIVED TYPE DEFINITIONS + + ! SUBROUTINE LOCAL VARIABLE DECLARATIONS: + INTEGER IoS + INTEGER DotPos + INTEGER Status + INTEGER NA + INTEGER NN + INTEGER CurArgs + INTEGER DifLfn + INTEGER xCount + INTEGER Num + INTEGER, EXTERNAL :: GetNewUnitNumber + INTEGER Arg + LOGICAL, SAVE :: FirstTime=.true. + CHARACTER(len=30) UnitsArg + CHARACTER(len=MaxNameLength) :: ObjectName + CHARACTER(len=30), EXTERNAL :: TrimTrailZeros + CHARACTER(len=MaxNameLength) :: UCRepVarName=blank + CHARACTER(len=MaxNameLength) :: UCCompRepVarName=blank + LOGICAL DelThis + INTEGER pos + INTEGER pos2 + LOGICAL ExitBecauseBadFile + LOGICAL StillWorking + LOGICAL NoDiff + LOGICAL checkrvi + LOGICAL NoVersion + LOGICAL DiffMinFields ! Set to true when diff number of min-fields between the two objects + LOGICAL Written + INTEGER :: Var + INTEGER :: CurVar + LOGICAL ArgFileBeingDone + LOGICAL LatestVersion + CHARACTER(len=10) :: LocalFileExtension=' ' + LOGICAL :: WildMatch + + LOGICAL :: ConnComp + LOGICAL :: ConnCompCtrl + LOGICAL :: FileExist + CHARACTER(len=MaxNameLength) :: CreatedOutputName + LOGICAL, ALLOCATABLE, DIMENSION(:) :: DeleteThisRecord + INTEGER :: COutArgs + CHARACTER(len=16) :: UnitsField + + LOGICAL :: ErrFlag + + INTEGER :: I, CurField, NewField, KAindex=0, SearchNum + INTEGER :: AlphaNumI + REAL :: SaveNumber + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! I N S E R T L O C A L V A R I A B L E S H E R E ! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + + ! TODO: Move to V10_0_0.f90 when available + ! For Defaulting now-required RunPeriod Name + INTEGER :: TotRunPeriods = 0 + INTEGER :: runPeriodNum = 0 + INTEGER :: iterateRunPeriod = 0 + CHARACTER(len=MaxNameLength), ALLOCATABLE, DIMENSION(:) :: CurrentRunPeriodNames + CHARACTER(len=20) :: PotentialRunPeriodName + ! END OF TODO + + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! E N D O F I N S E R T L O C A L V A R I A B L E S H E R E ! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + + If (FirstTime) THEN ! do things that might be applicable only to this new version + FirstTime=.false. + EndIf + + StillWorking=.true. + ArgFileBeingDone=.false. + LatestVersion=.false. + NoVersion=.true. + LocalFileExtension=ArgIDFExtension + EndOfFile=.false. + IOS=0 + + DO WHILE (StillWorking) + + ExitBecauseBadFile=.false. + DO WHILE (.not. EndOfFile) + IF (AskForInput) THEN + WRITE(*,*) 'Enter input file name, with path' + write(*,fmta,advance='no') '-->' + READ(*,fmta) FullFileName + ELSE + IF (.not. ArgFile) THEN + READ(InLfn,*,IOSTAT=IoS) FullFileName + ELSEIF (.not. ArgFileBeingDone) THEN + FullFileName=InputFileName + IOS=0 + ArgFileBeingDone=.true. + ELSE + FullFileName=Blank + IOS=1 + ENDIF + IF (FullFileName(1:1) == '!') THEN + FullFileName=Blank + CYCLE + ENDIF + ENDIF + UnitsArg=Blank + IF (IoS /= 0) FullFileName=Blank + FullFileName=ADJUSTL(FullFileName) + IF (FullFileName /= Blank) THEN + CALL DisplayString('Processing IDF -- '//TRIM(FullFileName)) + WRITE(Auditf,fmta) ' Processing IDF -- '//TRIM(FullFileName) + DotPos=SCAN(FullFileName,'.',.true.) ! Scan backward looking for extension, + IF (DotPos /= 0) THEN + FileNamePath=FullFileName(1:DotPos-1) + LocalFileExtension=MakeLowerCase(FullFileName(DotPos+1:)) + ELSE + FileNamePath=FullFileName + WRITE(*,*) ' assuming file extension of .idf' + WRITE(Auditf,fmta) ' ..assuming file extension of .idf' + FullFileName=TRIM(FullFileName)//'.idf' + LocalFileExtension='idf' + ENDIF + ! Process the old input + DifLfn=GetNewUnitNumber() + INQUIRE(File=TRIM(FullFileName),EXIST=FileOK) + IF (.not. FileOK) THEN + WRITE(*,*) 'File not found='//TRIM(FullFileName) + WRITE(Auditf,*) 'File not found='//TRIM(FullFileName) + EndOfFile=.true. + ExitBecauseBadFile=.true. + EXIT + ENDIF + IF (LocalFileExtension == 'idf' .or. LocalFileExtension == 'imf') THEN + checkrvi=.false. + ConnComp=.false. + ConnCompCtrl=.false. + IF (DiffOnly) THEN + OPEN(DifLfn,FILE=TRIM(FileNamePath)//'.'//TRIM(LocalFileExtension)//'dif') + ELSE + OPEN(DifLfn,FILE=TRIM(FileNamePath)//'.'//TRIM(LocalFileExtension)//'new') + ENDIF + IF (LocalFileExtension == 'imf') THEN + CALL ShowWarningError('Note: IMF file being processed. No guarantee of perfection. Please check new file carefully.',Auditf) + ProcessingIMFFile=.true. + ELSE + ProcessingIMFFile=.false. + ENDIF + CALL ProcessInput(IDDFileNameWithPath,NewIDDFileNameWithPath,FullFileName) + IF (FatalError) THEN + ExitBecauseBadFile=.true. + EXIT + ENDIF + + ! Clean up from any previous passes, then re-allocate. These are for the 'standard' stuff, not your own + ! Do not add anything here! + IF(ALLOCATED(DeleteThisRecord)) DEALLOCATE(DeleteThisRecord) + IF(ALLOCATED(Alphas)) DEALLOCATE(Alphas) + IF(ALLOCATED(Numbers)) DEALLOCATE(Numbers) + IF(ALLOCATED(InArgs)) DEALLOCATE(InArgs) + IF(ALLOCATED(TempArgs)) DEALLOCATE(TempArgs) + IF(ALLOCATED(AorN)) DEALLOCATE(AorN) + IF(ALLOCATED(ReqFld)) DEALLOCATE(ReqFld) + IF(ALLOCATED(FldNames)) DEALLOCATE(FldNames) + IF(ALLOCATED(FldDefaults)) DEALLOCATE(FldDefaults) + IF(ALLOCATED(FldUnits)) DEALLOCATE(FldUnits) + IF(ALLOCATED(NwAorN)) DEALLOCATE(NwAorN) + IF(ALLOCATED(NwReqFld)) DEALLOCATE(NwReqFld) + IF(ALLOCATED(NwFldNames)) DEALLOCATE(NwFldNames) + IF(ALLOCATED(NwFldDefaults)) DEALLOCATE(NwFldDefaults) + IF(ALLOCATED(NwFldUnits)) DEALLOCATE(NwFldUnits) + IF(ALLOCATED(OutArgs)) DEALLOCATE(OutArgs) + ALLOCATE(Alphas(MaxAlphaArgsFound),Numbers(MaxNumericArgsFound)) + ALLOCATE(InArgs(MaxTotalArgs)) + ALLOCATE(TempArgs(MaxTotalArgs)) + ALLOCATE(AorN(MaxTotalArgs),ReqFld(MaxTotalArgs),FldNames(MaxTotalArgs),FldDefaults(MaxTotalArgs),FldUnits(MaxTotalArgs)) + ALLOCATE(NwAorN(MaxTotalArgs),NwReqFld(MaxTotalArgs),NwFldNames(MaxTotalArgs),NwFldDefaults(MaxTotalArgs),NwFldUnits(MaxTotalArgs)) + ALLOCATE(OutArgs(MaxTotalArgs)) + ALLOCATE(DeleteThisRecord(NumIDFRecords)) + DeleteThisRecord=.false. + + NoVersion=.true. + DO Num=1,NumIDFRecords + IF (MakeUPPERCase(IDFRecords(Num)%Name) /= 'VERSION') CYCLE + NoVersion=.false. + EXIT + ENDDO + + DO Num=1,NumIDFRecords + IF (DeleteThisRecord(Num)) THEN + Write(DifLfn,fmta) '! Deleting: '//TRIM(IDFRecords(Num)%Name)//'="'//TRIM(IDFRecords(Num)%Alphas(1))//'".' + ENDIF + ENDDO + + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! P R E P R O C E S S I N G ! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +! Do any kind of Preprocessing that is needed here (eg: a first pass on objects to store some attributes etc) + + + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! P R O C E S S I N G ! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + CALL DisplayString('Processing IDF -- Processing idf objects . . .') + DO Num=1,NumIDFRecords + + IF (DeleteThisRecord(Num)) CYCLE + DO xcount=IDFRecords(Num)%CommtS+1,IDFRecords(Num)%CommtE + WRITE(DifLfn,fmta) TRIM(Comments(xcount)) + if (xcount == IDFRecords(Num)%CommtE) WRITE(DifLfn,fmta) '' + ENDDO + IF (NoVersion .and. Num == 1) THEN + CALL GetNewObjectDefInIDD('VERSION',NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1) = sVersionNumFourChars + CurArgs=1 + CALL ShowWarningError('No version found in file, defaulting to '//sVersionNumFourChars,Auditf) + CALL WriteOutIDFLinesAsComments(DifLfn,'Version',CurArgs,OutArgs,NwFldNames,NwFldUnits) + ENDIF + + ! deleted objects. no transition. + ! eg: IF (MakeUPPERCase(TRIM(IDFRecords(Num)%Name)) == 'PROGRAMCONTROL') CYCLE + + ObjectName=IDFRecords(Num)%Name + IF (FindItemInList(ObjectName,ObjectDef%Name,NumObjectDefs) /= 0) THEN + CALL GetObjectDefInIDD(ObjectName,NumArgs,AorN,ReqFld,ObjMinFlds,FldNames,FldDefaults,FldUnits) + NumAlphas=IDFRecords(Num)%NumAlphas + NumNumbers=IDFRecords(Num)%NumNumbers + Alphas(1:NumAlphas)=IDFRecords(Num)%Alphas(1:NumAlphas) + Numbers(1:NumNumbers)=IDFRecords(Num)%Numbers(1:NumNumbers) + CurArgs=NumAlphas+NumNumbers + InArgs=Blank + OutArgs=Blank + TempArgs=Blank + NA=0 + NN=0 + DO Arg=1,CurArgs + IF (AorN(Arg)) THEN + NA=NA+1 + InArgs(Arg)=Alphas(NA) + ELSE + NN=NN+1 + InArgs(Arg)=Numbers(NN) + ENDIF + ENDDO + ELSE + WRITE(Auditf,fmta) 'Object="'//TRIM(ObjectName)//'" does not seem to be on the "old" IDD.' + WRITE(Auditf,fmta) '... will be listed as comments (no field names) on the new output file.' + WRITE(Auditf,fmta) '... Alpha fields will be listed first, then numerics.' + NumAlphas=IDFRecords(Num)%NumAlphas + NumNumbers=IDFRecords(Num)%NumNumbers + Alphas(1:NumAlphas)=IDFRecords(Num)%Alphas(1:NumAlphas) + Numbers(1:NumNumbers)=IDFRecords(Num)%Numbers(1:NumNumbers) + DO Arg=1,NumAlphas + OutArgs(Arg)=Alphas(Arg) + ENDDO + NN=NumAlphas+1 + DO Arg=1,NumNumbers + OutArgs(NN)=Numbers(Arg) + NN=NN+1 + ENDDO + CurArgs=NumAlphas+NumNumbers + NwFldNames=Blank + NwFldUnits=Blank + CALL WriteOutIDFLinesAsComments(DifLfn,ObjectName,CurArgs,OutArgs,NwFldNames,NwFldUnits) + CYCLE + ENDIF + + Nodiff=.true. ! Nodiff is true by default + DiffMinFields=.false. + Written=.false. + + IF (FindItemInList(MakeUPPERCase(ObjectName),NotInNew,SIZE(NotInNew)) == 0) THEN + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + ! Check minfields + IF (ObjMinFlds /= NwObjMinFlds) THEN + DiffMinFields=.true. + ELSE + DiffMinFields=.false. + ENDIF + ENDIF + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IF NOT ONLY MAKING PRETTY !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + IF (.not. MakingPretty) THEN + + SELECT CASE (MakeUPPERCase(TRIM(IDFRecords(Num)%Name))) + + CASE ('VERSION') + IF ((InArgs(1)(1:4)) == sVersionNumFourChars .and. ArgFile) THEN + CALL ShowWarningError('File is already at latest version. No new diff file made.',Auditf) + CLOSE(diflfn,STATUS='DELETE') + LatestVersion=.true. + EXIT + ENDIF + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1) = sVersionNumFourChars + NoDiff=.false. + + ! changes for this version, pick one of the spots to add rules, this will reduce the possibility of merge conflicts + +! CASE('OBJECTNAMEHERE') +! CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) +! nodiff=.false. +! OutArgs(1)=InArgs(1) +! OutArgs(2) = 'SequentialLoad' +! OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) +! CurArgs = CurArgs + 1 + + ! If your original object starts with A, insert the rules here + + ! If your original object starts with C, insert the rules here + CASE('COIL:COOLING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.false. + OutArgs(1:1)=InArgs(1:1) + OutArgs(2) = '' ! new Availability Schedule Name field + OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) + CurArgs = CurArgs + 1 + + CASE('COIL:HEATING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.false. + OutArgs(1:1)=InArgs(1:1) + OutArgs(2) = '' ! new Availability Schedule Name field + OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) + CurArgs = CurArgs + 1 + + CASE('COIL:COOLING:DX:VARIABLESPEED') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.false. + OutArgs(1:1)=InArgs(1:1) + OutArgs(2) = '' ! new Availability Schedule Name field + OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) + CurArgs = CurArgs + 1 + + CASE('COIL:HEATING:DX:VARIABLESPEED') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.false. + OutArgs(1:1)=InArgs(1:1) + OutArgs(2) = '' ! new Availability Schedule Name field + OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) + CurArgs = CurArgs + 1 + + CASE('COIL:WATERHEATING:AIRTOWATERHEATPUMP:VARIABLESPEED') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.false. + OutArgs(1:1)=InArgs(1:1) + OutArgs(2) = '' ! new Availability Schedule Name field + OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) + CurArgs = CurArgs + 1 + + CASE('COIL:COOLING:WATERTOAIRHEATPUMP:EQUATIONFIT') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.false. + OutArgs(1:1)=InArgs(1:1) + OutArgs(2) = '' ! new Availability Schedule Name field + OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) + CurArgs = CurArgs + 1 + + CASE('COIL:HEATING:WATERTOAIRHEATPUMP:EQUATIONFIT') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.false. + OutArgs(1:1)=InArgs(1:1) + OutArgs(2) = '' ! new Availability Schedule Name field + OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) + CurArgs = CurArgs + 1 + + CASE('COIL:COOLING:WATERTOAIRHEATPUMP:PARAMETERESTIMATION') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.false. + OutArgs(1:1)=InArgs(1:1) + OutArgs(2) = '' ! new Availability Schedule Name field + OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) + CurArgs = CurArgs + 1 + + CASE('COIL:HEATING:WATERTOAIRHEATPUMP:PARAMETERESTIMATION') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.false. + OutArgs(1:1)=InArgs(1:1) + OutArgs(2) = '' ! new Availability Schedule Name field + OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) + CurArgs = CurArgs + 1 + + CASE('COIL:WATERHEATING:AIRTOWATERHEATPUMP:PUMPED') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.false. + OutArgs(1:1)=InArgs(1:1) + OutArgs(2) = '' ! new Availability Schedule Name field + OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) + CurArgs = CurArgs + 1 + + CASE('COIL:WATERHEATING:AIRTOWATERHEATPUMP:WRAPPED') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.false. + OutArgs(1:1)=InArgs(1:1) + OutArgs(2) = '' ! new Availability Schedule Name field + OutArgs(3:CurArgs+1)=InArgs(2:CurArgs) + CurArgs = CurArgs + 1 + + ! If your original object starts with D, insert the rules here + + ! If your original object starts with E, insert the rules here + + ! If your original object starts with F, insert the rules here + + ! If your original object starts with G, insert the rules here + + ! If your original object starts with H, insert the rules here + + ! If your original object starts with I, insert the rules here + + ! If your original object starts with L, insert the rules here + + ! If your original object starts with M, insert the rules here + + ! If your original object starts with N, insert the rules here + + ! If your original object starts with O, insert the rules here + + ! If your original object starts with P, insert the rules here + + ! If your original object starts with R, insert the rules here + + ! If your original object starts with S, insert the rules here + + ! If your original object starts with T, insert the rules here + + ! If your original object starts with U, insert the rules here + + ! If your original object starts with V, insert the rules here + + ! If your original object starts with W, insert the rules here + + ! If your original object starts with Z, insert the rules here + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! Changes for report variables, meters, tables -- update names ! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +! TODO: not sure if need to keep all of this... + + !!! Changes for report variables, meters, tables -- update names + CASE('OUTPUT:VARIABLE') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1:CurArgs)=InArgs(1:CurArgs) + nodiff=.true. + IF (OutArgs(1) == Blank) THEN + OutArgs(1)='*' + nodiff=.false. + ENDIF + + CALL ScanOutputVariablesForReplacement( & + 2, & + DelThis, & + checkrvi, & + nodiff, & + ObjectName, & + DifLfn, & + .true., & !OutVar + .false., & !MtrVar + .false., & !TimeBinVar + CurArgs, & + Written, & + .false.) + IF (DelThis) CYCLE + + CASE ('OUTPUT:METER','OUTPUT:METER:METERFILEONLY','OUTPUT:METER:CUMULATIVE','OUTPUT:METER:CUMULATIVE:METERFILEONLY') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1:CurArgs)=InArgs(1:CurArgs) + nodiff=.true. + CALL ScanOutputVariablesForReplacement( & + 1, & + DelThis, & + checkrvi, & + nodiff, & + ObjectName, & + DifLfn, & + .false., & !OutVar + .true., & !MtrVar + .false., & !TimeBinVar + CurArgs, & + Written, & + .false.) + IF (DelThis) CYCLE + + CASE('OUTPUT:TABLE:TIMEBINS') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1:CurArgs)=InArgs(1:CurArgs) + nodiff=.true. + IF (OutArgs(1) == Blank) THEN + OutArgs(1)='*' + nodiff=.false. + ENDIF + CALL ScanOutputVariablesForReplacement( & + 2, & + DelThis, & + checkrvi, & + nodiff, & + ObjectName, & + DifLfn, & + .false., & !OutVar + .false., & !MtrVar + .true., & !TimeBinVar + CurArgs, & + Written, & + .false.) + IF (DelThis) CYCLE + +!ExternalInterface:FunctionalMockupUnitImport:From:Variable, field 2 +!ExternalInterface:FunctionalMockupUnitExport:From:Variable, field 2 + CASE('EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT:FROM:VARIABLE', & + 'EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITEXPORT:FROM:VARIABLE') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1:CurArgs)=InArgs(1:CurArgs) + nodiff=.true. + IF (OutArgs(1) == Blank) THEN + OutArgs(1)='*' + nodiff=.false. + ENDIF + CALL ScanOutputVariablesForReplacement( & + 2, & + DelThis, & + checkrvi, & + nodiff, & + ObjectName, & + DifLfn, & + .false., & !OutVar + .false., & !MtrVar + .false., & !TimeBinVar + CurArgs, & + Written, & + .false.) + IF (DelThis) CYCLE + +!EnergyManagementSystem:Sensor, field 3 + CASE('ENERGYMANAGEMENTSYSTEM:SENSOR') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1:CurArgs)=InArgs(1:CurArgs) + nodiff=.true. + CALL ScanOutputVariablesForReplacement( & + 3, & + DelThis, & + checkrvi, & + nodiff, & + ObjectName, & + DifLfn, & + .false., & !OutVar + .false., & !MtrVar + .false., & !TimeBinVar + CurArgs, & + Written, & + .true.) + IF (DelThis) CYCLE + + CASE('OUTPUT:TABLE:MONTHLY') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.true. + OutArgs(1:CurArgs)=InArgs(1:CurArgs) + CurVar=3 + DO Var=3,CurArgs,2 + UCRepVarName=MakeUPPERCase(InArgs(Var)) + OutArgs(CurVar)=InArgs(Var) + OutArgs(CurVar+1)=InArgs(Var+1) + pos=INDEX(UCRepVarName,'[') + IF (pos > 0) THEN + UCRepVarName=UCRepVarName(1:pos-1) + OutArgs(CurVar)=InArgs(Var)(1:pos-1) + OutArgs(CurVar+1)=InArgs(Var+1) + ENDIF + DelThis=.false. + DO Arg=1,NumRepVarNames + UCCompRepVarName=MakeUPPERCase(OldRepVarName(Arg)) + IF (UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName)) == '*') THEN + WildMatch=.true. + UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName))=' ' + pos=INDEX(TRIM(UCRepVarname),TRIM(UCCompRepVarName)) + ELSE + WildMatch=.false. + pos=0 + if (UCRepVarName == UCCompRepVarName) pos=1 + ENDIF + IF (pos > 0 .and. pos /= 1) CYCLE + IF (pos > 0) THEN + IF (NewRepVarName(Arg) /= '') THEN + IF (.not. WildMatch) THEN + OutArgs(CurVar)=NewRepVarName(Arg) + ELSE + OutArgs(CurVar)=TRIM(NewRepVarName(Arg))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) + ENDIF + IF (NewRepVarCaution(Arg) /= Blank .and. .not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq') ) THEN + IF (.not. OTMVarCaution(Arg)) THEN ! caution message not written yet + CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & + 'Output Table Monthly (old)="'//trim(OldRepVarName(Arg))// & + '" conversion to Output Table Monthly (new)="'// & + trim(NewRepVarName(Arg))//'" has the following caution "'//trim(NewRepVarCaution(Arg))//'".') + write(diflfn,fmtA) ' ' + OTMVarCaution(Arg)=.true. + ENDIF + ENDIF + OutArgs(CurVar+1)=InArgs(Var+1) + nodiff=.false. + ELSE + DelThis=.true. + ENDIF + IF (OldRepVarName(Arg) == OldRepVarName(Arg+1)) THEN + IF (.not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq')) THEN + ! Adding a var field. + CurVar=CurVar+2 + IF (.not. WildMatch) THEN + OutArgs(CurVar)=NewRepVarName(Arg+1) + ELSE + OutArgs(CurVar)=TRIM(NewRepVarName(Arg+1))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) + ENDIF + IF (NewRepVarCaution(Arg+1) /= Blank) THEN + IF (.not. OTMVarCaution(Arg+1)) THEN ! caution message not written yet + CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & + 'Output Table Monthly (old)="'//trim(OldRepVarName(Arg))// & + '" conversion to Output Table Monthly (new)="'// & + trim(NewRepVarName(Arg+1))//'" has the following caution "'//trim(NewRepVarCaution(Arg+1))//'".') + write(diflfn,fmtA) ' ' + OTMVarCaution(Arg+1)=.true. + ENDIF + ENDIF + OutArgs(CurVar+1)=InArgs(Var+1) + nodiff=.false. + ENDIF + ENDIF + IF (OldRepVarName(Arg) == OldRepVarName(Arg+2)) THEN ! only 1 more... for ForkEq + ! Adding a var field. + CurVar=CurVar+2 + IF (.not. WildMatch) THEN + OutArgs(CurVar)=NewRepVarName(Arg+2) + ELSE + OutArgs(CurVar)=TRIM(NewRepVarName(Arg+2))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) + ENDIF + IF (NewRepVarCaution(Arg+2) /= Blank) THEN + IF (.not. OTMVarCaution(Arg+2)) THEN ! caution message not written yet + CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & + 'Output Table Monthly (old)="'//trim(OldRepVarName(Arg))// & + '" conversion to Output Table Monthly (new)="'// & + trim(NewRepVarName(Arg+2))//'" has the following caution "'//trim(NewRepVarCaution(Arg+2))//'".') + write(diflfn,fmtA) ' ' + OTMVarCaution(Arg+2)=.true. + ENDIF + ENDIF + OutArgs(CurVar+1)=InArgs(Var+1) + nodiff=.false. + ENDIF + EXIT + ENDIF + ENDDO + IF (.not. DelThis) CurVar=CurVar+2 + ENDDO + CurArgs=CurVar-1 + + CASE('METER:CUSTOM') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1:CurArgs)=InArgs(1:CurArgs) + nodiff=.true. + CurVar=4 + DO Var=4,CurArgs,2 + UCRepVarName=MakeUPPERCase(InArgs(Var)) + OutArgs(CurVar)=InArgs(Var) + OutArgs(CurVar+1)=InArgs(Var+1) + pos=INDEX(UCRepVarName,'[') + IF (pos > 0) THEN + UCRepVarName=UCRepVarName(1:pos-1) + OutArgs(CurVar)=InArgs(Var)(1:pos-1) + OutArgs(CurVar+1)=InArgs(Var+1) + ENDIF + DelThis=.false. + DO Arg=1,NumRepVarNames + UCCompRepVarName=MakeUPPERCase(OldRepVarName(Arg)) + IF (UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName)) == '*') THEN + WildMatch=.true. + UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName))=' ' + pos=INDEX(TRIM(UCRepVarname),TRIM(UCCompRepVarName)) + ELSE + WildMatch=.false. + pos=0 + if (UCRepVarName == UCCompRepVarName) pos=1 + ENDIF + IF (pos > 0 .and. pos /= 1) CYCLE + IF (pos > 0) THEN + IF (NewRepVarName(Arg) /= '') THEN + IF (.not. WildMatch) THEN + OutArgs(CurVar)=NewRepVarName(Arg) + ELSE + OutArgs(CurVar)=TRIM(NewRepVarName(Arg))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) + ENDIF + IF (NewRepVarCaution(Arg) /= Blank .and. .not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq') ) THEN + IF (.not. CMtrVarCaution(Arg)) THEN ! caution message not written yet + CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & + 'Custom Meter (old)="'//trim(OldRepVarName(Arg))// & + '" conversion to Custom Meter (new)="'// & + trim(NewRepVarName(Arg))//'" has the following caution "'//trim(NewRepVarCaution(Arg))//'".') + write(diflfn,fmtA) ' ' + CMtrVarCaution(Arg)=.true. + ENDIF + ENDIF + OutArgs(CurVar+1)=InArgs(Var+1) + nodiff=.false. + ELSE + DelThis=.true. + ENDIF + IF (OldRepVarName(Arg) == OldRepVarName(Arg+1)) THEN + IF (.not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq')) THEN + ! Adding a var field. + CurVar=CurVar+2 + IF (.not. WildMatch) THEN + OutArgs(CurVar)=NewRepVarName(Arg+1) + ELSE + OutArgs(CurVar)=TRIM(NewRepVarName(Arg+1))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) + ENDIF + IF (NewRepVarCaution(Arg+1) /= Blank .and. .not. SameString(NewRepVarCaution(Arg+1)(1:6),'Forkeq') ) THEN + IF (.not. CMtrVarCaution(Arg+1)) THEN ! caution message not written yet + CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & + 'Custom Meter (old)="'//trim(OldRepVarName(Arg))// & + '" conversion to Custom Meter (new)="'// & + trim(NewRepVarName(Arg+1))//'" has the following caution "'//trim(NewRepVarCaution(Arg+1))//'".') + write(diflfn,fmtA) ' ' + CMtrVarCaution(Arg+1)=.true. + ENDIF + ENDIF + OutArgs(CurVar+1)=InArgs(Var+1) + nodiff=.false. + ENDIF + ENDIF + IF (OldRepVarName(Arg) == OldRepVarName(Arg+2)) THEN + ! Adding a var field. + CurVar=CurVar+2 + IF (.not. WildMatch) THEN + OutArgs(CurVar)=NewRepVarName(Arg+2) + ELSE + OutArgs(CurVar)=TRIM(NewRepVarName(Arg+2))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) + ENDIF + IF (NewRepVarCaution(Arg+2) /= Blank) THEN + IF (.not. CMtrVarCaution(Arg+2)) THEN ! caution message not written yet + CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & + 'Custom Meter (old)="'//trim(OldRepVarName(Arg))// & + '" conversion to Custom Meter (new)="'// & + trim(NewRepVarName(Arg+2))//'" has the following caution "'//trim(NewRepVarCaution(Arg+2))//'".') + write(diflfn,fmtA) ' ' + CMtrVarCaution(Arg+2)=.true. + ENDIF + ENDIF + OutArgs(CurVar+1)=InArgs(Var+1) + nodiff=.false. + ENDIF + EXIT + ENDIF + ENDDO + IF (.not. DelThis) CurVar=CurVar+2 + ENDDO + CurArgs=CurVar + DO Arg=CurVar,1,-1 + IF (OutArgs(Arg) == Blank) THEN + CurArgs=CurArgs-1 + ELSE + EXIT + ENDIF + ENDDO + + CASE('METER:CUSTOMDECREMENT') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1:CurArgs)=InArgs(1:CurArgs) + nodiff=.true. + CurVar=4 ! In case Source Meter would change + DO Var=4,CurArgs,2 + UCRepVarName=MakeUPPERCase(InArgs(Var)) + OutArgs(CurVar)=InArgs(Var) + OutArgs(CurVar+1)=InArgs(Var+1) + pos=INDEX(UCRepVarName,'[') + IF (pos > 0) THEN + UCRepVarName=UCRepVarName(1:pos-1) + OutArgs(CurVar)=InArgs(Var)(1:pos-1) + OutArgs(CurVar+1)=InArgs(Var+1) + ENDIF + DelThis=.false. + DO Arg=1,NumRepVarNames + UCCompRepVarName=MakeUPPERCase(OldRepVarName(Arg)) + IF (UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName)) == '*') THEN + WildMatch=.true. + UCCompRepVarName(Len_Trim(UCCompRepVarName):Len_Trim(UCCompRepVarName))=' ' + pos=INDEX(TRIM(UCRepVarname),TRIM(UCCompRepVarName)) + ELSE + WildMatch=.false. + pos=0 + if (UCRepVarName == UCCompRepVarName) pos=1 + ENDIF + IF (pos > 0 .and. pos /= 1) CYCLE + IF (pos > 0) THEN + IF (NewRepVarName(Arg) /= '') THEN + IF (.not. WildMatch) THEN + OutArgs(CurVar)=NewRepVarName(Arg) + ELSE + OutArgs(CurVar)=TRIM(NewRepVarName(Arg))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) + ENDIF + IF (NewRepVarCaution(Arg) /= Blank .and. .not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq') ) THEN + IF (.not. CMtrDVarCaution(Arg)) THEN ! caution message not written yet + CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & + 'Custom Decrement Meter (old)="'//trim(OldRepVarName(Arg))// & + '" conversion to Custom Meter (new)="'// & + trim(NewRepVarName(Arg))//'" has the following caution "'//trim(NewRepVarCaution(Arg))//'".') + write(diflfn,fmtA) ' ' + CMtrDVarCaution(Arg)=.true. + ENDIF + ENDIF + OutArgs(CurVar+1)=InArgs(Var+1) + nodiff=.false. + ELSE + DelThis=.true. + ENDIF + IF (OldRepVarName(Arg) == OldRepVarName(Arg+1)) THEN + IF (.not. SameString(NewRepVarCaution(Arg)(1:6),'Forkeq')) THEN + ! Adding a var field. + CurVar=CurVar+2 + IF (.not. WildMatch) THEN + OutArgs(CurVar)=NewRepVarName(Arg+1) + ELSE + OutArgs(CurVar)=TRIM(NewRepVarName(Arg+1))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) + ENDIF + IF (NewRepVarCaution(Arg+1) /= Blank .and. .not. SameString(NewRepVarCaution(Arg+1)(1:6),'Forkeq') ) THEN + IF (.not. CMtrDVarCaution(Arg+1)) THEN ! caution message not written yet + CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & + 'Custom Decrement Meter (old)="'//trim(OldRepVarName(Arg))// & + '" conversion to Custom Decrement Meter (new)="'// & + trim(NewRepVarName(Arg+1))//'" has the following caution "'//trim(NewRepVarCaution(Arg+1))//'".') + write(diflfn,fmtA) ' ' + CMtrDVarCaution(Arg+1)=.true. + ENDIF + ENDIF + OutArgs(CurVar+1)=InArgs(Var+1) + nodiff=.false. + ENDIF + ENDIF + IF (OldRepVarName(Arg) == OldRepVarName(Arg+2)) THEN + ! Adding a var field. + CurVar=CurVar+2 + IF (.not. WildMatch) THEN + OutArgs(CurVar)=NewRepVarName(Arg+2) + ELSE + OutArgs(CurVar)=TRIM(NewRepVarName(Arg+2))//OutArgs(CurVar)(Len_Trim(UCCompRepVarName)+1:) + ENDIF + IF (NewRepVarCaution(Arg+2) /= Blank) THEN + IF (.not. CMtrDVarCaution(Arg+2)) THEN ! caution message not written yet + CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & + 'Custom Decrement Meter (old)="'//trim(OldRepVarName(Arg))// & + '" conversion to Custom Meter (new)="'// & + trim(NewRepVarName(Arg+2))//'" has the following caution "'//trim(NewRepVarCaution(Arg+2))//'".') + write(diflfn,fmtA) ' ' + CMtrDVarCaution(Arg+2)=.true. + ENDIF + ENDIF + OutArgs(CurVar+1)=InArgs(Var+1) + nodiff=.false. + ENDIF + EXIT + ENDIF + ENDDO + IF (.not. DelThis) CurVar=CurVar+2 + ENDDO + CurArgs=CurVar + DO Arg=CurVar,1,-1 + IF (OutArgs(Arg) == Blank) THEN + CurArgs=CurArgs-1 + ELSE + EXIT + ENDIF + ENDDO + + !!! Changes for other objects that reference meter names -- update names + CASE('DEMANDMANAGERASSIGNMENTLIST', & + 'UTILITYCOST:TARIFF') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1:CurArgs)=InArgs(1:CurArgs) + nodiff=.true. + + CALL ScanOutputVariablesForReplacement( & + 2, & + DelThis, & + checkrvi, & + nodiff, & + ObjectName, & + DifLfn, & + .false., & !OutVar + .true., & !MtrVar + .false., & !TimeBinVar + CurArgs, & + Written, & + .false.) + + CASE('ELECTRICLOADCENTER:DISTRIBUTION') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1:CurArgs)=InArgs(1:CurArgs) + nodiff=.true. + + ! Field 6 A5, \field Generator Track Meter Scheme Meter Name + CALL ScanOutputVariablesForReplacement( & + 6, & + DelThis, & + checkrvi, & + nodiff, & + ObjectName, & + DifLfn, & + .false., & !OutVar + .true., & !MtrVar + .false., & !TimeBinVar + CurArgs, & + Written, & + .false.) + + ! Field 12 A11, \field Storage Control Track Meter Name + CALL ScanOutputVariablesForReplacement( & + 12, & + DelThis, & + checkrvi, & + nodiff, & + ObjectName, & + DifLfn, & + .false., & !OutVar + .true., & !MtrVar + .false., & !TimeBinVar + CurArgs, & + Written, & + .false.) + + ! ANY OTHER OBJECT + CASE DEFAULT + IF (FindItemInList(ObjectName,NotInNew,SIZE(NotInNew)) /= 0) THEN + WRITE(Auditf,fmta) 'Object="'//TRIM(ObjectName)//'" is not in the "new" IDD.' + WRITE(Auditf,fmta) '... will be listed as comments on the new output file.' + CALL WriteOutIDFLinesAsComments(DifLfn,ObjectName,CurArgs,InArgs,FldNames,FldUnits) + Written=.true. + !CYCLE + ELSE + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1:CurArgs)=InArgs(1:CurArgs) + NoDiff=.true. + ENDIF + + END SELECT + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IF ONLY MAKING PRETTY !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ELSE !!! Making Pretty + + ! Just making pretty -- no changes as above. + CALL GetNewObjectDefInIDD(IDFRecords(Num)%Name,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1:CurArgs)=InArgs(1:CurArgs) + ENDIF + + IF (DiffMinFields .and. nodiff) THEN + ! Change in min-fields + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + OutArgs(1:CurArgs)=InArgs(1:CurArgs) + NoDiff=.false. + DO Arg=CurArgs+1,NwObjMinFlds + OutArgs(Arg)=NwFldDefaults(Arg) + ENDDO + CurArgs=MAX(NwObjMinFlds,CurArgs) + ENDIF + + IF (NoDiff .and. DiffOnly) CYCLE + + !! reformat for better readability + !! BUILDING,SOLUTION ALGORITHM,OUTSIDE CONVECTION ALGORITHM,INSIDE CONVECTION ALGORITHM,REPORT VARIABLE, + !! SURFACE:HEATTRANSFER,SURFACE:HEATTRANSFER:SUBSURFACE:SHADING:DETACHED, + !! SURFACE:SHADING:DETACHED:FIXED,SURFACE:SHADING:DETACHED:BUILDING, + !! SURFACE:SHADING:ATTACHED, + !! WINDOWGLASSSPECTRALDATA, + !! FLUIDPROPERTYTEMPERATURES, + !! FLUIDPROPERTYSATURATED,FLUIDPROPERTYSUPERHEATED,FLUIDPROPERTYCONCENTRATION + IF (.not. Written) THEN + CALL CheckSpecialObjects(DifLfn,ObjectName,CurArgs,OutArgs,NwFldNames,NwFldUnits,Written) + ENDIF + + IF (.not. Written) THEN + CALL WriteOutIDFLines(DifLfn,ObjectName,CurArgs,OutArgs,NwFldNames,NwFldUnits) + ENDIF + + ENDDO ! IDFRecords + + CALL DisplayString('Processing IDF -- Processing idf objects complete.') + IF (IDFRecords(NumIDFRecords)%CommtE /= CurComment) THEN + DO xcount=IDFRecords(NumIDFRecords)%CommtE+1,CurComment + WRITE(DifLfn,fmta) TRIM(Comments(xcount)) + if (xcount == IDFRecords(Num)%CommtE) WRITE(DifLfn,fmta) '' + ENDDO + ENDIF + + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! E N D O F P R O C E S S I N G ! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + + IF (GetNumSectionsFound('Report Variable Dictionary') > 0) THEN + ObjectName='Output:VariableDictionary' + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.false. + OutArgs(1)='Regular' + CurArgs=1 + CALL WriteOutIDFLines(DifLfn,ObjectName,CurArgs,OutArgs,NwFldNames,NwFldUnits) + ENDIF + + INQUIRE(FILE=trim(FileNamePath)//'.rvi',EXIST=FileExist) +! IF (FileExist) THEN +! CALL writePreprocessorObject(DifLfn,PrognameConversion,'Warning', & +! 'rvi file associated with this input is being processed. Review for accuracy.') +! write(diflfn,fmtA) ' ' +! ENDIF + CLOSE(DifLfn) + CALL ProcessRviMviFiles(FileNamePath,'rvi') + CALL ProcessRviMviFiles(FileNamePath,'mvi') + CALL CloseOut + ELSE ! not a idf or imf + CALL ProcessRviMviFiles(FileNamePath,'rvi') + CALL ProcessRviMviFiles(FileNamePath,'mvi') + ENDIF + ELSE ! Full name == Blank + EndOfFile=.true. + ENDIF + + CALL CreateNewName('Reallocate',CreatedOutputName,' ') + + ENDDO + + IF (.not. ExitBecauseBadFile) THEN + StillWorking=.false. + EXIT + ELSE + IF (.not. ArgFileBeingDone) THEN + EndOfFile=.false. + ELSE + EndOfFile=.true. + StillWorking=.false. + ENDIF + ENDIF + ENDDO + + IF (ArgFileBeingDone .and. .not. LatestVersion .and. .not. ExitBecauseBadFile) THEN + ! If this is true, then there was a "arg IDF File" on the command line and some files need to be renamed + ErrFlag=.false. + CALL copyfile(TRIM(FileNamePath)//'.'//TRIM(ArgIDFExtension),TRIM(FileNamePath)//'.'//TRIM(ArgIDFExtension)//'old',ErrFlag) + CALL copyfile(TRIM(FileNamePath)//'.'//TRIM(ArgIDFExtension)//'new',TRIM(FileNamePath)//'.'//TRIM(ArgIDFExtension),ErrFlag) + INQUIRE(File=TRIM(FileNamePath)//'.rvi',EXIST=FileExist) + IF (FileExist) THEN + CALL copyfile(TRIM(FileNamePath)//'.rvi',TRIM(FileNamePath)//'.rviold',ErrFlag) + ENDIF + INQUIRE(File=TRIM(FileNamePath)//'.rvinew',EXIST=FileExist) + IF (FileExist) THEN + CALL copyfile(TRIM(FileNamePath)//'.rvinew',TRIM(FileNamePath)//'.rvi',ErrFlag) + ENDIF + INQUIRE(File=TRIM(FileNamePath)//'.mvi',EXIST=FileExist) + IF (FileExist) THEN + CALL copyfile(TRIM(FileNamePath)//'.mvi',TRIM(FileNamePath)//'.mviold',ErrFlag) + ENDIF + INQUIRE(File=TRIM(FileNamePath)//'.mvinew',EXIST=FileExist) + IF (FileExist) THEN + CALL copyfile(TRIM(FileNamePath)//'.mvinew',TRIM(FileNamePath)//'.mvi',ErrFlag) + ENDIF + ENDIF + + RETURN + +END SUBROUTINE CreateNewIDFUsingRules From 5d1d344491a4913219e25860a98b56a42a011fa2 Mon Sep 17 00:00:00 2001 From: lymereJ Date: Fri, 10 Oct 2025 14:49:46 -0700 Subject: [PATCH 20/30] Update design document and docs. --- design/FY2025/parallel_piu_damper_leakage.md | 64 +++++++++++++------ ...ne-equipment-and-zone-forced-air-units.tex | 29 +++++++++ 2 files changed, 72 insertions(+), 21 deletions(-) diff --git a/design/FY2025/parallel_piu_damper_leakage.md b/design/FY2025/parallel_piu_damper_leakage.md index 8d853e5098a..66b29dc11f0 100644 --- a/design/FY2025/parallel_piu_damper_leakage.md +++ b/design/FY2025/parallel_piu_damper_leakage.md @@ -4,7 +4,7 @@ Air Leakage in Parallel Fan-Powered Terminal Units **Jeremy Lerond, Pacific Northwest National Laboratory** - Original Date: 04/07/2025 - - Revision Date: 04/07/2025 + - Revision Date: 10/10/2025 ## Justification for New Feature ## @@ -19,19 +19,20 @@ N/A ## Overview ## -With a new input users will be able to simulate the impact of parallel PIU backdraft damper leakage. The simplified modeling approach will consider the two main impacts of air leakage through backdraft dampers: increase in primary air flow rate and sensible heat loss to the plenum. +With a new input, users will be able to simulate the impact of parallel PIU backdraft damper leakage. This approach will consider the two main impacts of air leakage through backdraft dampers: increased primary air flow rate and heat/mass transfer to the zone where the air leaks. ## Approach ## Assumptions: - Leakage only occurs when the terminal fan is off -- The damper leakage fracation is expressed as follows: `f_leak = m_dot_leakage / m_dot_primary` +- Leaked air is determined from the leakage fraction +- The damper leakage fraction is expressed as follows: `f_leak = m_dot_leakage / m_dot_primary` - To meet zone loads, leakage results in an increase in primary air flow rate -- Leakage induces a sensible heat loss of primary air to the plenum or secondary thermal zone from which air is drew from when the fan is running +- Leakage induces heat/mass transfer of primary air to the plenum or secondary thermal zone from which air is drew from when the fan is running ## Testing/Validation/Data Sources ## -- Simulation using /sample files will be run and results will be compared against (Sardoueinasab et al., 2018) +- Simulation using sample files will be run and results will be compared against (Sardoueinasab et al., 2018) - Unit tests will be added to verify that EnergyPlus takes leakage into account when requested by a user ## Input Output Reference Documentation ## @@ -59,10 +60,9 @@ The following inputs will be added at the end of `AirTerminal:SingleDuct:Paralle ## Outputs Description ## -Two new outputs will be added: +A new output will be added: ``` Output:Variable,*,Zone Air Terminal Backdraft Damper Leakage Mass Flow Rate,hourly; !- HVAC Average [kg/s] -Output:Variable,*,Zone Air Terminal Backdraft Damper Heat Loss,hourly; !- HVAC Sum [J] ``` ## Engineering Reference ## @@ -74,29 +74,55 @@ A new section will be added under the "Zone Equipment and Zone Forced Air Units" As described in (O'Neal et al., 2016) and (Sardoueinasab et al., 2018), backdraft damper leakage in parallel fan-powered terminal units can be characterized using a leakage fraction at a constant static pressure setpoint: \begin{equation} -{f_{leakage}} = {\dot m_{leakage}} - {\dot m_{primary}} +{f_{leakage}} = \frac{\dot m_{leakage}}{\dot m_{primary}} \end{equation} Leakage is only simulated when the terminal fan is off. The impact of the simulated leakage is twofold: \begin{enumerate} - \item To make up for the leaked air, the primary air flow rate should be increased to meet the zone load - \item The leaked air impact is accounted for by adding a sensible load to the plenum or the secondary thermal zone from which the terminal draws air from when its fan is running + \item To make up for the leaked air, the primary air flow rate should be increased to meet the zone load + \item The air escaping from the terminal is affecting the plenum/the secondary thermal zone heat balance associated with the terminal \end{enumerate} -The new primary flow rate is calculated as follows: +The new primary flow rate is adjusted as follows: \begin{equation} -{\dot m_{primary, new}} = (1 + {f_{leakage}}) \times {\dot m_{primary}} +{\dot m_{primary, adj}} = {\dot m_{primary}} \times \frac{1}{1 - {f_{leakage}}} \end{equation} -The convective load is calculated as follows: +The new primary flow rate won't exceed the maximum primary flow rate of the terminal. + +Since leakage only occurs during dead-and and cooling operation (i.e., not during heating operation), the new primary air flow rate doesn't have an impact on the terminal mixer and heater. Leaks are accounted for after the terminal has been simulated, outlet nodes are updated then. The last step is to account for the thermal impact of the leakage on the plenum/secondary thermal zone. This is handled in a similar fashion as leakage simulation using the Simplified Duct Leakage Model, see \ref{implementation-000}. + +\subsubsection{References}\label{references_parallel_piu_leakage} +D.L. O'Neal, J.L. Edmondson, Characterizing air leakage in parallel fan-powered terminal units, ASHRAE Trans., 122 (1) (2016), pp. 343-353 + +Zahra Sardoueinasab, Peng Yin, Dennis O'Neal, Energy modeling and analysis of inherent air leakage from parallel fan-powered terminal units using EMS in EnergyPlus, (2018), Energy and Buildings, https://doi.org/10.1016/j.enbuild.2018.07.019\subsection{Air Leakage in Parallel Fan-Powered Terminal Units}\label{parallel_piu_leakage} + +As described in O'Neal et al. (2016) and Sardoueinasab et al. (2018), backdraft damper leakage in parallel fan-powered terminal units can be characterized using a leakage fraction at a constant static pressure setpoint: + +\begin{equation} + f_{\text{leakage}} = \frac{\dot{m}_{\text{leakage}}}{\dot{m}_{\text{primary}}} +\end{equation} + +Leakage is only simulated when the terminal fan is off. The impact of the simulated leakage is twofold: +\begin{enumerate} + \item To make up for the leaked air, the primary air flow rate should be increased to meet the zone load. + \item The air escaping from the terminal affects the plenum or the secondary thermal zone heat balance associated with the terminal. +\end{enumerate} + +The new primary flow rate is adjusted as follows: \begin{equation} -Q_{plenum} = {\dot m_{leakage}} \times C_p \times (T_{plenum} - T_{supply}) + \dot{m}_{\text{primary, adj}} = \dot{m}_{\text{primary}} \times \frac{1}{1 - f_{\text{leakage}}} \end{equation} +The new primary flow rate will not exceed the maximum primary flow rate of the terminal. + +Since leakage only occurs during dead-band and cooling operation (i.e., not during heating operation), the new primary air flow rate does not affect the terminal mixer and heater. Leaks are accounted for after the terminal simulation, and outlet nodes are updated at that point. The final step is to account for the thermal impact of the leakage on the plenum or the secondary thermal zone. This is handled in a similar fashion to leakage simulation using the Simplified Duct Leakage Model (see Section~\ref{implementation-000}). + \subsubsection{References}\label{references_parallel_piu_leakage} -D.L. O'Neal, J.L. Edmondson, Characterizing air leakage in parallel fan-powered terminal units, ASHRAE Trans., 122 (1) (2016), pp. 343-353 +D.L. O'Neal, J.L. Edmondson, "Characterizing air leakage in parallel fan-powered terminal units," ASHRAE Transactions, vol. 122, no. 1, 2016, pp. 343-353. + +Zahra Sardoueinasab, Peng Yin, Dennis O'Neal, "Energy modeling and analysis of inherent air leakage from parallel fan-powered terminal units using EMS in EnergyPlus," Energy and Buildings, vol. 174, 2018, pp. 413-426. https://doi.org/10.1016/j.enbuild.2018.07.019 -Zahra Sardoueinasab, Peng Yin, Dennis O'Neal, Energy modeling and analysis of inherent air leakage from parallel fan-powered terminal units using EMS in EnergyPlus, (2018), Energy and Buildings, https://doi.org/10.1016/j.enbuild.2018.07.019 ``` ## Example File and Transition Changes ## @@ -175,8 +201,4 @@ Curve:Linear, ## References ## - Energy modeling and analysis of inherent air leakage from parallel fan-powered terminal units using EMS in EnergyPlus, Zahra Sardoueinasab, Peng Yin, Dennis O'Neal, (2018), Energy and Buildings, https://doi.org/10.1016/j.enbuild.2018.07.019 -- Characterizing air leakage in parallel fan-powered terminal units, D.L. O'Neal, J.L. Edmondson, ASHRAE Trans., 122 (1) (2016), pp. 343-353 - -## Implemention Notes ## - -The leakage flow rate and losses calculation will be performed in a new function named `CalcBackdraftDamperLeakage` which will be called by `CalcParallelPIU` when the terminal is active, but the fan is off. The losses will be integrated into the heat balance through `SetupZoneInternalGain`. \ No newline at end of file +- Characterizing air leakage in parallel fan-powered terminal units, D.L. O'Neal, J.L. Edmondson, ASHRAE Trans., 122 (1) (2016), pp. 343-353 \ No newline at end of file diff --git a/doc/engineering-reference/src/simulation-models-encyclopedic-reference-005/zone-equipment-and-zone-forced-air-units.tex b/doc/engineering-reference/src/simulation-models-encyclopedic-reference-005/zone-equipment-and-zone-forced-air-units.tex index 5c6a1ac8b9d..d99a20bc285 100644 --- a/doc/engineering-reference/src/simulation-models-encyclopedic-reference-005/zone-equipment-and-zone-forced-air-units.tex +++ b/doc/engineering-reference/src/simulation-models-encyclopedic-reference-005/zone-equipment-and-zone-forced-air-units.tex @@ -223,6 +223,35 @@ \subsubsection{References}\label{references-3-005} Wray, C.P., R.C. Diamond, and M.H. Sherman. 2005. ``Rationale for Measuring Duct Leakage Flows in Large Commercial Buildings''. Proceedings -- 26th AIVC Conference, Brussels, Belgium, September. LBNL-58252. +\subsection{Air Leakage in Parallel Fan-Powered Terminal Units}\label{parallel_piu_leakage} + +As described in O'Neal et al. (2016) and Sardoueinasab et al. (2018), backdraft damper leakage in parallel fan-powered terminal units can be characterized using a leakage fraction at a constant static pressure setpoint: + +\begin{equation} + f_{\text{leakage}} = \frac{\dot{m}_{\text{leakage}}}{\dot{m}_{\text{primary}}} +\end{equation} + +Leakage is only simulated when the terminal fan is off. The impact of the simulated leakage is twofold: +\begin{enumerate} + \item To make up for the leaked air, the primary air flow rate should be increased to meet the zone load. + \item The air escaping from the terminal affects the plenum or the secondary thermal zone heat balance associated with the terminal. +\end{enumerate} + +The new primary flow rate is adjusted as follows: +\begin{equation} + \dot{m}_{\text{primary, adj}} = \dot{m}_{\text{primary}} \times \frac{1}{1 - f_{\text{leakage}}} +\end{equation} + +The new primary flow rate will not exceed the maximum primary flow rate of the terminal. + +Since leakage only occurs during dead-band and cooling operation (i.e., not during heating operation), the new primary air flow rate does not affect the terminal mixer and heater. Leaks are accounted for after the terminal simulation, and outlet nodes are updated at that point. The final step is to account for the thermal impact of the leakage on the plenum or the secondary thermal zone. This is handled in a similar fashion to leakage simulation using the Simplified Duct Leakage Model (see Section~\ref{implementation-000}). + +\subsubsection{References}\label{references_parallel_piu_leakage} +D.L. O'Neal, J.L. Edmondson, "Characterizing air leakage in parallel fan-powered terminal units," ASHRAE Transactions, vol. 122, no. 1, 2016, pp. 343-353. + +Zahra Sardoueinasab, Peng Yin, Dennis O'Neal, "Energy modeling and analysis of inherent air leakage from parallel fan-powered terminal units using EMS in EnergyPlus," Energy and Buildings, vol. 174, 2018, pp. 413-426. https://doi.org/10.1016/j.enbuild.2018.07.019 + + \subsection{Fan Coil Unit}\label{fan-coil-unit} \subsubsection{Overview}\label{overview-4-003} From 8c7f53c79fb93c9e7146a129372d0077ddae2901 Mon Sep 17 00:00:00 2001 From: lymereJ Date: Fri, 10 Oct 2025 15:31:42 -0700 Subject: [PATCH 21/30] Add new example file. --- testfiles/5ZoneWarmestParallelPIULeak.idf | 3767 +++++++++++++++++++++ testfiles/CMakeLists.txt | 1 + 2 files changed, 3768 insertions(+) create mode 100644 testfiles/5ZoneWarmestParallelPIULeak.idf diff --git a/testfiles/5ZoneWarmestParallelPIULeak.idf b/testfiles/5ZoneWarmestParallelPIULeak.idf new file mode 100644 index 00000000000..786e3ac3ba4 --- /dev/null +++ b/testfiles/5ZoneWarmestParallelPIULeak.idf @@ -0,0 +1,3767 @@ +! 5ZoneWarmestParallelPIULeak.idf +! Basic file description: 1 story building divided into 4 exterior and one interior conditioned zones and return plenum. +! +! Highlights: Illustrates the use of a "warmest" supply air temperature reset strategy. +! Also illustrates use of alternate input for window glass and gas mixture for windows. +! Also illustrates use of the Simple Duct Leakage mode (see ZoneHVAC:AirDistributionUnit objects). +! Also illustrates the use of the "Coil Performance Input Method" for hot water coils. +! Also illustrates the use of "smart defaulting" for VAV terminal unit min cooling flow fraction +! and max reheat flow fraction. +! Also illustrates the use of brackdraft damper leakage fraction curve for parallel PIU terminals. +! +! Simulation Location/Run: CHICAGO_IL_USA TMY2-94846, 2 design days, 2 run periods, +! Run Control executes the run periods using the weather file +! +! Location: Chicago, IL +! +! Design Days: CHICAGO_IL_USA Annual Heating 99% Design Conditions DB, MaxDB= -17.3°C +! CHICAGO_IL_USA Annual Cooling 1% Design Conditions, MaxDB= 31.5°C MCWB= 23.0°C +! +! Run Period (Weather File): Winter 1/14, Summer 7/7, CHICAGO_IL_USA TMY2-94846 +! +! Run Control: Zone and System sizing with weather file run control (no design days run) +! +! Building: Single floor rectangular building 100 ft x 50 ft. 5 zones - 4 exterior, 1 interior, zone height 8 feet. +! Exterior zone depth is 12 feet. There is a 2 foot high return plenum: the overall building height is +! 10 feet. There are windows on all 4 facades; the south and north facades have glass doors. +! The south facing glass is shaded by overhangs. The walls are woodshingle over plywood, R11 insulation, +! and gypboard. The roof is a gravel built up roof with R-3 mineral board insulation and plywood sheathing. +! The windows are of various single and double pane construction with 3mm and 6mm glass and either 6mm or +! 13mm argon or air gap. The window to wall ratio is approximately 0.29. +! The south wall and door have overhangs. +! +! The building is oriented 30 degrees east of north. +! +! Floor Area: 463.6 m2 (5000 ft2) +! Number of Stories: 1 +! +! Zone Description Details: +! +! (0,15.2,0) (30.5,15.2,0) +! _____ ________ ____ +! |\ *** **************** /| +! | \ / | +! | \ (26.8,11.6,0) / | +! * \_____________________________/ * +! * |(3.7,11.6,0) | * +! * | | * +! * | | * +! * | (26.8,3.7,0)| * +! * |___________________________| * +! * / (3.7,3.7,0) \ * +! | / \ | +! | / \ | +! |/___******************___***________\| +! | Overhang | | +! |_______________________| | window/door = * +! |___| +! +! (0,0,0) (30.5,0,0) +! +! Internal gains description: lighting is 1.5 watts/ft2, office equip is 1.0 watts/ft2. There is 1 occupant +! per 100 ft2 of floor area. The infiltration is 0.25 air changes per hour. +! +! Interzone Surfaces: 6 interzone surfaces (see diagram) +! Internal Mass: None +! People: 50 +! Lights: 7500 W +! Windows: 4 ea.: 1) Double pane clear, 3mm glass, 13mm air gap +! 2) Double pane clear, 3mm glass, 13mm argon gap +! 3) Double pane clear, 6mm glass, 6mm air gap +! 4) Double pane lowE, 6mm lowE glass outside, 6mm air gap, 6mm clear glass +! +! Doors: 2 ea.: Single pane grey, 3mm glass +! +! Detached Shading: None +! Daylight: None +! Natural Ventilation: None +! Compact Schedules: Yes +! +! HVAC: Standard VAV system with outside air economizer, hot water reheat coils, +! central chilled water cooling coil. Central Plant is single hot water +! boiler, electric compression chiller with water cooled condenser, and +! a cooling tower. All equipment is autosized. +! +! The supply air temperature setpoint is established by a setpoint +! manager using the "warmest" strategy: the supply air temperature +! is set to the highest temperature that will meet the cooling load +! of the warmest zone at full cfm. +! +! At design flow the system has 5% upstream supply duct leakage and 7% +! downstream of the terminal units. +! +! Zonal Equipment: (4) AirTerminal:SingleDuct:VAV:Reheat and (1) AirTerminal:SingleDuct:ParallelPIU:Reheat +! Central Air Handling Equipment: Yes +! System Equipment Autosize: Yes +! Purchased Cooling: None +! Purchased Heating: None +! Coils: Coil:Cooling:Water, Coil:Heating:Water +! Pumps: Pump:VariableSpeed +! Boilers: Boiler:HotWater +! Chillers: Chiller:Electric +! Towers: CoolingTower:SingleSpeed +! +! Results: +! Standard Reports: All Summary Predefined Reports +! Timestep or Hourly Variables: Hourly +! Time bins Report: None +! HTML Report: Predefined All Summary +! Environmental Emissions: None +! Utility Tariffs: None + + Version,25.2; + + Building, + Building, !- Name + 30., !- North Axis {deg} + City, !- Terrain + 0.04, !- Loads Convergence Tolerance Value {W} + 0.4, !- Temperature Convergence Tolerance Value {deltaC} + FullExterior, !- Solar Distribution + 25, !- Maximum Number of Warmup Days + 6; !- Minimum Number of Warmup Days + + Timestep,4; + + SurfaceConvectionAlgorithm:Inside,Simple; + + SurfaceConvectionAlgorithm:Outside,SimpleCombined; + + HeatBalanceAlgorithm,ConductionTransferFunction; + + GlobalGeometryRules, + UpperLeftCorner, !- Starting Vertex Position + CounterClockWise, !- Vertex Entry Direction + Relative; !- Coordinate System + + ScheduleTypeLimits, + Any Number; !- Name + + ScheduleTypeLimits, + Fraction, !- Name + 0.0, !- Lower Limit Value + 1.0, !- Upper Limit Value + CONTINUOUS; !- Numeric Type + + ScheduleTypeLimits, + Temperature, !- Name + -60, !- Lower Limit Value + 200, !- Upper Limit Value + CONTINUOUS, !- Numeric Type + Temperature; !- Unit Type + + ScheduleTypeLimits, + Control Type, !- Name + 0, !- Lower Limit Value + 4, !- Upper Limit Value + DISCRETE; !- Numeric Type + + ScheduleTypeLimits, + On/Off, !- Name + 0, !- Lower Limit Value + 1, !- Upper Limit Value + DISCRETE; !- Numeric Type + + ScheduleTypeLimits, + FlowRate, !- Name + 0.0, !- Lower Limit Value + 10, !- Upper Limit Value + CONTINUOUS; !- Numeric Type + + RunPeriod, + Run Period 1, !- Name + 1, !- Begin Month + 1, !- Begin Day of Month + , !- Begin Year + 12, !- End Month + 31, !- End Day of Month + , !- End Year + Tuesday, !- Day of Week for Start Day + Yes, !- Use Weather File Holidays and Special Days + Yes, !- Use Weather File Daylight Saving Period + No, !- Apply Weekend Holiday Rule + Yes, !- Use Weather File Rain Indicators + Yes; !- Use Weather File Snow Indicators + + Site:Location, + CHICAGO_IL_USA TMY2-94846, !- Name + 41.78, !- Latitude {deg} + -87.75, !- Longitude {deg} + -6.00, !- Time Zone {hr} + 190.00; !- Elevation {m} + + SimulationControl, + Yes, !- Do Zone Sizing Calculation + Yes, !- Do System Sizing Calculation + No, !- Do Plant Sizing Calculation + No, !- Run Simulation for Sizing Periods + Yes, !- Run Simulation for Weather File Run Periods + No, !- Do HVAC Sizing Simulation for Sizing Periods + 1; !- Maximum Number of HVAC Sizing Simulation Passes + + OutputControl:Files, + Yes, !- Output CSV + Yes, !- Output MTR + Yes, !- Output ESO + Yes, !- Output EIO + Yes, !- Output Tabular + Yes, !- Output SQLite + Yes, !- Output JSON + Yes, !- Output AUDIT + Yes, !- Output Space Sizing + Yes, !- Output Zone Sizing + Yes, !- Output System Sizing + Yes, !- Output DXF + Yes, !- Output BND + Yes, !- Output RDD + Yes, !- Output MDD + Yes, !- Output MTD + Yes, !- Output END + Yes, !- Output SHD + Yes, !- Output DFS + Yes, !- Output GLHE + Yes, !- Output DelightIn + Yes, !- Output DelightELdmp + Yes, !- Output DelightDFdmp + Yes, !- Output EDD + Yes, !- Output DBG + Yes, !- Output PerfLog + Yes, !- Output SLN + Yes, !- Output SCI + Yes, !- Output WRL + Yes, !- Output Screen + Yes, !- Output ExtShd + Yes; !- Output Tarcog + +! CHICAGO_IL_USA Annual Heating 99% Design Conditions DB, MaxDB= -17.3°C + + SizingPeriod:DesignDay, + CHICAGO_IL_USA Annual Heating 99% Design Conditions DB, !- Name + 1, !- Month + 21, !- Day of Month + WinterDesignDay, !- Day Type + -17.3, !- Maximum Dry-Bulb Temperature {C} + 0.0, !- Daily Dry-Bulb Temperature Range {deltaC} + , !- Dry-Bulb Temperature Range Modifier Type + , !- Dry-Bulb Temperature Range Modifier Day Schedule Name + Wetbulb, !- Humidity Condition Type + -17.3, !- Wetbulb or DewPoint at Maximum Dry-Bulb {C} + , !- Humidity Condition Day Schedule Name + , !- Humidity Ratio at Maximum Dry-Bulb {kgWater/kgDryAir} + , !- Enthalpy at Maximum Dry-Bulb {J/kg} + , !- Daily Wet-Bulb Temperature Range {deltaC} + 99063., !- Barometric Pressure {Pa} + 4.9, !- Wind Speed {m/s} + 270, !- Wind Direction {deg} + No, !- Rain Indicator + No, !- Snow Indicator + No, !- Daylight Saving Time Indicator + ASHRAEClearSky, !- Solar Model Indicator + , !- Beam Solar Day Schedule Name + , !- Diffuse Solar Day Schedule Name + , !- ASHRAE Clear Sky Optical Depth for Beam Irradiance (taub) {dimensionless} + , !- ASHRAE Clear Sky Optical Depth for Diffuse Irradiance (taud) {dimensionless} + 0.0; !- Sky Clearness + +! CHICAGO_IL_USA Annual Cooling 1% Design Conditions, MaxDB= 31.5°C MCWB= 23.0°C + + SizingPeriod:DesignDay, + CHICAGO_IL_USA Annual Cooling 1% Design Conditions DB/MCWB, !- Name + 7, !- Month + 21, !- Day of Month + SummerDesignDay, !- Day Type + 31.5, !- Maximum Dry-Bulb Temperature {C} + 10.7, !- Daily Dry-Bulb Temperature Range {deltaC} + , !- Dry-Bulb Temperature Range Modifier Type + , !- Dry-Bulb Temperature Range Modifier Day Schedule Name + Wetbulb, !- Humidity Condition Type + 23.0, !- Wetbulb or DewPoint at Maximum Dry-Bulb {C} + , !- Humidity Condition Day Schedule Name + , !- Humidity Ratio at Maximum Dry-Bulb {kgWater/kgDryAir} + , !- Enthalpy at Maximum Dry-Bulb {J/kg} + , !- Daily Wet-Bulb Temperature Range {deltaC} + 99063., !- Barometric Pressure {Pa} + 5.3, !- Wind Speed {m/s} + 230, !- Wind Direction {deg} + No, !- Rain Indicator + No, !- Snow Indicator + No, !- Daylight Saving Time Indicator + ASHRAEClearSky, !- Solar Model Indicator + , !- Beam Solar Day Schedule Name + , !- Diffuse Solar Day Schedule Name + , !- ASHRAE Clear Sky Optical Depth for Beam Irradiance (taub) {dimensionless} + , !- ASHRAE Clear Sky Optical Depth for Diffuse Irradiance (taud) {dimensionless} + 1.0; !- Sky Clearness + + Site:GroundTemperature:BuildingSurface,20.03,20.03,20.13,20.30,20.43,20.52,20.62,20.77,20.78,20.55,20.44,20.20; + + Material, + WD10, !- Name + MediumSmooth, !- Roughness + 0.667, !- Thickness {m} + 0.115, !- Conductivity {W/m-K} + 513, !- Density {kg/m3} + 1381, !- Specific Heat {J/kg-K} + 0.9, !- Thermal Absorptance + 0.78, !- Solar Absorptance + 0.78; !- Visible Absorptance + + Material, + RG01, !- Name + Rough, !- Roughness + 1.2700000E-02, !- Thickness {m} + 1.442000, !- Conductivity {W/m-K} + 881.0000, !- Density {kg/m3} + 1674.000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.6500000, !- Solar Absorptance + 0.6500000; !- Visible Absorptance + + Material, + BR01, !- Name + VeryRough, !- Roughness + 9.4999997E-03, !- Thickness {m} + 0.1620000, !- Conductivity {W/m-K} + 1121.000, !- Density {kg/m3} + 1464.000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.7000000, !- Solar Absorptance + 0.7000000; !- Visible Absorptance + + Material, + IN46, !- Name + VeryRough, !- Roughness + 7.6200001E-02, !- Thickness {m} + 2.3000000E-02, !- Conductivity {W/m-K} + 24.00000, !- Density {kg/m3} + 1590.000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.5000000, !- Solar Absorptance + 0.5000000; !- Visible Absorptance + + Material, + WD01, !- Name + MediumSmooth, !- Roughness + 1.9099999E-02, !- Thickness {m} + 0.1150000, !- Conductivity {W/m-K} + 513.0000, !- Density {kg/m3} + 1381.000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.7800000, !- Solar Absorptance + 0.7800000; !- Visible Absorptance + + Material, + PW03, !- Name + MediumSmooth, !- Roughness + 1.2700000E-02, !- Thickness {m} + 0.1150000, !- Conductivity {W/m-K} + 545.0000, !- Density {kg/m3} + 1213.000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.7800000, !- Solar Absorptance + 0.7800000; !- Visible Absorptance + + Material, + IN02, !- Name + Rough, !- Roughness + 9.0099998E-02, !- Thickness {m} + 4.3000001E-02, !- Conductivity {W/m-K} + 10.00000, !- Density {kg/m3} + 837.0000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.7500000, !- Solar Absorptance + 0.7500000; !- Visible Absorptance + + Material, + GP01, !- Name + MediumSmooth, !- Roughness + 1.2700000E-02, !- Thickness {m} + 0.1600000, !- Conductivity {W/m-K} + 801.0000, !- Density {kg/m3} + 837.0000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.7500000, !- Solar Absorptance + 0.7500000; !- Visible Absorptance + + Material, + GP02, !- Name + MediumSmooth, !- Roughness + 1.5900001E-02, !- Thickness {m} + 0.1600000, !- Conductivity {W/m-K} + 801.0000, !- Density {kg/m3} + 837.0000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.7500000, !- Solar Absorptance + 0.7500000; !- Visible Absorptance + + Material, + CC03, !- Name + MediumRough, !- Roughness + 0.1016000, !- Thickness {m} + 1.310000, !- Conductivity {W/m-K} + 2243.000, !- Density {kg/m3} + 837.0000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.6500000, !- Solar Absorptance + 0.6500000; !- Visible Absorptance + + Material:NoMass, + CP01, !- Name + Rough, !- Roughness + 0.3670000, !- Thermal Resistance {m2-K/W} + 0.9000000, !- Thermal Absorptance + 0.7500000, !- Solar Absorptance + 0.7500000; !- Visible Absorptance + + Material:NoMass, + MAT-SB-U, !- Name + Rough, !- Roughness + 0.117406666, !- Thermal Resistance {m2-K/W} + 0.65, !- Thermal Absorptance + 0.65, !- Solar Absorptance + 0.65; !- Visible Absorptance + + Material:NoMass, + MAT-CLNG-1, !- Name + Rough, !- Roughness + 0.652259290, !- Thermal Resistance {m2-K/W} + 0.65, !- Thermal Absorptance + 0.65, !- Solar Absorptance + 0.65; !- Visible Absorptance + + Material:NoMass, + MAT-FLOOR-1, !- Name + Rough, !- Roughness + 3.522199631, !- Thermal Resistance {m2-K/W} + 0.65, !- Thermal Absorptance + 0.65, !- Solar Absorptance + 0.65; !- Visible Absorptance + + Material:AirGap, + AL21, !- Name + 0.1570000; !- Thermal Resistance {m2-K/W} + + Material:AirGap, + AL23, !- Name + 0.1530000; !- Thermal Resistance {m2-K/W} + + Construction, + ROOF-1, !- Name + RG01, !- Outside Layer + BR01, !- Layer 2 + IN46, !- Layer 3 + WD01; !- Layer 4 + + Construction, + WALL-1, !- Name + WD01, !- Outside Layer + PW03, !- Layer 2 + IN02, !- Layer 3 + GP01; !- Layer 4 + + Construction, + CLNG-1, !- Name + MAT-CLNG-1; !- Outside Layer + + Construction, + FLOOR-SLAB-1, !- Name + CC03; !- Outside Layer + + Construction, + INT-WALL-1, !- Name + GP02, !- Outside Layer + AL21, !- Layer 2 + GP02; !- Layer 3 + + WindowMaterial:Gas, + AIR 6MM, !- Name + Air, !- Gas Type + 0.0063; !- Thickness {m} + + WindowMaterial:Gas, + AIR 13MM, !- Name + Air, !- Gas Type + 0.0127; !- Thickness {m} + + WindowMaterial:Gas, + ARGON 13MM, !- Name + Argon, !- Gas Type + 0.0127; !- Thickness {m} + + WindowMaterial:GasMixture, + ArgonKryptonMix 13MM, !- Name + 0.0127, !- Thickness {m} + 2, !- Number of Gases in Mixture + Argon, !- Gas 1 Type + 0.6, !- Gas 1 Fraction + Krypton, !- Gas 2 Type + 0.4; !- Gas 2 Fraction + + WindowMaterial:Glazing, + CLEAR 3MM, !- Name + SpectralAverage, !- Optical Data Type + , !- Window Glass Spectral Data Set Name + 0.003, !- Thickness {m} + 0.837, !- Solar Transmittance at Normal Incidence + 0.075, !- Front Side Solar Reflectance at Normal Incidence + 0.075, !- Back Side Solar Reflectance at Normal Incidence + 0.898, !- Visible Transmittance at Normal Incidence + 0.081, !- Front Side Visible Reflectance at Normal Incidence + 0.081, !- Back Side Visible Reflectance at Normal Incidence + 0.0, !- Infrared Transmittance at Normal Incidence + 0.84, !- Front Side Infrared Hemispherical Emissivity + 0.84, !- Back Side Infrared Hemispherical Emissivity + 0.9; !- Conductivity {W/m-K} + + WindowMaterial:Glazing:RefractionExtinctionMethod, + 3MM CLEAR GLASS, !- Name + 0.003, !- Thickness {m} + 1.526, !- Solar Index of Refraction + 30.0, !- Solar Extinction Coefficient {1/m} + 1.526, !- Visible Index of Refraction + 30.0, !- Visible Extinction Coefficient {1/m} + 0.0, !- Infrared Transmittance at Normal Incidence + 0.84, !- Infrared Hemispherical Emissivity + 0.9; !- Conductivity {W/m-K} + + WindowMaterial:Glazing, + GREY 3MM, !- Name + SpectralAverage, !- Optical Data Type + , !- Window Glass Spectral Data Set Name + 0.003, !- Thickness {m} + 0.626, !- Solar Transmittance at Normal Incidence + 0.061, !- Front Side Solar Reflectance at Normal Incidence + 0.061, !- Back Side Solar Reflectance at Normal Incidence + 0.611, !- Visible Transmittance at Normal Incidence + 0.061, !- Front Side Visible Reflectance at Normal Incidence + 0.061, !- Back Side Visible Reflectance at Normal Incidence + 0.0, !- Infrared Transmittance at Normal Incidence + 0.84, !- Front Side Infrared Hemispherical Emissivity + 0.84, !- Back Side Infrared Hemispherical Emissivity + 0.9; !- Conductivity {W/m-K} + + WindowMaterial:Glazing, + CLEAR 6MM, !- Name + SpectralAverage, !- Optical Data Type + , !- Window Glass Spectral Data Set Name + 0.006, !- Thickness {m} + 0.775, !- Solar Transmittance at Normal Incidence + 0.071, !- Front Side Solar Reflectance at Normal Incidence + 0.071, !- Back Side Solar Reflectance at Normal Incidence + 0.881, !- Visible Transmittance at Normal Incidence + 0.080, !- Front Side Visible Reflectance at Normal Incidence + 0.080, !- Back Side Visible Reflectance at Normal Incidence + 0.0, !- Infrared Transmittance at Normal Incidence + 0.84, !- Front Side Infrared Hemispherical Emissivity + 0.84, !- Back Side Infrared Hemispherical Emissivity + 0.9; !- Conductivity {W/m-K} + + WindowMaterial:Glazing, + LoE CLEAR 6MM, !- Name + SpectralAverage, !- Optical Data Type + , !- Window Glass Spectral Data Set Name + 0.006, !- Thickness {m} + 0.600, !- Solar Transmittance at Normal Incidence + 0.170, !- Front Side Solar Reflectance at Normal Incidence + 0.220, !- Back Side Solar Reflectance at Normal Incidence + 0.840, !- Visible Transmittance at Normal Incidence + 0.055, !- Front Side Visible Reflectance at Normal Incidence + 0.078, !- Back Side Visible Reflectance at Normal Incidence + 0.0, !- Infrared Transmittance at Normal Incidence + 0.84, !- Front Side Infrared Hemispherical Emissivity + 0.10, !- Back Side Infrared Hemispherical Emissivity + 0.9; !- Conductivity {W/m-K} + + Construction, + Dbl Clr 3mm/13mm Air, !- Name + 3MM CLEAR GLASS, !- Outside Layer + AIR 13MM, !- Layer 2 + 3MM CLEAR GLASS; !- Layer 3 + + Construction, + Dbl Clr 3mm/13mm ArgKryp,!- Name + CLEAR 3MM, !- Outside Layer + ArgonKryptonMix 13MM, !- Layer 2 + CLEAR 3MM; !- Layer 3 + + Construction, + Sgl Grey 3mm, !- Name + GREY 3MM; !- Outside Layer + + Schedule:Compact, + OCCUPY-1, !- Name + Fraction, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: Weekdays SummerDesignDay CustomDay1 CustomDay2, !- Field 2 + Until: 8:00,0.00, !- Field 3 + Until: 11:00,1.00, !- Field 5 + Until: 12:00,0.80, !- Field 7 + Until: 13:00,0.40, !- Field 9 + Until: 14:00,0.80, !- Field 11 + Until: 18:00,1.00, !- Field 13 + Until: 19:00,0.50, !- Field 15 + Until: 21:00,0.10, !- Field 17 + Until: 24:00,0.00, !- Field 19 + For: Saturday Sunday Holidays WinterDesignDay, !- Field 21 + Until: 24:00,0.00; !- Field 22 + + Schedule:Compact, + LIGHTS-1, !- Name + Fraction, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: Weekdays SummerDesignDay CustomDay1 CustomDay2, !- Field 2 + Until: 8:00,0.05, !- Field 3 + Until: 9:00,0.90, !- Field 5 + Until: 10:00,0.95, !- Field 7 + Until: 11:00,1.00, !- Field 9 + Until: 12:00,0.95, !- Field 11 + Until: 13:00,0.80, !- Field 13 + Until: 14:00,0.90, !- Field 15 + Until: 18:00,1.00, !- Field 17 + Until: 19:00,0.60, !- Field 19 + Until: 20:00,0.20, !- Field 21 + Until: 21:00,0.20, !- Field 23 + Until: 24:00,0.05, !- Field 25 + For: Saturday Sunday Holidays WinterDesignDay, !- Field 27 + Until: 24:00,0.05; !- Field 28 + + Schedule:Compact, + EQUIP-1, !- Name + Fraction, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: Weekdays SummerDesignDay CustomDay1 CustomDay2, !- Field 2 + Until: 8:00,0.02, !- Field 3 + Until: 9:00,0.40, !- Field 5 + Until: 14:00,0.90, !- Field 7 + Until: 15:00,0.80, !- Field 9 + Until: 16:00,0.70, !- Field 11 + Until: 18:00,0.50, !- Field 13 + Until: 20:00,0.30, !- Field 15 + Until: 24:00,0.02, !- Field 17 + For: Saturday Sunday Holidays WinterDesignDay, !- Field 19 + Until: 24:00,0.20; !- Field 20 + + Schedule:Compact, + INFIL-SCH, !- Name + Fraction, !- Schedule Type Limits Name + Through: 3/31, !- Field 1 + For: Alldays, !- Field 2 + Until: 24:00,1.00, !- Field 3 + Through: 10/31, !- Field 5 + For: Alldays, !- Field 6 + Until: 24:00,0.00, !- Field 7 + Through: 12/31, !- Field 9 + For: Alldays, !- Field 10 + Until: 24:00,1.00; !- Field 11 + + Schedule:Compact, + ActSchd, !- Name + Any Number, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: Alldays, !- Field 2 + Until: 24:00,117.239997864; !- Field 3 + + !- Field 4 + + Schedule:Compact, + ShadeTransSch, !- Name + Fraction, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: Alldays, !- Field 2 + Until: 24:00,0.00; !- Field 3 + + Schedule:Compact, + Htg-SetP-Sch, !- Name + Temperature, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: Weekdays CustomDay1 CustomDay2, !- Field 2 + Until: 7:00,12.80, !- Field 3 + Until: 18:00,21.10, !- Field 5 + Until: 24:00,12.80, !- Field 7 + For: Weekends Holidays, !- Field 9 + Until: 7:00,12.80, !- Field 10 + Until: 13:00,21.10, !- Field 12 + Until: 24:00,12.80, !- Field 14 + For: SummerDesignDay, !- Field 16 + Until: 24:00,12.80, !- Field 17 + For: WinterDesignDay, !- Field 19 + Until: 24:00,21.10; !- Field 20 + + Schedule:Compact, + Clg-SetP-Sch, !- Name + Temperature, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: Weekdays CustomDay1 CustomDay2, !- Field 2 + Until: 7:00,40.00, !- Field 3 + Until: 18:00,23.90, !- Field 5 + Until: 24:00,40.00, !- Field 7 + For: Weekends Holidays, !- Field 9 + Until: 7:00,40.00, !- Field 10 + Until: 13:00,23.90, !- Field 12 + Until: 24:00,32.20, !- Field 14 + For: SummerDesignDay, !- Field 16 + Until: 24:00,23.90, !- Field 17 + For: WinterDesignDay, !- Field 19 + Until: 24:00,40.00; !- Field 20 + + Schedule:Compact, + Zone Control Type Sched, !- Name + Control Type, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: Weekdays Weekends Holidays CustomDay1 CustomDay2, !- Field 2 + Until: 24:00,4, !- Field 3 + For: SummerDesignDay, !- Field 5 + Until: 24:00,2, !- Field 6 + For: WinterDesignDay, !- Field 8 + Until: 24:00,1; !- Field 9 + + Schedule:Compact, + Min OA Sched, !- Name + Fraction, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: Weekdays, !- Field 2 + Until: 6:00,0.02, !- Field 3 + Until: 18:00,1.00, !- Field 5 + Until: 24:00,0.02, !- Field 7 + For: Weekends SummerDesignDay WinterDesignDay CustomDay1 CustomDay2 Holidays, !- Field 9 + Until: 24:00,0.02; !- Field 10 + + Schedule:Compact, + FanAvailSched, !- Name + Fraction, !- Schedule Type Limits Name + Through: 3/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,1.00, !- Field 3 + Through: 9/30, !- Field 5 + For: Weekdays, !- Field 6 + Until: 7:00,0.00, !- Field 7 + Until: 17:00,1.00, !- Field 9 + Until: 24:00,0.00, !- Field 11 + For: Weekends Holidays CustomDay1 CustomDay2, !- Field 13 + Until: 24:00,0.00, !- Field 14 + For: SummerDesignDay WinterDesignDay, !- Field 16 + Until: 24:00,1.00, !- Field 17 + Through: 12/31, !- Field 19 + For: AllDays, !- Field 20 + Until: 24:00,1.00; !- Field 21 + + Schedule:Compact, + CoolingCoilAvailSched, !- Name + Fraction, !- Schedule Type Limits Name + Through: 3/31, !- Field 1 + For: Alldays, !- Field 2 + Until: 24:00,0.00, !- Field 3 + Through: 9/30, !- Field 5 + For: Weekdays, !- Field 6 + Until: 7:00,0.00, !- Field 7 + Until: 17:00,1.00, !- Field 9 + Until: 24:00,0.00, !- Field 11 + For: Weekends Holidays CustomDay1 CustomDay2, !- Field 13 + Until: 24:00,0.00, !- Field 14 + For: SummerDesignDay WinterDesignDay, !- Field 16 + Until: 24:00,1.00, !- Field 17 + Through: 12/31, !- Field 19 + For: Alldays, !- Field 20 + Until: 24:00,0.00; !- Field 21 + + Schedule:Compact, + CoolingPumpAvailSched, !- Name + Fraction, !- Schedule Type Limits Name + Through: 3/31, !- Field 1 + For: Alldays, !- Field 2 + Until: 24:00,0.00, !- Field 3 + Through: 9/30, !- Field 5 + For: Alldays, !- Field 6 + Until: 24:00,1.00, !- Field 7 + Through: 12/31, !- Field 9 + For: Alldays, !- Field 10 + Until: 24:00,0.00; !- Field 11 + + Schedule:Compact, + ReheatCoilAvailSched, !- Name + Fraction, !- Schedule Type Limits Name + Through: 3/31, !- Field 1 + For: Alldays, !- Field 2 + Until: 24:00,1.00, !- Field 3 + Through: 9/30, !- Field 5 + For: Weekdays, !- Field 6 + Until: 7:00,0.00, !- Field 7 + Until: 17:00,1.00, !- Field 9 + Until: 24:00,0.00, !- Field 11 + For: SummerDesignDay WinterDesignDay, !- Field 13 + Until: 24:00,1.00, !- Field 14 + For: Weekends Holidays CustomDay1 CustomDay2, !- Field 16 + Until: 24:00,0.00, !- Field 17 + Through: 12/31, !- Field 19 + For: Alldays, !- Field 20 + Until: 24:00,1.00; !- Field 21 + + Schedule:Compact, + CW Loop Temp Schedule, !- Name + Temperature, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: Alldays, !- Field 2 + Until: 24:00,7.22; !- Field 3 + + Schedule:Compact, + HW Loop Temp Schedule, !- Name + Temperature, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: Alldays, !- Field 2 + Until: 24:00,82.00; !- Field 3 + + Schedule:Compact, + PlantOnSched, !- Name + Fraction, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: Alldays, !- Field 2 + Until: 24:00,1.00; !- Field 3 + + Zone, + PLENUM-1, !- Name + 0, !- Direction of Relative North {deg} + 0, !- X Origin {m} + 0, !- Y Origin {m} + 0, !- Z Origin {m} + 1, !- Type + 1, !- Multiplier + 0.609600067, !- Ceiling Height {m} + 283.2; !- Volume {m3} + + BuildingSurface:Detailed, + WALL-1PF, !- Name + WALL, !- Surface Type + WALL-1, !- Construction Name + PLENUM-1, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.50000, !- View Factor to Ground + 4, !- Number of Vertices + 0.0,0.0,3.0, !- X,Y,Z ==> Vertex 1 {m} + 0.0,0.0,2.4, !- X,Y,Z ==> Vertex 2 {m} + 30.5,0.0,2.4, !- X,Y,Z ==> Vertex 3 {m} + 30.5,0.0,3.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + WALL-1PR, !- Name + WALL, !- Surface Type + WALL-1, !- Construction Name + PLENUM-1, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.50000, !- View Factor to Ground + 4, !- Number of Vertices + 30.5,0.0,3.0, !- X,Y,Z ==> Vertex 1 {m} + 30.5,0.0,2.4, !- X,Y,Z ==> Vertex 2 {m} + 30.5,15.2,2.4, !- X,Y,Z ==> Vertex 3 {m} + 30.5,15.2,3.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + WALL-1PB, !- Name + WALL, !- Surface Type + WALL-1, !- Construction Name + PLENUM-1, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.50000, !- View Factor to Ground + 4, !- Number of Vertices + 30.5,15.2,3.0, !- X,Y,Z ==> Vertex 1 {m} + 30.5,15.2,2.4, !- X,Y,Z ==> Vertex 2 {m} + 0.0,15.2,2.4, !- X,Y,Z ==> Vertex 3 {m} + 0.0,15.2,3.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + WALL-1PL, !- Name + WALL, !- Surface Type + WALL-1, !- Construction Name + PLENUM-1, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.50000, !- View Factor to Ground + 4, !- Number of Vertices + 0.0,15.2,3.0, !- X,Y,Z ==> Vertex 1 {m} + 0.0,15.2,2.4, !- X,Y,Z ==> Vertex 2 {m} + 0.0,0.0,2.4, !- X,Y,Z ==> Vertex 3 {m} + 0.0,0.0,3.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + TOP-1, !- Name + ROOF, !- Surface Type + ROOF-1, !- Construction Name + PLENUM-1, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.00000, !- View Factor to Ground + 4, !- Number of Vertices + 0.0,15.2,3.0, !- X,Y,Z ==> Vertex 1 {m} + 0.0,0.0,3.0, !- X,Y,Z ==> Vertex 2 {m} + 30.5,0.0,3.0, !- X,Y,Z ==> Vertex 3 {m} + 30.5,15.2,3.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C1-1P, !- Name + FLOOR, !- Surface Type + CLNG-1, !- Construction Name + PLENUM-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + C1-1, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 30.5,0.0,2.4, !- X,Y,Z ==> Vertex 2 {m} + 0.0,0.0,2.4, !- X,Y,Z ==> Vertex 3 {m} + 3.7,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C2-1P, !- Name + FLOOR, !- Surface Type + CLNG-1, !- Construction Name + PLENUM-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + C2-1, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 30.5,15.2,2.4, !- X,Y,Z ==> Vertex 2 {m} + 30.5,0.0,2.4, !- X,Y,Z ==> Vertex 3 {m} + 26.8,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C3-1P, !- Name + FLOOR, !- Surface Type + CLNG-1, !- Construction Name + PLENUM-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + C3-1, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,11.6,2.4, !- X,Y,Z ==> Vertex 2 {m} + 0.0,15.2,2.4, !- X,Y,Z ==> Vertex 3 {m} + 30.5,15.2,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C4-1P, !- Name + FLOOR, !- Surface Type + CLNG-1, !- Construction Name + PLENUM-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + C4-1, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 0.0,0.0,2.4, !- X,Y,Z ==> Vertex 2 {m} + 0.0,15.2,2.4, !- X,Y,Z ==> Vertex 3 {m} + 3.7,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C5-1P, !- Name + FLOOR, !- Surface Type + CLNG-1, !- Construction Name + PLENUM-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + C5-1, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 26.8,3.7,2.4, !- X,Y,Z ==> Vertex 2 {m} + 3.7,3.7,2.4, !- X,Y,Z ==> Vertex 3 {m} + 3.7,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + Zone, + SPACE1-1, !- Name + 0, !- Direction of Relative North {deg} + 0, !- X Origin {m} + 0, !- Y Origin {m} + 0, !- Z Origin {m} + 1, !- Type + 1, !- Multiplier + 2.438400269, !- Ceiling Height {m} + 239.247360229; !- Volume {m3} + + ZoneInfiltration:DesignFlowRate, + SPACE1-1 Infil 1, !- Name + SPACE1-1, !- Zone or ZoneList or Space or SpaceList Name + INFIL-SCH, !- Schedule Name + flow/zone, !- Design Flow Rate Calculation Method + 0.0167, !- Design Flow Rate {m3/s} + , !- Flow per Zone Floor Area {m3/s-m2} + , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Air Changes per Hour {1/hr} + 0, !- Constant Term Coefficient + 0, !- Temperature Term Coefficient + 0.2237, !- Velocity Term Coefficient + 0; !- Velocity Squared Term Coefficient + + People, + SPACE1-1 People 1, !- Name + SPACE1-1, !- Zone or ZoneList or Space or SpaceList Name + OCCUPY-1, !- Number of People Schedule Name + people, !- Number of People Calculation Method + 11, !- Number of People + , !- People per Floor Area {person/m2} + , !- Floor Area per Person {m2/person} + 0.3, !- Fraction Radiant + , !- Sensible Heat Fraction + ActSchd; !- Activity Level Schedule Name + + Lights, + SPACE1-1 Lights 1, !- Name + SPACE1-1, !- Zone or ZoneList or Space or SpaceList Name + LIGHTS-1, !- Schedule Name + LightingLevel, !- Design Level Calculation Method + 1584, !- Lighting Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0.2, !- Return Air Fraction + 0.59, !- Fraction Radiant + 0.2, !- Fraction Visible + 0, !- Fraction Replaceable + GeneralLights; !- End-Use Subcategory + + ElectricEquipment, + SPACE1-1 ElecEq 1, !- Name + SPACE1-1, !- Zone or ZoneList or Space or SpaceList Name + EQUIP-1, !- Schedule Name + EquipmentLevel, !- Design Level Calculation Method + 1056, !- Design Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0, !- Fraction Latent + 0.3, !- Fraction Radiant + 0; !- Fraction Lost + + BuildingSurface:Detailed, + FRONT-1, !- Name + WALL, !- Surface Type + WALL-1, !- Construction Name + SPACE1-1, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.50000, !- View Factor to Ground + 4, !- Number of Vertices + 0.0,0.0,2.4, !- X,Y,Z ==> Vertex 1 {m} + 0.0,0.0,0.0, !- X,Y,Z ==> Vertex 2 {m} + 30.5,0.0,0.0, !- X,Y,Z ==> Vertex 3 {m} + 30.5,0.0,2.4; !- X,Y,Z ==> Vertex 4 {m} + + FenestrationSurface:Detailed, + WF-1, !- Name + WINDOW, !- Surface Type + Dbl Clr 3mm/13mm ArgKryp,!- Construction Name + FRONT-1, !- Building Surface Name + , !- Outside Boundary Condition Object + 0.50000, !- View Factor to Ground + , !- Frame and Divider Name + 1, !- Multiplier + 4, !- Number of Vertices + 3.0,0.0,2.1, !- X,Y,Z ==> Vertex 1 {m} + 3.0,0.0,0.9, !- X,Y,Z ==> Vertex 2 {m} + 16.8,0.0,0.9, !- X,Y,Z ==> Vertex 3 {m} + 16.8,0.0,2.1; !- X,Y,Z ==> Vertex 4 {m} + + FenestrationSurface:Detailed, + DF-1, !- Name + GLASSDOOR, !- Surface Type + Sgl Grey 3mm, !- Construction Name + FRONT-1, !- Building Surface Name + , !- Outside Boundary Condition Object + 0.50000, !- View Factor to Ground + , !- Frame and Divider Name + 1, !- Multiplier + 4, !- Number of Vertices + 21.3,0.0,2.1, !- X,Y,Z ==> Vertex 1 {m} + 21.3,0.0,0.0, !- X,Y,Z ==> Vertex 2 {m} + 23.8,0.0,0.0, !- X,Y,Z ==> Vertex 3 {m} + 23.8,0.0,2.1; !- X,Y,Z ==> Vertex 4 {m} + + Shading:Zone:Detailed, + Main South Overhang, !- Name + FRONT-1, !- Base Surface Name + ShadeTransSch, !- Transmittance Schedule Name + 4, !- Number of Vertices + 0.0,-1.3,2.2, !- X,Y,Z ==> Vertex 1 {m} + 0.0,0.0,2.2, !- X,Y,Z ==> Vertex 2 {m} + 19.8,0.0,2.2, !- X,Y,Z ==> Vertex 3 {m} + 19.8,-1.3,2.2; !- X,Y,Z ==> Vertex 4 {m} + + Shading:Zone:Detailed, + South Door Overhang, !- Name + FRONT-1, !- Base Surface Name + ShadeTransSch, !- Transmittance Schedule Name + 4, !- Number of Vertices + 21.0,-2.0,2.6, !- X,Y,Z ==> Vertex 1 {m} + 21.0,0.0,2.6, !- X,Y,Z ==> Vertex 2 {m} + 24.1,0.0,2.6, !- X,Y,Z ==> Vertex 3 {m} + 24.1,-2.0,2.6; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C1-1, !- Name + CEILING, !- Surface Type + CLNG-1, !- Construction Name + SPACE1-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + C1-1P, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 0.0,0.0,2.4, !- X,Y,Z ==> Vertex 2 {m} + 30.5,0.0,2.4, !- X,Y,Z ==> Vertex 3 {m} + 26.8,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + F1-1, !- Name + FLOOR, !- Surface Type + FLOOR-SLAB-1, !- Construction Name + SPACE1-1, !- Zone Name + , !- Space Name + Ground, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,3.7,0.0, !- X,Y,Z ==> Vertex 1 {m} + 30.5,0.0,0.0, !- X,Y,Z ==> Vertex 2 {m} + 0.0,0.0,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,3.7,0.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB12, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + SPACE1-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB21, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 30.5,0.0,2.4, !- X,Y,Z ==> Vertex 1 {m} + 30.5,0.0,0.0, !- X,Y,Z ==> Vertex 2 {m} + 26.8,3.7,0.0, !- X,Y,Z ==> Vertex 3 {m} + 26.8,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB14, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + SPACE1-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB41, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,3.7,0.0, !- X,Y,Z ==> Vertex 2 {m} + 0.0,0.0,0.0, !- X,Y,Z ==> Vertex 3 {m} + 0.0,0.0,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB15, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + SPACE1-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB51, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 26.8,3.7,0.0, !- X,Y,Z ==> Vertex 2 {m} + 3.7,3.7,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + Zone, + SPACE2-1, !- Name + 0, !- Direction of Relative North {deg} + 0, !- X Origin {m} + 0, !- Y Origin {m} + 0, !- Z Origin {m} + 1, !- Type + 1, !- Multiplier + 2.438400269, !- Ceiling Height {m} + 103.311355591; !- Volume {m3} + + ZoneInfiltration:DesignFlowRate, + SPACE2-1 Infil 1, !- Name + SPACE2-1, !- Zone or ZoneList or Space or SpaceList Name + INFIL-SCH, !- Schedule Name + flow/zone, !- Design Flow Rate Calculation Method + 0.00717, !- Design Flow Rate {m3/s} + , !- Flow per Zone Floor Area {m3/s-m2} + , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Air Changes per Hour {1/hr} + 0, !- Constant Term Coefficient + 0, !- Temperature Term Coefficient + 0.2237, !- Velocity Term Coefficient + 0; !- Velocity Squared Term Coefficient + + People, + SPACE2-1 People 1, !- Name + SPACE2-1, !- Zone or ZoneList or Space or SpaceList Name + OCCUPY-1, !- Number of People Schedule Name + people, !- Number of People Calculation Method + 5, !- Number of People + , !- People per Floor Area {person/m2} + , !- Floor Area per Person {m2/person} + 0.3, !- Fraction Radiant + , !- Sensible Heat Fraction + ActSchd; !- Activity Level Schedule Name + + Lights, + SPACE2-1 Lights 1, !- Name + SPACE2-1, !- Zone or ZoneList or Space or SpaceList Name + LIGHTS-1, !- Schedule Name + LightingLevel, !- Design Level Calculation Method + 684, !- Lighting Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0.2, !- Return Air Fraction + 0.59, !- Fraction Radiant + 0.2, !- Fraction Visible + 0, !- Fraction Replaceable + GeneralLights; !- End-Use Subcategory + + ElectricEquipment, + SPACE2-1 ElecEq 1, !- Name + SPACE2-1, !- Zone or ZoneList or Space or SpaceList Name + EQUIP-1, !- Schedule Name + EquipmentLevel, !- Design Level Calculation Method + 456, !- Design Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0, !- Fraction Latent + 0.3, !- Fraction Radiant + 0; !- Fraction Lost + + BuildingSurface:Detailed, + RIGHT-1, !- Name + WALL, !- Surface Type + WALL-1, !- Construction Name + SPACE2-1, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.50000, !- View Factor to Ground + 4, !- Number of Vertices + 30.5,0.0,2.4, !- X,Y,Z ==> Vertex 1 {m} + 30.5,0.0,0.0, !- X,Y,Z ==> Vertex 2 {m} + 30.5,15.2,0.0, !- X,Y,Z ==> Vertex 3 {m} + 30.5,15.2,2.4; !- X,Y,Z ==> Vertex 4 {m} + + FenestrationSurface:Detailed, + WR-1, !- Name + WINDOW, !- Surface Type + Dbl Clr 3mm/13mm Air, !- Construction Name + RIGHT-1, !- Building Surface Name + , !- Outside Boundary Condition Object + 0.50000, !- View Factor to Ground + , !- Frame and Divider Name + 1, !- Multiplier + 4, !- Number of Vertices + 30.5,3.8,2.1, !- X,Y,Z ==> Vertex 1 {m} + 30.5,3.8,0.9, !- X,Y,Z ==> Vertex 2 {m} + 30.5,11.4,0.9, !- X,Y,Z ==> Vertex 3 {m} + 30.5,11.4,2.1; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C2-1, !- Name + CEILING, !- Surface Type + CLNG-1, !- Construction Name + SPACE2-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + C2-1P, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 30.5,0.0,2.4, !- X,Y,Z ==> Vertex 2 {m} + 30.5,15.2,2.4, !- X,Y,Z ==> Vertex 3 {m} + 26.8,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + F2-1, !- Name + FLOOR, !- Surface Type + FLOOR-SLAB-1, !- Construction Name + SPACE2-1, !- Zone Name + , !- Space Name + Ground, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 1 {m} + 30.5,15.2,0.0, !- X,Y,Z ==> Vertex 2 {m} + 30.5,0.0,0.0, !- X,Y,Z ==> Vertex 3 {m} + 26.8,3.7,0.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB21, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + SPACE2-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB12, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 26.8,3.7,0.0, !- X,Y,Z ==> Vertex 2 {m} + 30.5,0.0,0.0, !- X,Y,Z ==> Vertex 3 {m} + 30.5,0.0,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB23, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + SPACE2-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB32, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 30.5,15.2,2.4, !- X,Y,Z ==> Vertex 1 {m} + 30.5,15.2,0.0, !- X,Y,Z ==> Vertex 2 {m} + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 3 {m} + 26.8,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB25, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + SPACE2-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB52, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 26.8,3.7,0.0, !- X,Y,Z ==> Vertex 3 {m} + 26.8,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + Zone, + SPACE3-1, !- Name + 0, !- Direction of Relative North {deg} + 0, !- X Origin {m} + 0, !- Y Origin {m} + 0, !- Z Origin {m} + 1, !- Type + 1, !- Multiplier + 2.438400269, !- Ceiling Height {m} + 239.247360229; !- Volume {m3} + + ZoneInfiltration:DesignFlowRate, + SPACE3-1 Infil 1, !- Name + SPACE3-1, !- Zone or ZoneList or Space or SpaceList Name + INFIL-SCH, !- Schedule Name + flow/zone, !- Design Flow Rate Calculation Method + 0.0167, !- Design Flow Rate {m3/s} + , !- Flow per Zone Floor Area {m3/s-m2} + , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Air Changes per Hour {1/hr} + 0, !- Constant Term Coefficient + 0, !- Temperature Term Coefficient + 0.2237, !- Velocity Term Coefficient + 0; !- Velocity Squared Term Coefficient + + People, + SPACE3-1 People 1, !- Name + SPACE3-1, !- Zone or ZoneList or Space or SpaceList Name + OCCUPY-1, !- Number of People Schedule Name + people, !- Number of People Calculation Method + 11, !- Number of People + , !- People per Floor Area {person/m2} + , !- Floor Area per Person {m2/person} + 0.3, !- Fraction Radiant + , !- Sensible Heat Fraction + ActSchd; !- Activity Level Schedule Name + + Lights, + SPACE3-1 Lights 1, !- Name + SPACE3-1, !- Zone or ZoneList or Space or SpaceList Name + LIGHTS-1, !- Schedule Name + LightingLevel, !- Design Level Calculation Method + 1584, !- Lighting Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0.2, !- Return Air Fraction + 0.59, !- Fraction Radiant + 0.2, !- Fraction Visible + 0, !- Fraction Replaceable + GeneralLights; !- End-Use Subcategory + + ElectricEquipment, + SPACE3-1 ElecEq 1, !- Name + SPACE3-1, !- Zone or ZoneList or Space or SpaceList Name + EQUIP-1, !- Schedule Name + EquipmentLevel, !- Design Level Calculation Method + 1056, !- Design Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0, !- Fraction Latent + 0.3, !- Fraction Radiant + 0; !- Fraction Lost + + BuildingSurface:Detailed, + BACK-1, !- Name + WALL, !- Surface Type + WALL-1, !- Construction Name + SPACE3-1, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.50000, !- View Factor to Ground + 4, !- Number of Vertices + 30.5,15.2,2.4, !- X,Y,Z ==> Vertex 1 {m} + 30.5,15.2,0.0, !- X,Y,Z ==> Vertex 2 {m} + 0.0,15.2,0.0, !- X,Y,Z ==> Vertex 3 {m} + 0.0,15.2,2.4; !- X,Y,Z ==> Vertex 4 {m} + + FenestrationSurface:Detailed, + WB-1, !- Name + WINDOW, !- Surface Type + Dbl Clr 3mm/13mm Air, !- Construction Name + BACK-1, !- Building Surface Name + , !- Outside Boundary Condition Object + 0.50000, !- View Factor to Ground + , !- Frame and Divider Name + 1, !- Multiplier + 4, !- Number of Vertices + 27.4,15.2,2.1, !- X,Y,Z ==> Vertex 1 {m} + 27.4,15.2,0.9, !- X,Y,Z ==> Vertex 2 {m} + 13.7,15.2,0.9, !- X,Y,Z ==> Vertex 3 {m} + 13.7,15.2,2.1; !- X,Y,Z ==> Vertex 4 {m} + + FenestrationSurface:Detailed, + DB-1, !- Name + GLASSDOOR, !- Surface Type + Sgl Grey 3mm, !- Construction Name + BACK-1, !- Building Surface Name + , !- Outside Boundary Condition Object + 0.50000, !- View Factor to Ground + , !- Frame and Divider Name + 1, !- Multiplier + 4, !- Number of Vertices + 9.1,15.2,2.1, !- X,Y,Z ==> Vertex 1 {m} + 9.1,15.2,0.0, !- X,Y,Z ==> Vertex 2 {m} + 7.0,15.2,0.0, !- X,Y,Z ==> Vertex 3 {m} + 7.0,15.2,2.1; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C3-1, !- Name + CEILING, !- Surface Type + CLNG-1, !- Construction Name + SPACE3-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + C3-1P, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 30.5,15.2,2.4, !- X,Y,Z ==> Vertex 1 {m} + 0.0,15.2,2.4, !- X,Y,Z ==> Vertex 2 {m} + 3.7,11.6,2.4, !- X,Y,Z ==> Vertex 3 {m} + 26.8,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + F3-1, !- Name + FLOOR, !- Surface Type + FLOOR-SLAB-1, !- Construction Name + SPACE3-1, !- Zone Name + , !- Space Name + Ground, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 1 {m} + 3.7,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 0.0,15.2,0.0, !- X,Y,Z ==> Vertex 3 {m} + 30.5,15.2,0.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB32, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + SPACE3-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB23, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 30.5,15.2,0.0, !- X,Y,Z ==> Vertex 3 {m} + 30.5,15.2,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB34, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + SPACE3-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB43, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 0.0,15.2,2.4, !- X,Y,Z ==> Vertex 1 {m} + 0.0,15.2,0.0, !- X,Y,Z ==> Vertex 2 {m} + 3.7,11.6,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB35, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + SPACE3-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB53, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 3 {m} + 26.8,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + Zone, + SPACE4-1, !- Name + 0, !- Direction of Relative North {deg} + 0, !- X Origin {m} + 0, !- Y Origin {m} + 0, !- Z Origin {m} + 1, !- Type + 1, !- Multiplier + 2.438400269, !- Ceiling Height {m} + 103.311355591; !- Volume {m3} + + ZoneInfiltration:DesignFlowRate, + SPACE4-1 Infil 1, !- Name + SPACE4-1, !- Zone or ZoneList or Space or SpaceList Name + INFIL-SCH, !- Schedule Name + flow/zone, !- Design Flow Rate Calculation Method + 0.00717, !- Design Flow Rate {m3/s} + , !- Flow per Zone Floor Area {m3/s-m2} + , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Air Changes per Hour {1/hr} + 0, !- Constant Term Coefficient + 0, !- Temperature Term Coefficient + 0.2237, !- Velocity Term Coefficient + 0; !- Velocity Squared Term Coefficient + + People, + SPACE4-1 People 1, !- Name + SPACE4-1, !- Zone or ZoneList or Space or SpaceList Name + OCCUPY-1, !- Number of People Schedule Name + people, !- Number of People Calculation Method + 5, !- Number of People + , !- People per Floor Area {person/m2} + , !- Floor Area per Person {m2/person} + 0.3, !- Fraction Radiant + , !- Sensible Heat Fraction + ActSchd; !- Activity Level Schedule Name + + Lights, + SPACE4-1 Lights 1, !- Name + SPACE4-1, !- Zone or ZoneList or Space or SpaceList Name + LIGHTS-1, !- Schedule Name + LightingLevel, !- Design Level Calculation Method + 684, !- Lighting Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0.2, !- Return Air Fraction + 0.59, !- Fraction Radiant + 0.2, !- Fraction Visible + 0, !- Fraction Replaceable + GeneralLights; !- End-Use Subcategory + + ElectricEquipment, + SPACE4-1 ElecEq 1, !- Name + SPACE4-1, !- Zone or ZoneList or Space or SpaceList Name + EQUIP-1, !- Schedule Name + EquipmentLevel, !- Design Level Calculation Method + 456, !- Design Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0, !- Fraction Latent + 0.3, !- Fraction Radiant + 0; !- Fraction Lost + + BuildingSurface:Detailed, + LEFT-1, !- Name + WALL, !- Surface Type + WALL-1, !- Construction Name + SPACE4-1, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.50000, !- View Factor to Ground + 4, !- Number of Vertices + 0.0,15.2,2.4, !- X,Y,Z ==> Vertex 1 {m} + 0.0,15.2,0.0, !- X,Y,Z ==> Vertex 2 {m} + 0.0,0.0,0.0, !- X,Y,Z ==> Vertex 3 {m} + 0.0,0.0,2.4; !- X,Y,Z ==> Vertex 4 {m} + + FenestrationSurface:Detailed, + WL-1, !- Name + WINDOW, !- Surface Type + Dbl Clr 3mm/13mm Air, !- Construction Name + LEFT-1, !- Building Surface Name + , !- Outside Boundary Condition Object + 0.50000, !- View Factor to Ground + , !- Frame and Divider Name + 1, !- Multiplier + 4, !- Number of Vertices + 0.0,11.4,2.1, !- X,Y,Z ==> Vertex 1 {m} + 0.0,11.4,0.9, !- X,Y,Z ==> Vertex 2 {m} + 0.0,3.8,0.9, !- X,Y,Z ==> Vertex 3 {m} + 0.0,3.8,2.1; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C4-1, !- Name + CEILING, !- Surface Type + CLNG-1, !- Construction Name + SPACE4-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + C4-1P, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 0.0,15.2,2.4, !- X,Y,Z ==> Vertex 2 {m} + 0.0,0.0,2.4, !- X,Y,Z ==> Vertex 3 {m} + 3.7,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + F4-1, !- Name + FLOOR, !- Surface Type + FLOOR-SLAB-1, !- Construction Name + SPACE4-1, !- Zone Name + , !- Space Name + Ground, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,3.7,0.0, !- X,Y,Z ==> Vertex 1 {m} + 0.0,0.0,0.0, !- X,Y,Z ==> Vertex 2 {m} + 0.0,15.2,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,11.6,0.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB41, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + SPACE4-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB14, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 0.0,0.0,2.4, !- X,Y,Z ==> Vertex 1 {m} + 0.0,0.0,0.0, !- X,Y,Z ==> Vertex 2 {m} + 3.7,3.7,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB43, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + SPACE4-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB34, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 0.0,15.2,0.0, !- X,Y,Z ==> Vertex 3 {m} + 0.0,15.2,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB45, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + SPACE4-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB54, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,3.7,0.0, !- X,Y,Z ==> Vertex 2 {m} + 3.7,11.6,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + Zone, + SPACE5-1, !- Name + 0, !- Direction of Relative North {deg} + 0, !- X Origin {m} + 0, !- Y Origin {m} + 0, !- Z Origin {m} + 1, !- Type + 1, !- Multiplier + 2.438400269, !- Ceiling Height {m} + 447.682556152; !- Volume {m3} + + ZoneInfiltration:DesignFlowRate, + SPACE5-1 Infil 1, !- Name + SPACE5-1, !- Zone or ZoneList or Space or SpaceList Name + INFIL-SCH, !- Schedule Name + flow/zone, !- Design Flow Rate Calculation Method + 0.031089, !- Design Flow Rate {m3/s} + , !- Flow per Zone Floor Area {m3/s-m2} + , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Air Changes per Hour {1/hr} + 0, !- Constant Term Coefficient + 0, !- Temperature Term Coefficient + 0.2237, !- Velocity Term Coefficient + 0; !- Velocity Squared Term Coefficient + + People, + SPACE5-1 People 1, !- Name + SPACE5-1, !- Zone or ZoneList or Space or SpaceList Name + OCCUPY-1, !- Number of People Schedule Name + people, !- Number of People Calculation Method + 20, !- Number of People + , !- People per Floor Area {person/m2} + , !- Floor Area per Person {m2/person} + 0.3, !- Fraction Radiant + , !- Sensible Heat Fraction + ActSchd; !- Activity Level Schedule Name + + Lights, + SPACE5-1 Lights 1, !- Name + SPACE5-1, !- Zone or ZoneList or Space or SpaceList Name + LIGHTS-1, !- Schedule Name + LightingLevel, !- Design Level Calculation Method + 2964, !- Lighting Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0.2, !- Return Air Fraction + 0.59, !- Fraction Radiant + 0.2, !- Fraction Visible + 0, !- Fraction Replaceable + GeneralLights; !- End-Use Subcategory + + ElectricEquipment, + SPACE5-1 ElecEq 1, !- Name + SPACE5-1, !- Zone or ZoneList or Space or SpaceList Name + EQUIP-1, !- Schedule Name + EquipmentLevel, !- Design Level Calculation Method + 1976, !- Design Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0, !- Fraction Latent + 0.3, !- Fraction Radiant + 0; !- Fraction Lost + + BuildingSurface:Detailed, + C5-1, !- Name + CEILING, !- Surface Type + CLNG-1, !- Construction Name + SPACE5-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + C5-1P, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,3.7,2.4, !- X,Y,Z ==> Vertex 2 {m} + 26.8,3.7,2.4, !- X,Y,Z ==> Vertex 3 {m} + 26.8,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + F5-1, !- Name + FLOOR, !- Surface Type + FLOOR-SLAB-1, !- Construction Name + SPACE5-1, !- Zone Name + , !- Space Name + Ground, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 1 {m} + 26.8,3.7,0.0, !- X,Y,Z ==> Vertex 2 {m} + 3.7,3.7,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,11.6,0.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB51, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + SPACE5-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB15, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,3.7,0.0, !- X,Y,Z ==> Vertex 2 {m} + 26.8,3.7,0.0, !- X,Y,Z ==> Vertex 3 {m} + 26.8,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB52, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + SPACE5-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB25, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 26.8,3.7,0.0, !- X,Y,Z ==> Vertex 2 {m} + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 3 {m} + 26.8,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB53, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + SPACE5-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB35, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 3.7,11.6,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB54, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + SPACE5-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB45, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 3.7,3.7,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + Sizing:Parameters, + 1.3, !- Heating Sizing Factor + 1.3, !- Cooling Sizing Factor + ; !- Timesteps in Averaging Window + + Sizing:Zone, + SPACE1-1, !- Zone or ZoneList Name + SupplyAirTemperature, !- Zone Cooling Design Supply Air Temperature Input Method + 14., !- Zone Cooling Design Supply Air Temperature {C} + , !- Zone Cooling Design Supply Air Temperature Difference {deltaC} + SupplyAirTemperature, !- Zone Heating Design Supply Air Temperature Input Method + 50., !- Zone Heating Design Supply Air Temperature {C} + , !- Zone Heating Design Supply Air Temperature Difference {deltaC} + 0.009, !- Zone Cooling Design Supply Air Humidity Ratio {kgWater/kgDryAir} + 0.004, !- Zone Heating Design Supply Air Humidity Ratio {kgWater/kgDryAir} + SZ DSOA SPACE1-1, !- Design Specification Outdoor Air Object Name + 0.0, !- Zone Heating Sizing Factor + 0.0, !- Zone Cooling Sizing Factor + DesignDay, !- Cooling Design Air Flow Method + 0, !- Cooling Design Air Flow Rate {m3/s} + , !- Cooling Minimum Air Flow per Zone Floor Area {m3/s-m2} + , !- Cooling Minimum Air Flow {m3/s} + , !- Cooling Minimum Air Flow Fraction + DesignDay, !- Heating Design Air Flow Method + 0, !- Heating Design Air Flow Rate {m3/s} + , !- Heating Maximum Air Flow per Zone Floor Area {m3/s-m2} + , !- Heating Maximum Air Flow {m3/s} + , !- Heating Maximum Air Flow Fraction + , !- Design Specification Zone Air Distribution Object Name + No, !- Account for Dedicated Outdoor Air System + NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy + autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} + autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + + DesignSpecification:OutdoorAir, + SZ DSOA SPACE1-1, !- Name + flow/person, !- Outdoor Air Method + 0.00944, !- Outdoor Air Flow per Person {m3/s-person} + 0.0, !- Outdoor Air Flow per Zone Floor Area {m3/s-m2} + 0.0; !- Outdoor Air Flow per Zone {m3/s} + + Sizing:Zone, + SPACE2-1, !- Zone or ZoneList Name + SupplyAirTemperature, !- Zone Cooling Design Supply Air Temperature Input Method + 14., !- Zone Cooling Design Supply Air Temperature {C} + , !- Zone Cooling Design Supply Air Temperature Difference {deltaC} + SupplyAirTemperature, !- Zone Heating Design Supply Air Temperature Input Method + 50., !- Zone Heating Design Supply Air Temperature {C} + , !- Zone Heating Design Supply Air Temperature Difference {deltaC} + 0.009, !- Zone Cooling Design Supply Air Humidity Ratio {kgWater/kgDryAir} + 0.004, !- Zone Heating Design Supply Air Humidity Ratio {kgWater/kgDryAir} + SZ DSOA SPACE2-1, !- Design Specification Outdoor Air Object Name + 0.0, !- Zone Heating Sizing Factor + 0.0, !- Zone Cooling Sizing Factor + DesignDay, !- Cooling Design Air Flow Method + 0, !- Cooling Design Air Flow Rate {m3/s} + , !- Cooling Minimum Air Flow per Zone Floor Area {m3/s-m2} + , !- Cooling Minimum Air Flow {m3/s} + , !- Cooling Minimum Air Flow Fraction + DesignDay, !- Heating Design Air Flow Method + 0, !- Heating Design Air Flow Rate {m3/s} + , !- Heating Maximum Air Flow per Zone Floor Area {m3/s-m2} + , !- Heating Maximum Air Flow {m3/s} + , !- Heating Maximum Air Flow Fraction + , !- Design Specification Zone Air Distribution Object Name + No, !- Account for Dedicated Outdoor Air System + NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy + autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} + autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + + DesignSpecification:OutdoorAir, + SZ DSOA SPACE2-1, !- Name + flow/person, !- Outdoor Air Method + 0.00944, !- Outdoor Air Flow per Person {m3/s-person} + 0.0, !- Outdoor Air Flow per Zone Floor Area {m3/s-m2} + 0.0; !- Outdoor Air Flow per Zone {m3/s} + + Sizing:Zone, + SPACE3-1, !- Zone or ZoneList Name + SupplyAirTemperature, !- Zone Cooling Design Supply Air Temperature Input Method + 14., !- Zone Cooling Design Supply Air Temperature {C} + , !- Zone Cooling Design Supply Air Temperature Difference {deltaC} + SupplyAirTemperature, !- Zone Heating Design Supply Air Temperature Input Method + 50., !- Zone Heating Design Supply Air Temperature {C} + , !- Zone Heating Design Supply Air Temperature Difference {deltaC} + 0.009, !- Zone Cooling Design Supply Air Humidity Ratio {kgWater/kgDryAir} + 0.004, !- Zone Heating Design Supply Air Humidity Ratio {kgWater/kgDryAir} + SZ DSOA SPACE3-1, !- Design Specification Outdoor Air Object Name + 0.0, !- Zone Heating Sizing Factor + 0.0, !- Zone Cooling Sizing Factor + DesignDay, !- Cooling Design Air Flow Method + 0, !- Cooling Design Air Flow Rate {m3/s} + , !- Cooling Minimum Air Flow per Zone Floor Area {m3/s-m2} + , !- Cooling Minimum Air Flow {m3/s} + , !- Cooling Minimum Air Flow Fraction + DesignDay, !- Heating Design Air Flow Method + 0, !- Heating Design Air Flow Rate {m3/s} + , !- Heating Maximum Air Flow per Zone Floor Area {m3/s-m2} + , !- Heating Maximum Air Flow {m3/s} + , !- Heating Maximum Air Flow Fraction + , !- Design Specification Zone Air Distribution Object Name + No, !- Account for Dedicated Outdoor Air System + NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy + autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} + autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + + DesignSpecification:OutdoorAir, + SZ DSOA SPACE3-1, !- Name + flow/person, !- Outdoor Air Method + 0.00944, !- Outdoor Air Flow per Person {m3/s-person} + 0.0, !- Outdoor Air Flow per Zone Floor Area {m3/s-m2} + 0.0; !- Outdoor Air Flow per Zone {m3/s} + + Sizing:Zone, + SPACE4-1, !- Zone or ZoneList Name + SupplyAirTemperature, !- Zone Cooling Design Supply Air Temperature Input Method + 14., !- Zone Cooling Design Supply Air Temperature {C} + , !- Zone Cooling Design Supply Air Temperature Difference {deltaC} + SupplyAirTemperature, !- Zone Heating Design Supply Air Temperature Input Method + 50., !- Zone Heating Design Supply Air Temperature {C} + , !- Zone Heating Design Supply Air Temperature Difference {deltaC} + 0.009, !- Zone Cooling Design Supply Air Humidity Ratio {kgWater/kgDryAir} + 0.004, !- Zone Heating Design Supply Air Humidity Ratio {kgWater/kgDryAir} + SZ DSOA SPACE4-1, !- Design Specification Outdoor Air Object Name + 0.0, !- Zone Heating Sizing Factor + 0.0, !- Zone Cooling Sizing Factor + DesignDay, !- Cooling Design Air Flow Method + 0, !- Cooling Design Air Flow Rate {m3/s} + , !- Cooling Minimum Air Flow per Zone Floor Area {m3/s-m2} + , !- Cooling Minimum Air Flow {m3/s} + , !- Cooling Minimum Air Flow Fraction + DesignDay, !- Heating Design Air Flow Method + 0, !- Heating Design Air Flow Rate {m3/s} + , !- Heating Maximum Air Flow per Zone Floor Area {m3/s-m2} + , !- Heating Maximum Air Flow {m3/s} + , !- Heating Maximum Air Flow Fraction + , !- Design Specification Zone Air Distribution Object Name + No, !- Account for Dedicated Outdoor Air System + NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy + autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} + autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + + DesignSpecification:OutdoorAir, + SZ DSOA SPACE4-1, !- Name + flow/person, !- Outdoor Air Method + 0.00944, !- Outdoor Air Flow per Person {m3/s-person} + 0.0, !- Outdoor Air Flow per Zone Floor Area {m3/s-m2} + 0.0; !- Outdoor Air Flow per Zone {m3/s} + + Sizing:Zone, + SPACE5-1, !- Zone or ZoneList Name + SupplyAirTemperature, !- Zone Cooling Design Supply Air Temperature Input Method + 14., !- Zone Cooling Design Supply Air Temperature {C} + , !- Zone Cooling Design Supply Air Temperature Difference {deltaC} + SupplyAirTemperature, !- Zone Heating Design Supply Air Temperature Input Method + 50., !- Zone Heating Design Supply Air Temperature {C} + , !- Zone Heating Design Supply Air Temperature Difference {deltaC} + 0.009, !- Zone Cooling Design Supply Air Humidity Ratio {kgWater/kgDryAir} + 0.004, !- Zone Heating Design Supply Air Humidity Ratio {kgWater/kgDryAir} + SZ DSOA SPACE5-1, !- Design Specification Outdoor Air Object Name + 0.0, !- Zone Heating Sizing Factor + 0.0, !- Zone Cooling Sizing Factor + DesignDay, !- Cooling Design Air Flow Method + 0, !- Cooling Design Air Flow Rate {m3/s} + , !- Cooling Minimum Air Flow per Zone Floor Area {m3/s-m2} + , !- Cooling Minimum Air Flow {m3/s} + , !- Cooling Minimum Air Flow Fraction + DesignDay, !- Heating Design Air Flow Method + 0, !- Heating Design Air Flow Rate {m3/s} + , !- Heating Maximum Air Flow per Zone Floor Area {m3/s-m2} + , !- Heating Maximum Air Flow {m3/s} + , !- Heating Maximum Air Flow Fraction + , !- Design Specification Zone Air Distribution Object Name + No, !- Account for Dedicated Outdoor Air System + NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy + autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} + autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + + DesignSpecification:OutdoorAir, + SZ DSOA SPACE5-1, !- Name + flow/person, !- Outdoor Air Method + 0.00944, !- Outdoor Air Flow per Person {m3/s-person} + 0.0, !- Outdoor Air Flow per Zone Floor Area {m3/s-m2} + 0.0; !- Outdoor Air Flow per Zone {m3/s} + + Sizing:System, + VAV Sys 1, !- AirLoop Name + sensible, !- Type of Load to Size On + autosize, !- Design Outdoor Air Flow Rate {m3/s} + 0.3, !- Central Heating Maximum System Air Flow Ratio + 7.0, !- Preheat Design Temperature {C} + 0.008, !- Preheat Design Humidity Ratio {kgWater/kgDryAir} + 11.0, !- Precool Design Temperature {C} + 0.008, !- Precool Design Humidity Ratio {kgWater/kgDryAir} + 12.8, !- Central Cooling Design Supply Air Temperature {C} + 16.7, !- Central Heating Design Supply Air Temperature {C} + noncoincident, !- Type of Zone Sum to Use + no, !- 100% Outdoor Air in Cooling + no, !- 100% Outdoor Air in Heating + 0.008, !- Central Cooling Design Supply Air Humidity Ratio {kgWater/kgDryAir} + 0.008, !- Central Heating Design Supply Air Humidity Ratio {kgWater/kgDryAir} + DesignDay, !- Cooling Supply Air Flow Rate Method + 0, !- Cooling Supply Air Flow Rate {m3/s} + , !- Cooling Supply Air Flow Rate Per Floor Area {m3/s-m2} + , !- Cooling Fraction of Autosized Cooling Supply Air Flow Rate + , !- Cooling Supply Air Flow Rate Per Unit Cooling Capacity {m3/s-W} + DesignDay, !- Heating Supply Air Flow Rate Method + 0, !- Heating Supply Air Flow Rate {m3/s} + , !- Heating Supply Air Flow Rate Per Floor Area {m3/s-m2} + , !- Heating Fraction of Autosized Heating Supply Air Flow Rate + , !- Heating Fraction of Autosized Cooling Supply Air Flow Rate + , !- Heating Supply Air Flow Rate Per Unit Heating Capacity {m3/s-W} + , !- System Outdoor Air Method + 1.0, !- Zone Maximum Outdoor Air Fraction {dimensionless} + CoolingDesignCapacity, !- Cooling Design Capacity Method + autosize, !- Cooling Design Capacity {W} + , !- Cooling Design Capacity Per Floor Area {W/m2} + , !- Fraction of Autosized Cooling Design Capacity + HeatingDesignCapacity, !- Heating Design Capacity Method + autosize, !- Heating Design Capacity {W} + , !- Heating Design Capacity Per Floor Area {W/m2} + , !- Fraction of Autosized Heating Design Capacity + VAV; !- Central Cooling Capacity Control Method + + Sizing:Plant, + Hot Water Loop, !- Plant or Condenser Loop Name + heating, !- Loop Type + 82., !- Design Loop Exit Temperature {C} + 11; !- Loop Design Temperature Difference {deltaC} + + Sizing:Plant, + Chilled Water Loop, !- Plant or Condenser Loop Name + cooling, !- Loop Type + 7.22, !- Design Loop Exit Temperature {C} + 6.67; !- Loop Design Temperature Difference {deltaC} + + Sizing:Plant, + Condenser Water Loop, !- Plant or Condenser Loop Name + condenser, !- Loop Type + 29.4, !- Design Loop Exit Temperature {C} + 5.6; !- Loop Design Temperature Difference {deltaC} + + OutdoorAir:NodeList, + OutsideAirInletNodes; !- Node or NodeList Name 1 + + NodeList, + OutsideAirInletNodes, !- Name + Outside Air Inlet Node 1;!- Node 1 Name + + NodeList, + SPACE1-1 In Nodes, !- Name + SPACE1-1 In Node; !- Node 1 Name + + NodeList, + SPACE2-1 In Nodes, !- Name + SPACE2-1 In Node; !- Node 1 Name + + NodeList, + SPACE3-1 In Nodes, !- Name + SPACE3-1 In Node; !- Node 1 Name + + NodeList, + SPACE4-1 In Nodes, !- Name + SPACE4-1 In Node; !- Node 1 Name + + NodeList, + SPACE5-1 In Nodes, !- Name + SPACE5-1 In Node; !- Node 1 Name + + ZoneHVAC:EquipmentConnections, + SPACE1-1, !- Zone Name + SPACE1-1 Eq, !- Zone Conditioning Equipment List Name + SPACE1-1 In Nodes, !- Zone Air Inlet Node or NodeList Name + , !- Zone Air Exhaust Node or NodeList Name + SPACE1-1 Node, !- Zone Air Node Name + SPACE1-1 Out Node; !- Zone Return Air Node or NodeList Name + + ZoneHVAC:EquipmentConnections, + SPACE2-1, !- Zone Name + SPACE2-1 Eq, !- Zone Conditioning Equipment List Name + SPACE2-1 In Nodes, !- Zone Air Inlet Node or NodeList Name + , !- Zone Air Exhaust Node or NodeList Name + SPACE2-1 Node, !- Zone Air Node Name + SPACE2-1 Out Node; !- Zone Return Air Node or NodeList Name + + ZoneHVAC:EquipmentConnections, + SPACE3-1, !- Zone Name + SPACE3-1 Eq, !- Zone Conditioning Equipment List Name + SPACE3-1 In Nodes, !- Zone Air Inlet Node or NodeList Name + , !- Zone Air Exhaust Node or NodeList Name + SPACE3-1 Node, !- Zone Air Node Name + SPACE3-1 Out Node; !- Zone Return Air Node or NodeList Name + + ZoneHVAC:EquipmentConnections, + SPACE4-1, !- Zone Name + SPACE4-1 Eq, !- Zone Conditioning Equipment List Name + SPACE4-1 In Nodes, !- Zone Air Inlet Node or NodeList Name + , !- Zone Air Exhaust Node or NodeList Name + SPACE4-1 Node, !- Zone Air Node Name + SPACE4-1 Out Node; !- Zone Return Air Node or NodeList Name + + ZoneHVAC:EquipmentConnections, + SPACE5-1, !- Zone Name + SPACE5-1 Eq, !- Zone Conditioning Equipment List Name + SPACE5-1 In Nodes, !- Zone Air Inlet Node or NodeList Name + PIU Inlet, !- Zone Air Exhaust Node or NodeList Name + SPACE5-1 Node, !- Zone Air Node Name + SPACE5-1 Out Node; !- Zone Return Air Node or NodeList Name + + ZoneControl:Thermostat, + SPACE1-1 Control, !- Name + SPACE1-1, !- Zone or ZoneList Name + Zone Control Type Sched, !- Control Type Schedule Name + ThermostatSetpoint:SingleCooling, !- Control 1 Object Type + CoolingSetPoint, !- Control 1 Name + ThermostatSetpoint:SingleHeating, !- Control 2 Object Type + HeatingSetpoint, !- Control 2 Name + ThermostatSetpoint:DualSetpoint, !- Control 3 Object Type + DualSetPoint; !- Control 3 Name + + ZoneControl:Thermostat, + SPACE2-1 Control, !- Name + SPACE2-1, !- Zone or ZoneList Name + Zone Control Type Sched, !- Control Type Schedule Name + ThermostatSetpoint:SingleCooling, !- Control 1 Object Type + CoolingSetPoint, !- Control 1 Name + ThermostatSetpoint:SingleHeating, !- Control 2 Object Type + HeatingSetpoint, !- Control 2 Name + ThermostatSetpoint:DualSetpoint, !- Control 3 Object Type + DualSetPoint; !- Control 3 Name + + ZoneControl:Thermostat, + SPACE3-1 Control, !- Name + SPACE3-1, !- Zone or ZoneList Name + Zone Control Type Sched, !- Control Type Schedule Name + ThermostatSetpoint:SingleCooling, !- Control 1 Object Type + CoolingSetPoint, !- Control 1 Name + ThermostatSetpoint:SingleHeating, !- Control 2 Object Type + HeatingSetpoint, !- Control 2 Name + ThermostatSetpoint:DualSetpoint, !- Control 3 Object Type + DualSetPoint; !- Control 3 Name + + ZoneControl:Thermostat, + SPACE4-1 Control, !- Name + SPACE4-1, !- Zone or ZoneList Name + Zone Control Type Sched, !- Control Type Schedule Name + ThermostatSetpoint:SingleCooling, !- Control 1 Object Type + CoolingSetPoint, !- Control 1 Name + ThermostatSetpoint:SingleHeating, !- Control 2 Object Type + HeatingSetpoint, !- Control 2 Name + ThermostatSetpoint:DualSetpoint, !- Control 3 Object Type + DualSetPoint; !- Control 3 Name + + ZoneControl:Thermostat, + SPACE5-1 Control, !- Name + SPACE5-1, !- Zone or ZoneList Name + Zone Control Type Sched, !- Control Type Schedule Name + ThermostatSetpoint:SingleCooling, !- Control 1 Object Type + CoolingSetPoint, !- Control 1 Name + ThermostatSetpoint:SingleHeating, !- Control 2 Object Type + HeatingSetpoint, !- Control 2 Name + ThermostatSetpoint:DualSetpoint, !- Control 3 Object Type + DualSetPoint; !- Control 3 Name + + ThermostatSetpoint:SingleHeating, + HeatingSetpoint, !- Name + Htg-SetP-Sch; !- Setpoint Temperature Schedule Name + + ThermostatSetpoint:SingleCooling, + CoolingSetpoint, !- Name + Clg-SetP-Sch; !- Setpoint Temperature Schedule Name + + ThermostatSetpoint:DualSetpoint, + DualSetPoint, !- Name + Htg-SetP-Sch, !- Heating Setpoint Temperature Schedule Name + Clg-SetP-Sch; !- Cooling Setpoint Temperature Schedule Name + + ZoneHVAC:EquipmentList, + SPACE1-1 Eq, !- Name + SequentialLoad, !- Load Distribution Scheme + ZoneHVAC:AirDistributionUnit, !- Zone Equipment 1 Object Type + SPACE1-1 ATU, !- Zone Equipment 1 Name + 1, !- Zone Equipment 1 Cooling Sequence + 1, !- Zone Equipment 1 Heating or No-Load Sequence + , !- Zone Equipment 1 Sequential Cooling Fraction Schedule Name + ; !- Zone Equipment 1 Sequential Heating Fraction Schedule Name + + ZoneHVAC:EquipmentList, + SPACE2-1 Eq, !- Name + SequentialLoad, !- Load Distribution Scheme + ZoneHVAC:AirDistributionUnit, !- Zone Equipment 1 Object Type + SPACE2-1 ATU, !- Zone Equipment 1 Name + 1, !- Zone Equipment 1 Cooling Sequence + 1, !- Zone Equipment 1 Heating or No-Load Sequence + , !- Zone Equipment 1 Sequential Cooling Fraction Schedule Name + ; !- Zone Equipment 1 Sequential Heating Fraction Schedule Name + + ZoneHVAC:EquipmentList, + SPACE3-1 Eq, !- Name + SequentialLoad, !- Load Distribution Scheme + ZoneHVAC:AirDistributionUnit, !- Zone Equipment 1 Object Type + SPACE3-1 ATU, !- Zone Equipment 1 Name + 1, !- Zone Equipment 1 Cooling Sequence + 1, !- Zone Equipment 1 Heating or No-Load Sequence + , !- Zone Equipment 1 Sequential Cooling Fraction Schedule Name + ; !- Zone Equipment 1 Sequential Heating Fraction Schedule Name + + ZoneHVAC:EquipmentList, + SPACE4-1 Eq, !- Name + SequentialLoad, !- Load Distribution Scheme + ZoneHVAC:AirDistributionUnit, !- Zone Equipment 1 Object Type + SPACE4-1 ATU, !- Zone Equipment 1 Name + 1, !- Zone Equipment 1 Cooling Sequence + 1, !- Zone Equipment 1 Heating or No-Load Sequence + , !- Zone Equipment 1 Sequential Cooling Fraction Schedule Name + ; !- Zone Equipment 1 Sequential Heating Fraction Schedule Name + + ZoneHVAC:EquipmentList, + SPACE5-1 Eq, !- Name + SequentialLoad, !- Load Distribution Scheme + ZoneHVAC:AirDistributionUnit, !- Zone Equipment 1 Object Type + SPACE5-1 ATU, !- Zone Equipment 1 Name + 1, !- Zone Equipment 1 Cooling Sequence + 1, !- Zone Equipment 1 Heating or No-Load Sequence + , !- Zone Equipment 1 Sequential Cooling Fraction Schedule Name + ; !- Zone Equipment 1 Sequential Heating Fraction Schedule Name + + ZoneHVAC:AirDistributionUnit, + SPACE1-1 ATU, !- Name + SPACE1-1 In Node, !- Air Distribution Unit Outlet Node Name + AirTerminal:SingleDuct:ParallelPIU:Reheat, !- Air Terminal Object Type + SPACE1-1 VAV Reheat, !- Air Terminal Name + 0.0, !- Nominal Upstream Leakage Fraction + 0.0; !- Constant Downstream Leakage Fraction + + ZoneHVAC:AirDistributionUnit, + SPACE2-1 ATU, !- Name + SPACE2-1 In Node, !- Air Distribution Unit Outlet Node Name + AirTerminal:SingleDuct:VAV:Reheat, !- Air Terminal Object Type + SPACE2-1 VAV Reheat, !- Air Terminal Name + 0.00, !- Nominal Upstream Leakage Fraction + 0.00; !- Constant Downstream Leakage Fraction + + ZoneHVAC:AirDistributionUnit, + SPACE3-1 ATU, !- Name + SPACE3-1 In Node, !- Air Distribution Unit Outlet Node Name + AirTerminal:SingleDuct:VAV:Reheat, !- Air Terminal Object Type + SPACE3-1 VAV Reheat, !- Air Terminal Name + 0.00, !- Nominal Upstream Leakage Fraction + 0.00; !- Constant Downstream Leakage Fraction + + ZoneHVAC:AirDistributionUnit, + SPACE4-1 ATU, !- Name + SPACE4-1 In Node, !- Air Distribution Unit Outlet Node Name + AirTerminal:SingleDuct:VAV:Reheat, !- Air Terminal Object Type + SPACE4-1 VAV Reheat, !- Air Terminal Name + 0.00, !- Nominal Upstream Leakage Fraction + 0.00; !- Constant Downstream Leakage Fraction + + ZoneHVAC:AirDistributionUnit, + SPACE5-1 ATU, !- Name + SPACE5-1 In Node, !- Air Distribution Unit Outlet Node Name + AirTerminal:SingleDuct:VAV:Reheat, !- Air Terminal Object Type + SPACE5-1 VAV Reheat, !- Air Terminal Name + 0.00, !- Nominal Upstream Leakage Fraction + 0.00; !- Constant Downstream Leakage Fraction + + AirTerminal:SingleDuct:ParallelPIU:Reheat, + SPACE1-1 VAV Reheat, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + autosize, !- Maximum Primary Air Flow Rate {m3/s} + 0.20913, !- Maximum Secondary Air Flow Rate {m3/s} + 0.26186, !- Minimum Primary Air Flow Fraction + 0, !- Fan On Flow Fraction + SPACE1-1 ATU In Node, !- Supply Air Inlet Node Name + PIU Inlet, !- Secondary Air Inlet Node Name + SPACE1-1 In Node, !- Air Outlet Node Name + SPACE1-1 PIU MIXER OUTLET, !- Reheat Coil Air Inlet Node Name + SPACE1-1 PIU MIXER, !- Zone Mixer Name + SPACE1-1 PIU FAN, !- Fan Name + Coil:Heating:Water, !- Reheat Coil Object Type + SPACE1-1 Zone Coil, !- Reheat Coil Name + Autosize, !- Maximum Hot Water or Steam Flow Rate {m3/s} + 0, !- Minimum Hot Water or Steam Flow Rate {m3/s} + 0.001, !- Convergence Tolerance + , !- Fan Control Type + , !- Minimum Fan Turn Down Ratio {dimensionless} + , !- Heating Control Type + , !- Design Heating Discharge Air Temperature {C} + , !- High Limit Heating Discharge Air Temperature {C} + high_0p25_in_wc; !- Backdraft Damper Leakage Fraction Curve Name + + AirLoopHVAC:ZoneMixer, + SPACE1-1 PIU MIXER, !- Name + SPACE1-1 PIU Mixer Outlet, !- Outlet Node Name + SPACE1-1 PIU FAN Outlet, !- Inlet 1 Node Name + SPACE1-1 ATU In Node; !- Inlet 2 Node Name + + Fan:ConstantVolume, + SPACE1-1 PIU FAN, !- Name + , !- Availability Schedule Name + 0.7, !- Fan Total Efficiency + 300, !- Pressure Rise {Pa} + AutoSize, !- Maximum Flow Rate {m3/s} + 0.9, !- Motor Efficiency + 1, !- Motor In Airstream Fraction + PIU Inlet, !- Air Inlet Node Name + SPACE1-1 PIU FAN Outlet; !- Air Outlet Node Name + + Curve:Linear, + low_0p25_in_wc, !- Name + -.006083039, !- Coefficient1 Constant + 0.036612602, !- Coefficient2 x + 0.63, !- Minimum Value of x + 1, !- Maximum Value of x + , !- Minimum Curve Output + , !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + + Curve:Linear, + medium_0p25_in_wc, !- Name + 0.039928941, !- Coefficient1 Constant + 0.009555789, !- Coefficient2 x + 0.63, !- Minimum Value of x + 1, !- Maximum Value of x + , !- Minimum Curve Output + , !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + + Curve:Linear, + high_0p25_in_wc, !- Name + 0.117130811, !- Coefficient1 Constant + -.001792284, !- Coefficient2 x + 0.63, !- Minimum Value of x + 1, !- Maximum Value of x + , !- Minimum Curve Output + , !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + + Curve:Linear, + low_0p50_in_wc, !- Name + -.023960304, !- Coefficient1 Constant + 0.078345929, !- Coefficient2 x + 0.51, !- Minimum Value of x + 1, !- Maximum Value of x + , !- Minimum Curve Output + , !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + + Curve:Linear, + medium_0p50_in_wc, !- Name + 0.027345369, !- Coefficient1 Constant + 0.04614075, !- Coefficient2 x + 0.5, !- Minimum Value of x + 1, !- Maximum Value of x + , !- Minimum Curve Output + , !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + + Curve:Linear, + high_0p50_in_wc, !- Name + 0.094531603, !- Coefficient1 Constant + 0.07094517, !- Coefficient2 x + 0.5, !- Minimum Value of x + 1, !- Maximum Value of x + , !- Minimum Curve Output + , !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + + AirTerminal:SingleDuct:VAV:Reheat, + SPACE2-1 VAV Reheat, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + SPACE2-1 Zone Coil Air In Node, !- Damper Air Outlet Node Name + SPACE2-1 ATU In Node, !- Air Inlet Node Name + autosize, !- Maximum Air Flow Rate {m3/s} + , !- Zone Minimum Air Flow Input Method + , !- Constant Minimum Air Flow Fraction + , !- Fixed Minimum Air Flow Rate {m3/s} + , !- Minimum Air Flow Fraction Schedule Name + Coil:Heating:Water, !- Reheat Coil Object Type + SPACE2-1 Zone Coil, !- Reheat Coil Name + autosize, !- Maximum Hot Water or Steam Flow Rate {m3/s} + 0.0, !- Minimum Hot Water or Steam Flow Rate {m3/s} + SPACE2-1 In Node, !- Air Outlet Node Name + 0.001, !- Convergence Tolerance + , !- Damper Heating Action + , !- Maximum Flow per Zone Floor Area During Reheat {m3/s-m2} + ; !- Maximum Flow Fraction During Reheat + + AirTerminal:SingleDuct:VAV:Reheat, + SPACE3-1 VAV Reheat, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + SPACE3-1 Zone Coil Air In Node, !- Damper Air Outlet Node Name + SPACE3-1 ATU In Node, !- Air Inlet Node Name + autosize, !- Maximum Air Flow Rate {m3/s} + , !- Zone Minimum Air Flow Input Method + , !- Constant Minimum Air Flow Fraction + , !- Fixed Minimum Air Flow Rate {m3/s} + , !- Minimum Air Flow Fraction Schedule Name + Coil:Heating:Water, !- Reheat Coil Object Type + SPACE3-1 Zone Coil, !- Reheat Coil Name + autosize, !- Maximum Hot Water or Steam Flow Rate {m3/s} + 0.0, !- Minimum Hot Water or Steam Flow Rate {m3/s} + SPACE3-1 In Node, !- Air Outlet Node Name + 0.001, !- Convergence Tolerance + , !- Damper Heating Action + , !- Maximum Flow per Zone Floor Area During Reheat {m3/s-m2} + ; !- Maximum Flow Fraction During Reheat + + AirTerminal:SingleDuct:VAV:Reheat, + SPACE4-1 VAV Reheat, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + SPACE4-1 Zone Coil Air In Node, !- Damper Air Outlet Node Name + SPACE4-1 ATU In Node, !- Air Inlet Node Name + autosize, !- Maximum Air Flow Rate {m3/s} + , !- Zone Minimum Air Flow Input Method + , !- Constant Minimum Air Flow Fraction + , !- Fixed Minimum Air Flow Rate {m3/s} + , !- Minimum Air Flow Fraction Schedule Name + Coil:Heating:Water, !- Reheat Coil Object Type + SPACE4-1 Zone Coil, !- Reheat Coil Name + autosize, !- Maximum Hot Water or Steam Flow Rate {m3/s} + 0.0, !- Minimum Hot Water or Steam Flow Rate {m3/s} + SPACE4-1 In Node, !- Air Outlet Node Name + 0.001, !- Convergence Tolerance + , !- Damper Heating Action + , !- Maximum Flow per Zone Floor Area During Reheat {m3/s-m2} + ; !- Maximum Flow Fraction During Reheat + + AirTerminal:SingleDuct:VAV:Reheat, + SPACE5-1 VAV Reheat, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + SPACE5-1 Zone Coil Air In Node, !- Damper Air Outlet Node Name + SPACE5-1 ATU In Node, !- Air Inlet Node Name + autosize, !- Maximum Air Flow Rate {m3/s} + , !- Zone Minimum Air Flow Input Method + , !- Constant Minimum Air Flow Fraction + , !- Fixed Minimum Air Flow Rate {m3/s} + , !- Minimum Air Flow Fraction Schedule Name + Coil:Heating:Water, !- Reheat Coil Object Type + SPACE5-1 Zone Coil, !- Reheat Coil Name + autosize, !- Maximum Hot Water or Steam Flow Rate {m3/s} + 0.0, !- Minimum Hot Water or Steam Flow Rate {m3/s} + SPACE5-1 In Node, !- Air Outlet Node Name + 0.001, !- Convergence Tolerance + , !- Damper Heating Action + , !- Maximum Flow per Zone Floor Area During Reheat {m3/s-m2} + ; !- Maximum Flow Fraction During Reheat + + Coil:Heating:Water, + SPACE1-1 Zone Coil, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + , !- U-Factor Times Area Value {W/K} + , !- Maximum Water Flow Rate {m3/s} + SPACE1-1 Zone Coil Water In Node, !- Water Inlet Node Name + SPACE1-1 Zone Coil Water Out Node, !- Water Outlet Node Name + SPACE1-1 PIU Mixer Outlet, !- Air Inlet Node Name + SPACE1-1 In Node, !- Air Outlet Node Name + NominalCapacity, !- Performance Input Method + 10000., !- Rated Capacity {W} + 82.2, !- Rated Inlet Water Temperature {C} + 16.6, !- Rated Inlet Air Temperature {C} + 71.1, !- Rated Outlet Water Temperature {C} + 32.2, !- Rated Outlet Air Temperature {C} + ; !- Rated Ratio for Air and Water Convection + + Coil:Heating:Water, + SPACE2-1 Zone Coil, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + , !- U-Factor Times Area Value {W/K} + , !- Maximum Water Flow Rate {m3/s} + SPACE2-1 Zone Coil Water In Node, !- Water Inlet Node Name + SPACE2-1 Zone Coil Water Out Node, !- Water Outlet Node Name + SPACE2-1 Zone Coil Air In Node, !- Air Inlet Node Name + SPACE2-1 In Node, !- Air Outlet Node Name + NominalCapacity, !- Performance Input Method + 10000., !- Rated Capacity {W} + 82.2, !- Rated Inlet Water Temperature {C} + 16.6, !- Rated Inlet Air Temperature {C} + 71.1, !- Rated Outlet Water Temperature {C} + 32.2, !- Rated Outlet Air Temperature {C} + ; !- Rated Ratio for Air and Water Convection + + Coil:Heating:Water, + SPACE3-1 Zone Coil, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + , !- U-Factor Times Area Value {W/K} + , !- Maximum Water Flow Rate {m3/s} + SPACE3-1 Zone Coil Water In Node, !- Water Inlet Node Name + SPACE3-1 Zone Coil Water Out Node, !- Water Outlet Node Name + SPACE3-1 Zone Coil Air In Node, !- Air Inlet Node Name + SPACE3-1 In Node, !- Air Outlet Node Name + NominalCapacity, !- Performance Input Method + 10000., !- Rated Capacity {W} + 82.2, !- Rated Inlet Water Temperature {C} + 16.6, !- Rated Inlet Air Temperature {C} + 71.1, !- Rated Outlet Water Temperature {C} + 32.2, !- Rated Outlet Air Temperature {C} + ; !- Rated Ratio for Air and Water Convection + + Coil:Heating:Water, + SPACE4-1 Zone Coil, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + , !- U-Factor Times Area Value {W/K} + , !- Maximum Water Flow Rate {m3/s} + SPACE4-1 Zone Coil Water In Node, !- Water Inlet Node Name + SPACE4-1 Zone Coil Water Out Node, !- Water Outlet Node Name + SPACE4-1 Zone Coil Air In Node, !- Air Inlet Node Name + SPACE4-1 In Node, !- Air Outlet Node Name + NominalCapacity, !- Performance Input Method + 10000., !- Rated Capacity {W} + 82.2, !- Rated Inlet Water Temperature {C} + 16.6, !- Rated Inlet Air Temperature {C} + 71.1, !- Rated Outlet Water Temperature {C} + 32.2, !- Rated Outlet Air Temperature {C} + ; !- Rated Ratio for Air and Water Convection + + Coil:Heating:Water, + SPACE5-1 Zone Coil, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + , !- U-Factor Times Area Value {W/K} + , !- Maximum Water Flow Rate {m3/s} + SPACE5-1 Zone Coil Water In Node, !- Water Inlet Node Name + SPACE5-1 Zone Coil Water Out Node, !- Water Outlet Node Name + SPACE5-1 Zone Coil Air In Node, !- Air Inlet Node Name + SPACE5-1 In Node, !- Air Outlet Node Name + NominalCapacity, !- Performance Input Method + 10000., !- Rated Capacity {W} + 82.2, !- Rated Inlet Water Temperature {C} + 16.6, !- Rated Inlet Air Temperature {C} + 71.1, !- Rated Outlet Water Temperature {C} + 32.2, !- Rated Outlet Air Temperature {C} + ; !- Rated Ratio for Air and Water Convection + + AirLoopHVAC:ReturnPath, + ReturnAirPath1, !- Name + PLENUM-1 Out Node, !- Return Air Path Outlet Node Name + AirLoopHVAC:ReturnPlenum,!- Component 1 Object Type + Return-Plenum-1; !- Component 1 Name + + AirLoopHVAC:ReturnPlenum, + Return-Plenum-1, !- Name + PLENUM-1, !- Zone Name + PLENUM-1 Node, !- Zone Node Name + PLENUM-1 Out Node, !- Outlet Node Name + , !- Induced Air Outlet Node or NodeList Name + SPACE1-1 Out Node, !- Inlet 1 Node Name + SPACE2-1 Out Node, !- Inlet 2 Node Name + SPACE3-1 Out Node, !- Inlet 3 Node Name + SPACE4-1 Out Node, !- Inlet 4 Node Name + SPACE5-1 Out Node; !- Inlet 5 Node Name + + AirLoopHVAC:SupplyPath, + Zone Supply Air Path 1, !- Name + Zone Eq In Node, !- Supply Air Path Inlet Node Name + AirLoopHVAC:ZoneSplitter,!- Component 1 Object Type + Zone Supply Air Splitter 1; !- Component 1 Name + + AirLoopHVAC:ZoneSplitter, + Zone Supply Air Splitter 1, !- Name + Zone Eq In Node, !- Inlet Node Name + SPACE1-1 ATU In Node, !- Outlet 1 Node Name + SPACE2-1 ATU In Node, !- Outlet 2 Node Name + SPACE3-1 ATU In Node, !- Outlet 3 Node Name + SPACE4-1 ATU In Node, !- Outlet 4 Node Name + SPACE5-1 ATU In Node; !- Outlet 5 Node Name + + AirLoopHVAC, + VAV Sys 1, !- Name + VAV Sys 1 Controllers, !- Controller List Name + VAV Sys 1 Avail List, !- Availability Manager List Name + autosize, !- Design Supply Air Flow Rate {m3/s} + VAV Sys 1 Branches, !- Branch List Name + , !- Connector List Name + VAV Sys 1 Inlet Node, !- Supply Side Inlet Node Name + PLENUM-1 Out Node, !- Demand Side Outlet Node Name + Zone Eq In Node, !- Demand Side Inlet Node Names + VAV Sys 1 Outlet Node; !- Supply Side Outlet Node Names + + AirLoopHVAC:ControllerList, + VAV Sys 1 Controllers, !- Name + Controller:WaterCoil, !- Controller 1 Object Type + Central Cooling Coil Contoller 1, !- Controller 1 Name + Controller:WaterCoil, !- Controller 2 Object Type + Central Heating Coil Contoller 1; !- Controller 2 Name + + AvailabilityManagerAssignmentList, + VAV Sys 1 Avail List, !- Name + AvailabilityManager:Scheduled, !- Availability Manager 1 Object Type + VAV Sys 1 Avail; !- Availability Manager 1 Name + + AvailabilityManager:Scheduled, + VAV Sys 1 Avail, !- Name + FanAvailSched; !- Schedule Name + + BranchList, + VAV Sys 1 Branches, !- Name + VAV Sys 1 Main Branch; !- Branch 1 Name + + Branch, + VAV Sys 1 Main Branch, !- Name + , !- Pressure Drop Curve Name + AirLoopHVAC:OutdoorAirSystem, !- Component 1 Object Type + OA Sys 1, !- Component 1 Name + VAV Sys 1 Inlet Node, !- Component 1 Inlet Node Name + Mixed Air Node 1, !- Component 1 Outlet Node Name + Coil:Cooling:Water, !- Component 2 Object Type + Main Cooling Coil 1, !- Component 2 Name + Mixed Air Node 1, !- Component 2 Inlet Node Name + Main Cooling Coil 1 Outlet Node, !- Component 2 Outlet Node Name + Coil:Heating:Water, !- Component 3 Object Type + Main Heating Coil 1, !- Component 3 Name + Main Cooling Coil 1 Outlet Node, !- Component 3 Inlet Node Name + Main Heating Coil 1 Outlet Node, !- Component 3 Outlet Node Name + Fan:VariableVolume, !- Component 4 Object Type + Supply Fan 1, !- Component 4 Name + Main Heating Coil 1 Outlet Node, !- Component 4 Inlet Node Name + VAV Sys 1 Outlet Node; !- Component 4 Outlet Node Name + + AirLoopHVAC:OutdoorAirSystem, + OA Sys 1, !- Name + OA Sys 1 Controllers, !- Controller List Name + OA Sys 1 Equipment; !- Outdoor Air Equipment List Name + + AirLoopHVAC:ControllerList, + OA Sys 1 Controllers, !- Name + Controller:OutdoorAir, !- Controller 1 Object Type + OA Controller 1; !- Controller 1 Name + + AirLoopHVAC:OutdoorAirSystem:EquipmentList, + OA Sys 1 Equipment, !- Name + OutdoorAir:Mixer, !- Component 1 Object Type + OA Mixing Box 1; !- Component 1 Name + + OutdoorAir:Mixer, + OA Mixing Box 1, !- Name + Mixed Air Node 1, !- Mixed Air Node Name + Outside Air Inlet Node 1,!- Outdoor Air Stream Node Name + Relief Air Outlet Node 1,!- Relief Air Stream Node Name + VAV Sys 1 Inlet Node; !- Return Air Stream Node Name + + Coil:Cooling:Water, + Main Cooling Coil 1, !- Name + CoolingCoilAvailSched, !- Availability Schedule Name + autosize, !- Design Water Flow Rate {m3/s} + autosize, !- Design Air Flow Rate {m3/s} + autosize, !- Design Inlet Water Temperature {C} + autosize, !- Design Inlet Air Temperature {C} + autosize, !- Design Outlet Air Temperature {C} + autosize, !- Design Inlet Air Humidity Ratio {kgWater/kgDryAir} + autosize, !- Design Outlet Air Humidity Ratio {kgWater/kgDryAir} + Main Cooling Coil 1 Water Inlet Node, !- Water Inlet Node Name + Main Cooling Coil 1 Water Outlet Node, !- Water Outlet Node Name + Mixed Air Node 1, !- Air Inlet Node Name + Main Cooling Coil 1 Outlet Node, !- Air Outlet Node Name + SimpleAnalysis, !- Type of Analysis + CrossFlow; !- Heat Exchanger Configuration + + Coil:Heating:Water, + Main Heating Coil 1, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + autosize, !- U-Factor Times Area Value {W/K} + autosize, !- Maximum Water Flow Rate {m3/s} + Main Heating Coil 1 Water Inlet Node, !- Water Inlet Node Name + Main Heating Coil 1 Water Outlet Node, !- Water Outlet Node Name + Main Cooling Coil 1 Outlet Node, !- Air Inlet Node Name + Main Heating Coil 1 Outlet Node, !- Air Outlet Node Name + UFactorTimesAreaAndDesignWaterFlowRate, !- Performance Input Method + autosize, !- Rated Capacity {W} + 82.2, !- Rated Inlet Water Temperature {C} + 16.6, !- Rated Inlet Air Temperature {C} + 71.1, !- Rated Outlet Water Temperature {C} + 32.2, !- Rated Outlet Air Temperature {C} + ; !- Rated Ratio for Air and Water Convection + + Fan:VariableVolume, + Supply Fan 1, !- Name + FanAvailSched, !- Availability Schedule Name + 0.7, !- Fan Total Efficiency + 600.0, !- Pressure Rise {Pa} + autosize, !- Maximum Flow Rate {m3/s} + Fraction, !- Fan Power Minimum Flow Rate Input Method + 0.25, !- Fan Power Minimum Flow Fraction + , !- Fan Power Minimum Air Flow Rate {m3/s} + 0.9, !- Motor Efficiency + 1.0, !- Motor In Airstream Fraction + 0.35071223, !- Fan Power Coefficient 1 + 0.30850535, !- Fan Power Coefficient 2 + -0.54137364, !- Fan Power Coefficient 3 + 0.87198823, !- Fan Power Coefficient 4 + 0.000, !- Fan Power Coefficient 5 + Main Heating Coil 1 Outlet Node, !- Air Inlet Node Name + VAV Sys 1 Outlet Node; !- Air Outlet Node Name + + Controller:WaterCoil, + Central Cooling Coil Contoller 1, !- Name + Temperature, !- Control Variable + Reverse, !- Action + FLOW, !- Actuator Variable + Main Cooling Coil 1 Outlet Node, !- Sensor Node Name + Main Cooling Coil 1 Water Inlet Node, !- Actuator Node Name + 0.002, !- Controller Convergence Tolerance {deltaC} + autosize, !- Maximum Actuated Flow {m3/s} + 0.0; !- Minimum Actuated Flow {m3/s} + + Controller:OutdoorAir, + OA Controller 1, !- Name + Relief Air Outlet Node 1,!- Relief Air Outlet Node Name + VAV Sys 1 Inlet Node, !- Return Air Node Name + Mixed Air Node 1, !- Mixed Air Node Name + Outside Air Inlet Node 1,!- Actuator Node Name + autosize, !- Minimum Outdoor Air Flow Rate {m3/s} + autosize, !- Maximum Outdoor Air Flow Rate {m3/s} + FixedDryBulb, !- Economizer Control Type + ModulateFlow, !- Economizer Control Action Type + 19., !- Economizer Maximum Limit Dry-Bulb Temperature {C} + , !- Economizer Maximum Limit Enthalpy {J/kg} + , !- Economizer Maximum Limit Dewpoint Temperature {C} + , !- Electronic Enthalpy Limit Curve Name + 4., !- Economizer Minimum Limit Dry-Bulb Temperature {C} + NoLockout, !- Lockout Type + FixedMinimum, !- Minimum Limit Type + Min OA Sched; !- Minimum Outdoor Air Schedule Name + + Controller:WaterCoil, + Central Heating Coil Contoller 1, !- Name + Temperature, !- Control Variable + Normal, !- Action + FLOW, !- Actuator Variable + Main Heating Coil 1 Outlet Node, !- Sensor Node Name + Main Heating Coil 1 Water Inlet Node, !- Actuator Node Name + 0.002, !- Controller Convergence Tolerance {deltaC} + autosize, !- Maximum Actuated Flow {m3/s} + 0.0; !- Minimum Actuated Flow {m3/s} + + SetpointManager:Warmest, + Supply Air Temperature Manager 1, !- Name + Temperature, !- Control Variable + VAV Sys 1, !- HVAC Air Loop Name + 11.2, !- Minimum Setpoint Temperature {C} + 16., !- Maximum Setpoint Temperature {C} + MaximumTemperature, !- Strategy + Supply Air Temp Nodes 1; !- Setpoint Node or NodeList Name + + SetpointManager:MixedAir, + Mixed Air Temp Manager 1,!- Name + Temperature, !- Control Variable + VAV Sys 1 Outlet Node, !- Reference Setpoint Node Name + Main Heating Coil 1 Outlet Node, !- Fan Inlet Node Name + VAV Sys 1 Outlet Node, !- Fan Outlet Node Name + Main Branch SetPoint Node List; !- Setpoint Node or NodeList Name + + NodeList, + Main Branch SetPoint Node List, !- Name + Mixed Air Node 1, !- Node 1 Name + Main Cooling Coil 1 Outlet Node, !- Node 2 Name + Main Heating Coil 1 Outlet Node; !- Node 3 Name + + NodeList, + Supply Air Temp Nodes 1, !- Name + VAV Sys 1 Outlet Node; !- Node 1 Name + + PlantLoop, + Hot Water Loop, !- Name + Water, !- Fluid Type + , !- User Defined Fluid Type + Hot Loop Operation, !- Plant Equipment Operation Scheme Name + HW Supply Outlet Node, !- Loop Temperature Setpoint Node Name + 100, !- Maximum Loop Temperature {C} + 10, !- Minimum Loop Temperature {C} + autosize, !- Maximum Loop Flow Rate {m3/s} + 0.0, !- Minimum Loop Flow Rate {m3/s} + autocalculate, !- Plant Loop Volume {m3} + HW Supply Inlet Node, !- Plant Side Inlet Node Name + HW Supply Outlet Node, !- Plant Side Outlet Node Name + Heating Supply Side Branches, !- Plant Side Branch List Name + Heating Supply Side Connectors, !- Plant Side Connector List Name + HW Demand Inlet Node, !- Demand Side Inlet Node Name + HW Demand Outlet Node, !- Demand Side Outlet Node Name + Heating Demand Side Branches, !- Demand Side Branch List Name + Heating Demand Side Connectors, !- Demand Side Connector List Name + SequentialLoad; !- Load Distribution Scheme + + SetpointManager:Scheduled, + Hot Water Loop Setpoint Manager, !- Name + Temperature, !- Control Variable + HW Loop Temp Schedule, !- Schedule Name + Hot Water Loop Setpoint Node List; !- Setpoint Node or NodeList Name + + NodeList, + Hot Water Loop Setpoint Node List, !- Name + HW Supply Outlet Node; !- Node 1 Name + + BranchList, + Heating Supply Side Branches, !- Name + Heating Supply Inlet Branch, !- Branch 1 Name + Central Boiler Branch, !- Branch 2 Name + Heating Supply Bypass Branch, !- Branch 3 Name + Heating Supply Outlet Branch; !- Branch 4 Name + + ConnectorList, + Heating Supply Side Connectors, !- Name + Connector:Splitter, !- Connector 1 Object Type + Heating Supply Splitter, !- Connector 1 Name + Connector:Mixer, !- Connector 2 Object Type + Heating Supply Mixer; !- Connector 2 Name + + Branch, + Heating Supply Inlet Branch, !- Name + , !- Pressure Drop Curve Name + Pump:VariableSpeed, !- Component 1 Object Type + HW Circ Pump, !- Component 1 Name + HW Supply Inlet Node, !- Component 1 Inlet Node Name + HW Pump Outlet Node; !- Component 1 Outlet Node Name + + Branch, + Central Boiler Branch, !- Name + , !- Pressure Drop Curve Name + Boiler:HotWater, !- Component 1 Object Type + Central Boiler, !- Component 1 Name + Central Boiler Inlet Node, !- Component 1 Inlet Node Name + Central Boiler Outlet Node; !- Component 1 Outlet Node Name + + Branch, + Heating Supply Bypass Branch, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Heating Supply Side Bypass, !- Component 1 Name + Heating Supply Bypass Inlet Node, !- Component 1 Inlet Node Name + Heating Supply Bypass Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Heating Supply Side Bypass, !- Name + Heating Supply Bypass Inlet Node, !- Inlet Node Name + Heating Supply Bypass Outlet Node; !- Outlet Node Name + + Branch, + Heating Supply Outlet Branch, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Heating Supply Outlet, !- Component 1 Name + Heating Supply Exit Pipe Inlet Node, !- Component 1 Inlet Node Name + HW Supply Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Heating Supply Outlet, !- Name + Heating Supply Exit Pipe Inlet Node, !- Inlet Node Name + HW Supply Outlet Node; !- Outlet Node Name + + BranchList, + Heating Demand Side Branches, !- Name + Heating Demand Inlet Branch, !- Branch 1 Name + SPACE1-1 Reheat Branch, !- Branch 2 Name + SPACE2-1 Reheat Branch, !- Branch 3 Name + SPACE3-1 Reheat Branch, !- Branch 4 Name + SPACE4-1 Reheat Branch, !- Branch 5 Name + SPACE5-1 Reheat Branch, !- Branch 6 Name + Main Heating Coil 1 Branch, !- Branch 7 Name + Heating Demand Bypass Branch, !- Branch 8 Name + Heating Demand Outlet Branch; !- Branch 9 Name + + ConnectorList, + Heating Demand Side Connectors, !- Name + Connector:Splitter, !- Connector 1 Object Type + Heating Demand Splitter, !- Connector 1 Name + Connector:Mixer, !- Connector 2 Object Type + Heating Demand Mixer; !- Connector 2 Name + + Branch, + Heating Demand Inlet Branch, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Heating Demand Inlet Pipe, !- Component 1 Name + HW Demand Inlet Node, !- Component 1 Inlet Node Name + HW Demand Entrance Pipe Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Heating Demand Inlet Pipe, !- Name + HW Demand Inlet Node, !- Inlet Node Name + HW Demand Entrance Pipe Outlet Node; !- Outlet Node Name + + Branch, + Heating Demand Outlet Branch, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Heating Demand Outlet Pipe, !- Component 1 Name + HW Demand Exit Pipe Inlet Node, !- Component 1 Inlet Node Name + HW Demand Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Heating Demand Outlet Pipe, !- Name + HW Demand Exit Pipe Inlet Node, !- Inlet Node Name + HW Demand Outlet Node; !- Outlet Node Name + + Branch, + SPACE1-1 Reheat Branch, !- Name + , !- Pressure Drop Curve Name + Coil:Heating:Water, !- Component 1 Object Type + SPACE1-1 Zone Coil, !- Component 1 Name + SPACE1-1 Zone Coil Water In Node, !- Component 1 Inlet Node Name + SPACE1-1 Zone Coil Water Out Node; !- Component 1 Outlet Node Name + + Branch, + SPACE2-1 Reheat Branch, !- Name + , !- Pressure Drop Curve Name + Coil:Heating:Water, !- Component 1 Object Type + SPACE2-1 Zone Coil, !- Component 1 Name + SPACE2-1 Zone Coil Water In Node, !- Component 1 Inlet Node Name + SPACE2-1 Zone Coil Water Out Node; !- Component 1 Outlet Node Name + + Branch, + SPACE3-1 Reheat Branch, !- Name + , !- Pressure Drop Curve Name + Coil:Heating:Water, !- Component 1 Object Type + SPACE3-1 Zone Coil, !- Component 1 Name + SPACE3-1 Zone Coil Water In Node, !- Component 1 Inlet Node Name + SPACE3-1 Zone Coil Water Out Node; !- Component 1 Outlet Node Name + + Branch, + SPACE4-1 Reheat Branch, !- Name + , !- Pressure Drop Curve Name + Coil:Heating:Water, !- Component 1 Object Type + SPACE4-1 Zone Coil, !- Component 1 Name + SPACE4-1 Zone Coil Water In Node, !- Component 1 Inlet Node Name + SPACE4-1 Zone Coil Water Out Node; !- Component 1 Outlet Node Name + + Branch, + SPACE5-1 Reheat Branch, !- Name + , !- Pressure Drop Curve Name + Coil:Heating:Water, !- Component 1 Object Type + SPACE5-1 Zone Coil, !- Component 1 Name + SPACE5-1 Zone Coil Water In Node, !- Component 1 Inlet Node Name + SPACE5-1 Zone Coil Water Out Node; !- Component 1 Outlet Node Name + + Branch, + Main Heating Coil 1 Branch, !- Name + , !- Pressure Drop Curve Name + Coil:Heating:Water, !- Component 1 Object Type + Main Heating Coil 1, !- Component 1 Name + Main Heating Coil 1 Water Inlet Node, !- Component 1 Inlet Node Name + Main Heating Coil 1 Water Outlet Node; !- Component 1 Outlet Node Name + + Branch, + Heating Demand Bypass Branch, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Heating Demand Bypass, !- Component 1 Name + Heating Demand Bypass Inlet Node, !- Component 1 Inlet Node Name + Heating Demand Bypass Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Heating Demand Bypass, !- Name + Heating Demand Bypass Inlet Node, !- Inlet Node Name + Heating Demand Bypass Outlet Node; !- Outlet Node Name + + Connector:Splitter, + Heating Demand Splitter, !- Name + Heating Demand Inlet Branch, !- Inlet Branch Name + SPACE1-1 Reheat Branch, !- Outlet Branch 1 Name + SPACE2-1 Reheat Branch, !- Outlet Branch 2 Name + SPACE3-1 Reheat Branch, !- Outlet Branch 3 Name + SPACE4-1 Reheat Branch, !- Outlet Branch 4 Name + SPACE5-1 Reheat Branch, !- Outlet Branch 5 Name + Main Heating Coil 1 Branch, !- Outlet Branch 6 Name + Heating Demand Bypass Branch; !- Outlet Branch 7 Name + + Connector:Mixer, + Heating Demand Mixer, !- Name + Heating Demand Outlet Branch, !- Outlet Branch Name + SPACE1-1 Reheat Branch, !- Inlet Branch 1 Name + SPACE2-1 Reheat Branch, !- Inlet Branch 2 Name + SPACE3-1 Reheat Branch, !- Inlet Branch 3 Name + SPACE4-1 Reheat Branch, !- Inlet Branch 4 Name + SPACE5-1 Reheat Branch, !- Inlet Branch 5 Name + Main Heating Coil 1 Branch, !- Inlet Branch 6 Name + Heating Demand Bypass Branch; !- Inlet Branch 7 Name + + Connector:Splitter, + Heating Supply Splitter, !- Name + Heating Supply Inlet Branch, !- Inlet Branch Name + Central Boiler Branch, !- Outlet Branch 1 Name + Heating Supply Bypass Branch; !- Outlet Branch 2 Name + + Connector:Mixer, + Heating Supply Mixer, !- Name + Heating Supply Outlet Branch, !- Outlet Branch Name + Central Boiler Branch, !- Inlet Branch 1 Name + Heating Supply Bypass Branch; !- Inlet Branch 2 Name + + PlantEquipmentOperationSchemes, + Hot Loop Operation, !- Name + PlantEquipmentOperation:HeatingLoad, !- Control Scheme 1 Object Type + Central Boiler Only, !- Control Scheme 1 Name + PlantOnSched; !- Control Scheme 1 Schedule Name + + PlantEquipmentOperation:HeatingLoad, + Central Boiler Only, !- Name + 0, !- Load Range 1 Lower Limit {W} + 1000000, !- Load Range 1 Upper Limit {W} + heating plant; !- Range 1 Equipment List Name + + PlantEquipmentList, + heating plant, !- Name + Boiler:HotWater, !- Equipment 1 Object Type + Central Boiler; !- Equipment 1 Name + + Boiler:HotWater, + Central Boiler, !- Name + NaturalGas, !- Fuel Type + autosize, !- Nominal Capacity {W} + 0.8, !- Nominal Thermal Efficiency + LeavingBoiler, !- Efficiency Curve Temperature Evaluation Variable + BoilerEfficiency, !- Normalized Boiler Efficiency Curve Name + autosize, !- Design Water Flow Rate {m3/s} + 0.0, !- Minimum Part Load Ratio + 1.2, !- Maximum Part Load Ratio + 1.0, !- Optimum Part Load Ratio + Central Boiler Inlet Node, !- Boiler Water Inlet Node Name + Central Boiler Outlet Node, !- Boiler Water Outlet Node Name + 100., !- Water Outlet Upper Temperature Limit {C} + LeavingSetpointModulated;!- Boiler Flow Mode + + SetpointManager:Scheduled, + Central Boiler Setpoint Manager, !- Name + Temperature, !- Control Variable + HW Loop Temp Schedule, !- Schedule Name + Central Boiler Outlet Node; !- Setpoint Node or NodeList Name + + Curve:Quadratic, + BoilerEfficiency, !- Name + 1.0, !- Coefficient1 Constant + 0.0, !- Coefficient2 x + 0.0, !- Coefficient3 x**2 + 0, !- Minimum Value of x + 1; !- Maximum Value of x + + Pump:VariableSpeed, + HW Circ Pump, !- Name + HW Supply Inlet Node, !- Inlet Node Name + HW Pump Outlet Node, !- Outlet Node Name + autosize, !- Design Maximum Flow Rate {m3/s} + 179352, !- Design Pump Head {Pa} + autosize, !- Design Power Consumption {W} + 0.9, !- Motor Efficiency + 0.0, !- Fraction of Motor Inefficiencies to Fluid Stream + 0, !- Coefficient 1 of the Part Load Performance Curve + 1, !- Coefficient 2 of the Part Load Performance Curve + 0, !- Coefficient 3 of the Part Load Performance Curve + 0, !- Coefficient 4 of the Part Load Performance Curve + 0, !- Design Minimum Flow Rate {m3/s} + INTERMITTENT; !- Pump Control Type + + PlantLoop, + Chilled Water Loop, !- Name + Water, !- Fluid Type + , !- User Defined Fluid Type + CW Loop Operation, !- Plant Equipment Operation Scheme Name + CW Supply Outlet Node, !- Loop Temperature Setpoint Node Name + 98, !- Maximum Loop Temperature {C} + 1, !- Minimum Loop Temperature {C} + autosize, !- Maximum Loop Flow Rate {m3/s} + 0.0, !- Minimum Loop Flow Rate {m3/s} + autocalculate, !- Plant Loop Volume {m3} + CW Supply Inlet Node, !- Plant Side Inlet Node Name + CW Supply Outlet Node, !- Plant Side Outlet Node Name + Cooling Supply Side Branches, !- Plant Side Branch List Name + Cooling Supply Side Connectors, !- Plant Side Connector List Name + CW Demand Inlet Node, !- Demand Side Inlet Node Name + CW Demand Outlet Node, !- Demand Side Outlet Node Name + Cooling Demand Side Branches, !- Demand Side Branch List Name + Cooling Demand Side Connectors, !- Demand Side Connector List Name + SequentialLoad; !- Load Distribution Scheme + + SetpointManager:Scheduled, + Chilled Water Loop Setpoint Manager, !- Name + Temperature, !- Control Variable + CW Loop Temp Schedule, !- Schedule Name + Chilled Water Loop Setpoint Node List; !- Setpoint Node or NodeList Name + + NodeList, + Chilled Water Loop Setpoint Node List, !- Name + CW Supply Outlet Node; !- Node 1 Name + + BranchList, + Cooling Supply Side Branches, !- Name + CW Pump Branch, !- Branch 1 Name + Central Chiller Branch, !- Branch 2 Name + Cooling Supply Bypass Branch, !- Branch 3 Name + Cooling Supply Outlet; !- Branch 4 Name + + BranchList, + Cooling Demand Side Branches, !- Name + Cooling Demand Inlet, !- Branch 1 Name + Cooling Coil Branch, !- Branch 2 Name + Cooling Demand Bypass Branch, !- Branch 3 Name + Cooling Demand Outlet; !- Branch 4 Name + + ConnectorList, + Cooling Supply Side Connectors, !- Name + Connector:Splitter, !- Connector 1 Object Type + CW Loop Splitter, !- Connector 1 Name + Connector:Mixer, !- Connector 2 Object Type + CW Loop Mixer; !- Connector 2 Name + + ConnectorList, + Cooling Demand Side Connectors, !- Name + Connector:Splitter, !- Connector 1 Object Type + CW Demand Splitter, !- Connector 1 Name + Connector:Mixer, !- Connector 2 Object Type + CW Demand Mixer; !- Connector 2 Name + + Branch, + Cooling Demand Inlet, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Cooling Demand Side Inlet Pipe, !- Component 1 Name + CW Demand Inlet Node, !- Component 1 Inlet Node Name + CW Demand Entrance Pipe Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Cooling Demand Side Inlet Pipe, !- Name + CW Demand Inlet Node, !- Inlet Node Name + CW Demand Entrance Pipe Outlet Node; !- Outlet Node Name + + Branch, + Cooling Coil Branch, !- Name + , !- Pressure Drop Curve Name + Coil:Cooling:Water, !- Component 1 Object Type + Main Cooling Coil 1, !- Component 1 Name + Main Cooling Coil 1 Water Inlet Node, !- Component 1 Inlet Node Name + Main Cooling Coil 1 Water Outlet Node; !- Component 1 Outlet Node Name + + Branch, + Cooling Demand Bypass Branch, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Cooling Demand Side Bypass, !- Component 1 Name + CW Demand Bypass Inlet Node, !- Component 1 Inlet Node Name + CW Demand Bypass Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Cooling Demand Side Bypass, !- Name + CW Demand Bypass Inlet Node, !- Inlet Node Name + CW Demand Bypass Outlet Node; !- Outlet Node Name + + Branch, + Cooling Demand Outlet, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + CW Demand Side Outlet Pipe, !- Component 1 Name + CW Demand Exit Pipe Inlet Node, !- Component 1 Inlet Node Name + CW Demand Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + CW Demand Side Outlet Pipe, !- Name + CW Demand Exit Pipe Inlet Node, !- Inlet Node Name + CW Demand Outlet Node; !- Outlet Node Name + + Branch, + Cooling Supply Outlet, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Supply Side Outlet Pipe, !- Component 1 Name + Supply Side Exit Pipe Inlet Node, !- Component 1 Inlet Node Name + CW Supply Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Supply Side Outlet Pipe, !- Name + Supply Side Exit Pipe Inlet Node, !- Inlet Node Name + CW Supply Outlet Node; !- Outlet Node Name + + Branch, + CW Pump Branch, !- Name + , !- Pressure Drop Curve Name + Pump:VariableSpeed, !- Component 1 Object Type + CW Circ Pump, !- Component 1 Name + CW Supply Inlet Node, !- Component 1 Inlet Node Name + CW Pump Outlet Node; !- Component 1 Outlet Node Name + + Branch, + Central Chiller Branch, !- Name + , !- Pressure Drop Curve Name + Chiller:Electric, !- Component 1 Object Type + Central Chiller, !- Component 1 Name + Central Chiller Inlet Node, !- Component 1 Inlet Node Name + Central Chiller Outlet Node; !- Component 1 Outlet Node Name + + Branch, + Cooling Supply Bypass Branch, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Supply Side Bypass, !- Component 1 Name + CW Supply Bypass Inlet Node, !- Component 1 Inlet Node Name + CW Supply Bypass Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Supply Side Bypass, !- Name + CW Supply Bypass Inlet Node, !- Inlet Node Name + CW Supply Bypass Outlet Node; !- Outlet Node Name + + Connector:Splitter, + CW Loop Splitter, !- Name + CW Pump Branch, !- Inlet Branch Name + Central Chiller Branch, !- Outlet Branch 1 Name + Cooling Supply Bypass Branch; !- Outlet Branch 2 Name + + Connector:Mixer, + CW Loop Mixer, !- Name + Cooling Supply Outlet, !- Outlet Branch Name + Central Chiller Branch, !- Inlet Branch 1 Name + Cooling Supply Bypass Branch; !- Inlet Branch 2 Name + + Connector:Splitter, + CW Demand Splitter, !- Name + Cooling Demand Inlet, !- Inlet Branch Name + Cooling Coil Branch, !- Outlet Branch 1 Name + Cooling Demand Bypass Branch; !- Outlet Branch 2 Name + + Connector:Mixer, + CW Demand Mixer, !- Name + Cooling Demand Outlet, !- Outlet Branch Name + Cooling Coil Branch, !- Inlet Branch 1 Name + Cooling Demand Bypass Branch; !- Inlet Branch 2 Name + + PlantEquipmentOperationSchemes, + CW Loop Operation, !- Name + PlantEquipmentOperation:CoolingLoad, !- Control Scheme 1 Object Type + Central Chiller Only, !- Control Scheme 1 Name + PlantOnSched; !- Control Scheme 1 Schedule Name + + PlantEquipmentOperation:CoolingLoad, + Central Chiller Only, !- Name + 0, !- Load Range 1 Lower Limit {W} + 900000, !- Load Range 1 Upper Limit {W} + Cooling Plant; !- Range 1 Equipment List Name + + PlantEquipmentList, + Cooling Plant, !- Name + Chiller:Electric, !- Equipment 1 Object Type + Central Chiller; !- Equipment 1 Name + + Chiller:Electric, + Central Chiller, !- Name + WaterCooled, !- Condenser Type + autosize, !- Nominal Capacity {W} + 3.2, !- Nominal COP {W/W} + Central Chiller Inlet Node, !- Chilled Water Inlet Node Name + Central Chiller Outlet Node, !- Chilled Water Outlet Node Name + Central Chiller Condenser Inlet Node, !- Condenser Inlet Node Name + Central Chiller Condenser Outlet Node, !- Condenser Outlet Node Name + 0.0, !- Minimum Part Load Ratio + 1.0, !- Maximum Part Load Ratio + 0.65, !- Optimum Part Load Ratio + 29.44, !- Design Condenser Inlet Temperature {C} + 2.682759, !- Temperature Rise Coefficient + 6.667, !- Design Chilled Water Outlet Temperature {C} + autosize, !- Design Chilled Water Flow Rate {m3/s} + autosize, !- Design Condenser Fluid Flow Rate {m3/s} + 0.94483600, !- Coefficient 1 of Capacity Ratio Curve + -.05700880, !- Coefficient 2 of Capacity Ratio Curve + -.00185486, !- Coefficient 3 of Capacity Ratio Curve + 1.907846, !- Coefficient 1 of Power Ratio Curve + -1.20498700, !- Coefficient 2 of Power Ratio Curve + 0.26346230, !- Coefficient 3 of Power Ratio Curve + 0.03303, !- Coefficient 1 of Full Load Ratio Curve + 0.6852, !- Coefficient 2 of Full Load Ratio Curve + 0.2818, !- Coefficient 3 of Full Load Ratio Curve + 5, !- Chilled Water Outlet Temperature Lower Limit {C} + LeavingSetpointModulated;!- Chiller Flow Mode + + SetpointManager:Scheduled, + Central Chiller Setpoint Manager, !- Name + Temperature, !- Control Variable + CW Loop Temp Schedule, !- Schedule Name + Central Chiller Outlet Node; !- Setpoint Node or NodeList Name + + Pump:VariableSpeed, + CW Circ Pump, !- Name + CW Supply Inlet Node, !- Inlet Node Name + CW Pump Outlet Node, !- Outlet Node Name + autosize, !- Design Maximum Flow Rate {m3/s} + 179352, !- Design Pump Head {Pa} + autosize, !- Design Power Consumption {W} + 0.9, !- Motor Efficiency + 0.0, !- Fraction of Motor Inefficiencies to Fluid Stream + 0, !- Coefficient 1 of the Part Load Performance Curve + 1, !- Coefficient 2 of the Part Load Performance Curve + 0, !- Coefficient 3 of the Part Load Performance Curve + 0, !- Coefficient 4 of the Part Load Performance Curve + 0, !- Design Minimum Flow Rate {m3/s} + INTERMITTENT, !- Pump Control Type + CoolingPumpAvailSched; !- Pump Flow Rate Schedule Name + + CondenserLoop, + Condenser Water Loop, !- Name + Water, !- Fluid Type + , !- User Defined Fluid Type + Tower Loop Operation, !- Condenser Equipment Operation Scheme Name + Condenser Supply Outlet Node, !- Condenser Loop Temperature Setpoint Node Name + 80, !- Maximum Loop Temperature {C} + 10, !- Minimum Loop Temperature {C} + autosize, !- Maximum Loop Flow Rate {m3/s} + 0.0, !- Minimum Loop Flow Rate {m3/s} + autocalculate, !- Condenser Loop Volume {m3} + Condenser Supply Inlet Node, !- Condenser Side Inlet Node Name + Condenser Supply Outlet Node, !- Condenser Side Outlet Node Name + Condenser Supply Side Branches, !- Condenser Side Branch List Name + Condenser Supply Side Connectors, !- Condenser Side Connector List Name + Condenser Demand Inlet Node, !- Demand Side Inlet Node Name + Condenser Demand Outlet Node, !- Demand Side Outlet Node Name + Condenser Demand Side Branches, !- Condenser Demand Side Branch List Name + Condenser Demand Side Connectors, !- Condenser Demand Side Connector List Name + SequentialLoad; !- Load Distribution Scheme + + SetpointManager:FollowOutdoorAirTemperature, + MyCondenserControl, !- Name + Temperature, !- Control Variable + OutdoorAirWetBulb, !- Reference Temperature Type + 0, !- Offset Temperature Difference {deltaC} + 80, !- Maximum Setpoint Temperature {C} + 10, !- Minimum Setpoint Temperature {C} + Condenser Supply Outlet Node; !- Setpoint Node or NodeList Name + + BranchList, + Condenser Supply Side Branches, !- Name + Condenser Supply Inlet Branch, !- Branch 1 Name + Condenser Supply Tower Branch, !- Branch 2 Name + Condenser Supply Bypass Branch, !- Branch 3 Name + Condenser Supply Outlet Branch; !- Branch 4 Name + + ConnectorList, + Condenser Supply Side Connectors, !- Name + Connector:Splitter, !- Connector 1 Object Type + Condenser Supply Splitter, !- Connector 1 Name + Connector:Mixer, !- Connector 2 Object Type + Condenser Supply Mixer; !- Connector 2 Name + + Branch, + Condenser Supply Inlet Branch, !- Name + , !- Pressure Drop Curve Name + Pump:VariableSpeed, !- Component 1 Object Type + Cond Circ Pump, !- Component 1 Name + Condenser Supply Inlet Node, !- Component 1 Inlet Node Name + Condenser Pump Outlet Node; !- Component 1 Outlet Node Name + + Branch, + Condenser Supply Tower Branch, !- Name + , !- Pressure Drop Curve Name + CoolingTower:SingleSpeed,!- Component 1 Object Type + Central Tower, !- Component 1 Name + Condenser Tower Inlet Node, !- Component 1 Inlet Node Name + Condenser Tower Outlet Node; !- Component 1 Outlet Node Name + + Branch, + Condenser Supply Bypass Branch, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Condenser Supply Side Bypass, !- Component 1 Name + Cond Supply Bypass Inlet Node, !- Component 1 Inlet Node Name + Cond Supply Bypass Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Condenser Supply Side Bypass, !- Name + Cond Supply Bypass Inlet Node, !- Inlet Node Name + Cond Supply Bypass Outlet Node; !- Outlet Node Name + + Branch, + Condenser Supply Outlet Branch, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Condenser Supply Outlet, !- Component 1 Name + Condenser Supply Exit Pipe Inlet Node, !- Component 1 Inlet Node Name + Condenser Supply Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Condenser Supply Outlet, !- Name + Condenser Supply Exit Pipe Inlet Node, !- Inlet Node Name + Condenser Supply Outlet Node; !- Outlet Node Name + + BranchList, + Condenser Demand Side Branches, !- Name + Condenser Demand Inlet Branch, !- Branch 1 Name + Central Chiller Condenser Branch, !- Branch 2 Name + Condenser Demand Bypass Branch, !- Branch 3 Name + Condenser Demand Outlet Branch; !- Branch 4 Name + + ConnectorList, + Condenser Demand Side Connectors, !- Name + Connector:Splitter, !- Connector 1 Object Type + Condenser Demand Splitter, !- Connector 1 Name + Connector:Mixer, !- Connector 2 Object Type + Condenser Demand Mixer; !- Connector 2 Name + + Branch, + Condenser Demand Inlet Branch, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Condenser Demand Inlet Pipe, !- Component 1 Name + Condenser Demand Inlet Node, !- Component 1 Inlet Node Name + Condenser Demand Entrance Pipe Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Condenser Demand Inlet Pipe, !- Name + Condenser Demand Inlet Node, !- Inlet Node Name + Condenser Demand Entrance Pipe Outlet Node; !- Outlet Node Name + + Branch, + Central Chiller Condenser Branch, !- Name + , !- Pressure Drop Curve Name + Chiller:Electric, !- Component 1 Object Type + Central Chiller, !- Component 1 Name + Central Chiller Condenser Inlet Node, !- Component 1 Inlet Node Name + Central Chiller Condenser Outlet Node; !- Component 1 Outlet Node Name + + Branch, + Condenser Demand Bypass Branch, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Condenser Demand Side Bypass, !- Component 1 Name + Cond Demand Bypass Inlet Node, !- Component 1 Inlet Node Name + Cond Demand Bypass Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Condenser Demand Side Bypass, !- Name + Cond Demand Bypass Inlet Node, !- Inlet Node Name + Cond Demand Bypass Outlet Node; !- Outlet Node Name + + Branch, + Condenser Demand Outlet Branch, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Condenser Demand Outlet Pipe, !- Component 1 Name + Condenser Demand Exit Pipe Inlet Node, !- Component 1 Inlet Node Name + Condenser Demand Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Condenser Demand Outlet Pipe, !- Name + Condenser Demand Exit Pipe Inlet Node, !- Inlet Node Name + Condenser Demand Outlet Node; !- Outlet Node Name + + Connector:Splitter, + Condenser Demand Splitter, !- Name + Condenser Demand Inlet Branch, !- Inlet Branch Name + Central Chiller Condenser Branch, !- Outlet Branch 1 Name + Condenser Demand Bypass Branch; !- Outlet Branch 2 Name + + Connector:Mixer, + Condenser Demand Mixer, !- Name + Condenser Demand Outlet Branch, !- Outlet Branch Name + Central Chiller Condenser Branch, !- Inlet Branch 1 Name + Condenser Demand Bypass Branch; !- Inlet Branch 2 Name + + Connector:Splitter, + Condenser Supply Splitter, !- Name + Condenser Supply Inlet Branch, !- Inlet Branch Name + Condenser Supply Tower Branch, !- Outlet Branch 1 Name + Condenser Supply Bypass Branch; !- Outlet Branch 2 Name + + Connector:Mixer, + Condenser Supply Mixer, !- Name + Condenser Supply Outlet Branch, !- Outlet Branch Name + Condenser Supply Tower Branch, !- Inlet Branch 1 Name + Condenser Supply Bypass Branch; !- Inlet Branch 2 Name + + CondenserEquipmentOperationSchemes, + Tower Loop Operation, !- Name + PlantEquipmentOperation:CoolingLoad, !- Control Scheme 1 Object Type + Year Round Tower Operation, !- Control Scheme 1 Name + PlantOnSched; !- Control Scheme 1 Schedule Name + + PlantEquipmentOperation:CoolingLoad, + Year Round Tower Operation, !- Name + 0, !- Load Range 1 Lower Limit {W} + 90000000, !- Load Range 1 Upper Limit {W} + All Towers; !- Range 1 Equipment List Name + + CondenserEquipmentList, + All Towers, !- Name + CoolingTower:SingleSpeed,!- Equipment 1 Object Type + Central Tower; !- Equipment 1 Name + + CoolingTower:SingleSpeed, + Central Tower, !- Name + Condenser Tower Inlet Node, !- Water Inlet Node Name + Condenser Tower Outlet Node, !- Water Outlet Node Name + autosize, !- Design Water Flow Rate {m3/s} + autosize, !- Design Air Flow Rate {m3/s} + autosize, !- Design Fan Power {W} + autosize, !- Design U-Factor Times Area Value {W/K} + 0.0, !- Free Convection Regime Air Flow Rate {m3/s} + , !- Free Convection Regime Air Flow Rate Sizing Factor + 0.0, !- Free Convection Regime U-Factor Times Area Value {W/K} + , !- Free Convection U-Factor Times Area Value Sizing Factor + , !- Performance Input Method + , !- Heat Rejection Capacity and Nominal Capacity Sizing Ratio + , !- Nominal Capacity {W} + , !- Free Convection Capacity {W} + , !- Free Convection Nominal Capacity Sizing Factor + , !- Design Inlet Air Dry-Bulb Temperature {C} + , !- Design Inlet Air Wet-Bulb Temperature {C} + , !- Design Approach Temperature {deltaC} + , !- Design Range Temperature {deltaC} + , !- Basin Heater Capacity {W/K} + , !- Basin Heater Setpoint Temperature {C} + , !- Basin Heater Operating Schedule Name + , !- Evaporation Loss Mode + , !- Evaporation Loss Factor {percent/K} + , !- Drift Loss Percent {percent} + , !- Blowdown Calculation Mode + ; !- Blowdown Concentration Ratio + + Pump:VariableSpeed, + Cond Circ Pump, !- Name + Condenser Supply Inlet Node, !- Inlet Node Name + Condenser Pump Outlet Node, !- Outlet Node Name + autosize, !- Design Maximum Flow Rate {m3/s} + 179352, !- Design Pump Head {Pa} + autosize, !- Design Power Consumption {W} + 0.9, !- Motor Efficiency + 0.0, !- Fraction of Motor Inefficiencies to Fluid Stream + 0, !- Coefficient 1 of the Part Load Performance Curve + 1, !- Coefficient 2 of the Part Load Performance Curve + 0, !- Coefficient 3 of the Part Load Performance Curve + 0, !- Coefficient 4 of the Part Load Performance Curve + 0, !- Design Minimum Flow Rate {m3/s} + INTERMITTENT, !- Pump Control Type + CoolingPumpAvailSched; !- Pump Flow Rate Schedule Name + + Output:Variable,*,Site Outdoor Air Drybulb Temperature,hourly; + + Output:Variable,*,Zone Air Temperature,hourly; + + Output:Variable,*,Zone Air System Sensible Cooling Rate,hourly; + + Output:Variable,*,Zone Air System Sensible Heating Rate,hourly; + + Output:Variable,*,Heating Coil Heating Rate,hourly; + + Output:Variable,*,Cooling Coil Total Cooling Rate,hourly; + + Output:Variable,*,Cooling Coil Sensible Cooling Rate,hourly; + + Output:Variable,Mixed Air Node 1,System Node Temperature,hourly; + + Output:Variable,Main Cooling Coil 1 Outlet Node,System Node Temperature,hourly; + + Output:Variable,Main Heating Coil 1 Outlet Node,System Node Temperature,hourly; + + Output:Variable,VAV Sys 1 Outlet Node,System Node Temperature,hourly; + + Output:Variable,VAV Sys 1 Outlet Node,System Node Mass Flow Rate,hourly; + + Output:Variable,VAV Sys 1 Outlet Node,System Node Setpoint Temperature,hourly; + + Output:Variable,SPACE1-1 In Node,System Node Mass Flow Rate,hourly; + + Output:Variable,SPACE2-1 In Node,System Node Mass Flow Rate,hourly; + + Output:Variable,SPACE3-1 In Node,System Node Mass Flow Rate,hourly; + + Output:Variable,SPACE4-1 In Node,System Node Mass Flow Rate,hourly; + + Output:Variable,SPACE5-1 In Node,System Node Mass Flow Rate,hourly; + + Output:Variable,SPACE1-1 In Node,System Node Standard Density Volume Flow Rate,hourly; + + Output:Variable,SPACE2-1 In Node,System Node Standard Density Volume Flow Rate,hourly; + + Output:Variable,SPACE3-1 In Node,System Node Standard Density Volume Flow Rate,hourly; + + Output:Variable,SPACE4-1 In Node,System Node Standard Density Volume Flow Rate,hourly; + + Output:Variable,SPACE5-1 In Node,System Node Standard Density Volume Flow Rate,hourly; + + Output:Variable,*,Zone Air Terminal VAV Damper Position,hourly; + + Output:Variable,VAV Sys 1 Outlet Node,System Node Standard Density Volume Flow Rate,hourly; + + Output:Variable,*,Zone Air Terminal Primary Air Mass Flow Rate,hourly; + + Output:Variable,*,Zone Air Terminal Backdraft Damper Leakage Mass Flow Rate,hourly; + + Output:Variable,*,Zone Heating Setpoint Not Met While Occupied Time,hourly; + + Output:Variable,*,Zone Cooling Setpoint Not Met While Occupied Time,hourly; + + Output:Variable,SPACE1-1 PIU FAN Outlet,System Node Standard Density Volume Flow Rate,hourly; + + Output:VariableDictionary,Regular; + + Output:Surfaces:Drawing,dxf; + + Output:Meter:MeterFileOnly,Electricity:Facility,monthly; + + Output:Meter:MeterFileOnly,Electricity:Building,monthly; + + Output:Meter:MeterFileOnly,InteriorLights:Electricity,monthly; + + Output:Meter:MeterFileOnly,Electricity:HVAC,monthly; + + Output:Meter:MeterFileOnly,Electricity:Plant,monthly; + + Output:Meter:MeterFileOnly,NaturalGas:Facility,monthly; + + Output:Meter:MeterFileOnly,NaturalGas:Plant,monthly; + + Output:Meter:MeterFileOnly,Electricity:Facility,runperiod; + + Output:Meter:MeterFileOnly,Electricity:Building,runperiod; + + Output:Meter:MeterFileOnly,InteriorLights:Electricity,runperiod; + + Output:Meter:MeterFileOnly,Electricity:HVAC,runperiod; + + Output:Meter:MeterFileOnly,Electricity:Plant,runperiod; + + Output:Meter:MeterFileOnly,NaturalGas:Facility,runperiod; + + Output:Meter:MeterFileOnly,NaturalGas:Plant,runperiod; + + OutputControl:Table:Style, + HTML; !- Column Separator + + Output:Table:SummaryReports, + AllSummary; !- Report 1 Name + diff --git a/testfiles/CMakeLists.txt b/testfiles/CMakeLists.txt index 12f716a8218..467b014b030 100644 --- a/testfiles/CMakeLists.txt +++ b/testfiles/CMakeLists.txt @@ -123,6 +123,7 @@ add_simulation_test(IDF_FILE 5ZoneWarmestMultDDSizBypass.idf EPW_FILE USA_IL_Chi add_simulation_test(IDF_FILE 5ZoneWarmestMultDDSizOnOff.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) add_simulation_test(IDF_FILE 5ZoneWarmestMultDDSizVAV.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) add_simulation_test(IDF_FILE 5ZoneWarmestMultDDSizVT.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) +add_simulation_test(IDF_FILE 5ZoneWarmestParallelPIULeak.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) add_simulation_test(IDF_FILE 5ZoneWarmestVFD.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) add_simulation_test(IDF_FILE 5ZoneWarmestVFD_FCMAuto.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) add_simulation_test(IDF_FILE 5ZoneWaterCooled_Baseboard.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) From 8a6a2c5aca4eb66b027208900c4bf05b4db436d4 Mon Sep 17 00:00:00 2001 From: lymereJ Date: Fri, 10 Oct 2025 22:31:02 -0700 Subject: [PATCH 22/30] Remove comment. [skip_decent_ci] --- src/EnergyPlus/PoweredInductionUnits.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EnergyPlus/PoweredInductionUnits.cc b/src/EnergyPlus/PoweredInductionUnits.cc index b02423e311c..6d86cdad2e3 100644 --- a/src/EnergyPlus/PoweredInductionUnits.cc +++ b/src/EnergyPlus/PoweredInductionUnits.cc @@ -1946,7 +1946,7 @@ void CalcParallelPIU(EnergyPlusData &state, // Determine leakage rate that won't make it to the zone served by the terminal thisPIU.leakFlow = thisPIU.leakFrac * thisPIU.PriAirMassFlow; // Increase the primary flow rate to meet the cooling load with leakage - thisPIU.PriAirMassFlow *= 1 / (1 - thisPIU.leakFrac); //(1 + thisPIU.leakFrac); + thisPIU.PriAirMassFlow *= 1 / (1 - thisPIU.leakFrac); } // Make sure that the primary airflow doesn't exceed the maximum when leakage is modeled // When the primary airflow is limited to the maximum, the load won't likely be met From 3fc7c66ce1d93ecd8b689d86c601abd43887d6ac Mon Sep 17 00:00:00 2001 From: lymereJ Date: Mon, 13 Oct 2025 23:08:59 -0700 Subject: [PATCH 23/30] Add new input to handle return not done through a plenum but through a mixer. --- idd/Energy+.idd.in | 6 +- src/EnergyPlus/DataHeatBalance.hh | 2 +- src/EnergyPlus/MixerComponent.cc | 72 ++++++++++++++++++- src/EnergyPlus/PoweredInductionUnits.cc | 36 +++++----- src/EnergyPlus/RoomAirModelAirflowNetwork.cc | 14 ++-- .../ZoneContaminantPredictorCorrector.cc | 22 +++--- src/EnergyPlus/ZonePlenum.cc | 4 +- src/EnergyPlus/ZoneTempPredictorCorrector.cc | 45 ++++-------- testfiles/5ZoneWarmestParallelPIULeak.idf | 13 ++-- .../unit/ZoneTempPredictorCorrector.unit.cc | 2 +- 10 files changed, 128 insertions(+), 88 deletions(-) diff --git a/idd/Energy+.idd.in b/idd/Energy+.idd.in index 9baf996ee03..b7aabe3c6ed 100644 --- a/idd/Energy+.idd.in +++ b/idd/Energy+.idd.in @@ -48982,12 +48982,16 @@ AirTerminal:SingleDuct:ParallelPIU:Reheat, \default 37.7 \note Only used if Heating Control Type is Modulated \note Used to determine end of third stage heating - A13; \field Backdraft Damper Leakage Fraction Curve Name + A13, \field Backdraft Damper Leakage Fraction Curve Name \type object-list \object-list UnivariateFunctions \note Backdraft damper leakage fraction is the ratio of mass leakage flow rate to primary air flow rate \note at a constant static pressure setpoint. This curve should describe the ratio as a function primary \note air flow fraction (ratio of primary flow fraction to maximum nominal primary air flow rate). + A14; \field Backdraft Damper Leakage Zone Name + \note Name of a zone that will be impacted by the backdraft damper leakage. + \type object-list + \object-list ZoneNames AirTerminal:SingleDuct:ConstantVolume:FourPipeInduction, \memo Central air system terminal unit, single duct, variable volume, induction unit with diff --git a/src/EnergyPlus/DataHeatBalance.hh b/src/EnergyPlus/DataHeatBalance.hh index f297a4b612b..ff17a3ed3e7 100644 --- a/src/EnergyPlus/DataHeatBalance.hh +++ b/src/EnergyPlus/DataHeatBalance.hh @@ -610,7 +610,7 @@ namespace DataHeatBalance { Real64 ExtGrossGroundWallArea_Multiplied = 0.0; // Ground contact Wall Area for Zone (Gross) with multipliers bool IsSupplyPlenum = false; // True when this zone is a supply plenum bool IsReturnPlenum = false; // True when this zone is a return plenum - bool isSourceForParallelPIU = false; // True when a parallel PIU draws air from this zone + int leakageParallelPIUNum = 0; // parallel PIU index for backdraft damper leakage int PlenumCondNum = 0; // Supply or return plenum conditions number, 0 if this is not a plenum zone int TempControlledZoneIndex = 0; // this is the index number for TempControlledZone structure for lookup int humidityControlZoneIndex = 0; // this is the index number for HumidityControlZone structure for lookup diff --git a/src/EnergyPlus/MixerComponent.cc b/src/EnergyPlus/MixerComponent.cc index d33e72b2d78..96e0123bf3b 100644 --- a/src/EnergyPlus/MixerComponent.cc +++ b/src/EnergyPlus/MixerComponent.cc @@ -51,8 +51,10 @@ // EnergyPlus Headers #include #include +#include #include #include +#include #include #include #include @@ -432,8 +434,52 @@ void CalcAirMixer(EnergyPlusData &state, int &MixerNum) state.dataMixerComponent->MixerCond(MixerNum).OutletHumRat = 0.0; state.dataMixerComponent->MixerCond(MixerNum).OutletPressure = 0.0; state.dataMixerComponent->MixerCond(MixerNum).OutletEnthalpy = 0.0; - + Real64 massFlowRateParallelPIULk = 0.0; + Real64 massFlowRateHumRatParallelPIULk = 0.0; + Real64 massFlowRateTempParallelPIULk = 0.0; + Real64 massFlowRatePressureParallelPIULk = 0.0; + Real64 massFlowRateEnthalpyParallelPIULk = 0.0; for (InletNodeNum = 1; InletNodeNum <= state.dataMixerComponent->MixerCond(MixerNum).NumInletNodes; ++InletNodeNum) { + + // Get PIU leakage flow rate only first mixer in return path + // First: check if this mixer is in a return path + for (int returnAirPathNum = 1; returnAirPathNum <= static_cast(state.dataZoneEquip->ReturnAirPath.size()); ++returnAirPathNum) { + const int returnAirPathCompNumOfComponents = state.dataZoneEquip->ReturnAirPath(returnAirPathNum).NumOfComponents; + for (int returnPathCompNum = 1; returnPathCompNum <= returnAirPathCompNumOfComponents; ++returnPathCompNum) { + if (state.dataZoneEquip->ReturnAirPath(returnAirPathNum).ComponentName(returnPathCompNum) == + state.dataMixerComponent->MixerCond(MixerNum).MixerName && + state.dataZoneEquip->ReturnAirPath(returnAirPathNum).ComponentTypeEnum(returnAirPathNum) == + DataZoneEquipment::AirLoopHVACZone::Mixer) { + // Second: check if inlet nodes in the mixer are return nodes of zones served by a ADU that includes a parallel PIU + if (!state.dataDefineEquipment->AirDistUnit.empty()) { + for (int airDistUnitNum = 1; airDistUnitNum <= static_cast(state.dataDefineEquipment->AirDistUnit.size()); + ++airDistUnitNum) { + const auto &airDistUnit = state.dataDefineEquipment->AirDistUnit(airDistUnitNum); + if (const int airDistUnitZoneNum = airDistUnit.ZoneNum; airDistUnitZoneNum > 0) { + const int numRetNodes = state.dataZoneEquip->ZoneEquipConfig(airDistUnitZoneNum).NumReturnNodes; + for (int retZoneAirNodeNum = 1; retZoneAirNodeNum <= numRetNodes; ++retZoneAirNodeNum) { + if (const int retZoneAirNode = + state.dataZoneEquip->ZoneEquipConfig(airDistUnitZoneNum).ReturnNodeAirLoopNum(retZoneAirNodeNum); + retZoneAirNode == InletNodeNum) { + // Third: increment to get the mixer leakage + massFlowRateParallelPIULk += airDistUnit.massFlowRateParallelPIULk; + massFlowRateTempParallelPIULk += + airDistUnit.massFlowRateParallelPIULk * state.dataLoopNodes->Node(airDistUnit.InletNodeNum).Temp; + massFlowRateHumRatParallelPIULk += + airDistUnit.massFlowRateParallelPIULk * state.dataLoopNodes->Node(airDistUnit.InletNodeNum).HumRat; + massFlowRatePressureParallelPIULk += + airDistUnit.massFlowRateParallelPIULk * state.dataLoopNodes->Node(airDistUnit.InletNodeNum).Press; + massFlowRateEnthalpyParallelPIULk += + airDistUnit.massFlowRateParallelPIULk * state.dataLoopNodes->Node(airDistUnit.InletNodeNum).Enthalpy; + } + } + } + } + } + } + } + } + state.dataMixerComponent->MixerCond(MixerNum).OutletMassFlowRate += state.dataMixerComponent->MixerCond(MixerNum).InletMassFlowRate(InletNodeNum); state.dataMixerComponent->MixerCond(MixerNum).OutletMassFlowRateMaxAvail += @@ -471,8 +517,30 @@ void CalcAirMixer(EnergyPlusData &state, int &MixerNum) state.dataMixerComponent->MixerCond(MixerNum).OutletMassFlowRate; } - // Use Enthalpy and humidity ratio to get outlet temperature from psych chart + // Balance the leaks + if (massFlowRateParallelPIULk > 0) { + const Real64 noLeakMassFlowRate = state.dataMixerComponent->MixerCond(MixerNum).OutletMassFlowRate; + const Real64 totMassFlowRate = noLeakMassFlowRate + massFlowRateParallelPIULk; + // Humidity ratio + state.dataMixerComponent->MixerCond(MixerNum).OutletHumRat = + (noLeakMassFlowRate * state.dataMixerComponent->MixerCond(MixerNum).OutletHumRat + massFlowRateHumRatParallelPIULk) / totMassFlowRate; + + // Pressure + state.dataMixerComponent->MixerCond(MixerNum).OutletPressure = + (noLeakMassFlowRate * state.dataMixerComponent->MixerCond(MixerNum).OutletPressure + massFlowRatePressureParallelPIULk) / + totMassFlowRate; + + // Enthalpy + state.dataMixerComponent->MixerCond(MixerNum).OutletEnthalpy = + (noLeakMassFlowRate * state.dataMixerComponent->MixerCond(MixerNum).OutletEnthalpy + massFlowRateEnthalpyParallelPIULk) / + totMassFlowRate; + + // Flow rate + state.dataMixerComponent->MixerCond(MixerNum).OutletMassFlowRate = totMassFlowRate; + } + + // Use Enthalpy and humidity ratio to get outlet temperature from psych chart state.dataMixerComponent->MixerCond(MixerNum).OutletTemp = PsyTdbFnHW(state.dataMixerComponent->MixerCond(MixerNum).OutletEnthalpy, state.dataMixerComponent->MixerCond(MixerNum).OutletHumRat); diff --git a/src/EnergyPlus/PoweredInductionUnits.cc b/src/EnergyPlus/PoweredInductionUnits.cc index 6d86cdad2e3..11489303ca5 100644 --- a/src/EnergyPlus/PoweredInductionUnits.cc +++ b/src/EnergyPlus/PoweredInductionUnits.cc @@ -559,23 +559,23 @@ void GetPIUs(EnergyPlusData &state) cCurrentModuleObject, thisPIU.Name)); } else if (thisPIU.leakFracCurve > 0) { - // Find the secondary zone or plenum index - // The secondary air inlet node should either be a zone exhaust air node... - for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { - for (int exhaustNum = 1; exhaustNum <= state.dataZoneEquip->ZoneEquipConfig(zoneNum).NumExhaustNodes; ++exhaustNum) { - if (thisPIU.SecAirInNode == state.dataZoneEquip->ZoneEquipConfig(zoneNum).ExhaustNode(exhaustNum)) { - state.dataHeatBal->Zone(zoneNum).isSourceForParallelPIU = true; - break; - } - } - } - // ... or an induced air node of a return plenum - for (int zoneNum = 1; zoneNum <= state.dataZonePlenum->NumZoneSupplyPlenums; ++zoneNum) { - for (int nodeNum = 1; nodeNum <= state.dataZonePlenum->ZoneRetPlenCond(zoneNum).NumInducedNodes; ++nodeNum) { - if (thisPIU.SecAirInNode == state.dataZonePlenum->ZoneRetPlenCond(zoneNum).InducedNode(nodeNum)) { - state.dataHeatBal->Zone(zoneNum).isSourceForParallelPIU = true; - break; - } + std::string damperLeakageZoneName = ip->getAlphaFieldValue(fields, objectSchemaProps, "backdraft_damper_leakage_zone_name"); + if (damperLeakageFractionCurveName.empty()) { + thisPIU.leakFracCurve = 0; + ShowSevereError(state, + format("The air leakage zone name for the {} {} is missing. No air leakage will be modeled.", + cCurrentModuleObject, + thisPIU.Name)); + } else { + if (int zoneNum = Util::FindItemInList(damperLeakageZoneName, state.dataHeatBal->Zone); zoneNum == thisPIU.CtrlZoneNum) { + thisPIU.leakFracCurve = 0; + ShowSevereError(state, + format("Air leakage for the {} {} won't be simulated as both the control zone and leakage " + "zones are the same.", + cCurrentModuleObject, + thisPIU.Name)); + } else { + state.dataHeatBal->Zone(zoneNum).leakageParallelPIUNum = PIUNum; } } } @@ -735,7 +735,7 @@ void InitPIU(EnergyPlusData &state, if (!state.dataPowerInductionUnits->ZoneEquipmentListChecked && state.dataZoneEquip->ZoneEquipInputsFilled) { state.dataPowerInductionUnits->ZoneEquipmentListChecked = true; - // Check to see if there is a Air Distribution Unit on the Zone Equipment List + // Check to see if there is an Air Distribution Unit on the Zone Equipment List for (int Loop = 1; Loop <= state.dataPowerInductionUnits->NumPIUs; ++Loop) { if (state.dataPowerInductionUnits->PIU(Loop).ADUNum == 0) { continue; diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc index f35c7b1e329..38c6d466e2e 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc @@ -798,17 +798,11 @@ namespace RoomAir { SumSysMCpT += inletNode.MassFlowRate * CpAir * inletNode.Temp; } - if (zone.isSourceForParallelPIU) { + if (zone.leakageParallelPIUNum > 0) { Real64 CpAir = PsyCpAirFnW(zoneHB.airHumRat); - for (int iExhNode = 1; iExhNode <= state.dataZoneEquip->ZoneEquipConfig(zoneNum).NumExhaustNodes; ++iExhNode) { - int piuNum = PoweredInductionUnits::getParallelPIUNumFromSecNodeNum( - state, state.dataZoneEquip->ZoneEquipConfig(zoneNum).ExhaustNode(iExhNode)); - if (piuNum > 0) { - auto &thisPIU = state.dataPowerInductionUnits->PIU(piuNum); - SumSysMCp += thisPIU.leakFlow * CpAir; - SumSysMCpT += thisPIU.leakFlow * CpAir * state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp; - } - } + const auto &thisPIU = state.dataPowerInductionUnits->PIU(state.dataHeatBal->Zone(zoneNum).leakageParallelPIUNum); + SumSysMCp += thisPIU.leakFlow * CpAir; + SumSysMCpT += thisPIU.leakFlow * CpAir * state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp; } int ZoneMult = zone.Multiplier * zone.ListMultiplier; diff --git a/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc b/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc index b740b908571..08a76228277 100644 --- a/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc @@ -2320,21 +2320,15 @@ void CorrectZoneContaminants(EnergyPlusData &state, ZoneMassFlowRate += node.MassFlowRate / ZoneMult; } - if (state.dataHeatBal->Zone(ZoneNum).isSourceForParallelPIU) { - for (int iExhNode = 1; iExhNode <= state.dataZoneEquip->ZoneEquipConfig(ZoneNum).NumExhaustNodes; ++iExhNode) { - int piuNum = PoweredInductionUnits::getParallelPIUNumFromSecNodeNum( - state, state.dataZoneEquip->ZoneEquipConfig(ZoneNum).ExhaustNode(iExhNode)); - if (piuNum > 0) { - auto &thisPIU = state.dataPowerInductionUnits->PIU(piuNum); - if (state.dataContaminantBalance->Contaminant.CO2Simulation) { - CO2MassFlowRate += (thisPIU.leakFlow * state.dataLoopNodes->Node(thisPIU.PriAirInNode).CO2) / ZoneMult; - } - if (state.dataContaminantBalance->Contaminant.GenericContamSimulation) { - GCMassFlowRate += (thisPIU.leakFlow * state.dataLoopNodes->Node(thisPIU.PriAirInNode).GenContam) / ZoneMult; - } - ZoneMassFlowRate += thisPIU.leakFlow / ZoneMult; - } + if (state.dataHeatBal->Zone(ZoneNum).leakageParallelPIUNum > 0) { + const auto &thisPIU = state.dataPowerInductionUnits->PIU(state.dataHeatBal->Zone(ZoneNum).leakageParallelPIUNum); + if (state.dataContaminantBalance->Contaminant.CO2Simulation) { + CO2MassFlowRate += (thisPIU.leakFlow * state.dataLoopNodes->Node(thisPIU.PriAirInNode).CO2) / ZoneMult; + } + if (state.dataContaminantBalance->Contaminant.GenericContamSimulation) { + GCMassFlowRate += (thisPIU.leakFlow * state.dataLoopNodes->Node(thisPIU.PriAirInNode).GenContam) / ZoneMult; } + ZoneMassFlowRate += thisPIU.leakFlow / ZoneMult; } Real64 timeStepSysSec = state.dataHVACGlobal->TimeStepSysSec; diff --git a/src/EnergyPlus/ZonePlenum.cc b/src/EnergyPlus/ZonePlenum.cc index 779ec7546ec..43044fca099 100644 --- a/src/EnergyPlus/ZonePlenum.cc +++ b/src/EnergyPlus/ZonePlenum.cc @@ -995,9 +995,7 @@ void CalcAirZoneReturnPlenum(EnergyPlusData &state, int const ZonePlenumNum) state.dataZonePlenum->ZoneRetPlenCond(ZonePlenumNum).OutletMassFlowRate += state.dataDefineEquipment->AirDistUnit(ADUNum).MassFlowRateUpStrLk + state.dataDefineEquipment->AirDistUnit(ADUNum).MassFlowRateDnStrLk + - state.dataDefineEquipment->AirDistUnit(ADUNum) - .massFlowRateParallelPIULk; // Even though the PIU leakage flow rate doesn't necessarily go through the plenum, the same amount - // ends-up being returned + state.dataDefineEquipment->AirDistUnit(ADUNum).massFlowRateParallelPIULk; state.dataZonePlenum->ZoneRetPlenCond(ZonePlenumNum).OutletMassFlowRateMaxAvail += state.dataDefineEquipment->AirDistUnit(ADUNum).MaxAvailDelta; state.dataZonePlenum->ZoneRetPlenCond(ZonePlenumNum).OutletMassFlowRateMinAvail += diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index 1f288ff8522..49eee54d067 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -4484,16 +4484,10 @@ void ZoneSpaceHeatBalanceData::correctHumRat(EnergyPlusData &state, int const zo ZoneMassFlowRate += inletNode.MassFlowRate / ZoneMult; } - if (state.dataHeatBal->Zone(zoneNum).isSourceForParallelPIU) { - for (int iExhNode = 1; iExhNode <= state.dataZoneEquip->ZoneEquipConfig(zoneNum).NumExhaustNodes; ++iExhNode) { - int piuNum = - PoweredInductionUnits::getParallelPIUNumFromSecNodeNum(state, state.dataZoneEquip->ZoneEquipConfig(zoneNum).ExhaustNode(iExhNode)); - if (piuNum > 0) { - auto &thisPIU = state.dataPowerInductionUnits->PIU(piuNum); - MoistureMassFlowRate += (thisPIU.leakFlow * state.dataLoopNodes->Node(thisPIU.PriAirInNode).HumRat) / ZoneMult; - ZoneMassFlowRate += thisPIU.leakFlow / ZoneMult; - } - } + if (state.dataHeatBal->Zone(zoneNum).leakageParallelPIUNum > 0) { + const auto &thisPIU = state.dataPowerInductionUnits->PIU(state.dataHeatBal->Zone(zoneNum).leakageParallelPIUNum); + MoistureMassFlowRate += (thisPIU.leakFlow * state.dataLoopNodes->Node(thisPIU.PriAirInNode).HumRat) / ZoneMult; + ZoneMassFlowRate += thisPIU.leakFlow / ZoneMult; } // Calculate hourly humidity ratio from infiltration + humidity added from latent load + system added moisture @@ -5236,17 +5230,11 @@ void ZoneSpaceHeatBalanceData::calcZoneOrSpaceSums(EnergyPlusData &state, MassFlowRate * CpAir * state.dataLoopNodes->Node(state.dataZonePlenum->ZoneSupPlenCond(thisZone.PlenumCondNum).InletNode).Temp; } - if (state.dataHeatBal->Zone(zoneNum).isSourceForParallelPIU) { - for (int iExhNode = 1; iExhNode <= state.dataZoneEquip->ZoneEquipConfig(zoneNum).NumExhaustNodes; ++iExhNode) { - int piuNum = PoweredInductionUnits::getParallelPIUNumFromSecNodeNum( - state, state.dataZoneEquip->ZoneEquipConfig(zoneNum).ExhaustNode(iExhNode)); - if (piuNum > 0) { - auto &thisPIU = state.dataPowerInductionUnits->PIU(piuNum); - Real64 CpAir = Psychrometrics::PsyCpAirFnW(this->airHumRat); - this->SumSysMCp += thisPIU.leakFlow * CpAir; - this->SumSysMCpT += thisPIU.leakFlow * CpAir * state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp; - } - } + if (state.dataHeatBal->Zone(zoneNum).leakageParallelPIUNum > 0) { + const auto &thisPIU = state.dataPowerInductionUnits->PIU(state.dataHeatBal->Zone(zoneNum).leakageParallelPIUNum); + const Real64 CpAir = Psychrometrics::PsyCpAirFnW(this->airHumRat); + this->SumSysMCp += thisPIU.leakFlow * CpAir; + this->SumSysMCpT += thisPIU.leakFlow * CpAir * state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp; } int ZoneMult = thisZone.Multiplier * thisZone.ListMultiplier; @@ -5529,17 +5517,10 @@ void CalcZoneComponentLoadSums(EnergyPlusData &state, thisAirRpt.SumMCpDTsystem += QSensRate; } - if (state.dataHeatBal->Zone(ZoneNum).isSourceForParallelPIU) { - for (int iExhNode = 1; iExhNode <= state.dataZoneEquip->ZoneEquipConfig(ZoneNum).NumExhaustNodes; ++iExhNode) { - int piuNum = - PoweredInductionUnits::getParallelPIUNumFromSecNodeNum(state, state.dataZoneEquip->ZoneEquipConfig(ZoneNum).ExhaustNode(iExhNode)); - if (piuNum > 0) { - auto &thisPIU = state.dataPowerInductionUnits->PIU(piuNum); - QSensRate = - calcZoneSensibleOutput(thisPIU.leakFlow, state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp, thisHB->MAT, thisHB->airHumRat); - thisAirRpt.SumMCpDTsystem += QSensRate; - } - } + if (state.dataHeatBal->Zone(ZoneNum).leakageParallelPIUNum > 0) { + const auto &thisPIU = state.dataPowerInductionUnits->PIU(state.dataHeatBal->Zone(ZoneNum).leakageParallelPIUNum); + QSensRate = calcZoneSensibleOutput(thisPIU.leakFlow, state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp, thisHB->MAT, thisHB->airHumRat); + thisAirRpt.SumMCpDTsystem += QSensRate; } // non air system response. diff --git a/testfiles/5ZoneWarmestParallelPIULeak.idf b/testfiles/5ZoneWarmestParallelPIULeak.idf index 786e3ac3ba4..2ff3d3ef35a 100644 --- a/testfiles/5ZoneWarmestParallelPIULeak.idf +++ b/testfiles/5ZoneWarmestParallelPIULeak.idf @@ -2206,7 +2206,7 @@ SPACE1-1, !- Zone Name SPACE1-1 Eq, !- Zone Conditioning Equipment List Name SPACE1-1 In Nodes, !- Zone Air Inlet Node or NodeList Name - , !- Zone Air Exhaust Node or NodeList Name + PIU Inlet, !- Zone Air Exhaust Node or NodeList Name SPACE1-1 Node, !- Zone Air Node Name SPACE1-1 Out Node; !- Zone Return Air Node or NodeList Name @@ -2238,7 +2238,7 @@ SPACE5-1, !- Zone Name SPACE5-1 Eq, !- Zone Conditioning Equipment List Name SPACE5-1 In Nodes, !- Zone Air Inlet Node or NodeList Name - PIU Inlet, !- Zone Air Exhaust Node or NodeList Name + , !- Zone Air Exhaust Node or NodeList Name SPACE5-1 Node, !- Zone Air Node Name SPACE5-1 Out Node; !- Zone Return Air Node or NodeList Name @@ -2404,13 +2404,13 @@ SPACE1-1 VAV Reheat, !- Name ReheatCoilAvailSched, !- Availability Schedule Name autosize, !- Maximum Primary Air Flow Rate {m3/s} - 0.20913, !- Maximum Secondary Air Flow Rate {m3/s} - 0.26186, !- Minimum Primary Air Flow Fraction + 0.20913, !- Maximum Secondary Air Flow Rate {m3/s} + 0.26186, !- Minimum Primary Air Flow Fraction 0, !- Fan On Flow Fraction SPACE1-1 ATU In Node, !- Supply Air Inlet Node Name PIU Inlet, !- Secondary Air Inlet Node Name SPACE1-1 In Node, !- Air Outlet Node Name - SPACE1-1 PIU MIXER OUTLET, !- Reheat Coil Air Inlet Node Name + SPACE1-1 PIU MIXER OUTLET, !- Reheat Coil Air Inlet Node Name SPACE1-1 PIU MIXER, !- Zone Mixer Name SPACE1-1 PIU FAN, !- Fan Name Coil:Heating:Water, !- Reheat Coil Object Type @@ -2423,7 +2423,8 @@ , !- Heating Control Type , !- Design Heating Discharge Air Temperature {C} , !- High Limit Heating Discharge Air Temperature {C} - high_0p25_in_wc; !- Backdraft Damper Leakage Fraction Curve Name + high_0p25_in_wc, !- Backdraft Damper Leakage Fraction Curve Name + SPACE5-1; !- Backdraft Damper Leakage Zone Name AirLoopHVAC:ZoneMixer, SPACE1-1 PIU MIXER, !- Name diff --git a/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc b/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc index f12e95d9900..f14e05c3c97 100644 --- a/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc +++ b/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc @@ -1043,7 +1043,7 @@ TEST_F(EnergyPlusFixture, ZoneTempPredictorCorrector_calcZoneOrSpaceSums_SurfCon EXPECT_EQ(0.0, thisZoneHB.SumSysMCpT); // Check that parallel PIU leakage is accounted for - state->dataHeatBal->Zone(1).isSourceForParallelPIU = true; + state->dataHeatBal->Zone(1).leakageParallelPIUNum = 1; state->dataPowerInductionUnits->GetPIUInputFlag = false; state->dataPowerInductionUnits->NumPIUs = 1; state->dataPowerInductionUnits->PIU.allocate(1); From 67fade17a7c209655854f8b055401743b9336e1c Mon Sep 17 00:00:00 2001 From: lymereJ Date: Tue, 14 Oct 2025 08:37:29 -0700 Subject: [PATCH 24/30] Remove unused variable. --- src/EnergyPlus/MixerComponent.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/EnergyPlus/MixerComponent.cc b/src/EnergyPlus/MixerComponent.cc index 96e0123bf3b..5ba3c8b434b 100644 --- a/src/EnergyPlus/MixerComponent.cc +++ b/src/EnergyPlus/MixerComponent.cc @@ -436,7 +436,6 @@ void CalcAirMixer(EnergyPlusData &state, int &MixerNum) state.dataMixerComponent->MixerCond(MixerNum).OutletEnthalpy = 0.0; Real64 massFlowRateParallelPIULk = 0.0; Real64 massFlowRateHumRatParallelPIULk = 0.0; - Real64 massFlowRateTempParallelPIULk = 0.0; Real64 massFlowRatePressureParallelPIULk = 0.0; Real64 massFlowRateEnthalpyParallelPIULk = 0.0; for (InletNodeNum = 1; InletNodeNum <= state.dataMixerComponent->MixerCond(MixerNum).NumInletNodes; ++InletNodeNum) { @@ -463,8 +462,6 @@ void CalcAirMixer(EnergyPlusData &state, int &MixerNum) retZoneAirNode == InletNodeNum) { // Third: increment to get the mixer leakage massFlowRateParallelPIULk += airDistUnit.massFlowRateParallelPIULk; - massFlowRateTempParallelPIULk += - airDistUnit.massFlowRateParallelPIULk * state.dataLoopNodes->Node(airDistUnit.InletNodeNum).Temp; massFlowRateHumRatParallelPIULk += airDistUnit.massFlowRateParallelPIULk * state.dataLoopNodes->Node(airDistUnit.InletNodeNum).HumRat; massFlowRatePressureParallelPIULk += From 216e3f60b8221129b339632769878415cb1bf4ff Mon Sep 17 00:00:00 2001 From: lymereJ Date: Tue, 14 Oct 2025 12:11:46 -0700 Subject: [PATCH 25/30] Add missing documentation, bypass some of the new code if no PIUs are modeled, and fix integration test failure. --- design/FY2025/parallel_piu_damper_leakage.md | 45 +++++---------- ...ne-equipment-and-zone-forced-air-units.tex | 20 +++---- .../group-air-distribution-equipment.tex | 8 +++ src/EnergyPlus/DataDefineEquip.hh | 1 + src/EnergyPlus/MixerComponent.cc | 56 ++++++++++--------- src/EnergyPlus/PoweredInductionUnits.cc | 1 + src/EnergyPlus/PoweredInductionUnits.hh | 9 +-- src/EnergyPlus/ZoneAirLoopEquipmentManager.cc | 3 + 8 files changed, 70 insertions(+), 73 deletions(-) diff --git a/design/FY2025/parallel_piu_damper_leakage.md b/design/FY2025/parallel_piu_damper_leakage.md index 66b29dc11f0..a2cc3da04ba 100644 --- a/design/FY2025/parallel_piu_damper_leakage.md +++ b/design/FY2025/parallel_piu_damper_leakage.md @@ -28,7 +28,7 @@ Assumptions: - Leaked air is determined from the leakage fraction - The damper leakage fraction is expressed as follows: `f_leak = m_dot_leakage / m_dot_primary` - To meet zone loads, leakage results in an increase in primary air flow rate -- Leakage induces heat/mass transfer of primary air to the plenum or secondary thermal zone from which air is drew from when the fan is running +- The air escaping from the terminal impacts the heat balance of the thermal zone designated as the destination for the leaks ## Testing/Validation/Data Sources ## @@ -43,6 +43,10 @@ The following descriptions will be added to the Input Output Reference manual: \paragraph{Field: Backdraft Damper Leakage Curve Name}\label{field-backdraft_damper_leakage_fraction_curve_name} This field is used to indicate how the backdraft damper leakage fraction changes with different primary air flow fractions. The leakage fraction is defined as the ratio of leakage mass flow rate to primary air mass flow rate at a constant supply static pressure setpoint. This curve should describe the leakage fraction as a function of primary air flow fraction (ratio of primary flow fraction to maximum nominal primary air flow rate). For a static pressure setpoint of 62 Pa (0.25 in w.c) a resonable low leakage assumption could be around 3\%, a medium leakage value could be around 5\%, and relatively high leakage could be up to 12\%. + +\paragraph{Field: Backdraft Damper Leakage Zone Name}\label{field-backdraft_damper_leakage_zone_name} + +This field is used to indicate what zone will be impacted by the air leaking from the backdraft damper of the terminal. The zone should be different than the one served by the terminal. ``` ## Input Description ## @@ -50,12 +54,16 @@ This field is used to indicate how the backdraft damper leakage fraction changes The following inputs will be added at the end of `AirTerminal:SingleDuct:ParallelPIU:Reheat`: ``` - A13; \field Backdraft Damper Leakage Fraction Curve Name + A13, \field Backdraft Damper Leakage Fraction Curve Name \type object-list \object-list UnivariateFunctions \note Backdraft damper leakage fraction is the ratio of mass leakage flow rate to primary air flow rate \note at a constant static pressure setpoint. This curve should describe the ratio as a function primary \note air flow fraction (ratio of primary flow fraction to maximum nominal primary air flow rate). + A14; \field Backdraft Damper Leakage Zone Name + \note Name of a zone that will be impacted by the backdraft damper leakage. + \type object-list + \object-list ZoneNames ``` ## Outputs Description ## @@ -80,7 +88,7 @@ As described in (O'Neal et al., 2016) and (Sardoueinasab et al., 2018), backdraf Leakage is only simulated when the terminal fan is off. The impact of the simulated leakage is twofold: \begin{enumerate} \item To make up for the leaked air, the primary air flow rate should be increased to meet the zone load - \item The air escaping from the terminal is affecting the plenum/the secondary thermal zone heat balance associated with the terminal + \item The air escaping from the terminal impacts the heat balance of the thermal zone designated as the destination for the leaks \end{enumerate} The new primary flow rate is adjusted as follows: @@ -90,39 +98,12 @@ The new primary flow rate is adjusted as follows: The new primary flow rate won't exceed the maximum primary flow rate of the terminal. -Since leakage only occurs during dead-and and cooling operation (i.e., not during heating operation), the new primary air flow rate doesn't have an impact on the terminal mixer and heater. Leaks are accounted for after the terminal has been simulated, outlet nodes are updated then. The last step is to account for the thermal impact of the leakage on the plenum/secondary thermal zone. This is handled in a similar fashion as leakage simulation using the Simplified Duct Leakage Model, see \ref{implementation-000}. +Since leakage only occurs during dead-and and cooling operation (i.e., not during heating operation), the new primary air flow rate doesn't have an impact on the terminal mixer and heater. Leaks are accounted for after the terminal has been simulated, outlet nodes are updated then. The last step is to account for the thermal impact of the leakage on the thermal zone designated as the destination for the leaks. When an `AirLoopHVAC:ReturnPlenum`, this is handled in a similar fashion as leakage simulation using the Simplified Duct Leakage Model, see \ref{implementation-000}. Since users can select the thermal zone designated as the destination for the leaks, this feature also supports models that use an AirLoopHVAC:ZoneMixer as the return path. The leakage flow rate (at the conditions of each destination zone) is added to the mixer to calculate the new mixed air conditions. \subsubsection{References}\label{references_parallel_piu_leakage} D.L. O'Neal, J.L. Edmondson, Characterizing air leakage in parallel fan-powered terminal units, ASHRAE Trans., 122 (1) (2016), pp. 343-353 -Zahra Sardoueinasab, Peng Yin, Dennis O'Neal, Energy modeling and analysis of inherent air leakage from parallel fan-powered terminal units using EMS in EnergyPlus, (2018), Energy and Buildings, https://doi.org/10.1016/j.enbuild.2018.07.019\subsection{Air Leakage in Parallel Fan-Powered Terminal Units}\label{parallel_piu_leakage} - -As described in O'Neal et al. (2016) and Sardoueinasab et al. (2018), backdraft damper leakage in parallel fan-powered terminal units can be characterized using a leakage fraction at a constant static pressure setpoint: - -\begin{equation} - f_{\text{leakage}} = \frac{\dot{m}_{\text{leakage}}}{\dot{m}_{\text{primary}}} -\end{equation} - -Leakage is only simulated when the terminal fan is off. The impact of the simulated leakage is twofold: -\begin{enumerate} - \item To make up for the leaked air, the primary air flow rate should be increased to meet the zone load. - \item The air escaping from the terminal affects the plenum or the secondary thermal zone heat balance associated with the terminal. -\end{enumerate} - -The new primary flow rate is adjusted as follows: -\begin{equation} - \dot{m}_{\text{primary, adj}} = \dot{m}_{\text{primary}} \times \frac{1}{1 - f_{\text{leakage}}} -\end{equation} - -The new primary flow rate will not exceed the maximum primary flow rate of the terminal. - -Since leakage only occurs during dead-band and cooling operation (i.e., not during heating operation), the new primary air flow rate does not affect the terminal mixer and heater. Leaks are accounted for after the terminal simulation, and outlet nodes are updated at that point. The final step is to account for the thermal impact of the leakage on the plenum or the secondary thermal zone. This is handled in a similar fashion to leakage simulation using the Simplified Duct Leakage Model (see Section~\ref{implementation-000}). - -\subsubsection{References}\label{references_parallel_piu_leakage} -D.L. O'Neal, J.L. Edmondson, "Characterizing air leakage in parallel fan-powered terminal units," ASHRAE Transactions, vol. 122, no. 1, 2016, pp. 343-353. - -Zahra Sardoueinasab, Peng Yin, Dennis O'Neal, "Energy modeling and analysis of inherent air leakage from parallel fan-powered terminal units using EMS in EnergyPlus," Energy and Buildings, vol. 174, 2018, pp. 413-426. https://doi.org/10.1016/j.enbuild.2018.07.019 - +Zahra Sardoueinasab, Peng Yin, Dennis O'Neal, Energy modeling and analysis of inherent air leakage from parallel fan-powered terminal units using EMS in EnergyPlus, (2018), Energy and Buildings, https://doi.org/10.1016/j.enbuild.2018.07.019 ``` ## Example File and Transition Changes ## diff --git a/doc/engineering-reference/src/simulation-models-encyclopedic-reference-005/zone-equipment-and-zone-forced-air-units.tex b/doc/engineering-reference/src/simulation-models-encyclopedic-reference-005/zone-equipment-and-zone-forced-air-units.tex index d99a20bc285..d473ff1d6be 100644 --- a/doc/engineering-reference/src/simulation-models-encyclopedic-reference-005/zone-equipment-and-zone-forced-air-units.tex +++ b/doc/engineering-reference/src/simulation-models-encyclopedic-reference-005/zone-equipment-and-zone-forced-air-units.tex @@ -224,33 +224,31 @@ \subsubsection{References}\label{references-3-005} Wray, C.P., R.C. Diamond, and M.H. Sherman. 2005. ``Rationale for Measuring Duct Leakage Flows in Large Commercial Buildings''. Proceedings -- 26th AIVC Conference, Brussels, Belgium, September. LBNL-58252. \subsection{Air Leakage in Parallel Fan-Powered Terminal Units}\label{parallel_piu_leakage} - -As described in O'Neal et al. (2016) and Sardoueinasab et al. (2018), backdraft damper leakage in parallel fan-powered terminal units can be characterized using a leakage fraction at a constant static pressure setpoint: +As described in (O'Neal et al., 2016) and (Sardoueinasab et al., 2018), backdraft damper leakage in parallel fan-powered terminal units can be characterized using a leakage fraction at a constant static pressure setpoint: \begin{equation} - f_{\text{leakage}} = \frac{\dot{m}_{\text{leakage}}}{\dot{m}_{\text{primary}}} +{f_{leakage}} = \frac{\dot m_{leakage}}{\dot m_{primary}} \end{equation} Leakage is only simulated when the terminal fan is off. The impact of the simulated leakage is twofold: \begin{enumerate} - \item To make up for the leaked air, the primary air flow rate should be increased to meet the zone load. - \item The air escaping from the terminal affects the plenum or the secondary thermal zone heat balance associated with the terminal. + \item To make up for the leaked air, the primary air flow rate should be increased to meet the zone load + \item The air escaping from the terminal impacts the heat balance of the thermal zone designated as the destination for the leaks \end{enumerate} The new primary flow rate is adjusted as follows: \begin{equation} - \dot{m}_{\text{primary, adj}} = \dot{m}_{\text{primary}} \times \frac{1}{1 - f_{\text{leakage}}} +{\dot m_{primary, adj}} = {\dot m_{primary}} \times \frac{1}{1 - {f_{leakage}}} \end{equation} -The new primary flow rate will not exceed the maximum primary flow rate of the terminal. +The new primary flow rate won't exceed the maximum primary flow rate of the terminal. -Since leakage only occurs during dead-band and cooling operation (i.e., not during heating operation), the new primary air flow rate does not affect the terminal mixer and heater. Leaks are accounted for after the terminal simulation, and outlet nodes are updated at that point. The final step is to account for the thermal impact of the leakage on the plenum or the secondary thermal zone. This is handled in a similar fashion to leakage simulation using the Simplified Duct Leakage Model (see Section~\ref{implementation-000}). +Since leakage only occurs during dead-and and cooling operation (i.e., not during heating operation), the new primary air flow rate doesn't have an impact on the terminal mixer and heater. Leaks are accounted for after the terminal has been simulated, outlet nodes are updated then. The last step is to account for the thermal impact of the leakage on the thermal zone designated as the destination for the leaks. When an `AirLoopHVAC:ReturnPlenum`, this is handled in a similar fashion as leakage simulation using the Simplified Duct Leakage Model, see \ref{implementation-000}. Since users can select the thermal zone designated as the destination for the leaks, this feature also supports models that use an AirLoopHVAC:ZoneMixer as the return path. The leakage flow rate (at the conditions of each destination zone) is added to the mixer to calculate the new mixed air conditions. \subsubsection{References}\label{references_parallel_piu_leakage} -D.L. O'Neal, J.L. Edmondson, "Characterizing air leakage in parallel fan-powered terminal units," ASHRAE Transactions, vol. 122, no. 1, 2016, pp. 343-353. - -Zahra Sardoueinasab, Peng Yin, Dennis O'Neal, "Energy modeling and analysis of inherent air leakage from parallel fan-powered terminal units using EMS in EnergyPlus," Energy and Buildings, vol. 174, 2018, pp. 413-426. https://doi.org/10.1016/j.enbuild.2018.07.019 +D.L. O'Neal, J.L. Edmondson, Characterizing air leakage in parallel fan-powered terminal units, ASHRAE Trans., 122 (1) (2016), pp. 343-353 +Zahra Sardoueinasab, Peng Yin, Dennis O'Neal, Energy modeling and analysis of inherent air leakage from parallel fan-powered terminal units using EMS in EnergyPlus, (2018), Energy and Buildings, https://doi.org/10.1016/j.enbuild.2018.07.019 \subsection{Fan Coil Unit}\label{fan-coil-unit} diff --git a/doc/input-output-reference/src/overview/group-air-distribution-equipment.tex b/doc/input-output-reference/src/overview/group-air-distribution-equipment.tex index 95e06fee626..ab78bfd9ab6 100644 --- a/doc/input-output-reference/src/overview/group-air-distribution-equipment.tex +++ b/doc/input-output-reference/src/overview/group-air-distribution-equipment.tex @@ -1268,6 +1268,14 @@ \subsubsection{Inputs}\label{inputs-8-000} This field is used to indicate the high limit on discharge air temperature at the end of stage three heating for \textbf{Modulated} heat control. The default is 37.7 deg. C (100 deg. F). +\paragraph{Field: Backdraft Damper Leakage Curve Name}\label{field-backdraft_damper_leakage_fraction_curve_name} + +This field is used to indicate how the backdraft damper leakage fraction changes with different primary air flow fractions. The leakage fraction is defined as the ratio of leakage mass flow rate to primary air mass flow rate at a constant supply static pressure setpoint. This curve should describe the leakage fraction as a function of primary air flow fraction (ratio of primary flow fraction to maximum nominal primary air flow rate). For a static pressure setpoint of 62 Pa (0.25 in w.c) a resonable low leakage assumption could be around 3\%, a medium leakage value could be around 5\%, and relatively high leakage could be up to 12\%. + +\paragraph{Field: Backdraft Damper Leakage Zone Name}\label{field-backdraft_damper_leakage_zone_name} + +This field is used to indicate what zone will be impacted by the air leaking from the backdraft damper of the terminal. The zone should be different than the one served by the terminal. + An IDF example: \begin{lstlisting} diff --git a/src/EnergyPlus/DataDefineEquip.hh b/src/EnergyPlus/DataDefineEquip.hh index d7953deeaba..6ba4d5806ef 100644 --- a/src/EnergyPlus/DataDefineEquip.hh +++ b/src/EnergyPlus/DataDefineEquip.hh @@ -132,6 +132,7 @@ namespace DataDefineEquip { Real64 CoolGain = 0.0; // [J] bool EachOnceFlag = true; bool IsConstLeakageRate = false; // if true, constant leakage rate, if false proportional leakage rate will be calculated + int piuLkZoneNum = 0; // zone index designated as the destination for the PIU backdraft damper leaks // Default Constructor ZoneAirEquip() diff --git a/src/EnergyPlus/MixerComponent.cc b/src/EnergyPlus/MixerComponent.cc index 5ba3c8b434b..84930ab3041 100644 --- a/src/EnergyPlus/MixerComponent.cc +++ b/src/EnergyPlus/MixerComponent.cc @@ -58,6 +58,7 @@ #include #include #include +#include #include #include @@ -442,32 +443,35 @@ void CalcAirMixer(EnergyPlusData &state, int &MixerNum) // Get PIU leakage flow rate only first mixer in return path // First: check if this mixer is in a return path - for (int returnAirPathNum = 1; returnAirPathNum <= static_cast(state.dataZoneEquip->ReturnAirPath.size()); ++returnAirPathNum) { - const int returnAirPathCompNumOfComponents = state.dataZoneEquip->ReturnAirPath(returnAirPathNum).NumOfComponents; - for (int returnPathCompNum = 1; returnPathCompNum <= returnAirPathCompNumOfComponents; ++returnPathCompNum) { - if (state.dataZoneEquip->ReturnAirPath(returnAirPathNum).ComponentName(returnPathCompNum) == - state.dataMixerComponent->MixerCond(MixerNum).MixerName && - state.dataZoneEquip->ReturnAirPath(returnAirPathNum).ComponentTypeEnum(returnAirPathNum) == - DataZoneEquipment::AirLoopHVACZone::Mixer) { - // Second: check if inlet nodes in the mixer are return nodes of zones served by a ADU that includes a parallel PIU - if (!state.dataDefineEquipment->AirDistUnit.empty()) { - for (int airDistUnitNum = 1; airDistUnitNum <= static_cast(state.dataDefineEquipment->AirDistUnit.size()); - ++airDistUnitNum) { - const auto &airDistUnit = state.dataDefineEquipment->AirDistUnit(airDistUnitNum); - if (const int airDistUnitZoneNum = airDistUnit.ZoneNum; airDistUnitZoneNum > 0) { - const int numRetNodes = state.dataZoneEquip->ZoneEquipConfig(airDistUnitZoneNum).NumReturnNodes; - for (int retZoneAirNodeNum = 1; retZoneAirNodeNum <= numRetNodes; ++retZoneAirNodeNum) { - if (const int retZoneAirNode = - state.dataZoneEquip->ZoneEquipConfig(airDistUnitZoneNum).ReturnNodeAirLoopNum(retZoneAirNodeNum); - retZoneAirNode == InletNodeNum) { - // Third: increment to get the mixer leakage - massFlowRateParallelPIULk += airDistUnit.massFlowRateParallelPIULk; - massFlowRateHumRatParallelPIULk += - airDistUnit.massFlowRateParallelPIULk * state.dataLoopNodes->Node(airDistUnit.InletNodeNum).HumRat; - massFlowRatePressureParallelPIULk += - airDistUnit.massFlowRateParallelPIULk * state.dataLoopNodes->Node(airDistUnit.InletNodeNum).Press; - massFlowRateEnthalpyParallelPIULk += - airDistUnit.massFlowRateParallelPIULk * state.dataLoopNodes->Node(airDistUnit.InletNodeNum).Enthalpy; + if (state.dataPowerInductionUnits->NumParallelPIUs > 0) { + for (int returnAirPathNum = 1; returnAirPathNum <= static_cast(state.dataZoneEquip->ReturnAirPath.size()); ++returnAirPathNum) { + const int returnAirPathCompNumOfComponents = state.dataZoneEquip->ReturnAirPath(returnAirPathNum).NumOfComponents; + for (int returnPathCompNum = 1; returnPathCompNum <= returnAirPathCompNumOfComponents; ++returnPathCompNum) { + if (state.dataZoneEquip->ReturnAirPath(returnAirPathNum).ComponentName(returnPathCompNum) == + state.dataMixerComponent->MixerCond(MixerNum).MixerName && + state.dataZoneEquip->ReturnAirPath(returnAirPathNum).ComponentTypeEnum(returnPathCompNum) == + DataZoneEquipment::AirLoopHVACZone::Mixer) { + // Second: check if inlet nodes in the mixer are return nodes of zones served by a ADU that includes a parallel PIU + if (!state.dataDefineEquipment->AirDistUnit.empty()) { + for (int airDistUnitNum = 1; airDistUnitNum <= static_cast(state.dataDefineEquipment->AirDistUnit.size()); + ++airDistUnitNum) { + if (const auto &airDistUnit = state.dataDefineEquipment->AirDistUnit(airDistUnitNum); airDistUnit.piuLkZoneNum > 0) { + if (const int airDistUnitZoneNum = airDistUnit.ZoneNum; airDistUnitZoneNum > 0) { + const int numRetNodes = state.dataZoneEquip->ZoneEquipConfig(airDistUnitZoneNum).NumReturnNodes; + for (int retZoneAirNodeNum = 1; retZoneAirNodeNum <= numRetNodes; ++retZoneAirNodeNum) { + if (const int retZoneAirNode = + state.dataZoneEquip->ZoneEquipConfig(airDistUnitZoneNum).ReturnNodeAirLoopNum(retZoneAirNodeNum); + retZoneAirNode == InletNodeNum) { + // Third: increment to get the mixer leakage + massFlowRateParallelPIULk += airDistUnit.massFlowRateParallelPIULk; + massFlowRateHumRatParallelPIULk += airDistUnit.massFlowRateParallelPIULk * + state.dataLoopNodes->Node(airDistUnit.piuLkZoneNum).HumRat; + massFlowRatePressureParallelPIULk += + airDistUnit.massFlowRateParallelPIULk * state.dataLoopNodes->Node(airDistUnit.piuLkZoneNum).Press; + massFlowRateEnthalpyParallelPIULk += airDistUnit.massFlowRateParallelPIULk * + state.dataLoopNodes->Node(airDistUnit.piuLkZoneNum).Enthalpy; + } + } } } } diff --git a/src/EnergyPlus/PoweredInductionUnits.cc b/src/EnergyPlus/PoweredInductionUnits.cc index 11489303ca5..478c7924c47 100644 --- a/src/EnergyPlus/PoweredInductionUnits.cc +++ b/src/EnergyPlus/PoweredInductionUnits.cc @@ -576,6 +576,7 @@ void GetPIUs(EnergyPlusData &state) thisPIU.Name)); } else { state.dataHeatBal->Zone(zoneNum).leakageParallelPIUNum = PIUNum; + thisPIU.damperLeakageZoneNum = zoneNum; } } } diff --git a/src/EnergyPlus/PoweredInductionUnits.hh b/src/EnergyPlus/PoweredInductionUnits.hh index 53ae19ca660..cca6991850e 100644 --- a/src/EnergyPlus/PoweredInductionUnits.hh +++ b/src/EnergyPlus/PoweredInductionUnits.hh @@ -202,9 +202,10 @@ namespace PoweredInductionUnits { Real64 DischargeAirTemp = 0.0; // current operating discharge air temperature at outlet, for reporting HeatOpModeType heatingOperatingMode = HeatOpModeType::HeaterOff; CoolOpModeType coolingOperatingMode = CoolOpModeType::CoolerOff; - Real64 leakFrac = 0.0; // parallel PIU backdraft damper leakage fraction - Real64 leakFlow = 0.0; // parallel PIU backdraft damper leakage mass flow rate - int leakFracCurve = 0.0; // parallel PIU backdraft damper leakage fraction curve + Real64 leakFrac; // parallel PIU backdraft damper leakage fraction + Real64 leakFlow; // parallel PIU backdraft damper leakage mass flow rate + int leakFracCurve; // parallel PIU backdraft damper leakage fraction curve + int damperLeakageZoneNum; // zone index designated as the destination for the PIU backdraft damper leaks int CurOperationControlStage = -1; // integer reference for what stage of control the unit is in int plenumIndex = 0; @@ -218,7 +219,7 @@ namespace PoweredInductionUnits { MaxHotWaterFlow(0.0), MaxHotSteamFlow(0.0), MinVolHotWaterFlow(0.0), MinHotSteamFlow(0.0), MinVolHotSteamFlow(0.0), MinHotWaterFlow(0.0), HotControlNode(0), HotCoilOutNodeNum(0), HotControlOffset(0.0), HWplantLoc{}, ADUNum(0), InducesPlenumAir(false), HeatingRate(0.0), HeatingEnergy(0.0), SensCoolRate(0.0), SensCoolEnergy(0.0), CtrlZoneNum(0), ctrlZoneInNodeIndex(0), AirLoopNum(0), - OutdoorAirFlowRate(0.0), leakFrac(0.0), leakFlow(0.0), leakFracCurve(0) + OutdoorAirFlowRate(0.0), leakFrac(0.0), leakFlow(0.0), leakFracCurve(0), damperLeakageZoneNum(0) { } diff --git a/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc b/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc index 8d2cb287554..b78055ff041 100644 --- a/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc +++ b/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc @@ -699,6 +699,9 @@ namespace ZoneAirLoopEquipmentManager { // Retrieve previously calculated PIU terminal leakage through backdraft damper if (const int PIUNum = Util::FindItemInList(airDistUnit.EquipName(AirDistCompNum), state.dataPowerInductionUnits->PIU); PIUNum > 0) { airDistUnit.parallelPIUTerminalLeakFrac = state.dataPowerInductionUnits->PIU(PIUNum).leakFrac; + if (state.dataPowerInductionUnits->PIU(PIUNum).damperLeakageZoneNum > 0 && airDistUnit.piuLkZoneNum <= 0) { // one-time assignment + airDistUnit.piuLkZoneNum = state.dataPowerInductionUnits->PIU(PIUNum).damperLeakageZoneNum; + } } } break; case DataDefineEquip::ZnAirLoopEquipType::SingleDuct_ConstVol_4PipeInduc: { From 28b5d5300a4b76c4ff9411aa450ad70669dd502d Mon Sep 17 00:00:00 2001 From: lymereJ Date: Tue, 14 Oct 2025 21:14:55 -0700 Subject: [PATCH 26/30] Add impact of leaks on zones not served by air distribution systems. --- src/EnergyPlus/DataHeatBalance.hh | 2 +- src/EnergyPlus/PoweredInductionUnits.cc | 27 ++++++++++- src/EnergyPlus/RoomAirModelAirflowNetwork.cc | 14 ++++-- .../ZoneContaminantPredictorCorrector.cc | 19 ++++---- src/EnergyPlus/ZoneTempPredictorCorrector.cc | 47 +++++++++++++------ .../unit/ZoneTempPredictorCorrector.unit.cc | 2 +- 6 files changed, 81 insertions(+), 30 deletions(-) diff --git a/src/EnergyPlus/DataHeatBalance.hh b/src/EnergyPlus/DataHeatBalance.hh index ff17a3ed3e7..1330283ce60 100644 --- a/src/EnergyPlus/DataHeatBalance.hh +++ b/src/EnergyPlus/DataHeatBalance.hh @@ -610,7 +610,7 @@ namespace DataHeatBalance { Real64 ExtGrossGroundWallArea_Multiplied = 0.0; // Ground contact Wall Area for Zone (Gross) with multipliers bool IsSupplyPlenum = false; // True when this zone is a supply plenum bool IsReturnPlenum = false; // True when this zone is a return plenum - int leakageParallelPIUNum = 0; // parallel PIU index for backdraft damper leakage + std::vector leakageParallelPIUNums; // parallel PIU index for backdraft damper leakage int PlenumCondNum = 0; // Supply or return plenum conditions number, 0 if this is not a plenum zone int TempControlledZoneIndex = 0; // this is the index number for TempControlledZone structure for lookup int humidityControlZoneIndex = 0; // this is the index number for HumidityControlZone structure for lookup diff --git a/src/EnergyPlus/PoweredInductionUnits.cc b/src/EnergyPlus/PoweredInductionUnits.cc index 478c7924c47..4654bbc758e 100644 --- a/src/EnergyPlus/PoweredInductionUnits.cc +++ b/src/EnergyPlus/PoweredInductionUnits.cc @@ -575,7 +575,32 @@ void GetPIUs(EnergyPlusData &state) cCurrentModuleObject, thisPIU.Name)); } else { - state.dataHeatBal->Zone(zoneNum).leakageParallelPIUNum = PIUNum; + int leakToPlenumZoneNum = 0; + ZonePlenum::GetZonePlenumInput(state); + for (int zonePlenumLoop = 1; zonePlenumLoop <= state.dataZonePlenum->NumZoneReturnPlenums; ++zonePlenumLoop) { + if (state.dataZonePlenum->ZoneRetPlenCond(zonePlenumLoop).NumInletNodes > 0) { + for (int plenumInletNodeNum = 1; + plenumInletNodeNum <= state.dataZonePlenum->ZoneRetPlenCond(zonePlenumLoop).NumInletNodes; + ++plenumInletNodeNum) { + for (int retNodeNum = 1; retNodeNum <= state.dataZoneEquip->ZoneEquipConfig(zoneNum).NumReturnNodes; + ++retNodeNum) { + if (plenumInletNodeNum == retNodeNum) { + leakToPlenumZoneNum = state.dataZonePlenum->ZoneRetPlenCond(zonePlenumLoop).ZoneNodeNum; + } + } + } + } + } + if (leakToPlenumZoneNum > 0 && leakToPlenumZoneNum != zoneNum) { + ShowSevereError(state, + format("The {} {} is serving a zone connected to a AirLoopHVAC:ReturnPlenum object, leakage " + "should be assigned to {}.", + cCurrentModuleObject, + thisPIU.Name, + state.dataHeatBal->Zone(leakToPlenumZoneNum).Name)); + ErrorsFound = true; + } + state.dataHeatBal->Zone(zoneNum).leakageParallelPIUNums.push_back(PIUNum); thisPIU.damperLeakageZoneNum = zoneNum; } } diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc index 38c6d466e2e..6bf5e327bb0 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc @@ -751,7 +751,7 @@ namespace RoomAir { auto &zoneEquipConfig = state.dataZoneEquip->ZoneEquipConfig(zoneNum); for (int iNode = 1; iNode <= zoneEquipConfig.NumInletNodes; ++iNode) { // Get node conditions - // this next block is of interest to irratic system loads... maybe nodes are not accurate at time of call ? + // this next block is of interest to erratic system loads... maybe nodes are not accurate at time of call ? // how can we tell ? predict step must be lagged ? correct step, systems have run. auto const &inletNode = state.dataLoopNodes->Node(zoneEquipConfig.InletNode(iNode)); for (auto const &afnHVAC : afnNode.HVAC) { @@ -798,11 +798,15 @@ namespace RoomAir { SumSysMCpT += inletNode.MassFlowRate * CpAir * inletNode.Temp; } - if (zone.leakageParallelPIUNum > 0) { + if (!zone.leakageParallelPIUNums.empty()) { Real64 CpAir = PsyCpAirFnW(zoneHB.airHumRat); - const auto &thisPIU = state.dataPowerInductionUnits->PIU(state.dataHeatBal->Zone(zoneNum).leakageParallelPIUNum); - SumSysMCp += thisPIU.leakFlow * CpAir; - SumSysMCpT += thisPIU.leakFlow * CpAir * state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp; + for (int piuNum = 1; piuNum <= static_cast(state.dataHeatBal->Zone(zoneNum).leakageParallelPIUNums.size()); ++piuNum) { + const auto &thisPIU = state.dataPowerInductionUnits->PIU(piuNum + 1); + if (thisPIU.leakFlow > 0) { + SumSysMCp += thisPIU.leakFlow * CpAir; + SumSysMCpT += thisPIU.leakFlow * CpAir * state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp; + } + } } int ZoneMult = zone.Multiplier * zone.ListMultiplier; diff --git a/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc b/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc index 08a76228277..c0879023208 100644 --- a/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc @@ -2320,15 +2320,18 @@ void CorrectZoneContaminants(EnergyPlusData &state, ZoneMassFlowRate += node.MassFlowRate / ZoneMult; } - if (state.dataHeatBal->Zone(ZoneNum).leakageParallelPIUNum > 0) { - const auto &thisPIU = state.dataPowerInductionUnits->PIU(state.dataHeatBal->Zone(ZoneNum).leakageParallelPIUNum); - if (state.dataContaminantBalance->Contaminant.CO2Simulation) { - CO2MassFlowRate += (thisPIU.leakFlow * state.dataLoopNodes->Node(thisPIU.PriAirInNode).CO2) / ZoneMult; - } - if (state.dataContaminantBalance->Contaminant.GenericContamSimulation) { - GCMassFlowRate += (thisPIU.leakFlow * state.dataLoopNodes->Node(thisPIU.PriAirInNode).GenContam) / ZoneMult; + if (!state.dataHeatBal->Zone(ZoneNum).leakageParallelPIUNums.empty()) { + for (int piuNum = 1; piuNum <= static_cast(state.dataHeatBal->Zone(ZoneNum).leakageParallelPIUNums.size()); ++piuNum) { + if (const auto &thisPIU = state.dataPowerInductionUnits->PIU(piuNum); thisPIU.leakFlow > 0) { + if (state.dataContaminantBalance->Contaminant.CO2Simulation) { + CO2MassFlowRate += (thisPIU.leakFlow * state.dataLoopNodes->Node(thisPIU.PriAirInNode).CO2) / ZoneMult; + } + if (state.dataContaminantBalance->Contaminant.GenericContamSimulation) { + GCMassFlowRate += (thisPIU.leakFlow * state.dataLoopNodes->Node(thisPIU.PriAirInNode).GenContam) / ZoneMult; + } + ZoneMassFlowRate += thisPIU.leakFlow / ZoneMult; + } } - ZoneMassFlowRate += thisPIU.leakFlow / ZoneMult; } Real64 timeStepSysSec = state.dataHVACGlobal->TimeStepSysSec; diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index 49eee54d067..1c734c91e5e 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -4484,10 +4484,13 @@ void ZoneSpaceHeatBalanceData::correctHumRat(EnergyPlusData &state, int const zo ZoneMassFlowRate += inletNode.MassFlowRate / ZoneMult; } - if (state.dataHeatBal->Zone(zoneNum).leakageParallelPIUNum > 0) { - const auto &thisPIU = state.dataPowerInductionUnits->PIU(state.dataHeatBal->Zone(zoneNum).leakageParallelPIUNum); - MoistureMassFlowRate += (thisPIU.leakFlow * state.dataLoopNodes->Node(thisPIU.PriAirInNode).HumRat) / ZoneMult; - ZoneMassFlowRate += thisPIU.leakFlow / ZoneMult; + if (!state.dataHeatBal->Zone(zoneNum).leakageParallelPIUNums.empty()) { + for (int piuNum = 1; piuNum <= static_cast(state.dataHeatBal->Zone(zoneNum).leakageParallelPIUNums.size()); ++piuNum) { + if (const auto &thisPIU = state.dataPowerInductionUnits->PIU(piuNum); thisPIU.leakFlow > 0) { + MoistureMassFlowRate += (thisPIU.leakFlow * state.dataLoopNodes->Node(thisPIU.PriAirInNode).HumRat) / ZoneMult; + ZoneMassFlowRate += thisPIU.leakFlow / ZoneMult; + } + } } // Calculate hourly humidity ratio from infiltration + humidity added from latent load + system added moisture @@ -5230,15 +5233,23 @@ void ZoneSpaceHeatBalanceData::calcZoneOrSpaceSums(EnergyPlusData &state, MassFlowRate * CpAir * state.dataLoopNodes->Node(state.dataZonePlenum->ZoneSupPlenCond(thisZone.PlenumCondNum).InletNode).Temp; } - if (state.dataHeatBal->Zone(zoneNum).leakageParallelPIUNum > 0) { - const auto &thisPIU = state.dataPowerInductionUnits->PIU(state.dataHeatBal->Zone(zoneNum).leakageParallelPIUNum); + int ZoneMult = thisZone.Multiplier * thisZone.ListMultiplier; + + if (!state.dataHeatBal->Zone(zoneNum).leakageParallelPIUNums.empty()) { const Real64 CpAir = Psychrometrics::PsyCpAirFnW(this->airHumRat); - this->SumSysMCp += thisPIU.leakFlow * CpAir; - this->SumSysMCpT += thisPIU.leakFlow * CpAir * state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp; + for (int piuNum = 1; piuNum <= static_cast(state.dataHeatBal->Zone(zoneNum).leakageParallelPIUNums.size()); ++piuNum) { + if (const auto &thisPIU = state.dataPowerInductionUnits->PIU(piuNum); thisPIU.leakFlow > 0) { + if (state.dataHeatBal->Zone(zoneNum).SystemZoneNodeNumber > 0) { + this->SumSysMCp += thisPIU.leakFlow * CpAir; + this->SumSysMCpT += thisPIU.leakFlow * CpAir * state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp; + } else { + this->SumMCp += thisPIU.leakFlow * CpAir / ZoneMult; + this->SumMCpT += thisPIU.leakFlow * CpAir * state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp / ZoneMult; + } + } + } } - int ZoneMult = thisZone.Multiplier * thisZone.ListMultiplier; - this->SumSysMCp /= ZoneMult; this->SumSysMCpT /= ZoneMult; } @@ -5517,10 +5528,18 @@ void CalcZoneComponentLoadSums(EnergyPlusData &state, thisAirRpt.SumMCpDTsystem += QSensRate; } - if (state.dataHeatBal->Zone(ZoneNum).leakageParallelPIUNum > 0) { - const auto &thisPIU = state.dataPowerInductionUnits->PIU(state.dataHeatBal->Zone(ZoneNum).leakageParallelPIUNum); - QSensRate = calcZoneSensibleOutput(thisPIU.leakFlow, state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp, thisHB->MAT, thisHB->airHumRat); - thisAirRpt.SumMCpDTsystem += QSensRate; + if (!state.dataHeatBal->Zone(ZoneNum).leakageParallelPIUNums.empty()) { + for (int piuNum = 1; piuNum <= static_cast(state.dataHeatBal->Zone(ZoneNum).leakageParallelPIUNums.size()); ++piuNum) { + if (const auto &thisPIU = state.dataPowerInductionUnits->PIU(piuNum); thisPIU.leakFlow > 0) { + QSensRate = + calcZoneSensibleOutput(thisPIU.leakFlow, state.dataLoopNodes->Node(thisPIU.PriAirInNode).Temp, thisHB->MAT, thisHB->airHumRat); + if (state.dataHeatBal->Zone(ZoneNum).SystemZoneNodeNumber > 0) { + thisAirRpt.SumMCpDTsystem += QSensRate; + } else { + thisAirRpt.SumMCpDTzones += QSensRate; + } + } + } } // non air system response. diff --git a/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc b/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc index f14e05c3c97..f3e618fa0ef 100644 --- a/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc +++ b/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc @@ -1043,7 +1043,7 @@ TEST_F(EnergyPlusFixture, ZoneTempPredictorCorrector_calcZoneOrSpaceSums_SurfCon EXPECT_EQ(0.0, thisZoneHB.SumSysMCpT); // Check that parallel PIU leakage is accounted for - state->dataHeatBal->Zone(1).leakageParallelPIUNum = 1; + state->dataHeatBal->Zone(1).leakageParallelPIUNums.push_back(1); state->dataPowerInductionUnits->GetPIUInputFlag = false; state->dataPowerInductionUnits->NumPIUs = 1; state->dataPowerInductionUnits->PIU.allocate(1); From f895231d13f5494386bc73a8e303db3892d6ed29 Mon Sep 17 00:00:00 2001 From: lymereJ Date: Tue, 14 Oct 2025 22:05:05 -0700 Subject: [PATCH 27/30] Relax error to warning and rephrase message. --- src/EnergyPlus/PoweredInductionUnits.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/EnergyPlus/PoweredInductionUnits.cc b/src/EnergyPlus/PoweredInductionUnits.cc index 4654bbc758e..5c3f9effe03 100644 --- a/src/EnergyPlus/PoweredInductionUnits.cc +++ b/src/EnergyPlus/PoweredInductionUnits.cc @@ -585,20 +585,20 @@ void GetPIUs(EnergyPlusData &state) for (int retNodeNum = 1; retNodeNum <= state.dataZoneEquip->ZoneEquipConfig(zoneNum).NumReturnNodes; ++retNodeNum) { if (plenumInletNodeNum == retNodeNum) { - leakToPlenumZoneNum = state.dataZonePlenum->ZoneRetPlenCond(zonePlenumLoop).ZoneNodeNum; + leakToPlenumZoneNum = state.dataZonePlenum->ZoneRetPlenCond(zonePlenumLoop).ActualZoneNum; } } } } } if (leakToPlenumZoneNum > 0 && leakToPlenumZoneNum != zoneNum) { - ShowSevereError(state, - format("The {} {} is serving a zone connected to a AirLoopHVAC:ReturnPlenum object, leakage " - "should be assigned to {}.", - cCurrentModuleObject, - thisPIU.Name, - state.dataHeatBal->Zone(leakToPlenumZoneNum).Name)); - ErrorsFound = true; + ShowWarningMessage(state, + format("Check backdraft damper leakage zone name assignment for the {}:{}. It is serving a " + "zone connected to a AirLoopHVAC:ReturnPlenum object, leakage " + "should probably be assigned to {}.", + cCurrentModuleObject, + thisPIU.Name, + state.dataHeatBal->Zone(leakToPlenumZoneNum).Name)); } state.dataHeatBal->Zone(zoneNum).leakageParallelPIUNums.push_back(PIUNum); thisPIU.damperLeakageZoneNum = zoneNum; From 5cd9e60b865be871301b9735d7c270dacd8bff59 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Thu, 20 Nov 2025 17:19:59 -0700 Subject: [PATCH 28/30] format --- design/FY2025/parallel_piu_damper_leakage.md | 6 +++--- testfiles/5ZoneWarmestParallelPIULeak.idf | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/design/FY2025/parallel_piu_damper_leakage.md b/design/FY2025/parallel_piu_damper_leakage.md index a2cc3da04ba..874e1dc1bb7 100644 --- a/design/FY2025/parallel_piu_damper_leakage.md +++ b/design/FY2025/parallel_piu_damper_leakage.md @@ -5,7 +5,7 @@ Air Leakage in Parallel Fan-Powered Terminal Units - Original Date: 04/07/2025 - Revision Date: 10/10/2025 - + ## Justification for New Feature ## @@ -181,5 +181,5 @@ Curve:Linear, ## References ## -- Energy modeling and analysis of inherent air leakage from parallel fan-powered terminal units using EMS in EnergyPlus, Zahra Sardoueinasab, Peng Yin, Dennis O'Neal, (2018), Energy and Buildings, https://doi.org/10.1016/j.enbuild.2018.07.019 -- Characterizing air leakage in parallel fan-powered terminal units, D.L. O'Neal, J.L. Edmondson, ASHRAE Trans., 122 (1) (2016), pp. 343-353 \ No newline at end of file +- Energy modeling and analysis of inherent air leakage from parallel fan-powered terminal units using EMS in EnergyPlus, Zahra Sardoueinasab, Peng Yin, Dennis O'Neal, (2018), Energy and Buildings, https://doi.org/10.1016/j.enbuild.2018.07.019 +- Characterizing air leakage in parallel fan-powered terminal units, D.L. O'Neal, J.L. Edmondson, ASHRAE Trans., 122 (1) (2016), pp. 343-353 diff --git a/testfiles/5ZoneWarmestParallelPIULeak.idf b/testfiles/5ZoneWarmestParallelPIULeak.idf index 2ff3d3ef35a..5f5bc5551f6 100644 --- a/testfiles/5ZoneWarmestParallelPIULeak.idf +++ b/testfiles/5ZoneWarmestParallelPIULeak.idf @@ -3717,15 +3717,15 @@ Output:Variable,*,Zone Air Terminal VAV Damper Position,hourly; Output:Variable,VAV Sys 1 Outlet Node,System Node Standard Density Volume Flow Rate,hourly; - + Output:Variable,*,Zone Air Terminal Primary Air Mass Flow Rate,hourly; - + Output:Variable,*,Zone Air Terminal Backdraft Damper Leakage Mass Flow Rate,hourly; - + Output:Variable,*,Zone Heating Setpoint Not Met While Occupied Time,hourly; - + Output:Variable,*,Zone Cooling Setpoint Not Met While Occupied Time,hourly; - + Output:Variable,SPACE1-1 PIU FAN Outlet,System Node Standard Density Volume Flow Rate,hourly; Output:VariableDictionary,Regular; From 5cbe4350b73cf8288eacaa270f96cbee79ef4112 Mon Sep 17 00:00:00 2001 From: lymereJ Date: Thu, 18 Dec 2025 20:51:55 -0800 Subject: [PATCH 29/30] Updating example file to 26.1, updated IDD file based on mods to the parallel PIU objects from develop. --- idd/Energy+.idd.in | 4 +- testfiles/5ZoneWarmestParallelPIULeak.idf | 88 ++++++++++++++++------- 2 files changed, 63 insertions(+), 29 deletions(-) diff --git a/idd/Energy+.idd.in b/idd/Energy+.idd.in index 9600ae2a0d2..ed80e986352 100644 --- a/idd/Energy+.idd.in +++ b/idd/Energy+.idd.in @@ -48979,13 +48979,13 @@ AirTerminal:SingleDuct:ParallelPIU:Reheat, \default 37.7 \note Only used if Heating Control Type is Modulated \note Used to determine end of third stage heating - A13, \field Backdraft Damper Leakage Fraction Curve Name + A12, \field Backdraft Damper Leakage Fraction Curve Name \type object-list \object-list UnivariateFunctions \note Backdraft damper leakage fraction is the ratio of mass leakage flow rate to primary air flow rate \note at a constant static pressure setpoint. This curve should describe the ratio as a function primary \note air flow fraction (ratio of primary flow fraction to maximum nominal primary air flow rate). - A14; \field Backdraft Damper Leakage Zone Name + A13; \field Backdraft Damper Leakage Zone Name \note Name of a zone that will be impacted by the backdraft damper leakage. \type object-list \object-list ZoneNames diff --git a/testfiles/5ZoneWarmestParallelPIULeak.idf b/testfiles/5ZoneWarmestParallelPIULeak.idf index 5f5bc5551f6..12679cd188d 100644 --- a/testfiles/5ZoneWarmestParallelPIULeak.idf +++ b/testfiles/5ZoneWarmestParallelPIULeak.idf @@ -109,7 +109,7 @@ ! Environmental Emissions: None ! Utility Tariffs: None - Version,25.2; + Version,26.1; Building, Building, !- Name @@ -1015,8 +1015,8 @@ INFIL-SCH, !- Schedule Name flow/zone, !- Design Flow Rate Calculation Method 0.0167, !- Design Flow Rate {m3/s} - , !- Flow per Zone Floor Area {m3/s-m2} - , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Flow Rate per Floor Area {m3/s-m2} + , !- Flow Rate per Exterior Surface Area {m3/s-m2} , !- Air Changes per Hour {1/hr} 0, !- Constant Term Coefficient 0, !- Temperature Term Coefficient @@ -1041,7 +1041,7 @@ LIGHTS-1, !- Schedule Name LightingLevel, !- Design Level Calculation Method 1584, !- Lighting Level {W} - , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0.2, !- Return Air Fraction 0.59, !- Fraction Radiant @@ -1055,7 +1055,7 @@ EQUIP-1, !- Schedule Name EquipmentLevel, !- Design Level Calculation Method 1056, !- Design Level {W} - , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0, !- Fraction Latent 0.3, !- Fraction Radiant @@ -1230,8 +1230,8 @@ INFIL-SCH, !- Schedule Name flow/zone, !- Design Flow Rate Calculation Method 0.00717, !- Design Flow Rate {m3/s} - , !- Flow per Zone Floor Area {m3/s-m2} - , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Flow Rate per Floor Area {m3/s-m2} + , !- Flow Rate per Exterior Surface Area {m3/s-m2} , !- Air Changes per Hour {1/hr} 0, !- Constant Term Coefficient 0, !- Temperature Term Coefficient @@ -1256,7 +1256,7 @@ LIGHTS-1, !- Schedule Name LightingLevel, !- Design Level Calculation Method 684, !- Lighting Level {W} - , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0.2, !- Return Air Fraction 0.59, !- Fraction Radiant @@ -1270,7 +1270,7 @@ EQUIP-1, !- Schedule Name EquipmentLevel, !- Design Level Calculation Method 456, !- Design Level {W} - , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0, !- Fraction Latent 0.3, !- Fraction Radiant @@ -1410,8 +1410,8 @@ INFIL-SCH, !- Schedule Name flow/zone, !- Design Flow Rate Calculation Method 0.0167, !- Design Flow Rate {m3/s} - , !- Flow per Zone Floor Area {m3/s-m2} - , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Flow Rate per Floor Area {m3/s-m2} + , !- Flow Rate per Exterior Surface Area {m3/s-m2} , !- Air Changes per Hour {1/hr} 0, !- Constant Term Coefficient 0, !- Temperature Term Coefficient @@ -1436,7 +1436,7 @@ LIGHTS-1, !- Schedule Name LightingLevel, !- Design Level Calculation Method 1584, !- Lighting Level {W} - , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0.2, !- Return Air Fraction 0.59, !- Fraction Radiant @@ -1450,7 +1450,7 @@ EQUIP-1, !- Schedule Name EquipmentLevel, !- Design Level Calculation Method 1056, !- Design Level {W} - , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0, !- Fraction Latent 0.3, !- Fraction Radiant @@ -1605,8 +1605,8 @@ INFIL-SCH, !- Schedule Name flow/zone, !- Design Flow Rate Calculation Method 0.00717, !- Design Flow Rate {m3/s} - , !- Flow per Zone Floor Area {m3/s-m2} - , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Flow Rate per Floor Area {m3/s-m2} + , !- Flow Rate per Exterior Surface Area {m3/s-m2} , !- Air Changes per Hour {1/hr} 0, !- Constant Term Coefficient 0, !- Temperature Term Coefficient @@ -1631,7 +1631,7 @@ LIGHTS-1, !- Schedule Name LightingLevel, !- Design Level Calculation Method 684, !- Lighting Level {W} - , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0.2, !- Return Air Fraction 0.59, !- Fraction Radiant @@ -1645,7 +1645,7 @@ EQUIP-1, !- Schedule Name EquipmentLevel, !- Design Level Calculation Method 456, !- Design Level {W} - , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0, !- Fraction Latent 0.3, !- Fraction Radiant @@ -1785,8 +1785,8 @@ INFIL-SCH, !- Schedule Name flow/zone, !- Design Flow Rate Calculation Method 0.031089, !- Design Flow Rate {m3/s} - , !- Flow per Zone Floor Area {m3/s-m2} - , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Flow Rate per Floor Area {m3/s-m2} + , !- Flow Rate per Exterior Surface Area {m3/s-m2} , !- Air Changes per Hour {1/hr} 0, !- Constant Term Coefficient 0, !- Temperature Term Coefficient @@ -1811,7 +1811,7 @@ LIGHTS-1, !- Schedule Name LightingLevel, !- Design Level Calculation Method 2964, !- Lighting Level {W} - , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0.2, !- Return Air Fraction 0.59, !- Fraction Radiant @@ -1825,7 +1825,7 @@ EQUIP-1, !- Schedule Name EquipmentLevel, !- Design Level Calculation Method 1976, !- Design Level {W} - , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0, !- Fraction Latent 0.3, !- Fraction Radiant @@ -1965,7 +1965,14 @@ No, !- Account for Dedicated Outdoor Air System NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} - autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + autosize, !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + , !- Zone Load Sizing Method + , !- Zone Latent Cooling Design Supply Air Humidity Ratio Input Method + , !- Zone Dehumidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + , !- Zone Cooling Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} + , !- Zone Latent Heating Design Supply Air Humidity Ratio Input Method + , !- Zone Humidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + ; !- Zone Humidification Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} DesignSpecification:OutdoorAir, SZ DSOA SPACE1-1, !- Name @@ -2001,7 +2008,14 @@ No, !- Account for Dedicated Outdoor Air System NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} - autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + autosize, !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + , !- Zone Load Sizing Method + , !- Zone Latent Cooling Design Supply Air Humidity Ratio Input Method + , !- Zone Dehumidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + , !- Zone Cooling Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} + , !- Zone Latent Heating Design Supply Air Humidity Ratio Input Method + , !- Zone Humidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + ; !- Zone Humidification Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} DesignSpecification:OutdoorAir, SZ DSOA SPACE2-1, !- Name @@ -2037,7 +2051,14 @@ No, !- Account for Dedicated Outdoor Air System NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} - autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + autosize, !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + , !- Zone Load Sizing Method + , !- Zone Latent Cooling Design Supply Air Humidity Ratio Input Method + , !- Zone Dehumidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + , !- Zone Cooling Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} + , !- Zone Latent Heating Design Supply Air Humidity Ratio Input Method + , !- Zone Humidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + ; !- Zone Humidification Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} DesignSpecification:OutdoorAir, SZ DSOA SPACE3-1, !- Name @@ -2073,7 +2094,14 @@ No, !- Account for Dedicated Outdoor Air System NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} - autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + autosize, !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + , !- Zone Load Sizing Method + , !- Zone Latent Cooling Design Supply Air Humidity Ratio Input Method + , !- Zone Dehumidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + , !- Zone Cooling Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} + , !- Zone Latent Heating Design Supply Air Humidity Ratio Input Method + , !- Zone Humidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + ; !- Zone Humidification Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} DesignSpecification:OutdoorAir, SZ DSOA SPACE4-1, !- Name @@ -2109,7 +2137,14 @@ No, !- Account for Dedicated Outdoor Air System NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} - autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + autosize, !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + , !- Zone Load Sizing Method + , !- Zone Latent Cooling Design Supply Air Humidity Ratio Input Method + , !- Zone Dehumidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + , !- Zone Cooling Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} + , !- Zone Latent Heating Design Supply Air Humidity Ratio Input Method + , !- Zone Humidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + ; !- Zone Humidification Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} DesignSpecification:OutdoorAir, SZ DSOA SPACE5-1, !- Name @@ -2410,7 +2445,6 @@ SPACE1-1 ATU In Node, !- Supply Air Inlet Node Name PIU Inlet, !- Secondary Air Inlet Node Name SPACE1-1 In Node, !- Air Outlet Node Name - SPACE1-1 PIU MIXER OUTLET, !- Reheat Coil Air Inlet Node Name SPACE1-1 PIU MIXER, !- Zone Mixer Name SPACE1-1 PIU FAN, !- Fan Name Coil:Heating:Water, !- Reheat Coil Object Type From 1611385b3628c907453ea1d942ab40dbb956e971 Mon Sep 17 00:00:00 2001 From: lymereJ Date: Tue, 20 Jan 2026 18:08:24 -0800 Subject: [PATCH 30/30] Correct typo. [skip_decent_ci] --- design/FY2025/parallel_piu_damper_leakage.md | 2 +- .../zone-equipment-and-zone-forced-air-units.tex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/design/FY2025/parallel_piu_damper_leakage.md b/design/FY2025/parallel_piu_damper_leakage.md index 874e1dc1bb7..c8aef829ab1 100644 --- a/design/FY2025/parallel_piu_damper_leakage.md +++ b/design/FY2025/parallel_piu_damper_leakage.md @@ -98,7 +98,7 @@ The new primary flow rate is adjusted as follows: The new primary flow rate won't exceed the maximum primary flow rate of the terminal. -Since leakage only occurs during dead-and and cooling operation (i.e., not during heating operation), the new primary air flow rate doesn't have an impact on the terminal mixer and heater. Leaks are accounted for after the terminal has been simulated, outlet nodes are updated then. The last step is to account for the thermal impact of the leakage on the thermal zone designated as the destination for the leaks. When an `AirLoopHVAC:ReturnPlenum`, this is handled in a similar fashion as leakage simulation using the Simplified Duct Leakage Model, see \ref{implementation-000}. Since users can select the thermal zone designated as the destination for the leaks, this feature also supports models that use an AirLoopHVAC:ZoneMixer as the return path. The leakage flow rate (at the conditions of each destination zone) is added to the mixer to calculate the new mixed air conditions. +Since leakage only occurs during dead-band and cooling operation (i.e., not during heating operation), the new primary air flow rate doesn't have an impact on the terminal mixer and heater. Leaks are accounted for after the terminal has been simulated, outlet nodes are updated then. The last step is to account for the thermal impact of the leakage on the thermal zone designated as the destination for the leaks. When an `AirLoopHVAC:ReturnPlenum`, this is handled in a similar fashion as leakage simulation using the Simplified Duct Leakage Model, see \ref{implementation-000}. Since users can select the thermal zone designated as the destination for the leaks, this feature also supports models that use an AirLoopHVAC:ZoneMixer as the return path. The leakage flow rate (at the conditions of each destination zone) is added to the mixer to calculate the new mixed air conditions. \subsubsection{References}\label{references_parallel_piu_leakage} D.L. O'Neal, J.L. Edmondson, Characterizing air leakage in parallel fan-powered terminal units, ASHRAE Trans., 122 (1) (2016), pp. 343-353 diff --git a/doc/engineering-reference/src/simulation-models-encyclopedic-reference-005/zone-equipment-and-zone-forced-air-units.tex b/doc/engineering-reference/src/simulation-models-encyclopedic-reference-005/zone-equipment-and-zone-forced-air-units.tex index d473ff1d6be..cb7910676d8 100644 --- a/doc/engineering-reference/src/simulation-models-encyclopedic-reference-005/zone-equipment-and-zone-forced-air-units.tex +++ b/doc/engineering-reference/src/simulation-models-encyclopedic-reference-005/zone-equipment-and-zone-forced-air-units.tex @@ -243,7 +243,7 @@ \subsection{Air Leakage in Parallel Fan-Powered Terminal Units}\label{parallel_p The new primary flow rate won't exceed the maximum primary flow rate of the terminal. -Since leakage only occurs during dead-and and cooling operation (i.e., not during heating operation), the new primary air flow rate doesn't have an impact on the terminal mixer and heater. Leaks are accounted for after the terminal has been simulated, outlet nodes are updated then. The last step is to account for the thermal impact of the leakage on the thermal zone designated as the destination for the leaks. When an `AirLoopHVAC:ReturnPlenum`, this is handled in a similar fashion as leakage simulation using the Simplified Duct Leakage Model, see \ref{implementation-000}. Since users can select the thermal zone designated as the destination for the leaks, this feature also supports models that use an AirLoopHVAC:ZoneMixer as the return path. The leakage flow rate (at the conditions of each destination zone) is added to the mixer to calculate the new mixed air conditions. +Since leakage only occurs during dead-band and cooling operation (i.e., not during heating operation), the new primary air flow rate doesn't have an impact on the terminal mixer and heater. Leaks are accounted for after the terminal has been simulated, outlet nodes are updated then. The last step is to account for the thermal impact of the leakage on the thermal zone designated as the destination for the leaks. When an `AirLoopHVAC:ReturnPlenum`, this is handled in a similar fashion as leakage simulation using the Simplified Duct Leakage Model, see \ref{implementation-000}. Since users can select the thermal zone designated as the destination for the leaks, this feature also supports models that use an AirLoopHVAC:ZoneMixer as the return path. The leakage flow rate (at the conditions of each destination zone) is added to the mixer to calculate the new mixed air conditions. \subsubsection{References}\label{references_parallel_piu_leakage} D.L. O'Neal, J.L. Edmondson, Characterizing air leakage in parallel fan-powered terminal units, ASHRAE Trans., 122 (1) (2016), pp. 343-353