Loading...
Searching...
No Matches
solidIsothermalReactionRateI.H
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) 2021-2022 OpenCFD Ltd.
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
28// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29
31(
32 const scalar C,
33 const scalar Cp,
34 const scalar Tpc,
35 const scalar Elat
36)
37:
38 C_(C),
39 Cp_(Cp),
40 Tpc_(Tpc),
41 Elat_(Elat)
42{}
43
44
46(
47 const speciesTable&,
48 const dictionary& dict
49)
50:
51 C_(dict.get<scalar>("C")),
52 Cp_(dict.get<scalar>("Cp")),
53 Tpc_(dict.get<scalar>("Tpc")),
54 Elat_(dict.get<scalar>("Elat"))
55{}
56
57
58// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
59
60inline Foam::scalar Foam::solidIsothermalReactionRate::operator()
61(
62 const scalar,
63 const scalar T,
64 const scalarField&
65) const
66{
67 if (T < Tpc_)
68 {
69 return 0;
70 }
71
72 return -C_*Cp_*(T - Tpc_)/Elat_;
73}
74
75
76inline void Foam::solidIsothermalReactionRate::write(Ostream& os) const
77{
78 os.writeEntry("C", C_);
79 os.writeEntry("Cp", Cp_);
80 os.writeEntry("Tpc", Tpc_);
81 os.writeEntry("Elat", Elat_);
82}
83
84
85inline Foam::Ostream& Foam::operator<<
86(
87 Ostream& os,
88 const solidIsothermalReactionRate& iso
89)
90{
91 iso.write(os);
92 return os;
93}
94
95
96// ************************************************************************* //
Graphite solid properties.
Definition C.H:49
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Isothermal reaction rate for solids.
solidIsothermalReactionRate(const scalar C, const scalar Cp, const scalar Tpc, const scalar Elat)
Construct from components.
void write(Ostream &os) const
Write to stream.
const volScalarField & Cp
Definition EEqn.H:7
OBJstream os(runTime.globalPath()/outputName)
hashedWordList speciesTable
A table of species as a hashedWordList.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
dictionary dict