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-------------------------------------------------------------------------------
11License
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
34template<class CloudType>
36(
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
67template<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
83template<class CloudType>
85(
87)
88:
90 suppressionCloud_(cm.suppressionCloud_),
91 suppressedParcelType_(cm.suppressedParcelType_)
92{}
93
94
95// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
96
97template<class CloudType>
99{}
100
101
102// ************************************************************************* //
Y[inertIndex] max(0.0)
virtual void collide()=0
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
Templated stochastic collision model class.
Inter-cloud collision model, whereby the canReact flag can be used to inhibit devolatilisation and su...
virtual ~SuppressionCollision()
Destructor.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Class used to pass data into container.
Virtual abstract base class for templated KinematicCloud.
virtual const tmp< volScalarField > vDotSweep() const =0
Volume swept rate of parcels per cell.
Lookup type of boundary radiation properties.
Definition: lookup.H:66
volScalarField & p
dimensionedScalar exp(const dimensionedScalar &ds)
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:53
dictionary dict