From e481e1a05a3e5c66e7303dd3712485d6e1170b39 Mon Sep 17 00:00:00 2001
From: Henry <Henry>
Date: Thu, 8 May 2014 11:45:12 +0100
Subject: [PATCH] MRF: add operator() for consistency with fvOptions

---
 .../cfdTools/general/MRF/MRFZone.C            |  2 +-
 .../cfdTools/general/MRF/MRFZoneList.C        | 42 ++++++++++++++++++-
 .../cfdTools/general/MRF/MRFZoneList.H        | 15 ++++++-
 3 files changed, 56 insertions(+), 3 deletions(-)

diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C
index 6201e8f42ca..4e905b85817 100644
--- a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C
+++ b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2014 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.C b/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.C
index c56106f40c0..1d35530ae0d 100644
--- a/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.C
+++ b/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2012-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012-2014 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -160,6 +160,46 @@ void Foam::MRFZoneList::addCoriolis
 }
 
 
+Foam::tmp<Foam::volVectorField> Foam::MRFZoneList::operator()
+(
+    const volVectorField& U
+)
+{
+    tmp<volVectorField> tacceleration
+    (
+        new volVectorField
+        (
+            IOobject
+            (
+                "MRFZoneList:acceleration",
+                U.mesh().time().timeName(),
+                U.mesh()
+            ),
+            U.mesh(),
+            dimensionedVector("0", U.dimensions()/dimTime, vector::zero)
+        )
+    );
+    volVectorField& acceleration = tacceleration();
+
+    forAll(*this, i)
+    {
+        operator[](i).addCoriolis(U, acceleration);
+    }
+
+    return tacceleration;
+}
+
+
+Foam::tmp<Foam::volVectorField> Foam::MRFZoneList::operator()
+(
+    const volScalarField& rho,
+    const volVectorField& U
+)
+{
+    return rho*operator()(U);
+}
+
+
 void Foam::MRFZoneList::makeRelative(volVectorField& U) const
 {
     forAll(*this, i)
diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.H b/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.H
index 4965d85e39e..2cf759c3e94 100644
--- a/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.H
+++ b/src/finiteVolume/cfdTools/general/MRF/MRFZoneList.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2012-2013 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012-2014 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -102,6 +102,19 @@ public:
         //- Add the Coriolis force contribution to the momentum equation
         void addCoriolis(const volScalarField& rho, fvVectorMatrix& UEqn) const;
 
+        //- Return the frame acceleration
+        tmp<volVectorField> operator()
+        (
+            const volVectorField& U
+        );
+
+        //- Return the frame acceleration force
+        tmp<volVectorField> operator()
+        (
+            const volScalarField& rho,
+            const volVectorField& U
+        );
+
         //- Make the given absolute velocity relative within the MRF region
         void makeRelative(volVectorField& U) const;
 
-- 
GitLab