solidProperties.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  Copyright (C) 2018-2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "solidProperties.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35  defineTypeNameAndDebug(solidProperties, 0);
36  defineRunTimeSelectionTable(solidProperties,);
37  defineRunTimeSelectionTable(solidProperties, dictionary);
38 }
39 
40 
41 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42 
44 (
45  scalar rho,
46  scalar Cp,
47  scalar kappa,
48  scalar Hf,
49  scalar emissivity,
50  scalar W
51 )
52 :
53  rho_(rho),
54  Cp_(Cp),
55  kappa_(kappa),
56  Hf_(Hf),
57  emissivity_(emissivity),
58  W_(W)
59 {}
60 
61 
63 :
64  rho_(dict.get<scalar>("rho")),
65  Cp_(dict.get<scalar>("Cp")),
66  kappa_(dict.getCompat<scalar>("kappa", {{"K", 1612}})),
67  Hf_(dict.get<scalar>("Hf")),
68  emissivity_(dict.get<scalar>("emissivity")),
69  W_(dict.get<scalar>("W"))
70 {}
71 
72 
73 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
74 
76 {
77  dict.readIfPresent("rho", rho_);
78  dict.readIfPresent("Cp", Cp_);
79  dict.readIfPresentCompat("kappa", {{"K", 1612}}, kappa_);
80  dict.readIfPresent("Hf_", Hf_);
81  dict.readIfPresent("emissivity", emissivity_);
82  dict.readIfPresent("W", W_);
83 }
84 
85 
87 {
88  os << rho_ << token::SPACE
89  << Cp_ << token::SPACE
90  << kappa_ << token::SPACE
91  << Hf_ << token::SPACE
92  << emissivity_ << token::SPACE
93  << W_;
94 }
95 
96 
97 // * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
98 
100 {
101  s.writeData(os);
102  return os;
103 }
104 
105 
106 // ************************************************************************* //
s
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))
Definition: gmvOutputSpray.H:25
Foam::solidProperties::writeData
virtual void writeData(Ostream &os) const
Write the solidProperties properties.
Definition: solidProperties.C:86
Foam::defineRunTimeSelectionTable
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
Foam::solidProperties
The thermophysical properties of a solid.
Definition: solidProperties.H:54
Foam::solidProperties::solidProperties
solidProperties(scalar rho, scalar Cp, scalar kappa, scalar Hf, scalar emissivity, scalar W)
Construct from components.
Definition: solidProperties.C:44
Foam::dictionary::get
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionaryTemplates.C:81
Foam::constant::electromagnetic::kappa
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
rho
rho
Definition: readInitialConditions.H:96
Foam::solidProperties::readIfPresent
void readIfPresent(const dictionary &dict)
Read and set the properties if present in the given dictionary.
Definition: solidProperties.C:75
Foam::dictionary::readIfPresentCompat
bool readIfPresentCompat(const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, T &val, enum keyType::option=keyType::REGEX) const
Definition: dictionaryTemplates.C:485
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::token::SPACE
Space [isspace].
Definition: token.H:112
Cp
const volScalarField & Cp
Definition: EEqn.H:7
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
solidProperties.H
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &)
Definition: boundaryPatch.C:102
Foam::dictionary::readIfPresent
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionaryTemplates.C:417