ENH: MRF - added function to return the frame absolute flux

This commit is contained in:
Andrew Heather
2024-06-03 10:46:27 +01:00
committed by Kutalmış Berçin
parent 06ee000cb8
commit bf9b9204c3
2 changed files with 26 additions and 2 deletions

View File

@ -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::volVectorField> Foam::MRFZoneList::DDt
}
Foam::tmp<Foam::surfaceScalarField> 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)

View File

@ -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<surfaceScalarField> phi() const;
//- Make the given absolute velocity relative within the MRF region
void makeRelative(volVectorField& U) const;