[0D] Remove legacy wall methods

This commit is contained in:
Ingmar Schoegl 2024-03-29 22:34:56 -05:00 committed by Ray Speth
parent 0c89553977
commit cb2be38dc8
5 changed files with 0 additions and 114 deletions

View File

@ -63,11 +63,7 @@ extern "C" {
CANTERA_CAPI int wall_new(const char* type);
CANTERA_CAPI int wall_del(int i);
CANTERA_CAPI int wall_install(int i, int n, int m);
//! @deprecated Only used by traditional MATLAB toolbox
CANTERA_CAPI double wall_vdot(int i, double t);
CANTERA_CAPI double wall_expansionRate(int i);
//! @deprecated Only used by traditional MATLAB toolbox
CANTERA_CAPI double wall_Q(int i, double t);
CANTERA_CAPI double wall_heatRate(int i);
CANTERA_CAPI double wall_area(int i);
CANTERA_CAPI int wall_setArea(int i, double v);

View File

@ -33,18 +33,6 @@ public:
return "WallBase";
}
//! Rate of volume change (m^3/s) for the adjacent reactors.
/*!
* This method is called by Reactor::evalWalls(). Base class method
* does nothing (that is, constant volume), but may be overloaded.
* @deprecated Still used by traditional MATLAB toolbox; replaceable by expansionRate.
*/
virtual double vdot(double t) {
warn_deprecated("WallBase::vdot",
"To be removed; replaceable by 'expansionRate'.");
return 0.0;
}
//! Rate of volume change (m^3/s) for the adjacent reactors at current reactor
//! network time.
/*!
@ -56,18 +44,6 @@ public:
return 0.0;
}
//! Heat flow rate through the wall (W).
/*!
* This method is called by Reactor::evalWalls(). Base class method
* does nothing (that is, an adiabatic wall), but may be overloaded.
* @deprecated Still used by traditional MATLAB toolbox; replaceable by heatRate.
*/
virtual double Q(double t) {
warn_deprecated("WallBase::Q",
"To be removed; replaceable by 'heatRate'.");
return 0.0;
}
//! Heat flow rate through the wall (W) at current reactor network time.
/*!
* This method is called by Reactor::evalWalls(). Base class method
@ -153,21 +129,6 @@ public:
}
}
//! Rate of volume change (m^3/s) for the adjacent reactors.
/*!
* The volume rate of change is given by
* @f[
* \dot V = K A (P_{left} - P_{right}) + F(t)
* @f]
* where *K* is the specified expansion rate coefficient, *A* is the wall
* area, and *F(t)* is a specified function of time. Positive values for
* `vdot` correspond to increases in the volume of reactor on left, and
* decreases in the volume of the reactor on the right.
* @deprecated Still used by traditional MATLAB toolbox; replaceable by
* expansionRate.
*/
double vdot(double t) override;
//! Rate of volume change (m^3/s) for the adjacent reactors.
/*!
* The volume rate of change is given by
@ -191,19 +152,6 @@ public:
m_qf = q;
}
//! Heat flow rate through the wall (W).
/*!
* The heat flux is given by
* @f[
* Q = h A (T_{left} - T_{right}) + A G(t)
* @f]
* where *h* is the heat transfer coefficient, *A* is the wall area, and
* *G(t)* is a specified function of time. Positive values denote a flux
* from left to right.
* @deprecated Still used by traditional MATLAB toolbox; replaceable by heatRate.
*/
double Q(double t) override;
//! Heat flow rate through the wall (W).
/*!
* The heat flux is given by

View File

@ -494,15 +494,6 @@ extern "C" {
}
}
double wall_vdot(int i, double t)
{
try {
return WallCabinet::item(i).vdot(t);
} catch (...) {
return handleAllExceptions(DERR, DERR);
}
}
double wall_expansionRate(int i)
{
try {
@ -512,15 +503,6 @@ extern "C" {
}
}
double wall_Q(int i, double t)
{
try {
return WallCabinet::item(i).Q(t);
} catch (...) {
return handleAllExceptions(DERR, DERR);
}
}
double wall_heatRate(int i)
{
try {

View File

@ -34,21 +34,6 @@ double Wall::velocity() const {
return 0.;
}
double Wall::vdot(double t)
{
warn_deprecated("Wall::vdot", "To be removed; replaceable by 'expansionRate'.");
if (!ready()) {
throw CanteraError("Wall::vdot",
"Wall is not ready; some parameters have not been set.");
}
double rate = m_k * m_area * (m_left->pressure() - m_right->pressure());
if (m_vf) {
rate += m_area * m_vf->eval(t);
}
return rate;
}
double Wall::expansionRate()
{
if (!ready()) {
@ -70,27 +55,6 @@ double Wall::heatFlux() const {
return 0.;
}
double Wall::Q(double t)
{
warn_deprecated("Wall::Q", "To be removed; replaceable by 'heatRate'.");
if (!ready()) {
throw CanteraError("Wall::Q",
"Wall is not ready; some parameters have not been set.");
}
double q1 = (m_area * m_rrth) *
(m_left->temperature() - m_right->temperature());
if (m_emiss > 0.0) {
double tl = m_left->temperature();
double tr = m_right->temperature();
q1 += m_emiss * m_area * StefanBoltz * (tl*tl*tl*tl - tr*tr*tr*tr);
}
if (m_qf) {
q1 += m_area * m_qf->eval(t);
}
return q1;
}
double Wall::heatRate()
{
if (!ready()) {

View File

@ -48,10 +48,6 @@ TEST(zerodim, test_guards)
Wall wall;
EXPECT_THROW(wall.heatRate(), CanteraError);
EXPECT_THROW(wall.expansionRate(), CanteraError);
suppress_deprecation_warnings();
EXPECT_THROW(wall.Q(0.), CanteraError);
EXPECT_THROW(wall.vdot(0.), CanteraError);
make_deprecation_warnings_fatal();
// FlowDevice with no adjacent reactors
EXPECT_THROW(FlowDevice().massFlowRate(), CanteraError);