SuppressionCollision.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2013 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 "SuppressionCollision.H"
27 #include "kinematicCloud.H"
28 
29 // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
30 
31 template<class CloudType>
33 {
34  const kinematicCloud& sc =
35  this->owner().mesh().template
36  lookupObject<kinematicCloud>(suppressionCloud_);
37 
38  volScalarField vDotSweep(sc.vDotSweep());
39 
40  dimensionedScalar Dt("dt", dimTime, dt);
41  volScalarField P(type() + ":p", 1.0 - exp(-vDotSweep*Dt));
42 
43  forAllIter(typename CloudType, this->owner(), iter)
44  {
45  typename CloudType::parcelType& p = iter();
46  label cellI = p.cell();
47 
48  scalar xx = this->owner().rndGen().template sample01<scalar>();
49 
50  if (xx < P[cellI])
51  {
52  p.canCombust() = -1;
53  p.typeId() = max(p.typeId(), suppressedParcelType_);
54  }
55  }
56 }
57 
58 
59 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
60 
61 template<class CloudType>
63 (
64  const dictionary& dict,
65  CloudType& owner
66 )
67 :
68  StochasticCollisionModel<CloudType>(dict, owner, typeName),
69  suppressionCloud_(this->coeffDict().lookup("suppressionCloud")),
70  suppressedParcelType_
71  (
72  this->coeffDict().lookupOrDefault("suppressedParcelType", -1)
73  )
74 {}
75 
76 
77 template<class CloudType>
79 (
81 )
82 :
84  suppressionCloud_(cm.suppressionCloud_),
85  suppressedParcelType_(cm.suppressedParcelType_)
86 {}
87 
88 
89 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
90 
91 template<class CloudType>
93 {}
94 
95 
96 // ************************************************************************* //
Foam::SuppressionCollision::suppressionCloud_
const word suppressionCloud_
Name of cloud used for suppression.
Definition: SuppressionCollision.H:55
p
p
Definition: pEqn.H:62
forAllIter
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
Definition: UList.H:431
kinematicCloud.H
Foam::SuppressionCollision
Inter-cloud collision model, whereby the canReact flag can be used to inhibit devolatilisation and su...
Definition: SuppressionCollision.H:46
Foam::exp
dimensionedScalar exp(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:252
Foam::DSMCCloud::rndGen
Random & rndGen()
Return refernce to the random object.
Definition: DSMCCloudI.H:121
Foam::dimTime
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
Foam::kinematicCloud
Virtual abstract base class for templated KinematicCloud.
Definition: kinematicCloud.H:49
Foam::StochasticCollisionModel< CloudType >
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::SuppressionCollision::SuppressionCollision
SuppressionCollision(const dictionary &dict, CloudType &owner)
Construct from dictionary.
Definition: SuppressionCollision.C:63
Foam::SuppressionCollision::suppressedParcelType_
const label suppressedParcelType_
Suppressed parcel type - optional.
Definition: SuppressionCollision.H:58
Foam::DSMCCloud::mesh
const fvMesh & mesh() const
Return refernce to the mesh.
Definition: DSMCCloudI.H:41
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:68
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:41
Foam::kinematicCloud::vDotSweep
virtual const tmp< volScalarField > vDotSweep() const =0
Volume swept rate of parcels per cell.
Foam::max
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
Foam::SuppressionCollision::~SuppressionCollision
virtual ~SuppressionCollision()
Destructor.
Definition: SuppressionCollision.C:92
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:217
Foam::type
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:588
Foam::SuppressionCollision::collide
virtual void collide(const scalar dt)
Update the model.
Definition: SuppressionCollision.C:32
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
SuppressionCollision.H
lookup
stressControl lookup("compactNormalStress") >> compactNormalStress