I'm working on a simple calculation-model for a hot-water-storage. At the moment I'm stuck on implementing natural convection.

To calculate the temperature I've implemented a simple 1D-model in python. My tank consists of vertically stacked volumes/cells. If the temperature of one cell is higher than that of the cell above, as shown for cell 5 with a temperature of 50°C, I want to calculate the resulting massflow.

Model of instable stratified tank

So far I tried to implement the buoyancy-model used in modelica (which is calculating a heat-flow instead of a massflow. That's quite ok...). But I can't get it to work properly. The resulting increase in temperature is just massive (and the units don't fit)... The code for the model can be found here: Modelica buoyancy model
A short example for my calculations (default values are for the mean temperature of T4 and T5: 40°C): $$ \tau = 60\,s, \ \ V = 0.1\,m^3, \ \ T_4 = 30\,^\circ C, \ \ T_5 = 50\,^\circ C, \ \ \rho_{def} = 992.21\,\frac{kg}{m^3}, \ \ c_{p_{def}} = 4178.63\,\frac{J}{kgK} $$ $\Delta T = 20\,K$
$k = \frac{V \rho_{def} c_{p_{def}}}{\tau} = 6910\,\frac{W}{K}$
$Q_{flow} = \dot{Q} = k * \Delta T^2 = 2.7641e6\,\frac{JK}{s}$
$Q = Q_{flow} * \tau = 1.6584e8\,JK$
$\delta T = \frac{Q}{c_{p_{def}}V\rho_{def}} = 400\,K^2$
$sqrt(\delta T) = 20\,K = \Delta T$
So basically the result is my input... Is there a mistake in translating the modelica-code to equations? Or how does modelica get useful results out of this?

My second approach to solve the buoyancy-problem is the use of equations for thermals as in this link at page 171: Plumes and Thermals
But here I'm stuck at calculating the correct buoyancy of cell 5. (I know this sounds simple, but after about 4 days of trying to solve this problem I guess my brain just turned to butter).
When calculation the buoyancy like shown in this image: Pressure_distribution_on_an_immersed_cube

And transferring this to my storage-model with cells:
How do I calculate the forces on cell 5? Do I have to consider the density of cells 1 to 3 to calculate the force on the top of cell 5 and cell 6 for the force on the bottom of cell 5?
Or if working with displaced fluid and using the buoyancy forumla $B = \frac{\rho_\infty - \rho_{Cell 5}}{\rho_\infty} g V$: Which density should I use for the surrounding fluid? Am I calculating the density by 50% density of cell 4 and 50% density of cell 6?

Thanks so far! And if anyone got a better idea on how to work on the buoyancy calculation: I'm grateful for your advices!


Thank you for posting your question in so much detail. Unfortunately I think it cannot be answered on this site.

The first line of your question shows that you have unrealistic expectations. Although it is quite easy to explain how and why natural convection occurs, it is a very complex phenomenon to calculate and simulate - not "simple".

The fact that you are using a 1D model suggests to me that you do not know what you are doing. Convection requires lateral as well as vertical motion : it cannot be modelled in 1D.

I am not able to comment on your code and why it might not be working, or the mathematical model contained in it, because I am not familiar with Modelica and am not willing to spend time studying it. Problems with your coding are "off topic" in Physics SE, but might get an answer in Stack Overflow.

Your calculation does not have any meaning for me because you do not explain what you are doing and the calculation is not self-explanatory. It appears to be entirely a calculation of heat flow. If this is a buoyancy calculation, there is something very obviously missing : a pressure gradient. Without a pressure gradient (usually caused by gravity) there can be no buoyancy and no convection, only conduction.

In the 2nd method you clearly recognise the need for a pressure gradient and that fluid will be displaced. The need to have somewhere for fluid to be displaced sideways is why convection cannot be modelled in 1D. Your questions here again suggest that you have no idea what you are doing.

This site cannot provide tuition in physics to help you understand how buoyancy and convection work. (There are plenty of articles and videos online, and books in libraries.) Nor can it help you with coding.

May I suggest that, instead of asking for help in developing a computational model to simulate your hot-water storage tank, you ask the question which your simulation is trying to answer. That question might be one that can be answered on this site.

  • $\begingroup$ I'm terribly sorry if you felt attacked by my question. I didn't want to attack you or your self-esteem by asking what I asked. But I don't think you speak on behalf of all people here on this site. I know it can be answered by someone with a background in fluid dynamics. But perhaps I should rephrase the question. Looking over it I see that it is kind of confusing. Thanks for pointing that out. And concerning your assumption that I don't know what I'm doing: I know what I'm doing. I could easily implement the relevant differential equations and solve the linear equation system. $\endgroup$ – Scotty1- Jun 20 '16 at 11:40
  • $\begingroup$ But that’s not what I want to do. That has already been done a million times in CFX etc… I need calculations over a time span of several weeks. Using CFX this would take years. Thus I want to translate the effects of buoyancy to a simple (semi-)empirical model. I do NOT need the 3D flow velocities in a high resolution grid. And I do NOT need the exact representation of vortices, turbulences or any short-scale pertubations. $\endgroup$ – Scotty1- Jun 20 '16 at 11:41
  • $\begingroup$ Thus I wrote that I implemented a 1D-model. And my time-step-size is going to be around 1s to 60s, depending on the CFL-number. But perhaps I should have emphasized the low degree of accuracy that I need. $\endgroup$ – Scotty1- Jun 20 '16 at 11:41
  • $\begingroup$ Additionally your answer on my first question shows that you have no idea what you are doing. I clearly wrote that this model simulates the mass-flow by calculating a heat-flow and that this is absolutely ok for me. And if you are not willing to spend time on it, then why bother spending time for a full-page rant? $\endgroup$ – Scotty1- Jun 20 '16 at 11:42
  • $\begingroup$ Wouldn’t it be smarter to be not spending any time by not answering at all? I asked for help with my problem, I did not command you or anyone else to solve all my problems and do work for me. Perhaps you should spend your time with some self-esteem or social skill courses instead of ranting on online forums… And if fluid dynamics is not your topic it might be better to now answer on it. $\endgroup$ – Scotty1- Jun 20 '16 at 11:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.