## Using Global Equations: Modeling Room Air Temperature in a House

##### Walter Frei | September 20, 2013

An interesting question came up the other day that I felt would make an excellent blog post since it allows us to discuss one of the very powerful, and often underutilized, features of COMSOL Multiphysics: the Global Equation. In this post, we will look at using global equations to introduce an additional degree of freedom to a model. This additional degree of freedom will represent something we do not want to model explicitly.

### The Scenario

Let us consider a small house with a person inside, as shown below. There is a fan circulating air, mixing it thoroughly, so we can assume the inside air temperature is constant. There’s a stiff breeze outside, and we know the outside air temperature. We’ll also assume that the ground underneath is at a constant temperature. The average person at rest dissipates about 75 W of heat. We would like to find out the air temperature inside of the house, and the temperature gradient through the walls.

### Setting up the Model

Now, if we wanted to be very accurate, we could build a conjugate heat transfer model of this, and solve for the temperature field and the fluid flow inside of and around the house. (If you want to build a model of all the airflow in your room, please see this example of Displacement Ventilation in a Room to get started.)

However, solving for the fluid flow is going to be computationally demanding, as compared to just solving a heat transfer problem. And if you’re familiar with heat transfer modeling, you know that there are tabulated heat transfer coefficients, h, for vertical and horizontal walls that relate the inward heat flux, q'', to the wall temperature, T, and the air temperature, T_{air} via the equation: q''=h(T_{air}-T). If the air is hotter than the wall, heat will flow into the wall and vice versa. So using this equation, we don’t need to solve for fluid flow at all, but we do need to know the air temperature inside the house. Let’s draw a simplified engineering sketch of how this can be modeled:

Here, the house walls are modeled explicitly via the finite element method; the true wall dimensions are used and appropriate material properties are applied. The field being solved for is the temperature of the walls and we are assuming steady state conditions. We know the outside temperature, ground temperature, and all heat transfer coefficients, so this problem is almost solvable. But… we do not know the air temperature inside the room, T_{air}. So the air temperature is the one additional unknown that we need to add to this finite element model.

Along with the unknown, we need to know what equation this variable must satisfy. In this case, the choice is clear: we want to ensure that the sum of all the heat going in and out of the volume of air equals zero. That is, if we take a surface integral of the heat flux between the interior walls and air, and add the heat contribution from the person, this should equal zero:

### Using Global Equations to Solve the Model

Let’s take a look at the *Global Equation* interface, which gives us a list of variable names to enter — we’ll use **Tair** — and the equation to satisfy. In the field defining the equation, we will use an *Integration Coupling Operator* named **intop** to integrate the normal total energy heat flux variable, **ht.nteflux**, across all of the wall boundaries. Since this is a steady state problem, it doesn’t matter what initial conditions we give for this variable. When setting this up, make sure to turn on the *Advanced Physics Options* in the Model Builder so that you can add global equations to a physics interface. When you are solving a problem with global equations, you will want to use a *Fully Coupled Stationary* Solver with a *Direct Linear System* Solver.

*The* Global Equation* interface, as well as the appropriate solver settings.*

After we solve this model, we’ll be able to visualize the temperature distribution on all of the interior walls, and evaluate the air temperature via **Results > Derived Values > Global Evaluation**. We have simplified the problem by assuming that the air has a uniform temperature, and thus simplified the modeling, via the usage of the Global Equation. The approach shown here assumes that the thermal mass of the air is negligible, but if we wanted to model this as a transient problem, we could include the time-derivative of the air temperature and the total mass and specific heat of air in the global equation as well.

### Next Steps

If you would like to see an example that walks through all of the steps of setting up a global equation in your model, please see this example of Using Global Equations to Satisfy Constraints. If you think that using global equations will be helpful for your modeling and are interested in learning more about COMSOL Multiphysics, please contact us.

#### Post Tags

Technical Content### Get new posts by email

### Categories

- Applications (39)
- Certified Consultants (33)
- Chemical (69)
- Batteries & Fuel Cells (18)
- Chemical Reaction Engineering (28)
- Corrosion (14)
- Electrochemistry (10)
- Electrodeposition (5)

- COMSOL Now (152)
- Conference (116)
- Core Functionality (122)
- Equation-Based Modeling (16)
- Geometry (6)
- HPC (12)
- Meshing (22)
- Postprocessing (30)
- Solvers (17)
- UI (4)

- Electrical (182)
- AC/DC (55)
- MEMS (25)
- Plasma (7)
- Ray Optics (11)
- RF (50)
- Semiconductor (6)
- Wave Optics (15)

- Fluid (124)
- CFD (60)
- Microfluidics (16)
- Mixer (5)
- Molecular Flow (11)
- Pipe Flow (10)
- Subsurface Flow (10)

- Interfacing (44)
- Mechanical (226)
- Acoustics (40)
- Fatigue (12)
- Geomechanics (5)
- Heat Transfer (108)
- Multibody Dynamics (13)
- Nonlinear Structural Materials (9)
- Structural Mechanics (73)

- Multipurpose (24)
- Optimization (11)
- Particle Tracing (15)

- Tips & Tricks (13)
- Trending Topics (63)
- User Perspectives (98)
- Video (73)

## Comments

Ishant JainSeptember 21, 2013 12:52 pmPlease share some documentation, how we can use equation directly.

Enzo MaierJanuary 5, 2014 9:29 amDear Walter,

great information you provide in this blog! Although I still have a question on “.., you will want to use a Fully Coupled Stationary Solver with a Direct Linear System Solver”. Why is that? If I add a Gloal Equation as separate physic, can I use a segregated stationary solver / iterative linear solver? Thanks for your reply.

Walter FreiJanuary 6, 2014 9:10 amDear Enzo,

The reason why you would want to use a fully coupled solver are described here:

http://www.comsol.com/blogs/solving-multiphysics-problems/

Basically, you cannot solve one equation without the other. If you try to solve it by hand, the issue will become immediately apparent.

YongweiLi YongweiLDecember 11, 2014 4:32 amDear Walter:

Interior wall Overrided by Thermal Insulation is not applicable In Comsol 4.4 ,How did you implement Boundary Selection of Heat Flux ?

Walter FreiDecember 22, 2014 9:00 amDear YongweiL, There is no interior wall with a thermal insulation to override here. The boundaries conditions you are applying here are not *interior* to the modeling domain.