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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2013-2017 OpenFOAM Foundation
9  Copyright (C) 2019-2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
30 #include "kinematicCloud.H"
31 
32 // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
33 
34 template<class CloudType>
36 (
37  typename CloudType::parcelType::trackingData& td,
38  const scalar dt
39 )
40 {
41  const kinematicCloud& sc =
42  this->owner().mesh().template
43  lookupObject<kinematicCloud>(suppressionCloud_);
44 
45  volScalarField vDotSweep(sc.vDotSweep());
46 
47  dimensionedScalar Dt("dt", dimTime, dt);
48  volScalarField P(type() + ":p", 1.0 - exp(-vDotSweep*Dt));
49 
50  for (typename CloudType::parcelType& p : this->owner())
51  {
52  const label celli = p.cell();
53 
54  scalar xx = this->owner().rndGen().template sample01<scalar>();
55 
56  if (xx < P[celli])
57  {
58  p.canCombust() = -1;
59  p.typeId() = max(p.typeId(), suppressedParcelType_);
60  }
61  }
62 }
63 
64 
65 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
66 
67 template<class CloudType>
69 (
70  const dictionary& dict,
71  CloudType& owner
72 )
73 :
74  StochasticCollisionModel<CloudType>(dict, owner, typeName),
75  suppressionCloud_(this->coeffDict().lookup("suppressionCloud")),
76  suppressedParcelType_
77  (
78  this->coeffDict().getOrDefault("suppressedParcelType", -1)
79  )
80 {}
81 
82 
83 template<class CloudType>
85 (
87 )
88 :
90  suppressionCloud_(cm.suppressionCloud_),
91  suppressedParcelType_(cm.suppressedParcelType_)
92 {}
93 
94 
95 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
96 
97 template<class CloudType>
99 {}
100 
101 
102 // ************************************************************************* //
Foam::SuppressionCollision::suppressionCloud_
const word suppressionCloud_
Definition: SuppressionCollision.H:54
p
volScalarField & p
Definition: createFieldRefs.H:8
kinematicCloud.H
Foam::SuppressionCollision
Inter-cloud collision model, whereby the canReact flag can be used to inhibit devolatilisation and su...
Definition: SuppressionCollision.H:45
Foam::exp
dimensionedScalar exp(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:254
Foam::DSMCCloud::rndGen
Random & rndGen()
Definition: DSMCCloudI.H:117
Foam::dimTime
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
Foam::SuppressionCollision::collide
virtual void collide(typename CloudType::parcelType::trackingData &td, const scalar dt)
Definition: SuppressionCollision.C:29
Foam::kinematicCloud
Virtual abstract base class for templated KinematicCloud.
Definition: kinematicCloud.H:48
Foam::StochasticCollisionModel< CloudType >
Foam::SuppressionCollision::SuppressionCollision
SuppressionCollision(const dictionary &dict, CloudType &owner)
Definition: SuppressionCollision.C:62
Foam::SuppressionCollision::suppressedParcelType_
const label suppressedParcelType_
Definition: SuppressionCollision.H:57
Foam::DSMCCloud::mesh
const fvMesh & mesh() const
Definition: DSMCCloudI.H:37
Foam::max
label max(const labelHashSet &set, label maxValue=labelMin)
Definition: hashSets.C:40
Foam::radiation::lookup
Lookup type of boundary radiation properties.
Definition: lookup.H:57
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:67
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:119
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:36
Foam::kinematicCloud::vDotSweep
virtual const tmp< volScalarField > vDotSweep() const =0
Foam::SuppressionCollision::~SuppressionCollision
virtual ~SuppressionCollision()
Definition: SuppressionCollision.C:91
Foam::roots::type
type
Definition: Roots.H:52
Foam::DSMCCloud::parcelType
ParcelType parcelType
Definition: DSMCCloud.H:216
Foam::GeometricField
Generic GeometricField class.
Definition: areaFieldsFwd.H:49
SuppressionCollision.H