From bf9b9204c31b472f936039de5e25c9a1eaeedfbb Mon Sep 17 00:00:00 2001 From: Andrew Heather <> Date: Mon, 3 Jun 2024 10:46:27 +0100 Subject: [PATCH] ENH: MRF - added function to return the frame absolute flux --- .../cfdTools/general/MRF/MRFZoneList.C | 23 ++++++++++++++++++- .../cfdTools/general/MRF/MRFZoneList.H | 5 +++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.C b/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.C index a66957b9ec..d50d8a65cf 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2017 OpenFOAM Foundation - Copyright (C) 2021 OpenCFD Ltd. + Copyright (C) 2021-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -28,6 +28,7 @@ License #include "MRFZoneList.H" #include "volFields.H" +#include "surfaceFields.H" #include "fixedValueFvsPatchFields.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -216,6 +217,26 @@ Foam::tmp Foam::MRFZoneList::DDt } +Foam::tmp Foam::MRFZoneList::phi() const +{ + auto tphi = surfaceScalarField::New + ( + "phiMRF", + IOobject::NO_REGISTER, + mesh_, + dimensionedScalar(dimVelocity*dimArea, Zero) + ); + auto& phi = tphi.ref(); + + for (const auto& mrf : *this) + { + mrf.makeAbsolute(phi); + } + + return tphi; +} + + void Foam::MRFZoneList::makeRelative(volVectorField& U) const { for (const auto& mrf: *this) diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.H b/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.H index 72ee1c9860..c91c24f4e7 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.H +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2018 OpenFOAM Foundation - Copyright (C) 2021 OpenCFD Ltd. + Copyright (C) 2021-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -127,6 +127,9 @@ public: const volVectorField& U ) const; + //- Return the MRF absolute flux + tmp phi() const; + //- Make the given absolute velocity relative within the MRF region void makeRelative(volVectorField& U) const;