CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   Suggestion to make spray simulations more stable (

fabianpk October 12, 2007 08:56

Hello, I have a suggestion f
I have a suggestion for how to stabilize the spray simulations in OpenFOAM. After having my fair share of "out of temperature range" errors, Niklas Nordin suggested to me to introduce under-relaxation on the temperature calculation, together with a few iterations. This was ok for some cases, but not for all. After examining closer what happened to each parcel I found out that OpenFOAM has set a lower limit for each parcel's mass to VSMALL (1e-300). This is, in my opinion, far too low, and is (at least as far as I can see now) one of the major causes for janaf thermo related crashes.

For instance, in my spray simulation I had parcels with a total mass of less than 1e-20 kg. This means the droplets in that parcel amount to roughly 60 000 molecules (assuming 100e-3kg/mole) in total. This is also below the machine epsilon, which is at about 2.2e-16 in my case.

I made the needed changes to parcel.C, parcel.H and also made the new limits for minimum parcel mass, relaxation factor and number of iterations runtime-selectable through the spray class, as the spray is passed when parcel::updateParcelProperties is updated. If anyone is interested I can be more precise in how and where the changes were made.


hjasak October 12, 2007 20:41

Hi Fabian, Yup, I'd like to
Hi Fabian,

Yup, I'd like to know - could you please indicate the changes by E-mail.



tsencic October 16, 2007 04:36

Hi, I am also interested in t
I am also interested in the modifications about the spray calculation.

niklas October 16, 2007 06:38

hmmm, not a bad change but Im
hmmm, not a bad change but Im not completely happy about it either, since it requires some a-priori knowledge of the system since you have to give absolute numbers.

The nature of implicit evaporation is you never reach 0, but has to make a cut-off somewhere after
which the residual is added to the gas.

What I didnt think of was that as the mass of the parcel is reduced, the parcel is also more sensitive to energy

It should be pretty straight-forward to compare the characteristic evaporation time and compare with the integration time. If the ratio is
'small enough' and the energy content in the drop is 'small enough' compared to the energy in the gas it should be evaporated immediately.

something like this...

(m^(n+1) - m^n)/delta = - m^(n+1)/tau =>

m^(n+1) = m^p/(1+delta/tau)

if delta/tau > 100 (for instance) and
the energy left in parcel the is lower than 10% (or 1%...dunno how stability/accuracy will be affected)
then it safe to remove the drop and add all.

Would be nice if you could test this Fabian

fabianpk October 16, 2007 06:53

As I've tried more and more ca
As I've tried more and more cases, I've noticed that you sometimes need to have as low under-relaxation as 0.5, so it's not really stable yet, just more stable. What tends to happen for small parcels is that their temperature starts to diverge in one direction (usually down), and as this happen they evaporate more and more mass. If the fix works, the parcel mass hits the minimum mass and is removed. If it doesn't, the code still crashes because the temperature goes below 200. As you say, the parcel becomes very sensitive to energy transfer at these low masses.

I will try to see if comparing evaporation time scales will make things better.


All times are GMT -4. The time now is 16:04.