Development of a Modelica Model for the Texas A&M Smart and Connected Homes Testbed

The Texas A&M Smart and Connected Homes Testbed was developed to enable testing and fair comparison of different smart home technologies and grid-interactive capabilities. Having an accurate building model allows researchers to design and optimize smart home systems before implementing them into the experimental testbed. The Modelica Buildings library gives researchers the flexibility to prototype buildings and energy systems to apply to their research projects. This study develops a Modelica model using the Buildings library for the building envelope of the testbed homes using data from the home manufacturer. The A/C system model is developed from the device’s rated performance data. Each model goes through independent testing before implementation in the complete building model. In the future, real data from the lab homes will be used to tune these models to ensure accurate performance before a final model is made for testing.


Introduction
As Modelica grows in popularity among the research community, libraries are built and maintained by labs to further develop the software.Researchers at the Lawrence Berkeley National Laboratory (LBNL) have created an open-source library, the Modelica Buildings library, which enables researchers in the building science community to design and operate buildings and district energy and control systems (Wetter at al. 2014).This library contains dynamic simulation models for HVAC systems, energy storage, multi-zone airflow, and so much more.The contributions to this library come from many researchers among different institutions that aid in developing these tools for building research.Buildings research is a growing field as the electrification of the grid and modern technology advancements enable the use of new smart home technologies.Whether it is smart thermostats, highefficiency equipment, or even advanced building controls that are being researched, they all require a dependable model of the physical building to develop these complex fields.With the help of Modelica and the Modelica Buildings library, a flexible building model can be constructed while saving time in simulation-based projects.
The Buildings Energy and HVAC&R research group at Texas A&M University has a smart home testbed that will allow for the testing of smart home technologies, smart grid applications, and other residential building research topics.This paper will briefly go over the testbed before walking through the modeling using Modelica and the Modelica Buildings library.The paper will finish with individual model inspection.The future work of this project is to tune and verify the complete Modelica model performance using data taken at the testbed during operation.

Texas A&M Smart and Connected Homes Testbed
The Texas A&M Smart and Connected Homes Testbed (TAM-SCHT) is located at the RELLIS campus in Bryan, Texas, United States.This testbed is used by the Building Energy and HVAC&R research group at Texas A&M University for smart home technology and smart grid applications research (Firsich et al. 2022).It consists of two identical mobile homes of 1,200 ft 2 (111 m 2 ), each having 3 bedrooms, 2 bathrooms and an open living room and kitchen layout.A picture of the testbed can be seen in Figure 1.This testbed is equipped with a wide-range of sensors to collect building envelope measurements, indoor airquality, HVAC operation, as well as detailed power consumption.The homes contain removable walls and replaceable windows to provide potential reconfigurable floorplan and advanced building envelope testing.High efficiency HVAC equipment can be installed for testing and the supply ducts can be switched from overhead vents to floor vents.The testbed is also capable of smart grid research with the addition of a PV panel solar farm and on-site battery storage.The PV solar farm location, system configuration, and budget has been established already.Smart appliances will also allow for demand control strategies with the ability to program the operation and scheduling of these loads.The next section will go through the Modelica modeling process for TAM-SCHT.

Modelica Models
The Modelica Buildings library is used to construct the model of TAM-SCHT.A complete model of the testbed includes a building model made up of three separate thermal zones: a crawlspace, an attic space, and the living floor, as well as an HVAC model.This building model will be used to test new technologies or control strategies before experimental testing within the testbed.A complete Modelica model, with only a cooling HVAC system implemented, can be seen in Figure 1.The following sections will go over each element of the Modelica model.

