solidMixtureProperties.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) 2011-2020 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::solidMixtureProperties
26 
27 Description
28  A mixture of solids
29 
30  An example of a two component solid mixture:
31  \verbatim
32  <parentDictionary>
33  {
34  C;
35 
36  ash
37  {
38  //... user defined properties for ash
39  }
40  }
41  \endverbatim
42 
43 
44 SourceFiles
45  solidMixtureProperties.C
46 
47 See also
48  Foam::solidProperties
49 
50 \*---------------------------------------------------------------------------*/
51 
52 #ifndef solidMixtureProperties_H
53 #define solidMixtureProperties_H
54 
55 #include "solidProperties.H"
56 #include "PtrList.H"
57 #include "scalarField.H"
58 
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61 namespace Foam
62 {
63 
64 /*---------------------------------------------------------------------------*\
65  Class solidMixtureProperties Declaration
66 \*---------------------------------------------------------------------------*/
67 
69 {
70  // Private Data
71 
72  //- The names of the solids
73  List<word> components_;
74 
75  //- The solidProperties properties
76  PtrList<solidProperties> properties_;
77 
78 
79 public:
80 
81  // Constructors
82 
83  //- Construct from dictionary
85 
86  //- Construct copy
88 
89  //- Construct and return a clone
91  {
93  (
94  new solidMixtureProperties(*this)
95  );
96  }
97 
98 
99  //- Destructor
100  virtual ~solidMixtureProperties()
101  {}
102 
103 
104  // Selectors
105 
106  //- Select construct from dictionary
108 
109 
110  // Member Functions
111 
112  //- Return the solidProperties names
113  inline const List<word>& components() const
114  {
115  return components_;
116  }
117 
118  //- Return the solidProperties properties
119  inline const PtrList<solidProperties>& properties() const
120  {
121  return properties_;
122  }
123 
124  //- Return the number of solids in the mixture
125  inline label size() const
126  {
127  return components_.size();
128  }
129 
130  //- Calculate the mixture density [kg/m^3] as a function of
131  // mass fractions
132  scalar rho(const scalarField& Y) const;
133 
134  //- Calculate the mixture heat capacity [J/kg/K] as a function of
135  // mass fractions
136  scalar Cp(const scalarField& Y) const;
137 };
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 } // End namespace Foam
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 #endif
147 
148 // ************************************************************************* //
scalar rho(const scalarField &Y) const
Calculate the mixture density [kg/m^3] as a function of.
const List< word > & components() const
Return the solidProperties names.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
const PtrList< solidProperties > & properties() const
Return the solidProperties properties.
void size(const label)
Override size to be inconsistent with allocated storage.
Definition: ListI.H:164
scalar Cp(const scalarField &Y) const
Calculate the mixture heat capacity [J/kg/K] as a function of.
virtual autoPtr< solidMixtureProperties > clone() const
Construct and return a clone.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:70
PtrList< volScalarField > & Y
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
virtual ~solidMixtureProperties()
Destructor.
solidMixtureProperties(const dictionary &)
Construct from dictionary.
static autoPtr< solidMixtureProperties > New(const dictionary &)
Select construct from dictionary.
label size() const
Return the number of solids in the mixture.
Namespace for OpenFOAM.