solidMixtureProperties.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) 2011-2016 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  defaultCoeffs yes; // employ default coefficients
37  }
38  ash
39  {
40  defaultCoeffs no;
41  ashCoeffs
42  {
43  ... user defined properties for ash
44  }
45  }
46  }
47  \endverbatim
48 
49 
50 SourceFiles
51  solidMixtureProperties.C
52 
53 See also
54  Foam::solidProperties
55 
56 \*---------------------------------------------------------------------------*/
57 
58 #ifndef solidMixtureProperties_H
59 #define solidMixtureProperties_H
60 
61 #include "scalarField.H"
62 #include "PtrList.H"
63 #include "solidProperties.H"
64 #include "autoPtr.H"
65 
66 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67 
68 namespace Foam
69 {
70 
71 /*---------------------------------------------------------------------------*\
72  Class solidMixtureProperties Declaration
73 \*---------------------------------------------------------------------------*/
74 
76 {
77  // Private data
78 
79  //- The names of the solids
80  List<word> components_;
81 
82  //- The solidProperties properties
83  PtrList<solidProperties> properties_;
84 
85 
86 public:
87 
88  // Constructors
89 
90  //- Construct from dictionary
92 
93  //- Construct copy
95 
96  //- Construct and return a clone
98  {
100  (
101  new solidMixtureProperties(*this)
102  );
103  }
104 
105 
106  //- Destructor
107  virtual ~solidMixtureProperties()
108  {}
109 
110 
111  // Selectors
112 
113  //- Select construct from dictionary
115 
116 
117  // Member Functions
118 
119  //- Return the solidProperties names
120  inline const List<word>& components() const
121  {
122  return components_;
123  }
124 
125  //- Return the solidProperties properties
126  inline const PtrList<solidProperties>& properties() const
127  {
128  return properties_;
129  }
130 
131  //- Return the number of solids in the mixture
132  inline label size() const
133  {
134  return components_.size();
135  }
136 
137 
138  //- Returns the mass fractions, given mole fractions
139  scalarField Y(const scalarField& X) const;
140 
141  //- Returns the mole fractions, given mass fractions
142  scalarField X(const scalarField& Y) const;
143 
144  //- Calculate the mixture density [kg/m^3] as a function of
145  // volume fractions
146  scalar rho(const scalarField& X) const;
147 
148  //- Calculate the mixture heat capacity [J/(kg K)] as a function
149  // of mass fractions
150  scalar Cp(const scalarField& Y) const;
151 };
152 
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 } // End namespace Foam
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 #endif
161 
162 // ************************************************************************* //
scalarField Y(const scalarField &X) const
Returns the mass fractions, given mole fractions.
label size() const
Return the number of solids in the mixture.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
void size(const label)
Override size to be inconsistent with allocated storage.
Definition: ListI.H:76
scalarField X(const scalarField &Y) const
Returns the mole fractions, given mass fractions.
const PtrList< solidProperties > & properties() const
Return the solidProperties properties.
const List< word > & components() const
Return the solidProperties names.
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:62
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
virtual ~solidMixtureProperties()
Destructor.
solidMixtureProperties(const dictionary &)
Construct from dictionary.
static autoPtr< solidMixtureProperties > New(const dictionary &)
Select construct from dictionary.
scalar Cp(const scalarField &Y) const
Calculate the mixture heat capacity [J/(kg K)] as a function.
scalar rho(const scalarField &X) const
Calculate the mixture density [kg/m^3] as a function of.
Namespace for OpenFOAM.