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

Different result from solver run and CLI of function object

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 10, 2023, 12:31
Default Different result from solver run and CLI of function object
  #1
New Member
 
Join Date: Apr 2023
Posts: 4
Rep Power: 3
rangure is on a distinguished road
hi,
I'm trying to identify the amount of water passing a plane. to achieve this, I add a functionObject in my controlDict. the function added is shown below. The case is a simpler version of damBreak, which is some water dropping from the air(see attachment).
Code:
functions
{
    flux
    {
        functionObjectLibs ("libfieldFunctionObjects.so");
        type             surfaceFieldValue;

        enabled          true;
        writeControl     outputTime;
        writeInterval    1;
        writeFields      true;

        name myName;
        surfaceFormat   none;
        // regionType: patch/faceZone/sampledSurface
        regionType sampledSurface;

        sampledSurfaceDict
        {
            type                  plane;
            planeType             pointAndNormal;
            pointAndNormalDict
            {
                point  (0.1 0 25);
                normal (0 0 1);
            };
            interpolate false;
        }

        // Operation: areaAverage/sum/weightedAverage/...
        operation    areaNormalIntegrate;
        fields
        (
            U
        );
    }
}
the problem is, when I run the simulation with interFoam, it generated a single file like this. but when I use
Code:
interFoam -postProcess
it generate a file for each tilmestep with different values. for example, at time 0.05, the value is
Code:
# Region type : sampledSurface myName
# Faces  :    178
# Area   :    8.900000e+00
# Time          areaNormalIntegrate(U)
0.05            (1.601638e+00 0.000000e+00 0.000000e+00)
here's the single file.
Code:
# Region type : sampledSurface myName
# Faces  :    184
# Area   :    9.200000e+00
# Time          areaNormalIntegrate(U)
0               (0.000000e+00 0.000000e+00 0.000000e+00)
0.05            (-2.227504e-04 0.000000e+00 0.000000e+00)
0.1             (-2.932480e-04 0.000000e+00 0.000000e+00)
0.15            (-8.891989e-05 0.000000e+00 0.000000e+00)
0.2             (-1.824714e-03 0.000000e+00 0.000000e+00)
0.25            (-3.951143e-05 0.000000e+00 0.000000e+00)
0.3             (-8.158129e-04 0.000000e+00 0.000000e+00)
0.35            (7.823114e-04 0.000000e+00 0.000000e+00)
0.4             (2.245233e-03 0.000000e+00 0.000000e+00)
0.45            (4.049318e-03 0.000000e+00 0.000000e+00)
0.5             (4.898588e-03 0.000000e+00 0.000000e+00)
0.55            (5.109302e-03 0.000000e+00 0.000000e+00)
0.6             (5.978782e-03 0.000000e+00 0.000000e+00)
0.65            (6.250927e-03 0.000000e+00 0.000000e+00)
0.7             (-2.399643e-03 0.000000e+00 0.000000e+00)
0.75            (-1.127230e-02 0.000000e+00 0.000000e+00)
0.8             (-7.155068e-03 0.000000e+00 0.000000e+00)
0.85            (-1.574159e-01 0.000000e+00 0.000000e+00)
0.9             (1.621918e-01 0.000000e+00 0.000000e+00)
0.95            (-1.254870e-01 0.000000e+00 0.000000e+00)
1               (3.400532e-02 0.000000e+00 0.000000e+00)
1.05            (7.201005e-02 0.000000e+00 0.000000e+00)
1.1             (9.076889e-02 0.000000e+00 0.000000e+00)
1.15            (-2.786471e-01 0.000000e+00 0.000000e+00)
1.2             (-5.048007e-01 0.000000e+00 0.000000e+00)
1.25            (-3.681236e-01 0.000000e+00 0.000000e+00)
1.3             (-5.155362e-01 0.000000e+00 0.000000e+00)
1.35            (-6.984839e-01 0.000000e+00 0.000000e+00)
1.4             (9.784959e-03 0.000000e+00 0.000000e+00)
1.45            (3.927942e-01 0.000000e+00 0.000000e+00)
1.5             (-3.542411e-01 0.000000e+00 0.000000e+00)
1.55            (-2.586261e+00 0.000000e+00 0.000000e+00)
1.6             (-6.864394e+00 0.000000e+00 0.000000e+00)
1.65            (-2.605651e-01 0.000000e+00 0.000000e+00)
1.7             (4.457992e+00 0.000000e+00 0.000000e+00)
1.75            (-3.350072e+00 0.000000e+00 0.000000e+00)
1.8             (-1.535838e+00 0.000000e+00 0.000000e+00)
1.85            (-3.504160e+00 0.000000e+00 0.000000e+00)
1.9             (-9.405926e+00 0.000000e+00 0.000000e+00)
1.95            (-1.448530e+01 0.000000e+00 0.000000e+00)
2               (8.364064e+00 0.000000e+00 0.000000e+00)
2.05            (7.780693e-01 0.000000e+00 0.000000e+00)
2.1             (-2.933097e+00 0.000000e+00 0.000000e+00)
2.15            (-6.424189e+00 0.000000e+00 0.000000e+00)
2.2             (-2.183912e+00 0.000000e+00 0.000000e+00)
2.25            (-6.395861e+00 0.000000e+00 0.000000e+00)
2.3             (-3.685619e+00 0.000000e+00 0.000000e+00)
2.35            (-4.437925e+00 0.000000e+00 0.000000e+00)
2.4             (-1.785322e+00 0.000000e+00 0.000000e+00)
2.45            (4.933389e+00 0.000000e+00 0.000000e+00)
2.5             (4.853685e+00 0.000000e+00 0.000000e+00)
2.55            (-2.499341e+00 0.000000e+00 0.000000e+00)
2.6             (-4.315828e+00 0.000000e+00 0.000000e+00)
2.65            (-1.217215e+01 0.000000e+00 0.000000e+00)
2.7             (-5.688268e+00 0.000000e+00 0.000000e+00)
2.75            (-3.997427e+00 0.000000e+00 0.000000e+00)
2.8             (-2.372049e+00 0.000000e+00 0.000000e+00)
2.85            (-7.069010e+00 0.000000e+00 0.000000e+00)
2.9             (-6.452742e+00 0.000000e+00 0.000000e+00)
2.95            (-1.762354e+00 0.000000e+00 0.000000e+00)
3               (-1.288960e+00 0.000000e+00 0.000000e+00)
I understand that the function is not correctly calculating the water volume, but it should gives same result for CLI execution and solver execution.
Attached Images
File Type: jpg 1691680954906.jpg (11.9 KB, 4 views)
rangure is offline   Reply With Quote

Reply

Tags
functionobjects, postprocessing; openfoam;

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



All times are GMT -4. The time now is 02:13.