distributionGroupFractionFvScalarFieldSource.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) 2024-2026 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::distributionGroupFractionFvScalarFieldSource
26 
27 Description
28  Source condition for group fractions of a population balance model that
29  sets values corresponding to a given distribution.
30 
31 Usage
32  Example of the source condition specification:
33  \verbatim
34  <sourceName>
35  {
36  type distributionGroupFraction;
37  distribution
38  {
39  type RosinRammler;
40  Q 0;
41  min 1 [mm];
42  max 15 [mm];
43  d 14 [mm];
44  n 2 [];
45  }
46  }
47  \endverbatim
48 
49 SourceFiles
50  distributionGroupFractionFvScalarFieldSource.C
51 
52 \*---------------------------------------------------------------------------*/
53 
54 #ifndef distributionGroupFractionFvScalarFieldSource_H
55 #define distributionGroupFractionFvScalarFieldSource_H
56 
57 #include "fvFieldSources.H"
59 #include "distribution.H"
60 
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 
63 namespace Foam
64 {
65 
66 /*---------------------------------------------------------------------------*\
67  Class distributionGroupFractionFvScalarFieldSource Declaration
68 \*---------------------------------------------------------------------------*/
69 
71 :
72  public fvScalarFieldSource,
74 {
75 private:
76 
77  // Private Data
78 
79  //- Distribution
80  const autoPtr<distribution> distribution_;
81 
82  //- Cached allocation coefficient value. Calculated on demand.
83  mutable autoPtr<scalar> etaPtr_;
84 
85 
86  // Private Member Functions
87 
88  //- Return the allocation coefficient value
89  scalar eta(const fvSource& model) const;
90 
91 
92 public:
93 
94  //- Runtime type information
95  TypeName("distributionGroupFraction");
96 
97 
98  // Constructors
99 
100  //- Construct from internal field and dictionary
102  (
104  const dictionary& dict
105  );
106 
107  //- Copy constructor setting internal field reference
109  (
112  );
113 
114  //- Construct and return a clone setting internal field reference
116  (
118  ) const
119  {
121  (
123  (
124  *this,
125  iF
126  )
127  );
128  }
129 
130 
131  //- Destructor
133 
134 
135  // Member Functions
136 
137  //- Return the source value
139  (
140  const fvSource& model,
142  ) const;
143 
144  //- Return the source value
146  (
147  const fvSource& model,
148  const scalarField& source,
149  const labelUList& cells
150  ) const;
151 
152  //- Return the internal coefficient
154  (
155  const fvSource& model,
157  ) const;
158 
159  //- Return the internal coefficient
161  (
162  const fvSource& model,
163  const scalarField& source,
164  const labelUList& cells
165  ) const;
166 
167  //- Write
168  virtual void write(Ostream&) const;
169 };
170 
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 } // End namespace Foam
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 #endif
179 
180 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Source condition for group fractions of a population balance model that sets values corresponding to ...
virtual tmp< DimensionedField< scalar, fvMesh > > sourceValue(const fvSource &model, const DimensionedField< scalar, fvMesh > &source) const
Return the source value.
virtual autoPtr< fvScalarFieldSource > clone(const DimensionedField< scalar, fvMesh > &iF) const
Construct and return a clone setting internal field reference.
virtual tmp< DimensionedField< scalar, fvMesh > > internalCoeff(const fvSource &model, const DimensionedField< scalar, fvMesh > &source) const
Return the internal coefficient.
TypeName("distributionGroupFraction")
Runtime type information.
distributionGroupFractionFvScalarFieldSource(const DimensionedField< scalar, fvMesh > &, const dictionary &dict)
Construct from internal field and dictionary.
Base class for finite volume sources.
Definition: fvSource.H:53
Base class for source conditions of properties of the groups in a population balance model.
A class for managing temporary objects.
Definition: tmp.H:55
const cellShapeList & cells
Namespace for OpenFOAM.
dictionary dict