diff --git a/include/cantera/transport/GasTransport.h b/include/cantera/transport/GasTransport.h index 4cb78e2372..705243847c 100644 --- a/include/cantera/transport/GasTransport.h +++ b/include/cantera/transport/GasTransport.h @@ -148,7 +148,7 @@ class GasTransport : public Transport double* bstar_coeffs, double* cstar_coeffs, bool actualT) override; - void init(ThermoPhase* thermo, int mode=0, int log_level=0) override; + void init(ThermoPhase* thermo, int mode=0, int log_level=-7) override; bool CKMode() const override { return m_mode == CK_Mode; @@ -541,7 +541,8 @@ class GasTransport : public Transport //! Quadrupole polarizability vector m_quad_polar; - //! Level of verbose printing during initialization + //! Level of verbose printing during initialization. + //! @deprecated To be removed after %Cantera 3.1. int m_log_level = 0; }; diff --git a/include/cantera/transport/IonGasTransport.h b/include/cantera/transport/IonGasTransport.h index d1d2114551..63c081d409 100644 --- a/include/cantera/transport/IonGasTransport.h +++ b/include/cantera/transport/IonGasTransport.h @@ -40,7 +40,7 @@ class IonGasTransport : public MixTransport return "ionized-gas"; } - void init(ThermoPhase* thermo, int mode, int log_level) override; + void init(ThermoPhase* thermo, int mode, int log_level=-7) override; //! Viscosity of the mixture (kg/m/s). //! Only Neutral species contribute to Viscosity. diff --git a/include/cantera/transport/MixTransport.h b/include/cantera/transport/MixTransport.h index a328a5b7fd..f881d050de 100644 --- a/include/cantera/transport/MixTransport.h +++ b/include/cantera/transport/MixTransport.h @@ -147,7 +147,7 @@ class MixTransport : public GasTransport size_t ldx, const double* const grad_X, size_t ldf, double* const fluxes) override; - void init(ThermoPhase* thermo, int mode=0, int log_level=0) override; + void init(ThermoPhase* thermo, int mode=0, int log_level=-7) override; protected: //! Update the temperature dependent parts of the species thermal diff --git a/include/cantera/transport/MultiTransport.h b/include/cantera/transport/MultiTransport.h index be7e5828ac..1ae2da793e 100644 --- a/include/cantera/transport/MultiTransport.h +++ b/include/cantera/transport/MultiTransport.h @@ -100,7 +100,7 @@ class MultiTransport : public GasTransport void getMassFluxes(const double* state1, const double* state2, double delta, double* fluxes) override; - void init(ThermoPhase* thermo, int mode=0, int log_level=0) override; + void init(ThermoPhase* thermo, int mode=0, int log_level=-7) override; protected: //! Update basic temperature-dependent quantities if the temperature has diff --git a/include/cantera/transport/Transport.h b/include/cantera/transport/Transport.h index 98594a3833..df03a1713b 100644 --- a/include/cantera/transport/Transport.h +++ b/include/cantera/transport/Transport.h @@ -413,8 +413,10 @@ class Transport * @param mode Chemkin compatible mode or not. This alters the * specification of the collision integrals. defaults to no. * @param log_level Defaults to zero, no logging + * @deprecated The `log_level` parameter is deprecated and will be removed after + * %Cantera 3.1. */ - virtual void init(ThermoPhase* thermo, int mode=0, int log_level=0) {} + virtual void init(ThermoPhase* thermo, int mode=0, int log_level=-7) {} //! Boolean indicating the form of the transport properties polynomial fits. //! Returns true if the Chemkin form is used. diff --git a/include/cantera/transport/TransportFactory.h b/include/cantera/transport/TransportFactory.h index 5ed5f406ab..a4dcff2d94 100644 --- a/include/cantera/transport/TransportFactory.h +++ b/include/cantera/transport/TransportFactory.h @@ -54,16 +54,22 @@ class TransportFactory : public Factory * @param model String name for the transport manager * @param thermo ThermoPhase object * @param log_level log level + * + * @deprecated The `log_level` parameter is deprecated and will be removed after + * %Cantera 3.1. */ - Transport* newTransport(const string& model, ThermoPhase* thermo, int log_level=0); + Transport* newTransport(const string& model, ThermoPhase* thermo, int log_level=-7); //! Build a new transport manager using the default transport manager //! in the phase description and return a base class pointer to it /*! * @param thermo ThermoPhase object * @param log_level log level + * + * @deprecated The `log_level` parameter is deprecated and will be removed after + * %Cantera 3.1. */ - Transport* newTransport(ThermoPhase* thermo, int log_level=0); + Transport* newTransport(ThermoPhase* thermo, int log_level=-7); private: //! Static instance of the factor -> This is the only instance of this diff --git a/include/cantera/transport/WaterTransport.h b/include/cantera/transport/WaterTransport.h index 74b17c1f77..d5f3ebde95 100644 --- a/include/cantera/transport/WaterTransport.h +++ b/include/cantera/transport/WaterTransport.h @@ -57,7 +57,7 @@ class WaterTransport : public Transport */ double thermalConductivity() override; - void init(ThermoPhase* thermo, int mode=0, int log_level=0) override; + void init(ThermoPhase* thermo, int mode=0, int log_level=-7) override; }; } #endif diff --git a/src/transport/GasTransport.cpp b/src/transport/GasTransport.cpp index ab13ea5e77..ca6bc9c7bd 100644 --- a/src/transport/GasTransport.cpp +++ b/src/transport/GasTransport.cpp @@ -29,7 +29,7 @@ void GasTransport::update_T() { if (m_thermo->nSpecies() != m_nsp) { // Rebuild data structures if number of species has changed - init(m_thermo, m_mode, m_log_level); + init(m_thermo, m_mode, m_log_level != 0 ? m_log_level : -7); } double T = m_thermo->temperature(); @@ -263,6 +263,12 @@ void GasTransport::init(ThermoPhase* thermo, int mode, int log_level) m_thermo = thermo; m_nsp = m_thermo->nSpecies(); m_mode = mode; + if (log_level == -7) { + log_level = 0; + } else { + warn_deprecated("Transport::init", "The log_level parameter " + "is deprecated and will be removed after Cantera 3.1."); + } m_log_level = log_level; // set up Monchick and Mason collision integrals @@ -372,7 +378,7 @@ void GasTransport::setupCollisionIntegral() // initialize the collision integral calculator for the desired T* range debuglog("*** collision_integrals ***\n", m_log_level); MMCollisionInt integrals; - integrals.init(tstar_min, tstar_max, m_log_level); + integrals.init(tstar_min, tstar_max, m_log_level != 0 ? m_log_level : -7); fitCollisionIntegrals(integrals); debuglog("*** end of collision_integrals ***\n", m_log_level); // make polynomial fits diff --git a/src/transport/IonGasTransport.cpp b/src/transport/IonGasTransport.cpp index 3cd12608e9..5867cd870a 100644 --- a/src/transport/IonGasTransport.cpp +++ b/src/transport/IonGasTransport.cpp @@ -23,6 +23,12 @@ void IonGasTransport::init(ThermoPhase* thermo, int mode, int log_level) throw CanteraError("IonGasTransport::init", "mode = CK_Mode, which is an outdated lower-order fit."); } + if (log_level == -7) { + log_level = 0; + } else { + warn_deprecated("Transport::init", "The log_level parameter " + "is deprecated and will be removed after Cantera 3.1."); + } m_log_level = log_level; // make a local copy of species charge for (size_t k = 0; k < m_nsp; k++) { diff --git a/src/transport/MMCollisionInt.cpp b/src/transport/MMCollisionInt.cpp index 90b421b947..ae4a21a38d 100644 --- a/src/transport/MMCollisionInt.cpp +++ b/src/transport/MMCollisionInt.cpp @@ -215,6 +215,12 @@ double MMCollisionInt::cstar_table[39*8] = { void MMCollisionInt::init(double tsmin, double tsmax, int log_level) { + if (log_level == -7) { + log_level = 0; + } else { + warn_deprecated("MMCollisionInt::init", "The log_level parameter " + "is deprecated and will be removed after Cantera 3.1."); + } m_loglevel = log_level; debuglog("Collision Integral Polynomial Fits\n", m_loglevel > 0); m_nmin = -1; diff --git a/src/transport/MMCollisionInt.h b/src/transport/MMCollisionInt.h index 6fd2323a99..00f87bfe18 100644 --- a/src/transport/MMCollisionInt.h +++ b/src/transport/MMCollisionInt.h @@ -33,8 +33,10 @@ class MMCollisionInt * @param tsmax Maximum value of Tstar to carry out the fitting * @param loglevel Set the loglevel for the object. The default * loglevel is zero, indicating no output. + * @deprecated The `log_level` parameter is deprecated and will be removed after + * %Cantera 3.1. */ - void init(double tsmin, double tsmax, int loglevel = 0); + void init(double tsmin, double tsmax, int loglevel = -7); double omega22(double ts, double deltastar); double astar(double ts, double deltastar); diff --git a/src/transport/TransportFactory.cpp b/src/transport/TransportFactory.cpp index f721ca08e0..2589697261 100644 --- a/src/transport/TransportFactory.cpp +++ b/src/transport/TransportFactory.cpp @@ -68,6 +68,10 @@ void TransportFactory::deleteFactory() Transport* TransportFactory::newTransport(const string& transportModel, ThermoPhase* phase, int log_level) { + if (log_level != -7) { + warn_deprecated("TransportFactory::newTransport", "The log_level parameter " + "is deprecated and will be removed after Cantera 3.1."); + } if (transportModel != "DustyGas" && canonicalize(transportModel) == "none") { return create(transportModel); } @@ -98,6 +102,10 @@ Transport* TransportFactory::newTransport(const string& transportModel, Transport* TransportFactory::newTransport(ThermoPhase* phase, int log_level) { + if (log_level != -7) { + warn_deprecated("TransportFactory::newTransport", "The log_level parameter " + "is deprecated and will be removed after Cantera 3.1."); + } string transportModel = "none"; AnyMap& input = phase->input(); if (input.hasKey("transport")) { @@ -110,9 +118,9 @@ shared_ptr newTransport(shared_ptr thermo, const string& { Transport* tr; if (model == "default") { - tr = TransportFactory::factory()->newTransport(thermo.get(), 0); + tr = TransportFactory::factory()->newTransport(thermo.get()); } else { - tr = TransportFactory::factory()->newTransport(model, thermo.get(), 0); + tr = TransportFactory::factory()->newTransport(model, thermo.get()); } return shared_ptr(tr); } diff --git a/src/transport/WaterTransport.cpp b/src/transport/WaterTransport.cpp index 2c81e153e5..160ee5661e 100644 --- a/src/transport/WaterTransport.cpp +++ b/src/transport/WaterTransport.cpp @@ -7,6 +7,7 @@ #include "cantera/thermo/VPStandardStateTP.h" #include "cantera/thermo/PDSS_Water.h" #include "cantera/thermo/WaterSSTP.h" +#include "cantera/base/global.h" namespace { @@ -32,6 +33,10 @@ namespace Cantera void WaterTransport::init(ThermoPhase* thermo, int mode, int log_level) { + if (log_level != -7) { + warn_deprecated("Transport::init", "The log_level parameter " + "is deprecated and will be removed after Cantera 3.1."); + } m_thermo = thermo; }