buoyantSimpleFoam and watertank
3 Attachment(s)
Dear Foamers,
I am working (since 2 weeks) on a very simple simulation. What I want to simulate: Something like that: http://www.wigaenergietechnik.de/bi...mage/lwsp2.gif What I did:  I meshed the whole geometry with a corse and very fine mesh  I build polynoms for water thermodynamics (30°C70°C)  I changed the thermodynamics for water  Simulation is LAMINAR  Inlet 4e5 m³/s  At the inlet I have a very simple pipe installation but the solver blow up every time so I just set an Inlet + Outlet (thats all  see pictures). Now my problem: Every BC I set make problems. I am not 100% sure how I should set the p_rgh BC for inlet/outlet/wall. p is calculated. For U and T its clear. The solver is working just for 1 or none iterations. If I set of the gravity the simulation is working. It seems that the solver is calculating my water with a compressibility because after the first time step I get extrem huge velocity fields in the big domain. I tried a lot of BC for U + p_rgh  fixed at the outlet  pressureInletOutletVelocty etc. Does someone can give me a hint how to set these BC right? Relaxationfactors are decreased to 0.1. linearUpwind + limitedLinear schemes are used etc... Interesting fact: without gravitation the simulation is working. With gravitation the mass flux cant be calculated: Code:
> FOAM FATAL ERROR: The error message: Code:
Time = 2 Any suggestions would be appreciated. Regards Tobi 
Hi Tobi,
seems to me as your problem might arise due to the initial conditions of p. In your final solution the p field should be close to the hydrostatic field and p_rgh close to constant. However, if you assume p to be constant in the beginning then you get the p_rgh field shown in your plot which leads to high velocities and possibly even to a crash. The problem is that in the very first step the solver uses the pfield to calculate the p_rgh field although your boundary conditions are set for p_rgh and p is set to calculated. So what you can do is either adapt the solver (which is just a change of one line) or probably a little bit easier use funkySetFields to set the initial pressure field to the hydrostatic pressure. Hope that helps Hannes 
Hi Tobi,
As a bypass you could run initially with gravity turned off. Than after say 200 iterations turn gravity on. Unfortunately it is not runtime modifiable so you have to stop (and save) the run, change gravity and rerun from latestTime. Regards, Tom 
3 Attachment(s)
Hi,
thanks for your replays. I tried Toms hints. The pictures show p, p_rgh and U after 500 iterations. Then i turned gravity on and the 501 step is shown in the 2nd replay. @hannes: what lines had to be modified? @all: could it be possible that my polynomes are wrong? 
3 Attachment(s)
Here are the pictures at 501 iterations.
After that my solver blow up: Code:
[5] Code:
p0 = p_rgh + rho*gh Because my tank is 2m high and the fluid is water (1000kg/m³). So as I see in this formula the higher I get in the tank the lower p0 should be because: Code:
rho ~ 1000kg/m³ Therefor p and p_rgh should not be the same? 
Hi all,
just one question. Why is in interFoam the p0 calculation for nonclosedVolumes like that: Code:
p == p_rgh + rho*gh; Code:
p = p_rgh + rho*gh; Tobi 
Hi all,
I made a test with chtMultiRegionSimpleFoam with only one region. Just a very simple case  box with inlet and outlet at the top of the box. If I use the thermodynamics out of the liquidHeater tutorial: Code:
thermoType After switching to my own thermodynamic with the polynoms its blow up after the 4th iteration: Code:
thermoType Therefor I made a test just with the first coefficient like: Code:
Code:
> FOAM FATAL ERROR: I am out of mind and have no further ideas at the moment. Regards Tobi 
Hi all,
just notice: I am stupid! :p All values of mu are wrong. Instead of writing: 503,89e6 I wrote 0,50389e6 After changing this, the easy test case is working. Now I am going to check if my bigger project is working too. 
Okay.
I checked it out with the other case. Without gravity its working (bouyantSimpleFoam and chtMultiRegionSimpleFoam). But after switching on the gravity its still the same. :( Regards Tobi 
Perhaps your problem is the same as described in this thread:
http://www.cfdonline.com/Forums/ope...roperties.html You could also try the transient solver (buoyantPimpleFoam) 
Dear Tobi,
the pictures you showed match exactly the problem we had. I'm pretty sure that your results will improve when you start the simulations with hydrostatic pressure distribution for p. What happens is when you turn on gravity the pressure field rapidly changes in order to be consistent so that's why you get those strong gradients in the p_rgh field which again results in the high velocities. If you don't want to set your p field with funkySetFields then you should adapt your solver. Copy the solver and the only thing you have to change in createFields.H is the line reading Code:
p_rgh = p  rho*gh; Replace it by solving for p: Code:
p = p_rgh + rho*gh Regards Hannes 
1 Attachment(s)
Hi all,
thanks for the hints but it is still not working. On my easy case the chtMultiRegionSimpleFoam solver (only with one domain) is working. But the buoyantSimpleFoam is not working. Additionally I tryed the hints hannes said but not with success. In the attachment you find a picture of the chtMultiSImpleFoam solver and the solution. I have no further idea at the moment. For me it seems that the buoyantSimpleFoam is not a good solver for the thing I want to do. Furthermore the chtMultiSimpleFoam solver is not working in my big case too. Thanks for your help but I think I have to give up on that project. Maybe "WATER" is not very common for the solvers. At least I had a look into the cht solver and the createFields.H file. There is the same calculation as in the buoyantSimpleFoam. So I have no idea why this solver is working and the other one not :/ Regards Tobi 
Hi all,
now the pressure fields are the same (buoyantSimpleFoam and chtMultiRegionSimpleFoam) . I had to change the schemes to get the same results :) Now I am going to check if its working wit a bigger domain. 
Summary with a bigger domain:
 chtMultiRegionSimpleFoam isn 't working anymore  buoyantSimpleFoam isn 't working anymore  myBuoyantSimpleFoam with the modification in the createFields.H is working. Hannes I think the work is done now. I will check my official geometry now. I keep you posted. 
