Skip to content
Draft
7 changes: 6 additions & 1 deletion idd/Energy+.idd.in
Original file line number Diff line number Diff line change
Expand Up @@ -25597,13 +25597,18 @@ AirflowNetwork:MultiZone:Surface,
\default PolygonHeight
\note This field is applied to a non-rectangular window or door. The equivalent shape has
\note the same area as a polygonal window or door.
N7; \field Equivalent Rectangle Aspect Ratio
N7, \field Equivalent Rectangle Aspect Ratio
\note This field is used when UserDefinedAspectRatio is entered in the Equivalent
\note Rectangle Method field.
\units dimensionless
\type real
\minimum> 0.0
\default 1.0
A9; \field Control Schedule Name
\type object-list
\object-list ScheduleNames
\note If specified, this schedule will be applied to the control parameter of the specified leakage component.
\note Not used if Ventilation Control Mode != NoVent or Occupant Ventilation Control Name is specified.

AirflowNetwork:MultiZone:ReferenceCrackConditions,
\min-fields 4
Expand Down
4 changes: 2 additions & 2 deletions src/EnergyPlus/AirflowNetwork/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER "3.0")
cmake_policy(SET CMP0054 NEW) # CMake 3.1 added this policy
endif()

set(HDRS include/AirflowNetwork/Solver.hpp include/AirflowNetwork/Elements.hpp include/AirflowNetwork/Properties.hpp)
set(HDRS include/AirflowNetwork/Types.hpp include/AirflowNetwork/Solver.hpp include/AirflowNetwork/Elements.hpp include/AirflowNetwork/Linkages.hpp include/AirflowNetwork/Properties.hpp include/AirflowNetwork/Nodes.hpp)

set(SRCS src/Solver.cpp src/Elements.cpp src/Properties.cpp)
set(SRCS src/Solver.cpp src/Elements.cpp src/Linkages.cpp src/Properties.cpp src/Nodes.cpp)

# Create a static library
# this will be linked statically to create the DLL and also the unit tests
Expand Down
460 changes: 47 additions & 413 deletions src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Elements.hpp

Large diffs are not rendered by default.

304 changes: 304 additions & 0 deletions src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Linkages.hpp

Large diffs are not rendered by default.

219 changes: 219 additions & 0 deletions src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Nodes.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
// EnergyPlus, Copyright (c) 1996-2025, The Board of Trustees of the University of Illinois,
// The Regents of the University of California, through Lawrence Berkeley National Laboratory
// (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge
// National Laboratory, managed by UT-Battelle, Alliance for Sustainable Energy, LLC, and other
// contributors. All rights reserved.
//
// NOTICE: This Software was developed under funding from the U.S. Department of Energy and the
// U.S. Government consequently retains certain rights. As such, the U.S. Government has been
// granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable,
// worldwide license in the Software to reproduce, distribute copies to the public, prepare
// derivative works, and perform publicly and display publicly, and to permit others to do so.
//
// Redistribution and use in source and binary forms, with or without modification, are permitted
// provided that the following conditions are met:
//
// (1) Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
//
// (2) Redistributions in binary form must reproduce the above copyright notice, this list of
// conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
//
// (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory,
// the University of Illinois, U.S. Dept. of Energy nor the names of its contributors may be
// used to endorse or promote products derived from this software without specific prior
// written permission.
//
// (4) Use of EnergyPlus(TM) Name. If Licensee (i) distributes the software in stand-alone form
// without changes from the version obtained under this License, or (ii) Licensee makes a
// reference solely to the software portion of its product, Licensee must refer to the
// software as "EnergyPlus version X" software, where "X" is the version number Licensee
// obtained under this License and may not use a different name for the software. Except as
// specifically required in this Section (4), Licensee shall not use in a company name, a
// product name, in advertising, publicity, or other promotional activities any name, trade
// name, trademark, logo, or other designation of "EnergyPlus", "E+", "e+" or confusingly
// similar designation, without the U.S. Department of Energy's prior written consent.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

#ifndef AIRFLOWNETWORK_NODES_HPP
#define AIRFLOWNETWORK_NODES_HPP

#include "AirflowNetwork/Properties.hpp"
#include "AirflowNetwork/Types.hpp"
#include <EnergyPlus/DataHVACGlobals.hh>
#include <EnergyPlus/EPVector.hh>
#include <EnergyPlus/ScheduleManager.hh>

