Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question
3

Is temperature inversion correction in stratified tank model of Buildings Library dimensionally correct?

asked 2017-02-05 12:17:57 -0500

dhumane's avatar

updated 2017-05-04 08:44:37 -0500

I was reading code for the stratified tank model in particular the buoyancy model (Buildings.Fluid.Storage.BaseClasses.Buoyancy, see code on GitHub).

Q_flow[i] = k*noEvent(smooth(1, if dT[i]>0 then dT[i]^2 else 0));

Now k has dimensions W/K, so right hand side becomes [W/K * K^2] while left hand side is [W].

The old implementation was:

Q_flow[i] = k*max(heatPort[i+1].T-heatPort[i].T, 0);

which is dimensionally correct.

The smooth operator does not differentiate dT^2. Is this a correction factor kind of equation and so we do not look at dimensions? What am I missing here?

edit retag flag offensive close merge delete

Comments

@Neal Kruis, @AaronBoranian: The MathJax extension is no longer working

Julien Marrec's avatar Julien Marrec  ( 2017-02-07 07:27:05 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2017-02-07 01:54:12 -0500

updated 2017-02-07 07:36:20 -0500

This was changed on September 16, 2011 by Michael Wetter (see revision notes in the model file. The model's revision notes state:

Changed the implementation from Q_flow[i] = k*max(heatPort[i+1].T-heatPort[i].T, 0); to Q_flow[i] = k*smooth(1, if dT[i]>0 then dT[i]^2 else 0);.

The previous implementation was not differentiable. In modeling a solar system, this change reduced the computing time by a factor of 20 during the time when the pumps were almost switched off and colder temperature was fed from the collector to the tank.

The new formulation is differentiable and triggers no events, which makes it easier for Newton-solvers to find a solution, and avoids a computationally expensive event iteration which was done in the old implementation whenever the result of the if-then condition changed.

edit flag offensive delete link more

Comments

Thanks Michael! That was very helpful

dhumane's avatar dhumane  ( 2017-02-07 19:27:32 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Careers

Question Tools

1 follower

Stats

Asked: 2017-02-05 12:17:57 -0500

Seen: 197 times

Last updated: Feb 07 '17