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-2023 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 {
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_(dict.lookupBackwardsCompatible<scalar>({"kappa", "K"})),
61  hf_(dict.lookupBackwardsCompatible<scalar>({"hf", "Hf"})),
62  emissivity_(dict.lookup<scalar>("emissivity"))
63 {}
64 
65 
66 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
67 
69 {
70  dict.readIfPresent("rho", rho_);
71  dict.readIfPresent("Cp", Cp_);
72  dict.readIfPresent("K", kappa_);
73  dict.readIfPresent("kappa", kappa_);
74  dict.readIfPresent("hf", hf_);
75  dict.readIfPresent("emissivity", emissivity_);
76 }
77 
78 
80 {
81  os << rho_ << token::SPACE
82  << Cp_ << token::SPACE
83  << kappa_ << token::SPACE
84  << hf_ << token::SPACE
85  << emissivity_;
86 }
87 
88 
89 // * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
90 
92 {
93  s.write(os);
94  return os;
95 }
96 
97 
98 // ************************************************************************* //
scalar Cp(const scalar p, const scalar T) const
Definition: EtoHthermo.H:2
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Definition: dictionary.C:710
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
ITstream & lookupBackwardsCompatible(const wordList &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream, trying a list of keywords.
Definition: dictionary.C:721
The thermophysical properties of a solid.
virtual void write(Ostream &os) const
Write the solidProperties properties.
solidProperties(scalar rho, scalar Cp, scalar kappa, scalar hf, scalar emissivity)
Construct from components.
void readIfPresent(const dictionary &dict)
Read and set the properties present it the given dictionary.
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.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
Namespace for OpenFOAM.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
defineTypeNameAndDebug(combustionModel, 0)
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)
dictionary dict