From 87dc45f49520eb568046502b90b0939eb16083ed Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Tue, 3 Feb 2015 12:31:01 +0000
Subject: [PATCH] BUG: MRF: update velocity in case of non-constant rotation

---
 src/fvOptions/sources/derived/MRFSource/MRFSource.C | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/fvOptions/sources/derived/MRFSource/MRFSource.C b/src/fvOptions/sources/derived/MRFSource/MRFSource.C
index 59fd4ff..531d35f 100644
--- a/src/fvOptions/sources/derived/MRFSource/MRFSource.C
+++ b/src/fvOptions/sources/derived/MRFSource/MRFSource.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2012-2014 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2012-2015 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -103,6 +103,10 @@ void Foam::fv::MRFSource::addSup
     const label fieldI
 )
 {
+    // Make sure the boundary velocity is consistent with the rotation
+    // (not needed for constant rotation)
+    mrfPtr_->correctBoundaryVelocity(const_cast<volVectorField&>(eqn.psi()));
+
     // Add to rhs of equation
     mrfPtr_->addCoriolis(eqn, true);
 }
@@ -115,6 +119,10 @@ void Foam::fv::MRFSource::addSup
     const label fieldI
 )
 {
+    // Make sure the boundary velocity is consistent with the rotation
+    // (not needed for constant rotation)
+    mrfPtr_->correctBoundaryVelocity(const_cast<volVectorField&>(eqn.psi()));
+
     // Add to rhs of equation
     mrfPtr_->addCoriolis(rho, eqn, true);
 }
-- 
1.8.1.4

