View Issue Details

IDProjectCategoryView StatusLast Update
0002807OpenFOAMFeaturepublic2018-01-11 12:22
Reporterxiaofeng_liu Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSUbuntuOS Version14.10
Fixed in Versiondev 
Summary0002807: sample with region name does not work
DescriptionThe current implementation of sample (and other postProcess function objects) seems not to honor the specification of "-region".
Steps To ReproduceRun sample postprocessing on cases with multiple regions, such as the case "multiRegionHeater" within "chtMultiRegionFoam" directory. Try to sample on a specific region. It does not work.
Additional InformationTo correct this, simply change the file "src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C" to make it "region" aware:

Foam::fileName Foam::functionObjectList::findDict(const word& funcName, const word& region)
{
    // First check if there is a functionObject dictionary file in the
    // case system directory
    fileName dictFile

    if (region == word::null) //no region specified, use default
    {
       dictFile = stringOps::expand("$FOAM_CASE")/"system"/funcName;
    }
    else
    {
       dictFile = stringOps::expand("$FOAM_CASE")/"system"/region/funcName;
    }

The definition of the "findDict(...)" function in .H file should also be changed. In addition, the calling of this function should be modified to add the region name reference.

Recomple the lib and now we can sample on multi-region case with:
$ postProcess -func sample -region bottomWater
TagsNo tags attached.

Activities

henry

2018-01-11 12:22

manager   ~0009203

Resolved by commit a5a034a1d2129ea3fd40912907b5908e9ba79b5b

Issue History

Date Modified Username Field Change
2018-01-10 17:53 xiaofeng_liu New Issue
2018-01-11 12:22 henry Category Bug => Feature
2018-01-11 12:22 henry Assigned To => henry
2018-01-11 12:22 henry Status new => resolved
2018-01-11 12:22 henry Resolution open => fixed
2018-01-11 12:22 henry Fixed in Version => dev
2018-01-11 12:22 henry Note Added: 0009203