mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
functionObjects:surfaceFieldValue, volFieldValue: Added weightedSum and weighted[Area|Vol]Integrate
Patch contributed by Timo Niemi, VTT. Resolves patch request https://bugs.openfoam.org/view.php?id=2452
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -141,6 +141,18 @@ processSameTypeValues
|
||||
result = sum(values);
|
||||
break;
|
||||
}
|
||||
case opWeightedSum:
|
||||
{
|
||||
if (weightField.size())
|
||||
{
|
||||
result = sum(weightField*values);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = sum(values);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case opSumMag:
|
||||
{
|
||||
result = sum(cmptMag(values));
|
||||
@ -213,6 +225,20 @@ processSameTypeValues
|
||||
result = sum(magSf*values);
|
||||
break;
|
||||
}
|
||||
case opWeightedAreaIntegrate:
|
||||
{
|
||||
const scalarField magSf(mag(Sf));
|
||||
|
||||
if (weightField.size())
|
||||
{
|
||||
result = sum(weightField*magSf*values);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = sum(magSf*values);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case opMin:
|
||||
{
|
||||
result = min(values);
|
||||
|
||||
Reference in New Issue
Block a user