namespace EnergyPlus {

// Forward declarations
struct EnergyPlusData;
struct AirflowNetworkData;

namespace AirflowNetwork {

struct MultizoneZoneProp // Zone information
{
// Members
std::string ZoneName; // Name of Associated EnergyPlus Thermal Zone
std::string VentControl; // Ventilation Control Mode: "TEMPERATURE", "ENTHALPIC", "CONSTANT", or "NOVENT"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this a string?

std::string VentAvailSchName; // Ventilation availability schedule
Real64 Height; // Nodal height
Real64 OpenFactor; // Limit Value on Multiplier for Modulating Venting Open Factor,
// Not applicable if Vent Control Mode = CONSTANT or NOVENT
Real64 LowValueTemp; // Lower Value on Inside/Outside Temperature Difference for
// Modulating the Venting Open Factor with temp control
Real64 UpValueTemp; // Upper Value on Inside/Outside Temperature Difference for
// Modulating the Venting Open Factor with temp control
Real64 LowValueEnth; // Lower Value on Inside/Outside Temperature Difference for
// Modulating the Venting Open Factor with Enthalpic control
Real64 UpValueEnth; // Upper Value on Inside/Outside Temperature Difference for
// Modulating the Venting Open Factor with Enthalpic control
int ZoneNum; // Zone number associated with ZoneName
Sched::Schedule *ventTempControlSched = nullptr; // Ventilation temperature control schedule
int VentCtrNum; // Ventilation control mode number: 1 "Temperature", 2 "ENTHALPIC", 3 "CONSTANT", 4 "NOVENT"
std::string VentTempControlSchName; // Name of ventilation temperature control schedule
Sched::Schedule *ventAvailSched = nullptr; // Ventilation availability schedule
std::string SingleSidedCpType; // Type of calculation method for single sided wind pressure coefficients
Real64 BuildWidth; // The width of the building along the facade that contains this zone.
int ASH55PeopleInd; // Index of people object with ASH55 comfort calcs for ventilation control
int CEN15251PeopleInd; // Index of people object with CEN15251 comfort calcs for ventilation control
std::string OccupantVentilationControlName; // Occupant ventilation control name
int OccupantVentilationControlNum; // Occupant ventilation control number
int RAFNNodeNum; // Index of RAFN node number

// Default Constructor
MultizoneZoneProp()
Copy link
Collaborator

Choose a reason for hiding this comment

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

I thought we're not doing constructors this way anymore and we're putting the default values into the declarations. That's much cleaner IMO. Same comment on constructors below.

: VentControl("NoVent"), Height(0.0), OpenFactor(1.0), LowValueTemp(0.0), UpValueTemp(100.0), LowValueEnth(0.0), UpValueEnth(300000.0),
ZoneNum(0), VentCtrNum(VentControlType::None), SingleSidedCpType("STANDARD"), BuildWidth(10.0), ASH55PeopleInd(0), CEN15251PeopleInd(0),
OccupantVentilationControlNum(0), RAFNNodeNum(0)
{
}
};

struct MultizoneExternalNodeProp // External node properties
{
// Members
std::string Name; // Name of external node
Real64 azimuth; // Azimuthal angle of the associated surface
Real64 height; // Nodal height
int ExtNum; // External node number
int OutAirNodeNum; // Outdoor air node number
int facadeNum; // Facade number
int curve; // Curve ID, replace with pointer after curve refactor
bool symmetricCurve; // Symmtric curves are evaluated from 0 to 180, others are evaluated from 0 to 360
bool useRelativeAngle; // Determines whether the wind angle is relative to the surface or absolute

// Default Constructor
MultizoneExternalNodeProp()
: azimuth(0.0), height(0.0), ExtNum(0), OutAirNodeNum(0), facadeNum(0), curve(0), symmetricCurve(false), useRelativeAngle(false)
{
}
};

struct IntraZoneNodeProp // Intra zone node data
{
// Members
std::string Name; // Name of node
std::string RAFNNodeName; // RoomAir model node name
Real64 Height; // Nodal height
int RAFNNodeNum; // RoomAir model node number
int ZoneNum; // Zone number
int AFNZoneNum; // MultiZone number

// Default Constructor
IntraZoneNodeProp() : Height(0.0), RAFNNodeNum(0), ZoneNum(0), AFNZoneNum(0)
{
}
};

struct DisSysNodeProp // CP Value
{
// Members
std::string Name; // Name of node
std::string EPlusName; // EnergyPlus node name
std::string EPlusType; // EnergyPlus node type
Real64 Height; // Nodal height
int EPlusNodeNum; // EPlus node number
int AirLoopNum; // AirLoop number

// Default Constructor
DisSysNodeProp() : Height(0.0), EPlusNodeNum(0), AirLoopNum(0)
{
}
};

struct AirflowNetworkNodeProp // AirflowNetwork nodal data
{
// Members
std::string Name; // Provide a unique node name
std::string NodeType; // Provide node type "External", "Thermal Zone" or "Other"
std::string EPlusNode; // EnergyPlus node name
Real64 NodeHeight; // Node height [m]
int NodeNum; // Node number
int NodeTypeNum; // Node type with integer number: 0 - Calculated, 1 - Given pressure;
std::string EPlusZoneName; // EnergyPlus node name
int EPlusZoneNum; // E+ zone number
int EPlusNodeNum;
int ExtNodeNum;
int OutAirNodeNum;
EPlusNodeType EPlusTypeNum;
int RAFNNodeNum; // RoomAir model node number
int NumOfLinks; // Number of links for RoomAir model
int AirLoopNum; // AirLoop number

// Default Constructor
AirflowNetworkNodeProp()
: NodeHeight(0.0), NodeNum(0), NodeTypeNum(0), EPlusZoneNum(0), EPlusNodeNum(0), ExtNodeNum(0), OutAirNodeNum(0),
EPlusTypeNum(EPlusNodeType::Invalid), RAFNNodeNum(0), NumOfLinks(0), AirLoopNum(0)
{
}
};

struct AirflowNetworkNodeSimuData // Node variable for simulation
{
// Members
Real64 TZ; // Temperature [C]
Real64 WZ; // Humidity ratio [kg/kg]
Real64 PZ; // Pressure [Pa]
Real64 CO2Z; // CO2 [ppm]
Real64 GCZ; // Generic contaminant [ppm]
Real64 TZlast; // Temperature [C] at previous time step
Real64 WZlast; // Humidity ratio [kg/kg] at previous time step
Real64 CO2Zlast; // CO2 [ppm] at previous time step
Real64 GCZlast; // Generic contaminant [ppm] at previous time step

// Default Constructor
AirflowNetworkNodeSimuData() : TZ(0.0), WZ(0.0), PZ(0.0), CO2Z(0.0), GCZ(0.0), TZlast(0.0), WZlast(0.0), CO2Zlast(0.0), GCZlast(0.0)
{
}
};

struct AirflowNetworkNodeReportData // Node variable for simulation
{
// Members
Real64 PZ; // Average Pressure [Pa]
Real64 PZON; // Pressure with fan on [Pa]
Real64 PZOFF; // Pressure with fan off [Pa]

// Default Constructor
AirflowNetworkNodeReportData() : PZ(0.0), PZON(0.0), PZOFF(0.0)
{
}
};

} // namespace AirflowNetwork

} // namespace EnergyPlus

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@

