View Issue Details

IDProjectCategoryView StatusLast Update
0002156OpenFOAMBugpublic2016-07-20 18:52
ReporterfTheobald Assigned Tohenry  
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSUbuntuOS Version14.04
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,
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.

        type fieldAverage;
        functionObjectLibs ( "" );
        enabled true;
        outputControl outputTime;

    region topAir;
                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.



2016-07-20 13:33

manager   ~0006540

Can you provide a patch for this functionality?


2016-07-20 15:16


decomposePar.C (41,522 bytes)


2016-07-20 15:17


reconstructPar.C (29,809 bytes)


2016-07-20 15:23

reporter   ~0006541

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.


2016-07-20 15:25

manager   ~0006542

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


2016-07-20 15:34

manager   ~0006543

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


2016-07-20 16:44

manager   ~0006544

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.


2016-07-20 18:52

manager   ~0006545

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.

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