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-2022 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
29#include "PairModel.H"
30
31// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32
33template<class CloudType>
35(
36 CloudType& owner
37)
38:
39 dict_(dictionary::null),
40 owner_(owner),
41 coeffDict_(dictionary::null),
42 forceRampTime_(-1)
43{}
44
45
46template<class CloudType>
48(
49 const dictionary& dict,
50 CloudType& owner,
51 const word& type
52)
53:
54 dict_(dict),
55 owner_(owner),
56 coeffDict_(dict.subDict(type + "Coeffs")),
57 forceRampTime_
58 (
59 this->coeffDict().template getOrDefault<scalar>("forceRampTime", -1)
60 )
61{}
62
63
64// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
65
66template<class CloudType>
68{}
69
70
71// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
72
73template<class CloudType>
74const CloudType&
76{
77 return owner_;
78}
79
80
81template<class CloudType>
83{
84 return dict_;
85}
86
87
88template<class CloudType>
90{
91 return coeffDict_;
92}
93
94
95template<class CloudType>
97(
98 typename CloudType::parcelType& pA,
99 typename CloudType::parcelType& pB
100) const
101{
102 if (forceRampTime_ < 0)
103 {
104 return 1;
105 }
107 return min(min(pA.age(), pB.age())/forceRampTime_, 1);
108}
110
111// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112
113#include "PairModelNew.C"
114
115// ************************************************************************* //
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 pair interaction class.
Definition: PairModel.H:56
virtual ~PairModel()
Destructor.
Definition: PairModel.C:67
const dictionary & coeffDict() const
Return the coefficients dictionary.
Definition: PairModel.C:89
const dictionary & dict() const
Return the dictionary.
Definition: PairModel.C:82
const CloudType & owner() const
Return the owner cloud object.
Definition: PairModel.C:75
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
volVectorField & forceCoeff()
Return access to the force coefficients field.
Definition: forceCoeffs.C:64
A class for handling words, derived from Foam::string.
Definition: word.H:68
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:598
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:33
dictionary dict