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

Pass functionObjects results to other functionObjects

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 7, 2024, 05:29
Default Pass functionObjects results to other functionObjects
  #1
Senior Member
 
Join Date: Dec 2021
Posts: 268
Rep Power: 6
Alczem is on a distinguished road
Hey!


I would like to use the outputs of two functionObjects in a third functionObjects.


More precisely, I would like to divide the areaAverage of a field on a patch by the max value of the same field on another patch. Supposedly, surfaceFieldValue stores results to be reused in the next postprocessing functions, but it seems to be the case only for specific functions.


I cannot use coded functions (precompiled OpenFoam on Windows) or any kind of dynamic code. So far, I have tried:
  • exprFields to compute this value, but it does not recognize the previous FOs or the max or average mathematical functions
  • add or multiply work to add fields, but not functionObjects outputs
  • several variants of these tools


Does anyone know a way to further process functionObjects results? Thanks!
Alczem is offline   Reply With Quote

Old   November 26, 2024, 11:28
Default
  #2
Member
 
Giorgio
Join Date: Mar 2023
Posts: 57
Rep Power: 3
giorgianig is on a distinguished road
I stumbled on this post because I have exactly the same need. Did you menage to solve the issue?
giorgianig is offline   Reply With Quote

Old   November 27, 2024, 05:21
Default
  #3
Senior Member
 
Join Date: Dec 2021
Posts: 268
Rep Power: 6
Alczem is on a distinguished road
Hey!


Sadly I have not found a solution. I managed to find a way by using Paraview for my specific case, but I could not generalize to other cases.
Alczem is offline   Reply With Quote

Old   November 28, 2024, 08:39
Default
  #4
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 825
Blog Entries: 1
Rep Power: 19
dlahaye is on a distinguished road
can you instruct the first function object to store data in the object registry and the second to rad from the object registry?
dlahaye is offline   Reply With Quote

Old   November 29, 2024, 05:02
Default
  #5
Senior Member
 
Join Date: Dec 2021
Posts: 268
Rep Power: 6
Alczem is on a distinguished road
I tried to use the stored results but could not make it work. Is there a functionObject that allows to force the reading of other FOs' results? Thanks for the hint!
Alczem is offline   Reply With Quote

Old   November 29, 2024, 05:06
Default
  #6
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 825
Blog Entries: 1
Rep Power: 19
dlahaye is on a distinguished road
What exactly did you try?

What error message do you obtain?

Thx, D.
dlahaye is offline   Reply With Quote

Old   November 29, 2024, 05:09
Default
  #7
Member
 
Giorgio
Join Date: Mar 2023
Posts: 57
Rep Power: 3
giorgianig is on a distinguished road
Quote:
Originally Posted by dlahaye View Post
What exactly did you try?

What error message do you obtain?

Thx, D.


Here is what I tried.

I wrote a first function object:

HTML Code:
cuttingPlane001
{
    type            surfaceFieldValue;
    libs            (fieldFunctionObjects);
    enabled         yes;
    writeControl    timeStep;
    writeInterval   1; 
    writeFields     no;
    writeToFile     no;

    //interpolationScheme cellPoint;
    regionType      sampledSurface;
    name            z-0.01;
    sampledSurfaceDict
    {
            type                    cuttingPlane;
            planeType               pointAndNormal;
            pointAndNormalDict
            {
                    basePoint       (0 0 0.01);  
                    normalVector    (0 0 1);
            }
            source cells; // sample cells or boundaryFaces
            interpolate true;
    }
    operation       areaAverage;
    fields          ( alpha.SA );
    result ctp001;

}
and another to use the result cpt001

HTML Code:
expr001
{
	type exprField;
	libs            (fieldFunctionObjects);
	name expr001;
	expression "(0.9-ctp001)/0.4";
	dimensions      [   ];
}
I am calling them in controlDict

HTML Code:
functions
{
    #include "cuttingPlane001"
    #include "expr001"
}
but I get:

HTML Code:
--> FOAM FATAL IO ERROR: (openfoam-2312 patch=240220) 
Entry 'field' not found in dictionary 
"/home/giorgio/tutorials/combustion/reactingFoam/RAS/TEST_liquid/lockExchange/system/controlDict/functions/expr001" 
file: system/controlDict/functions/expr001 at line 10 to 14.
giorgianig is offline   Reply With Quote

Old   November 29, 2024, 07:31
Default
  #8
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 825
Blog Entries: 1
Rep Power: 19
dlahaye is on a distinguished road
One example of a function object storing data in the object registry is at Register object inside functionObject without static pointer
dlahaye is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Time sensitivity analysis - results variation qntldoql FLUENT 1 January 25, 2022 01:07
My results become inconsistent when using PIMPLE (nOuterCorrectors>1) instead of PISO FloB OpenFOAM Running, Solving & CFD 5 May 17, 2021 07:17
Validating the results of numerical modeling compared to the results of another model ENG.AHMAD FLUENT 0 June 22, 2020 17:49
bad heat transfer results with low y+ me45 OpenFOAM Running, Solving & CFD 0 April 29, 2020 12:56
Different Results from Fluent 5.5 and Fluent 6.0 Rajeev Kumar Singh FLUENT 6 December 19, 2010 12:33


All times are GMT -4. The time now is 01:36.