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

Post Processing pressure difference with fieldValueDelta gives error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 15, 2022, 04:15
Default Post Processing pressure difference with fieldValueDelta gives error
  #1
Member
 
Daniel
Join Date: May 2018
Posts: 43
Rep Power: 8
CFDanielGER is on a distinguished road
Hello everyone,


I want to calculate the pressure difference between the inlet and outlet of my domain with the following code:


Code:
      Druckdifferenz
      {
        type                      fieldValueDelta;
        functionObjectLibs         ("libfieldFunctionObjects.so");
        enabled                   true;
        writeControl            timeStep;
        writeInterval            1;
        log                        true;
        writeFields                false;
        operation                subtract;

        region1
        {
              type                    surfaceFieldValue;
              libs                    ("libfieldFunctionObjects.so");
              log                     false;
              writeControl            timeStep;
              writeFields             false;
              regionType              patch;
              name                    inlet;
              operation               areaAverage;
              fields                  ( total(p) );
              writeArea             true;
        }
        region2
        {
              type                    surfaceFieldValue;
              libs                    ("libfieldFunctionObjects.so");
              log                     false;
              writeControl            timeStep;
              writeFields             false;
              regionType              patch;
              name                    outlet;
              operation               areaAverage;
              fields                  ( total(p) );
              writeArea             true;
        }
        }

I didn't put it in the controlDict file, more precisely I have a seperate file in the system directory with some other functions I am postprocessing. I call this file with the following code:


simpleFoam -postProcess -dict "system/PostProcess_Werte" -latestTime


For older versions the code works without problems but now it gives me the following error:


--> FOAM IOWarning :
Found [v1612] 'functionObjectLibs' entry instead of 'libs' in dictionary "functions.Druckdifferenz"

This keyword is 60 months old.

--> FOAM Warning :
Unknown function type fieldValueDelta


Is someone aware of this problem and knows what I have to change?


Many thanks for your help and best regards,
Daniel

Last edited by CFDanielGER; July 15, 2022 at 06:45.
CFDanielGER is offline   Reply With Quote

Old   July 18, 2022, 07:08
Default
  #2
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 647
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
Hi Daniel,

They changed the name to multiFieldValue for version 2112.

The warning just means you can use libs instead of functionObjectLibs in the controlDict.

Best Regards,
Tom
tomf is offline   Reply With Quote

Old   July 18, 2022, 08:26
Default
  #3
Member
 
Daniel
Join Date: May 2018
Posts: 43
Rep Power: 8
CFDanielGER is on a distinguished road
Many thanks for your answer Tom. My complete code looks now like this:


Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2112                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      functionObject;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

functions
{
    pressureDropInletOutlet
    {
        type            multiFieldValue;
        libs             (fieldFunctionObjects);
        operation       subtract;

        region1
        {
            type            surfaceFieldValue;
            libs            (fieldFunctionObjects);
            log             false;
            writeControl    timeStep;
            writeFields     false;
            regionType      patch;
            name            inlet;
            operation       areaAverage;
            fields          (total(p));
        }

        region2
        {
            type            surfaceFieldValue;
            libs            (fieldFunctionObjects);
            log             false;
            writeControl    timeStep;
            writeFields     false;
            regionType      patch;
            name            outlet;
            operation       areaAverage;
            fields          (total(p));
        }
    }
}
But there is still an error:
Code:
--> FOAM FATAL IO ERROR: (openfoam-2112)
Entry 'type' not found in dictionary "functions.pressureDrop"


file: functions.pressureDrop at line 21 to 48.

    From bool Foam::dictionary::readEntry(const Foam::word&, T&, Foam::keyType::option, bool) const [with T = Foam::word]
    in file lnInclude/dictionaryTemplates.C at line 322.

FOAM exiting
Am I missing something?
CFDanielGER is offline   Reply With Quote

Old   July 18, 2022, 08:36
Default
  #4
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 647
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
Hi,

It is a bit weird that is says functions.pressureDrop instead of functions.pressureDropInletOutlet, so maybe the issue is in the controlDict, or the naming of the file when you issue the command? Or it is because you have the call to the functions in there? I can only guess based on the information you share.

I Hope that some of these questions help you find your issue, I do not see any obvious syntax error in the example you provide.

Cheers,
Tom
tomf is offline   Reply With Quote

Old   March 16, 2023, 13:20
Default
  #5
Member
 
s1291's Avatar
 
Join Date: Aug 2017
Location: Algeria
Posts: 98
Rep Power: 9
s1291 is on a distinguished road
Quote:
Originally Posted by tomf View Post
Hi,

It is a bit weird that is says functions.pressureDrop instead of functions.pressureDropInletOutlet, so maybe the issue is in the controlDict, or the naming of the file when you issue the command? Or it is because you have the call to the functions in there? I can only guess based on the information you share.

I Hope that some of these questions help you find your issue, I do not see any obvious syntax error in the example you provide.

Cheers,
Tom
This might be irrelevant to the error above but the multiFieldValue function object requires that the regions' dictionaries be included within "another" functions dictionary.

This is the syntax according to the documentation:

Code:
multiFieldValue1
{
    // Mandatory entries
    type        multiFieldValue;
    libs        (fieldFunctionObjects);
    operation   average;

    // List of fieldValue function objects as dictionaries
    functions
    {
        region1
        {
            ...
            // Optional
            resultFields        (field1 field2);
        }
        region2
        {
            ...
            // Optional
            resultFields        (field1 field2);
        }

        ...

        regionN
        {
            ...
            // Optional
            resultFields        (field1 field2);
        }
    }
}
__________________
"When in doubt, use brute force." -- Ken Thompson
s1291 is offline   Reply With Quote

Old   March 17, 2023, 02:49
Default
  #6
Member
 
Daniel
Join Date: May 2018
Posts: 43
Rep Power: 8
CFDanielGER is on a distinguished road
Sorry for not updating this post. I got it working. I created a file called pressureDrop in the system directory and the code looks now like this:

Code:
        type            multiFieldValue; //fieldValueDelta; multiFieldValue;
        libs             (fieldFunctionObjects);
        operation       subtract;
        
        functions
        {
        region1
        {
            type            surfaceFieldValue;
            libs            (fieldFunctionObjects);
            log             false;
            writeControl    timeStep;
            writeFields     false;
            regionType      patch;
            name            inlet;
            operation       areaAverage;
            fields          (total(p));
        }

        region2
        {
            type            surfaceFieldValue;
            libs            (fieldFunctionObjects);
            log             false;
            writeControl    timeStep;
            writeFields     false;
            regionType      patch;
            name            outlet;
            operation       areaAverage;
            fields          (total(p));
        }
        }
I call it in the controlDict file by:


Code:
#includeFunc pressureDrop
CFDanielGER 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
Building OpenFOAM1.7.0 from source ata OpenFOAM Installation 46 March 6, 2022 14:21
error compiling modified applications yvyan OpenFOAM Programming & Development 21 March 1, 2016 05:53
Compile problem ivanyao OpenFOAM Running, Solving & CFD 1 October 12, 2012 10:31
CGNS lib and Fortran compiler manaliac Main CFD Forum 2 November 29, 2010 07:25
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 21:50


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