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-2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
33namespace Foam
34{
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 scalar nu,
52 scalar E
53)
54:
55 rho_(rho),
56 Cp_(Cp),
57 kappa_(kappa),
58 Hf_(Hf),
59 emissivity_(emissivity),
60 W_(W),
61 nu_(nu),
62 E_(E)
63{}
64
65
67:
68 rho_(dict.get<scalar>("rho")),
69 Cp_(dict.get<scalar>("Cp")),
70 kappa_(dict.getCompat<scalar>("kappa", {{"K", 1612}})),
71 Hf_(dict.get<scalar>("Hf")),
72 emissivity_(dict.get<scalar>("emissivity")),
73 W_(dict.get<scalar>("W")),
74 nu_(dict.getOrDefault<scalar>("nu", 0.0)),
75 E_(dict.getOrDefault<scalar>("E", 0.0))
76{}
77
78
79// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
80
82{
83 dict.readIfPresent("rho", rho_);
84 dict.readIfPresent("Cp", Cp_);
85 dict.readIfPresentCompat("kappa", {{"K", 1612}}, kappa_);
86 dict.readIfPresent("Hf", Hf_);
87 dict.readIfPresent("emissivity", emissivity_);
88 dict.readIfPresent("W", W_);
89 dict.readIfPresent("nu", nu_);
90 dict.readIfPresent("E", E_);
91}
92
93
95{
96 os << rho_ << token::SPACE
97 << Cp_ << token::SPACE
98 << kappa_ << token::SPACE
99 << Hf_ << token::SPACE
100 << emissivity_ << token::SPACE
101 << W_ << token::SPACE
102 << nu_ << token::SPACE
103 << E_;
104}
105
106
107// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
108
110{
111 s.writeData(os);
112 return os;
113}
114
115
116// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
bool readIfPresentCompat(const word &keyword, std::initializer_list< std::pair< const char *, int > > compat, T &val, enum keyType::option matchOpt=keyType::REGEX) const
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
The thermophysical properties of a solid.
virtual void writeData(Ostream &os) const
Write the solidProperties properties.
void readIfPresent(const dictionary &dict)
Read and set the properties if present in the given dictionary.
@ SPACE
Space [isspace].
Definition: token.H:125
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
const volScalarField & Cp
Definition: EEqn.H:7
OBJstream os(runTime.globalPath()/outputName)
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))
Namespace for OpenFOAM.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
volScalarField & nu
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.
dictionary dict