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/)
-   -   Line data in runtime (https://www.cfd-online.com/Forums/openfoam-solving/59825-line-data-runtime.html)

magnus February 9, 2007 11:44

Hi, I want to save line dat
 
Hi,

I want to save line data from my LES case in runtime. Do anyone know if there is a tool already implemented for this ? If there is I did not find it..

What I did so far was to use the tool sampleLine in my own routine i.e. I define my lines and then use OpenFOAM's sampleLine to interpolate the values. Then I write the data manually from my own routine. The structure of the solver looks schematically something like this:

create all fields,points,lines:
...
...
define lineVar // (contains start,end,nrPoints)
line=new sampleLine(lineVar) // (calls the tool sampleline which finds the cells in the mesh which defines the line)

start time looping of LES:
...
...
phi_line=line->line.interpolate(phi) // (interpolate the variable phi to the line, using the line memberfunction interpolate)

write the line

end time loop


This works fine in serial, but when I try to use it in parallel, the interpolation function gets stuck and the solver hangs.

Maybe this is a stupid way to do it, but as I said I found no other tool for this. what would your solution to the problem be?

best regards
/M

magnus February 13, 2007 10:05

Hi, I tried to debug my cod
 
Hi,

I tried to debug my code and it seems the bug is inside sampleLine. But I am not sure how or why. I would relly appreciate some help here.. All suggestions are welcome!

best regards!
/Magnus

pierre February 13, 2007 11:10

Hello, I might be wrong but
 
Hello,

I might be wrong but I think that sampleSurface is fully parallelised but not sampleLine (although I have only used them as post-proc tools).

Although it's a bit annoying, you can just use sampleSurface and write it, and write a little routine then to pick out line data from the surface data.
Other solution make the line sampling utility fully parallelised.

Hope this helps

Pierre

magnus February 14, 2007 08:19

Hi, thanks for your input P
 
Hi,

thanks for your input Pierre!

I guess I will have to study the lineSampling code more thoroughly. It feels like using the sampleSurface utility and then extracting lines will take about the same effort as fixing the current problem. It is only a matter of 2d vs 3d in this case right?

Best regards
/M


All times are GMT -4. The time now is 11:24.