PairModel.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) 2011 OpenFOAM Foundation
9  Copyright (C) 2018-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 
29 #include "PairModel.H"
30 
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 
33 template<class CloudType>
35 (
36  const dictionary& dict,
37  CloudType& owner,
38  const word& type
39 )
40 :
41  dict_(dict),
42  owner_(owner),
43  coeffDict_(dict.subDict(type + "Coeffs")),
44  forceRampTime_
45  (
46  this->coeffDict().template getOrDefault<scalar>("forceRampTime", -1)
47  )
48 {}
49 
50 
51 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
52 
53 template<class CloudType>
55 {}
56 
57 
58 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
59 
60 template<class CloudType>
61 const CloudType&
63 {
64  return owner_;
65 }
66 
67 
68 template<class CloudType>
70 {
71  return dict_;
72 }
73 
74 
75 template<class CloudType>
77 {
78  return coeffDict_;
79 }
80 
81 
82 template<class CloudType>
84 (
85  typename CloudType::parcelType& pA,
86  typename CloudType::parcelType& pB
87 ) const
88 {
89  if (forceRampTime_ < 0)
90  {
91  return 1;
92  }
93 
94  return min(min(pA.age(), pB.age())/forceRampTime_, 1);
95 }
96 
97 
98 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
99 
100 #include "PairModelNew.C"
101 
102 // ************************************************************************* //
Foam::PairModel::~PairModel
virtual ~PairModel()
Destructor.
Definition: PairModel.C:54
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::PairModel::PairModel
PairModel(const dictionary &dict, CloudType &owner, const word &type)
Construct from components.
Definition: PairModel.C:35
Foam::min
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:33
Foam::PairModel::owner
const CloudType & owner() const
Return the owner cloud object.
Definition: PairModel.C:62
Foam::PairModel::dict
const dictionary & dict() const
Return the dictionary.
Definition: PairModel.C:69
PairModelNew.C
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::PairModel::coeffDict
const dictionary & coeffDict() const
Return the coefficients dictionary.
Definition: PairModel.C:76
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::roots::type
type
Types of root.
Definition: Roots.H:54
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
Foam::PairModel::forceCoeff
scalar forceCoeff(typename CloudType::parcelType &pA, typename CloudType::parcelType &pB) const
Return the force coefficient based on the forceRampTime_.
Definition: PairModel.C:84
PairModel.H