CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Post-Processing

How to sample velocity magnitudes at each time-step

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree3Likes
  • 2 Post By HakikiCanakkaleli
  • 1 Post By immortality

Reply
 
LinkBack Thread Tools Display Modes
Old   February 14, 2013, 15:11
Default How to sample velocity magnitudes at each time-step
  #1
Member
 
Join Date: Aug 2012
Posts: 74
Rep Power: 5
HakikiCanakkaleli is on a distinguished road
Hi,

Could anyone please tell me how I can sample magnitudes of a velocity flow field which passes through a specified region of cells (rather than the patches) (e.g. an arbitrary cylinder shaped plane in the middle of the computational domain) during run-time and to write those at each time-step?

Many thanks for any reply in advance.
HakikiCanakkaleli is offline   Reply With Quote

Old   February 15, 2013, 04:00
Default
  #2
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,123
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
there are several options:
1- using post processing such as paraview:
-create a mag (U) with calculator
-extract the surface
-integrateVariables for specified Time or all time steps

2-using sampleDict, i guess you can create your sample point

3- using swak4Foam there are lots of Options in that, which youy can extract plane, use a faceSet and so to derive what you want!
__________________
Training Course on OpenFOAM at (http://www.isme.ir/)
My Weblog (http://openfoam.blogfa.com/)
nimasam is offline   Reply With Quote

Old   February 15, 2013, 06:36
Default
  #3
Member
 
Join Date: Aug 2012
Posts: 74
Rep Power: 5
HakikiCanakkaleli is on a distinguished road
Thanks very much.

When I tried to use the swak4Foam with faceSet, I receive the error below:

Could you please tell me what it really means

Code:
libs (
      "libOpenFOAM.so"
      "libsimpleSwakFunctionObjects.so"
      "libswakFunctionObjects.so"
      "libgroovyBC.so"
     );

functions
(
   averageVel
    {
        type swakExpression;
        valueType faceSet;
        setName f0;
        accumulations (
            average
        );
        expression "U";
        verbose true;
    }
);


Code:
--> FOAM FATAL ERROR: 
Could not find a field name "U" of type vector (neither surfaceVectorField nor volVectorField) autoInterpolate: 0 (try setting 'autoInterpolate' to 'true')


    From function SubsetValueExpressionDriver::getFieldInternalAndInterpolate(const string &name,const Subset &sub)
    in file SubsetValueExpressionDriverI.H at line 275.
Edit: Also, with faceZone, I obtained exactly same error.

Last edited by HakikiCanakkaleli; February 15, 2013 at 06:57.
HakikiCanakkaleli is offline   Reply With Quote

Old   February 15, 2013, 08:00
Default
  #4
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,123
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
use phi which is U & mesh.Sf
__________________
Training Course on OpenFOAM at (http://www.isme.ir/)
My Weblog (http://openfoam.blogfa.com/)
nimasam is offline   Reply With Quote

Old   February 15, 2013, 09:00
Default
  #5
Member
 
Join Date: Aug 2012
Posts: 74
Rep Power: 5
HakikiCanakkaleli is on a distinguished road
Thanks very much!

Could you please tell me whether I can average the magnitudes of the velocity vector components (e.g. Ux) or not as well?
HakikiCanakkaleli is offline   Reply With Quote

Old   February 15, 2013, 09:14
Default
  #6
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,123
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
Code:
 surfacePlane
    {
        type swakExpression;
        valueType surface;
        surfaceName testPlane;
        surface {
            type plane;
            basePoint       (0 0 0);
            normalVector    (1 0 0);
            interpolate true; //false
        }
        verbose true;

        expression "U";
        accumulations (
            min
            max
           average

        );
    }
__________________
Training Course on OpenFOAM at (http://www.isme.ir/)
My Weblog (http://openfoam.blogfa.com/)
nimasam is offline   Reply With Quote

Old   February 15, 2013, 09:15
Default
  #7
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by HakikiCanakkaleli View Post
Code:
--> FOAM FATAL ERROR: 
Could not find a field name "U" of type vector (neither surfaceVectorField nor volVectorField) autoInterpolate: 0 (try setting 'autoInterpolate' to 'true')


    From function SubsetValueExpressionDriver::getFieldInternalAndInterpolate(const string &name,const Subset &sub)
    in file SubsetValueExpressionDriverI.H at line 275.
Edit: Also, with faceZone, I obtained exactly same error.
Could you tell me how I can improve that error message? I was hoping all the relevant information is there.

swak offers for these parsers the possibility to automatically interpolate fields that are defined on cells to the faces ... but you've got to ask it to: I don't believe in forcing extra work on the machine without the user asking for it.

Anyway: simply add a line
Code:
autoInterpolate true;
to the function object and it should be fine
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   February 15, 2013, 09:16
Default
  #8
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by HakikiCanakkaleli View Post
Thanks very much!

Could you please tell me whether I can average the magnitudes of the velocity vector components (e.g. Ux) or not as well?
Together with the autoInterpolate described in the other post this should be easy ("mag(U.x)" or so)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   February 17, 2013, 17:05
Default
  #9
Member
 
Join Date: Aug 2012
Posts: 74
Rep Power: 5
HakikiCanakkaleli is on a distinguished road
Thanks very much for this information to both of you.

Quote:
Could you tell me how I can improve that error message? I was hoping all the relevant information is there.
With the below:

Quote:
(try setting 'autoInterpolate' to 'true')
Personally, as a novice, I have thought to myself that I have to change 'autoInterpolate' from 'false' to 'true'; but, I couldn't find wherein I can do it.

Instead, if you would like to change the error message, my unpretencious suggestion would only be, by citing your words:
Code:
simply add a line: autoInterpolate true;
By the way, I made things work with 'cellSet' instead of 'faceSet'. I could not see any fundamental difference between two to extract the velocity magnitudes. If there is some, any additional suggestions would be highly appreciated. Thanks!
immortality and rafa13 like this.
HakikiCanakkaleli is offline   Reply With Quote

Old   April 5, 2013, 15:48
Default
  #10
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,205
Rep Power: 17
immortality is on a distinguished road
what a nice thread!
I have a question now.whats difference between faceSet and faceZone?
rafa13 likes this.
immortality is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Floating point exception error Alan OpenFOAM Running, Solving & CFD 10 April 6, 2012 14:02
High Courant Number @ icoFoam Artex85 OpenFOAM Running, Solving & CFD 9 January 3, 2012 09:06
Orifice Plate with a fully developed flow - Problems with convergence jonmec OpenFOAM Running, Solving & CFD 3 July 28, 2011 05:24
Extrusion with OpenFoam problem No. Iterations 0 Lord Kelvin OpenFOAM 6 April 12, 2011 11:24
Extract velocity field in certain time step to MATLAB spatialtime CFX 3 September 9, 2009 18:30


All times are GMT -4. The time now is 15:39.