From abf6d57ae8fe3f0a71429bb58ed84c796cb19c8d Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 15 Jan 2019 16:58:27 +0100 Subject: [PATCH] ENH: include the selection volume in momentum output --- src/functionObjects/field/momentum/momentum.C | 23 ++++++++++++++----- src/functionObjects/field/momentum/momentum.H | 8 ++++++- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/functionObjects/field/momentum/momentum.C b/src/functionObjects/field/momentum/momentum.C index 53438c91af..d36af0afd3 100644 --- a/src/functionObjects/field/momentum/momentum.C +++ b/src/functionObjects/field/momentum/momentum.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -249,8 +249,9 @@ void Foam::functionObjects::momentum::writeFileHeader(Ostream& os) { writeTabbed(os, "(momentum_r momentum_rtheta momentum_axis)"); } - os << endl; + writeTabbed(os, "volume"); + os << endl; writtenHeader_ = true; } @@ -319,7 +320,8 @@ void Foam::functionObjects::momentum::writeValues(Ostream& os) { os << tab << sumAngularMom_; } - os << endl; + + os << tab << volRegion::V() << endl; } Log << endl; @@ -409,9 +411,6 @@ bool Foam::functionObjects::momentum::read(const dictionary& dict) pName_ = dict.lookupOrDefault("p", "p"); rhoName_ = dict.lookupOrDefault("rho", "rho"); rhoRef_ = dict.lookupOrDefault("rhoRef", 1.0); - - rhoRef_ = dict.lookupOrDefault("rhoRef", 1.0); - hasCsys_ = dict.lookupOrDefault("cylindrical", false); if (hasCsys_) @@ -570,4 +569,16 @@ bool Foam::functionObjects::momentum::write() } +void Foam::functionObjects::momentum::updateMesh(const mapPolyMesh& mpm) +{ + volRegion::updateMesh(mpm); +} + + +void Foam::functionObjects::momentum::movePoints(const polyMesh& pm) +{ + volRegion::movePoints(pm); +} + + // ************************************************************************* // diff --git a/src/functionObjects/field/momentum/momentum.H b/src/functionObjects/field/momentum/momentum.H index 2da62e1ea0..4db24cbfe4 100644 --- a/src/functionObjects/field/momentum/momentum.H +++ b/src/functionObjects/field/momentum/momentum.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -251,6 +251,12 @@ public: //- Write the momentum, possibly angular momentum and velocity virtual bool write(); + + //- Update for changes of mesh + virtual void updateMesh(const mapPolyMesh&); + + //- Update for mesh point-motion + virtual void movePoints(const polyMesh&); };