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

How to sample velocity magnitudes at each time-step

Register Blogs Community New Posts Updated Threads Search

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 14, 2013, 14:11
Default How to sample velocity magnitudes at each time-step
  #1
Senior Member
 
Canakkale Dardanelspor
Join Date: Aug 2012
Posts: 135
Rep Power: 13
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, 03:00
Default
  #2
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
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!
__________________
My Personal Website (http://nimasamkhaniani.ir/)
Telegram channel (https://t.me/cfd_foam)
nimasam is offline   Reply With Quote

Old   February 15, 2013, 05:36
Default
  #3
Senior Member
 
Canakkale Dardanelspor
Join Date: Aug 2012
Posts: 135
Rep Power: 13
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 05:57.
HakikiCanakkaleli is offline   Reply With Quote

Old   February 15, 2013, 07:00
Default
  #4
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
use phi which is U & mesh.Sf
__________________
My Personal Website (http://nimasamkhaniani.ir/)
Telegram channel (https://t.me/cfd_foam)
nimasam is offline   Reply With Quote

Old   February 15, 2013, 08:00
Default
  #5
Senior Member
 
Canakkale Dardanelspor
Join Date: Aug 2012
Posts: 135
Rep Power: 13
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, 08:14
Default
  #6
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
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

        );
    }
__________________
My Personal Website (http://nimasamkhaniani.ir/)
Telegram channel (https://t.me/cfd_foam)
nimasam is offline   Reply With Quote

Old   February 15, 2013, 08:15
Default
  #7
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
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, 08:16
Default
  #8
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
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, 16:05
Default
  #9
Senior Member
 
Canakkale Dardanelspor
Join Date: Aug 2012
Posts: 135
Rep Power: 13
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,208
Rep Power: 26
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


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
Floating point exception error Alan OpenFOAM Running, Solving & CFD 11 July 1, 2021 21:51
High Courant Number @ icoFoam Artex85 OpenFOAM Running, Solving & CFD 11 February 16, 2017 13:40
Extrusion with OpenFoam problem No. Iterations 0 Lord Kelvin OpenFOAM Running, Solving & CFD 8 March 28, 2016 11:08
Orifice Plate with a fully developed flow - Problems with convergence jonmec OpenFOAM Running, Solving & CFD 3 July 28, 2011 05: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 06:41.