CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (https://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   Change in trajectory causing problems (https://www.cfd-online.com/Forums/openfoam-bugs/62512-change-trajectory-causing-problems.html)

 fabianpk January 10, 2008 07:47

In OpenFOAM 1.4.1 (or possibly

In OpenFOAM 1.4.1 (or possibly 1.4) there was a change in the lagrangian spray collision model "trajectory". In trajectoryCM.H on line 11, it is now:

scalar vAlign = vRel & (p/dist);

but before it was:

scalar vAlign = vRel & (p/(dist+SMALL));

The division by zero protection was removed, and I'm quite sure it's causing crashes for me, was there a specific reason why it was removed?

/Fabian

 henry January 10, 2008 08:06

The big question is how small

The big question is how small should SMALL be? SMALL is set to 1e-15 when running double precision which may be similar to the real order of magnitude of "dist". If "dist" is so small that it cannot be used in this division what would you like vAlign to be set to?

Henry

 fabianpk January 11, 2008 04:58

I see the problem, but 1e-15 m

I see the problem, but 1e-15 m is of the order of the electron radius, so if they're that close they are in the same spot for all CFD applications. My guess is that this happens around the spray injector where there are many parcels in the same position. Anyway, it could easily be related to a physical quantity, for instance:

scalar mindist = min(p1.d()/10.0,p2.d()/10.0);
mindist = min(mindist,SMALL);

scalar vAlign = vReal & (p/(dist + mindist));

One could also include an if-statement setting vAlign to zero for parcels that close. I'm not sure what would be best without wasting too much computational time. I have found that it's not possible to run the code without some fix for this, at least not if trajectory model is to be used.

/Fabian

 henry January 11, 2008 06:50

If it is OK that vAlign -> 0 a

If it is OK that vAlign -> 0 as dist -> 0 then I don't see a problem with adding a mindist and avoid the if-statement. If 1e-15 is always acceptable then I don't have a problem with the code as it was and we can reinstate the SMALL. Another option would be to add VSMALL rather than SMALL but that may not solve your problem but it might be interesting to try.

Henry

 All times are GMT -4. The time now is 20:40.