All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
solidProperties.C
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-2019 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 \*---------------------------------------------------------------------------*/
25 
26 #include "solidProperties.H"
27 
28 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
29 
30 namespace Foam
31 {
32  defineTypeNameAndDebug(solidProperties, 0);
33  defineRunTimeSelectionTable(solidProperties,);
34  defineRunTimeSelectionTable(solidProperties, dictionary);
35 }
36 
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38 
40 (
41  scalar rho,
42  scalar Cp,
43  scalar kappa,
44  scalar Hf,
45  scalar emissivity
46 )
47 :
48  rho_(rho),
49  Cp_(Cp),
50  kappa_(kappa),
51  Hf_(Hf),
52  emissivity_(emissivity)
53 {}
54 
55 
57 :
58  rho_(dict.lookup<scalar>("rho")),
59  Cp_(dict.lookup<scalar>("Cp")),
60  kappa_
61  (
62  dict.found("K")
63  ? dict.lookup<scalar>("K")
64  : dict.lookup<scalar>("kappa")
65  ),
66  Hf_(dict.lookup<scalar>("Hf")),
67  emissivity_(dict.lookup<scalar>("emissivity"))
68 {}
69 
70 
71 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
72 
74 {
75  dict.readIfPresent("rho", rho_);
76  dict.readIfPresent("Cp", Cp_);
77  dict.readIfPresent("K", kappa_);
78  dict.readIfPresent("kappa", kappa_);
79  dict.readIfPresent("Hf_", Hf_);
80  dict.readIfPresent("emissivity", emissivity_);
81 }
82 
83 
85 {
86  os << rho_ << token::SPACE
87  << Cp_ << token::SPACE
88  << kappa_ << token::SPACE
89  << Hf_ << token::SPACE
90  << emissivity_;
91 }
92 
93 
94 // * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
95 
97 {
98  s.write(os);
99  return os;
100 }
101 
102 
103 // ************************************************************************* //
solidProperties(scalar rho, scalar Cp, scalar kappa, scalar Hf, scalar emissivity)
Construct from components.
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
virtual void write(Ostream &os) const
Write the solidProperties properties.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().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))
stressControl lookup("compactNormalStress") >> compactNormalStress
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
void readIfPresent(const dictionary &dict)
Read and set the properties present it the given dictionary.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
defineTypeNameAndDebug(combustionModel, 0)
The thermophysical properties of a solid.
Ostream & operator<<(Ostream &, const ensightPart &)
bool found
Namespace for OpenFOAM.