zeroDimensionalMassSourceBase.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2021-2025 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::fv::zeroDimensionalMassSourceBase
26 
27 Description
28  Base class for zero-dimensional mass source models
29 
30 SourceFiles
31  zeroDimensionalMassSource.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef zeroDimensionalMassSourceBase_H
36 #define zeroDimensionalMassSourceBase_H
37 
38 #include "massSourceBase.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 namespace fv
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class zeroDimensionalMassSourceBase Declaration
49 \*---------------------------------------------------------------------------*/
50 
52 :
53  public massSourceBase
54 {
55 private:
56 
57  // Private Data
58 
59  //- Reference to the zero-dimensional mass
60  volScalarField& m0D_;
61 
62 
63  // Private Member Functions
64 
65  //- Calculate and return the zero-dimensional mass
66  tmp<volScalarField> calcM0D() const;
67 
68  //- Initialise and return a reference to the zero-dimensional mass
69  volScalarField& initM0D() const;
70 
71  //- Get a reference to the mass
72  const volScalarField& m() const;
73 
74  //- Return the mass flow rate
75  virtual scalar massFlowRate() const = 0;
76 
77 
78 public:
79 
80  //- Runtime type information
81  TypeName("zeroDimensionalMassSourceBase");
82 
83 
84  // Constructors
85 
86  //- Construct from explicit source name and mesh
88  (
89  const word& name,
90  const word& modelType,
91  const fvMesh& mesh,
92  const dictionary& dict
93  );
94 
95 
96  // Member Functions
97 
98  // Access
99 
100  //- Return the cellZone that the source applies to
101  virtual const cellZone& zone() const;
102 
103  //- Return the volume of cells that the source applies to
104  virtual scalar V() const;
105 
106 
107  // Sources
108 
109  //- Return the source value
110  virtual dimensionedScalar S() const;
111 
112 
113  // Mesh changes
114 
115  //- Update for mesh motion
116  virtual bool movePoints();
117 
118  //- Update topology using the given map
119  virtual void topoChange(const polyTopoChangeMap&);
120 
121  //- Update from another mesh using the given map
122  virtual void mapMesh(const polyMeshMap&);
123 
124  //- Redistribute or update using the given distribution map
125  virtual void distribute(const polyDistributionMap&);
126 
127 
128  //- Update the model
129  virtual void correct();
130 };
131 
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 } // End namespace fv
136 } // End namespace Foam
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 #endif
141 
142 // ************************************************************************* //
Generic GeometricField class.
Named list of cell indices representing a sub-set of the mesh.
Definition: cellZone.H:61
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:96
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:69
const word & name() const
Return const access to the source name.
Definition: fvModelI.H:57
Base class for mass source models.
Base class for zero-dimensional mass source models.
virtual bool movePoints()
Update for mesh motion.
virtual const cellZone & zone() const
Return the cellZone that the source applies to.
virtual scalar V() const
Return the volume of cells that the source applies to.
zeroDimensionalMassSourceBase(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
TypeName("zeroDimensionalMassSourceBase")
Runtime type information.
virtual dimensionedScalar S() const
Return the source value.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
labelList fv(nPoints)
dictionary dict