Quote:
Thanks a lot. Just one question to that. Why isn 't it implemented as you wrote? I think there is any reason for that? Additionally with the PIMPLE algorithm it is not working. Do you have any experience with that? Maybe I will initialize it with simple and then switch to pimple. Regards Tobi 
Hi all,
with the modified buoyantSimpleFoam solver my case is working and the steady state result is very nice. After initialize this solution with the buoyantPimpleFoam solver I get crazy p_rgh and p fields again :( 
Hi Tobi,
I can't really tell you why it is implemented that way, I'm not aware of any restrictions at that point. Maybe the thinking is, that it is easier to initialise a pressure field which is a little more intuitiv then to initialise p_rgh when not starting with constant fields. However, concerning the problem with buoyantPimpleFoam I could only guess. First of all, one thing that might become neccessary is to increase your writePrecision in controlDict, the standard six (or eight?) digits are by far not sufficient when small fluctuations in p_rgh are concerned, so that might be a reason why a restart might fail. Otherwise it should be possible to run the simulation with the buoyantPimpleFoam starting from a constant field when the same change to the solver is performed (change in createFields.H). Could you provide some more information on the crash if the above does not help? Hannes 
3 Attachment(s)
Dear Hannes,
thanks for your replay. I also tried to start the simulation with the change in the createField.H. But without success. Additionally I changed the time precision like you said but the same  crash. Here is the output: Code:
Starting time loop Regards Tobi 
If I read your log file correctly, you don't use the nOuterCorrectors loop. Have you tried nOuterCorrectors > 1 with underrelaxation?

Hi,
PIMPLE and underrelaxation? Is underrelaxation not changing the real solution (accuracy in time)? Well I used nOuterCorrectors > 1 but without success anyway. The error is different. I reach the maximum iteration in the temperature calculation: Code:
Courant Number mean: 6.92740210013e09 max: 4.85034908134e06 
All times are GMT 4. The time now is 18:15. 