CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   RuntimeControl with surfaceFieldValue (v2012) (https://www.cfd-online.com/Forums/openfoam-post-processing/233312-runtimecontrol-surfacefieldvalue-v2012.html)

simrego January 21, 2021 03:45

RuntimeControl with surfaceFieldValue (v2012)
 
Dear All!


How can I combine the runtimeControl function object with the surfaceFieldValue function object?
In the following dummy example I get the following warning:
Code:

runTimeControl runTimeControl1 output:
    average: condition0 averages:
--> FOAM Warning :
    From virtual bool Foam::functionObjects::runTimeControls::averageCondition::apply()
    in file runTimeControl/runTimeCondition/averageCondition/averageCondition.C at line 151
    From function object: inletPres
Unprocessed fields:
        p

Code:

functions
 {
    inletPres
    {
        type            surfaceFieldValue;
        libs            ("libfieldFunctionObjects.so");
        writeControl    timeStep;
        log            yes;
        writeFields    no;
        regionType      patch;
        name            inlet;
        operation      areaAverage;

        fields
        (
            p
        );
    }

    runTimeControl1
    {
        type            runTimeControl;
        libs            ("libutilityFunctionObjects.so");
        conditions
        {
            condition0
            {
                type            average;
                functionObject  inletPres;
                fields          (p);
                tolerance      5;
                windowType      approximate;
                window          5;
                // groupID        1;
            }
        }
    }
 }

I have tried many combinations for the field name in the condition0 entry without any success.
It seems like the surfaceFieldValue is using some weird name for the results field which I wasn't able to figure out or they are just not compatible (it would be surprising)?


Thanks!

tomf January 22, 2021 08:21

Hi,

It happens to be I am also trying to do something similar. I hope to test if it works soon, but I have to wait a bit until I can run the case, but in the past (v1712) we found out that the field name would need to be something as in <timeDirectory>/uniform/funtionObjectProperties. It is a bit of a weird construction, but based on how we did it in the past and also how I have now prepared my case, I would estimate that you would need to use

fields (areaAverage(inlet,p));

as in:

Code:

    runTimeControl1
    {
        type            runTimeControl;
        libs            ("libutilityFunctionObjects.so");
        conditions
        {
            condition0
            {
                type            average;
                functionObject  inletPres;
                fields          (areaAverage(inlet,p));
                tolerance      5;
                windowType      approximate;
                window          5;
                // groupID        1;
            }
        }
    }

I hope to be able to update you soon if it works, or if you can confirm, that would be great.

Cheers,
Tom

simrego January 22, 2021 08:37

Hi!


Thank you very much! This is it. Working properly!


Thanks again! :)


EDIT:

In the postProcess folder it writes as "areaAverage(p)" which I have already tried so this seems to be a really inconsistent naming for me.

hinmanws April 23, 2021 15:11

Has anyone accomplished this using probes? I.e. for convergence based on a local field value? I haven't had success with this yet. It seems that since probes doesn't use the "setResult" command, maybe these results aren't available to the runTimeControl utility?


All times are GMT -4. The time now is 09:46.