transferModel.H
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) 2017 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 Class
25  Foam::regionModels::surfaceFilmModels::transferModel
26 
27 Description
28  Base class for film transfer models, handling mass transfer between the
29  film and the continuous phase.
30 
31 SourceFiles
32  transferModel.C
33  transferModelNew.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef transferModel_H
38 #define transferModel_H
39 
40 #include "filmSubModelBase.H"
41 #include "runTimeSelectionTables.H"
42 #include "scalarField.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 namespace regionModels
49 {
50 namespace surfaceFilmModels
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class transferModel Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class transferModel
58 :
59  public filmSubModelBase
60 {
61  // Private data
62 
63  //- Transferred mass
64  scalar transferredMass_;
65 
66 
67  // Private Member Functions
68 
69  //- Disallow default bitwise copy construct
71 
72  //- Disallow default bitwise assignment
73  void operator=(const transferModel&);
74 
75 
76 protected:
77 
78  // Protected Member Functions
79 
80  //- Add to transferred mass
81  void addToTransferredMass(const scalar dMass);
82 
83  //- Correct
84  void correct();
85 
86 
87 public:
88 
89  //- Runtime type information
90  TypeName("transferModel");
91 
92 
93  // Declare runtime constructor selection table
94 
96  (
97  autoPtr,
99  dictionary,
100  (
102  const dictionary& dict
103  ),
104  (film, dict)
105  );
106 
107 
108  // Constructors
109 
110  //- Construct for film
112 
113  //- Construct from type name, dictionary and surface film model
115  (
116  const word& modelType,
117  surfaceFilmModel& film,
118  const dictionary& dict
119  );
120 
121 
122  // Selectors
123 
124  //- Return a reference to the selected injection model
126  (
127  surfaceFilmModel& film,
128  const dictionary& dict,
129  const word& modelType
130  );
131 
132 
133  //- Destructor
134  virtual ~transferModel();
135 
136 
137  // Member Functions
138 
139  //- Correct kinematic transfers
140  virtual void correct
141  (
142  scalarField& availableMass,
143  scalarField& massToTransfer
144  ) = 0;
145 
146  //- Correct kinematic and thermodynamic transfers
147  virtual void correct
148  (
149  scalarField& availableMass,
150  scalarField& massToTransfer,
151  scalarField& energyToTransfer
152  );
153 
154  //- Return the total mass transferred
155  virtual scalar transferredMassTotal() const;
156 
157  //- Accumulate the total mass transferred for the patches into the
158  // scalarField provided
159  virtual void patchTransferredMassTotals(scalarField& patchMasses) const
160  {}
161 };
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 } // End namespace surfaceFilmModels
167 } // End namespace regionModels
168 } // End namespace Foam
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #endif
173 
174 // ************************************************************************* //
const surfaceFilmModel & film() const
Return const access to the film surface film model.
static autoPtr< transferModel > New(surfaceFilmModel &film, const dictionary &dict, const word &modelType)
Return a reference to the selected injection model.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Base class for film transfer models, handling mass transfer between the film and the continuous phase...
Definition: transferModel.H:56
TypeName("transferModel")
Runtime type information.
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
virtual scalar transferredMassTotal() const
Return the total mass transferred.
A class for handling words, derived from string.
Definition: word.H:59
void addToTransferredMass(const scalar dMass)
Add to transferred mass.
Definition: transferModel.C:44
virtual void patchTransferredMassTotals(scalarField &patchMasses) const
Accumulate the total mass transferred for the patches into the.
const word & modelType() const
Return const access to the sub-model type.
Definition: subModelBase.C:122
declareRunTimeSelectionTable(autoPtr, transferModel, dictionary,(surfaceFilmModel &film, const dictionary &dict),(film, dict))
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Macros to ease declaration of run-time selection tables.
Namespace for OpenFOAM.