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

Time-average of a patch (wallHeatFlux)

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

Reply
 
LinkBack Thread Tools Display Modes
Old   February 22, 2016, 19:17
Default Time-average of a patch (wallHeatFlux)
  #1
New Member
 
Camila Braga Vieira
Join Date: Apr 2012
Posts: 9
Rep Power: 6
milabvieira is on a distinguished road
Dear Foamers,

I would like to know if someone could help me to get the time-average of a variable defined on the patches (in my case, wallHeatFlux), by using the fieldAverage function?

The fieldAverage works well when I define it (in the controlDict) for Temperature of Velocity, which are internal fields (fieldI, according to the .C document).

Nevertheless, I am interested in obtaining the average on time of the wallHeatFlux (that are calculated over the patches), so when writing this variable inside the fields brackets, I get an error informing that I don't have the wallHeatFlux database, but I have that file with my results from the previous time-step.

If someone knows how to modify the libfunctionObjects.so to a libfunctionObjectsCustom.so (for instance), so that I could time-average the wallHeatFlux exactly as it is done to the Temperature field, I will be very glad to receive your suggestions.

Thank you very much for your help.

Camila

Last edited by milabvieira; February 23, 2016 at 16:27.
milabvieira is offline   Reply With Quote

Old   March 28, 2016, 15:11
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,748
Blog Entries: 39
Rep Power: 103
wyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of light
Greetings Camila,

Please find in attachment the case "hotRoom_wallHeatFlux.tar.gz", tested on OpenFOAM 3.0.x, but the case set-up can be used as a basis for other versions.

The case was modified from "heatTransfer/buoyantPimpleFoam/hotRoom" and the following steps were added:
  1. Added in Allrun the following two lines:
    Code:
    runApplication wallHeatFlux 
    runApplication execFlowFunctionObjects -noFlow -dict system/execDict
  2. The file "system/execDict" has the function object for the field averaging over time, namely:
    Code:
    functions
    {
        fieldAverage1
        {
            type            fieldAverage;
            functionObjectLibs ("libfieldFunctionObjects.so");
            enabled         true;
            outputControl       timeStep;
            outputInterval      1;
            resetOnRestart  false;
            resetOnOutput   false;
    
            fields
            (
                wallHeatFlux
                {
                    mean        on;
                    prime2Mean  on;
                    base        time;
                }
            );
        }
    }
This is a quick solution that I could come up with, but this averaging is only taking into account the time snapshots that were saved. It's not exactly what you wanted, but as I said, it's a quick fix.




If you need this done during the simulation, then the following source code folders can be used as a basis:
  • "$FOAM_SRC/postProcessing/functionObjects/utilities/wallShearStress"
  • "$FOAM_APP/utilities/postProcessing/wall/wallHeatFlux"
Best regards,
Bruno
Attached Files
File Type: gz hotRoom_wallHeatFlux.tar.gz (3.4 KB, 11 views)
__________________
wyldckat is offline   Reply With Quote

Old   April 29, 2016, 04:57
Default
  #3
New Member
 
Nestor Rueda
Join Date: Apr 2016
Posts: 2
Rep Power: 0
ruedanestor is on a distinguished road
Thank you Bruno, it works perfectly.

It used to work a bit different in OF 2.1, more like:

patchAverage -latestTime wallHeatFlux <patch_here>

What was the change between versions so we now have to include it in an external dictionary?

Nestor,
ruedanestor is offline   Reply With Quote

Old   May 1, 2016, 19:03
Default
  #4
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,748
Blog Entries: 39
Rep Power: 103
wyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of light
Hi Nestor,

patchAverage still exists in OpenFOAM 3.0 and it should still work. But the original question was about the "fieldAverage" function object, so I replied to that specific question. And honestly, I didn't remember about patchAverage.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Reply

Tags
fieldaverage, functionobjects, post-processing

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 lpz_michele OpenFOAM Running, Solving & CFD 53 October 19, 2015 02:50
Contribution a new utility: refine wall layer mesh based on yPlus field lakeat OpenFOAM Mesh Utilities 57 February 1, 2015 09:25
Floating point exception error Alan OpenFOAM Running, Solving & CFD 10 April 6, 2012 14:02
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 19:07
Import gmsh msh to Foam adorean Open Source Meshers: Gmsh, Netgen, CGNS, ... 24 April 27, 2005 08:19


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