// EnergyPlus Headers
#include <AirflowNetwork/Elements.hpp>
#include <AirflowNetwork/Linkages.hpp>
#include <AirflowNetwork/Properties.hpp>
#include <EnergyPlus/Data/BaseData.hh>
#include <EnergyPlus/EPVector.hh>
Expand Down Expand Up @@ -200,7 +201,7 @@ namespace AirflowNetwork {
ControlType::NoMultizoneOrDistribution; // AirflowNetwork control: MULTIZONE WITH DISTRIBUTION, MULTIZONE WITHOUT DISTRIBUTION, MULTIZONE
// WITH DISTRIBUTION ONLY DURING FAN OPERATION, and NO MULTIZONE OR DISTRIBUTION
std::string WPCCntr = "SURFACEAVERAGECALCULATION"; // Wind pressure coefficient input control: "SURFACE-AVERAGE CALCULATION", or "INPUT"
iWPCCntr iWPCCnt = iWPCCntr::SurfAvg; // Integer equivalent for WPCCntr field
WindPressureType iWPCCnt = WindPressureType::SurfAvg; // Integer equivalent for WPCCntr field
std::string BldgType = "LowRise"; // Building type: "LOWRISE" or "HIGHRISE" at WPCCntr = "SURFACE-AVERAGE CALCULATIO"
std::string HeightOption = "OpeningHeight"; // Height Selection: "ExternalNode" or "OpeningHeight" at WPCCntr = "INPUT"
int maximum_iterations = 500; // Maximum number of iteration, default 500
Expand Down
Loading
Loading