Cantera  3.0.0
Loading...
Searching...
No Matches
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
9
10namespace Cantera
11{
12
14{
15 // check if wall is already installed
16 if (m_left || m_right) {
17 return false;
18 }
19 m_left = &rleft;
20 m_right = &rright;
21 m_left->addWall(*this, 0);
22 m_right->addWall(*this, 1);
23 return true;
24}
25
26void WallBase::setArea(double a) {
27 m_area = a;
28}
29
30double Wall::velocity() const {
31 if (m_vf) {
32 return m_vf->eval(m_time);
33 }
34 return 0.;
35}
36
37double Wall::vdot(double t)
38{
39 warn_deprecated("Wall::vdot",
40 "To be removed after Cantera 3.0; replaceable by 'expansionRate'.");
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
50{
51 double rate = m_k * m_area * (m_left->pressure() - m_right->pressure());
52
53 if (m_vf) {
54 rate += m_area * m_vf->eval(m_time);
55 }
56 return rate;
57}
58
59double Wall::heatFlux() const {
60 if (m_qf) {
61 return m_qf->eval(m_time);
62 }
63 return 0.;
64}
65
66double Wall::Q(double t)
67{
68 warn_deprecated("Wall::Q",
69 "To be removed after Cantera 3.0; replaceable by 'heatRate'.");
70 double q1 = (m_area * m_rrth) *
71 (m_left->temperature() - m_right->temperature());
72 if (m_emiss > 0.0) {
73 double tl = m_left->temperature();
74 double tr = m_right->temperature();
75 q1 += m_emiss * m_area * StefanBoltz * (tl*tl*tl*tl - tr*tr*tr*tr);
76 }
77
78 if (m_qf) {
79 q1 += m_area * m_qf->eval(t);
80 }
81 return q1;
82}
83
85{
86 double q1 = (m_area * m_rrth) *
87 (m_left->temperature() - m_right->temperature());
88 if (m_emiss > 0.0) {
89 double tl = m_left->temperature();
90 double tr = m_right->temperature();
91 q1 += m_emiss * m_area * StefanBoltz * (tl*tl*tl*tl - tr*tr*tr*tr);
92 }
93
94 if (m_qf) {
95 q1 += m_area * m_qf->eval(m_time);
96 }
97 return q1;
98}
99
100}
Header file for base class WallBase.
virtual double eval(double t) const
Evaluate the function.
Definition Func1.cpp:61
Base class for stirred reactors.
Definition ReactorBase.h:50
double pressure() const
Returns the current pressure (Pa) of the reactor.
void addWall(WallBase &w, int lr)
Insert a Wall between this reactor and another reactor.
double temperature() const
Returns the current temperature (K) of the reactor's contents.
bool install(ReactorBase &leftReactor, ReactorBase &rightReactor)
Install the wall between two reactors or reservoirs.
Definition Wall.cpp:13
double m_time
current reactor network time
Definition Wall.h:123
virtual void setArea(double a)
Set the area [m^2].
Definition Wall.cpp:26
Func1 * m_vf
Velocity function.
Definition Wall.h:270
double heatFlux() const
Heat flux function evaluated at current reactor network time.
Definition Wall.cpp:59
double vdot(double t) override
Rate of volume change (m^3/s) for the adjacent reactors.
Definition Wall.cpp:37
double heatRate() override
Heat flow rate through the wall (W).
Definition Wall.cpp:84
double m_rrth
heat transfer coefficient
Definition Wall.h:264
Func1 * m_qf
Heat flux function.
Definition Wall.h:273
double m_k
expansion rate coefficient
Definition Wall.h:261
double Q(double t) override
Heat flow rate through the wall (W).
Definition Wall.cpp:66
double velocity() const
Wall velocity at current reactor network time.
Definition Wall.cpp:30
double expansionRate() override
Rate of volume change (m^3/s) for the adjacent reactors.
Definition Wall.cpp:49
double m_emiss
emissivity
Definition Wall.h:267
const double StefanBoltz
Stefan-Boltzmann constant [W/m2/K4].
Definition ct_defs.h:128
Namespace for the Cantera kernel.
Definition AnyMap.cpp:564
void warn_deprecated(const string &source, const AnyBase &node, const string &message)
A deprecation warning for syntax in an input file.
Definition AnyMap.cpp:1926
Contains declarations for string manipulation functions within Cantera.