Cantera  2.4.0
Wall.cpp
Go to the documentation of this file.
1 //! @file Wall.cpp
2 
3 // This file is part of Cantera. See License.txt in the top-level directory or
4 // at http://www.cantera.org/license.txt for license and copyright information.
5 
6 #include "cantera/zeroD/Wall.h"
11 
12 namespace Cantera
13 {
14 Wall::Wall() : m_left(0), m_right(0),
15  m_surf(2),
16  m_area(1.0), m_k(0.0), m_rrth(0.0), m_emiss(0.0),
17  m_vf(0), m_qf(0)
18 {
19 }
20 
21 bool Wall::install(ReactorBase& rleft, ReactorBase& rright)
22 {
23  // check if wall is already installed
24  if (m_left || m_right) {
25  return false;
26  }
27  m_left = &rleft;
28  m_right = &rright;
29  m_left->addWall(*this, 0);
30  m_right->addWall(*this, 1);
31  m_surf[0].setReactor(&rleft);
32  m_surf[1].setReactor(&rright);
33  return true;
34 }
35 
36 doublereal Wall::vdot(doublereal t)
37 {
38  double rate1 = m_k * m_area * (m_left->pressure() - m_right->pressure());
39  if (m_vf) {
40  rate1 += m_area * m_vf->eval(t);
41  }
42  return rate1;
43 }
44 
45 doublereal Wall::Q(doublereal t)
46 {
47  double q1 = (m_area * m_rrth) *
48  (m_left->temperature() - m_right->temperature());
49  if (m_emiss > 0.0) {
50  double tl = m_left->temperature();
51  double tr = m_right->temperature();
52  q1 += m_emiss * m_area * StefanBoltz * (tl*tl*tl*tl - tr*tr*tr*tr);
53  }
54  if (m_qf) {
55  q1 += m_area * m_qf->eval(t);
56  }
57  return q1;
58 }
59 
60 }
Header for a simple thermodynamics model of a surface phase derived from ThermoPhase, assuming an ideal solution model (see Thermodynamic Properties and class SurfPhase).
Header file for class Wall.
const doublereal StefanBoltz
Stefan-Boltzmann constant.
Definition: ct_defs.h:85
virtual doublereal Q(doublereal t)
Heat flow rate through the wall (W).
Definition: Wall.cpp:45
bool install(ReactorBase &leftReactor, ReactorBase &rightReactor)
Install the wall between two reactors or reservoirs.
Definition: Wall.cpp:21
virtual doublereal eval(doublereal t) const
Evaluate the function.
Definition: Func1.cpp:60
Base class for stirred reactors.
Definition: ReactorBase.h:44
void addWall(Wall &w, int lr)
Insert a Wall between this reactor and another reactor.
Definition: ReactorBase.cpp:57
doublereal pressure() const
Returns the current pressure (Pa) of the reactor.
Definition: ReactorBase.h:204
virtual doublereal vdot(doublereal t)
Rate of volume change (m^3/s) for the adjacent reactors.
Definition: Wall.cpp:36
Contains declarations for string manipulation functions within Cantera.
doublereal temperature() const
Returns the current temperature (K) of the reactor's contents.
Definition: ReactorBase.h:189
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:8