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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::regionModels::surfaceFilmModels::transferModel
28 
29 Description
30  Base class for film transfer models, handling mass transfer between the
31  film and the continuous phase.
32 
33 SourceFiles
34  transferModel.C
35  transferModelNew.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef transferModel_H
40 #define transferModel_H
41 
42 #include "filmSubModelBase.H"
43 #include "runTimeSelectionTables.H"
44 #include "scalarField.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 namespace regionModels
51 {
52 namespace surfaceFilmModels
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class transferModel Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class transferModel
60 :
61  public filmSubModelBase
62 {
63  // Private data
64 
65  //- Transferred mass
66  scalar transferredMass_;
67 
68 
69  // Private Member Functions
70 
71  //- No copy construct
72  transferModel(const transferModel&) = delete;
73 
74  //- No copy assignment
75  void operator=(const transferModel&) = delete;
76 
77 
78 protected:
79 
80  // Protected Member Functions
81 
82  //- Add to transferred mass
83  void addToTransferredMass(const scalar dMass);
84 
85  //- Correct
86  void correct();
87 
88 
89 public:
90 
91  //- Runtime type information
92  TypeName("transferModel");
93 
94 
95  // Declare runtime constructor selection table
96 
98  (
99  autoPtr,
101  dictionary,
102  (
104  const dictionary& dict
105  ),
106  (film, dict)
107  );
108 
109 
110  // Constructors
111 
112  //- Construct for film
114 
115  //- Construct from type name, dictionary and surface film model
117  (
118  const word& modelType,
120  const dictionary& dict
121  );
122 
123 
124  // Selectors
125 
126  //- Return a reference to the selected injection model
128  (
130  const dictionary& dict,
131  const word& modelType
132  );
133 
134 
135  //- Destructor
136  virtual ~transferModel();
137 
138 
139  // Member Functions
140 
141  //- Correct kinematic transfers
142  virtual void correct
143  (
144  scalarField& availableMass,
145  scalarField& massToTransfer
146  ) = 0;
147 
148  //- Correct kinematic and thermodynamic transfers
149  virtual void correct
150  (
151  scalarField& availableMass,
152  scalarField& massToTransfer,
153  scalarField& energyToTransfer
154  );
155 
156  //- Return the total mass transferred
157  virtual scalar transferredMassTotal() const;
158 
159  //- Accumulate the total mass transferred for the patches into the
160  // scalarField provided
161  virtual void patchTransferredMassTotals(scalarField& patchMasses) const
162  {}
163 };
164 
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 } // End namespace surfaceFilmModels
169 } // End namespace regionModels
170 } // End namespace Foam
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 #endif
175 
176 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
scalarField.H
Foam::regionModels::surfaceFilmModels::filmSubModelBase::film
const surfaceFilmRegionModel & film() const
Return const access to the film surface film model.
Definition: filmSubModelBaseI.H:39
Foam::regionModels::surfaceFilmModels::transferModel::correct
void correct()
Correct.
Definition: transferModel.C:81
Foam::regionModels::surfaceFilmModels::transferModel::transferredMassTotal
virtual scalar transferredMassTotal() const
Return the total mass transferred.
Definition: transferModel.C:105
Foam::Field< scalar >
Foam::regionModels::surfaceFilmModels::surfaceFilmRegionModel
Base class for surface film models.
Definition: surfaceFilmRegionModel.H:55
Foam::subModelBase::dict
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:113
Foam::regionModels::surfaceFilmModels::transferModel::patchTransferredMassTotals
virtual void patchTransferredMassTotals(scalarField &patchMasses) const
Accumulate the total mass transferred for the patches into the.
Definition: transferModel.H:160
Foam::regionModels::surfaceFilmModels::transferModel::TypeName
TypeName("transferModel")
Runtime type information.
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::regionModels::surfaceFilmModels::transferModel::addToTransferredMass
void addToTransferredMass(const scalar dMass)
Add to transferred mass.
Definition: transferModel.C:46
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::subModelBase::modelType
const word & modelType() const
Return const access to the sub-model type.
Definition: subModelBase.C:125
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::regionModels::surfaceFilmModels::transferModel
Base class for film transfer models, handling mass transfer between the film and the continuous phase...
Definition: transferModel.H:58
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::regionModels::surfaceFilmModels::transferModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, transferModel, dictionary,(surfaceFilmRegionModel &film, const dictionary &dict),(film, dict))
Foam::regionModels::surfaceFilmModels::transferModel::New
static autoPtr< transferModel > New(surfaceFilmRegionModel &film, const dictionary &dict, const word &modelType)
Return a reference to the selected injection model.
Definition: transferModelNew.C:43
Foam::regionModels::surfaceFilmModels::transferModel::~transferModel
virtual ~transferModel()
Destructor.
Definition: transferModel.C:75
Foam::regionModels::surfaceFilmModels::filmSubModelBase
Base class for surface film sub-models.
Definition: filmSubModelBase.H:56