solidParticle.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) 2011-2022 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 "solidParticleCloud.H"
27 
28 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
29 
30 namespace Foam
31 {
33 }
34 
35 
36 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
37 
39 (
41  trackingData& td
42 )
43 {
44  td.keepParticle = true;
45  td.sendToProc = -1;
46 
47  const scalar trackTime = td.mesh.time().deltaTValue();
48 
49  while (td.keepParticle && td.sendToProc == -1 && stepFraction() < 1)
50  {
51  if (debug)
52  {
53  Info<< "Time = " << td.mesh.time().name()
54  << " trackTime = " << trackTime
55  << " stepFraction() = " << stepFraction() << endl;
56  }
57 
58  const scalar sfrac = stepFraction();
59 
60  const scalar f = 1 - stepFraction();
61  trackToAndHitFace(f*trackTime*U_, f, cloud, td);
62 
63  const scalar dt = (stepFraction() - sfrac)*trackTime;
64 
65  const tetIndices tetIs = this->currentTetIndices(td.mesh);
66  scalar rhoc = td.rhoInterp().interpolate(this->coordinates(), tetIs);
67  vector Uc = td.UInterp().interpolate(this->coordinates(), tetIs);
68  scalar nuc = td.nuInterp().interpolate(this->coordinates(), tetIs);
69 
70  scalar rhop = cloud.rhop();
71  scalar magUr = mag(Uc - U_);
72 
73  scalar ReFunc = 1.0;
74  scalar Re = magUr*d_/nuc;
75 
76  if (Re > 0.01)
77  {
78  ReFunc += 0.15*pow(Re, 0.687);
79  }
80 
81  scalar Dc = (24.0*nuc/d_)*ReFunc*(3.0/4.0)*(rhoc/(d_*rhop));
82 
83  U_ = (U_ + dt*(Dc*Uc + (1.0 - rhoc/rhop)*td.g()))/(1.0 + dt*Dc);
84  }
85 
86  return td.keepParticle;
87 }
88 
89 
91 (
93  trackingData& td
94 )
95 {
96  const vector nw = normal(td.mesh);
97 
98  const scalar Un = U_ & nw;
99  const vector Ut = U_ - Un*nw;
100 
101  if (Un > 0)
102  {
103  U_ -= (1.0 + cloud.e())*Un*nw;
104  }
105 
106  U_ -= cloud.mu()*Ut;
107 }
108 
109 
111 {
113  U_ = transform.transform(U_);
114 }
115 
116 
117 // ************************************************************************* //
scalar deltaTValue() const
Return time step value.
Definition: TimeStateI.H:34
A cloud is a collection of lagrangian particles.
Definition: cloud.H:55
friend dimensionSet transform(const dimensionSet &)
Return the argument; transformations do not change the dimensions.
const word & name() const
Return const reference to name.
Type interpolate(const cellPointWeight &cpw) const
Interpolate field for the given cellPointWeight.
const Time & time() const
Return time.
label sendToProc
Processor to send the particle to. -1 indicates that this.
Definition: particle.H:113
bool keepParticle
Flag to indicate whether to keep particle (false = delete)
Definition: particle.H:109
const polyMesh & mesh
Reference to the mesh.
Definition: particle.H:106
const barycentric & coordinates() const
Return current particle coordinates.
Definition: particleI.H:128
scalar trackToAndHitFace(const vector &displacement, const scalar fraction, TrackCloudType &cloud, trackingData &td)
Convenience function. Combines trackToFace and hitFace.
scalar stepFraction() const
Return the fraction of time-step completed.
Definition: particleI.H:164
tetIndices currentTetIndices(const polyMesh &mesh) const
Return the indices of the current tet that the.
Definition: particleI.H:201
virtual void transformProperties(const transformer &)
Transform the physical properties of the particle.
Definition: particle.C:1020
A Cloud of solid particles.
Class used to pass tracking data to the trackToFace function.
Definition: solidParticle.H:91
const interpolationCellPoint< scalar > & rhoInterp() const
const interpolationCellPoint< vector > & UInterp() const
const interpolationCellPoint< scalar > & nuInterp() const
Simple solid spherical particle class with one-way coupling with the continuous phase.
Definition: solidParticle.H:69
void hitWallPatch(solidParticleCloud &cloud, trackingData &td)
Overridable function to handle the particle hitting a wallPatch.
Definition: solidParticle.C:91
virtual void transformProperties(const transformer &)
Transform the physical properties of the particle.
bool move(solidParticleCloud &, trackingData &)
Move.
Definition: solidParticle.C:39
Storage and named access for the indices of a tet which is part of the decomposition of a cell.
Definition: tetIndices.H:82
Vector-tensor class used to perform translations, rotations and scaling operations in 3D space.
Definition: transformer.H:84
Namespace for OpenFOAM.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
messageStream Info
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
dimensionSet transform(const dimensionSet &)
Definition: dimensionSet.C:483
dimensioned< scalar > mag(const dimensioned< Type > &)
defineTypeNameAndDebug(combustionModel, 0)
scalarField Re(const UList< complex > &cf)
Definition: complexFields.C:97
labelList f(nPoints)