functionObject::fieldAverage: Corrected the name of mean and variance of phase fields

Now rather than the average of "U.air" being named "U.airMean" it is correctly
named for the air phase "UMean.air".
This commit is contained in:
Henry Weller
2019-07-30 12:22:10 +01:00
parent 22bba48722
commit ba5cdbeb61
3 changed files with 38 additions and 18 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -27,12 +27,12 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::word Foam::functionObjects::fieldAverageItem::EXT_MEAN const Foam::word Foam::functionObjects::fieldAverageItem::meanExt
( (
"Mean" "Mean"
); );
const Foam::word Foam::functionObjects::fieldAverageItem::EXT_PRIME2MEAN const Foam::word Foam::functionObjects::fieldAverageItem::prime2MeanExt
( (
"Prime2Mean" "Prime2Mean"
); );

View File

@ -78,16 +78,6 @@ class fieldAverageItem
{ {
public: public:
// Public data
// File and field name extensions
//- Mean average
static const word EXT_MEAN;
//- Prime-squared average
static const word EXT_PRIME2MEAN;
//- Enumeration defining the averaging base type //- Enumeration defining the averaging base type
enum class baseType enum class baseType
{ {
@ -130,6 +120,17 @@ private:
public: public:
// Static data
// File and field name extensions
//- Mean average
static const word meanExt;
//- Prime-squared average
static const word prime2MeanExt;
// Constructors // Constructors
//- Construct null //- Construct null

View File

@ -26,6 +26,7 @@ License
#include "fieldAverageItem.H" #include "fieldAverageItem.H"
#include "IOstreams.H" #include "IOstreams.H"
#include "dictionaryEntry.H" #include "dictionaryEntry.H"
#include "IOobject.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -54,8 +55,18 @@ Foam::functionObjects::fieldAverageItem::fieldAverageItem(Istream& is)
window_ = entry.lookupOrDefault<scalar>("window", -1.0); window_ = entry.lookupOrDefault<scalar>("window", -1.0);
windowName_ = entry.lookupOrDefault<word>("windowName", ""); windowName_ = entry.lookupOrDefault<word>("windowName", "");
meanFieldName_ = fieldName_ + EXT_MEAN; meanFieldName_ = IOobject::groupName
prime2MeanFieldName_ = fieldName_ + EXT_PRIME2MEAN; (
IOobject::member(fieldName_) + meanExt,
IOobject::group(fieldName_)
);
prime2MeanFieldName_ = IOobject::groupName
(
IOobject::member(fieldName_) + prime2MeanExt,
IOobject::group(fieldName_)
);
if ((window_ > 0) && (windowName_ != "")) if ((window_ > 0) && (windowName_ != ""))
{ {
meanFieldName_ = meanFieldName_ + "_" + windowName_; meanFieldName_ = meanFieldName_ + "_" + windowName_;
@ -87,9 +98,17 @@ Foam::Istream& Foam::functionObjects::operator>>
faItem.window_ = entry.lookupOrDefault<scalar>("window", -1.0); faItem.window_ = entry.lookupOrDefault<scalar>("window", -1.0);
faItem.windowName_ = entry.lookupOrDefault<word>("windowName", ""); faItem.windowName_ = entry.lookupOrDefault<word>("windowName", "");
faItem.meanFieldName_ = faItem.fieldName_ + fieldAverageItem::EXT_MEAN; faItem.meanFieldName_ = IOobject::groupName
faItem.prime2MeanFieldName_ = (
faItem.fieldName_ + fieldAverageItem::EXT_PRIME2MEAN; IOobject::member(faItem.fieldName_) + fieldAverageItem::meanExt,
IOobject::group(faItem.fieldName_)
);
faItem.prime2MeanFieldName_ = IOobject::groupName
(
IOobject::member(faItem.fieldName_) + fieldAverageItem::prime2MeanExt,
IOobject::group(faItem.fieldName_)
);
if ((faItem.window_ > 0) && (faItem.windowName_ != "")) if ((faItem.window_ > 0) && (faItem.windowName_ != ""))
{ {