CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (https://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   improvig stability in timeVaryingMappedFixedValue (https://www.cfd-online.com/Forums/openfoam-bugs/76350-improvig-stability-timevaryingmappedfixedvalue.html)

Romario Lopez May 23, 2010 07:43

improvig stability in timeVaryingMappedFixedValue
 
Hello to all FOAMers,

this is not really a bug, rather an improvement suggestion. I'm using the timeVaryingMappedFixedValue patch mostly to map the results from the velocity measurement (PIV, LDA, you name it) onto the inlet patch in my computational domain. The problem is how FOAM calculates the coordinate system from the point cloud. It takes the first point, then look for the second one, which is further that SMALL, then for the third one, which is further than SMALL and has some angle to the first two. This is indeed correct, but very unstable, since the PIV points are due to measurement precisions not EXACTLY in one plane. This affects the mapping process because the plane chosen by FOAM differs from the "right one". I modified the timeVaryingMappedfvPatchField.C to chose the coordinate system differently:
1) take the first point as the starting point
2) the second coordinate point is the one with maximal distance from the first one
3) the third coordinate point is the one with maximal distance from the line connecting the first two point.

With that modifications (you can understand it as a choice of the "average plane" I was able to get very robust mapping even when the mapped points are not exactly in one plane.

Unfortunately my source code understanding are not deep enough to put the modified code here.

mattijs May 25, 2010 07:20

Sounds like a good idea. I've implemented your points and tested it on the pitzDailyExptInlet tutorial and get very slightly different results probably due to rounding errors. I've pushed it into 16x. Please let me know if you see any problems.

(if you switch on the debug flag for timeVaryingMappedFixedValue it will print out the choice of points)

Thanks,

Mattijs

panda60 July 6, 2010 02:09

I also found this problem in version 1.6 .
But I changed the first point coordinate, and the reading is OK.
Now in version 1.7.0 , The problem seems to have been fixed.


All times are GMT -4. The time now is 18:10.