View Issue Details

IDProjectCategoryView StatusLast Update
0002936OpenFOAM[All Projects] Bugpublic2018-05-15 16:41
ReporterzhernadiAssigned Tochris 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformUnixOSOtherOS Version(please specify)
Product Version5.0 
Fixed in Version 
Summary0002936: patchAverage does not perform area weighted average
DescriptionPrevious OpenFOAM versions up to 3.x used patchAverage application to calculate face area weighted average of volume fields on a boundary patch. Now, in OpenFOAM 5.x,

patchAverage U outlet # OpenFOAM 3.x

is substituted by

postProcess -func 'patchAverage(name=outlet,U)' # OpenFOAM 5.x

However they do not provide the same result if the boundary patch consists of non-uniform sized faces. While 3.x version calculates face area weighted average, 5.x version simply performs ensemble averaging (sums up the face values and divides with number of faces).

In most of the cases, ensemble average of volume fields does not have a physical meaning, while face area weighted average is usually meaningful. For example in simpleFoam tutorial pitzDaily, user might want to calculate mean velocity on the outlet. For the non-uniform mesh provided in pitzDaily case, face area weighted averaging should be performed to correctly calculate mean velocity.

So it would be better to perform face area weighted averaging in patchAverage for two reasons:
1. backward compatibility with OpenFOAM 3.x or older
2. higher chance for physically meaningful results
Steps To Reproduce# In OpenFOAM 5.x:
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily /tmp/pitzDaily5x
cd /tmp/pitzDaily5x
blockMesh > log.blockMesh
simpleFoam > log.simpleFoam
postProcess -func 'patchAverage(name=outlet, U)'

# In OpenFOAM 3.x:
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily /tmp/pitzDaily3x
cd /tmp/pitzDaily3x
blockMesh > log.blockMesh
simpleFoam > log.simpleFoam
patchAverage U outlet

# Physically correct value is provided by OpenFOAM 3.x
Additional InformationThis issue could be easily solved by modifying the file
$FOAM_ETC/caseDicts/postProcessing/surfaceFieldValue/patchAverage

Change the line

operation average;

to

operation areaAverage;
TagsNo tags attached.

Activities

chris

2018-05-15 16:41

manager   ~0009579

Thanks for the report.

Resolved in dev: https://github.com/OpenFOAM/OpenFOAM-dev/commit/c7d711
Resolved in 5.x: https://github.com/OpenFOAM/OpenFOAM-5.x/commit/d06c3b

Issue History

Date Modified Username Field Change
2018-05-15 14:33 zhernadi New Issue
2018-05-15 16:41 chris Note Added: 0009579
2018-05-15 16:41 chris Assigned To => chris
2018-05-15 16:41 chris Status new => resolved
2018-05-15 16:41 chris Resolution open => fixed
2018-05-15 16:41 chris Status resolved => closed