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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-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::solidMixtureProperties
28 
29 Description
30  A mixture of solids
31 
32  An example of a two component solid mixture:
33  \verbatim
34  <parentDictionary>
35  {
36  C;
37 
38  ash
39  {
40  //... user defined properties for ash
41  }
42  }
43  \endverbatim
44 
45 
46 SourceFiles
47  solidMixtureProperties.C
48 
49 See also
50  Foam::solidProperties
51 
52 \*---------------------------------------------------------------------------*/
53 
54 #ifndef solidMixtureProperties_H
55 #define solidMixtureProperties_H
56 
57 #include "solidProperties.H"
58 #include "PtrList.H"
59 #include "scalarField.H"
60 
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 
63 namespace Foam
64 {
65 
66 /*---------------------------------------------------------------------------*\
67  Class solidMixtureProperties Declaration
68 \*---------------------------------------------------------------------------*/
69 
71 {
72  // Private data
73 
74  //- The names of the solids
75  List<word> components_;
76 
77  //- The solidProperties properties
78  PtrList<solidProperties> properties_;
79 
80 
81 public:
82 
83  // Constructors
84 
85  //- Construct from dictionary
87 
88  //- Construct copy
90 
91  //- Construct and return a clone
93  {
95  }
96 
97 
98  //- Destructor
99  virtual ~solidMixtureProperties() = default;
100 
101 
102  // Selectors
103 
104  //- Select construct from dictionary
106 
107 
108  // Member Functions
109 
110  //- Return the solidProperties names
111  inline const List<word>& components() const
112  {
113  return components_;
114  }
115 
116  //- Return the solidProperties properties
117  inline const PtrList<solidProperties>& properties() const
118  {
119  return properties_;
120  }
121 
122  //- Return the number of solids in the mixture
123  inline label size() const
124  {
125  return components_.size();
126  }
127 
128  //- Calculate the mixture density [kg/m^3] as a function of
129  // mass fractions
130  scalar rho(const scalarField& Y) const;
131 
132  //- Calculate the mixture heat capacity [J/(kg K)] as a function of
133  // mass fractions
134  scalar Cp(const scalarField& Y) const;
135 };
136 
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 } // End namespace Foam
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 #endif
145 
146 // ************************************************************************* //
Foam::autoPtr::New
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
Foam::solidMixtureProperties::clone
virtual autoPtr< solidMixtureProperties > clone() const
Construct and return a clone.
Definition: solidMixtureProperties.H:91
scalarField.H
Foam::solidMixtureProperties::solidMixtureProperties
solidMixtureProperties(const dictionary &)
Construct from dictionary.
Definition: solidMixtureProperties.C:32
Foam::solidMixtureProperties
A mixture of solids.
Definition: solidMixtureProperties.H:69
Foam::solidMixtureProperties::rho
scalar rho(const scalarField &Y) const
Calculate the mixture density [kg/m^3] as a function of.
Definition: solidMixtureProperties.C:90
Foam::solidMixtureProperties::Cp
scalar Cp(const scalarField &Y) const
Calculate the mixture heat capacity [J/(kg K)] as a function of.
Definition: solidMixtureProperties.C:103
Foam::solidMixtureProperties::components
const List< word > & components() const
Return the solidProperties names.
Definition: solidMixtureProperties.H:110
Foam::Field< scalar >
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::solidMixtureProperties::properties
const PtrList< solidProperties > & properties() const
Return the solidProperties properties.
Definition: solidMixtureProperties.H:116
Y
PtrList< volScalarField > & Y
Definition: createFieldRefs.H:7
Foam::solidMixtureProperties::New
static autoPtr< solidMixtureProperties > New(const dictionary &)
Select construct from dictionary.
Definition: solidMixtureProperties.C:80
Foam::solidMixtureProperties::size
label size() const
Return the number of solids in the mixture.
Definition: solidMixtureProperties.H:122
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::List< word >
PtrList.H
solidProperties.H
Foam::solidMixtureProperties::~solidMixtureProperties
virtual ~solidMixtureProperties()=default
Destructor.