SaffmanMeiLift.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 "SaffmanMeiLift.H"
29 #include "coupledToFluid.H"
30 #include "sphericalCoupled.H"
31 #include "LagrangianmSp.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::SaffmanMeiLift::calcL
54 (
55  const LagrangianModelRef& model,
56  const LagrangianSubMesh& subMesh
57 ) const
58 {
59  using namespace constant::mathematical;
60 
61  const clouds::carried& cCloud = cloud<clouds::carried>();
62  const clouds::spherical& sCloud = cloud<clouds::spherical>();
63  const clouds::coupled& cplCloud = cloud<clouds::coupled>();
64  const clouds::sphericalCoupled& scCloud = cloud<clouds::sphericalCoupled>();
65 
66  tmp<LagrangianSubScalarSubField> td = sCloud.d(model, subMesh);
67  const LagrangianSubScalarSubField& d = td();
68  const LagrangianSubScalarField& v = sCloud.v(model, subMesh);
69  const LagrangianSubScalarField& nuc = cplCloud.nuc(model, subMesh);
70  const LagrangianSubScalarField& Re = scCloud.Re(model, subMesh);
71  const LagrangianSubVectorField& curlUc = cCloud.curlUc(model, subMesh);
72 
73  const LagrangianSubScalarField mcByMOrMc
74  (
75  isCloud<clouds::coupledToConstantDensityFluid>()
76  ? v/cloud<clouds::coupledToConstantDensityFluid>().rhoByRhoc
77  : v*cloud<clouds::coupledToFluid>().rhoc(model, subMesh)
78  );
79 
80  const LagrangianSubScalarField Rew(mag(curlUc)*sqr(d)/nuc);
81  const LagrangianSubScalarField beta(Rew/(Re + rootVSmall)/2);
82  const LagrangianSubScalarField alpha(0.3314*sqrt(beta));
83  const LagrangianSubScalarField Cld
84  (
85  neg(Re - 40)*6.46*((1 - alpha)*exp(-0.1*Re) + alpha)
86  + pos(Re - 40)*6.46*0.0524*sqrt(beta*Re)
87  );
88 
89  return
91  (
92  subMesh.sub("L"),
93  -mcByMOrMc*3/(twoPi*sqrt(Rew + rootVSmall))*Cld*(*curlUc)
94  );
95 }
96 
97 
98 void Foam::Lagrangian::SaffmanMeiLift::addUSup
99 (
101  LagrangianEqn<vector>& eqn
102 ) const
103 {
104  const LagrangianSubTensorField& L = this->L(U.mesh());
105 
106  const LagrangianSubVectorField& Uc = cloud<clouds::carried>().Uc(U.mesh());
107 
108  if (eqn.isPsi(U))
109  {
110  eqn.Su += L & Uc;
111  eqn -= Lagrangianm::Sp(L, U);
112  }
113  else
114  {
115  eqn += Lagrangianm::Sp(L, Uc);
116  eqn.Su -= L & U;
117  }
118 }
119 
120 
121 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
122 
124 (
125  const word& name,
126  const LagrangianMesh& mesh,
127  const dictionary& modelDict,
128  const dictionary& stateDict
129 )
130 :
132  cloudLagrangianModel(static_cast<const LagrangianModel&>(*this)),
133  L
134  (
135  cloud().derivedField<tensor>
136  (
137  *this,
138  &SaffmanMeiLift::calcL
139  )
140  )
141 {
142  cloud<clouds::carried>().curlUc.psi();
143 }
144 
145 
146 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
147 
149 {
150  return wordList({cloud().U.name()});
151 }
152 
153 
155 (
156  const word& fieldName,
157  const word& eqnFieldName
158 ) const
159 {
160  return
161  fieldName == cloud().U.name()
162  && (
163  eqnFieldName == cloud().U.name()
164  || eqnFieldName == cloud<clouds::carried>().Uc.name()
165  );
166 }
167 
168 
170 (
171  const LagrangianSubScalarField& deltaT,
174 ) const
175 {
176  assertCloud<clouds::coupledToConstantDensityFluid>();
177 
178  addUSup(U, eqn);
179 }
180 
181 
183 (
184  const LagrangianSubScalarField& deltaT,
185  const LagrangianSubScalarSubField& vOrM,
188 ) const
189 {
190  assertCloud
191  <
194  >();
195 
196  addUSup(U, eqn);
197 }
198 
199 
200 // ************************************************************************* //
Functions for calculating sources in a Lagrangian equation.
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
static tmp< DimensionedField< Type, GeoMesh, PrimitiveField > > New(const word &name, const GeoMesh &mesh, const dimensionSet &, const PrimitiveField< Type > &)
Return a temporary field constructed from name, mesh,.
const word & name() const
Return name.
Definition: IOobject.H:307
This class stores the coefficients of a Lagrangian equation, and facilitates solving that equation an...
Definition: LagrangianEqn.H:56
Class containing Lagrangian geometry and topology.
Base class for Lagrangian models.
const LagrangianMesh & mesh() const
The mesh.
const word & name() const
The source name.
Lift model of Saffman (1965) as extended by Mei (1992). Applicable to spherical particles.
virtual wordList addSupFields() const
Return the name of the velocity field.
virtual bool addsSupToField(const word &fieldName, const word &eqnFieldName) const
Return true for the velocity or carrier velocity field.
virtual void addSup(const LagrangianSubScalarField &deltaT, const LagrangianSubVectorSubField &U, LagrangianEqn< vector > &eqn) const
Add a source term to the velocity equation.
SaffmanMeiLift(const word &name, const LagrangianMesh &mesh, const dictionary &modelDict, const dictionary &stateDict)
Construct from components.
const CloudDerivedField< tensor > & L
Lift force.
Mix-in for Lagrangian models that refer to a cloud.
Base class for clouds. Provides a basic evolution algorithm, models, and a database for caching deriv...
Definition: cloud.H:61
CloudStateField< vector > U
Velocity.
Definition: cloud.H:209
Base class for clouds which are coupled to a constant density fluid.
Base class for clouds which are coupled to a variable density fluid.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
static dictionary stateDict(const word &name, const objectRegistry &db)
Construct and return the state dictionary for reading.
Definition: stateModel.C:137
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:63
U
Definition: pEqn.H:72
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)
tmp< LagrangianEqn< Type > > Sp(const LagrangianSubField< SpType > &Sp, const LagrangianSubSubField< Type > &psi)
Return a source matrix.
const scalar twoPi(2 *pi)
Namespace for OpenFOAM.
dimensionedScalar pos(const dimensionedScalar &ds)
List< word > wordList
A List of words.
Definition: fileName.H:54
dimensionedScalar exp(const dimensionedScalar &ds)
tmp< DimensionedField< typename outerProduct< Type, Type >::type, GeoMesh, Field >> sqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
LagrangianSubSubField< vector > LagrangianSubVectorSubField
dimensionedScalar neg(const dimensionedScalar &ds)
LagrangianSubSubField< scalar > LagrangianSubScalarSubField
tmp< DimensionedField< scalar, GeoMesh, Field > > mag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
LagrangianSubField< tensor > LagrangianSubTensorField
LagrangianSubField< scalar > LagrangianSubScalarField
void sqrt(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
LagrangianSubField< vector > LagrangianSubVectorField
scalarField Re(const UList< complex > &cf)
Definition: complexFields.C:97