CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Runtime sampling along a time-dependent line

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 22, 2014, 10:13
Default Runtime sampling along a time-dependent line
  #1
New Member
 
Gaetano
Join Date: Jul 2012
Posts: 18
Rep Power: 14
Gaetano is on a distinguished road
Dear OF developers,

I have a 10M$ question: is there a way to do a run-time line sampling? My problem is that the slope of the sampling line depends on calculations being made. I wrote a post-processing script, but I can't believe I need to store double-digit GBs of data to get a few undred kB ascii file at the end of the post-processing!

Here's my problem step by step:
  1. I have a vector: it's the direction of the sampling line;
  2. I need to find the points where this line intersect with the boundary: those will be the start and end points of the sampling line (no need for line-patch intersection to pass through;
  3. I need to sample a field along that line.

I've been browsing the forum for days looking for an answer, but with really poor results.

I'm trying to do something like this (still not tested, basically taken from here):
Code:
    dictionary interpolationDict = mesh.solutionDict().subDict("interpolationSchemes");
    autoPtr<interpolation<vector> > Uinterp = interpolation<vector>::New(interpolationDict, U);

    vectorList positions = ..something;

    vectorList Ui;
    labelList cellI;

    forAll(positions, i)
    {
        cellI.append(mesh.findCell(positions[i]));
        Ui.append(Uinterp->interpolate(positions[i], cellI));
    }
How does it look? Am I on the right path? Or perhaps I'm reinventig the wheel again? Would you suggest me better approaches, if any?

Gaetano
Gaetano is offline   Reply With Quote

Old   January 30, 2014, 06:46
Default
  #2
New Member
 
Gaetano
Join Date: Jul 2012
Posts: 18
Rep Power: 14
Gaetano is on a distinguished road
Nobody has any clue? I'll be satisfied even with a "not possible" answer.
Gaetano is offline   Reply With Quote

Old   January 30, 2014, 16:30
Default
  #3
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi Gaetano,

I have not been able to find the thread, but I recall a discussion, where some people needed to sample over a line, which was fixed, but the whole of the computational domain was moving, i.e. so was the line.

If I remember correctly they looked at sloshing and they seemed to solve the problem.

I hope that this has helped you a bit.

Good luck,

Niels

P.S. This is definitely not a "not possible" problem, but it might require a bit of work.
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   January 31, 2014, 06:34
Default
  #4
New Member
 
Gaetano
Join Date: Jul 2012
Posts: 18
Rep Power: 14
Gaetano is on a distinguished road
Thanks for the hint, but it doesn't help me a lot.

Those guys were looking for a line moving with the mesh and not with respect to it, so they simply commented out the mesh updating part in the sample and probe utilities. Here's the post where the discussion started, two posts below they figured out the way.

I know that my problem might require some work (and I'm not afraid at all), but I'm still looking for a way to do that.

In other words: I'm not looking for someone doing my homework for me. I'd like a clue from more skilled users who might suggest me few logical steps to tackle the problem.

I still can't believe that I have to save 30 GBs of time folders, filter out the results of the sample utility via a bash/awk script just to end up with few kBs of neat results...

Last edited by Gaetano; January 31, 2014 at 06:35. Reason: typos
Gaetano is offline   Reply With Quote

Old   January 31, 2014, 08:46
Default
  #5
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22
jherb is on a distinguished road
Have a look at this thread:
http://www.cfd-online.com/Forums/ope...swak-type.html
I think the idea with the probes could be used in your case.

Also have a look at swak4foam and function objects with "type createSampledSet". Search for it in the files named "contolDict" in the Example directory (I use the development version on the port_2.0.x branch): http://openfoamwiki.net/index.php/Co...am#Development
here is one of the examples:
http://hg.code.sf.net/p/openfoam-ext...ontrolDict#l85
I am not sure but you might be able to output the values sampled on this line after each timestep.
jherb is offline   Reply With Quote

Reply

Tags
line, line sampling, runtime, sample, sets


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
AMI speed performance danny123 OpenFOAM 21 October 24, 2020 05:13
[Gmsh] Problem with Gmsh nishant_hull OpenFOAM Meshing & Mesh Conversion 23 August 5, 2015 03:09
Regarding FoamX running Kindly help out hariya03 OpenFOAM Pre-Processing 0 April 18, 2008 05:26
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 03:58
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 15:00


All times are GMT -4. The time now is 17:54.