2017-04-28 09:20 BST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002156OpenFOAM[All Projects] Bugpublic2016-07-20 18:52
ReporterfTheobald 
Assigned Tohenry 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformGNU/LinuxOSUbuntuOS Version14.04
Product Version4.0 
Target VersionFixed in Version4.x 
Summary0002156: chtMultiRegionFoam + parallel computation + fieldAverage function object => missing file transfer at decomposePar/reconstructPar
DescriptionAfter decomposing a case (including fields generated by fieldAverage function object) for parallel computation (with chtMultiRegionFoam solver), the file <example time step>/<example region>/uniform/fieldAveragingProperties is not copied to the processor* folders.

The same issue occurs vice versa, i.e. if a parallel case is reconstructed the fieldAveragingProperties file is not copied to the reconstructed time step.

To resolve this issue the user is forced to copy the fieldAveragingProperties file by hand, which is not that convenient.

This issue could be reproduced with OpenFOAM v2.3.0,v2.3.1,v3.0.1,v4.0

It would be great if the decomposePar/reconstructPar tool could be modified, so that it copies the fieldAveragingProperties file to/from the processor* folders.

Best regards,
Florian
Steps To ReproduceThe following steps are performed with OpenFOAM v3.0.1, but should be similar to the above mentioned versions.

1. Change to multiRegionHeater tutorial (<tutorial folder>/heatTransfer/chtMultiRegionFoam/multiRegionHeater/)
2. Modify Allrun script so that a serial simulation is performed
3. Add fieldAverage function Object to controlDict, e.g.

functions
{
    fieldAverage1
    {
        type fieldAverage;
        functionObjectLibs ( "libfieldFunctionObjects.so" );
        enabled true;
        outputControl outputTime;

    region topAir;
    
        fields
        (
            U
            {
                mean on;
                prime2Mean on;
                base time;
            }
        );
    }
}

4. Execute Allrun script, wait till first time step is written and then kill the simulation => file 10/topAir/uniform/fieldAveragingProperties exists

5. Execute 'decomposePar -latestTime -allRegions' => the mean fields - generated via fieldAverage - are written to the processor* folders, whereas the fieldAveragingProperties file is not copied

6. As a result the specified fields for averaging are being averaged from new if the parallel simulation is started
Additional InformationFor non-multi-region cases (e.g. pimpleFoam solver is used) the fieldAveragingProperties file is copied properly with decomposePar/reconstructPar.
TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0006540

henry (manager)

Can you provide a patch for this functionality?

~0006541

fTheobald (reporter)

I have modified the decomposePar and reconstructPar utilities. After some testing they seem to do the job. For this to work, I have copied existing code, which detects files in <example time step>/uniform and links/copies them to <processor_i>/<example time step>/uniform. The new code fragment detects files in <example time step>/<example region>/uniform and links/copies them to <processor_i>/<example time step>/<example region>/uniform.

The decomposePar/reconstructPar options '-allRegions' and '-region <example reion>' have been tested successfully.

However the code does not look nice because of the redundancy introduced. A more proficient programmer than me may find a better way to include the new feature.

~0006542

henry (manager)

Thank you for having a go. I will review the changes and implement an elegant solution.

~0006543

henry (manager)

The code changes you provide appear to be for an older version of OpenFOAM, certainly older than 4.0.

~0006544

henry (manager)

I have implemented a more elegant solution for decomposePar in OpenFOAM-dev: commit 0dfb1d6935815a79049841f183bed44fc60c08b6

Will do reconstructPar as well if the approach in decomposePar works for all cases.

~0006545

henry (manager)

Resolved in OpenFOAM-4.x by commit 68a024778e5401af6a41c11a1a44f1ddf6812050
Resolved in OpenFOAM-dev by commit 08a7438038a959d3d0cdd8ad64a66f6c4f87d9db and
commit 0dfb1d6935815a79049841f183bed44fc60c08b6

Please reopen if there are any issues with these changes.
+Notes

-Issue History
Date Modified Username Field Change
2016-07-20 13:27 fTheobald New Issue
2016-07-20 13:33 henry Note Added: 0006540
2016-07-20 15:16 fTheobald File Added: decomposePar.C
2016-07-20 15:17 fTheobald File Added: reconstructPar.C
2016-07-20 15:23 fTheobald Note Added: 0006541
2016-07-20 15:25 henry Note Added: 0006542
2016-07-20 15:34 henry Note Added: 0006543
2016-07-20 16:44 henry Note Added: 0006544
2016-07-20 18:52 henry Note Added: 0006545
2016-07-20 18:52 henry Status new => resolved
2016-07-20 18:52 henry Fixed in Version => 4.x
2016-07-20 18:52 henry Resolution open => fixed
2016-07-20 18:52 henry Assigned To => henry
+Issue History