ENH: Pair collision model - added ramp time to bleed-in force contributions

This commit is contained in:
Andrew Heather
2018-05-22 10:05:36 +01:00
parent 885c47150e
commit 08193a50fa
3 changed files with 48 additions and 7 deletions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -37,7 +37,11 @@ Foam::PairModel<CloudType>::PairModel
: :
dict_(dict), dict_(dict),
owner_(owner), owner_(owner),
coeffDict_(dict.subDict(type + "Coeffs")) coeffDict_(dict.subDict(type + "Coeffs")),
forceRampTime_
(
this->coeffDict().template lookupOrDefault<scalar>("forceRampTime", -1)
)
{} {}
@ -66,13 +70,28 @@ const Foam::dictionary& Foam::PairModel<CloudType>::dict() const
template<class CloudType> template<class CloudType>
const Foam::dictionary& const Foam::dictionary& Foam::PairModel<CloudType>::coeffDict() const
Foam::PairModel<CloudType>::coeffDict() const
{ {
return coeffDict_; return coeffDict_;
} }
template<class CloudType>
Foam::scalar Foam::PairModel<CloudType>::forceCoeff
(
typename CloudType::parcelType& pA,
typename CloudType::parcelType& pB
) const
{
if (forceRampTime_ < 0)
{
return 1;
}
return min(min(pA.age(), pB.age())/forceRampTime_, 1);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "PairModelNew.C" #include "PairModelNew.C"

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -63,6 +63,21 @@ class PairModel
//- The coefficients dictionary //- The coefficients dictionary
const dictionary coeffDict_; const dictionary coeffDict_;
//- Time to bleed-in collision forces; default = 0 (no delay)
scalar forceRampTime_;
protected:
// Protected Member Functions
//- Return the force coefficient based on the forceRampTime_
scalar forceCoeff
(
typename CloudType::parcelType& pA,
typename CloudType::parcelType& pB
) const;
public: public:

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -193,7 +193,10 @@ void Foam::PairSpringSliderDashpot<CloudType>::evaluatePair
if (normalOverlapMag > 0) if (normalOverlapMag > 0)
{ {
//Particles in collision // Particles in collision
// Force coefficient
scalar forceCoeff = this->forceCoeff(pA, pB);
vector rHat_AB = r_AB/(r_AB_mag + VSMALL); vector rHat_AB = r_AB/(r_AB_mag + VSMALL);
@ -224,6 +227,8 @@ void Foam::PairSpringSliderDashpot<CloudType>::evaluatePair
*rHat_AB; *rHat_AB;
} }
fN_AB *= forceCoeff;
pA.f() += fN_AB; pA.f() += fN_AB;
pB.f() += -fN_AB; pB.f() += -fN_AB;
@ -278,6 +283,8 @@ void Foam::PairSpringSliderDashpot<CloudType>::evaluatePair
fT_AB = - kT*tangentialOverlap_AB - etaT*USlip_AB; fT_AB = - kT*tangentialOverlap_AB - etaT*USlip_AB;
} }
fT_AB *= forceCoeff;
pA.f() += fT_AB; pA.f() += fT_AB;
pB.f() += -fT_AB; pB.f() += -fT_AB;