multiComponentMixture.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::multiComponentMixture
26 
27 Description
28  Foam::multiComponentMixture
29 
30 SourceFiles
31  multiComponentMixture.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef multiComponentMixture_H
36 #define multiComponentMixture_H
37 
38 #include "basicSpecieMixture.H"
39 #include "HashPtrTable.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class multiComponentMixture Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 template<class ThermoType>
52 :
53  public basicSpecieMixture
54 {
55  // Private data
56 
57  //- Species data
58  PtrList<ThermoType> speciesData_;
59 
60  //- Temporary storage for the cell/face mixture thermo data
61  mutable ThermoType mixture_;
62 
63  //- Temporary storage for the volume weighted
64  // cell/face mixture thermo data
65  mutable ThermoType mixtureVol_;
66 
67 
68  // Private Member Functions
69 
70  //- Construct the species data from the given dictionary and return the
71  // data for the first specie to initialise the mixture thermo data
72  const ThermoType& constructSpeciesData(const dictionary& thermoDict);
73 
74  //- Correct the mass fractions to sum to 1
75  void correctMassFractions();
76 
77  //- Construct as copy (not implemented)
79 
80 
81 public:
82 
83  //- The type of thermodynamics this mixture is instantiated for
84  typedef ThermoType thermoType;
85 
86 
87  // Constructors
88 
89  //- Construct from dictionary, specie names, thermo database,
90  // mesh and phase name
92  (
93  const dictionary&,
94  const wordList& specieNames,
95  const HashPtrTable<ThermoType>& thermoData,
96  const fvMesh&,
97  const word&
98  );
99 
100  //- Construct from dictionary, mesh and phase name
101  multiComponentMixture(const dictionary&, const fvMesh&, const word&);
102 
103 
104  //- Destructor
105  virtual ~multiComponentMixture()
106  {}
107 
108 
109  // Member functions
110 
111  const ThermoType& cellMixture(const label celli) const;
112 
113  const ThermoType& patchFaceMixture
114  (
115  const label patchi,
116  const label facei
117  ) const;
118 
119  const ThermoType& cellVolMixture
120  (
121  const scalar p,
122  const scalar T,
123  const label celli
124  ) const;
125 
126  const ThermoType& patchFaceVolMixture
127  (
128  const scalar p,
129  const scalar T,
130  const label patchi,
131  const label facei
132  ) const;
133 
134  //- Return the raw specie thermodynamic data
135  const PtrList<ThermoType>& speciesData() const
136  {
137  return speciesData_;
138  }
139 
140  //- Read dictionary
141  void read(const dictionary&);
142 
143  //- Return thermo based on index
144  inline const ThermoType& getLocalThermo(const label speciei) const
145  {
146  return speciesData_[speciei];
147  }
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace Foam
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #ifdef NoRepository
158  #include "multiComponentMixture.C"
159 #endif
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165 // ************************************************************************* //
const ThermoType & patchFaceMixture(const label patchi, const label facei) const
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
const PtrList< ThermoType > & speciesData() const
Return the raw specie thermodynamic data.
Specialization of basicMultiComponentMixture for a mixture consisting of a number for molecular speci...
virtual ~multiComponentMixture()
Destructor.
const ThermoType & cellVolMixture(const scalar p, const scalar T, const label celli) const
A class for handling words, derived from string.
Definition: word.H:59
const ThermoType & cellMixture(const label celli) const
Foam::multiComponentMixture.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
label patchi
const ThermoType & patchFaceVolMixture(const scalar p, const scalar T, const label patchi, const label facei) const
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
volScalarField & p
const ThermoType & getLocalThermo(const label speciei) const
Return thermo based on index.
void read(const dictionary &)
Read dictionary.
Namespace for OpenFOAM.