Cantera 2.6.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 https://cantera.org/license.txt for license and copyright information.
5
10
11namespace Cantera
12{
13
14WallBase::WallBase() : m_left(0), m_right(0), m_surf(2), m_area(1.0) {}
15
16bool WallBase::install(ReactorBase& rleft, ReactorBase& rright)
17{
18 // check if wall is already installed
19 if (m_left || m_right) {
20 return false;
21 }
22 m_left = &rleft;
23 m_right = &rright;
24 m_left->addWall(*this, 0);
25 m_right->addWall(*this, 1);
26 m_surf[0].setReactor(&rleft);
27 m_surf[1].setReactor(&rright);
28 return true;
29}
30
31void WallBase::setArea(double a) {
32 m_area = a;
33 m_surf[0].setArea(a);
34 m_surf[1].setArea(a);
35}
36
37Wall::Wall() : WallBase(), m_k(0.0), m_rrth(0.0), m_emiss(0.0), m_vf(0), m_qf(0) {}
38
39double Wall::vdot(double t)
40{
41 double rate = m_k * m_area * (m_left->pressure() - m_right->pressure());
42
43 if (m_vf) {
44 rate += m_area * m_vf->eval(t);
45 }
46 return rate;
47}
48
49double Wall::Q(double t)
50{
51 double q1 = (m_area * m_rrth) *
52 (m_left->temperature() - m_right->temperature());
53 if (m_emiss > 0.0) {
54 double tl = m_left->temperature();
55 double tr = m_right->temperature();
56 q1 += m_emiss * m_area * StefanBoltz * (tl*tl*tl*tl - tr*tr*tr*tr);
57 }
58
59 if (m_qf) {
60 q1 += m_area * m_qf->eval(t);
61 }
62 return q1;
63}
64
65}
Header for a simple thermodynamics model of a surface phase derived from ThermoPhase,...
Header file for base class WallBase.
virtual doublereal eval(doublereal t) const
Evaluate the function.
Definition: Func1.cpp:60
Base class for stirred reactors.
Definition: ReactorBase.h:49
doublereal pressure() const
Returns the current pressure (Pa) of the reactor.
Definition: ReactorBase.h:228
void addWall(WallBase &w, int lr)
Insert a Wall between this reactor and another reactor.
Definition: ReactorBase.cpp:58
doublereal temperature() const
Returns the current temperature (K) of the reactor's contents.
Definition: ReactorBase.h:213
Base class for 'walls' (walls, pistons, etc.) connecting reactors.
Definition: Wall.h:25
Func1 * m_vf
Velocity function.
Definition: Wall.h:198
double m_rrth
heat transfer coefficient
Definition: Wall.h:192
Func1 * m_qf
Heat flux function.
Definition: Wall.h:201
double m_k
expansion rate coefficient
Definition: Wall.h:189
double m_emiss
emissivity
Definition: Wall.h:195
virtual double Q(double t)
Heat flow rate through the wall (W).
Definition: Wall.cpp:49
virtual double vdot(double t)
Rate of volume change (m^3/s) for the adjacent reactors.
Definition: Wall.cpp:39
Namespace for the Cantera kernel.
Definition: AnyMap.h:29
const double StefanBoltz
Stefan-Boltzmann constant [W/m2/K4].
Definition: ct_defs.h:125
Contains declarations for string manipulation functions within Cantera.