GidaspowErgunWenYuDrag.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2025-2026 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "GidaspowErgunWenYuDrag.H"
27 #include "SchillerNaumannDrag.H"
30 #include "coupledToFluid.H"
31 #include "sphericalCoupled.H"
32 
33 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
37 namespace Lagrangian
38 {
41  (
45  );
46 }
47 }
48 
49 
50 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
51 
53 Foam::Lagrangian::GidaspowErgunWenYuDrag::calcD
54 (
55  const LagrangianModelRef& model,
56  const LagrangianSubMesh& subMesh
57 ) const
58 {
59  const clouds::spherical& sCloud = cloud<clouds::spherical>();
60  const clouds::sphericalCoupled& scCloud = cloud<clouds::sphericalCoupled>();
61 
62  tmp<LagrangianSubScalarSubField> td = sCloud.d(model, subMesh);
63  const LagrangianSubScalarSubField& d = td();
64  const LagrangianSubScalarField& Re = scCloud.Re(model, subMesh);
65 
66  const LagrangianSubScalarField alpha(min(sCloud.alpha(subMesh), alphaMax_));
67  const LagrangianSubScalarField alphac(1 - alpha);
68 
69  const LagrangianSubScalarField CdRe
70  (
71  // Use Wen-Yu at low particulate fractions (< 20%) ...
72  pos0(alphac - 0.8)
74  *pow(alphac, -2.65)
75 
76  // ... and Ergun at high particulate fractions (> 20%)
77  + neg(alphac - 0.8)*(4.0/3.0)*(150*alpha/alphac + 1.75*Re)
78  );
79 
81  <
82  clouds::coupledToConstantDensityFluid,
83  clouds::coupledToFluid
84  >();
85 
86  tmp<LagrangianSubScalarField> tmucByRhoOrMuc =
87  isCloud<clouds::coupledToConstantDensityFluid>()
88  ? (
89  cloud<clouds::coupledToConstantDensityFluid>().nuc(model, subMesh)
90  /cloud<clouds::coupledToConstantDensityFluid>().rhoByRhoc
91  )
92  : tmp<LagrangianSubScalarField>
93  (
94  cloud<clouds::coupledToFluid>().muc(model, subMesh)
95  );
96 
97  return CdRe*(constant::mathematical::pi/8)*d*tmucByRhoOrMuc;
98 }
99 
100 
101 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
102 
104 (
105  const word& name,
106  const LagrangianMesh& mesh,
107  const dictionary& modelDict,
108  const dictionary& stateDict
109 )
110 :
111  drag(name, mesh, modelDict, stateDict),
112  alphaMax_(modelDict.lookup<scalar>("alphaMax", units::fraction))
113 {}
114 
115 
116 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Class containing Lagrangian geometry and topology.
Base class for Lagrangian models.
Drag model of Gidaspow which switches between the drag models of Ergun and Wen and Yu at different pa...
GidaspowErgunWenYuDrag(const word &name, const LagrangianMesh &mesh, const dictionary &modelDict, const dictionary &stateDict)
Construct from components.
static tmp< LagrangianSubScalarField > CdRe(const LagrangianSubScalarField &Re)
Return the drag coefficient times Reynold's number, as a function.
Base class for Lagrangian drag models.
Definition: drag.H:55
void assertCloud() const
Generate an error if the cloud is not one of the given types.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:63
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
defineTypeNameAndDebug(collisionPhaseTransfer, 0)
addToRunTimeSelectionTable(LagrangianModel, collisionPhaseTransfer, dictionary)
const unitSet fraction
const unitSet & lookup(const word &unitName)
Lookup and return the named unit from the table.
Definition: units.C:346
Namespace for OpenFOAM.
dimensionedScalar pos0(const dimensionedScalar &ds)
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
dimensionedScalar neg(const dimensionedScalar &ds)
LagrangianSubSubField< scalar > LagrangianSubScalarSubField
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
tmp< DimensionedField< typename powProduct< Type, r >::type, GeoMesh, Field > > pow(const DimensionedField< Type, GeoMesh, PrimitiveField > &df, typename powProduct< Type, r >::type)
LagrangianSubField< scalar > LagrangianSubScalarField
scalarField Re(const UList< complex > &cf)
Definition: complexFields.C:97