From f780dcd2b6fce88dfd5f1ee8201b6b336ef145e8 Mon Sep 17 00:00:00 2001 From: Henry <Henry> Date: Wed, 14 Nov 2012 15:47:22 +0000 Subject: [PATCH] MRFZone: Rationalized the update of Omega for tabulated omega --- .../cfdTools/general/MRF/MRFZone.C | 18 ++++++++++++------ .../cfdTools/general/MRF/MRFZone.H | 5 ++++- .../cfdTools/general/MRF/MRFZoneTemplates.C | 1 + 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C index d56bf6421ad..f09f38d4ee7 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C @@ -296,6 +296,12 @@ Foam::MRFZone::MRFZone // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +Foam::vector Foam::MRFZone::Omega() const +{ + return omega_->value(mesh_.time().timeOutputValue())*axis_; +} + + void Foam::MRFZone::addCoriolis ( const volVectorField& U, @@ -312,7 +318,7 @@ void Foam::MRFZone::addCoriolis vectorField& ddtUc = ddtU.internalField(); const vectorField& Uc = U.internalField(); - const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_; + const vector Omega = this->Omega(); forAll(cells, i) { @@ -334,7 +340,7 @@ void Foam::MRFZone::addCoriolis(fvVectorMatrix& UEqn) const vectorField& Usource = UEqn.source(); const vectorField& U = UEqn.psi(); - const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_; + const vector Omega = this->Omega(); forAll(cells, i) { @@ -360,7 +366,7 @@ void Foam::MRFZone::addCoriolis vectorField& Usource = UEqn.source(); const vectorField& U = UEqn.psi(); - const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_; + const vector Omega = this->Omega(); forAll(cells, i) { @@ -374,7 +380,7 @@ void Foam::MRFZone::relativeVelocity(volVectorField& U) const { const volVectorField& C = mesh_.C(); - const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_; + const vector Omega = this->Omega(); const labelList& cells = mesh_.cellZones()[cellZoneID_]; @@ -412,7 +418,7 @@ void Foam::MRFZone::absoluteVelocity(volVectorField& U) const { const volVectorField& C = mesh_.C(); - const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_; + const vector Omega = this->Omega(); const labelList& cells = mesh_.cellZones()[cellZoneID_]; @@ -480,7 +486,7 @@ void Foam::MRFZone::absoluteFlux void Foam::MRFZone::correctBoundaryVelocity(volVectorField& U) const { - const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_; + const vector Omega = this->Omega(); // Included patches diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZone.H b/src/finiteVolume/cfdTools/general/MRF/MRFZone.H index 74160cf39b8..5c6e05e2d39 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZone.H +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZone.H @@ -47,7 +47,7 @@ SourceFiles #include "volFieldsFwd.H" #include "surfaceFieldsFwd.H" #include "fvMatricesFwd.H" -#include "fvMatrices.H" +#include "mapPolyMesh.H" #include "DataEntry.H" #include "autoPtr.H" @@ -164,6 +164,9 @@ public: //- Return const access to the MRF active flag inline bool active() const; + //- Return the current Omega vector + vector Omega() const; + // Evaluation diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C b/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C index 872bf53a823..bc0087826c9 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C @@ -27,6 +27,7 @@ License #include "fvMesh.H" #include "volFields.H" #include "surfaceFields.H" +#include "fvMatrices.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -- GitLab