View Issue Details

IDProjectCategoryView StatusLast Update
0003552OpenFOAMBugpublic2020-09-23 13:03
Reporterchrix Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformGNU/Linux (using Docker on Mac)OSUbuntuOS Version18.04
Fixed in Versiondev 
Summary0003552: Sampling using 'volFieldValue' doesn't work correctly in parallel
DescriptionI tried to sample the (entire) pressure field for the 'cavity' case using 'volFieldValue' from the library 'fieldFunctionObjects', but it doesn't work correctly when running in parallel.

After running icoFoam, here's the output:

cavity>> ls processor*
processor0:
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 constant
processor1:
0 0.1 0.2 0.3 0.4 0.5 constant
cavity>> ls processor0/0.05
p_all-

In other words, it only works for 'processor0'. I think it's reasonable to expect the feature to work for all processors.

I should note that I ultimately want to be able to sample 'cellZones', but I'm assuming that if this problem (using 'regionType all') is fixed, then it will also work for 'regionType cellZone'.
Steps To ReproduceMake a copy of the 'cavity' case.

Add to the end of 'controlDict':

functions
{

    volFieldValue1
    {
        type volFieldValue;
        libs ("libfieldFunctionObjects.so");

        log true;
        writeControl timeStep;
        writeInterval 10;
        writeFields true;

        regionType all;
        operation none;

        fields
        (
            p
        );
    }

}

Add, into cavity/system, the 'decomposeParDict':

/*--------------------------------*- C++ -*----------------------------------*\
  ========= |
  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
   \\ / O peration | Website: https://openfoam.org
    \\ / A nd | Version: 7
     \\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version 2.0;
    format ascii;
    class dictionary;
    note "mesh decomposition control dictionary";
    object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

numberOfSubdomains 2;

method simple;

simpleCoeffs
{
    n (2 1 1);
    delta 0.001;
}

// ************************************************************************* //

Run:

>> blockMesh
>> decomposePar
>> mpirun -np 2 icoFoam -parallel
>> ls processor*
TagsNo tags attached.

Activities

henry

2020-09-21 10:58

manager   ~0011519

Try this is OpenFOAM-dev:

commit 77ee78b47e599cded781a4bc8eda9b8c5ee1b635 (HEAD -> master, origin/master, origin/HEAD)
Author: Henry Weller <http://cfd.direct>
Date: Mon Sep 21 10:55:49 2020 +0100

    functionObjects::volFieldValue: corrected parallel operation of writeFields = true
    
    Resolves bug-report https://bugs.openfoam.org/view.php?id=3552

Issue History

Date Modified Username Field Change
2020-09-21 10:38 chrix New Issue
2020-09-21 10:58 henry Note Added: 0011519
2020-09-23 13:03 henry Assigned To => henry
2020-09-23 13:03 henry Status new => resolved
2020-09-23 13:03 henry Resolution open => fixed
2020-09-23 13:03 henry Fixed in Version => dev