CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Strange temperature behaviour with interFoam (https://www.cfd-online.com/Forums/openfoam/110470-strange-temperature-behaviour-interfoam.html)

tayo December 11, 2012 15:51

Strange temperature behaviour with interFoam
 
Hello all,

I added energy equation to interFoam following example in this trend

It compiles, runs and converges fine but I keep getting strange results with the temperature. I simulated rising bubble at high pressure. The problem is that after few time steps, the bubble temperature acts like a heat source such that the bubble temperature rises (+30k) above the saturated temp even when the surrounding liquid is also set at saturated condition. It's like perpectual motion machine of the 1st order (no heat source yet bubble temperature keeps increasing, even when I initialize the bubble temp to same as the surrounding). The bubble should atleast stay at around the same temperature as the surrounding liquid for now, right?

Temperature BC used are same as bubble, i.e. inlet, wall and internal field are at saturated temp; no phase change and no wall heating for now. My solver seems fine, similar what was used in the trend. 0.5 was used for maxCo and maxAlphaCo. Please how do I get the bubble temperature to behave right? Every advice is welcomed please. Thanks

olivierG December 12, 2012 04:14

hello,

I faced this issue some time ago with this solver (interFoam + T).
To solve this issue, i have added a limiter to T (min and max), and also use a lower time step + more corrector for the Pimple loop.
This effect (heated bubble) should disappear after some time step, and the limiter on T will not be used, but help for the first iterations.

regards,
olivier

tayo December 12, 2012 12:53

It has been resolved. Thanks Oliver. I actually noticed that setting the maxCo and maxAlphaCo to around 0.1 provided better results, yet it did not really resolve the issue. The true problem was with convective term. The way it was computed in the trend is not quite correct. What I did was to divide through my rhoCp and solve the energy eqn in the form below.

ddt(T) + div(phi,T) == laplacian(kappa/rhoCp,T)

From this, I think the best way to compute the convective term might be to simply multiply the flux with rhoCp i.e.
rhoPhiCp = phi*rho1*cp1*alpha1 + (scalar(1) - alpha1)*rho2*cp2*phi

thus, solving energy eqn as in the trend would be
ddt(rhoCp,T) + div(rhoPhiCp,T) == laplacian(kappa,T)

Note that I computed my kappa using simple VOF relation:
kappa = k1*alpha1 + k2*(scalar(1) - alpha1)


Now, I have another question:
What's the effect of including pressure in the equation? i.e.
ddt(rhoCp,T) + div(rhoPhiCp,T) + div(phi,p_rgh) == laplacian(kappa,T)
Every comment is welcomed.

seju July 11, 2014 06:07

dear foamer,
I know this post write for many time ago,but I face to this problem right now, I wanna simulation rising bubble with temp, following this boundary conditions:
upper wall 312k
and else is zeroGradient and my box have 298k.
after few iteration bubble temp be 400k.
can you help me plz?
how can I solve this problem?

olivierG July 11, 2014 06:16

Hello,

You can now use compressibleInterFoam (from OF 2.2. and 2.3).

regards,
olivier

seju July 11, 2014 06:39

Quote:

Originally Posted by olivierG (Post 501104)
Hello,

You can now use compressibleInterFoam (from OF 2.2. and 2.3).

regards,
olivier

dear olivier
in my case bubble is incompressible. how can used this solver? don't you know about my problem? why bubble temp increase?
best regard
Sajad

olivierG July 11, 2014 06:51

hello,

Well if the temperature of the bubble will change, then your case is not incompressible, unless you consider small temperature variation.

And even with incompressible gaz (thus small temperature effect), you can use compressibleInterFoam solver.

regards,
olivier

seju July 11, 2014 07:04

Quote:

Originally Posted by olivierG (Post 501109)
hello,

Well if the temperature of the bubble will change, then your case is not incompressible, unless you consider small temperature variation.

And even with incompressible gaz (thus small temperature effect), you can use compressibleInterFoam solver.

regards,
olivier

dear olivier
thanks for reply again, I wanna simulation bubble next to a wall, wall have 312k and box have 298k, after spend time, I must saw change bubble temp change but this change is between 298 to 312. but I saw this temp=400k, for this simulation can I use compressibleInterFoam?
thanks

tayo July 11, 2014 07:20

Hi Seju, double check how you're implementing the convection term in your energy equation. Seems you might have problem with your flux.

seju July 11, 2014 07:28

Quote:

Originally Posted by tayo (Post 501117)
Hi Seju, double check how you're implementing the convection term in your energy equation. Seems you might have problem with your flux.

dear Tayo
this is my energy equation:
fvScalarMatrix TEqn
(
fvm::ddt(rhoCp, T)
+ fvm::div(rhoPhiCpf, T)
- fvm::laplacian(kappaf, T)
);

TEqn.solve();
I simulation same you simulation this and I use
HTML Code:

[B]Diverging result for Temperature field in interFoam [/B]
I dont know why this is wrong. I valid this code for single phase but in two phase I have strange temp.


All times are GMT -4. The time now is 12:38.