NonSphereDragForce.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "NonSphereDragForce.H"
30 
31 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
32 
33 template<class CloudType>
34 Foam::scalar Foam::NonSphereDragForce<CloudType>::CdRe(const scalar Re) const
35 {
36  // (HL:Eq. 10-11)
37  return 24.0*(1.0 + a_*pow(Re, b_)) + Re*c_/(1 + d_/(Re + ROOTVSMALL));
38 }
39 
40 
41 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42 
43 template<class CloudType>
45 (
46  CloudType& owner,
47  const fvMesh& mesh,
48  const dictionary& dict
49 )
50 :
51  ParticleForce<CloudType>(owner, mesh, dict, typeName, true),
52  phi_(this->coeffs().getScalar("phi")),
53  a_(exp(2.3288 - 6.4581*phi_ + 2.4486*sqr(phi_))),
54  b_(0.0964 + 0.5565*phi_),
55  c_(exp(4.9050 - 13.8944*phi_ + 18.4222*sqr(phi_) - 10.2599*pow3(phi_))),
56  d_(exp(1.4681 + 12.2584*phi_ - 20.7322*sqr(phi_) + 15.8855*pow3(phi_)))
57 {
58  if (phi_ <= 0 || phi_ > 1)
59  {
61  << "Ratio of surface of sphere having same volume as particle to "
62  << "actual surface area of particle (phi) must be greater than 0 "
63  << "and less than or equal to 1" << exit(FatalError);
64  }
65 }
66 
67 
68 template<class CloudType>
70 (
71  const NonSphereDragForce<CloudType>& df
72 )
73 :
74  ParticleForce<CloudType>(df),
75  phi_(df.phi_),
76  a_(df.a_),
77  b_(df.b_),
78  c_(df.c_),
79  d_(df.d_)
80 {}
81 
82 
83 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
84 
85 template<class CloudType>
87 (
88  const typename CloudType::parcelType& p,
89  const typename CloudType::parcelType::trackingData& td,
90  const scalar dt,
91  const scalar mass,
92  const scalar Re,
93  const scalar muc
94 ) const
95 {
96  return forceSuSp(Zero, mass*0.75*muc*CdRe(Re)/(p.rho()*sqr(p.d())));
97 }
98 
99 
100 // ************************************************************************* //
dictionary dict
DSMCCloud< dsmcParcel > CloudType
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
error FatalError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL ERROR&#39; header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:598
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Abstract base class for particle forces.
Definition: ParticleForce.H:54
Helper container for force Su and Sp terms.
Definition: forceSuSp.H:60
dynamicFvMesh & mesh
dimensionedScalar exp(const dimensionedScalar &ds)
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:290
scalarField Re(const UList< complex > &cmplx)
Extract real component.
Definition: complexField.C:207
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
dimensionedScalar pow3(const dimensionedScalar &ds)
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
scalar CdRe(const scalar Re) const
Drag coefficient multiplied by Reynolds number.
virtual forceSuSp calcCoupled(const typename CloudType::parcelType &p, const typename CloudType::parcelType::trackingData &td, const scalar dt, const scalar mass, const scalar Re, const scalar muc) const
Calculate the non-coupled force.
volScalarField & p
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:67
NonSphereDragForce(CloudType &owner, const fvMesh &mesh, const dictionary &dict)
Construct from mesh.
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:127