Building Envelope
The physical building of TAM-SCHT has been constructed using the detailed thermal zone models in the Buildings library.The thermal zones are assumed to be completely mixed air and have been configured with construction details from the building manufacturer.A mixed air thermal zone model has been created for the crawlspace foundation, the actual living zone of the building, and the attic space.These three thermal zones are then connected to form the entire building.Each thermal zone model is constructed with material data from the building manufacturer to get accurate heat transfer into the building.Starting with the crawlspace model in Figure 2, the testbed is built on top of 6 inches (15.24 cm) of caliche white rock but will be modeled as cement for the time being.Each wall of the crawlspace is 0.375 inch (0.92 cm) of plywood at 28 inches (0.71 m) tall.The ceiling of the crawlspace is the floor of the living area zone and is defined as a surface boundary.The heat transfer for this layer is calculated in the living zone model and input to the crawlspace through the heat transfer port along with the temperature.Heat transfer from the ground into the slab layer of the thermal zone is modeled with a fixed temperature thermal conductance.This data uses the average ground temperature in College Station, Texas with a thermal conductance value found from (GreenCast, Syngenta).Because there is nothing inside the crawlspace, there is zero heat input into the internal gains of the thermal zone.The building envelope becomes more involved for the part of the house designed for occupants.Exterior finished layers, weather proofing sheets, insulation, and drywall layers can be found in a typical building wall, from the outside inward.These layers ensure that occupant comfort is maintained throughout the year.For the thermal zone of the living space, the wall construction begins on the outside with a synthetic stucco, then a sheathing layer, next fiberglass insulation between the structural wood framing, and finally 0.5-inch (1.27 cm) gypsum board interior, with a ceiling height of 8.5 ft (2.59 m).Thermal properties of each layer are required and some come from the IECC code compliant house for climate zone 2A (Building Energy Codes Program).The ceiling is made up of cellulose insulation and the same gypsum board for the interior of the zone.The flooring has fiberglass insulation which is beneath the linoleum flooring.Because the floor and ceiling are shared constructions with the crawlspace and attic thermal zones, they are both defined as construction boundaries.The heat conduction through the constructions is modeled in this thermal zone model and then connected to the other thermal zones for the convection, infrared, and solar radiation exchange with the room using the surface ports.The thermal properties of the windows come from the building manufacturer and are defined based on their window area for each exterior wall construction.There is 4 ft 2 (0.37 m 2 ) of window area on the north wall, 60 ft 2 (5.6 m 2 ) on the east side, 15 ft 2 (1.4 m 2 ) on the south side, and 31 ft 2 (2.9 m 2 ) on the west side of the thermal zone construction.The windows of the testbed currently do not have shading or blinds.
Another crucial element to the thermal zone model of the living space is the internal gains.The lab homes were designed for research to be conducted with simulated internal gains that a typical single-family house would experience.The method used to calculate these internal gains of the house come from the Building America Housing Simulation Protocols (Wilson, E. et al. 2014) and the accompanying spreadsheet tool developed by the National Renewable Energy Laboratory and other Building America partners.With this, the internal gains that we would expect to see in a house of this size are calculated with respect to occupants, appliances, and a typical schedule for all.A weekend hourly profile of these loads can be seen in Table 1..7These results can be input into the mixed air thermal zone model as the heat input into the zone, split into radiant, convective, and latent heat transfer.The living space thermal zone also contains supply and return fluid ports for the HVAC to be implemented later.The complete living space thermal zone can be found in Figure 3. ).The angle of the roof is 11° (0.192 rad) and the tilt of the roof construction needs to be specified following the Buildings.Types.Tilt method.In Figure 4, we can see the orientation specifications that is used in the Buildings library.A ceiling has a tilt of 0 radians due to the solar irradiation being on the other side of the surface that faces the sky, viewing as an occupant in the room.A floor has a tilt of π radians and a wall has a tilt of π/2 radians with respect to the occupants in the building.To get the 11° angle for both roof surfaces, the left roof, letter A in the figure, will have a tilt of 0.192 radians and azimuth facing west, and the right roof, letter B, will also have an angle of 0.192 radians but with an azimuth facing east, matching the building orientation.The attic space has no internal gains or heat input into the thermal zone model, just as the crawlspace.Putting all these elements together, the attic thermal zone can be seen in Figure 5.

