CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   negative temperature with twoPhaseEulerFoam (https://www.cfd-online.com/Forums/openfoam-solving/234875-negative-temperature-twophaseeulerfoam.html)

Taendyr March 22, 2021 11:49

negative temperature with twoPhaseEulerFoam
 
3 Attachment(s)
Hi,



I'm trying to simulate a mix of gas and dust against a disc using twoPhaseEulerFoam. After some iterations, the solver stops without any error message, but we can see some negative temperature for the air:
Courant Number mean: 0.122993 max: 0.401974
Max Ur Courant Number = 0.0456224
Time = 0.195

PIMPLE: iteration 1
MULES: Solving for alpha.particles
MULES: Solving for alpha.particles
smoothSolver: Solving for alpha.particles, Initial residual = 1.22398e-08, Final residual = 2.15733e-15, No Iterations 1
alpha.particles volume fraction = 0.199907 Min(alpha.particles) = 0.00159117 Max(alpha.particles) = 0.992272
Constructing momentum equations
smoothSolver: Solving for e.particles, Initial residual = 0.0643472, Final residual = 2.2115e-12, No Iterations 3
smoothSolver: Solving for e.air, Initial residual = 0.252945, Final residual = 2.55661e-13, No Iterations 5
min T.particles 119.995
min T.air -18672.9
GAMG: Solving for p_rgh, Initial residual = 0.999183, Final residual = 3.63007e-18, No Iterations 1
GAMG: Solving for p_rgh, Initial residual = 1.40899e-18, Final residual = 1.40899e-18, No Iterations 0
PIMPLE: iteration 2
MULES: Solving for alpha.particles
MULES: Solving for alpha.particles
smoothSolver: Solving for alpha.particles, Initial residual = 1.07889e-08, Final residual = 2.02332e-15, No Iterations 1
alpha.particles volume fraction = 0.199984 Min(alpha.particles) = 0.00158145 Max(alpha.particles) = 0.996012
Constructing momentum equations.


I tried to change the pressure tolerance, to change deltaT,etc.. I always have this behaviour.


How can I fix it ? Imposing a limit to the temperature doens't work.



I joined the files case.

shock77 March 23, 2021 04:33

There might be several reasons. You can start with first order schemes instead of vanLeer. Why do you use vanLeer btw? Do you have strong gradients? You should also check your pressure BCs, because I dont think "calculated" for all boundaries is physically correct.


Also you can implement the limitTemperature function in your solver. There are some instructions how to do that in this forum.

Taendyr March 23, 2021 05:40

Thanks, I am, indeed not really sure about the BCs.
Limiting the temperature doens't work.


I should have strong gradient indeed. It is supposed to have some shocks

shock77 March 23, 2021 05:46

Did you implement the limitTemperature functionality? Because it is not implemented in the standard version of the solver.


If you have shocks than using a limiter makes perfect sense.

Taendyr March 23, 2021 08:31

I was using this in fvOptions:
Code:

limitTemperature
{
    type    limitTemperature;
    active    true;
    limitTemperatureCoeffs
    {
        selectionMode all;
        phase air;
        min    10;
        max 200;
    }
}

I get a Temperature of 10 everywhere in the domain (except for the inlet which is ok) since the first iteration

shock77 March 24, 2021 04:25

10 K for air is really really low. The only gas I know that stays in its gaseos form is helium for 10 K. So air should be either liquid or solod depending on the pressure. You should definitly check your BCs.

Taendyr March 24, 2021 05:44

imposing 10 or 120 for the minimum gives me same behaviour actually. It is indeed not air for the gas, I just kept the name "air"

shock77 March 24, 2021 05:47

Did you implement the limitTemperature utility? As I said, its not implemented in the standard openfoam version. You can add whatever your want in fvOptions, if its not implemented, you wont see any impact.

Taendyr March 24, 2021 06:07

oh ok. I thought that waht I put in fvOptions was ok. So, no, I didn't

shock77 March 24, 2021 06:12

That's what I thought from start.


Here is how you do it: https://www.cfd-online.com/Forums/op...residuals.html

Taendyr March 24, 2021 07:13

Ok thank you, I'll do it.


But I don't understand this solution. The solver crashes, by imposing a boundary, it won't anymore but I don't understand how it can give me good results

shock77 March 24, 2021 07:27

I still think that your BCs are wrong. "Calculated" for all your boundaries doenst make sense for me. That way your pressure can rise or drecrese to infity or negative values. I have really good experiences with the totalPressure boundary condition. I dont know your case, but you should definitly check your BCs!

Taendyr March 24, 2021 09:30

Yes, I changed them to zeroGradient for the outlet and the walls and fixed it for the inlet, the behaviour remains the same



When I look at the temperature, I have some instabilities on the walls. I guess the crash emerges from there. I don't what's wrong for the pressure or the temperature for the walls' BC (zeroGradient for both). Can it come from somewhere else ?

shock77 March 24, 2021 09:39

zeroGradient for pressure and temperature at the walls is correct for adiabatic walls. I dont think thats the issue. If there are troubles at the walls, it could come from several reasons, e. g. bad mesh quality, or too big or too small cells (logarithmic law). What are your y+ values at the wall?


I usually use for the inlet totalPressure, totalTemperature and pressureInletOutletVelocity for U. For the outlet waveTransmissive for u and p and zeroGradient for T. I dont know how your mesh and how your geometry looks like. If you post some images of your u-fields and your mesh, I might be able to help you better.

Taendyr March 24, 2021 10:27

5 Attachment(s)
Thanks, I'm going to have a look on how work tho one you gave me.


here are some pics.


This is the only part of the domain where I have someting. Otherwise the variables kept their initial values.
These were taken with the BCs I used.

shock77 March 24, 2021 10:34

The mesh looks ok acutally. I dont know what kind of application that is, but velocities of 4000 m/s are really difficult to reach. Do you expect such high velocities?


And check if the BCs I suggested are applicable for your application.

Taendyr March 24, 2021 10:36

Actually I need, in further simulation, go until 9km/s:mad::mad:


All times are GMT -4. The time now is 07:14.