mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: DragForce: modernise the code content
This commit is contained in:
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2014-2017 OpenFOAM Foundation
|
Copyright (C) 2014-2017 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2021 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -35,14 +36,13 @@ Foam::scalar Foam::DistortedSphereDragForce<CloudType>::CdRe
|
|||||||
const scalar Re
|
const scalar Re
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
// (AOB:Eq. 35; LMR:Eq. 9)
|
||||||
if (Re > 1000.0)
|
if (Re > 1000.0)
|
||||||
{
|
{
|
||||||
return 0.424*Re;
|
return 0.424*Re;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
return 24.0*(1.0 + (1.0/6.0)*pow(Re, 2.0/3.0));
|
||||||
return 24.0*(1.0 + (1.0/6.0)*pow(Re, 2.0/3.0));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -70,13 +70,6 @@ Foam::DistortedSphereDragForce<CloudType>::DistortedSphereDragForce
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class CloudType>
|
|
||||||
Foam::DistortedSphereDragForce<CloudType>::~DistortedSphereDragForce()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
@ -90,14 +83,16 @@ Foam::forceSuSp Foam::DistortedSphereDragForce<CloudType>::calcCoupled
|
|||||||
const scalar muc
|
const scalar muc
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
forceSuSp value(Zero);
|
|
||||||
|
|
||||||
// Limit the drop distortion to y=0 (sphere) and y=1 (disk)
|
// Limit the drop distortion to y=0 (sphere) and y=1 (disk)
|
||||||
scalar y = min(max(p.y(), 0), 1);
|
const scalar y = min(max(p.y(), scalar(0)), scalar(1));
|
||||||
|
|
||||||
value.Sp() = mass*0.75*muc*CdRe(Re)*(1 + 2.632*y)/(p.rho()*sqr(p.d()));
|
// (LMR:Eq. 10)
|
||||||
|
return
|
||||||
return value;
|
forceSuSp
|
||||||
|
(
|
||||||
|
Zero,
|
||||||
|
mass*0.75*muc*CdRe(Re)*(1.0 + 2.632*y)/(p.rho()*sqr(p.d()))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -126,7 +126,7 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class DistortedSphereDragForce Declaration
|
Class DistortedSphereDragForce Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
@ -168,9 +168,12 @@ public:
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- No copy assignment
|
||||||
|
void operator=(const DistortedSphereDragForce<CloudType>&) = delete;
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~DistortedSphereDragForce();
|
virtual ~DistortedSphereDragForce() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -31,19 +31,16 @@ License
|
|||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
Foam::scalar Foam::ErgunWenYuDragForce<CloudType>::CdRe
|
Foam::scalar Foam::ErgunWenYuDragForce<CloudType>::CdRe(const scalar alphacRe)
|
||||||
(
|
const
|
||||||
const scalar Re
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
if (Re > 1000.0)
|
// (ZZB:Eq. 14, GLSLR:Table 3)
|
||||||
|
if (alphacRe < 1000.0)
|
||||||
{
|
{
|
||||||
return 0.44*Re;
|
return 24.0*(1.0 + 0.15*pow(alphacRe, 0.687));
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return 24.0*(1.0 + 0.15*pow(Re, 0.687));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0.44*alphacRe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -85,13 +82,6 @@ Foam::ErgunWenYuDragForce<CloudType>::ErgunWenYuDragForce
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class CloudType>
|
|
||||||
Foam::ErgunWenYuDragForce<CloudType>::~ErgunWenYuDragForce()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
@ -105,7 +95,7 @@ Foam::forceSuSp Foam::ErgunWenYuDragForce<CloudType>::calcCoupled
|
|||||||
const scalar muc
|
const scalar muc
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
scalar alphac(alphac_[p.cell()]);
|
const scalar alphac = alphac_[p.cell()];
|
||||||
|
|
||||||
if (alphac < 0.8)
|
if (alphac < 0.8)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -168,8 +168,8 @@ class ErgunWenYuDragForce
|
|||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Drag coefficient multiplied by Reynolds number
|
//- Drag coefficient multiplied by volume fraction and Reynolds number
|
||||||
scalar CdRe(const scalar Re) const;
|
scalar CdRe(const scalar alphacRe) const;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -200,9 +200,12 @@ public:
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- No copy assignment
|
||||||
|
void operator=(const ErgunWenYuDragForce<CloudType>&) = delete;
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~ErgunWenYuDragForce();
|
virtual ~ErgunWenYuDragForce() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2021 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -32,6 +33,7 @@ License
|
|||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
Foam::scalar Foam::NonSphereDragForce<CloudType>::CdRe(const scalar Re) const
|
Foam::scalar Foam::NonSphereDragForce<CloudType>::CdRe(const scalar Re) const
|
||||||
{
|
{
|
||||||
|
// (HL:Eq. 10-11)
|
||||||
return 24.0*(1.0 + a_*pow(Re, b_)) + Re*c_/(1 + d_/(Re + ROOTVSMALL));
|
return 24.0*(1.0 + a_*pow(Re, b_)) + Re*c_/(1 + d_/(Re + ROOTVSMALL));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,13 +80,6 @@ Foam::NonSphereDragForce<CloudType>::NonSphereDragForce
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class CloudType>
|
|
||||||
Foam::NonSphereDragForce<CloudType>::~NonSphereDragForce()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
@ -98,11 +93,7 @@ Foam::forceSuSp Foam::NonSphereDragForce<CloudType>::calcCoupled
|
|||||||
const scalar muc
|
const scalar muc
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
forceSuSp value(Zero);
|
return forceSuSp(Zero, mass*0.75*muc*CdRe(Re)/(p.rho()*sqr(p.d())));
|
||||||
|
|
||||||
value.Sp() = mass*0.75*muc*CdRe(Re)/(p.rho()*sqr(p.d()));
|
|
||||||
|
|
||||||
return value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -165,7 +165,7 @@ protected:
|
|||||||
// Protected Data
|
// Protected Data
|
||||||
|
|
||||||
//- Ratio of surface of sphere having same volume as particle to
|
//- Ratio of surface of sphere having same volume as particle to
|
||||||
// actual surface area of particle (0 < phi <= 1)
|
//- actual surface area of particle (0 < phi <= 1)
|
||||||
scalar phi_;
|
scalar phi_;
|
||||||
|
|
||||||
|
|
||||||
@ -214,9 +214,12 @@ public:
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- No copy assignment
|
||||||
|
void operator=(const NonSphereDragForce<CloudType>&) = delete;
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~NonSphereDragForce();
|
virtual ~NonSphereDragForce() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -66,13 +66,6 @@ Foam::PlessisMasliyahDragForce<CloudType>::PlessisMasliyahDragForce
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class CloudType>
|
|
||||||
Foam::PlessisMasliyahDragForce<CloudType>::~PlessisMasliyahDragForce()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
@ -86,11 +79,11 @@ Foam::forceSuSp Foam::PlessisMasliyahDragForce<CloudType>::calcCoupled
|
|||||||
const scalar muc
|
const scalar muc
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
scalar alphac(alphac_[p.cell()]);
|
const scalar alphac = alphac_[p.cell()];
|
||||||
|
|
||||||
scalar cbrtAlphap(cbrt(1.0 - alphac));
|
const scalar cbrtAlphap = cbrt(1.0 - alphac);
|
||||||
|
|
||||||
scalar A =
|
const scalar A =
|
||||||
26.8*pow3(alphac)
|
26.8*pow3(alphac)
|
||||||
/(
|
/(
|
||||||
sqr(cbrtAlphap)
|
sqr(cbrtAlphap)
|
||||||
@ -99,9 +92,8 @@ Foam::forceSuSp Foam::PlessisMasliyahDragForce<CloudType>::calcCoupled
|
|||||||
+ SMALL
|
+ SMALL
|
||||||
);
|
);
|
||||||
|
|
||||||
scalar B =
|
// (P:Eq. 36)
|
||||||
sqr(alphac)
|
const scalar B = sqr(alphac)/sqr(1.0 - sqr(cbrtAlphap));
|
||||||
/sqr(1.0 - sqr(cbrtAlphap));
|
|
||||||
|
|
||||||
return forceSuSp
|
return forceSuSp
|
||||||
(
|
(
|
||||||
|
|||||||
@ -168,9 +168,12 @@ public:
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- No copy assignment
|
||||||
|
void operator=(const PlessisMasliyahDragForce<CloudType>&) = delete;
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~PlessisMasliyahDragForce();
|
virtual ~PlessisMasliyahDragForce() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
|
Copyright (C) 2021 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -32,14 +33,13 @@ License
|
|||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
Foam::scalar Foam::SphereDragForce<CloudType>::CdRe(const scalar Re) const
|
Foam::scalar Foam::SphereDragForce<CloudType>::CdRe(const scalar Re) const
|
||||||
{
|
{
|
||||||
|
// (AOB:Eq. 35)
|
||||||
if (Re > 1000.0)
|
if (Re > 1000.0)
|
||||||
{
|
{
|
||||||
return 0.424*Re;
|
return 0.424*Re;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
return 24.0*(1.0 + (1.0/6.0)*pow(Re, 2.0/3.0));
|
||||||
return 24.0*(1.0 + 1.0/6.0*pow(Re, 2.0/3.0));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -67,13 +67,6 @@ Foam::SphereDragForce<CloudType>::SphereDragForce
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class CloudType>
|
|
||||||
Foam::SphereDragForce<CloudType>::~SphereDragForce()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
@ -87,11 +80,8 @@ Foam::forceSuSp Foam::SphereDragForce<CloudType>::calcCoupled
|
|||||||
const scalar muc
|
const scalar muc
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
forceSuSp value(Zero);
|
// (AOB:Eq. 34)
|
||||||
|
return forceSuSp(Zero, mass*0.75*muc*CdRe(Re)/(p.rho()*sqr(p.d())));
|
||||||
value.Sp() = mass*0.75*muc*CdRe(Re)/(p.rho()*sqr(p.d()));
|
|
||||||
|
|
||||||
return value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -169,9 +169,12 @@ public:
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- No copy assignment
|
||||||
|
void operator=(const SphereDragForce<CloudType>&) = delete;
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~SphereDragForce();
|
virtual ~SphereDragForce() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -31,16 +31,15 @@ License
|
|||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
Foam::scalar Foam::WenYuDragForce<CloudType>::CdRe(const scalar Re) const
|
Foam::scalar Foam::WenYuDragForce<CloudType>::CdRe(const scalar alphacRe) const
|
||||||
{
|
{
|
||||||
if (Re > 1000.0)
|
// (ZZB:Eq. 14, GLSLR:Table 3)
|
||||||
|
if (alphacRe < 1000.0)
|
||||||
{
|
{
|
||||||
return 0.44*Re;
|
return 24.0*(1.0 + 0.15*pow(alphacRe, 0.687));
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return 24.0*(1.0 + 0.15*pow(Re, 0.687));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0.44*alphacRe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -82,13 +81,6 @@ Foam::WenYuDragForce<CloudType>::WenYuDragForce
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class CloudType>
|
|
||||||
Foam::WenYuDragForce<CloudType>::~WenYuDragForce()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
@ -102,7 +94,7 @@ Foam::forceSuSp Foam::WenYuDragForce<CloudType>::calcCoupled
|
|||||||
const scalar muc
|
const scalar muc
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
scalar alphac(alphac_[p.cell()]);
|
const scalar alphac = alphac_[p.cell()];
|
||||||
|
|
||||||
return forceSuSp
|
return forceSuSp
|
||||||
(
|
(
|
||||||
|
|||||||
@ -158,8 +158,8 @@ class WenYuDragForce
|
|||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Drag coefficient multiplied by Reynolds number
|
//- Drag coefficient multiplied by volume fraction and Reynolds number
|
||||||
scalar CdRe(const scalar Re) const;
|
scalar CdRe(const scalar alphacRe) const;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -190,9 +190,12 @@ public:
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- No copy assignment
|
||||||
|
void operator=(const WenYuDragForce<CloudType>&) = delete;
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~WenYuDragForce();
|
virtual ~WenYuDragForce() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
Reference in New Issue
Block a user