Thermal Modeling of the Air Flow Inside and Around Your House

Walter Frei June 22, 2016
Share this on Facebook Share this on Twitter Share this on LinkedIn

Have you ever wanted to quickly predict the temperature of an enclosed structure that is exposed to ambient environmental conditions, such as your house? The temperature inside depends on the surrounding air temperature, wind speed, and solar loads, all of which have significant variability. For simplicity, we often also want to approximate the inside air as well-mixed. Today, we will discuss the tools in the COMSOL Multiphysics® software that help you quickly build such thermal models.

Approximating the Airflow Inside and Around Your House

Let’s say that you want to quickly predict the temperature of an enclosed structure that is exposed to ambient conditions. This could be a small structure, such as a junction box on a utility pole or a shipping container, or perhaps a structure that is familiar to all of us: a house.

To begin, we can consider a small house, as illustrated below. The house features four walls, a roof, one big room, a door, and a few windows. We will assume that there is a fan that causes the air inside to be reasonably well-circulated, meaning that if we measure the air temperature at any one point inside, it will be the same as it is at any other point inside the room. This is a very good approximation of what happens if we have a mixing ventilation system.

A model of a simple house.
A very simple model of a house. We are interested in the temperature inside the structure.

Since the air is well-circulated, we only need to solve for a single spatially uniform air temperature. This room’s air temperature varies over time due to the air conditioning and heating, along with heat transfer through the walls. At the outside of the walls, we also need to apply thermal boundary conditions to reflect the ambient air temperature, wind speed, and solar heat loads.

We all know that weather is notoriously unpredictable. Therefore, rather than trying to build a thermal model of the environment around our house, we instead look to historical weather data. The American Society of Heating, Refrigerating, and Air-Conditioning Engineers (ASHRAE) compiles a database of information gathered at weather stations located around the world. In the Heat Transfer module, this tabulated data is available as input for simulations in COMSOL Multiphysics.

Illustration showing the data collected by weather stations, including air temperature, direct and scattered solar irradiance, and wind speed.
A weather station records direct and scattered solar irradiance, wind speed, and air temperature.

The tabulated meteorological data includes the historical data for about 8000 different weather stations spanning the globe. Temperature, dew point, wind speed, air pressure, and direct and diffuse solar irradiation as a function of calendar day and time are available. Direct solar irradiation refers to the radiation that comes directly from the sun, while diffuse irradiance results from the scattering of direct sunlight through the particulates and clouds in the atmosphere. You can use the data from any nearby weather station as a reasonable estimation of the ambient conditions for your models. It is up to you to decide if you want to use the average, the average low or high, or the peak low or high temperature, dew point, and wind speed. Average high and average low are defined as the average plus or minus one standard deviation.

A sample plot depicting various weather data estimations.

Sample plot of average, average high and low, and peak high and low temperature over two days.

Let’s take a look at using such features within COMSOL Multiphysics to help us model the air inside our house and the ambient conditions outside.

Well-Mixed Air Inside a Room: Isothermal Domains

To model a well-mixed fluid domain like the air inside a house, we can use the Isothermal Domains feature available with the Heat Transfer Module. To use this feature, you first need to check the relevant box in the Physical Model settings, as shown in the screenshot below.

A screenshot of the Isothermal domain check box in the Model Builder settings.
The Isothermal domain check box.

Once this functionality is enabled, you will be able to add Isothermal Domain features to the Heat Transfer interface, as depicted in the following screenshot. By default, this feature will compute the total mass and thermal heat capacity of the domain based on the assigned material properties. You can override these calculations with a user-specified domain mass and specific heat, if desired.

A screenshot of the Isothermal Domain interface in the Model Builder settings.
The Isothermal Domain interface.

The temperature variation of the isothermal domain over time is governed by the heat flux into and out of the domain through its boundaries. This is defined via the Isothermal Domain Interface boundary condition, which is illustrated in the screenshot below. You can specify one of several different conditions:

  • Thermal Insulation
  • Continuity
  • Thermal Contact
  • Ventilation
  • Convective Heat Flux

The last of these conditions, Convective Heat Flux, is the most appropriate for describing the heat transfer between the average temperature of a well-mixed fluid domain and a solid domain.

A screenshot showing the boundary condition between an isothermal domain and the surrounding domains.
The boundary condition between an isothermal domain and surrounding domains.

Now that we have seen how to define a uniform air temperature within a house, let’s turn our attention outward, addressing the boundary conditions on the outside surfaces that are exposed to ambient conditions.

Tabulated Environmental Thermal Conditions

The first step is to add a Ambient Thermal Properties node under definitions. Then select Meteorological data (ASHRAE 2017) as data source and choose the location of the weather station with the data that we want to use, Boston in this example. You can choose from about 8000 different weather stations.

A screenshot that shows the selection of the ambient environmental data source.
Screenshot showing the selection of the ambient environmental data source.

Once the station is selected, the data and time can be updated. In case of a transient analysis, the time corresponds to the time for t = 0 s. By default, the software will update the time from the solver, so the ambient conditions will change if you are simulating for a long period of time.

For the temperature, dew point temperature, and wind speed, it is possible to use the average values (default option) that correspond to the mean weight of the measurements done in the selected station. It is also possible to use other values corresponding to, for example, the minimum or maximum values recorded at a specific station. Some of the options for temperature are shown on the previous sample plot.

A screenshot that shows how to define the ambient environmental data.
Screenshot showing how to define the ambient environmental data.

Once ambient conditions are defined, the surrounding air temperature and wind velocity are defined and can be referenced from other features within the physics interface, such as the Heat Flux boundary condition.

A screenshot showing the ambient temperature, pressure, and wind speed settings for the Heat Flux boundary condition.
The ambient temperature, pressure, and wind speed are referenced by the Heat Flux boundary condition.

The ambient solar irradiance is used within the External Radiation Source feature in the Surface-to-Surface interface, when using the Solar Position option, as highlighted below. Note that the ambient data contains the solar flux at noon under clear sky conditions. By entering the location and the time of day within this feature, the software will automatically recompute the orientation of the incident sunlight over the course of the day, as described in our earlier blog post on solar heating.

A screenshot of the Settings window showing the ambient solar irradiance as an input for the External Radiation Source feature.
The ambient solar irradiance is an input for the External Radiation Source feature.

Now that we’ve seen all of the features that can be utilized, let’s take a look at some representative results. The animation below, for instance, plots the temperature over time and shows the incident direction of the solar flux.


Animation showing temperature and incident solar flux.

Further Possibilities for Thermal Modeling in COMSOL Multiphysics®

Here, we have looked features that are useful for modeling structures that are exposed to ambient conditions and filled with well-mixed air. You can also use the COMSOL® to perform similar types of analysis, such as:

Here are some example models that you can use to get started:

Editor’s note: This blog post was updated on 4/1/19.


  1. Babar Raja January 18, 2018   1:29 am

    what does this error stands for and how to solve it ??
    Radiation error: exactly one adjacent domain must be opaque.


  2. Caty Fairclough January 25, 2018   10:37 am

    Hi Babar,

    Thanks for your comment.

    For your question, please contact our Support team.

    Online Support Center:

  3. Byron Edward Kahoali’i Fonseca April 19, 2019   12:22 am

    I do not have the “Definitions” node under Global Definitions.

    Is there a possibility of obtaining it? I have the student trial version of comsol, not too sure if that makes a difference.


Loading Comments...