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

OpenFOAM: Writing out time-averaged fields to Probes

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 3 Post By Yann
  • 1 Post By fale

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 27, 2020, 18:24
Default OpenFOAM: Writing out time-averaged fields to Probes
  #1
New Member
 
Maziar
Join Date: Jul 2019
Posts: 15
Rep Power: 7
yek_irani is on a distinguished road
Hello,

The examples of probes in OpenFOAM (e.g. https://cfd.direct/openfoam/user-gui...hs-monitoring/) include examples for the pressure and velocity vector fields.

I am doing LES simulations. I would like to also write out probe values for the time-averaged fields of velocity (<U>, <V> and <W>) and the square of the velocity fluctuations (<u'u'>, <v'v'> and <w'w'>) - actually the TKE which I can derive from the aforementioned fluctuation correlations. I understand that there is a fieldAverage function (https://www.openfoam.com/documentati...d-average.html). But this appears to write out entire field data as opposed to probe data.

Is it possible to do what I am looking for, and if so, can you direct me to the link which provides additional information? I am not a C++ programmmer.

Thank you.
yek_irani is offline   Reply With Quote

Old   April 28, 2020, 04:45
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Hello Maziar,

You have already found the fieldAverage funtionObject, allowing to calculate time averaged fields. If you use it on the velocity field, it will create a new variable named UMean.

You can then use the probes function object with UMean as field to achieve what you want.

Just make sure to execute the function in the proper order (fieldAverage first, then Probes)

If you don't want to write the whole field data to save storage space, I guess you should use a setting like "writeFields false;" in your fieldAverage function. It will still compute the whole volume field and keep it in RAM (so you can use it in your probe function) but it will not write it on disk.

Cheers,
Yann
Yann is offline   Reply With Quote

Old   April 28, 2020, 14:19
Default
  #3
New Member
 
Maziar
Join Date: Jul 2019
Posts: 15
Rep Power: 7
yek_irani is on a distinguished road
Yann,

Thank you very much for your response. I will try out what you suggest. It sounds simple enough.

Best wishes,
Maziar.
yek_irani is offline   Reply With Quote

Old   February 10, 2022, 13:13
Default
  #4
New Member
 
Alessandro Fenzi
Join Date: May 2021
Posts: 3
Rep Power: 5
fale is on a distinguished road
Hi yek_irani,
could you gently show me your files please, because i'm trying to achieve the same results but it isn't working.


thanks in advance!
fale is offline   Reply With Quote

Old   February 10, 2022, 16:43
Default
  #5
Senior Member
 
Julio Pieri
Join Date: Sep 2017
Posts: 109
Rep Power: 9
JulioPieri is on a distinguished road
Hi Alessandro, could you share your files? This should be quite simple to make it work, you might be missing some syntax details.

Add to your controlDict's functionObject:
- fieldAverage: it will generate the mean of the field you want. This snip is from the cavitatingFoam/LES/throttle tutorial
Code:
fieldAverage1
    {
        type            fieldAverage;
        libs            (fieldFunctionObjects);
        writeControl    writeTime;
        fields
        (
            U
            {
                mean        on;
                prime2Mean  off;
                base        time;
            }

            p
            {
                mean        on;
                prime2Mean  off;
                base        time;
            }

            alpha.vapour
            {
                mean        on;
                prime2Mean  off;
                base        time;
            }
        );
    }
(you might also be able to use the volFieldValue and use the volAverage operation)
- probe: to probe the mean calculated in the previous functionObject. This snip is from another LES tutorial
Code:
probes
    {
        type            probes;
        libs            (sampling);

        // Name of the directory for probe data
        name            probes;

        // Write at same frequency as fields
        writeControl    timeStep;
        writeInterval   1;

        // Fields to be probed
        fields          (p U);

        // Optional: interpolation scheme to use (default is cell)
        interpolationScheme cell;

        probeLocations
        (
            (0.00132  0.0009 0.005)
        );
    }
change the fields entry accordingly.

Hope this helps.
JulioPieri is offline   Reply With Quote

Old   February 11, 2022, 03:37
Default
  #6
New Member
 
Alessandro Fenzi
Join Date: May 2021
Posts: 3
Rep Power: 5
fale is on a distinguished road
Firstly, thank you so much for the reply!
I dont have a file to share because im able to generate the fieldAverage and the probes correctly but after that, since my goal is to calculate the TKE, i dont understand how to write and combines the function "subtract" and "multiply" (i.e. u' = U - <U>). Any chance you have any hints about that? Thanks a lot Julio
fale is offline   Reply With Quote

Old   February 11, 2022, 15:43
Default
  #7
Senior Member
 
Julio Pieri
Join Date: Sep 2017
Posts: 109
Rep Power: 9
JulioPieri is on a distinguished road
I've never used it, but I think you can call the "subtract" functionObject having as input the fields you want to manipulate. So if you want the fluctuation u'=U-UMean, you could first run fieldAverage having as output the UMean, then write something like this functionObject:

Code:
subtract1
{
    // Mandatory entries
    type            subtract;
    libs            (fieldFunctionObjects);
    fields          (U UMean);

    // Optional (inherited) entries
    result          uPrime;
    region          region0;
    enabled         true;
    log             true;
    timeStart       0;
    timeEnd         10;
    executeControl  timeStep;
    executeInterval 1;
    writeControl    runTime;
    writeInterval   1;
}
Also, you could write the fields, including UPrime2Mean and manipulate them in paraview.

These are all the available functions. https://www.openfoam.com/documentati...cts-field.html

Also, check this link as it might give you some insights.
What's the meaning of "prime2Mean" in fieldAverage function of OpenFOAM
JulioPieri is offline   Reply With Quote

Old   February 12, 2022, 09:52
Default
  #8
New Member
 
Alessandro Fenzi
Join Date: May 2021
Posts: 3
Rep Power: 5
fale is on a distinguished road
Thanks a lot Julio! I'm gonna try this out immediately.
JulioPieri likes this.
fale is offline   Reply With Quote

Reply

Tags
openfoam 1912, probes


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
[snappyHexMesh] SnappyHexMesh/splitMeshRegion : region1 in zone "-1" GuiMagyar OpenFOAM Meshing & Mesh Conversion 3 August 4, 2023 13:38
Star cd es-ice solver error ernarasimman STAR-CD 2 September 12, 2014 01:01
a reconstructPar issue immortality OpenFOAM Post-Processing 8 June 16, 2013 12:25
plot over time fferroni OpenFOAM Post-Processing 7 June 8, 2012 08:56
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 03:58


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