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

Custom function object

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   Today, 04:38
Default Custom function object
  #1
Member
 
Giorgio
Join Date: Mar 2023
Posts: 49
Rep Power: 3
giorgianig is on a distinguished road
Dear all,

I am using Openfoam 2312. I am trying to develop a custom function object that compute a linear combination of an area average (at runtime). Seems complicated but it is just computing something like

Output = (0.9-Area_average)/(0.9-0.5)

where Area_average can be computed with the function object "surfaceFieldValue".

In other words, I want to apply an expression to the output of a function object before printing.

I know that I could compile a new function object but I guess there is a simpler approach? Moreover I need it for just one test case.

Thanks in advance

Last edited by giorgianig; Today at 06:43.
giorgianig is online now   Reply With Quote

Old   Today, 07:24
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,210
Rep Power: 28
Yann will become famous soon enough
Hello Giorgio,

It looks like a job for the exprField function object!
https://doc.openfoam.com/2312/tools/...eld/exprField/

Cheers,
Yan
Yann is offline   Reply With Quote

Old   Today, 08:18
Default
  #3
Member
 
Giorgio
Join Date: Mar 2023
Posts: 49
Rep Power: 3
giorgianig is on a distinguished road
Quote:
Originally Posted by Yann View Post
Hello Giorgio,

It looks like a job for the exprField function object!
https://doc.openfoam.com/2312/tools/...eld/exprField/

Cheers,
Yan
Thank you for your reply Yann. I don't see how to make an average using the exprField function object. Maybe I have to make the average using the surfaceFieldValue object and use the result in exprField?
giorgianig is online now   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
Error in enabling the python wrapper Jinn SU2 Installation 2 April 23, 2022 14:52
[Other] mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 13 March 7, 2022 18:22
Custom field function object from wallHeatFlux HorstvanGrass OpenFOAM Post-Processing 1 August 3, 2021 13:28
[blockMesh] non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Meshing & Mesh Conversion 7 April 17, 2013 06:42
[blockMesh] error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Meshing & Mesh Conversion 2 March 14, 2012 10:56


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