From 115bbd2699deb7600263424a35ee1af2fd9c6f2e Mon Sep 17 00:00:00 2001
From: Guanyang Xue <>
Date: Wed, 5 Jul 2023 16:34:50 +0200
Subject: [PATCH] ENH: reinstate support for cubic Brownian motion (#2922)

- continue to support spherical by default (for compatibility)
  but add the 'spherical' switch to disable that and use a cubic
  distribution instead.

STYLE: reduce number of inline files

  Co-authored-by: Mark Olesen <>
---
 .../ParticleForces/Gravity/GravityForce.H     | 15 +++--
 .../ParticleForces/Gravity/GravityForceI.H    | 38 +-----------
 .../NonInertialFrame/NonInertialFrameForce.H  | 31 +++++-----
 .../NonInertialFrame/NonInertialFrameForceI.H | 61 +------------------
 .../Paramagnetic/ParamagneticForce.H          | 23 ++++---
 .../Paramagnetic/ParamagneticForceI.H         | 47 +-------------
 .../ParticleForce/ParticleForce.H             | 27 ++++----
 .../ParticleForce/ParticleForceI.H            | 59 +-----------------
 .../BrownianMotion/BrownianMotionForce.C      | 53 +++++++++-------
 .../BrownianMotion/BrownianMotionForce.H      | 32 +++++++---
 .../BrownianMotion/BrownianMotionForceI.H     | 45 +-------------
 11 files changed, 104 insertions(+), 327 deletions(-)

diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Gravity/GravityForce.H b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Gravity/GravityForce.H
index c7810aff350..d44f594e5ff 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Gravity/GravityForce.H
+++ b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Gravity/GravityForce.H
@@ -38,8 +38,8 @@ SourceFiles
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef GravityForce_H
-#define GravityForce_H
+#ifndef Foam_GravityForce_H
+#define Foam_GravityForce_H
 
 #include "ParticleForce.H"
 
@@ -48,6 +48,7 @@ SourceFiles
 namespace Foam
 {
 
+// Forward Declarations
 class fvMesh;
 
 /*---------------------------------------------------------------------------*\
@@ -59,7 +60,7 @@ class GravityForce
 :
     public ParticleForce<CloudType>
 {
-    // Private data
+    // Private Data
 
         //- Reference to the acceleration due to gravity
         const vector& g_;
@@ -100,10 +101,10 @@ public:
 
     // Member Functions
 
-        // Access
+    // Access
 
-            //- Return the acceleration due to gravity
-            inline const vector& g() const;
+        //- Return the acceleration due to gravity
+        const vector& g() const noexcept { return g_; }
 
 
         // Evaluation
@@ -127,8 +128,6 @@ public:
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-#include "GravityForceI.H"
-
 #ifdef NoRepository
     #include "GravityForce.C"
 #endif
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Gravity/GravityForceI.H b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Gravity/GravityForceI.H
index a1459f76760..7cec1b4541d 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Gravity/GravityForceI.H
+++ b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Gravity/GravityForceI.H
@@ -1,37 +1 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | www.openfoam.com
-     \\/     M anipulation  |
--------------------------------------------------------------------------------
-    Copyright (C) 2011 OpenFOAM Foundation
--------------------------------------------------------------------------------
-License
-    This file is part of OpenFOAM.
-
-    OpenFOAM is free software: you can redistribute it and/or modify it
-    under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
-    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-    for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
-
-\*---------------------------------------------------------------------------*/
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-template<class CloudType>
-inline const Foam::vector& Foam::GravityForce<CloudType>::g() const
-{
-    return g_;
-}
-
-
-// ************************************************************************* //
+#warning File removed - left for old dependency check only
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/NonInertialFrame/NonInertialFrameForce.H b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/NonInertialFrame/NonInertialFrameForce.H
index db8fbc793ed..0a2824daab0 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/NonInertialFrame/NonInertialFrameForce.H
+++ b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/NonInertialFrame/NonInertialFrameForce.H
@@ -38,8 +38,8 @@ SourceFiles
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef NonInertialFrameForce_H
-#define NonInertialFrameForce_H
+#ifndef Foam_NonInertialFrameForce_H
+#define Foam_NonInertialFrameForce_H
 
 #include "ParticleForce.H"
 
@@ -48,8 +48,6 @@ SourceFiles
 namespace Foam
 {
 
-class fvMesh;
-
 /*---------------------------------------------------------------------------*\
                   Class NonInertialFrameForce Declaration
 \*---------------------------------------------------------------------------*/
@@ -59,7 +57,7 @@ class NonInertialFrameForce
 :
     public ParticleForce<CloudType>
 {
-    // Private data
+    // Private Data
 
         //- Name of the linear acceleration field
         word WName_;
@@ -121,19 +119,22 @@ public:
 
     // Member Functions
 
-        // Access
+    // Access
 
-            //- Return the linear acceleration of the reference frame
-            inline const vector& W() const;
+        //- Return the linear acceleration of the reference frame
+        const vector& W() const noexcept { return W_; }
 
-            //- Return the angular velocity of the reference frame
-            inline const vector& omega() const;
+        //- Return the angular velocity of the reference frame
+        const vector& omega() const noexcept { return omega_; }
 
-            //- Return the angular acceleration of the reference frame
-            inline const vector& omegaDot() const;
+        //- Return the angular acceleration of the reference frame
+        const vector& omegaDot() const noexcept { return omegaDot_; }
 
-            //- Return the centre of rotation of the reference frame
-            inline const vector& centreOfRotation() const;
+        //- Return the centre of rotation of the reference frame
+        const vector& centreOfRotation() const noexcept
+        {
+            return centreOfRotation_;
+        }
 
 
         // Evaluation
@@ -160,8 +161,6 @@ public:
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-#include "NonInertialFrameForceI.H"
-
 #ifdef NoRepository
     #include "NonInertialFrameForce.C"
 #endif
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/NonInertialFrame/NonInertialFrameForceI.H b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/NonInertialFrame/NonInertialFrameForceI.H
index e7c35adeb49..7cec1b4541d 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/NonInertialFrame/NonInertialFrameForceI.H
+++ b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/NonInertialFrame/NonInertialFrameForceI.H
@@ -1,60 +1 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | www.openfoam.com
-     \\/     M anipulation  |
--------------------------------------------------------------------------------
-    Copyright (C) 2011 OpenFOAM Foundation
--------------------------------------------------------------------------------
-License
-    This file is part of OpenFOAM.
-
-    OpenFOAM is free software: you can redistribute it and/or modify it
-    under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
-    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-    for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
-
-\*---------------------------------------------------------------------------*/
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-template<class CloudType>
-inline const Foam::vector& Foam::NonInertialFrameForce<CloudType>::W() const
-{
-    return W_;
-}
-
-
-template<class CloudType>
-inline const Foam::vector& Foam::NonInertialFrameForce<CloudType>::omega() const
-{
-    return omega_;
-}
-
-
-template<class CloudType>
-inline const Foam::vector&
-Foam::NonInertialFrameForce<CloudType>::omegaDot() const
-{
-    return omegaDot_;
-}
-
-
-template<class CloudType>
-inline const Foam::vector&
-Foam::NonInertialFrameForce<CloudType>::centreOfRotation() const
-{
-    return centreOfRotation_;
-}
-
-
-// ************************************************************************* //
+#warning File removed - left for old dependency check only
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Paramagnetic/ParamagneticForce.H b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Paramagnetic/ParamagneticForce.H
index 3e0978a8463..95e7d90634e 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Paramagnetic/ParamagneticForce.H
+++ b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Paramagnetic/ParamagneticForce.H
@@ -38,8 +38,8 @@ SourceFiles
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef ParamagneticForce_H
-#define ParamagneticForce_H
+#ifndef Foam_ParamagneticForce_H
+#define Foam_ParamagneticForce_H
 
 #include "ParticleForce.H"
 #include "interpolation.H"
@@ -49,8 +49,6 @@ SourceFiles
 namespace Foam
 {
 
-class fvMesh;
-
 /*---------------------------------------------------------------------------*\
                        Class ParamagneticForce Declaration
 \*---------------------------------------------------------------------------*/
@@ -60,7 +58,7 @@ class ParamagneticForce
 :
     public ParticleForce<CloudType>
 {
-    // Private data
+    // Private Data
 
         //- Name of paramagnetic field strength field - default = "HdotGradH"
         const word HdotGradHName_;
@@ -107,13 +105,16 @@ public:
 
     // Member Functions
 
-        // Access
+    // Access
 
-            //- Return the name of paramagnetic field strength field
-            const word& HdotGradHName() const;
+        //- Return the name of paramagnetic field strength field
+        const word& HdotGradHName() const noexcept { return HdotGradHName_; }
 
-            //- Return the magnetic susceptibility of particle
-            scalar magneticSusceptibility() const;
+        //- Return the magnetic susceptibility of particle
+        scalar magneticSusceptibility() const noexcept
+        {
+            return magneticSusceptibility_;
+        }
 
 
         // Evaluation
@@ -140,8 +141,6 @@ public:
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-#include "ParamagneticForceI.H"
-
 #ifdef NoRepository
     #include "ParamagneticForce.C"
 #endif
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Paramagnetic/ParamagneticForceI.H b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Paramagnetic/ParamagneticForceI.H
index 037918d6d86..7cec1b4541d 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Paramagnetic/ParamagneticForceI.H
+++ b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/Paramagnetic/ParamagneticForceI.H
@@ -1,46 +1 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | www.openfoam.com
-     \\/     M anipulation  |
--------------------------------------------------------------------------------
-    Copyright (C) 2011 OpenFOAM Foundation
--------------------------------------------------------------------------------
-License
-    This file is part of OpenFOAM.
-
-    OpenFOAM is free software: you can redistribute it and/or modify it
-    under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
-    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-    for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
-
-\*---------------------------------------------------------------------------*/
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-template<class CloudType>
-inline const Foam::word&
-Foam::ParamagneticForce<CloudType>::HdotGradHName() const
-{
-    return HdotGradHName_;
-}
-
-
-template<class CloudType>
-inline Foam::scalar
-Foam::ParamagneticForce<CloudType>::magneticSusceptibility() const
-{
-    return magneticSusceptibility_;
-}
-
-
-// ************************************************************************* //
+#warning File removed - left for old dependency check only
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForce.H b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForce.H
index 3e945461eb4..166fcba6b60 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForce.H
+++ b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForce.H
@@ -33,14 +33,13 @@ Description
     Abstract base class for particle forces
 
 SourceFiles
-    ParticleForceI.H
     ParticleForce.C
     ParticleForceNew.C
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef ParticleForce_H
-#define ParticleForce_H
+#ifndef Foam_ParticleForce_H
+#define Foam_ParticleForce_H
 
 #include "dictionary.H"
 #include "forceSuSp.H"
@@ -59,7 +58,7 @@ namespace Foam
 template<class CloudType>
 class ParticleForce
 {
-    // Private data
+    // Private Data
 
         //- Reference to the owner cloud
         CloudType& owner_;
@@ -136,19 +135,19 @@ public:
 
     // Member Functions
 
-        // Access
+    // Access
 
-            //- Return const access to the cloud owner
-            inline const CloudType& owner() const;
+        //- Return const access to the cloud owner
+        const CloudType& owner() const noexcept { return owner_; }
 
-            //- Return reference to the cloud owner
-            inline CloudType& owner();
+        //- Return reference to the cloud owner
+        CloudType& owner() noexcept { return owner_; }
 
-            //- Return the mesh database
-            inline const fvMesh& mesh() const;
+        //- Return the mesh database
+        const fvMesh& mesh() const noexcept { return mesh_; }
 
-            //- Return the force coefficients dictionary
-            inline const dictionary& coeffs() const;
+        //- Return the force coefficients dictionary
+        const dictionary& coeffs() const noexcept { return coeffs_; }
 
 
         // Evaluation
@@ -194,8 +193,6 @@ public:
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-#include "ParticleForceI.H"
-
 #ifdef NoRepository
     #include "ParticleForce.C"
 #endif
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForceI.H b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForceI.H
index 42e1ed2efa0..7cec1b4541d 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForceI.H
+++ b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/ParticleForce/ParticleForceI.H
@@ -1,58 +1 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | www.openfoam.com
-     \\/     M anipulation  |
--------------------------------------------------------------------------------
-    Copyright (C) 2011 OpenFOAM Foundation
--------------------------------------------------------------------------------
-License
-    This file is part of OpenFOAM.
-
-    OpenFOAM is free software: you can redistribute it and/or modify it
-    under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
-    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-    for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
-
-\*---------------------------------------------------------------------------*/
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-template<class CloudType>
-inline const CloudType& Foam::ParticleForce<CloudType>::owner() const
-{
-    return owner_;
-}
-
-
-template<class CloudType>
-inline CloudType& Foam::ParticleForce<CloudType>::owner()
-{
-    return owner_;
-}
-
-
-template<class CloudType>
-inline const Foam::fvMesh& Foam::ParticleForce<CloudType>::mesh() const
-{
-    return mesh_;
-}
-
-
-template<class CloudType>
-inline const Foam::dictionary& Foam::ParticleForce<CloudType>::coeffs() const
-{
-    return coeffs_;
-}
-
-
-// ************************************************************************* //
+#warning File removed - left for old dependency check only
diff --git a/src/lagrangian/turbulence/submodels/Thermodynamic/ParticleForces/BrownianMotion/BrownianMotionForce.C b/src/lagrangian/turbulence/submodels/Thermodynamic/ParticleForces/BrownianMotion/BrownianMotionForce.C
index adf38116963..ad4e14d68c5 100644
--- a/src/lagrangian/turbulence/submodels/Thermodynamic/ParticleForces/BrownianMotion/BrownianMotionForce.C
+++ b/src/lagrangian/turbulence/submodels/Thermodynamic/ParticleForces/BrownianMotion/BrownianMotionForce.C
@@ -79,7 +79,8 @@ Foam::BrownianMotionForce<CloudType>::BrownianMotionForce
     lambda_(this->coeffs().getScalar("lambda")),
     kPtr_(nullptr),
     turbulence_(this->coeffs().getBool("turbulence")),
-    ownK_(false)
+    ownK_(false),
+    useSpherical_(this->coeffs().getOrDefault("spherical", true))
 {}
 
 
@@ -94,7 +95,8 @@ Foam::BrownianMotionForce<CloudType>::BrownianMotionForce
     lambda_(bmf.lambda_),
     kPtr_(nullptr),
     turbulence_(bmf.turbulence_),
-    ownK_(false)
+    ownK_(false),
+    useSpherical_(bmf.useSpherical_)
 {}
 
 
@@ -103,7 +105,11 @@ Foam::BrownianMotionForce<CloudType>::BrownianMotionForce
 template<class CloudType>
 Foam::BrownianMotionForce<CloudType>::~BrownianMotionForce()
 {
-    cacheFields(false);
+    if (ownK_)
+    {
+        deleteDemandDrivenData(kPtr_);
+        ownK_ = false;
+    }
 }
 
 
@@ -179,28 +185,33 @@ Foam::forceSuSp Foam::BrownianMotionForce<CloudType>::calcCoupled
         f = mass*sqrt(mathematical::pi*s0/dt);
     }
 
-
-    // To generate a cubic distribution (3 independent directions) :
-    // const scalar sqrt2 = sqrt(2.0);
-    // for (direction dir = 0; dir < vector::nComponents; dir++)
-    // {
-    //     const scalar x = rndGen_.sample01<scalar>();
-    //     const scalar eta = sqrt2*Math::erfInv(2*x - 1.0);
-    //     value.Su()[dir] = f*eta;
-    // }
-
-
-    // To generate a spherical distribution:
-
     Random& rnd = this->owner().rndGen();
 
-    const scalar theta = rnd.sample01<scalar>()*twoPi;
-    const scalar u = 2*rnd.sample01<scalar>() - 1;
+    if (useSpherical_)
+    {
+        // To generate a spherical distribution:
+        const scalar theta = rnd.sample01<scalar>()*twoPi;
+        const scalar u = 2*rnd.sample01<scalar>() - 1;
 
-    const scalar a = sqrt(1 - sqr(u));
-    const vector dir(a*cos(theta), a*sin(theta), u);
+        const scalar a = sqrt(1 - sqr(u));
+        const vector dir(a*cos(theta), a*sin(theta), u);
 
-    value.Su() = f*mag(rnd.GaussNormal<scalar>())*dir;
+        value.Su() = f*mag(rnd.GaussNormal<scalar>())*dir;
+    }
+    else
+    {
+        // Generate a cubic distribution (3 independent directions)
+        value.Su() = f*rnd.GaussNormal<vector>();
+
+        // OLD CODE for cubic distribution
+        // const scalar sqrt2 = sqrt(2.0);
+        // for (direction dir = 0; dir < vector::nComponents; dir++)
+        // {
+        //     const scalar x = rnd.sample01<scalar>();
+        //     const scalar eta = sqrt2*Math::erfInv(2*x - 1.0);
+        //     value.Su()[dir] = f*eta;
+        // }
+    }
 
     return value;
 }
diff --git a/src/lagrangian/turbulence/submodels/Thermodynamic/ParticleForces/BrownianMotion/BrownianMotionForce.H b/src/lagrangian/turbulence/submodels/Thermodynamic/ParticleForces/BrownianMotion/BrownianMotionForce.H
index 57bbbdfdb2b..2ca2bb99d3e 100644
--- a/src/lagrangian/turbulence/submodels/Thermodynamic/ParticleForces/BrownianMotion/BrownianMotionForce.H
+++ b/src/lagrangian/turbulence/submodels/Thermodynamic/ParticleForces/BrownianMotion/BrownianMotionForce.H
@@ -39,14 +39,25 @@ Description
         16(4), 209-226.
     \endverbatim
 
+    Entries
+    \table
+        Property | Description                            | Type | Reqd | Deflt
+        lambda   | Molecular free path length             | scalar | yes  | -
+        turbulence | Use turbulence                       | bool | yes | -
+        spherical | Spherical instead of cubic distribution | bool | no  | true
+    \endtable
+
+Note
+    The treatment changed from cubic to spherical around v1606.
+    Reinstate support for cubic via spherical (true/false) switch after v2306.
+
 SourceFiles
-    BrownianMotionForceI.H
     BrownianMotionForce.C
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef BrownianMotionForce_H
-#define BrownianMotionForce_H
+#ifndef Foam_BrownianMotionForce_H
+#define Foam_BrownianMotionForce_H
 
 #include "ParticleForce.H"
 #include "Random.H"
@@ -82,6 +93,9 @@ class BrownianMotionForce
         //- Local ownership of the turbulence k field
         bool ownK_;
 
+        //- Spherical vs cubic (transitional)
+        bool useSpherical_;
+
 
     // Private Member Functions
 
@@ -124,13 +138,13 @@ public:
 
     // Member Functions
 
-        // Access
+    // Access
 
-            //- Return const access to the molecular free path length [m]
-            inline scalar lambda() const;
+        //- The molecular free path length [m]
+        scalar lambda() const noexcept { return lambda_; }
 
-            //- Return const access to the turbulence flag
-            inline bool turbulence() const;
+        //- The turbulence flag
+        bool turbulence() const noexcept { return turbulence_; }
 
 
         // Evaluation
@@ -157,8 +171,6 @@ public:
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-#include "BrownianMotionForceI.H"
-
 #ifdef NoRepository
     #include "BrownianMotionForce.C"
 #endif
diff --git a/src/lagrangian/turbulence/submodels/Thermodynamic/ParticleForces/BrownianMotion/BrownianMotionForceI.H b/src/lagrangian/turbulence/submodels/Thermodynamic/ParticleForces/BrownianMotion/BrownianMotionForceI.H
index f7bb60a0ba6..7cec1b4541d 100644
--- a/src/lagrangian/turbulence/submodels/Thermodynamic/ParticleForces/BrownianMotion/BrownianMotionForceI.H
+++ b/src/lagrangian/turbulence/submodels/Thermodynamic/ParticleForces/BrownianMotion/BrownianMotionForceI.H
@@ -1,44 +1 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | www.openfoam.com
-     \\/     M anipulation  |
--------------------------------------------------------------------------------
-    Copyright (C) 2011 OpenFOAM Foundation
--------------------------------------------------------------------------------
-License
-    This file is part of OpenFOAM.
-
-    OpenFOAM is free software: you can redistribute it and/or modify it
-    under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
-    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-    for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
-
-\*---------------------------------------------------------------------------*/
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-template<class CloudType>
-inline Foam::scalar Foam::BrownianMotionForce<CloudType>::lambda() const
-{
-    return lambda_;
-}
-
-
-template<class CloudType>
-inline bool Foam::BrownianMotionForce<CloudType>::turbulence() const
-{
-    return turbulence_;
-}
-
-
-// ************************************************************************* //
+#warning File removed - left for old dependency check only
-- 
GitLab