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

What does the "add" function object do?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 9, 2020, 12:58
Default What does the "add" function object do?
  #1
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 15
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Hello all,

The topic title says it all!
What does the new "add" function object do?

In the user guide it says:

Code:
Add a list of fields.
Thanks for the comprehensive description, OpenFOAM Foundation!

Not even a single tutorial on this.

Code:
cd $FOAM_TUTORIALS
grep -r "type" | grep "add"
Boom, Nothing.

Stay healthy,
Mojtaba
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Old   April 9, 2020, 14:04
Default
  #2
Senior Member
 
Daniel
Join Date: Mar 2013
Location: Noshahr, Iran
Posts: 348
Rep Power: 21
Daniel_Khazaei will become famous soon enough
Hi,

The header description usually contains a simple example:

Code:
    The operation can be applied to any volume or surface fields generating a
    volume or surface scalar field.

    Example of function object specification:
    \verbatim
    Ttot
    {
        type            add;
        libs            ("libfieldFunctionObjects.so");
        fields          (T Tdelta);
        result          Ttot;
        executeControl  writeTime;
        writeControl    writeTime;
    }
    \endverbatim
Looking at the source code and using the above variable names, it creates a new field called "Ttotal" which is the result of "T + Tdelta".

Regards,
D. Khazaei
Daniel_Khazaei is offline   Reply With Quote

Old   April 9, 2020, 14:13
Default
  #3
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 15
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Quote:
Originally Posted by Daniel_Khazaei View Post
Hi,

The header description usually contains a simple example:

Code:
    The operation can be applied to any volume or surface fields generating a
    volume or surface scalar field.

    Example of function object specification:
    \verbatim
    Ttot
    {
        type            add;
        libs            ("libfieldFunctionObjects.so");
        fields          (T Tdelta);
        result          Ttot;
        executeControl  writeTime;
        writeControl    writeTime;
    }
    \endverbatim
Looking at the source code and using the above variable names, it creates a new field called "Ttotal" which is the result of "T + Tdelta".

Regards,
D. Khazaei

Thank you Dan!

You are right, I forgot about the .H source files.

Cheers!
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Old   April 9, 2020, 14:13
Default
  #4
Senior Member
 
zhangyan's Avatar
 
Yan Zhang
Join Date: May 2014
Posts: 120
Rep Power: 12
zhangyan is on a distinguished road
You need a configuration file in the system directory, like this:
https://github.com/OpenFOAM/OpenFOAM...ing/fields/add
change the <field names> to T T

and then:
Code:
postProcess -func add -fields '(T T)'
finally, you will get add(T,T) in the $time directory.

From my experience, this functionObject cannot use in the OpenFOAM compiled by Icc.
__________________
https://openfoam.top
zhangyan is offline   Reply With Quote

Old   April 9, 2020, 14:35
Default
  #5
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 15
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Quote:
Originally Posted by zhangyan View Post
You need a configuration file in the system directory, like this:
https://github.com/OpenFOAM/OpenFOAM...ing/fields/add
change the <field names> to T T

and then:
Code:
postProcess -func add -fields '(T T)'
finally, you will get add(T,T) in the $time directory.

From my experience, this functionObject cannot use in the OpenFOAM compiled by Icc.
Thank you Yan, got it.
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a 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
[Other] refineWallLayer Error Yuby OpenFOAM Meshing & Mesh Conversion 2 November 11, 2021 11:04
foamToTecplot360 thomasduerr OpenFOAM Post-Processing 121 June 11, 2021 10:05
How to create a function object in OpenFoam that runs properly ? mkhm OpenFOAM Programming & Development 1 October 20, 2018 16:16
[blockMesh] Errors during blockMesh meshing Madeleine P. Vincent OpenFOAM Meshing & Mesh Conversion 51 May 30, 2016 10:51
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 10:23


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