From 83707b29ea6a237a0ead7b322e2a1896991bd714 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 18 Sep 2013 15:58:22 +0100 Subject: [PATCH] BUG: Added files missed during commit f588b4f --- .../Templates/KinematicCloud/KinematicCloud.H | 6 +++++ .../KinematicCloud/KinematicCloudI.H | 8 ++++++ .../ParticleForceList/ParticleForceList.C | 26 ++++++++++++++----- .../ParticleForceList/ParticleForceList.H | 14 +++++++++- .../ParticleForceList/ParticleForceListI.H | 16 +++++++++++- 5 files changed, 61 insertions(+), 9 deletions(-) diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H index c29dfe2c8d..e32a3bdf4f 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H @@ -397,6 +397,9 @@ public: // inline const typename parcelType::forceType& forces() const; inline const forceType& forces() const; + //- Return the optional particle forces + inline forceType& forces(); + //- Optional cloud function objects inline functionType& functions(); @@ -487,6 +490,9 @@ public: //- Total linear kinetic energy in the system inline scalar linearKineticEnergyOfSystem() const; + //- Total rotational kinetic energy in the system + inline scalar rotationalKineticEnergyOfSystem() const; + //- Penetration for fraction [0-1] of the current total mass inline scalar penetration(const scalar fraction) const; diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H index 5f0d6767f3..1bbf47b41a 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H @@ -156,6 +156,14 @@ Foam::KinematicCloud::forces() const } +template +inline typename Foam::KinematicCloud::forceType& +Foam::KinematicCloud::forces() +{ + return forces_; +} + + template inline typename Foam::KinematicCloud::functionType& Foam::KinematicCloud::functions() diff --git a/src/lagrangian/intermediate/submodels/ForceTypes/ParticleForceList/ParticleForceList.C b/src/lagrangian/intermediate/submodels/ForceTypes/ParticleForceList/ParticleForceList.C index 04016823b4..81fced59a8 100644 --- a/src/lagrangian/intermediate/submodels/ForceTypes/ParticleForceList/ParticleForceList.C +++ b/src/lagrangian/intermediate/submodels/ForceTypes/ParticleForceList/ParticleForceList.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,7 +38,9 @@ Foam::ParticleForceList::ParticleForceList PtrList >(), owner_(owner), mesh_(mesh), - dict_(dictionary::null) + dict_(dictionary::null), + calcCoupled_(true), + calcNonCoupled_(true) {} @@ -54,7 +56,9 @@ Foam::ParticleForceList::ParticleForceList PtrList >(), owner_(owner), mesh_(mesh), - dict_(dict) + dict_(dict), + calcCoupled_(true), + calcNonCoupled_(true) { if (readFields) { @@ -151,9 +155,13 @@ Foam::forceSuSp Foam::ParticleForceList::calcCoupled ) const { forceSuSp value(vector::zero, 0.0); - forAll(*this, i) + + if (calcCoupled_) { - value += this->operator[](i).calcCoupled(p, dt, mass, Re, muc); + forAll(*this, i) + { + value += this->operator[](i).calcCoupled(p, dt, mass, Re, muc); + } } return value; @@ -171,9 +179,13 @@ Foam::forceSuSp Foam::ParticleForceList::calcNonCoupled ) const { forceSuSp value(vector::zero, 0.0); - forAll(*this, i) + + if (calcNonCoupled_) { - value += this->operator[](i).calcNonCoupled(p, dt, mass, Re, muc); + forAll(*this, i) + { + value += this->operator[](i).calcNonCoupled(p, dt, mass, Re, muc); + } } return value; diff --git a/src/lagrangian/intermediate/submodels/ForceTypes/ParticleForceList/ParticleForceList.H b/src/lagrangian/intermediate/submodels/ForceTypes/ParticleForceList/ParticleForceList.H index fe5f561268..0c7b08a7ed 100644 --- a/src/lagrangian/intermediate/submodels/ForceTypes/ParticleForceList/ParticleForceList.H +++ b/src/lagrangian/intermediate/submodels/ForceTypes/ParticleForceList/ParticleForceList.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -64,6 +64,12 @@ class ParticleForceList //- Forces dictionary const dictionary dict_; + //- Calculate coupled forces flag + bool calcCoupled_; + + //- Calculate non-coupled forces flag + bool calcNonCoupled_; + public: @@ -105,6 +111,12 @@ public: //- Return the forces dictionary inline const dictionary& dict() const; + //- Set the calcCoupled flag + inline void setCalcCoupled(bool flag); + + //- Set the calcNonCoupled flag + inline void setCalcNonCoupled(bool flag); + // Evaluation diff --git a/src/lagrangian/intermediate/submodels/ForceTypes/ParticleForceList/ParticleForceListI.H b/src/lagrangian/intermediate/submodels/ForceTypes/ParticleForceList/ParticleForceListI.H index db2f807ed2..a803255935 100644 --- a/src/lagrangian/intermediate/submodels/ForceTypes/ParticleForceList/ParticleForceListI.H +++ b/src/lagrangian/intermediate/submodels/ForceTypes/ParticleForceList/ParticleForceListI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -53,4 +53,18 @@ inline const Foam::dictionary& Foam::ParticleForceList::dict() const } +template +inline void Foam::ParticleForceList::setCalcCoupled(bool flag) +{ + calcCoupled_ = flag; +} + + +template +inline void Foam::ParticleForceList::setCalcNonCoupled(bool flag) +{ + calcNonCoupled_ = flag; +} + + // ************************************************************************* //