View Issue Details

IDProjectCategoryView StatusLast Update
0003689OpenFOAMBugpublic2021-06-19 12:14
Reportertiziano.maffei Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSUbuntuOS Version20.04
Fixed in Versiondev 
Summary0003689: postProcessing with surfaceFieldValue function
DescriptionGood morning,
I have found a bug in the lib libfieldFunctionObjects.so.

When I run a solver with the option to evaluate i.e the flowRatePacth specified in the functions dictionary in the file system/controlDict, I have noted the function is called two times
If regionType is defined as patch, this is not a big issue.

But, if I set the keyword regionType with the option sampledSurface and the subdictionary sampledSurfaceDict, I get an error message: "Either weightField or orientedWeightField can be supplied, but not both", even if I didn't specify any weightField and by default it should be "none".
Infact, in the first call the weightField is set as "none" but in the second call is set with the field defined in orientedWeighField (assigned to weightField after the first call, as indicated in the file surfaceFieldValue.C)

Thank you for your time

Tiziano
Steps To ReproduceIn the example "tutorials/incompressible/pimpleFoam/RAS/TJunction", I have added in the functions dictionary of the system/controlDict

x1
{
    type surfaceFieldValue;
    functionObjectLibs ( "libfieldFunctionObjects.so" );
    writeControl timeStep;
    writeInterval 1;
    log true;
    writeFields false;
    regionType sampledSurface;
    sampledSurfaceDict
    {
        type cuttingPlane;
        planeType pointAndNormal;
        pointAndNormalDict
        {
            basePoint ( 0.055 0 0.01 );
            normalVector ( 1 0 0 );
        }
        source cells;
        interpolate true;
    }
    operation weightedSum;
    orientedWeightField phi;
    fields ( );
}


The output is:

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0


PIMPLE: No convergence criteria found


PIMPLE: Operating solver in transient mode with 1 outer corrector
PIMPLE: Operating solver in PISO mode


Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type RAS
Selecting RAS turbulence model kEpsilon
RAS
{
    model kEpsilon;
    turbulence on;
    printCoeffs on;
    Cmu 0.09;
    C1 1.44;
    C2 1.92;
    C3 0;
    sigmak 1;
    sigmaEps 1.3;
}

No MRF models present

No fvModels present
No fvConstraints present
Courant Number mean: 0 max: 0

Starting time loop

surfaceFieldValue flowRatePatch(name=outlet1):
    total faces = 25
    total area = 0.0004


surfaceFieldValue flowRatePatch(name=outlet1):
    total faces = 25
    total area = 0.0004


surfaceFieldValue flowRateFaceZone(name=fz1):
    total faces = 31
    total area = 0.000496


surfaceFieldValue flowRateFaceZone(name=fz1):
    total faces = 31
    total area = 0.000496


surfaceFieldValue flowRatePatch(name=outlet2):
    total faces = 25
    total area = 0.0004


surfaceFieldValue flowRatePatch(name=outlet2):
    total faces = 25
    total area = 0.0004


surfaceFieldValue flowRateFaceZone(name=fz2):
    total faces = 31
    total area = 0.000496


surfaceFieldValue flowRateFaceZone(name=fz2):
    total faces = 31
    total area = 0.000496


surfaceFieldValue x1:
    total faces = 25
    total area = 0.0004
    weight field = phi


surfaceFieldValue x1:
    total faces = 25
    total area = 0.0004

--> FOAM FATAL IO ERROR:
Either weightField or orientedWeightField can be supplied, but not both

file: /home/tiziano/OpenFOAM/tiziano-dev/tutorials/incompressible/pimpleFoam/RAS/TJunction/system/controlDict/functions/x1 from line 90 to line 111.

    From function void Foam::functionObjects::fieldValues::surfaceFieldValue::initialise(const Foam::dictionary&)
    in file fieldValues/surfaceFieldValue/surfaceFieldValue.C at line 511.

TagsNo tags attached.

Activities

henry

2021-06-19 12:14

manager   ~0012070

Resolved by commit c8307122c67df4f2b156e61c7530604218923837

Issue History

Date Modified Username Field Change
2021-06-17 13:42 tiziano.maffei New Issue
2021-06-19 12:14 henry Assigned To => henry
2021-06-19 12:14 henry Status new => resolved
2021-06-19 12:14 henry Resolution open => fixed
2021-06-19 12:14 henry Fixed in Version => dev
2021-06-19 12:14 henry Note Added: 0012070
2021-06-19 12:14 henry Severity major => minor