CoulombForce.H
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) 2023 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::CoulombForce
28 
29 Group
30  grpLagrangianIntermediateForceSubModels
31 
32 Description
33  Particle electric force model involving the Coulomb force calculation.
34 
35  \f[
36  \vec{F}_\mathrm{E} = q \, \vec{E}
37  \f]
38 
39  where
40 
41  \vartable
42  \vec{F}_\mathrm{E} | Coulomb force [kg m s^{-2}]
43  q | Electric charge of particle [A s]
44  \vec{E} | Electric field [kg m^2 A^{-1} s^{-3} m^{-1}]
45  \endvartable
46 
47  References:
48  \verbatim
49  Governing equations (tag:YSSD):
50  Ye, Q., Steigleder, T., Scheibe, A., & Domnick, J. (2002).
51  Numerical simulation of the electrostatic powder coating process
52  with a corona spray gun. Journal of Electrostatics, 54(2), 189-205.
53  DOI:10.1016/S0304-3886(01)00181-4
54  \endverbatim
55 
56 Usage
57  Minimal example by using \c constant/cloudProperties:
58  \verbatim
59  subModels
60  {
61  solution
62  {
63  interpolationSchemes
64  {
65  <Ename> <interpolationScheme>;
66  }
67  }
68 
69  particleForces
70  {
71  Coulomb
72  {
73  q <Function1<scalar>>;
74  E <word>;
75  }
76  }
77  }
78  \endverbatim
79 
80  where the entries mean:
81  \table
82  Property | Description | Type | Reqd | Deflt
83  type | Type name: Coulomb | word | yes | -
84  q | Electric charge of particles | <Function1<scalar> | yes | -
85  E | Name of electric field | word | no | E
86  \endtable
87 
88 Note
89  - Particle electric charge can be input as a function of particle diameter:
90  \verbatim
91  particleForces
92  {
93  Coulomb
94  {
95  q table
96  (
97  // d [m] q [C = A s]
98  (1e-06 -5.0e-11)
99  (1e-05 -1.0e-10)
100  );
101  E electricPotential:E;
102  }
103  }
104  \endverbatim
105 
106 SourceFiles
107  CoulombForce.C
108 
109 \*---------------------------------------------------------------------------*/
110 
111 #ifndef Foam_CoulombForce_H
112 #define Foam_CoulombForce_H
113 
114 #include "ParticleForce.H"
115 #include "Function1.H"
116 #include "interpolation.H"
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 namespace Foam
121 {
122 
123 // Forward Declarations
124 class fvMesh;
125 
126 /*---------------------------------------------------------------------------*\
127  Class CoulombForce Declaration
128 \*---------------------------------------------------------------------------*/
129 
130 template<class CloudType>
131 class CoulombForce
132 :
133  public ParticleForce<CloudType>
134 {
135  // Private Data
136 
137  //- Particle electric charge
138  autoPtr<Function1<scalar>> qPtr_;
139 
140  //- Name of electric field
141  const word Ename_;
142 
143  //- Electric-field interpolator
144  mutable std::unique_ptr<interpolation<vector>> EInterpPtr_;
145 
146 
147  // Private Member Functions
148 
149  //- Return requested volVectorField from the object registry
150  //- or read+register the field to the object registry
151  volVectorField& getOrReadField(const word& fieldName) const;
152 
153 
154 public:
155 
156  //- Runtime type information
157  TypeName("Coulomb");
158 
159 
160  // Constructors
161 
162  //- Construct from mesh
164  (
165  CloudType& owner,
166  const fvMesh& mesh,
167  const dictionary& dict
168  );
169 
170  //- Copy construct
171  CoulombForce(const CoulombForce& gf);
172 
173  //- No copy assignment
174  void operator=(const CoulombForce<CloudType>&) = delete;
175 
176  //- Construct and return a clone
177  virtual autoPtr<ParticleForce<CloudType>> clone() const
178  {
180  (
181  new CoulombForce<CloudType>(*this)
182  );
183  }
184 
185 
186  //- Destructor
187  virtual ~CoulombForce() = default;
188 
189 
190  // Member Functions
191 
192  // Evaluation
193 
194  //- Cache fields
195  virtual void cacheFields(const bool store);
196 
197  //- Calculate the non-coupled force
198  virtual forceSuSp calcNonCoupled
199  (
200  const typename CloudType::parcelType& p,
201  const typename CloudType::parcelType::trackingData& td,
202  const scalar dt,
203  const scalar mass,
204  const scalar Re,
205  const scalar muc
206  ) const;
207 };
208 
209 
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 
212 } // End namespace Foam
213 
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 
216 #ifdef NoRepository
217  #include "CoulombForce.C"
218 #endif
219 
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 
222 #endif
223 
224 // ************************************************************************* //
dictionary dict
void operator=(const CoulombForce< CloudType > &)=delete
No copy assignment.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual autoPtr< ParticleForce< CloudType > > clone() const
Construct and return a clone.
Definition: CoulombForce.H:226
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:82
Helper container for force Su and Sp terms.
Definition: forceSuSp.H:60
const fvMesh & mesh() const noexcept
Return the mesh database.
TypeName("Coulomb")
Runtime type information.
virtual void cacheFields(const bool store)
Cache fields.
Definition: CoulombForce.C:91
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:290
virtual forceSuSp calcNonCoupled(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.
Definition: CoulombForce.C:115
virtual ~CoulombForce()=default
Destructor.
scalarField Re(const UList< complex > &cmplx)
Extract real component.
Definition: complexField.C:207
const CloudType & owner() const noexcept
Return const access to the cloud owner.
Particle electric force model involving the Coulomb force calculation.
Definition: CoulombForce.H:162
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
CoulombForce(CloudType &owner, const fvMesh &mesh, const dictionary &dict)
Construct from mesh.
Definition: CoulombForce.C:59
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
volScalarField & p
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:67
Namespace for OpenFOAM.