HVAC System
TAM-SCHT is equipped with a split system air conditioning package, serving a single zone, single thermostat building.The outdoor unit is a 2.5-ton air conditioner and the indoor fan coil unit is rated at 3 tons and has a 10-kW electric heating package.The houses come with a thermostat that operates using dual setpoint control.
To model the air conditioning system, a single speed direct expansion, DX, cooling coil, model is used from the Buildings library.This model uses Equation 1 and Equation 2 to calculate the cooling capacity and energy input ration (EIR) of the cooling coil modeled for the building (Wetter et al. 2014). ̇( () =  1 +  2  +  3  2 + ⋯ (5)   ( , ,  , ) =  1 +  2  , +  3  , 2 +  4  , +  5  , 2 +  6  ,  , (6) To get the coefficients for the modifier functions that are required for the DX coil performance, the rated performance data is fit using ordinary least squares linear regression functions in the scikit-learn Python package.The Air-Conditioning, Heating, and Refrigeration Institute (AHRI) rated performance data of the HVAC system is found using the model numbers of the equipment and (International Comfort Products).The modifier factors that are functions of inlet temperatures are fit to biquadratic polynomials and the modifier factors that are functions of flow fraction are equal to 1 because the air handler that contains the evaporator has a constant speed fan.A sample of the performance data at rated conditions can be found in Table 2 at one condenser inlet temperature.With the performance curves calculated for the split system AC at TAM-SCHT, the Buildings library DX coil is used in the building model as the HVAC system, shown in Figure 6.The thermostat control for the model is representative of the thermostat in the testbed.It uses dual setpoint control with a cooling setpoint of 75°F (23.9°C) and a heating setpoint of 69°F (20.6°C).An on/off controller is implemented with a temperature setpoint of 75F with a dead band of 2°F (1.11°C) to mimic the cooling operation in the homes.The thermal zone temperature output from the living floor model is also input to the controller to operate the DX coil.The fan that moves air into the living thermal zone model is a constant mass flow rate fan that operates at the single speed nominal condition.

Modelica Model Verification
This section will cover the integration of the thermal zones and HVAC system into one complete model.Initial tests were run to verify the performance of each separate model.The following sections will present the initial results from testing.The period of testing is seven days from August 4 th to August 11 th of 2022 in which on-site weather conditions are used.

Building Envelope Verification
The thermal zone models are tested individually to show their performance before implementing into the larger model.An example of the model verification can be seen in Figure 7. Weather data that has been recorded from an on-site weather station and solar radiation data is pulled from (Solcast) to create a TMY3 weather file for Bryan, Texas for the seven days tested.A fan moving the outdoor air into the zone will show the effects on the thermal zone temperature after an intial temperature of 75°F (23.9°C).This can also be seen in Figure 8.We expect this performance from a recently built house with good insulation, even with the outdoor air influencing the zone temperature.The attic and the crawlspace undergo the same verification simulations as the thermal zone but without the fan connection because the two zones do not have air flow through them.The crawlspace perfrmance over the week can be seen in Figure 9 and the attic performance can be seen in Figure 10.These results are what is expected as the crawlspace temperature influence comes from the solar irradiation and the ground heat transfer.For the attic, solar irradiation plays a big role in the temperature influence of the zone.If the horizontal global radiation is plotted alongside the outdoor dry bulb and zone air temperatures, the zone temperature effects follow the radiation during the week simulation period, resulting from the local weather.After the building thermal zone models, the HVAC cooling system is next to check.

DX Coil Verification
For the DX coil verification, the AHRI rated conditions performance data is used to check the accuracy of the model.These rated conditions come from the same data as table 2. The condenser inlet temperature, the outdoor dry bulb temperature for a split system AC unit, and the evaporator inlet temperature are supplied to the model.A quick simulation is run and the cooling capacities and power consumption is compared to the tabulated ratings data.
The model that is used to verify the cooling capacity and power consumption of the DX coil can be seen in Figure 11.This model comes from the air cooled DX coil example called single speed.Modifications have been made to this example.A constant condenser inlet dry bulb temperature is wired to the DX coil model along with a constant on signal for operation.A wether file is used to supply the wet bulb temperature to the moist air media that is supplied as the evaporator inlet air, also a rated condition from AHRI performance data.A constant mass flow rate fan is used to pull the moist air media through the DX coil at the nominal condition.Relative humidity, wet bulb, and dry bulb temperatures are measured for the inlet air to ensure that the rated condition being run is satisfied.Each rated condition was run to compare the total and sensible cooling capacity, as well as the power consumption from the DX coil.The results from the rated performance and the simulated perforamnce can be seen in tables 3-5.The DX coil model performs accurately at the highest 4 temperatures at the evaporator inlet.The lowest 2 temperature conditions perform significantly worse at every condenser inlet condition.Improvements to the model will be discussed in the future work section of this paper that follows.

Integrated Envelope and HVAC Model
With all three thermal zone models and the HVAC cooling model completed and verified, they can now be connected together to simulate the operation of TAMSCHT.Because the surface boundaries were defined in the attic and crawlspace model, a heat port is used to connect with the boundary construction that calculates the heat transfer.Figure 1 shows the complete model and each thermal zone is connected to each other.The HVAC cooling system implementation in the complete model is discussed in section 3.2.
The indoor temperature of the living space is plotted in Figure 12 along with the outdoor dry bulb temperature and the setpoint for the thermal zone.The Modelica simulation of the one week period shows that even with the high temperatures, the room setpoint was met.The testbed does not haev any problems reaching this setpoint as it is a newly built home.However, t he zone temperature control can be seen as faulty as the temperature drops to the lower bound of the setpoint deadband.This will be discussed in the future work.For validating the Modelica model of TAM-SCHT, we look to compare the simulated AC power consumption against measured power consumption.Detailed power metering in the testbed contains data sampled every minute on the power consumption from each end use.Figure 13 shows the comparison of the simulated power consumption against the measured data.The simulated results managed to capture the trend of the AC power consumption, while further model calibration is necessary to corrrect the minor over-estimation.

6
Future Work Based on the initial simulation results of this integrated model using on-site measure weather data illustrated in te previous section, tuning and model calibration is necessary to improve the model accuracy.On the envelope side, the envelope of the living space thermal zone contains a few materials that are common of code compliant construction in IECC climate zone 2A.Due to limited information from the manufacturer, these materials were substituted in for the layers with descriptions too vague to find thermal properties for, like the "engineered wood panels" on the exterior of the houses.For the DX coil model, the accuracy at lower evaporator inlet temperature needs to be improved.The DX coil modifier functions need to be calibrated as shown by the over-estimated power consumption from Figure 13.The actual data allows us to tune these model inputs to match the actual on-site measurement.
Further improvement and calibration of this Modelica model is being carried out with the increasing stream of on-site measurement data following the progress of sensor deployment.The model for electric furnace will also be implemented for the testing during the heating season.

Conclusion
An accurate building model is crucial for simulation based research.Data from the building manufacturer, equipment distributor, and knowledge of modeling techniques in Modelica are necessary to have a model for testing.In this

Figure 3 .
Figure 3. Living space thermal zone model.The thermal zone model of the attic varies from the other models due to the geometry of the double-pitched roof.Just like the crawlspace model, the floor of the attic is defined as a surface boundary and connected to the heat port of the living space thermal zone.The walls have the same construction but without the fiberglass insulation and gypsum board layers.The double-pitched roof is made up of 0.438-inch (1.11 cm) OSB roof decking with asphalt shingles.The thermal properties of these layers are found in (property ref.).The angle of the roof is 11° (0.192 rad) and the tilt of the roof construction needs to be specified following the Buildings.Types.Tilt method.In Figure4, we can see the orientation specifications that is used in the Buildings library.A ceiling has a tilt of 0 radians due to the solar irradiation being on the other side of the surface that faces the sky, viewing as an occupant in the room.A floor has a tilt of π radians and a wall has a tilt of π/2 radians with respect to the occupants in the building.To get the 11° angle for both roof surfaces, the left roof, letter A in the figure, will have a tilt of 0.192 radians and azimuth facing west, and the right roof, letter B, will also have an angle of 0.192 radians but with an azimuth facing east, matching the building orientation.

Figure 6 .
Figure 6.HVAC model for the cooling.

Figure 7 .
Figure 7. Thermal zone verification model with a fan.

Figure 8 .
Figure 8. Temperature profile of the outdoor dry bulb (red) and the indoor thermal zone (blue). 120

Figure 9 .
Figure 9. Crawlspace temperature verification results with outdoor dry bulb (red) and zone air (blue).

Figure 10 .
Figure 10.Attic temperature verification with outdoor dry bulb (red), zone air (blue), and the horizontal global radiation (green).

Figure 11 .
Figure 11.DX Coil verification model, derived from the single speed example.

Table 1 .
Weekday hourly profile of calculated internal loads.

Table 2 .
Sample rated performance data from AHRI at 1000 CFM.

Table 3 .
DX coil performance at a condenser inlet temperature of 29.4°C, dry bulb.

Table 5 .
DX coil performance at a condenser inlet temperature of 29.4°C, dry bulb.