MichaelisMentenReactionRateI.H
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) 2018-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 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
27 
29 (
30  const speciesTable& st,
31  const dictionary& dict
32 )
33 :
34  species_(st),
35  Vmax_(dict.lookup<scalar>("Vmax")),
36  Km_(dict.lookup<scalar>("Km")),
37  s_(st[dict.lookup("S")])
38 {
39  beta_.append(Tuple2<label, scalar>(s_, 1.0));
40 }
41 
42 
43 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
44 
45 inline Foam::scalar Foam::MichaelisMentenReactionRate::operator()
46 (
47  const scalar p,
48  const scalar T,
49  const scalarField& c,
50  const label li
51 ) const
52 {
53  return Vmax_/(Km_ + c[s_]);
54 }
55 
56 
58 (
59  const scalar p,
60  const scalar T,
61  const scalarField& c,
62  const label li
63 ) const
64 {
65  return 0;
66 }
67 
68 
71 {
72  return beta_;
73 }
74 
75 
77 (
78  const scalar p,
79  const scalar T,
80  const scalarField& c,
81  const label li,
82  scalarField& dcidc
83 ) const
84 {
85  dcidc[0] = -1.0/(Km_ + c[s_]);
86 }
87 
88 
90 (
91  const scalar p,
92  const scalar T,
93  const scalarField& c,
94  const label li
95 ) const
96 {
97  return 0;
98 }
99 
100 
102 {
103  writeEntry(os, "Vmax", Vmax_);
104  writeEntry(os, "Km", Km_);
105  writeEntry(os, "S", species_[s_]);
106 }
107 
108 
109 inline Foam::Ostream& Foam::operator<<
110 (
111  Ostream& os,
112  const MichaelisMentenReactionRate& mmrr
113 )
114 {
115  mmrr.write(os);
116  return os;
117 }
118 
119 
120 // ************************************************************************* //
virtual Ostream & write(const char)=0
Write character.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
A 2-tuple for storing two objects of different types.
Definition: HashTable.H:65
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
scalar dcidT(const scalar p, const scalar T, const scalarField &c, const label li) const
Temperature derivative of the pressure dependent term.
Michaelis-Menten reaction rate for enzymatic reactions.
const dimensionedScalar & c
Speed of light in a vacuum.
void dcidc(const scalar p, const scalar T, const scalarField &c, const label li, scalarField &dcidc) const
Species concentration derivative of the pressure dependent term.
const List< Tuple2< label, scalar > > & beta() const
Third-body efficiencies (beta = 1-alpha)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition: HashTableIO.C:96
const volScalarField & T
void write(Ostream &os) const
Write to stream.
scalar ddT(const scalar p, const scalar T, const scalarField &c, const label li) const
A wordList with hashed indices for faster lookup by name.
MichaelisMentenReactionRate(const speciesTable &species, const dictionary &dict)
Construct from dictionary.
volScalarField & p
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Definition: dictionary.C:812