Usher.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) 2024 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 "Usher.H"
28 
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 namespace packingDispersionModels
34 {
37  (
39  Usher,
41  );
42 }
43 }
44 
45 
46 // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
47 
48 template<class T>
49 inline auto Foam::packingDispersionModels::Usher::sigma1(const T& alphad) const
50 {
51  return sigma01_*pow
52  (
53  (alphad - alphaGel_)
54  /(alphacp_ - alphad)*(b1_ + alphad - alphaGel_),
55  n1_
56  );
57 }
58 
59 
60 template<class T>
61 inline auto Foam::packingDispersionModels::Usher::sigmaPrime1
62 (
63  const T& alphad
64 ) const
65 {
66  return n1_*sigma01_*pow
67  (
68  (alphad - alphaGel_)
69  /(alphacp_ - alphad)*(b1_ + alphad - alphaGel_),
70  n1_ + 1
71  )
72  *(b1_*(alphacp_ - alphaGel_)/sqr(alphad - alphaGel_) + 1);
73 }
74 
75 
76 template<class T>
77 inline auto Foam::packingDispersionModels::Usher::sigma2(const T& alphad) const
78 {
79  return sigma02_*pow
80  (
81  (alphad - alphag_)
82  /(alphaMax_ - alphad)*(b2_ + alphad - alphag_),
83  n2_
84  );
85 }
86 
87 
88 template<class T>
89 inline auto Foam::packingDispersionModels::Usher::sigmaPrime2
90 (
91  const T& alphad
92 ) const
93 {
94  return n2_*sigma02_*pow
95  (
96  (alphad - alphag_)
97  /(alphaMax_ - alphad)*(b2_ + alphad - alphag_),
98  n2_ + 1
99  )
100  *(b2_*(alphaMax_ - alphag_)/sqr(alphad - alphag_) + 1);
101 }
102 
103 
104 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
105 
107 (
108  const dictionary& dict,
109  const relativeVelocityModel& relativeVelocity
110 )
111 :
112  packingDispersionModel(relativeVelocity),
113  alphaGel_("alphaGel", dimless, dict),
114  alphap_("alphap", dimless, dict),
115  alphag_("alphap", dimless, dict),
116  alphacp_("alphacp", dimless, dict),
117  alphaMax_("alphaMax", dimless, dict),
118  b1_("b1", dimless, dict),
119  n1_("n1", dimless, dict),
120  sigma01_("sigma01", sqr(dimVelocity), dict),
121  b2_("b2", dimless, dict),
122  n2_
123  (
124  "n2",
125  sigmaPrime1(alphap_)/sigma1(alphap_)
126  *(alphaMax_ - alphap_)*(alphap_ - alphag_)
127  *(b2_ + alphap_ - alphag_)
128  /((b2_*(alphaMax_ - alphag_) + sqr(alphap_ - alphag_)))
129  ),
130  sigma02_
131  (
132  "sigma02",
133  sigma1(alphap_)
134  *pow((alphaMax_ - alphap_)*(b2_ + alphap_ - alphag_), n2_)
135  /pow(alphap_ - alphag_, n2_)
136  )
137 {}
138 
139 
140 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
141 
143 {}
144 
145 
146 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
147 
150 {
151  const volScalarField& alphad = mixture_.alphad();
152 
153  return
154  pos(alphad - alphaGel_)*pos(alphap_ - alphad)*sigmaPrime1(alphad)
155  + pos(alphad - alphap_)*pos(alphaMax_ - alphad)*sigmaPrime2(alphad);
156 }
157 
158 
159 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Packing dispersion model.
Usher packing dispersion model for sewage and mineral slurries, both cetrifugated and filtered.
Definition: Usher.H:99
Usher(const dictionary &dict, const relativeVelocityModel &relativeVelocity)
Construct from components.
Definition: Usher.C:107
virtual tmp< volScalarField > sigmaPrime() const
Return the derivative of the packing stress w.r.t. phase-fraction.
Definition: Usher.C:149
A class for managing temporary objects.
Definition: tmp.H:55
addToRunTimeSelectionTable(packingDispersionModel, DeClercq, dictionary)
Namespace for OpenFOAM.
dimensionedScalar pos(const dimensionedScalar &ds)
const dimensionSet dimless
void T(LagrangianPatchField< Type > &f, const LagrangianPatchField< Type > &f1)
void pow(LagrangianPatchField< typename powProduct< Type, r >::type > &f, const LagrangianPatchField< Type > &f1)
void sqr(LagrangianPatchField< typename outerProduct< Type, Type >::type > &f, const LagrangianPatchField< Type > &f1)
const dimensionSet dimVelocity
dictionary dict