solidMixtureProperties.C
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-------------------------------------------------------------------------------
10License
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\*---------------------------------------------------------------------------*/
27
29
30// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31
33:
34 components_(),
35 properties_()
36{
37 components_ = dict.toc();
38 properties_.setSize(components_.size());
39
40 forAll(components_, i)
41 {
42 if (dict.isDict(components_[i]))
43 {
44 properties_.set
45 (
46 i,
47 solidProperties::New(dict.subDict(components_[i]))
48 );
49 }
50 else
51 {
52 properties_.set
53 (
54 i,
55 solidProperties::New(components_[i])
56 );
57 }
58 }
59}
60
61
63(
65)
66:
67 components_(s.components_),
68 properties_(s.properties_.size())
69{
70 forAll(properties_, i)
71 {
72 properties_.set(i, s.properties_(i)->clone());
73 }
74}
75
76
77// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
78
80(
82)
83{
85}
86
87
88// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
89
91{
92 scalar rrho = 0;
93
94 forAll(properties_, i)
95 {
96 rrho += Y[i]/properties_[i].rho();
97 }
98
99 return 1/rrho;
100}
101
102
104{
105 scalar Cp = 0;
106
107 forAll(properties_, i)
108 {
109 Cp += Y[i]*properties_[i].Cp();
110 }
111
112 return Cp;
113}
114
115
116// ************************************************************************* //
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:114
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
Definition: dictionary.C:460
bool isDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Check if entry is found and is a sub-dictionary.
Definition: dictionaryI.H:147
wordList toc() const
Return the table of contents.
Definition: dictionary.C:602
Base-class for thermophysical properties of solids, liquids and gases providing an interface compatib...
PtrList< volScalarField > & Y
const volScalarField & Cp
Definition: EEqn.H:7
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
dictionary dict
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333